先提交一波

This commit is contained in:
aixianling
2022-09-02 18:17:08 +08:00
parent 46c2872740
commit 76676d43fb
2 changed files with 37 additions and 11 deletions

View File

@@ -10,7 +10,7 @@
</div> </div>
<div class="bottom" flex> <div class="bottom" flex>
<div class="fill" v-text="user.girdName"/> <div class="fill" v-text="user.girdName"/>
<div class="signBtn" :class="{signIn}" v-text="signBtn" @click="handleSignIn"/> <div class="signBtn" :class="{signIn}" v-text="signBtn" @click="$u.debounce(handleSignIn,500)"/>
</div> </div>
</div> </div>
<div class="link" v-for="(item, index) in linkList" :key="index" @click="linkTo(item.linkUrl)"> <div class="link" v-for="(item, index) in linkList" :key="index" @click="linkTo(item.linkUrl)">
@@ -47,18 +47,33 @@ export default {
} }
}, },
methods: { methods: {
getMyGrid() { getMySignStatus() {
this.$http.post("/app/appgirdmemberinfo/checkLogOnUser").then(res => {
if (res?.data) {
this.signIn = res.data.isSign == 1
}
})
}, },
linkTo(url) { linkTo(url) {
uni.navigateTo({url}) uni.navigateTo({url})
}, },
handleSignIn() { handleSignIn() {
!this.signIn && this.linkTo("./signResult") !this.signIn && wx.getLocation({
success: res => {
const {latitude: lat, longitude: lng} = res
this.$http.post('/app/appdvcpconfig/apiForward', `https://apis.map.qq.com/ws/geocoder/v1/?location=${lat},${lng}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`)
.then(({data: {result: {address}}}) => this.$http.post("/app/appwxsigninfo/sign", {lat, lng, address}))
.then(res => {
if (res?.code == 0) {
this.linkTo("./signResult")
}
})
}
})
} }
}, },
created() { created() {
this.getMyGrid() this.getMySignStatus()
} }
} }
</script> </script>

View File

@@ -2,9 +2,10 @@
<section class="signResult"> <section class="signResult">
<div class="successImg"/> <div class="successImg"/>
<b class="mar-t32">今日已完成签到</b> <b class="mar-t32">今日已完成签到</b>
<div class="mar-t32 score">积分+5</div> <div v-if="result.score" class="mar-t32 score mar-b112">积分+5</div>
<AiItem label="时间" :border="false">2022-9-2 16:59:23</AiItem> <u-gap v-else class="mar-t32 mar-b112" height="32"/>
<AiItem label="位置" :border="false">张家湾小区</AiItem> <AiItem label="时间" :border="false">{{ result.createTime }}</AiItem>
<AiItem label="位置" :border="false">{{ result.address }}</AiItem>
</section> </section>
</template> </template>
@@ -13,10 +14,17 @@ export default {
name: "signResult", name: "signResult",
appName: "签到结果", appName: "签到结果",
data() { data() {
return {} return {
result: {}
}
},
methods: {
getResult() {
}
}, },
methods: {},
created() { created() {
this.getResult()
} }
} }
</script> </script>
@@ -43,13 +51,16 @@ export default {
.score { .score {
color: #3975C6; color: #3975C6;
height: 32px; height: 32px;
margin-bottom: 112px;
padding-left: 48px; padding-left: 48px;
background-image: url("./assets/score.png"); background-image: url("./assets/score.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: left center; background-position: left center;
} }
.mar-b112 {
margin-bottom: 112px;
}
::v-deep.normal { ::v-deep.normal {
height: 56px; height: 56px;
} }