多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

243 lines
5.4 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <view class="container">
  3. <global-loading />
  4. <view class="bankcardList">
  5. <view class="addBankcard-content flex-row-plus" v-for="(item, index) in bankcardList" :key="index">
  6. <view class="bankcard-detail" @click="itemTap(item.bankId)">
  7. <view class="banktype">
  8. <label></label>
  9. </view>
  10. <view class="cardnum">
  11. <label>{{encodeCardNum(item.bankCard)}}</label>
  12. </view>
  13. <view class="bankname">
  14. <label>{{item.bankName}}</label>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <view v-if="ifEmpty" class="emptyBankcard-box">
  20. <image class="emptyBankcard" src="http://36.138.125.206:8081/ceres-local-file/static/img/bgnull.png"></image>
  21. <label>{{$t('common.bankaccountempty')}}</label>
  22. </view>
  23. <view class="addBankcard-box">
  24. <view class="addBankcard" @click="addBankcardClick">{{$t('common.add')}}</view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. const NET = require('../../utils/request')
  30. const API = require('../../config/api')
  31. export default {
  32. data() {
  33. return {
  34. bankcardList:[],
  35. headWord:'',
  36. editBankcard:[],
  37. type:0,
  38. bankcardListlength:0,
  39. page:1,//当前页
  40. pageSize:20,//每页记录数
  41. loadingType:0,
  42. ifEmpty: false
  43. }
  44. },
  45. onLoad(options) {
  46. this.type = options.type
  47. this.getBankcardData()
  48. },
  49. onBackPress(options) {
  50. uni.switchTab({
  51. url:'../../pages/tabbar/user/index'
  52. });
  53. return true
  54. },
  55. onReachBottom(){
  56. if(this.loadingType == 1){
  57. uni.stopPullDownRefresh()
  58. }else{
  59. this.page = this.page+1
  60. this.getBankcardData()
  61. }
  62. },
  63. methods: {
  64. addBankcardClick(){
  65. uni.navigateTo({
  66. url:'addBankcard?type=1'
  67. })
  68. },
  69. getBankcardData(){
  70. // uni.showLoading({
  71. // mask: true,
  72. // title: '加载中...',
  73. // })
  74. NET.request(API.QueryBankcardList,{
  75. page: this.page,
  76. pageSize:this.pageSize,
  77. },'GET').then(res => {
  78. uni.hideLoading()
  79. if(res.data.list.length == 0){
  80. this.loadingType = 1
  81. this.page = this.page
  82. }
  83. this.bankcardList = this.bankcardList.concat(res.data.list)
  84. this.bankcardListlength = res.data.total
  85. if (this.bankcardList.length === 0) {
  86. this.ifEmpty = true
  87. }
  88. }).catch(res => {
  89. })
  90. },
  91. editAdress(id){
  92. uni.setStorageSync("editBankcard",JSON.stringify(this.bankcardList[id]))
  93. uni.navigateTo({
  94. url:'addBankcard?type=2'
  95. })
  96. },
  97. itemTap(id){
  98. uni.setStorageSync('bankcardId', id)
  99. uni.navigateTo({
  100. url:'../userModule/addBankcard?type=2'
  101. })
  102. },
  103. encodeCardNum(cardNum){
  104. let length = cardNum.length
  105. if(length > 4){
  106. return "**** **** **** "+cardNum.substring(length-4,length)
  107. }
  108. }
  109. }
  110. }
  111. </script>
  112. <style lang="scss">
  113. .container{
  114. .bankcardList {
  115. background: url("http://36.138.125.206:8081/ceres-local-file/image/addBankBg.png") no-repeat left top;
  116. background-size: contain;
  117. display: block;
  118. padding-bottom: 85px;
  119. padding-top: 50rpx;
  120. min-height: 300rpx;
  121. }
  122. .emptyBankcard-box{
  123. display: flex;
  124. justify-content: center;
  125. flex-direction: column;
  126. align-items: center;
  127. margin-top: 55upx;
  128. .emptyBankcard{
  129. margin-top: 45%;
  130. width: 113upx;
  131. height: 98upx;
  132. margin-bottom: 20rpx;
  133. }
  134. }
  135. .addBankcard-box{
  136. position: fixed;
  137. bottom: 50upx;
  138. left: 30upx;
  139. .addBankcard{
  140. width: 690rpx;
  141. height: 98rpx;
  142. color: #ffffff;
  143. text-align: center;
  144. line-height: 98rpx;
  145. background: #252744;
  146. border-radius: 50rpx;
  147. }
  148. }
  149. .addBankcard-content{
  150. display: flex;
  151. align-items: center;
  152. justify-content: space-around;
  153. margin-bottom: 10rpx;
  154. .bankcard-detail {
  155. width: 100%;
  156. height: 451rpx;
  157. background: url("http://36.138.125.206:8081/ceres-local-file/image/accountBg.png") no-repeat left top;
  158. background-size: contain;
  159. border-radius: 18rpx;
  160. .bankname {
  161. color: #ffffff;
  162. margin-left:80rpx;
  163. margin-top:7px;
  164. }
  165. .banktype {
  166. margin-left: 15px;
  167. margin-top: 2px;
  168. font-size: 8px;
  169. color: #9C9C9C;
  170. }
  171. .cardnum {
  172. color: #ffffff;
  173. margin: 0 auto;
  174. margin-top: 150rpx;
  175. margin-left:80rpx;
  176. font-size:20px;
  177. }
  178. }
  179. .lable {
  180. padding: 3rpx 10rpx;
  181. background: rgba(153, 153, 153, 0.2);
  182. border-radius: 4rpx;
  183. font-size: 24rpx;
  184. font-weight: 500;
  185. color: rgba(102, 102, 102, 1);
  186. }
  187. .def{
  188. padding: 3rpx 10rpx;
  189. border-radius: 4rpx;
  190. font-size: 24rpx;
  191. font-weight: 500;
  192. color: rgba(102, 102, 102, 1);
  193. background:rgba(255,121,17,0.2);
  194. color: #FF7911;
  195. }
  196. .user-bankcard {
  197. font-size: 28rpx;
  198. font-weight: 500;
  199. color: rgba(51, 51, 51, 1);
  200. margin-left: 10rpx;
  201. }
  202. .bankcard-hesd{
  203. height: 70upx;
  204. width: 70upx;
  205. background-color: #BBBBBB;
  206. color: #FFFFFF;
  207. border-radius: 50%;
  208. line-height: 70upx;
  209. text-align: center;
  210. }
  211. .defaultAD-box{
  212. width: 455upx;
  213. .default-textBox{
  214. padding-right: 20upx;
  215. width: 80upx;
  216. }
  217. .default-content{
  218. width: 435upx;
  219. }
  220. .default-text{
  221. color: #C5AA7B;
  222. background-color: #FFE4CC;
  223. height: 36upx;
  224. width: 60upx;
  225. font-size: 26upx;
  226. border-radius: 4upx;
  227. align-items: center;
  228. line-height: 36upx;
  229. }
  230. }
  231. .right-Line{
  232. border-right: 2upx solid #DDDDDD;
  233. height: 50upx;
  234. }
  235. }
  236. }
  237. </style>