collection.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view class="content">
  3. <view class="collection-box">
  4. <view class="collection-item" @click="nav('/pages/collection/bank')">
  5. <view class="left">
  6. <view class="img"><image src="../../static/user/mybank.png" mode=""></image></view>
  7. <view class="bank">银行卡</view>
  8. </view>
  9. <view class="gg" >
  10. <view class="status" v-if="bankData.name != null">{{ bankData.name}}</view>
  11. <view class="status" v-else>未添加</view>
  12. <view class="img1"><text class="iconfont iconenter"></text></view>
  13. </view>
  14. </view>
  15. <view class="collection-item" @click="nav('/pages/collection/zfb')">
  16. <view class="left">
  17. <view class="img"><image src="../../static/user/zfb.png" mode=""></image></view>
  18. <view class="bank">支付宝</view>
  19. </view>
  20. <view class="gg" >
  21. <view class="status" v-if="aliData.name != null">{{aliData.name}}</view>
  22. <view class="status" v-else>未添加</view>
  23. <view class="img1"><text class="iconfont iconenter"></text></view>
  24. </view>
  25. </view>
  26. <view class="collection-item" @click="nav('/pages/collection/wx')">
  27. <view class="left">
  28. <view class="img">
  29. <image src="../../static/user/wx.png" mode=""></image>
  30. </view>
  31. <view class="bank">
  32. 微信
  33. </view>
  34. </view>
  35. <view class="gg" >
  36. <view class="status" v-if="wx.name != null">{{wx.name}}</view>
  37. <view class="status" v-else>未添加</view>
  38. <view class="img1">
  39. <text class="iconfont iconenter"></text>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. import { mapState, mapMutations } from 'vuex';
  48. import { pay_list } from '../../api/wallet.js'
  49. export default {
  50. data() {
  51. return {
  52. aliData: {},
  53. bankData: {},
  54. wx:{},
  55. };
  56. },
  57. computed: {
  58. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
  59. },
  60. onShow() {
  61. this.loadDate();
  62. },
  63. methods: {
  64. nav(url) {
  65. uni.navigateTo({
  66. url
  67. });
  68. },
  69. loadDate() {
  70. pay_list().then(({data}) =>{
  71. this.wx = data.wx
  72. this.aliData = data.zfb
  73. this.bankData = data.bank
  74. })
  75. }
  76. }
  77. };
  78. </script>
  79. <style lang="scss">
  80. page,
  81. .content {
  82. height: 100%;
  83. margin: 0;
  84. height: 0;
  85. }
  86. .collection-box {
  87. background: #ffffff;
  88. margin: 50rpx 20rpx;
  89. width: 710rpx;
  90. display: flex;
  91. flex-direction: column;
  92. .collection-item {
  93. margin: 35rpx 30rpx;
  94. display: flex;
  95. justify-content: space-between;
  96. .left {
  97. display: flex;
  98. .img {
  99. height: 40rpx;
  100. width: 40rpx;
  101. image {
  102. height: 100%;
  103. width: 100%;
  104. }
  105. }
  106. .bank {
  107. margin-left: 25rpx;
  108. font-size: 26rpx;
  109. font-family: PingFang SC;
  110. font-weight: 500;
  111. color: #333333;
  112. }
  113. }
  114. .gg {
  115. display: flex;
  116. .status {
  117. font-size: 26rpx;
  118. font-family: PingFang SC;
  119. font-weight: 500;
  120. color: #999999;
  121. margin-right: 20rpx;
  122. }
  123. .img1 {
  124. width: 15rpx;
  125. height: 25rpx;
  126. image {
  127. width: 100%;
  128. height: 100%;
  129. }
  130. }
  131. }
  132. }
  133. }
  134. </style>