Browse Source

对接接口

master
前端-胡立永 3 months ago
parent
commit
29ede54f58
4 changed files with 73 additions and 12 deletions
  1. +1
    -1
      pages/index/index.vue
  2. +13
    -6
      pages/subPack/autonym/autonym.vue
  3. +55
    -5
      pages/subPack/human/human.vue
  4. +4
    -0
      store/store.js

+ 1
- 1
pages/index/index.vue View File

@ -19,7 +19,7 @@
<map style="width: 100%; height: 100%" <map style="width: 100%; height: 100%"
:latitude="latitude" :latitude="latitude"
:longitude="longitude" :longitude="longitude"
:markers="covers" :scale="18">
:markers="covers" :scale="13">
</map> </map>
</view> </view>
</view> </view>


+ 13
- 6
pages/subPack/autonym/autonym.vue View File

@ -56,13 +56,20 @@
return return
} }
this.$api('authApply', this.form, res => {
if(res.code == 200){
uni.reLaunch({
url: '/pages/index/index'
})
}
this.$store.commit('setAuthInfo', this.form)
uni.navigateTo({
url: '/pages/subPack/human/human?type=auth'
}) })
//
// this.$api('authApply', this.form, res => {
// if(res.code == 200){
// uni.reLaunch({
// url: '/pages/index/index'
// })
// }
// })
}, },
} }
} }


+ 55
- 5
pages/subPack/human/human.vue View File

@ -34,7 +34,7 @@
<view class="human-face-desc" <view class="human-face-desc"
v-else> v-else>
{{ tipsText }}{{ tempImg }}
{{ tipsText }}
</view> </view>
<!-- 说明 --> <!-- 说明 -->
@ -57,9 +57,17 @@
</view> </view>
<!-- 实名认证 -->
<div class="btn" <div class="btn"
@click="handleTakePhotoClick" @click="handleTakePhotoClick"
v-if="tipsText == '请拍照'">
v-if="tipsText == '请拍照' && type == 'auth'">
立即核验
</div>
<div class="btn"
@click="handleTakePhotoClick"
v-else-if="tipsText == '请拍照'">
<uv-upload <uv-upload
multiple multiple
:maxCount="1" :maxCount="1"
@ -99,12 +107,17 @@
cameraEngine: null, // cameraEngine: null, //
devicePosition: true, // devicePosition: true, //
isAuthCamera: true, // isAuthCamera: true, //
type : '',
} }
}, },
computed: { computed: {
...mapState(['teamList', 'userInfo']),
...mapState(['teamList', 'userInfo', 'authInfo']),
}, },
onLoad() {
onLoad(args) {
if(args.type){
this.type = args.type
}
this.initData() this.initData()
}, },
onShow() { onShow() {
@ -189,6 +202,11 @@
}) })
setTimeout(uni.navigateBack, 1000, -1) setTimeout(uni.navigateBack, 1000, -1)
}else{
this.$nextTick(() => {
this.form.image = ''
this.tempImg = ''
})
} }
}) })
}, },
@ -287,7 +305,39 @@
tempImagePath tempImagePath
}) => { }) => {
this.tempImg = tempImagePath this.tempImg = tempImagePath
console.log("=======tempImg:", this.tempImg)
//
this.$Oss.ossUpload(tempImagePath).then(url => {
//
if(this.type == 'auth'){
let form = {
...this.authInfo,
pic : url
}
this.$api('authApply', form, res => {
if(res.code == 200){
setTimeout(uni.reLaunch, 1000, {
url: '/pages/index/index'
})
}else{
setTimeout(uni.navigateBack, 1000, -1)
}
})
return
}
this.form.image = url
if(this.form.lat){
this.submit()
}else{
uni.showLoading({
title: '定位中...'
})
this.isLocationSubmit = true
}
})
} }
}) })
}, },


+ 4
- 0
store/store.js View File

@ -11,6 +11,7 @@ const store = new Vuex.Store({
configList: [], //配置列表 configList: [], //配置列表
userInfo : {}, //用户信息 userInfo : {}, //用户信息
teamList : [],//团队列表 teamList : [],//团队列表
authInfo : {},//实名认证信息
}, },
getters: { getters: {
@ -112,6 +113,9 @@ const store = new Vuex.Store({
} }
}) })
}, },
setAuthInfo(state, data){
state.authInfo = data
},
}, },
actions: {}, actions: {},
}) })


Loading…
Cancel
Save