学员端小程序
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.

191 lines
4.5 KiB

1 year ago
  1. <template>
  2. <view class="form">
  3. <view class="card">
  4. <view class="row" @click="showReason=true">
  5. <view class="lab">退款原因</view>
  6. <view class="val">申请同城转校</view>
  7. <view class="icon">
  8. <u-icon name="arrow-right"></u-icon>
  9. </view>
  10. </view>
  11. <!-- <view class="tpsBlue">此操作容易造成您已有学时丢失请谨慎</view> -->
  12. <view class="row">
  13. <view class="lab">退款金额</view>
  14. <view class="val">
  15. <u--input placeholder="请输入" border="none" clearable type="number" maxlength="11" v-model="FormData.phone"></u--input>
  16. </view>
  17. </view>
  18. <view class="tpsHui">退款金额不可超过¥2000.00</view>
  19. </view>
  20. <view class="h1">收款信息</view>
  21. <view class="card">
  22. <view class="row">
  23. <view class="lab">持卡人</view>
  24. <view class="val">
  25. <u--input placeholder="请输入" border="none" clearable type="number" maxlength="11" v-model="FormData.phone"></u--input>
  26. </view>
  27. </view>
  28. <view class="row">
  29. <view class="lab">手机号</view>
  30. <view class="val">
  31. <view class="flex-b">
  32. <view class="inputBox">
  33. <u--input placeholder="请输入" border="none" clearable type="number" maxlength="11" v-model="FormData.phone"></u--input>
  34. </view>
  35. <view class="code" @click='goSms' :class="{active: isPhone&&!codeOn}">获取验证码</view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="row">
  40. <view class="lab" >验证码</view>
  41. <view class="val">
  42. <u--input placeholder="请输入" border="none" clearable type="number" maxlength="11" v-model="FormData.phone"></u--input>
  43. </view>
  44. </view>
  45. <view class="row">
  46. <view class="lab">卡号</view>
  47. <view class="val">
  48. <view class="flex-b">
  49. <view class="inputBox">
  50. <u--input placeholder="请输入" border="none" clearable type="number" maxlength="11" v-model="FormData.phone"></u--input>
  51. </view>
  52. <view class="scan">
  53. <image src="@/static/images/userCenter/btn_yinhangkax.png" mode=""></image>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="row">
  59. <view class="lab">开户行</view>
  60. <view class="val">
  61. <u--input placeholder="请输入" border="none" clearable type="number" maxlength="11" v-model="FormData.phone"></u--input>
  62. </view>
  63. </view>
  64. </view>
  65. <u-picker :show="showReason" :columns="reasonArr" keyName="lab" @confirm="confirmReason" @cancel="showReason=false"></u-picker>
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. FormData: {
  73. },
  74. showReason: false ,
  75. codeOn: false,
  76. reasonArr: [
  77. [
  78. {lab: '不想学了',id: 1},
  79. {lab: '有事情',id: 2},
  80. {lab: '去别的地方学',id: 3},
  81. ]
  82. ],
  83. }
  84. },
  85. computed: {
  86. isPhone() {
  87. return uni.$u.test.mobile(this.FormData.phone)
  88. }
  89. },
  90. methods: {
  91. confirmReason(val) {
  92. let item = val.value[0]
  93. this.showReason = false
  94. console.log(item)
  95. },
  96. // 发送短信验证码
  97. async goSms() {
  98. const {
  99. FormData
  100. } = this
  101. if (!FormData.phone) return this.$u.toast('请输入手机号');
  102. if (!this.isPhone) return this.$u.toast('手机号格式有误');
  103. if (this.codeOn) return
  104. const data = await getLoginCode({
  105. codeType: 1,
  106. phone: FormData.phone,
  107. })
  108. console.log(data)
  109. // 获取验证码
  110. var time = 60;
  111. var timer = setInterval(() => {
  112. time--;
  113. this.codeText = time + "秒后重新发送"
  114. this.codeOn = true;
  115. if (time == 0) {
  116. clearInterval(timer);
  117. this.codeText = "获取验证码";
  118. this.codeOn = false;
  119. }
  120. }, 1000);
  121. },
  122. }
  123. }
  124. </script>
  125. <style lang="scss" scoped>
  126. .h1 {
  127. margin: 20rpx 0;
  128. }
  129. .card {
  130. padding: 12rpx 28rpx;
  131. margin-bottom: 24rpx;
  132. .row {
  133. display: flex;
  134. align-items: center;
  135. justify-content: space-between;
  136. height: 80rpx;
  137. line-height: 80rpx;
  138. .lab {
  139. font-size: 28rpx;
  140. color: #333;
  141. font-weight: 500;
  142. width: 152rpx;
  143. }
  144. .val {
  145. flex: 1;
  146. &.tpsBlue {
  147. font-size: 24rpx;
  148. }
  149. .flex-b {
  150. .scan {
  151. width: 44rpx;
  152. height: 44rpx;
  153. }
  154. .code {
  155. flex-shrink: 0;
  156. color: #ADADAD;
  157. &.active {
  158. color: $themC;
  159. }
  160. }
  161. }
  162. }
  163. .icon {
  164. u-icon {
  165. }
  166. }
  167. }
  168. .tpsBlue {
  169. color: $themC;
  170. margin-bottom: 10rpx;
  171. padding-left: 152rpx;
  172. font-size: 24rpx;
  173. }
  174. .tpsHui {
  175. font-size: 24rpx;
  176. color: #ADADAD;
  177. padding: 0rpx 0 16rpx 0;
  178. }
  179. }
  180. </style>