Browse Source

对接接口

master
前端-胡立永 3 months ago
parent
commit
d33d5a5bbe
5 changed files with 55 additions and 10 deletions
  1. +1
    -1
      App.vue
  2. +1
    -1
      api/api.js
  3. +1
    -1
      config.js
  4. +47
    -6
      pages/subPack/human/human.vue
  5. +5
    -1
      store/store.js

+ 1
- 1
App.vue View File

@ -1,11 +1,11 @@
<script>
export default {
onLaunch: function() {
// this.$store.commit('getUserInfo')
},
onShow: function() {
// this.$store.commit('initConfig')
this.$store.commit('getTeam')
this.$store.commit('getUserInfo')
},
onHide: function() {
}


+ 1
- 1
api/api.js View File

@ -34,7 +34,7 @@ const config = {
url: '/user/info',
method: 'GET',
auth: true,
limit : 800,
limit : 200,
},
//隐私政策
getPrivacyPolicy: {


+ 1
- 1
config.js View File

@ -6,7 +6,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
const type = 'dev'
const type = 'prod'
// 环境配置


+ 47
- 6
pages/subPack/human/human.vue View File

@ -38,11 +38,22 @@
<view class="text">正对充足</view>
</view>
</view>
<!-- 立即核验 -->
<div @click="photo" class="btn">
立即核验
<div class="btn">
<uv-upload
multiple
:maxCount="1"
capture="camera"
height="180rpx"
@afterRead="afterRead">
<view style="display: flex;justify-content: center;
width: 600rpx;">
立即核验
</view>
</uv-upload>
</div>
</view>
</template>
@ -59,6 +70,7 @@
form : {
pic : '',
},
isLocationSubmit : false,
}
},
computed: {
@ -72,15 +84,35 @@
self.form.lat = res.position.latitude
self.form.lon = res.position.longitude
self.form.address = res.address
if(self.isLocationSubmit){
self.submit()
}
})
},
methods: {
afterRead(e) {
let self = this
e.file.forEach(file => {
self.$Oss.ossUpload(file.url).then(url => {
self.form.pic = url
if(self.form.lat){
self.submit()
}else{
uni.showLoading({
title: '定位中...'
})
self.isLocationSubmit = true
}
})
})
},
//
photo() {
let self = this
uni.chooseImage({
count: 1, //9
sizeType: ['original', 'compressed'], //
sizeType: ['compressed'], //
// sizeType: ['original', 'compressed'], //
sourceType: ['camera '], //cameraalbum
success: function(res) {
console.log(JSON.stringify(res.tempFilePaths));
@ -88,7 +120,16 @@
self.$Oss.ossUpload(res.tempFilePaths[0]).then(url => {
self.form.pic = url
self.submit()
if(self.form.lat){
self.submit()
}else{
uni.showLoading({
title: '定位中...'
})
self.isLocationSubmit = true
}
})


+ 5
- 1
store/store.js View File

@ -89,7 +89,11 @@ const store = new Vuex.Store({
if(res.code == 200){
state.userInfo = res.result
if(!state.userInfo.team){
if(!state.userInfo.nickName || !state.userInfo.headImage){
uni.navigateTo({
url: '/pages/login/wxUserInfo'
})
}else if(!state.userInfo.team){
uni.navigateTo({
url: "/pages/subPack/team/team"
})


Loading…
Cancel
Save