Wodeyanhangka.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view>
  3. <customNav :shownav="true" :title="$t('tixian.wodeyhk')" tinColor="#006AFF" jiantou="0" titledetl=''></customNav>
  4. <view class="contenV">
  5. <view v-for="(item,index) in carList">
  6. <view :class="[index==selectIndex?'contentInRowS ItemContentS':'contentInRowS ItemContent']">
  7. <view class="contentColumn" @click="xuanzeyhk(index)">
  8. <text class="tianjiaBT">{{$t('tixian.yinghang')}}</text>
  9. <text class="tianjiaBT">{{$t('tixian.kahao')}}</text>
  10. </view>
  11. <view class="contentColumn" @click="xuanzeyhk(index)">
  12. <text class="jiedanText">{{item.bankName}}</text>
  13. <text class="jiedanText">{{item.number}}</text>
  14. </view>
  15. <view class="" @click="xuanzeyhk(index)">
  16. <image style="width: 100rpx;height: 100rpx;" src="/static/imags/yinlian.png" mode="scaleToFill"></image>
  17. </view>
  18. <view class="" @click="jiebang(index)">
  19. <text class="jiebangText">{{$t('tixian.jiebang')}}</text>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="bottomfloatV" @click="gotoyhkmanager">
  25. <label class="tianjiaBTC">{{$t('tixian.tianjayhk')}}</label>
  26. </view>
  27. <!-- 提示窗示例 -->
  28. <uni-popup ref="alertDialog" type="dialog">
  29. <uni-popup-dialog type="NOMLE" :cancelText="$t('index.quxiao')" :confirmText="$t('index.queren')" :title="noteMsgtitle" :content="noteMsgmsg" @confirm="dialogConfirm"
  30. @close="dialogClose"></uni-popup-dialog>
  31. </uni-popup>
  32. </view>
  33. </template>
  34. <script>
  35. import {
  36. getbankcard,
  37. delebankcard
  38. } from '@/pages/api/basic.js';
  39. export default {
  40. data() {
  41. return {
  42. noteMsgtitle:'',
  43. noteMsgmsg:'',
  44. isSelect:false,
  45. carList:'',
  46. selectIndex:0,
  47. jiebangid:-1,
  48. state:0
  49. }
  50. },
  51. onLoad(option) {
  52. this.state = option.state;
  53. },
  54. onShow() {
  55. this.getbankcard();
  56. this.selectIndex=uni.getStorageSync("defyanhangK");
  57. },
  58. methods: {
  59. jiebang(index){
  60. var car = this.carList[index];
  61. this.jiebangid=car.id;
  62. this.noteMsgtitle=this.$t('tixian.querenjieb');
  63. this.noteMsgmsg= car.bankName+':'+car.number;
  64. this.$refs.alertDialog.open('center');
  65. },
  66. dialogConfirm() {
  67. console.log('点击确认')
  68. if(this.jiebangid!=-1){
  69. this.delebankcard();
  70. }
  71. },
  72. dialogClose() {
  73. console.log('点击关闭')
  74. },
  75. gotoyhkmanager(){
  76. uni.navigateTo({
  77. url:'/pages/tixian/YHkamanager'
  78. })
  79. },
  80. xuanzeyhk(index){
  81. if(this.state==0){
  82. return;
  83. }
  84. this.selectIndex=index;
  85. uni.setStorageSync('defyanhangK',index);
  86. uni.navigateBack();
  87. },
  88. async getbankcard(){
  89. //console.log('getUserMsg')
  90. await this.$http.get(`${getbankcard}`, {
  91. },true)
  92. .then(async r => {
  93. console.log(r.data.data);
  94. this.carList= r.data.data;
  95. })
  96. .catch(err => {
  97. console.log(err)
  98. })
  99. },
  100. async delebankcard(){
  101. //console.log('getUserMsg')
  102. await this.$http.get(`${delebankcard}`, {
  103. id:this.jiebangid
  104. },true)
  105. .then(async r => {
  106. console.log(r.data.data);
  107. this.getbankcard();
  108. })
  109. .catch(err => {
  110. console.log(err)
  111. })
  112. },
  113. }
  114. }
  115. </script>
  116. <style lang="scss">
  117. @import '@/common/common.scss';
  118. page{
  119. background-color: whitesmoke;
  120. }
  121. .contenV{
  122. width: 94%;
  123. margin-left: 3%;
  124. }
  125. .ItemContent{
  126. margin-top: 30rpx;
  127. padding: 24rpx;
  128. border-radius: 10rpx;
  129. box-shadow: 0px 0rpx 10rpx 0rpx darkgray;
  130. background-color: white;
  131. }
  132. .ItemContentS{
  133. margin-top: 30rpx;
  134. padding: 24rpx;
  135. border-radius: 10rpx;
  136. box-shadow: 0px 0rpx 10rpx 0rpx #006AFF;
  137. background-color: white;
  138. }
  139. .jiedanText{
  140. font-size: 28rpx;
  141. color: darkgray;
  142. }
  143. .tianjiaBT{
  144. width: 160rpx;
  145. text-align: left;
  146. font-size: 28rpx;
  147. font-weight: bold;
  148. color: #1A1A1A;
  149. }
  150. .jiebangText{
  151. font-size: 30rpx;
  152. color: #006AFF;
  153. text-decoration:underline;
  154. }
  155. .bottomfloatV{
  156. position: fixed;
  157. left: 10%;
  158. width:80%;
  159. right: 0;
  160. bottom: 40rpx;
  161. z-index: 999;
  162. background-color: white;
  163. height: 76rpx;
  164. line-height: 76rpx;
  165. border-radius: 10rpx;
  166. border: 2rpx solid darkgray;
  167. text-align: center;
  168. }
  169. .tianjiaBTC{
  170. text-align: center;
  171. font-size: 28rpx;
  172. font-weight: bold;
  173. color: #1A1A1A;
  174. width:100%;
  175. }
  176. </style>