diff --git a/common/js/mixins.js b/common/js/mixins.js new file mode 100644 index 0000000..09c8274 --- /dev/null +++ b/common/js/mixins.js @@ -0,0 +1,14 @@ + +import { mapState } from 'vuex' + +export default { + computed: { + ...mapState({ + identity: state=> state.user.identity, + }), + }, + data() { + return { + } + } +} \ No newline at end of file diff --git a/components/UserTab/UserTab.vue b/components/UserTab/UserTab.vue index 5de086a..8554ae9 100644 --- a/components/UserTab/UserTab.vue +++ b/components/UserTab/UserTab.vue @@ -1,8 +1,8 @@ @@ -10,75 +10,110 @@ + + \ No newline at end of file diff --git a/pages/tabbar/examSimulation/index.vue b/pages/tabbar/examSimulation/index.vue index 0aad9e1..05d6de0 100644 --- a/pages/tabbar/examSimulation/index.vue +++ b/pages/tabbar/examSimulation/index.vue @@ -50,7 +50,7 @@ - + @@ -61,7 +61,7 @@ }, onLoad() {}, onShow() { - // uni.hideTabBar(); + uni.hideTabBar(); }, methods: { goPage() {} diff --git a/pages/tabbar/mine/index.vue b/pages/tabbar/mine/index.vue index 2e4659a..50a5f38 100644 --- a/pages/tabbar/mine/index.vue +++ b/pages/tabbar/mine/index.vue @@ -17,7 +17,8 @@ - + + @@ -37,10 +38,23 @@ } }, onLoad() { + if(this.identity==2) { + this.tabData = [ + {text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'}, + {text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'}, + {text: '学员退款', icon: require('../../../static/images/coach/ic_tuikuan.png'), id: 7, url: '/pages/userCenter/refund/refund'}, + {text: '教学数据', icon: require('../../../static/images/coach/ic_shuju.png'), id: 6, url: '/pages/userCenter/teachingData/teachingData'}, + ] + }else if(this.identity==3) { + this.tabData = [ + {text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'}, + {text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'}, + ] + } console.log('我的页面') }, onShow() { - // uni.hideTabBar(); + uni.hideTabBar(); }, methods: { goPage() {} diff --git a/pages/tabbar/operateTrain/index.vue b/pages/tabbar/operateTrain/index.vue index 62ca593..ec641f2 100644 --- a/pages/tabbar/operateTrain/index.vue +++ b/pages/tabbar/operateTrain/index.vue @@ -39,7 +39,7 @@ - + @@ -72,7 +72,7 @@ console.log('我的页面') }, onShow() { - // uni.hideTabBar(); + uni.hideTabBar(); }, methods: { changeTab(item) { diff --git a/pages/tabbar/statistics/index.vue b/pages/tabbar/statistics/index.vue index 30f26ba..570d9cc 100644 --- a/pages/tabbar/statistics/index.vue +++ b/pages/tabbar/statistics/index.vue @@ -13,6 +13,20 @@ 今日已结算金额 ¥36333.66 + + + 今日学员退款 + ¥900 + + + 今日代收费 + ¥900 + + + 今日学员退款 + ¥900 + + 截止:2023/08/08 11:00:00 @@ -24,7 +38,7 @@ - 结算统计 + {{identity==1?'结算': '收入'}}统计 按日 按月 @@ -37,7 +51,7 @@ - 结算明细 + {{identity==1?'结算': '收入'}}明细 @@ -46,7 +60,7 @@ 查看更多 - + - + 我的学员 手动添加 @@ -20,6 +20,10 @@ 260 今日新增学员 + + 260 + 今日退学学员 + @@ -49,6 +53,7 @@ + @@ -62,7 +67,10 @@ className: '全部班型' } } - } + }, + onShow() { + uni.hideTabBar(); + }, } @@ -106,7 +114,7 @@ color: $themC; position: relative; &::before { - content: '天'; + content: '个'; position: absolute; right: -30rpx; bottom: 10rpx; diff --git a/pages/userCenter/login/login.vue b/pages/userCenter/login/login.vue index ea765d1..2667488 100644 --- a/pages/userCenter/login/login.vue +++ b/pages/userCenter/login/login.vue @@ -1,6 +1,27 @@ @@ -8,14 +29,48 @@ export default { data() { return { - + isCheck: false, + show: false, + decodePhoneParams: {} } }, onLoad() { - // this.init() - + this.getCode() + // uni.getLocation({ + // type: 'wgs84', + // success: function (res) { + // console.log(res) + // console.log('当前位置的经度:' + res.longitude); + // console.log('当前位置的纬度:' + res.latitude); + // } + // }); }, methods: { + // 获取code + getCode() { + uni.login({ + provider: 'weixin', + success: loginRes => { + this.decodePhoneParams.code = loginRes.code + console.log('loginRes') + console.log(loginRes) + } + }); + }, + // 获取手机号 + async getPhoneNumber(e) { + await this.getCode(); + console.log('获取手机号') + console.log(e) + if(!this.decodePhoneParams.code || !e.detail.encryptedData){ + return false; + } + + }, + // 是否选择协议 + changeRadio(val) { + this.isCheck = val + }, init() { uni.login({ provider: 'weixin', @@ -45,27 +100,68 @@ \ No newline at end of file diff --git a/pages/userCenter/login/loginByPhone.vue b/pages/userCenter/login/loginByPhone.vue index b700bce..021041c 100644 --- a/pages/userCenter/login/loginByPhone.vue +++ b/pages/userCenter/login/loginByPhone.vue @@ -93,8 +93,17 @@ }, 1000); }, submitFn() { + let val = 1 + if(this.FormData.phone=='18267103167') { + val = 1 + }else if(this.FormData.phone=='18267103168') { + val = 2 + }else { + val = 3 + } + this.$store.commit('upDateIdentity', val) uni.switchTab({ - url: '/pages/tabbar/index/index' + url: '/pages/tabbar/statistics/index' }) } } diff --git a/static/images/userCenter/title_1.png b/static/images/userCenter/loginTitle.png similarity index 100% rename from static/images/userCenter/title_1.png rename to static/images/userCenter/loginTitle.png diff --git a/store/modules/user.js b/store/modules/user.js index 5af0505..5f72a8e 100644 --- a/store/modules/user.js +++ b/store/modules/user.js @@ -3,12 +3,13 @@ import addApi from '../../common/sdk/qqmap-wx-jssdk.min.js'; // 引入 const user = { state: { - addList: [] + identity: uni.getStorageSync('identity')?uni.getStorageSync('identity'):1 }, mutations: { - // 更新广告列表 - upDateAddList(state, list) { - state.addList = list + // 更新用户身份 + upDateIdentity(state, val) { + state.identity = val + uni.setStorageSync('identity', val); }, }, actions: {