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.

187 lines
5.8 KiB

9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
8 months ago
8 months ago
9 months ago
  1. <template>
  2. <view class="pageBgImg">
  3. <view class="status_bar"></view>
  4. <view class="" style="height: 44rpx;"></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="goSanCode" >
  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. console.log(item.url)
  58. this.$goPage(item.url)
  59. },
  60. // 点击扫码小图标
  61. goSanCode() {
  62. if(this.identity=='校长') {
  63. this.$goPage('/pages/userCenter/scanCode/scanCodeSchool')
  64. }else if(this.identity=='实操教练') {
  65. this.$goPage('/pages/userCenter/scanCode/scanCode')
  66. }
  67. },
  68. initMenu() {
  69. if(this.identity=='实操教练') {
  70. this.tabData = [
  71. {text: '上课学员', icon: require('../../../static/images/coach/ic_zhibiao.png'), id: 2, url: '/pages/recordEntry/operate/todayStudent/todayStudent'},
  72. {text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'},
  73. {text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
  74. {text: '教学数据', icon: require('../../../static/images/coach/ic_shuju.png'), id: 6, url: '/pages/userCenter/teachingData/teachingData'},
  75. {text: '我的签名', icon: require('../../../static/images/coach/ic_daijiesuan.png'), id: 1, url: '/pages/userCenter/signature/signature'},
  76. // {text: '学员退款', icon: require('../../../static/images/coach/ic_tuikuan.png'), id: 7, url: '/pages/userCenter/refund/refund'},
  77. ]
  78. }else if(this.identity=='校长'||this.identity=='驾校财务') {
  79. this.tabData = [
  80. {text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'},
  81. {text: '驾校场地', icon: require('../../../static/images/coach/site.png'), id: 7, url: '/pages/userCenter/schoolSite/schoolSite'},
  82. {text: '驾校教练', icon: require('../../../static/images/coach/coach.png'), id: 7, url: '/pages/userCenter/schoolCoach/schoolCoach'},
  83. {text: '教学数据', icon: require('../../../static/images/coach/ic_shuju.png'), id: 6, url: '/pages/userCenter/teachingData/teachingData'},
  84. {text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
  85. {text: '学员退款', icon: require('../../../static/images/coach/ic_tuikuan.png'), id: 7, url: '/pages/userCenter/refund/refund'},
  86. ]
  87. }else if(this.identity=='考场模拟教练') {
  88. this.tabData = [
  89. {text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'},
  90. {text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
  91. ]
  92. }else if(this.identity=='模拟器老师') {
  93. this.tabData = [
  94. {text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
  95. ]
  96. }
  97. },
  98. // 切换角色
  99. selectClick(item) {
  100. this.showRole = false
  101. this.$store.commit('upDateIdentity', item.name)
  102. this.initMenu()
  103. uni.reLaunch({
  104. url: '/pages/tabbar/mine/index'
  105. })
  106. },
  107. getIpAddress() {
  108. // 使用第三方API服务获取IP地址,例如ipinfo.io
  109. fetch('https://ipinfo.io/json')
  110. .then(response => response.json())
  111. .then(data => {
  112. const ipAddress = data.ip;
  113. console.log(data)
  114. console.log('用户的IP地址是:', ipAddress);
  115. })
  116. .catch(error => {
  117. console.error('获取IP地址时出错:', error);
  118. });
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss" scoped>
  124. .pageBgImg {
  125. padding: 40rpx 28rpx;
  126. }
  127. .card {
  128. margin-bottom: 24rpx;
  129. padding: 28rpx;
  130. position: relative;
  131. .qcode {
  132. width: 76rpx;
  133. height: 76rpx;
  134. position: absolute;
  135. right: 34rpx;
  136. bottom: 24rpx;
  137. }
  138. .cut_row {
  139. display: flex;
  140. justify-content: flex-end;
  141. margin-bottom: 6rpx;
  142. .cut_icon {
  143. width: 24rpx;
  144. height: 24rpx;
  145. }
  146. .cut_text {
  147. font-size: 24rpx;
  148. color: $themC;
  149. margin-left: 5rpx;
  150. }
  151. }
  152. }
  153. .ul {
  154. display: flex;
  155. flex-wrap: wrap;
  156. .li {
  157. display: flex;
  158. align-items: center;
  159. flex-direction: column;
  160. padding: 10rpx 0 50rpx 0;
  161. width: 33.33%;
  162. .icon {
  163. width: 72rpx;
  164. height: 72rpx;
  165. }
  166. .text {
  167. font-size: 28rpx;
  168. margin-top: 16rpx;
  169. }
  170. }
  171. }
  172. </style>