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.

178 lines
5.7 KiB

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