Browse Source

修复bug

master
前端-胡立永 1 week ago
parent
commit
e4d0aa60c0
6 changed files with 104 additions and 9 deletions
  1. +1
    -1
      mixins/configList.js
  2. +12
    -1
      pages/index/center.vue
  3. +24
    -2
      pages_login/wxUserInfo.vue
  4. +20
    -0
      pages_order/huodong-detail.vue
  5. +21
    -0
      pages_order/lvyou-detail.vue
  6. +26
    -5
      store/store.js

+ 1
- 1
mixins/configList.js View File

@ -13,7 +13,7 @@ export default {
}
},
computed: {
...mapState(['configList', 'userInfo', 'selectArea']),
...mapState(['configList', 'userInfo', 'isLogin', 'selectArea']),
},
// 定义全局分享
// 1.发送给朋友


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

@ -53,7 +53,8 @@
<view class="user">
<view class="cell-bottom">
<view class="cell-line"
v-if="!item.role || userInfo.isUser == 'Y'"
v-if="(!item.role || userInfo.isUser == 'Y')
&& (!item.auth || isLogin)"
v-for="(item,i) in cellList"
:key="i" @click="jump(item)">
<view class="line-l">
@ -124,6 +125,12 @@
name:'主理人签到',
url:'/pages_my/zlx-qiandao',
role : true,
},
{
src: '/static/image/center/line-5.png',
name:'退出登录',
commit : 'logout',
auth : true,
}
],
vipType : ['普通会员', '黄金会员', '渠道商'],
@ -158,6 +165,10 @@
})
},
jump(item) {
if(item.commit){
this.$store.commit(item.commit)
return
}
uni.navigateTo({
url:item.url
})


+ 24
- 2
pages_login/wxUserInfo.vue View File

@ -31,6 +31,19 @@
v-model="userInfoForm.nickName" />
</view>
</view>
<view class="line">
<view class="">
性别
</view>
<view class="">
<input
placeholder="请选择性别"
disabled
@click="$refs.sexPicker.open()"
style="text-align: right;"
v-model="userInfoForm.sex" />
</view>
</view>
<view class="line">
<view class="">
手机号
@ -54,7 +67,7 @@
</view>
</view>
<uv-picker ref="sexPicker" :columns="sexcolumns" @confirm="sexConfirm"></uv-picker>
<view class="btn" @click="submit">
确认
@ -70,7 +83,11 @@
headImage: '',
nickName: '',
phone : '',
}
sex : '',
},
sexcolumns:[
['男','女']
],
};
},
onShow() {},
@ -106,6 +123,9 @@
}
})
},
sexConfirm(val) {
this.userInfoForm.sex = val.value[0]
},
submit() {
let self = this
@ -122,6 +142,7 @@
headImage: '请选择头像',
nickName: '请填写昵称',
phone: '请填写昵称',
sex: '请选择性别',
})) {
return
}
@ -130,6 +151,7 @@
headImage : self.userInfoForm.headImage,
nickName : self.userInfoForm.nickName,
phone : self.userInfoForm.phone,
sex : self.userInfoForm.sex,
}, res => {
if (res.code == 200) {
this.$store.commit('getUserInfo')


+ 20
- 0
pages_order/huodong-detail.vue View File

@ -216,6 +216,10 @@
onLoad({activityId}) {
this.activityId = activityId
this.activityInfo(activityId)
if(this.isLogin){
this.$store.commit('getUserInfo')
}
},
methods:{
daohang() {
@ -297,6 +301,22 @@
})
},
confirmClick(typePrice) {
if(!this.userInfo.nickName ||
!this.userInfo.headImage ||
!this.userInfo.phone ||
!this.userInfo.sex){
uni.showToast({
title: '请您先完善必要信息',
icon: 'none'
})
setTimeout(uni.navigateTo, 800, {
url: '/pages_login/wxUserInfo'
})
return
}
this.$api('createOrder',{
id:this.activityId,
typePrice: this.typeList[typePrice].type,


+ 21
- 0
pages_order/lvyou-detail.vue View File

@ -171,9 +171,30 @@
onLoad({travelId}) {
this.travelId = travelId
this.travelInfo(travelId)
if(this.isLogin){
this.$store.commit('getUserInfo')
}
},
methods:{
toBaoming() {
if(!this.userInfo.nickName ||
!this.userInfo.headImage ||
!this.userInfo.phone ||
!this.userInfo.sex){
uni.showToast({
title: '请您先完善必要信息',
icon: 'none'
})
setTimeout(uni.navigateTo, 800, {
url: '/pages_login/wxUserInfo'
})
return
}
this.$api('createOrder',{
id : this.travelId,
typePrice : 1,


+ 26
- 5
store/store.js View File

@ -17,7 +17,7 @@ const store = new Vuex.Store({
},
getters: {
userInfo:state => state.userInfo,
isLogin:state=>state.token?true:false
isLogin:state => state.token ? true : false
},
mutations: {
// 初始化配置
@ -86,6 +86,18 @@ const store = new Vuex.Store({
if(res.code == 200){
uni.setStorageSync('userInfo',JSON.stringify(res.result))
state.userInfo = res.result
// if(!state.userInfo.nickName ||
// !state.userInfo.headImage ||
// !state.userInfo.phone ||
// !state.userInfo.sex){
// uni.showToast({
// title: '请您先完善必要信息'
// })
// uni.navigateTo({
// url: '/pages_login/wxUserInfo'
// })
// }
}
})
},
@ -100,10 +112,19 @@ const store = new Vuex.Store({
// },
// 退出登录
logout(state){
state.userInfo = {}
state.role = false
state.token = ""
uni.removeStorageSync('token')
uni.showModal({
title: '确认退出登录吗',
success(r) {
if (r.confirm) {
state.userInfo = {}
state.token = ""
uni.removeStorageSync('token')
uni.reLaunch({
url: '/pages/index/index'
})
}
}
})
},
// 查询地区
getArea(state, fn){


Loading…
Cancel
Save