Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

signing-bank.vue 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <view class="oderPage">
  3. <u-form :model="form" ref="myForm" :error-type="errorType">
  4. <view class="from">
  5. <u-form-item prop="bank">
  6. <view class="from_item">
  7. <text><text style="color: red;">*</text>签约银行:</text>
  8. <u-input v-model="form.bank" class="input" disabled />
  9. </view>
  10. </u-form-item>
  11. <u-form-item prop="bankID">
  12. <view class="from_item">
  13. <text><text style="color: red;">*</text>银行卡号:</text>
  14. <u-input v-model="form.bankID" class="input" />
  15. </view>
  16. </u-form-item>
  17. <u-form-item prop="phone">
  18. <view class="from_item">
  19. <text><text style="color: red;">*</text>开户手机:</text>
  20. <u-input v-model="form.phone" class="input" />
  21. <view class="btn">
  22. 获取验证码
  23. </view>
  24. </view>
  25. </u-form-item>
  26. <u-form-item prop="code">
  27. <view class="from_item">
  28. <text><text style="color: red;"></text>验证码:</text>
  29. <u-input v-model="form.code" class="input" />
  30. </view>
  31. </u-form-item>
  32. </view>
  33. </u-form>
  34. <button class="submit" @click="toPage()">下一步</button>
  35. </view>
  36. </template>
  37. <script setup lang="ts">
  38. import navBar from "./components/nav-bar.vue"
  39. import {
  40. checkStr
  41. } from "@/utils/utils"
  42. import {
  43. ref,
  44. reactive
  45. } from "vue";
  46. import {
  47. navTo
  48. } from "@/utils/utils"
  49. import {
  50. onReady
  51. } from "@dcloudio/uni-app";
  52. // 表单数据
  53. const form = reactive({
  54. bank: "工商银行",
  55. bankID: "666655454554555",
  56. phone: "12332112321",
  57. code: ""
  58. })
  59. // 验证规则
  60. const rules = {
  61. bankID: [{
  62. required: true,
  63. message: '请输入',
  64. trigger: ['change', 'blur'],
  65. }],
  66. bank: [{
  67. required: true,
  68. message: '请输入',
  69. trigger: ['change', 'blur'],
  70. }],
  71. code: [{
  72. required: true,
  73. message: '请输入',
  74. trigger: ['change', 'blur'],
  75. }],
  76. phone: [{
  77. required: true,
  78. message: '请输入手机号',
  79. trigger: ['change', 'blur'],
  80. },
  81. {
  82. // 自定义验证函数,见上说明
  83. validator: (rule, value, callback) => {
  84. // 上面有说,返回true表示校验通过,返回false表示不通过
  85. console.log(checkStr(value, 'mobile'), '0011');
  86. return checkStr(value, 'mobile')
  87. },
  88. message: '手机号码不正确',
  89. trigger: ['change', 'blur'],
  90. }
  91. ],
  92. // status: [{
  93. // required: true,
  94. // message: '请选择状态',
  95. //
  96. // trigger: ['change', 'blur'],
  97. }
  98. // 验证提示类型(toast要版本为1.3.5才支持)
  99. const errorType = ['message', 'border-bottom', 'toast']
  100. // 设置验证规则
  101. const myForm = ref(null)
  102. onReady(() => {
  103. myForm.value.setRules(rules)
  104. })
  105. // 单选数据列表
  106. const radiolist1 = reactive([{
  107. name: '营业点自提',
  108. disabled: false
  109. },
  110. {
  111. name: '邮寄',
  112. disabled: false
  113. },
  114. ], )
  115. // 单选
  116. const radioChange = (n) => {
  117. console.log('radioChange', n);
  118. // if (n == '卡退费') {
  119. // flag.value = true
  120. // console.log(flag.value);
  121. // } else {
  122. // flag.value = false
  123. // console.log(flag.value);
  124. // }
  125. }
  126. // // 提交
  127. // const submit = () => {
  128. // myForm.value.validate((valid) => {
  129. // console.log(valid);
  130. // if (valid) {
  131. // console.log('验证通过', form);
  132. // } else {
  133. // console.log('验证未通过');
  134. // }
  135. // })
  136. // }
  137. const toPage = () => {
  138. uni.showModal({
  139. title: '模拟两种情况',
  140. confirmText: '无需支付',
  141. cancelText: '需支付',
  142. success: function(res) {
  143. if (res.confirm) {
  144. console.log('用户点击确定');
  145. // navTo('/subpackage/after-sale/replace-equipment/result')
  146. uni.redirectTo({
  147. url: ('/subpackage/after-sale/replace-equipment/result')
  148. });
  149. } else if (res.cancel) {
  150. console.log('用户点击取消');
  151. // navTo('/subpackage/after-sale/replace-equipment/pay-page')
  152. uni.redirectTo({
  153. url: ('/subpackage/after-sale/replace-equipment/pay-page')
  154. });
  155. }
  156. }
  157. });
  158. }
  159. </script>
  160. <style>
  161. page {
  162. width: 100%;
  163. height: 100%;
  164. display: flex;
  165. flex-direction: column;
  166. background-color: ##EEF7F7;
  167. }
  168. </style>
  169. <style lang="scss" scoped>
  170. .oderPage {
  171. flex: 1;
  172. width: 100%;
  173. .from {
  174. background-color: #fff;
  175. margin-top: 30rpx;
  176. padding: 0 30rpx;
  177. ::v-deep .u-form-item {
  178. padding: 0;
  179. line-height: normal;
  180. .u-form-item__message {
  181. margin-bottom: 12rpx
  182. }
  183. }
  184. .from_item {
  185. display: flex;
  186. flex-wrap: nowrap;
  187. justify-content: space-between;
  188. align-items: center;
  189. height: 80rpx;
  190. border-bottom: 1rpx solid #DCDCDC;
  191. .btn {
  192. font-size: 24rpx;
  193. font-family: Microsoft YaHei;
  194. font-weight: 400;
  195. color: #FFFFFF;
  196. background: #00B38B;
  197. border-radius: 10rpx;
  198. padding: 10rpx 15rpx;
  199. }
  200. ::v-deep .input {
  201. text-align: left;
  202. flex: 1;
  203. background: transparent;
  204. input {
  205. text-align: left;
  206. }
  207. }
  208. }
  209. .from_item1 {
  210. display: flex;
  211. flex-wrap: nowrap;
  212. flex-direction: column;
  213. justify-content: space-between;
  214. padding: 30rpx;
  215. border-bottom: #DCDCDC 1px solid;
  216. input {
  217. text-align: right;
  218. }
  219. .textarea {
  220. background-color: #F1F1F1;
  221. width: 100%;
  222. border-radius: 20rpx;
  223. margin-top: 10rpx;
  224. text-indent: 1rem;
  225. height: 180rpx;
  226. padding: 20rpx;
  227. box-sizing: border-box;
  228. }
  229. }
  230. }
  231. }
  232. .submit {
  233. background: linear-gradient(to left, #43A1E0 0%, #13E7C1 100%);
  234. width: 670rpx;
  235. height: 80rpx;
  236. color: #fff;
  237. border-radius: 100rpx;
  238. position: fixed;
  239. left: 50%;
  240. transform: translate(-50%);
  241. bottom: 60rpx;
  242. font-size: 32rpx;
  243. }
  244. </style>