wallet.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <view>
  3. <navbar :iSimmersive="true" title-color="#ffffff" :placeholder="false" title="我的钱包"></navbar>
  4. <view class="header">
  5. <image v-if="static" :src="static+'app/wallet-bg.png'"></image>
  6. <view class="header-warp">
  7. <view class="info">
  8. <view>总资产(元)</view>
  9. <view>{{amount}}</view>
  10. <view v-if="switch_1">
  11. <text>累计充值(元):{{rechange_amount||"0.00"}}</text>
  12. <text>|</text>
  13. <text>累计消费(元):{{consume_amount||"0.00"}}</text>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="log" v-if="switch_2">
  19. <view class="log-box" @click="$utils.navigateTo('bill/cashlist')">
  20. <view><image v-if="static" :src="static+'app/wallet/1.png'"></image></view>
  21. <view>申请提现</view>
  22. </view>
  23. <view class="log-box" @click="$utils.navigateTo('bill/fund')">
  24. <view><image v-if="static" :src="static+'app/wallet/2.png'"></image></view>
  25. <view>资金明细</view>
  26. </view>
  27. <view class="log-box" @click="$utils.navigateTo('ucenter/point')">
  28. <view><image v-if="static" :src="static+'app/wallet/3.png'"></image></view>
  29. <view>积分中心</view>
  30. </view>
  31. </view>
  32. <view class="receive">
  33. <view class="c" @click="$utils.navigateTo('point/index')">
  34. <view>
  35. <text>积分商品兑换</text>
  36. <text>赚积分抵现金</text>
  37. </view>
  38. </view>
  39. <view class="c" @click="$utils.navigateTo('coupon/index')">
  40. <view>
  41. <text>领取优惠券</text>
  42. <text>满减享优惠</text>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="guide">
  47. <view class="guide-box" @click="$utils.navigateTo('group/index')">
  48. <view><image v-if="static" :src="static+'app/wallet/6.png'"></image></view>
  49. <view>拼团</view>
  50. </view>
  51. <view class="guide-box" @click="$utils.navigateTo('regiment/index')">
  52. <view><image v-if="static" :src="static+'app/wallet/7.png'"></image></view>
  53. <view>团购</view>
  54. </view>
  55. <view class="guide-box" @click="$utils.navigateTo('second/index')">
  56. <view><image v-if="static" :src="static+'app/wallet/8.png'"></image></view>
  57. <view>秒杀</view>
  58. </view>
  59. <!-- view class="guide-box" @click="$utils.navigateTo('point/index')">
  60. <view><image v-if="static" :src="static+'app/wallet/9.png'"></image></view>
  61. <view>积分商品</view>
  62. </view -->
  63. <view class="guide-box" @click="$utils.navigateTo('special/index')">
  64. <view><image v-if="static" :src="static+'app/wallet/10.png'"></image></view>
  65. <view>会员特价</view>
  66. </view>
  67. <!-- view class="guide-box" @click="$utils.navigateTo('special/index')">
  68. <view><image v-if="static" :src="static+'app/wallet/11.png'"></image></view>
  69. <view>购物满减</view>
  70. </view -->
  71. </view>
  72. </view>
  73. </template>
  74. <script>
  75. import navbar from "@/components/navbar/navbar";
  76. export default {
  77. components: {
  78. navbar
  79. },
  80. data() {
  81. return {
  82. static: "",
  83. amount:0.00,
  84. rechange_amount:0.00,
  85. consume_amount:0.00,
  86. switch_1: 0,
  87. switch_2: 0
  88. };
  89. },
  90. onLoad() {
  91. this.static = this.$static;
  92. },
  93. onShow() {
  94. this.$utils.navigateTo()
  95. let users = this.$storage.getJson("users");
  96. this.amount = users.amount;
  97. this.$http.getWallet().then((res)=>{
  98. if(res.status){
  99. this.amount = res.data.amount;
  100. this.rechange_amount = res.data.rechange_amount;
  101. this.consume_amount = res.data.consume_amount;
  102. // #ifdef MP
  103. this.switch_1 = res.data.switch_1;
  104. this.switch_2 = res.data.switch_2;
  105. // #endif
  106. // #ifdef H5 || APP-PLUS
  107. this.switch_1 = 1;
  108. this.switch_2 = 1;
  109. // #endif
  110. }
  111. });
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .header{
  117. width: 100%;
  118. height: 400rpx;
  119. position: relative;
  120. z-index: 1;
  121. image {
  122. width: 100%;
  123. height: 400rpx;
  124. }
  125. .header-warp { position: absolute; top:0; left: 0; width: 100%; height: 400rpx; z-index: 2; }
  126. .rechange{
  127. position: absolute;
  128. top: 135rpx;
  129. right: 0;
  130. width: 180rpx;
  131. height: 60rpx;
  132. line-height: 60rpx;
  133. background-color: #6183db;
  134. color: #fff;
  135. border-top-left-radius: 100rpx;
  136. border-bottom-left-radius: 100rpx;
  137. text-align: center;
  138. z-index: 9999;
  139. }
  140. .info{
  141. position: absolute;
  142. top: 135rpx;
  143. left: 30rpx;
  144. color: #fff;
  145. view:nth-child(1){
  146. font-size: 35rpx;
  147. }
  148. view:nth-child(2){
  149. font-size: 58rpx;
  150. padding-top: 20rpx;
  151. }
  152. view:nth-child(3){
  153. font-size: 26rpx;
  154. padding-top: 30rpx;
  155. text:nth-child(2){
  156. padding: 0 10rpx;
  157. position: relative;
  158. top: -2rpx;
  159. }
  160. }
  161. }
  162. }
  163. .log{
  164. display: flex;
  165. flex-wrap: nowrap;
  166. flex-direction: row;
  167. background-color: #fff;
  168. .log-box {
  169. width: 33.333%;
  170. height: 200rpx;
  171. font-size: 30rpx;
  172. view {
  173. display: block;
  174. text-align: center;
  175. &:first-child{
  176. margin-top: 40rpx;
  177. }
  178. &:last-child {
  179. margin-top: 20rpx;
  180. }
  181. }
  182. &:nth-child(1){
  183. image { width: 62rpx; height: 58rpx; }
  184. }
  185. &:nth-child(2){
  186. image { width: 54rpx; height: 62rpx; }
  187. }
  188. &:nth-child(3){
  189. image { width: 72rpx; height: 56rpx; }
  190. }
  191. }
  192. }
  193. .receive{
  194. width: 100%;
  195. height: 180rpx;
  196. margin-top: 20rpx;
  197. background-color: #fff;
  198. display: flex;
  199. flex-direction: row;
  200. flex-wrap: nowrap;
  201. .c {
  202. width: 50%;
  203. height: 180rpx;
  204. view{
  205. position: relative;
  206. margin-top: 40rpx;
  207. margin-left: 120rpx;
  208. text:first-child { font-size: 32rpx; color: #1b43c4 }
  209. text:last-child { padding-top: 8rpx; font-size: 24rpx; color: #999999; }
  210. }
  211. &:first-child view:before {
  212. position: absolute;
  213. left: -80rpx;
  214. top: 12rpx;
  215. content: " ";
  216. width: 60rpx;
  217. height: 66rpx;
  218. background-size: 100%;
  219. background-repeat: no-repeat;
  220. background-image: url(~@/static/images/wallet/4.png);
  221. }
  222. &:last-child view:before {
  223. position: absolute;
  224. left: -64rpx;
  225. top: -2rpx;
  226. content: " ";
  227. width: 46rpx;
  228. height: 82rpx;
  229. background-size: 100%;
  230. background-repeat: no-repeat;
  231. background-image: url(~@/static/images/wallet/5.png);
  232. }
  233. text {
  234. display: block;
  235. }
  236. }
  237. }
  238. .guide{
  239. width: 100%;
  240. margin-top: 20rpx;
  241. background-color: #fff;
  242. display: flex;
  243. flex-direction: row;
  244. flex-wrap: wrap;
  245. margin-bottom: 20rpx;
  246. .guide-box {
  247. width: 50%;
  248. height: 90rpx;
  249. line-height: 90rpx;
  250. border-bottom: 4rpx solid #f9f9f9;
  251. padding: 40rpx 0;
  252. font-size: 32rpx;
  253. image { width: 90rpx; height: 90rpx; display: block; }
  254. view {
  255. float: left;
  256. &:first-child { margin-left: 70rpx; }
  257. &:last-child { margin-left: 30rpx; }
  258. }
  259. }
  260. }
  261. </style>