四零语境前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

212 lines
4.5 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="cash-page">
  3. <!-- 顶部标题栏 -->
  4. <view class="header-icon">
  5. <image class="cash-icon" src="/static/withdraw-icon.png" mode="aspectFit"></image>
  6. </view>
  7. <!-- 表单内容 -->
  8. <view class="form-container">
  9. <view class="header">
  10. <view class="title">微信提现</view>
  11. <!-- <view class="flow-link">过往流水 ></view> -->
  12. </view>
  13. <!-- 真实姓名 -->
  14. <view class="form-item">
  15. <view class="label">真实姓名</view>
  16. <uv-input
  17. v-model="realName"
  18. placeholder="请输入"
  19. border="none"
  20. :custom-style="inputStyle"
  21. ></uv-input>
  22. </view>
  23. <!-- 提现金额 -->
  24. <view class="form-item">
  25. <view class="label">提现金额</view>
  26. <uv-input
  27. v-model="amount"
  28. placeholder="请输入"
  29. type="digit"
  30. border="none"
  31. :custom-style="inputStyle"
  32. ></uv-input>
  33. </view>
  34. </view>
  35. <!-- 说明文字 -->
  36. <view class="notice-text">
  37. 请仔细检查并确认相关信息因用户个人疏忽导致的充值错误需由用户自行承担
  38. <text class="link-text" @click="showWithdrawRules">提现须知</text>
  39. </view>
  40. <!-- 固定底部按钮 -->
  41. <view class="fixed-bottom">
  42. <uv-button
  43. type="primary"
  44. :custom-style="buttonStyle"
  45. @click="handleWithdraw"
  46. >
  47. 提现
  48. </uv-button>
  49. <uv-safe-bottom></uv-safe-bottom>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. realName: '',
  58. amount: '',
  59. inputStyle: {
  60. backgroundColor: 'transparent',
  61. fontSize: '32rpx',
  62. color: '#333'
  63. },
  64. buttonStyle: {
  65. backgroundColor: '#22F2EB',
  66. borderRadius: '50rpx',
  67. height: '88rpx',
  68. fontSize: '32rpx',
  69. fontWeight: 'bold'
  70. }
  71. }
  72. },
  73. methods: {
  74. async handleWithdraw() {
  75. if (!this.realName) {
  76. uni.showToast({
  77. title: '请输入真实姓名',
  78. icon: 'none'
  79. })
  80. return
  81. }
  82. if (!this.amount) {
  83. uni.showToast({
  84. title: '请输入提现金额',
  85. icon: 'none'
  86. })
  87. return
  88. }
  89. const subRes = await this.$api.promotion.withdraw({
  90. // #ifdef H5
  91. type : 'official',
  92. // #endif
  93. name: this.realName,
  94. money: this.amount
  95. })
  96. if (subRes.code === 200) {
  97. uni.showToast({
  98. title: '提现申请已提交',
  99. icon: 'success'
  100. })
  101. uni.navigateBack({
  102. delta: 1,
  103. duration: 1000
  104. })
  105. } else {
  106. uni.showToast({
  107. title: subRes.msg,
  108. icon: 'none'
  109. })
  110. }
  111. // 提现逻辑
  112. console.log('提现信息:', {
  113. realName: this.realName,
  114. amount: this.amount
  115. })
  116. uni.showToast({
  117. title: '提现申请已提交',
  118. icon: 'success'
  119. })
  120. },
  121. showWithdrawRules() {
  122. // 显示提现须知
  123. uni.showModal({
  124. title: '提现须知',
  125. content: this.configParamContent('cash_policy'),
  126. showCancel: false
  127. })
  128. }
  129. }
  130. }
  131. </script>
  132. <style lang="scss" scoped>
  133. // @import '@/uni.scss';
  134. .cash-page {
  135. min-height: 100vh;
  136. background-color: #F2F2F2;
  137. padding-bottom: 200rpx;
  138. padding-top: 40rpx;
  139. .header {
  140. background-color: #fff;
  141. padding: 40rpx 40rpx 30rpx;
  142. display: flex;
  143. justify-content: space-between;
  144. align-items: center;
  145. .title {
  146. font-size: 36rpx;
  147. font-weight: bold;
  148. color: #333;
  149. }
  150. .flow-link {
  151. font-size: 28rpx;
  152. color: #999;
  153. }
  154. }
  155. .form-container {
  156. background-color: #fff;
  157. margin: 20rpx 40rpx;
  158. border-radius: 32rpx;
  159. margin-top: 20rpx;
  160. .form-item {
  161. padding: 40rpx;
  162. border-bottom: 1rpx solid #f0f0f0;
  163. &:last-child {
  164. border-bottom: none;
  165. }
  166. .label {
  167. font-size: 32rpx;
  168. color: #333;
  169. margin-bottom: 20rpx;
  170. font-weight: 500;
  171. }
  172. }
  173. }
  174. .notice-text {
  175. padding: 40rpx;
  176. font-size: 24rpx;
  177. color: #999;
  178. line-height: 1.6;
  179. .link-text {
  180. color: #22F2EB;
  181. }
  182. }
  183. .fixed-bottom {
  184. position: fixed;
  185. bottom: 0;
  186. left: 0;
  187. right: 0;
  188. padding: 30rpx 40rpx;
  189. background-color: #fff;
  190. border-top: 1rpx solid #f0f0f0;
  191. z-index: 999;
  192. }
  193. }
  194. </style>