鸿宇研学生前端代码
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.

232 lines
4.7 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar title="提现" leftClick @leftClick="$utils.navigateBack" color="#191919" bgColor="#FFFFFF" />
  4. <view class="main">
  5. <view class="card">
  6. <view class="card-header">微信提现</view>
  7. <view class="form">
  8. <uv-form
  9. ref="form"
  10. :model="form"
  11. :rules="rules"
  12. errorType="toast"
  13. >
  14. <view class="form-item">
  15. <uv-form-item prop="name" :customStyle="formItemStyle">
  16. <view class="form-item-label">真实姓名</view>
  17. <view class="form-item-content">
  18. <formInput v-model="form.name"></formInput>
  19. </view>
  20. </uv-form-item>
  21. </view>
  22. <view class="form-item">
  23. <uv-form-item prop="amount" :customStyle="formItemStyle">
  24. <view class="form-item-label">提现金额</view>
  25. <view class="form-item-content">
  26. <formInput v-model="form.amount"></formInput>
  27. </view>
  28. </uv-form-item>
  29. </view>
  30. </uv-form>
  31. </view>
  32. </view>
  33. <view class="notice">
  34. 请仔细检查并确认相关信息因用户个人疏忽导致的充值错误需由用户自行承担
  35. <!-- todo: 替换配置项key -->
  36. <text class="highlight" @click="$refs.modal.open('user_ys', '提现须知')">提现须知</text>
  37. </view>
  38. <agreementModal ref="modal"></agreementModal>
  39. </view>
  40. <view class="bottom">
  41. <button class="btn" @click="onSubmit">提现</button>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import formInput from '@/pages_order/components/formInput.vue'
  47. import agreementModal from '@/pages_order/components/agreementModal.vue'
  48. export default {
  49. components: {
  50. formInput,
  51. agreementModal,
  52. },
  53. data() {
  54. return {
  55. form: {
  56. name: null,
  57. amount: null,
  58. },
  59. rules: {
  60. 'name': {
  61. type: 'string',
  62. required: true,
  63. message: '请输入真实姓名',
  64. },
  65. 'amount': {
  66. type: 'string',
  67. required: true,
  68. message: '请输入提现金额',
  69. },
  70. },
  71. formItemStyle: { padding: 0 },
  72. }
  73. },
  74. methods: {
  75. async onSubmit() {
  76. try {
  77. await this.$refs.form.validate()
  78. const {
  79. } = this.form
  80. const params = {
  81. }
  82. // todo: fetch
  83. // await this.$fetch('updateAddress', params)
  84. uni.showToast({
  85. icon: 'success',
  86. title: '提交成功',
  87. });
  88. setTimeout(() => {
  89. this.$utils.navigateBack()
  90. }, 800)
  91. } catch (err) {
  92. console.log('onSave err', err)
  93. }
  94. },
  95. },
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .page__view {
  100. width: 100vw;
  101. min-height: 100vh;
  102. background: $uni-bg-color;
  103. position: relative;
  104. /deep/ .nav-bar__view {
  105. position: fixed;
  106. top: 0;
  107. left: 0;
  108. }
  109. }
  110. .main {
  111. padding: calc(var(--status-bar-height) + 144rpx) 32rpx 224rpx 32rpx;
  112. }
  113. .card {
  114. padding: 32rpx;
  115. background: #FFFFFF;
  116. border: 2rpx solid #FFFFFF;
  117. border-radius: 32rpx;
  118. & + & {
  119. margin-top: 40rpx;
  120. }
  121. &-header {
  122. font-family: PingFang SC;
  123. font-weight: 500;
  124. font-size: 36rpx;
  125. line-height: 1.4;
  126. color: #252545;
  127. margin-bottom: 32rpx;
  128. }
  129. }
  130. .form {
  131. padding: 8rpx 0 0 0;
  132. &-item {
  133. border-bottom: 2rpx solid #EEEEEE;
  134. &:last-child {
  135. border: none;
  136. }
  137. & + & {
  138. margin-top: 40rpx;
  139. }
  140. &-label {
  141. font-family: PingFang SC;
  142. font-weight: 400;
  143. font-size: 26rpx;
  144. line-height: 1.4;
  145. color: #181818;
  146. }
  147. &-content {
  148. margin-top: 14rpx;
  149. padding: 6rpx 0;
  150. .text {
  151. padding: 2rpx 0;
  152. font-family: PingFang SC;
  153. font-weight: 400;
  154. font-size: 32rpx;
  155. line-height: 1.4;
  156. &.placeholder {
  157. color: #C6C6C6;
  158. }
  159. }
  160. }
  161. }
  162. }
  163. .notice {
  164. margin-top: 40rpx;
  165. font-size: 24rpx;
  166. line-height: 1.4;
  167. color: #BABABA;
  168. .highlight {
  169. color: #F79400;
  170. }
  171. }
  172. .bottom {
  173. position: fixed;
  174. left: 0;
  175. bottom: 0;
  176. width: 100vw;
  177. // height: 200rpx;
  178. padding: 24rpx 40rpx;
  179. padding-bottom: calc(env(safe-area-inset-bottom) + 24rpx);
  180. background: #FFFFFF;
  181. box-sizing: border-box;
  182. .btn {
  183. width: 100%;
  184. padding: 14rpx 0;
  185. box-sizing: border-box;
  186. font-family: PingFang SC;
  187. font-weight: 500;
  188. font-size: 36rpx;
  189. line-height: 1;
  190. color: #FFFFFF;
  191. background: linear-gradient(to right, #21FEEC, #019AF9);
  192. border: 2rpx solid #00A9FF;
  193. border-radius: 41rpx;
  194. }
  195. }
  196. </style>