先提交网格员积分签到
This commit is contained in:
@@ -26,7 +26,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {mapState} from "vuex"
|
import {mapState, mapActions} from "vuex"
|
||||||
|
import qs from "query-string"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AppMyGrid",
|
name: "AppMyGrid",
|
||||||
@@ -34,11 +35,11 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapState(['user']),
|
...mapState(['user']),
|
||||||
isGridMember: v => v.user.girdCheckType > 0,
|
isGridMember: v => v.user.girdCheckType > 0,
|
||||||
|
signIn: v => v.user.gridExtra.isSign == 1,
|
||||||
signBtn: v => v.signIn ? '已签到' : '签到'
|
signBtn: v => v.signIn ? '已签到' : '签到'
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
signIn: false,
|
|
||||||
linkList: [
|
linkList: [
|
||||||
{title: '我的积分', img: require('./assets/wdjf.png'), linkUrl: '../AppCreditPoints/AppGridIntegral'},
|
{title: '我的积分', img: require('./assets/wdjf.png'), linkUrl: '../AppCreditPoints/AppGridIntegral'},
|
||||||
{title: '积分兑换', img: require('./assets/jfdh.png'), linkUrl: '../AppCreditPoints/AppGridIntegral'},
|
{title: '积分兑换', img: require('./assets/jfdh.png'), linkUrl: '../AppCreditPoints/AppGridIntegral'},
|
||||||
@@ -47,13 +48,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getMySignStatus() {
|
...mapActions(['getGridInfo']),
|
||||||
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})
|
||||||
},
|
},
|
||||||
@@ -61,19 +56,28 @@ export default {
|
|||||||
!this.signIn && wx.getLocation({
|
!this.signIn && wx.getLocation({
|
||||||
success: res => {
|
success: res => {
|
||||||
const {latitude: lat, longitude: lng} = 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`)
|
if (!!lat && !!lng) {
|
||||||
|
this.$http.post('/app/appdvcpconfig/apiForward', qs.stringifyUrl({
|
||||||
|
url: "https://apis.map.qq.com/ws/geocoder/v1/?get_poi=1",
|
||||||
|
query: {
|
||||||
|
location: [lat, lng].toString(),
|
||||||
|
key: "3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY",
|
||||||
|
}
|
||||||
|
}))
|
||||||
.then(({data: {result: {address}}}) => this.$http.post("/app/appwxsigninfo/sign", {lat, lng, address}))
|
.then(({data: {result: {address}}}) => this.$http.post("/app/appwxsigninfo/sign", {lat, lng, address}))
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res?.code == 0) {
|
if (res?.code == 0) {
|
||||||
this.linkTo("./signResult")
|
this.linkTo("./signResult")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else this.$u.toast("无法获取到定位!")
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getMySignStatus()
|
this.getGridInfo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<section class="signResult">
|
<section class="signResult">
|
||||||
<div class="successImg"/>
|
<div class="successImg"/>
|
||||||
<b class="mar-t32">今日已完成签到</b>
|
<b class="mar-t32">今日已完成签到</b>
|
||||||
<div v-if="result.score" class="mar-t32 score mar-b112">积分+5</div>
|
<div v-if="result.score>0" class="mar-t32 score mar-b112">积分{{ result.score }}</div>
|
||||||
<u-gap v-else class="mar-t32 mar-b112" height="32"/>
|
<u-gap v-else class="mar-t32 mar-b112" height="32"/>
|
||||||
<AiItem label="时间" :border="false">{{ result.createTime }}</AiItem>
|
<AiItem label="时间" :border="false">{{ result.createTime }}</AiItem>
|
||||||
<AiItem label="位置" :border="false">{{ result.address }}</AiItem>
|
<AiItem label="位置" :border="false">{{ result.address }}</AiItem>
|
||||||
|
|||||||
@@ -149,8 +149,9 @@ export const user = {
|
|||||||
//获取登录着网格员信息
|
//获取登录着网格员信息
|
||||||
return http.post("/app/appgirdmemberinfo/checkLogOnUser", null, config).then(res => {
|
return http.post("/app/appgirdmemberinfo/checkLogOnUser", null, config).then(res => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
let {girdId, girdMemberId, girdName, checkType: girdCheckType, appGirdInfo: gridInfo} = res.data
|
let {girdId, girdMemberId, girdName, checkType: girdCheckType, appGirdInfo: gridInfo, isSign} = res.data,
|
||||||
return commit("setUser", {girdId, girdMemberId, girdName, girdCheckType, gridInfo})
|
gridExtra = {isSign}
|
||||||
|
return commit("setUser", {girdId, girdMemberId, girdName, girdCheckType, gridInfo, gridExtra})
|
||||||
}
|
}
|
||||||
}).catch(() => 0)
|
}).catch(() => 0)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user