index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <view class="container">
  3. <navBar title="" :navImg="navImg" :back="false" color="#333333" background="#FFFFFF" />
  4. <tabBar :tabBarList="tabBarList" :routePath="routePath" @onTabBar="onTabBar" />
  5. <view class="topBox">
  6. <view class="userBox">
  7. <image class="avatar" @click="toUserInfo" :src="picBase+'edit.png'" mode=""></image>
  8. <view class="nickname" @click="toUserInfo">
  9. 刘晓艺
  10. </view>
  11. <image class="icon" @click="toUserInfo" :src="picBase+'edit.png'" mode=""></image>
  12. </view>
  13. <view class="infoBox">
  14. <view class="left">
  15. <image class="icon" :src="picBase+'edit.png'" mode=""></image>
  16. 当前剩余次数:2
  17. </view>
  18. <view class="btn" @click="toCharge">
  19. 立即充值
  20. </view>
  21. </view>
  22. </view>
  23. <view class="contentBox">
  24. <view class="tabBox">
  25. <view class="item" @click="toHuibenJilu">
  26. <image class="icon" :src="picBase+'edit.png'" mode=""></image>
  27. <view class="right">
  28. <view class="t1">
  29. 绘本记录
  30. </view>
  31. <view class="t2">
  32. 绘本历史记录
  33. </view>
  34. </view>
  35. </view>
  36. <view class="item">
  37. <image class="icon" :src="picBase+'edit.png'" mode=""></image>
  38. <view class="right">
  39. <view class="t1">
  40. 推广大使
  41. </view>
  42. <view class="t2">
  43. 推广大使招募
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="serListBox">
  49. <view class="item" v-for="(item,index) in serList">
  50. <view class="left">
  51. <image class="icon" src="../../static/other/edit.png" mode=""></image>
  52. {{item.name}}
  53. </view>
  54. <image class="icon_r" src="../../static/other/arrR.png" mode=""></image>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. // import navBar from '@/components/navBar/index.vue'
  62. export default {
  63. // components: {
  64. // navBar
  65. // },
  66. data() {
  67. return {
  68. picBase: this.$picBase,
  69. navImg: require('@/static/other/logo.png'),
  70. tabBarList: [{
  71. "pagePath": "pages/index/index",
  72. "iconPath": "../../static/tabbar/index.png",
  73. "selectedIconPath": "../../static/tabbar/index_a.png",
  74. "text": "首页"
  75. },
  76. {
  77. "pagePath": "pages/my/index",
  78. "iconPath": "../../static/tabbar/my.png",
  79. "selectedIconPath": "../../static/tabbar/my_a.png",
  80. "text": "我的"
  81. }
  82. ],
  83. routePath: '',
  84. serList: [{
  85. name: '推荐奖励',
  86. icon: this.$picBase + 'edit.png',
  87. },
  88. {
  89. name: '消费记录',
  90. icon: this.$picBase + 'edit.png',
  91. },
  92. {
  93. name: '客服中心',
  94. icon: this.$picBase + 'edit.png',
  95. },
  96. {
  97. name: '关于我们',
  98. icon: this.$picBase + 'edit.png',
  99. },
  100. ]
  101. }
  102. },
  103. onLoad() {
  104. uni.hideTabBar()
  105. let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
  106. let curRoute = routes[routes.length - 1].route // 获取当前页面路由,也就是最后一个打开的页面路由
  107. this.routePath = curRoute;
  108. console.log('routePath', this.routePath);
  109. },
  110. methods: {
  111. onTabBar(e) {
  112. console.log('e------------', e);
  113. uni.switchTab({
  114. url: '/' + e
  115. })
  116. },
  117. toCharge() {
  118. uni.navigateTo({
  119. url: '/pages/my/charge/index'
  120. })
  121. },
  122. toHuibenJilu() {
  123. uni.navigateTo({
  124. url: '/pages/my/huiBen_record/index'
  125. })
  126. },
  127. toUserInfo() {
  128. uni.navigateTo({
  129. url: '/pages/my/userInfo/index'
  130. })
  131. }
  132. }
  133. }
  134. </script>
  135. <style lang="scss" scoped>
  136. @import "./index.scss";
  137. </style>