withdraw.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="withdraw">
  3. <view class="header-bg"></view>
  4. <view class="block">
  5. <view class="account">
  6. <image class="image" src="../../static/alipay.png" mode=""></image>
  7. <view class="text">
  8. <navigator url="/pages/user/bind-alipay" hover-class="none">
  9. <view style="margin-bottom: 20upx;">{{this.form.name?this.form.name:'支付宝'}}</view>
  10. <view>{{this.form.account?this.form.account:'还没有添加支付宝账号,请点击添加'}}</view>
  11. </navigator>
  12. </view>
  13. <uni-icons type="arrowright" size="24" color="#CCCCCC" style="margin-left: auto;"></uni-icons>
  14. </view>
  15. <view class="withdraw-input-wrapper">
  16. <input class="input" type="text" v-model="form.money" :placeholder="`请输入提现金额,当前可提取余额为${money}元`" />
  17. </view>
  18. <view class="withdraw-button-wrapper">
  19. <button class="btn" type="default" @tap="submit">确认提取</button>
  20. </view>
  21. </view>
  22. <view class="block remind-wrapper">
  23. <view class="title">
  24. 重要提醒
  25. </view>
  26. <view class="li">
  27. 1.当天可提现的最高金额为100元。
  28. </view>
  29. <view class="li">
  30. 2.单笔提现金额最低30元起。
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. form: {
  40. account: "",
  41. name: "",
  42. money: undefined,
  43. }
  44. }
  45. },
  46. onShow() {
  47. uni.$emit("refresh_userinfo");
  48. this.form.account = this.$store.state.user.alipay
  49. this.form.name = this.$store.state.user.alipay_name
  50. this.money = this.$store.state.user.money
  51. },
  52. methods: {
  53. submit() {
  54. if (this.$verified.required(this.form.account,"请选择支付宝账户")
  55. &&this.$verified.required(this.form.name,"请选择支付宝账户")
  56. &&this.$verified.required(this.form.money,"请输入您要提取的金额")) {
  57. this.$http.post({
  58. url: "/withdraw/create",
  59. data: this.form,
  60. success: (res) => {
  61. console.log(res)
  62. uni.showModal({
  63. title: "提现",
  64. content: "提交成功,平台将于三个工作日之内为您处理",
  65. success: (res) => {
  66. if (res.confirm) {
  67. uni.navigateBack()
  68. }
  69. }
  70. })
  71. }
  72. })
  73. }
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .withdraw {
  80. position: relative;
  81. overflow: hidden;
  82. }
  83. .header-bg {
  84. background: $primary-color;
  85. height: 100upx;
  86. position: absolute;
  87. top: 0;
  88. width: 100%;
  89. }
  90. .block {
  91. background: white;
  92. border-radius: 20upx;
  93. margin: 20upx;
  94. padding: 20upx;
  95. position: relative;
  96. z-index: 1;
  97. }
  98. .account {
  99. display: flex;
  100. background: #eeeeee;
  101. padding: 20upx;
  102. align-items: center;
  103. border-radius: 10upx;
  104. margin: 10upx 0;
  105. .image {
  106. width: 100upx;
  107. height: 100upx;
  108. }
  109. .text {
  110. font-size: 24upx;
  111. color: #999;
  112. margin-left: 50upx;
  113. }
  114. }
  115. .withdraw-input-wrapper {
  116. margin-top: 40upx;
  117. }
  118. .input {
  119. background: #eeeeee;
  120. padding: 20upx;
  121. font-size: 24upx;
  122. border-radius: 10upx;
  123. }
  124. .withdraw-button-wrapper {
  125. margin-top: 40upx;
  126. .btn {
  127. font-size: 32upx;
  128. background: $primary-color;
  129. color: white;
  130. }
  131. }
  132. .remind-wrapper {
  133. .title {
  134. font-size: 30upx;
  135. border-bottom: #999999 solid 2upx;
  136. width: 60%;
  137. margin: auto;
  138. text-align: center;
  139. padding: 20upx;
  140. margin-bottom: 40upx;
  141. color: #999999;
  142. }
  143. .li {
  144. font-size: 24upx;
  145. color: #999999;
  146. margin-bottom: 20upx;
  147. margin-left: 50upx;
  148. }
  149. }
  150. </style>