daiJiaoGeRenHuiFei.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view class="container">
  3. <view class="form-box">
  4. <u-form :model="formData.form" ref="formRef" label-width="120" :label-style="{fontWeight: 'bold', fontSize: '26rpx'}">
  5. <u-form-item label="姓名" prop="name"><u-input v-model="formData.form.name" :border="true" type="text" placeholder="请输入缴交对象姓名"/></u-form-item>
  6. <u-form-item label="证件号码" prop="idNumber"><u-input v-model="formData.form.idNumber" :border="true" type="text" placeholder="请输入缴交对象的身份证号/手机号/业务水平认证证书编号"/></u-form-item>
  7. </u-form>
  8. </view>
  9. <view class="bottom-box">
  10. <u-button type="primary" shape="circle" @click="onSubmit">查询</u-button>
  11. </view>
  12. </view>
  13. </template>
  14. <script setup>
  15. import { ref, reactive } from 'vue'
  16. import { onLoad, onReady } from '@dcloudio/uni-app'
  17. const formRef = ref()
  18. const formData = reactive({
  19. form: {
  20. name: null, // 姓名
  21. idNumber: null, // 证件号码
  22. },
  23. rules: {
  24. name: [
  25. {
  26. required: true,
  27. message: '请输入缴交对象姓名',
  28. // 可以单个或者同时写两个触发验证方式
  29. trigger: 'blur',
  30. }
  31. ],
  32. idNumber: [
  33. {
  34. required: true,
  35. message: '请输入缴交对象的身份证号/手机号/业务水平认证证书编号',
  36. // 可以单个或者同时写两个触发验证方式
  37. trigger: 'blur',
  38. }
  39. ],
  40. }
  41. })
  42. function onSubmit() {
  43. formRef.value.validate((valid) => {
  44. if (valid) {
  45. // 查询到的ID
  46. const id = '1'
  47. uni.navigateTo({
  48. url: `/pages/daiJiaoGeRenChaXunJieGuo/daiJiaoGeRenChaXunJieGuo?id=${id}`
  49. })
  50. }
  51. })
  52. }
  53. onReady(() => {
  54. formRef.value.setRules(formData.rules)
  55. })
  56. onLoad(() => {
  57. console.log('onLoad')
  58. })
  59. </script>
  60. <style lang="scss" scoped>
  61. .container {
  62. height: 100vh;
  63. width: 100vw;
  64. background-color: $uni-bg-color;
  65. padding: 20rpx;
  66. .form-box {
  67. padding: 20rpx 0;
  68. }
  69. .bottom-box {
  70. margin-top: 100rpx;
  71. padding: 0 50rpx;
  72. }
  73. }
  74. </style>