withdraw.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <view>
  3. <navbar :scroll="scrollNum" :iSimmersive="false" :placeholder="true" title="申请提现"></navbar>
  4. <view class="notice-box">
  5. 当前可提现金额: ¥{{money}}
  6. </view>
  7. <form>
  8. <view class="form-box">
  9. <view class="form-fields clear">
  10. <view class="title">转帐方式</view>
  11. <view class="form-field-box">
  12. <picker @change="bindPickerChange" :value="index" :range="array">
  13. <view class="form-field-text">{{array[index]}}</view>
  14. </picker>
  15. </view>
  16. </view>
  17. <view class="form-fields clear">
  18. <view class="title">持卡人</view>
  19. <view class="form-field-box">
  20. <input class="form-field-input" name="name" v-model="name" placeholder="请填写持卡人" />
  21. </view>
  22. </view>
  23. <view class="form-fields clear">
  24. <view class="title">卡号</view>
  25. <view class="form-field-box">
  26. <input class="form-field-input" name="code" v-model="code" placeholder="请填写卡号" />
  27. </view>
  28. </view>
  29. <view class="form-fields clear">
  30. <view class="title">提现金额</view>
  31. <view class="form-field-box">
  32. <input type="number" class="form-field-input" name="price" v-model="price" placeholder="0.00" />
  33. </view>
  34. </view>
  35. <view class="form-submit">
  36. <view class="btn" :class="{ active: isActive }" @click="formSubmit">提交</view>
  37. </view>
  38. </view>
  39. </form>
  40. </view>
  41. </template>
  42. <script>
  43. import navbar from "@/components/navbar/navbar";
  44. export default {
  45. components: {
  46. navbar
  47. },
  48. data(){
  49. return {
  50. scrollNum: 0,
  51. array: ["请选择"],
  52. index: 0,
  53. name: "",
  54. code: "",
  55. price: "",
  56. money: "",
  57. isActive: false
  58. };
  59. },
  60. onShow(){
  61. this.$http.getWalletSettlement().then(res=>{
  62. if(res.status){
  63. this.array = res.data.bank;
  64. this.money = res.data.money;
  65. }
  66. });
  67. },
  68. onPageScroll(obj){
  69. this.scrollNum = obj.scrollTop;
  70. },
  71. methods: {
  72. bindPickerChange: function(e) {
  73. this.index = e.target.value
  74. },
  75. formSubmit(){
  76. if(this.isActive){
  77. return ;
  78. }
  79. if(this.price.length <= 0){
  80. this.$utils.msg("请输入要提现金额");
  81. return ;
  82. }
  83. if(this.name.length == 0){
  84. this.$utils.msg("请填写持卡人");
  85. return false;
  86. }
  87. if(this.code.length == 0){
  88. this.$utils.msg("请填写卡号");
  89. return false;
  90. }
  91. if(!/^([1-9]{1})(\d{15}|\d{18})$/.test(this.code)){
  92. this.$utils.msg("您填写的银行卡号不正确");
  93. return false;
  94. }
  95. this.isActive = true;
  96. this.$http.editWalletSettlement({
  97. bank_type: this.array[this.index],
  98. name: this.name,
  99. code: this.code,
  100. price: this.price
  101. }).then(res=>{
  102. if(res.status){
  103. this.$utils.msg(res.info);
  104. setTimeout(()=>{
  105. this.$utils.navigateBack();
  106. },2000);
  107. }else{
  108. this.$utils.msg(res.info);
  109. }
  110. this.isActive = false;
  111. }).catch(err=>{
  112. this.$utils.msg("连接网络出错,请稍后在试。");
  113. });
  114. }
  115. }
  116. }
  117. </script>
  118. <style lang="scss" scoped>
  119. .notice-box {
  120. color: #1989FA;
  121. background: #ECF9FF;
  122. font-size: 28rpx;
  123. padding: 0 30rpx;
  124. height: 80rpx;
  125. line-height: 80rpx;
  126. }
  127. .form-fields {
  128. width: 100%; float: left;
  129. height: 100rpx;
  130. line-height: 100rpx;
  131. border-bottom: 1px solid #ebedf0;
  132. .title {
  133. float: left; font-size: 30rpx;
  134. width: 200rpx; text-indent: 30rpx;
  135. }
  136. .form-field-box {
  137. float: right; font-size: 30rpx;
  138. width: 550rpx;
  139. .form-field-input {
  140. height: 100rpx;
  141. line-height: 100rpx;
  142. font-size: 30rpx;
  143. }
  144. }
  145. }
  146. .form-submit {
  147. float: left;
  148. width: 100%;
  149. margin-top: 50rpx;
  150. .btn {
  151. margin: 0 auto;
  152. width: 92%;
  153. height: 80rpx;
  154. line-height: 80rpx;
  155. display: block;
  156. text-align: center;
  157. font-size: 30rpx;
  158. background-color: #1b43c4;
  159. border: 1px solid #1b43c4;
  160. border-radius: 10rpx;
  161. color: #fff;
  162. }
  163. .active {
  164. background-color: #ffffff;
  165. border: 1px solid #d6d6d6;
  166. color: #a1a1a1;
  167. }
  168. }
  169. </style>