江西小程序管理端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

181 lines
5.7 KiB

1 year ago
1 year ago
1 year ago
11 months ago
8 months ago
1 year ago
11 months ago
1 year ago
1 year ago
10 months ago
11 months ago
1 year ago
1 year ago
11 months ago
10 months ago
11 months ago
1 year ago
1 year ago
11 months ago
1 year ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
12 months ago
1 year ago
1 year ago
8 months ago
1 year ago
1 year ago
10 months ago
11 months ago
1 year ago
1 year ago
  1. <template>
  2. <view class="pageBgImg">
  3. <view class="status_bar"></view>
  4. <view class="card">
  5. <view class="cut_row" @click.stop="showRole=true" v-if="list.length>1">
  6. <view class="flex-b">
  7. <view class="cut_icon">
  8. <image src="@/static/images/userCenter/cut.png" mode=""></image>
  9. </view>
  10. <view class="cut_text">切换身份</view>
  11. </view>
  12. </view>
  13. <view class="qcode" @click="$goPage('/pages/userCenter/scanCode/scanCode')" v-if="identity=='实操教练'">
  14. <image src="@/static/images/coach/ic_erweima.png" mode=""></image>
  15. </view>
  16. <user-info/>
  17. </view>
  18. <view class="card" style="padding: 35rpx 0 0 0;">
  19. <view class="ul">
  20. <view class="li" v-for="(item,index) in tabData" :key="index" @click="$goPage(item.url)">
  21. <view class="icon">
  22. <image :src="item.icon" mode=""></image>
  23. </view>
  24. <view class="text">{{ item.text }}</view>
  25. </view>
  26. </view>
  27. </view>
  28. <u-action-sheet :actions="list" title="请选择您要登录的角色" :show="showRole" @select="selectClick" @close="showRole=false" ></u-action-sheet>
  29. <UserTab name ='我的'></UserTab>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. tabData: [],
  37. list: [],
  38. showRole: false
  39. }
  40. },
  41. onLoad() {
  42. // this.$store.dispatch('refreshToken')
  43. this.initMenu()
  44. this.roleListFn()
  45. },
  46. onShow() {
  47. uni.hideTabBar();
  48. // this.getIpAddress()
  49. },
  50. methods: {
  51. initMenu() {
  52. if(this.identity=='实操教练') {
  53. this.tabData = [
  54. // {text: '待结算记录', icon: require('../../../static/images/coach/ic_daijiesuan.png'), id: 1, url: '/pages/userCenter/settled/settled'},
  55. // {text: '指标充值记录', icon: require('../../../static/images/coach/ic_zhibiao.png'), id: 2, url: '/pages/userCenter/indicatorRecharge/indicatorRecharge'},
  56. {text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'},
  57. {text: '考场信息', icon: require('../../../static/images/coach/ic_changdi.png'), id: 4, url: '/pages/userCenter/examinInfo/examinInfo'},
  58. {text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
  59. {text: '教学数据', icon: require('../../../static/images/coach/ic_shuju.png'), id: 6, url: '/pages/userCenter/teachingData/teachingData'},
  60. // {text: '学员退款', icon: require('../../../static/images/coach/ic_tuikuan.png'), id: 7, url: '/pages/userCenter/refund/refund'},
  61. ]
  62. }else if(this.identity=='校长'||this.identity=='驾校财务') {
  63. this.tabData = [
  64. {text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'},
  65. {text: '驾校场地', icon: require('../../../static/images/coach/site.png'), id: 7, url: '/pages/userCenter/schoolSite/schoolSite'},
  66. {text: '驾校教练', icon: require('../../../static/images/coach/coach.png'), id: 7, url: '/pages/userCenter/schoolCoach/schoolCoach'},
  67. {text: '教学数据', icon: require('../../../static/images/coach/ic_shuju.png'), id: 6, url: '/pages/userCenter/teachingData/teachingData'},
  68. {text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
  69. {text: '学员退款', icon: require('../../../static/images/coach/ic_tuikuan.png'), id: 7, url: '/pages/userCenter/refund/refund'},
  70. ]
  71. }else if(this.identity=='考场模拟教练') {
  72. this.tabData = [
  73. {text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'},
  74. {text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
  75. ]
  76. }else if(this.identity=='模拟器老师') {
  77. this.tabData = [
  78. {text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
  79. ]
  80. }
  81. },
  82. // 切换角色
  83. selectClick(item) {
  84. this.showRole = false
  85. this.$store.commit('upDateIdentity', item.name)
  86. this.initMenu()
  87. uni.reLaunch({
  88. url: '/pages/tabbar/mine/index'
  89. })
  90. },
  91. roleListFn() {
  92. this.list = []
  93. if(this.role.length<=1) return
  94. let roleObj = this.$store.state.user.vuex_role
  95. this.role.forEach((item)=>{
  96. let obj = {
  97. name: roleObj[item]
  98. }
  99. this.list.push(obj)
  100. })
  101. },
  102. getIpAddress() {
  103. // 使用第三方API服务获取IP地址,例如ipinfo.io
  104. fetch('https://ipinfo.io/json')
  105. .then(response => response.json())
  106. .then(data => {
  107. const ipAddress = data.ip;
  108. console.log(data)
  109. console.log('用户的IP地址是:', ipAddress);
  110. })
  111. .catch(error => {
  112. console.error('获取IP地址时出错:', error);
  113. });
  114. }
  115. }
  116. }
  117. </script>
  118. <style lang="scss" scoped>
  119. .pageBgImg {
  120. padding: 40rpx 28rpx;
  121. }
  122. .card {
  123. margin-bottom: 24rpx;
  124. padding: 28rpx;
  125. position: relative;
  126. .qcode {
  127. width: 76rpx;
  128. height: 76rpx;
  129. position: absolute;
  130. right: 34rpx;
  131. bottom: 24rpx;
  132. }
  133. .cut_row {
  134. display: flex;
  135. justify-content: flex-end;
  136. margin-bottom: 6rpx;
  137. .cut_icon {
  138. width: 24rpx;
  139. height: 24rpx;
  140. }
  141. .cut_text {
  142. font-size: 24rpx;
  143. color: $themC;
  144. margin-left: 5rpx;
  145. }
  146. }
  147. }
  148. .ul {
  149. display: flex;
  150. flex-wrap: wrap;
  151. .li {
  152. display: flex;
  153. align-items: center;
  154. flex-direction: column;
  155. padding: 10rpx 0 50rpx 0;
  156. width: 33.33%;
  157. .icon {
  158. width: 72rpx;
  159. height: 72rpx;
  160. }
  161. .text {
  162. font-size: 28rpx;
  163. margin-top: 16rpx;
  164. }
  165. }
  166. }
  167. </style>