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.

195 lines
5.8 KiB

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