| | |
| | | await this.login(userInfo); |
| | | this.$request('/api/Member/checkNum', 'POST').then(res => { |
| | | console.log(res,"checkNumres") |
| | | userInfo.num = res.data.num+res.data.pay_num // 更新数量 |
| | | userInfo.num = res.data.num // 更新数量 |
| | | this.syncUserInfo(userInfo) |
| | | this.$store.commit('syncUserInfo', userInfo) |
| | | }) |
| | | } |
| | | this.$request('/api/Baseconfig/getInfo').then(res => { |
| | |
| | | </view> |
| | | <view class="flex justify-center align-center flex-direction"> |
| | | <button @click="toChat" style="width: calc(100vw - 60rpx); height: 100rpx;" class="cu-btn text-bold chat-button"> |
| | | 开始咨询 (余{{num}}次) </button> |
| | | 开始咨询 (余{{sum_num}}次) </button> |
| | | </view> |
| | | <view class="tool padding-top-xl"> |
| | | <view class="header"> |
| | |
| | | setting_data:'null', |
| | | user_data:'null', |
| | | shar_openid:'null', |
| | | open_id_data |
| | | open_id_data, |
| | | userinfo_data:'null', |
| | | sum_num:0 |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(['config', 'num', 'userInfo', 'token', 'main_model', 'tabbar']) |
| | | }, |
| | | onLoad(op) { |
| | | async onLoad(op) { |
| | | console.log(this.$store.state.userInfo,"home userinfo") |
| | | this.getTabIndex() |
| | | // #ifdef MP-WEIXIN || MP-JD |
| | | uni.hideHomeButton() |
| | | // #endif |
| | | |
| | | if(this.$store.state.userInfo.num&&this.$store.state.userInfo.pay_num){ |
| | | this.setting_data = setting |
| | | this.userinfo_data = this.$store.state.userInfo |
| | | this.sum_num = this.userinfo_data.num+this.userinfo_data.pay_num |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | res.data.token = res.token |
| | | uni.setStorageSync('userInfo',res.data); |
| | | uni.setStorageSync('token',res.token) |
| | | this.$store.commit('login',res.data) |
| | | this.login(res.data) |
| | | setTimeout(() => { |
| | | uni.redirectTo({ |
| | |
| | | res.data.token = res.token |
| | | uni.setStorageSync('userInfo',res.data); |
| | | uni.setStorageSync('token',res.token) |
| | | this.$store.commit('login',res.data) |
| | | this.login(res.data) |
| | | setTimeout(() => { |
| | | uni.redirectTo({ |
| | |
| | | mutations: { |
| | | login(state, userInfo) { |
| | | state.userInfo = userInfo; |
| | | state.num = userInfo.num; |
| | | state.num = userInfo.num+userInfo.pay_num; |
| | | state.token = userInfo.token; |
| | | }, |
| | | syncUserInfo(state, userInfo) { |
| | | state.userInfo = userInfo; |
| | | state.num = userInfo.num; |
| | | state.num = userInfo.num+userInfo.pay_num; |
| | | }, |
| | | syncUserNum(state, num) { |
| | | state.num = num; |