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.

signing-bank.vue 5.7KB

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