四零语境前端代码仓库
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.

209 lines
4.3 KiB

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