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

206 lines
4.3 KiB

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. name: this.realName,
  88. money: this.amount
  89. })
  90. if (subRes.code === 200) {
  91. uni.showToast({
  92. title: '提现申请已提交',
  93. icon: 'success'
  94. })
  95. uni.navigateBack({
  96. delta: 1,
  97. duration: 1000
  98. })
  99. } else {
  100. uni.showToast({
  101. title: subRes.msg,
  102. icon: 'none'
  103. })
  104. }
  105. // 提现逻辑
  106. console.log('提现信息:', {
  107. realName: this.realName,
  108. amount: this.amount
  109. })
  110. uni.showToast({
  111. title: '提现申请已提交',
  112. icon: 'success'
  113. })
  114. },
  115. showWithdrawRules() {
  116. // 显示提现须知
  117. uni.showModal({
  118. title: '提现须知',
  119. content: this.configParamContent('cash_policy'),
  120. showCancel: false
  121. })
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="scss" scoped>
  127. // @import '@/uni.scss';
  128. .cash-page {
  129. min-height: 100vh;
  130. background-color: #F2F2F2;
  131. padding-bottom: 200rpx;
  132. padding-top: 40rpx;
  133. .header {
  134. background-color: #fff;
  135. padding: 40rpx 40rpx 30rpx;
  136. display: flex;
  137. justify-content: space-between;
  138. align-items: center;
  139. .title {
  140. font-size: 36rpx;
  141. font-weight: bold;
  142. color: #333;
  143. }
  144. .flow-link {
  145. font-size: 28rpx;
  146. color: #999;
  147. }
  148. }
  149. .form-container {
  150. background-color: #fff;
  151. margin: 20rpx 40rpx;
  152. border-radius: 32rpx;
  153. margin-top: 20rpx;
  154. .form-item {
  155. padding: 40rpx;
  156. border-bottom: 1rpx solid #f0f0f0;
  157. &:last-child {
  158. border-bottom: none;
  159. }
  160. .label {
  161. font-size: 32rpx;
  162. color: #333;
  163. margin-bottom: 20rpx;
  164. font-weight: 500;
  165. }
  166. }
  167. }
  168. .notice-text {
  169. padding: 40rpx;
  170. font-size: 24rpx;
  171. color: #999;
  172. line-height: 1.6;
  173. .link-text {
  174. color: #22F2EB;
  175. }
  176. }
  177. .fixed-bottom {
  178. position: fixed;
  179. bottom: 0;
  180. left: 0;
  181. right: 0;
  182. padding: 30rpx 40rpx;
  183. background-color: #fff;
  184. border-top: 1rpx solid #f0f0f0;
  185. z-index: 999;
  186. }
  187. }
  188. </style>