index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="page-wrap">
  3. <view class="header-panel" @click="handleOpenInfo">
  4. <image v-if="userInfo && userInfo.avatar" class="avatar" :src="userInfo.avatar" mode="aspectFill"></image>
  5. <image v-else class="avatar" src="../../static/img_avatar.png" mode="aspectFill"></image>
  6. <view v-if="userInfo" class="info">
  7. <view class="name">{{ userInfo.name }}</view>
  8. <view class="company">{{ userInfo.company }}</view>
  9. <image class="arrow" src="../../static/icon_arrow.png"></image>
  10. </view>
  11. <button v-else class="btn" @click.stop="handleOpenLogin">登录</button>
  12. </view>
  13. <view class="menu-panel">
  14. <view class="item" v-for="(item, index) in manuList" :key="index">
  15. <image class="icon" :src="`../../static/svg/user_menu_${item.value}.svg`"></image>
  16. {{ item.label }}
  17. <view class="badge" v-if="item.value === 2">4</view>
  18. </view>
  19. </view>
  20. <view class="nav-panel">
  21. <view :class="{ item: true, sapce: item.topSpace }" v-for="(item, index) in navList" :key="index"
  22. @click="handleNav(item.value)">
  23. <view class="icon">
  24. <image :class="'icon-img icon-img-' + item.value" :src="`../../static/svg/user_nav_${item.value}.svg`">
  25. </image>
  26. </view>
  27. <view class="label">
  28. {{ item.label }}
  29. </view>
  30. <!-- 我的分销 -->
  31. <view class="tag" v-if="item.value === 4">累计收益 0.00</view>
  32. <!-- 我的优惠券 -->
  33. <view class="sub active" v-if="item.value === 5">3张可用</view>
  34. <image class="arrow" src="../../static/svg/arrow.svg"></image>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import avatar from '@/static/taxation/poster.jpg';
  41. export default {
  42. components: {},
  43. data() {
  44. return {
  45. userInfo: '',
  46. manuList: [{
  47. label: '我的订单',
  48. value: 1
  49. },
  50. {
  51. label: '我的账单',
  52. value: 2
  53. },
  54. {
  55. label: '我的发票',
  56. value: 3
  57. },
  58. {
  59. label: '企业钱包',
  60. value: 4
  61. }
  62. ],
  63. navList: [{
  64. label: '企业资料',
  65. value: 1
  66. },
  67. {
  68. label: '企业团队',
  69. value: 2
  70. },
  71. {
  72. label: '认证信息',
  73. value: 3
  74. },
  75. {
  76. label: '我的分销',
  77. value: 4,
  78. topSpace: true
  79. },
  80. {
  81. label: '我的优惠券',
  82. value: 5
  83. },
  84. {
  85. label: '常见问题',
  86. value: 6,
  87. topSpace: true
  88. },
  89. {
  90. label: '关于我们',
  91. value: 7
  92. }
  93. ],
  94. list: [{
  95. icon: '/static/scan.png',
  96. name: '企业资料',
  97. // url: "/pages/index/scanCode/index",
  98. isShow: true
  99. },
  100. {
  101. icon: '/static/self-icon.png',
  102. name: '企业团队',
  103. url: '/pages/index/self_info',
  104. isShow: true
  105. },
  106. {
  107. icon: '/static/org-icon.png',
  108. name: '认证信息',
  109. url: '/pages/index/org_member',
  110. isShow: true
  111. },
  112. {
  113. icon: '/static/explain-icon.png',
  114. name: '我的分销',
  115. url: '/pages/index/back_login',
  116. isShow: true
  117. },
  118. {
  119. icon: '/static/back.png',
  120. name: '我的优惠券',
  121. // url: "/pages/index/scanCode/index",
  122. isShow: true
  123. },
  124. {
  125. icon: '/static/explain-icon.png',
  126. name: '常见问题',
  127. url: '/pages/index/back_login',
  128. isShow: true
  129. },
  130. {
  131. icon: '/static/back.png',
  132. name: '关于我们',
  133. // url: "/pages/index/scanCode/index",
  134. isShow: true
  135. }
  136. ]
  137. };
  138. },
  139. onLoad() {},
  140. onShow() {},
  141. methods: {
  142. handleOpenLogin() {
  143. this.userInfo = {
  144. name: 'Caocao',
  145. company: '天津超易达胜科技',
  146. avatar: avatar,
  147. };
  148. },
  149. handleOpenInfo() {
  150. if (!this.userInfo) return
  151. uni.navigateTo({
  152. url: 'info'
  153. });
  154. },
  155. handleNav(val) {
  156. let url = '';
  157. switch (val) {
  158. case 1:
  159. url = 'enterpriseInfo'
  160. break
  161. case 2:
  162. url = 'enterpriseTeam'
  163. break
  164. case 3:
  165. url = 'auth'
  166. break
  167. case 5:
  168. url = 'coupon'
  169. break
  170. case 6:
  171. url = 'commonQuestion'
  172. break
  173. case 7:
  174. url = 'about'
  175. break
  176. }
  177. uni.navigateTo({
  178. url
  179. });
  180. }
  181. }
  182. };
  183. </script>
  184. <style lang="scss" scoped>
  185. @import 'index.scss';
  186. </style>