mine.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <view class="mine">
  3. <view class="top">
  4. <view class="top_title" :style="{ 'padding-top': top + 'px', height: height + 'px', 'line-height': height + 'px' }">我的</view>
  5. <view class="top_con flexA">
  6. <view class="left flexS">
  7. <view class="avatar"><open-data type="userAvatarUrl"></open-data></view>
  8. <view>
  9. <view class="nikename"><open-data type="userNickName"></open-data></view>
  10. <view class="role flexC">
  11. <text class="iconfont iconwodexunzhang" style="font-size: 30rpx;margin-right: 5rpx;"></text>
  12. <text>{{ userInfo.level ? userInfo.level : '管理员' }}</text>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="right flexS" @click="skipDetail(8)">
  17. <text>个人资料</text>
  18. <text class="iconfont iconyoujiantou" style="font-size:25rpx;color:#fff;margin-left:3rpx;"></text>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="middle flexA" v-if="userInfo.type == 0">
  23. <view class="flexCC" @click="skipDetail(5)">
  24. <image src="../../static/imgs/voucher.png" style="width: 46rpx;height:36rpx;"></image>
  25. <text>报名凭证</text>
  26. </view>
  27. <view class="flexCC" @click="skipDetail(6)">
  28. <image src="../../static/imgs/mine_collect.png" style="width: 46rpx;height:41rpx;"></image>
  29. <text>我的收藏</text>
  30. </view>
  31. <!-- <view class="flexCC" @click="skipDetail(10)">
  32. <image src="../../static/imgs/note_in.png" style="width: 42rpx;height:42rpx;"></image>
  33. <text>我的便签</text>
  34. </view> -->
  35. </view>
  36. <view class="list">
  37. <view class="list_con flexB" @click="skipDetail(1)" v-if="userInfo.type == 0">
  38. <view class="flexS">
  39. <image src="../../static/imgs/military_order.png" style="width: 45rpx;height:40rpx;"></image>
  40. <text>军令状</text>
  41. </view>
  42. <text class="arrow iconfont iconyoujiantou"></text>
  43. </view>
  44. <view class="list_con flexB" @click="skipDetail(2)" v-if="userInfo.type == 0">
  45. <view class="flexS">
  46. <image src="../../static/imgs/bill.png" style="width: 36rpx;height:41rpx;"></image>
  47. <text>我的账单</text>
  48. </view>
  49. <text class="arrow iconfont iconyoujiantou"></text>
  50. </view>
  51. <view class="list_con flexB" @click="skipDetail(3)" v-if="userInfo.type == 1">
  52. <view class="flexS">
  53. <image src="../../static/imgs/sign_in.png" style="width: 36rpx;height:42rpx;"></image>
  54. <text>签到码</text>
  55. </view>
  56. <text class="arrow iconfont iconyoujiantou"></text>
  57. </view>
  58. <!-- <view class="list_con flexB" @click="skipDetail(4)" v-if="userInfo.type == 0">
  59. <view class="flexS">
  60. <image src="../../static/imgs/role.png" style="width: 38rpx;height:42rpx;"></image>
  61. <text>身份徽章</text>
  62. </view>
  63. <text class="arrow iconfont iconyoujiantou"></text>
  64. </view> -->
  65. <view class="list_con flexB" @click="skipDetail(6)" v-if="userInfo.type == 1">
  66. <view class="flexS">
  67. <image src="../../static/imgs/mine_collect.png" style="width: 46rpx;height:41rpx;"></image>
  68. <text>我的收藏</text>
  69. </view>
  70. <text class="arrow iconfont iconyoujiantou"></text>
  71. </view>
  72. <view class="list_con flexB" @click="skipDetail(7)" v-if="userInfo.type == 0">
  73. <view class="flexS">
  74. <image src="../../static/imgs/history.png" style="width: 38rpx;height:38rpx;"></image>
  75. <text>报名历史</text>
  76. </view>
  77. <text class="arrow iconfont iconyoujiantou"></text>
  78. </view>
  79. <!-- <view class="list_con flexB" @click="skipDetail(9)">
  80. <view class="flexS">
  81. <image src="../../static/imgs/msg_board.png" style="width: 38rpx;height:35rpx;"></image>
  82. <text>留言板</text>
  83. </view>
  84. <text class="arrow iconfont iconyoujiantou"></text>
  85. </view> -->
  86. <view class="list_con flexB">
  87. <view class="flexS">
  88. <image src="../../static/imgs/join_num.png" style="width: 40rpx;height:40rpx;"></image>
  89. <text>参加次数(实战营)</text>
  90. </view>
  91. <text>{{ userInfo.join_one_num || 0 }}次</text>
  92. </view>
  93. <view v-if="userInfo.level === '代理公司'" class="list_con flexB">
  94. <view class="flexS">
  95. <image src="../../static/imgs/join_num.png" style="width: 40rpx;height:40rpx;"></image>
  96. <text>参加次数(密训营)</text>
  97. </view>
  98. <text>{{ userInfo.join_two_num || 0 }}次</text>
  99. </view>
  100. </view>
  101. </view>
  102. </template>
  103. <script>
  104. export default {
  105. data() {
  106. return {
  107. currentPage: 'mine',
  108. top: '', //胶囊距顶部的距离
  109. height: '', //胶囊的高度
  110. userInfo: '' //用户信息
  111. };
  112. },
  113. onLoad() {
  114. let { top, height } = wx.getMenuButtonBoundingClientRect(); //获取胶囊的高度和距顶部的距离
  115. this.top = top;
  116. this.height = height;
  117. },
  118. onShow() {
  119. if (uni.getStorageSync('userInfo')) {
  120. this.userInfo = uni.getStorageSync('userInfo');
  121. }
  122. },
  123. methods: {
  124. /*跳转到详情页
  125. * id
  126. *【1:军令状】 【2:我的账单】【3:签到码】
  127. *【4:身份徽章】 【5:报名凭证】 【6:我的收藏】
  128. *【7:报名历史】【8:个人信息】 【9:留言板】
  129. * 【10:便签】
  130. */
  131. skipDetail(id) {
  132. if ((id === 5 || id === 1 || id === 4) && !this.userInfo.sign_type) {
  133. uni.showModal({
  134. content: '您还没有报过名',
  135. showCancel: false
  136. });
  137. return false;
  138. }
  139. if (id === 1 && this.userInfo.enroll_t) {
  140. uni.showModal({
  141. title: '温馨提示',
  142. content: '已发生过一次退款,无法查看军令状\n给您带来不便,敬请谅解!',
  143. showCancel: false
  144. });
  145. return false;
  146. }
  147. let url = '';
  148. switch (id) {
  149. case 1:
  150. url = '../military_order/military_order'; //军令状
  151. break;
  152. case 2:
  153. url = '../my_bill/my_bill'; //我的账单
  154. break;
  155. case 3:
  156. url = '../sign_in_code/sign_in_code'; //签到码
  157. break;
  158. case 4:
  159. url = '../identity/identity'; //身份徽章
  160. break;
  161. case 5:
  162. url = '../sign_up_voucher/sign_up_voucher'; //报名凭证
  163. break;
  164. case 6:
  165. url = '../my_collect/my_collect'; //我的收藏
  166. break;
  167. case 7:
  168. url = '../sign_up_history/sign_up_history'; //报名历史
  169. break;
  170. case 8:
  171. url = '../personal_info/personal_info'; //个人信息
  172. break;
  173. case 9:
  174. url = '../msg_board/msg_board'; //留言板
  175. break;
  176. case 10:
  177. url = '../note_pad/note_pad'; //便签
  178. break;
  179. dedault: break;
  180. }
  181. uni.navigateTo({
  182. url
  183. });
  184. }
  185. }
  186. };
  187. </script>
  188. <style>
  189. page {
  190. height: 100%;
  191. width: 100%;
  192. background: #f9f9f9;
  193. }
  194. </style>
  195. <style lang="scss">
  196. .mine {
  197. .top {
  198. width: 100%;
  199. height: 360rpx;
  200. background: #f44242;
  201. color: #fff;
  202. .top_title {
  203. font-size: 36rpx;
  204. text-align: center;
  205. }
  206. .top_con {
  207. margin-top: 80rpx;
  208. .left {
  209. .avatar {
  210. height: 88rpx;
  211. width: 88rpx;
  212. border-radius: 50%;
  213. overflow: hidden;
  214. margin-right: 30rpx;
  215. }
  216. .nikename {
  217. font-size: 32rpx;
  218. }
  219. .role {
  220. width: 160rpx;
  221. height: 38rpx;
  222. background: #fff;
  223. border-radius: 44rpx;
  224. margin-top: 14rpx;
  225. image {
  226. width: 26rpx;
  227. height: 28rpx;
  228. }
  229. text {
  230. font-size: 24rpx;
  231. color: #e94941;
  232. }
  233. }
  234. }
  235. .right {
  236. text {
  237. font-size: 28rpx;
  238. }
  239. }
  240. }
  241. }
  242. .middle,
  243. .list {
  244. width: 690rpx;
  245. background: #fff;
  246. margin: 0 auto;
  247. border-radius: 6rpx;
  248. color: #656565;
  249. font-size: 28rpx;
  250. }
  251. .middle {
  252. margin: -50rpx auto 0;
  253. height: 160rpx;
  254. text {
  255. margin-top: 30rpx;
  256. color: #656565;
  257. font-size: 28rpx;
  258. }
  259. }
  260. .list {
  261. margin-top: 20rpx;
  262. .list_con {
  263. height: 106rpx;
  264. border-bottom: 1rpx solid #f9f9f9;
  265. padding: 0 30rpx;
  266. box-sizing: border-box;
  267. text {
  268. margin-left: 24rpx;
  269. }
  270. }
  271. .arrow {
  272. color: #343434;
  273. font-size: 30rpx;
  274. }
  275. }
  276. }
  277. </style>