extract.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <view class="box">
  3. <view class="header">
  4. <view class="title">支付宝提现</view>
  5. <view class="moneyView">
  6. <text class="icon">¥</text>
  7. <input type="digit" class="moneyInput" placeholder-style="color:#999999; font-size:30rpx"
  8. placeholder="请输入提现金额" v-model="money" @input="inputValue" />
  9. <view class="allBtn" @click="allBtn">全部提现</view>
  10. </view>
  11. <view class="zongMoney">可提现金额:¥{{okMoney}}</view>
  12. <view class="line"></view>
  13. <view class="name">
  14. <view class="leftTitle">姓名</view>
  15. <input type="text" class="Input" placeholder-style="color:#999999; font-size:30rpx" placeholder="支付宝实名"
  16. v-model="name" />
  17. </view>
  18. <view class="line"></view>
  19. <view class="name">
  20. <view class="leftTitle" style="margin-right: 60rpx;">支付宝</view>
  21. <input type="text" class="Input" placeholder-style="color:#999999; font-size:30rpx" placeholder="支付宝账户"
  22. v-model="account" />
  23. </view>
  24. </view>
  25. <view class="tishi" style="padding: 20rpx 44rpx;">支付宝账号或姓名输入错误将无法提现到账</view>
  26. <view class="sureBtn" @click="sure">确认提现</view>
  27. <view class="tishi">
  28. <rich-text :nodes="couContent"></rich-text>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. okMoney: '',
  37. money: '',
  38. name: '',
  39. account: '',
  40. detailData: {},
  41. couContent: '', //提现规则
  42. }
  43. },
  44. onLoad() {
  45. this.getDetailData()
  46. },
  47. methods: {
  48. getDetailData() {
  49. uni.showLoading({
  50. title: '加载中'
  51. })
  52. let url = 'worldKeepCar/worldDistribution/queryDistributionIndexDetail',
  53. params = {
  54. }
  55. this.$http(url, params, 'GET').then(res => {
  56. uni.hideLoading();
  57. var data = res.data
  58. // 处理 undefined和null转为空白字符串
  59. for (const key in data) {
  60. data[key] = this.$praseStrEmpty(data[key])
  61. }
  62. this.detailData = data
  63. this.okMoney = this.detailData.cantidatMoney
  64. if (this.detailData.tSSetting.withdrawalRules) {
  65. this.couContent = this.detailData.tSSetting.withdrawalRules.replace(/\<p/gi,
  66. '<p style="display: inline-block"');
  67. }
  68. })
  69. },
  70. inputValue(event) {
  71. if (event.detail.value < 0) {
  72. setTimeout(() => {
  73. this.money = 0; // 解决
  74. }, 0)
  75. } else {
  76. this.money = event.detail.value;
  77. }
  78. },
  79. allBtn() {
  80. setTimeout(() => {
  81. this.money = this.okMoney; // 解决
  82. }, 0)
  83. console.log('money,allmoney', this.money, this.okMoney);
  84. },
  85. sure() {
  86. if (this.money > this.okMoney) {
  87. uni.showToast({
  88. title: '提现金额不能大于可提现金额',
  89. icon: 'none',
  90. duration: 3000,
  91. });
  92. return;
  93. }
  94. if (this.money <= 0) {
  95. uni.showToast({
  96. title: '提现金额不能为空',
  97. icon: 'none',
  98. duration: 3000,
  99. });
  100. return;
  101. }
  102. if (!this.name) {
  103. uni.showToast({
  104. title: '姓名不能为空',
  105. icon: 'none',
  106. duration: 3000,
  107. });
  108. return;
  109. }
  110. if (!this.account) {
  111. uni.showToast({
  112. title: '支付宝账户不能为空',
  113. icon: 'none',
  114. duration: 3000,
  115. });
  116. return;
  117. }
  118. this.postData();
  119. },
  120. postData() {
  121. uni.showLoading({
  122. title: '提现中'
  123. })
  124. let url = 'worldKeepCar/worldDistribution/applyWithdrawal',
  125. params = {
  126. money: this.money,
  127. aliName: this.name,
  128. aliPhone: this.account,
  129. }
  130. this.$http(url, params, 'POST').then(res => {
  131. uni.hideLoading();
  132. uni.showModal({
  133. title: '提交成功',
  134. content: '请耐心等待平台审核',
  135. showCancel:false,
  136. confirmText:'知道了',
  137. success: function(res) {
  138. uni.navigateBack({
  139. })
  140. }
  141. });
  142. })
  143. },
  144. }
  145. }
  146. </script>
  147. <style>
  148. .box {
  149. min-height: 100vh;
  150. background: #F4F5F7;
  151. padding-top: 20rpx;
  152. }
  153. .header {
  154. background-color: #FFFFFF;
  155. margin: 0 24rpx;
  156. border-radius: 10rpx;
  157. padding: 30rpx 20rpx;
  158. padding-bottom: 0;
  159. }
  160. .title {
  161. font-size: 30rpx;
  162. color: #3C3C3C;
  163. font-weight: bold;
  164. }
  165. .moneyView {
  166. display: flex;
  167. justify-content: space-between;
  168. align-items: center;
  169. margin: 15rpx 0;
  170. }
  171. .icon {
  172. font-size: 50rpx;
  173. color: #222222;
  174. font-weight: bold;
  175. }
  176. .moneyInput {
  177. font-size: 70rpx;
  178. color: #222222;
  179. font-weight: bold;
  180. /* flex-grow: 1; */
  181. height: 98rpx;
  182. width: 100%;
  183. }
  184. .allBtn {
  185. font-size: 26rpx;
  186. color: #FF4F00;
  187. width: 200rpx;
  188. height: 50rpx;
  189. line-height: 50rpx;
  190. margin-left: 10rpx;
  191. text-align: right;
  192. }
  193. .zongMoney {
  194. font-size: 26rpx;
  195. color: #999999;
  196. margin-bottom: 30rpx;
  197. }
  198. .line {
  199. background-color: #EEEEEE;
  200. height: 1rpx;
  201. }
  202. .name {
  203. display: flex;
  204. justify-content: flex-start;
  205. padding: 28rpx 0;
  206. }
  207. .leftTitle {
  208. font-size: 30rpx;
  209. color: #3C3C3C;
  210. margin-right: 90rpx;
  211. }
  212. .Input {
  213. font-size: 30rpx;
  214. color: #333333;
  215. }
  216. .tishi {
  217. padding: 0 44rpx;
  218. font-size: 26rpx;
  219. color: #999999;
  220. line-height: 1.5;
  221. }
  222. .sureBtn {
  223. width: 690rpx;
  224. margin: 20rpx 30rpx;
  225. border-radius: 37rpx;
  226. height: 74rpx;
  227. background: linear-gradient(124deg, #FF8700 0%, #FF4F00 100%);
  228. color: #FFFFFF;
  229. font-size: 30rpx;
  230. text-align: center;
  231. line-height: 74rpx;
  232. }
  233. </style>