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> <script>
export default { export default {
onLaunch: function() { onLaunch: function() {
// this.$store.commit('getUserInfo')
}, },
onShow: function() { onShow: function() {
// this.$store.commit('initConfig') // this.$store.commit('initConfig')
this.$store.commit('getTeam') this.$store.commit('getTeam')
this.$store.commit('getUserInfo')
}, },
onHide: function() { onHide: function() {
} }


+ 1
- 1
api/api.js View File

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


+ 1
- 1
config.js View File

@ -6,7 +6,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI); 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 class="text">正对充足</view>
</view> </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> </div>
</view> </view>
</template> </template>
@ -59,6 +70,7 @@
form : { form : {
pic : '', pic : '',
}, },
isLocationSubmit : false,
} }
}, },
computed: { computed: {
@ -72,15 +84,35 @@
self.form.lat = res.position.latitude self.form.lat = res.position.latitude
self.form.lon = res.position.longitude self.form.lon = res.position.longitude
self.form.address = res.address self.form.address = res.address
if(self.isLocationSubmit){
self.submit()
}
}) })
}, },
methods: { 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() { photo() {
let self = this let self = this
uni.chooseImage({ uni.chooseImage({
count: 1, //9 count: 1, //9
sizeType: ['original', 'compressed'], //
sizeType: ['compressed'], //
// sizeType: ['original', 'compressed'], //
sourceType: ['camera '], //cameraalbum sourceType: ['camera '], //cameraalbum
success: function(res) { success: function(res) {
console.log(JSON.stringify(res.tempFilePaths)); console.log(JSON.stringify(res.tempFilePaths));
@ -88,7 +120,16 @@
self.$Oss.ossUpload(res.tempFilePaths[0]).then(url => { self.$Oss.ossUpload(res.tempFilePaths[0]).then(url => {
self.form.pic = 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){ if(res.code == 200){
state.userInfo = res.result 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({ uni.navigateTo({
url: "/pages/subPack/team/team" url: "/pages/subPack/team/team"
}) })


Loading…
Cancel
Save