Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

bank-card.vue 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view class="container" @click="navTo('/subpackage/personal-center/setting/bank-card/bank-card-add')">
  3. <view class="">
  4. <image class="bg" style="width:100%;height: 260rpx;" :src="`${$imgUrl}bank-bg.png`"></image>
  5. <view class="content">
  6. <view class="flex">
  7. <image style="width:68rpx;height:68rpx;" :src="`${$imgUrl}gongshang.png`">
  8. </image>
  9. <view style="margin-left: 15rpx;" class="">
  10. <view class="bank">工商银行</view>
  11. <view class="card">储蓄卡</view>
  12. </view>
  13. </view>
  14. <view class="button" @click.stop='delCard(11)'>解除绑定</view>
  15. </view>
  16. <view class="value">6216 **** **** 8721</view>
  17. <!-- <view class='default'>默认</view> -->
  18. </view>
  19. </view>
  20. <view class="container" @click="navTo('/subpackage/personal-center/setting/bank-card/bank-card-add')">
  21. <view class="">
  22. <image class="bg" style="width:100%;height: 260rpx;" :src="`${$imgUrl}bank-bg.png`"></image>
  23. <view class="content">
  24. <view class="flex">
  25. <image style="width:68rpx;height:68rpx;" :src="`${$imgUrl}gongshang.png`">
  26. </image>
  27. <view style="margin-left: 15rpx;" class="">
  28. <view class="bank">工商银行</view>
  29. <view class="card">储蓄卡</view>
  30. </view>
  31. </view>
  32. <view class="button" @click.stop='delCard()'>解除绑定</view>
  33. </view>
  34. <view class="value">6216 **** **** 8721</view>
  35. <view class='default'>默认</view>
  36. </view>
  37. </view>
  38. <view style='margin: 40rpx 30rpx;' @click="navTo('/subpackage/personal-center/setting/bank-card/bank-card-add')">
  39. <submit-button title="+ 添加银行卡"></submit-button>
  40. </view>
  41. </template>
  42. <script lang="ts" setup>
  43. import { reactive } from "vue";
  44. import {request} from "@/utils/network/request.js";
  45. import {queryBankCard,delBankCard} from "@/utils/network/api.js";
  46. import {stringToJson} from "@/utils/network/encryption.js";
  47. import {navTo} from '@/utils/utils';
  48. import { onLoad} from "@dcloudio/uni-app";
  49. const state = reactive({
  50. name:''
  51. })
  52. onLoad((option : any) => {
  53. state.name=option.name;
  54. getBankList();
  55. })
  56. const getBankList=()=>{
  57. const options = {
  58. type: 2,
  59. data: {
  60. 'accountId': state.name
  61. },
  62. method: "POST",
  63. showLoading: true,
  64. };
  65. request(queryBankCard, options).then((res) => {
  66. const data = stringToJson(res.bizContent)
  67. console.log("获取银行卡",data)
  68. })
  69. }
  70. const delCard=(cardId)=>{
  71. const options = {
  72. type: 2,
  73. data: {
  74. 'accountId': state.name,
  75. 'bankCardId':cardId
  76. },
  77. method: "POST",
  78. showLoading: true,
  79. };
  80. request(delBankCard, options).then((res) => {
  81. const data = stringToJson(res.bizContent)
  82. console.log("删除银行卡",data);
  83. getBankList();
  84. })
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. .container {
  89. padding: 30rpx 30rpx 0 30rpx;
  90. position:relative;
  91. .flex {
  92. display: flex;
  93. align-items: center;
  94. }
  95. .value {
  96. position: absolute;
  97. top: 160rpx;
  98. left: 30rpx;
  99. right: 30rpx;
  100. font-size: 36rpx;
  101. font-family: Microsoft YaHei;
  102. font-weight: 400;
  103. color: #FFFFFF;
  104. text-align: center;
  105. line-height: 36rpx;
  106. }
  107. .default{
  108. position: absolute;
  109. top: 235rpx;
  110. left: 60rpx;
  111. font-size: 29rpx;
  112. font-family: Microsoft YaHei;
  113. font-weight: 400;
  114. color: #FFFFFF;
  115. line-height: 36rpx;
  116. }
  117. .content {
  118. padding: 30rpx;
  119. position: absolute;
  120. top: 30rpx;
  121. left: 30rpx;
  122. right: 30rpx;
  123. display: flex;
  124. justify-content: space-between;
  125. .bank {
  126. font-size: 28rpx;
  127. font-family: Microsoft YaHei;
  128. font-weight: 400;
  129. color: #FFFFFF;
  130. line-height: 28rpx;
  131. }
  132. .card {
  133. font-size: 24rpx;
  134. font-family: Microsoft YaHei;
  135. font-weight: 400;
  136. color: #FFFFFF;
  137. line-height: 24rpx;
  138. margin-top: 5rpx;
  139. }
  140. .button {
  141. height: 48rpx;
  142. line-height: 48rpx;
  143. border: 1px solid #FFFFFF;
  144. border-radius: 20rpx;
  145. color: #ffffff;
  146. font-size: 24rpx;
  147. text-align: center;
  148. padding: 0 20rpx;
  149. }
  150. }
  151. }
  152. </style>