user_wallet.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <view class="user-wallet">
  3. <view class="contain bg-white m-b-20">
  4. <!-- 资产总计 -->
  5. <view class="header">
  6. <view class="white m-b-20">
  7. <view class="xs">总资产(元)</view>
  8. <view style="font-size: 76rpx">{{wallet.user_money || '0.00'}}</view>
  9. </view>
  10. <view class="money white flex">
  11. <view class="item">
  12. <view class="xs">累计充值(元)</view>
  13. <view style="font-size: 38rpx">{{wallet.total_recharge_amount || '0.00'}}</view>
  14. </view>
  15. <view class="item">
  16. <view class="xs">累计消费(元)</view>
  17. <view style="font-size: 38rpx">{{wallet.total_order_amount || '0.00'}}</view>
  18. </view>
  19. <template v-if="wallet.open_racharge">
  20. <router-link style="height: 58rpx;" class="flex primary bg-white br60 btn" size="xs"
  21. to="/bundle/pages/user_payment/user_payment">充值</router-link>
  22. </template>
  23. </view>
  24. </view>
  25. <!-- 资金明细 -->
  26. <view class="nav flex">
  27. <!-- <router-link class="nav-item">
  28. <view class="flex-col col-center">
  29. <image class="icon" src="../../static/icon_yezz.png"></image>
  30. <view class="m-t-10 sm">余额转账</view>
  31. </view>
  32. </router-link> -->
  33. <router-link class="nav-item" to="/bundle/pages/user_withdraw/user_withdraw">
  34. <view class="flex-col col-center">
  35. <image class="icon" src="../../static/icon_czjl.png"></image>
  36. <view class="m-t-10 sm">余额提现</view>
  37. </view>
  38. </router-link>
  39. <router-link class="nav-item" to="/bundle/pages/user_withdraw_code/user_withdraw_code">
  40. <view class="flex-col col-center">
  41. <image class="icon" src="../../static/icon_zhmx.png"></image>
  42. <view class="m-t-10 sm">提现记录</view>
  43. </view>
  44. </router-link>
  45. <router-link class="nav-item" to="/bundle/pages/user_bill/user_bill">
  46. <view class="flex-col col-center">
  47. <image class="icon" src="../../static/icon_zhmx.png"></image>
  48. <view class="m-t-10 sm">账户明细</view>
  49. </view>
  50. </router-link>
  51. <!-- <router-link class="nav-item">
  52. <view class="flex-col col-center">
  53. <image class="icon" src="../../static/icon_zzjl.png"></image>
  54. <view class="m-t-10 sm">转账记录</view>
  55. </view>
  56. </router-link> -->
  57. <router-link class="nav-item" to="/bundle/pages/recharge_record/recharge_record">
  58. <view class="flex-col col-center">
  59. <image class="icon" src="../../static/icon_czjl.png"></image>
  60. <view class="m-t-10 sm">充值记录</view>
  61. </view>
  62. </router-link>
  63. </view>
  64. <!-- 热门活动 -->
  65. <view class="activity">
  66. <view class="activity-title xl flex">
  67. <view class="m-r-20 bg-primary" style="width: 6rpx;height: 30rpx;"></view>
  68. <text>热门活动</text>
  69. </view>
  70. <block v-for="(item, index) in activityList" :key="item.title">
  71. <view class="activity-item flex row-between" :style="{backgroundColor: item.background}">
  72. <view>
  73. <view class="xl normal" style="font-weight: 500;">{{ item.title }}</view>
  74. <view class="muted sm m-t-10">{{ item.slogan }}</view>
  75. <router-link style="display: inline-block;" :to="item.href">
  76. <view :style="{backgroundColor: item.buttonColor}"
  77. class="br60 white join-btn flex row-center">立即参与</view>
  78. </router-link>
  79. </view>
  80. <image style="width:274rpx; height: 210rpx;" :src="item.image"></image>
  81. </view>
  82. </block>
  83. </view>
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. // +----------------------------------------------------------------------
  89. // | likeshop开源商城系统
  90. // +----------------------------------------------------------------------
  91. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  92. // | gitee下载:https://gitee.com/likeshop_gitee
  93. // | github下载:https://github.com/likeshop-github
  94. // | 访问官网:https://www.likeshop.cn
  95. // | 访问社区:https://home.likeshop.cn
  96. // | 访问手册:http://doc.likeshop.cn
  97. // | 微信公众号:likeshop技术社区
  98. // | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
  99. // | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
  100. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  101. // | likeshop团队版权所有并拥有最终解释权
  102. // +----------------------------------------------------------------------
  103. // | author: likeshop.cn.team
  104. // +----------------------------------------------------------------------
  105. import {
  106. getWallet
  107. } from '@/api/user';
  108. export default {
  109. data() {
  110. return {
  111. wallet: {},
  112. // 热门活动列表数据
  113. activityList: [
  114. {
  115. title: "领取优惠券",
  116. slogan: "每日优惠券抢不停",
  117. button: "立即抢购",
  118. buttonColor: "#FC597A",
  119. href: "/pages/get_coupon/get_coupon",
  120. image: "/bundle/static/img_activity_coupon.png",
  121. background: "rgba(252, 89, 122, 0.1)"
  122. },
  123. {
  124. title: "超值商品 限时秒杀",
  125. slogan: "最新商品秒杀中",
  126. button: "立即抢购",
  127. buttonColor: "#FF2C3C",
  128. href: "/bundle/pages/goods_seckill/goods_seckill",
  129. image: "/bundle/static/img_activity_seckill.png",
  130. background: "rgba(236, 71, 37, 0.1)"
  131. }
  132. ]
  133. };
  134. },
  135. onShow() {
  136. this.getWalletFun();
  137. },
  138. methods: {
  139. getWalletFun() {
  140. getWallet().then(res => {
  141. if (res.code == 1) {
  142. this.wallet = res.data
  143. }
  144. });
  145. },
  146. }
  147. };
  148. </script>
  149. <style lang="scss">
  150. .user-wallet {
  151. .contain {
  152. padding: 20rpx 30rpx 36rpx;
  153. .header {
  154. position: relative;
  155. background: linear-gradient(180deg, rgba(255, 44, 60, 1) 0%, rgba(255, 49, 106, 1) 100%);
  156. border-radius: 20rpx;
  157. height: 320rpx;
  158. padding: 50rpx 30rpx 30rpx;
  159. box-sizing: border-box;
  160. .money {
  161. .item {
  162. flex: 1;
  163. }
  164. }
  165. .btn {
  166. position: absolute;
  167. right: 30rpx;
  168. top: 50rpx;
  169. padding: 0 51rpx;
  170. }
  171. }
  172. .nav {
  173. border-bottom: $-solid-border;
  174. .nav-item {
  175. width: 25%;
  176. padding: 40rpx 0;
  177. .icon {
  178. width: 52rpx;
  179. height: 52rpx;
  180. }
  181. }
  182. }
  183. }
  184. }
  185. .activity {
  186. padding: 40rpx 0rpx;
  187. .activity-title {
  188. font-weight: bold;
  189. }
  190. .activity-item {
  191. padding: 15rpx 40rpx;
  192. // box-shadow: 0px 0rpx 20rpx rgba(0, 0, 0, 0.16);
  193. margin-top: 34rpx;
  194. .join-btn {
  195. height: 52rpx;
  196. width: 156rpx;
  197. margin-top: 24rpx;
  198. }
  199. }
  200. }
  201. </style>