江西小程序管理端
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.

124 lines
4.0 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year 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="qcode" @click="$goPage('/pages/userCenter/scanCode/scanCode')">
  6. <image src="@/static/images/coach/ic_erweima.png" mode=""></image>
  7. </view>
  8. <user-info/>
  9. </view>
  10. <view class="card">
  11. <view class="ul">
  12. <view class="li" v-for="(item,index) in tabData" :key="index" @click="$goPage(item.url)">
  13. <view class="icon">
  14. <image :src="item.icon" mode=""></image>
  15. </view>
  16. <view class="text">{{ item.text }}</view>
  17. </view>
  18. </view>
  19. </view>
  20. <UserTab name ='我的'></UserTab>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. tabData: []
  28. }
  29. },
  30. onLoad() {
  31. if(this.identity=='实操教练') {
  32. this.tabData = [
  33. // {text: '待结算记录', icon: require('../../../static/images/coach/ic_daijiesuan.png'), id: 1, url: '/pages/userCenter/settled/settled'},
  34. // {text: '指标充值记录', icon: require('../../../static/images/coach/ic_zhibiao.png'), id: 2, url: '/pages/userCenter/indicatorRecharge/indicatorRecharge'},
  35. {text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'},
  36. {text: '考场信息', icon: require('../../../static/images/coach/ic_changdi.png'), id: 4, url: '/pages/userCenter/examinInfo/examinInfo'},
  37. {text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
  38. {text: '教学数据', icon: require('../../../static/images/coach/ic_shuju.png'), id: 6, url: '/pages/userCenter/teachingData/teachingData'},
  39. // {text: '学员退款', icon: require('../../../static/images/coach/ic_tuikuan.png'), id: 7, url: '/pages/userCenter/refund/refund'},
  40. ]
  41. }else if(this.identity=='校长') {
  42. this.tabData = [
  43. {text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'},
  44. {text: '教学数据', icon: require('../../../static/images/coach/ic_shuju.png'), id: 6, url: '/pages/userCenter/teachingData/teachingData'},
  45. {text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
  46. {text: '学员退款', icon: require('../../../static/images/coach/ic_tuikuan.png'), id: 7, url: '/pages/userCenter/refund/refund'},
  47. ]
  48. }else if(this.identity=='考场模拟教练') {
  49. this.tabData = [
  50. {text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'},
  51. {text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
  52. ]
  53. }
  54. console.log('我的页面')
  55. },
  56. onShow() {
  57. uni.hideTabBar();
  58. this.getIpAddress()
  59. },
  60. methods: {
  61. goPage() {},
  62. getIpAddress() {
  63. // 使用第三方API服务获取IP地址,例如ipinfo.io
  64. fetch('https://ipinfo.io/json')
  65. .then(response => response.json())
  66. .then(data => {
  67. const ipAddress = data.ip;
  68. console.log(data)
  69. console.log('用户的IP地址是:', ipAddress);
  70. })
  71. .catch(error => {
  72. console.error('获取IP地址时出错:', error);
  73. });
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .pageBgImg {
  80. padding: 120rpx 28rpx 40rpx 28rpx;
  81. }
  82. .card {
  83. margin-bottom: 24rpx;
  84. padding: 28rpx;
  85. position: relative;
  86. .qcode {
  87. width: 76rpx;
  88. height: 76rpx;
  89. position: absolute;
  90. right: 16rpx;
  91. top: 50%;
  92. transform: translateY(-50%);
  93. }
  94. }
  95. .ul {
  96. display: flex;
  97. flex-wrap: wrap;
  98. .li {
  99. display: flex;
  100. align-items: center;
  101. flex-direction: column;
  102. padding: 10rpx 0 50rpx 0;
  103. width: 33.33%;
  104. .icon {
  105. width: 72rpx;
  106. height: 72rpx;
  107. }
  108. .text {
  109. font-size: 28rpx;
  110. margin-top: 16rpx;
  111. }
  112. }
  113. }
  114. </style>