treasure.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <template>
  2. <view>
  3. <hua-page-head :pageTitle="pageTitle" color="#fff"></hua-page-head>
  4. <view class="container">
  5. <view class="user-info d-flex justify-content-between align-items-center">
  6. <view class="info d-flex align-items-center">
  7. <view class="avatar">
  8. <image :src="userInfo.avatar" mode=""></image>
  9. </view>
  10. <view class="cont">
  11. <view class="name">{{ userInfo.nickname }}</view>
  12. <view class="up">上级分销商:无</view>
  13. </view>
  14. </view>
  15. <view class="level">{{ data.level_name }}</view>
  16. </view>
  17. <view class="account bg-white radius10">
  18. <view class="top d-flex justify-content-between align-items-center">
  19. <view class="item">
  20. <view class="txt">抵用券余额</view>
  21. <view class="num">{{ data.energy }}</view>
  22. </view>
  23. <view class="item">
  24. <view class="txt">今日抵用券余额</view>
  25. <view class="num">{{ data.todayenergy }}</view>
  26. </view>
  27. <view class="item">
  28. <view class="txt">邀请有效账号</view>
  29. <view class="num">{{ data.ztui }}</view>
  30. </view>
  31. </view>
  32. <view class="wrap">
  33. <view class="acc-data d-flex justify-content-between flex-wrap">
  34. <view class="item">
  35. <view class="txt">累计推荐商家(奖励抵用券)</view>
  36. <view class="num">{{ data.tshopenergy }}</view>
  37. </view>
  38. <view class="item">
  39. <view class="txt">累计推荐用户(奖励抵用券)</view>
  40. <view class="num">{{ data.tuserenergy }}</view>
  41. </view>
  42. <view class="item">
  43. <view class="txt">月度收益抵用券</view>
  44. <view class="num">{{ data.menergy }}</view>
  45. </view>
  46. <view class="item">
  47. <view class="txt">总收益抵用券</view>
  48. <view class="num">{{ data.totalenergy }}</view>
  49. </view>
  50. </view>
  51. <router-link to="/pages/user/energy-transfer"><button class="btn">转让抵用券</button></router-link>
  52. <router-link to="/bundle/pages/user_fans/user_fans"><button class="btn">我的团队</button></router-link>
  53. </view>
  54. </view>
  55. <view class="user-code d-flex justify-content-between align-items-center bg-white radius10">
  56. <view class="title">
  57. 我的邀请码
  58. <text class="tip">点击复制即可</text>
  59. </view>
  60. <view class="code" @tap.stop="onCopy">{{ inviteCode }}</view>
  61. </view>
  62. <view class="menu bg-white radius10">
  63. <router-link to="/pages/user/energy-detials">
  64. <view class="item d-flex justify-content-between align-items-center">
  65. <view class="title">抵用券明细</view>
  66. <text class="iconfont">&#xe63c;</text>
  67. </view>
  68. </router-link>
  69. <view class="item d-flex justify-content-between align-items-center">
  70. <view class="title">推广商家</view>
  71. <text class="num">{{ data.tshop }}家</text>
  72. </view>
  73. <view class="item d-flex justify-content-between align-items-center">
  74. <view class="title">推广用户</view>
  75. <text class="num">{{ data.tuser }}人</text>
  76. </view>
  77. <view class="item d-flex justify-content-between align-items-center">
  78. <view class="title">奖励规则</view>
  79. <text class="iconfont">&#xe63c;</text>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. import {
  87. apiEnergy
  88. } from '@/api/shop.js';
  89. import {
  90. mapGetters,
  91. mapActions
  92. } from 'vuex';
  93. import {
  94. copy
  95. } from '@/utils/tools';
  96. export default {
  97. data() {
  98. return {
  99. pageTitle: '宝藏密码',
  100. data: {}
  101. };
  102. },
  103. onShow() {
  104. this.getEnergy();
  105. },
  106. methods: {
  107. ...mapActions(['getUser']),
  108. onCopy(e) {
  109. copy(this.userInfo.sn);
  110. },
  111. goBack() {
  112. uni.navigateBack({
  113. delta: 1
  114. });
  115. },
  116. async getEnergy() {
  117. const {
  118. data,
  119. code
  120. } = await apiEnergy();
  121. if (code == 1) {
  122. console.log(data);
  123. this.data = data;
  124. }
  125. }
  126. },
  127. computed: {
  128. ...mapGetters(['userInfo', 'inviteCode'])
  129. }
  130. };
  131. </script>
  132. <style lang="scss">
  133. page {
  134. background: #f3f4f6 url('https://shop.xianghuaqi.net.cn/images/treasureBg.png') no-repeat;
  135. background-size: 100%;
  136. }
  137. .container {
  138. padding: 0 24rpx;
  139. box-sizing: border-box;
  140. }
  141. .page-head {
  142. height: 80rpx;
  143. line-height: 80rpx;
  144. position: relative;
  145. color: #fff;
  146. .iconfont {
  147. position: absolute;
  148. left: 24rpx;
  149. top: 50%;
  150. transform: translateY(-50%) rotateY(180deg);
  151. }
  152. .title {
  153. font-weight: bold;
  154. }
  155. }
  156. .user-info {
  157. margin: 32rpx auto;
  158. .info {
  159. color: #fff;
  160. .avatar {
  161. image {
  162. width: 120rpx;
  163. height: 120rpx;
  164. border-radius: 50%;
  165. }
  166. margin-right: 20rpx;
  167. }
  168. .cont {
  169. line-height: 40rpx;
  170. }
  171. }
  172. .level {
  173. background: linear-gradient(151deg, #ffe9d1 0%, #ffd2a7 100%);
  174. border-radius: 14px;
  175. font-size: 24rpx;
  176. color: #f73e33;
  177. width: 160rpx;
  178. height: 56rpx;
  179. text-align: center;
  180. line-height: 56rpx;
  181. }
  182. }
  183. .account {
  184. margin: 32rpx auto;
  185. .top {
  186. background: linear-gradient(158deg, #fef6e1 0%, #f5e4be 100%);
  187. border-radius: 10px 10px 0px 0px;
  188. height: 186rpx;
  189. .item {
  190. text-align: center;
  191. flex-basis: 100%;
  192. .txt {
  193. font-size: 20rpx;
  194. color: #b18044;
  195. }
  196. .num {
  197. margin-top: 12rpx;
  198. font-weight: 600;
  199. font-size: 32rpx;
  200. color: #823308;
  201. }
  202. }
  203. }
  204. .wrap {
  205. padding: 40rpx;
  206. box-sizing: border-box;
  207. .item {
  208. width: 50%;
  209. border-bottom: 1px solid #f3f4f6;
  210. border-right: 1px solid #f3f4f6;
  211. padding: 40rpx 0;
  212. .txt {
  213. color: #616161;
  214. font-size: 20rpx;
  215. }
  216. .num {
  217. font-size: 32rpx;
  218. color: #040404;
  219. font-weight: 600;
  220. margin-top: 12rpx;
  221. }
  222. &:nth-child(3),
  223. &:nth-child(4) {
  224. border-bottom: none;
  225. }
  226. &:nth-child(2n) {
  227. padding-left: 20rpx;
  228. border-right: none;
  229. }
  230. }
  231. .btn {
  232. background: linear-gradient(142deg, #f16d60 0%, #f8352b 100%);
  233. border-radius: 25px;
  234. color: #fff;
  235. margin-top: 30rpx;
  236. }
  237. }
  238. }
  239. .user-code {
  240. height: 100rpx;
  241. padding: 0 24rpx;
  242. .title {
  243. font-size: 28rpx;
  244. color: #363636;
  245. .tip {
  246. color: #aaaaaa;
  247. font-size: 24rpx;
  248. margin-left: 20rpx;
  249. }
  250. }
  251. .code {
  252. padding: 10rpx 20rpx;
  253. background-color: #f3f4f6;
  254. border-radius: 30rpx;
  255. font-size: 28rpx;
  256. font-weight: 600;
  257. }
  258. }
  259. .menu {
  260. margin: 24rpx auto;
  261. padding: 0 24rpx;
  262. box-sizing: border-box;
  263. .item {
  264. padding: 30rpx 0;
  265. box-sizing: border-box;
  266. border-bottom: 1px solid #f3f4f6;
  267. .title {
  268. color: #040404;
  269. font-size: 28rpx;
  270. font-weight: 600;
  271. }
  272. .num {
  273. color: #040404;
  274. font-weight: 600;
  275. }
  276. }
  277. }
  278. </style>