bankCard.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <template>
  2. <view class="main">
  3. <view class="top-title flex align-center justify-between">
  4. <view class="">请{{ disable ? '确认' : '填写'}}提现银行卡信息:</view>
  5. <view v-if="!disable" class="top-cancel" @click="cancel">清除</view>
  6. </view>
  7. <view class="input-container">
  8. <view class="bankCardInfo round">
  9. <view class="infoLeft">
  10. 用户姓名:
  11. </view>
  12. <view class="infoRight">
  13. <input :disabled="disable" type="text" v-model="from.card_user_name" placeholder="请输入姓名" class="input-item"/>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="input-container">
  18. <view class="bankCardInfo round">
  19. <view class="infoLeft">
  20. 开户行:
  21. </view>
  22. <view class="infoRight">
  23. <!-- <picker value="index" @change="bindPickerChange" :range="array">
  24. <view class="uni-input">{{array[index]}}</view>
  25. </picker> -->
  26. <input :disabled="disable" type="text" v-model="from.bank_name" placeholder="请输入开户行" class="input-item"/>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="input-container">
  31. <view class="bankCardInfo round">
  32. <view class="infoLeft">
  33. 银行卡号:
  34. </view>
  35. <view class="infoRight">
  36. <input :disabled="disable" type="text" v-model="from.bank_card_no" placeholder="请输入银行卡号" class="input-item"/>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="input-container">
  41. <view class="bankCardInfo round">
  42. <view class="infoLeft">
  43. 预留手机:
  44. </view>
  45. <view class="infoRight">
  46. <input :disabled="disable" type="text" v-model="from.card_phone" placeholder="请输入预留手机号" class="input-item"/>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="input-container">
  51. <view v-if="disable" class="submit-btn round" @click="tixian">
  52. 立即提交
  53. </view>
  54. <view v-else class="submit-btn round" @click="submit">
  55. 保存
  56. </view>
  57. </view>
  58. <!-- <view class="bank-btn">
  59. <view class="sub" @click="submit">
  60. 提交
  61. </view>
  62. <view class="quxiao" @click="cancel">
  63. 清除
  64. </view>
  65. </view> -->
  66. <view class="aboutUsBottom">
  67. <view class="aboutUsNav">
  68. <navigator open-type="redirect" url="/pages/mine/aboutUsService" class="bottomNotice">服务协议</navigator>
  69. <text style="margin: 0 10rpx;">|</text>
  70. <navigator open-type="redirect" url="/pages/mine/aboutUsprivacy" class="bottomNotice">隐私政策</navigator>
  71. </view>
  72. <view class="aboutUsCopy">
  73. <view>Copyright @ 2011-2020 JULIANCHENG CREDIT</view>
  74. <view>ALL Rights Reserved</view>
  75. </view>
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. export default {
  81. data() {
  82. return {
  83. disable: false,
  84. amount: 0,
  85. from:{
  86. card_user_name: '',
  87. bank_name: '',
  88. bank_card_no: '',
  89. card_phone: ''
  90. },
  91. index: 0,
  92. // array: ['请选择开户行','中国银行', '建设银行', '邮政银行', '农村银行'],
  93. array: ['中国银行', '建设银行', '邮政银行', '农村银行'],
  94. }
  95. },
  96. onLoad(option) {
  97. this.amount = option.amount;
  98. },
  99. mounted(){
  100. this.cardData()
  101. },
  102. methods: {
  103. cardData: async function(){
  104. let res = await this.$request.post('/api/userPromote/promoteInfo',{});
  105. console.log(res.data)
  106. if(res.code == 200){
  107. this.from = {
  108. card_user_name : res.data.card_user_name,
  109. bank_name : res.data.bank_name,
  110. bank_card_no : res.data.bank_card_no,
  111. card_phone : res.data.card_phone
  112. }
  113. if(res.data.bank_card_no){
  114. this.disable = true
  115. } else {
  116. this.disable = false
  117. }
  118. }else {
  119. uni.showToast({
  120. icon: 'none',
  121. title: res.message
  122. });
  123. }
  124. },
  125. async submit(){
  126. let res = await this.$request.post('/api/userPromote/saveBankCard',this.from);
  127. if(res.code == 200){
  128. uni.showToast({
  129. icon: 'success',
  130. title:'提交成功'
  131. });
  132. setTimeout(function() {
  133. uni.navigateBack()
  134. }, 2000);
  135. }else {
  136. uni.showToast({
  137. icon: 'none',
  138. title: res.message
  139. });
  140. }
  141. },
  142. tixian:async function(){
  143. let res = await this.$request.post('/api/userPromote/applyWithdrawal',{amount:this.amount});
  144. if(res.code == 200){
  145. uni.showToast({
  146. icon: 'success',
  147. title: '提交成功'
  148. });
  149. setTimeout(function() {
  150. uni.redirectTo({
  151. url: "/pages/tuijian/cash"
  152. })
  153. }, 2000);
  154. }else {
  155. uni.showToast({
  156. icon: 'none',
  157. title: res.message
  158. });
  159. }
  160. },
  161. cancel(){
  162. console.log("清除按钮")
  163. this.from = {
  164. card_user_name: '',
  165. bank_name: '',
  166. bank_card_no: '',
  167. card_phone: ''
  168. }
  169. },
  170. bindPickerChange(e) {
  171. console.log('picker发送选择改变,携带值为', e.target.value)
  172. this.index = e.target.value
  173. },
  174. }
  175. }
  176. </script>
  177. <style>
  178. .main{
  179. width: 100%;
  180. height: 100vh;
  181. background-color: #F1F1F1;
  182. position: relative;
  183. }
  184. .main>.top-title{
  185. font-size: 32rpx;
  186. width: 100%;
  187. padding: 120rpx 60rpx;
  188. }
  189. .top-cancel{
  190. color: #F6C459;
  191. }
  192. .main .input-container{
  193. width: 100%;
  194. padding: 0 30rpx;
  195. margin: 15px 0;
  196. }
  197. .main .bankCardInfo{
  198. /* display: flex;
  199. justify-content: space-between;
  200. width: 100%;
  201. height: 110rpx;
  202. line-height: 110rpx;
  203. border-bottom: 1px solid #eee;
  204. background: #fff;
  205. display: flex;
  206. justify-content: space-between;
  207. align-items: center; */
  208. width: 100%;
  209. height: 90rpx;
  210. padding: 0 30rpx 0 40rpx;
  211. background: #fff;
  212. display: flex;
  213. align-items: center;
  214. }
  215. .main .bankCardInfo .infoLeft{
  216. width: 33%;
  217. height: 50rpx;
  218. line-height:50rpx;
  219. font-size: 32rpx;
  220. font-weight:normal;
  221. padding-left: 10px;
  222. font-family: PingFangSC-Regular, sans-serif;
  223. /* color: #555864; */
  224. color: #000;
  225. }
  226. .main .bankCardInfo .infoRight{
  227. width: 67%;
  228. height: 50rpx;
  229. line-height:50rpx;
  230. display: flex;
  231. justify-content: center;
  232. align-items: center;
  233. }
  234. picker{
  235. margin-right: auto;
  236. }
  237. .main .bankCardInfo .infoRight .input-item{
  238. width: 100%;
  239. height: 100%;
  240. font-size: 30rpx;
  241. font-family: PingFangSC-Regular, sans-serif;
  242. font-weight: 300;
  243. color: rgba(143,143,144,1);
  244. }
  245. .bank-btn{
  246. height: 60px;
  247. display: flex;
  248. justify-content: center;
  249. align-items: center;
  250. }
  251. .quxiao,.sub{
  252. /* width: auto; */
  253. width: 100%;
  254. height: 40px;
  255. line-height: 40px;
  256. text-align: center;
  257. padding: 0 20px;
  258. border-radius: 5px;
  259. margin-top: 10px;
  260. margin-right: 20px;
  261. }
  262. .sub{
  263. background: #F5CC57;
  264. color: #fff;
  265. }
  266. .submit-btn{
  267. width: 80%;
  268. height: 40px;
  269. line-height: 40px;
  270. text-align: center;
  271. margin: 120rpx auto;
  272. padding: 0 20px;
  273. color: #FFFFFF;
  274. background-color: #F6C459;
  275. }
  276. .quxiao{
  277. border: 1px solid #979797;
  278. color: #979797;
  279. }
  280. .aboutUsBottom{
  281. width: 100%;
  282. position: fixed;
  283. bottom: 0;
  284. left: 0;
  285. }
  286. .aboutUsNav{
  287. display: flex;
  288. align-items: center;
  289. justify-content: center;
  290. }
  291. .aboutUsCopy{
  292. margin: 0 auto;
  293. padding-bottom: 30rpx;
  294. width: 500rpx;
  295. font-size: 10rpx;
  296. text-align: center;
  297. }
  298. .bottomNotice{
  299. color: #3180D5;
  300. }
  301. </style>