BankList.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <member-base :show="false"><view class="div distributor-bank-list">
  3. <view class="div common-header-wrap">
  4. <view :style="'height:'+navHeight+'px'"></view>
  5. <view class="common-header-holder"></view>
  6. <view class="common-header-fixed">
  7. <title-header />
  8. <uni-nav-bar title="提现账户" class="common-header" left-icon="back" @clickLeft="goBack">
  9. </uni-nav-bar>
  10. </view>
  11. </view>
  12. <view class="div pb-30" v-if="bank_list.length>0">
  13. <view class="div mb-5" v-for="(item,index) in bank_list" :key="index">
  14. <view class="div container" v-if="item.memberbank_id > 0">
  15. <view class="div top-wrapper">
  16. <view class="div title-wrapper">
  17. <label class="title">{{ item.memberbank_name }}</label>
  18. <label class="title">{{ item.memberbank_truename }}</label>
  19. </view>
  20. <label class="desc bank-text">{{memberbankTypeText(item.memberbank_type)}}&nbsp;{{item.memberbank_no}}</label>
  21. <view class="div bottom-line"></view>
  22. </view>
  23. <view class="div bottom-wrapper">
  24. <view class="div bottom-right-wrapper">
  25. <view class="div edit-wrapper" @click="onEdit(item.memberbank_id)">
  26. <view class="div common-btn btn-2 mr-5">编辑</view>
  27. </view>
  28. <view class="div edit-wrapper delete-wrapper" @click="onDelete(item.memberbank_id)">
  29. <view class="div common-btn btn-1">删除</view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="div" v-else>
  37. <empty-record></empty-record>
  38. </view>
  39. <view class='common-add-btn-wrapper'><view class="div common-btn common-add-btn" @click="goAdd">新增</view></view>
  40. </view>
  41. <uni-popup background-color="#fff" ref="confirm" type="dialog">
  42. <uni-popup-dialog :mode="dialog.mode" :title="dialog.title" :content="dialog.content" :placeholder="dialog.content" @confirm="confirmDialog" @close="closeDialog"></uni-popup-dialog>
  43. </uni-popup>
  44. </member-base>
  45. </template>
  46. <script>
  47. import {getFontSize} from '@/util/common'
  48. import TitleHeader from '../../TitleHeader'
  49. import { urlencode } from '@/util/common'
  50. import MemberBase from '../MemberBase'
  51. import EmptyRecord from '../../EmptyRecord'
  52. import { getBankList, delBank } from '../../../api/memberBank'
  53. export default {
  54. components:{
  55. TitleHeader,
  56. MemberBase,
  57. EmptyRecord
  58. },
  59. name:'MemberBankList',
  60. mounted(){
  61. // #ifdef MP-WEIXIN
  62. this.navHeight = uni.getMenuButtonBoundingClientRect().top
  63. // #endif
  64. },
  65. data(){
  66. return {
  67. navHeight: 0,
  68. dialog:{},
  69. bank_list: []
  70. }
  71. },
  72. computed:{
  73. fontSize(){
  74. return getFontSize()
  75. },
  76. memberbankTypeText () {
  77. return function (memberbankType) {
  78. if (memberbankType === 'bank') {
  79. return '银行'
  80. } else if (memberbankType === 'alipay') {
  81. return '支付宝'
  82. } else {
  83. return '账户类型错误'
  84. }
  85. }
  86. }
  87. },
  88. onShow: function () {
  89. this.getBankList()
  90. },
  91. methods:{
  92. closeDialog(){
  93. },
  94. confirmDialog(value){
  95. uni.showLoading({ title: '加载中' })
  96. delBank(this.dialog.data).then(
  97. (response) => {
  98. this.getBankList()
  99. uni.hideLoading()
  100. }, (error) => {
  101. uni.hideLoading()
  102. uni.showToast({icon:'none',title: error.message})
  103. })
  104. },
  105. goBack () {
  106. uni.navigateBack({delta:1})
  107. },
  108. goAdd () {
  109. uni.navigateTo({ url: '/pages/member/bank/BankForm'+'?'+urlencode( { action: 'add' } )})
  110. },
  111. onEdit (memberbankId) {
  112. uni.navigateTo({ url: '/pages/member/bank/BankForm'+'?'+urlencode( { memberbank_id: memberbankId } )})
  113. },
  114. onDelete (memberbankId) {
  115. this.dialog={content:'确定要删除该提现账户吗?',data:memberbankId}
  116. this.$refs.confirm.open()
  117. },
  118. getBankList () {
  119. getBankList().then(res => {
  120. this.bank_list = res.result.bank_list
  121. }).catch(function (error) {
  122. uni.showToast({icon:'none',title: error.message})
  123. })
  124. }
  125. }
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. .distributor-bank-list {
  130. .common-header{
  131. .btn{background: #000;color: #fff;box-shadow: 0px 2px 4px #d2d2d2;}
  132. }
  133. .container {
  134. display: flex;
  135. flex-direction: column;
  136. justify-content: flex-start;
  137. align-items: stretch;
  138. background-color: #fff;
  139. }
  140. .btn-1{border:1px solid $primaryColor;color:$primaryColor;min-width: 2rem}
  141. .btn-2{border:1px solid #333;color:#333;min-width: 2rem}
  142. .top-wrapper {
  143. position: relative;
  144. flex: 1;
  145. display: flex;
  146. flex-direction: column;
  147. justify-content: flex-start;
  148. align-items: stretch;
  149. }
  150. .title-wrapper {
  151. height:1rem;
  152. display: flex;
  153. flex-direction: row;
  154. justify-content: flex-start;
  155. align-items: center;
  156. margin-top:0.5rem;
  157. margin-left:0.5rem;
  158. }
  159. .title {
  160. font-size:$h3;
  161. color: #333;
  162. font-weight: 700;
  163. margin-left:0.5rem;
  164. }
  165. .default {
  166. width:1.4rem;
  167. margin-left:0.5rem;
  168. margin-right:0.5rem;
  169. border: 1px solid $primaryColor;
  170. color: $primaryColor;
  171. font-size:$h6;
  172. text-align: center;
  173. border-radius:0.1rem;
  174. }
  175. .desc {
  176. color:$descTextColor;
  177. font-size:$subFontSize;
  178. }
  179. .bank-text {
  180. margin-top:0.5rem;
  181. margin-bottom:0.5rem;
  182. margin-left:1rem;
  183. margin-right:0.5rem;
  184. }
  185. .bottom-line {
  186. position: absolute;
  187. left:0.5rem;
  188. bottom: 0;
  189. right:0.5rem;
  190. border-bottom:1px dashed #eee
  191. }
  192. .bottom-wrapper {
  193. height:2.5rem;
  194. display: flex;
  195. flex-direction: row;
  196. justify-content: space-around;
  197. align-items: stretch;
  198. }
  199. .bottom-right-wrapper {
  200. flex: 1;
  201. display: flex;
  202. flex-direction: row;
  203. justify-content: flex-end;
  204. align-items: stretch;
  205. }
  206. .edit-wrapper {
  207. display: flex;
  208. flex-direction: row;
  209. justify-content: flex-start;
  210. align-items: center;
  211. }
  212. .delete-wrapper {
  213. margin-right:0.5rem;
  214. }
  215. .indicator {
  216. width:1rem;
  217. height:1rem;
  218. margin-left:0.75rem;
  219. margin-right:0.5rem;
  220. font-size:$subFontSize;
  221. }
  222. .icon {
  223. width:0.9rem;
  224. height:0.9rem;
  225. margin-left:0.5rem;
  226. }
  227. .subtitle {
  228. font-size:$subFontSize;
  229. color: #7c7f88;
  230. margin-top:0.5rem;
  231. margin-bottom:0.5rem;
  232. margin-left: 1rem;
  233. margin-right:0.5rem;
  234. }
  235. .subtitle .i{font-size:$h2;margin-right:.5rem;}
  236. }
  237. </style>