daiJiaoGeRenHuiFei.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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="请输入缴交对象姓名" placeholder-style="font-size: 22rpx;"/></u-form-item>
  6. <u-form-item label="证件号码" prop="idNumber"><u-input v-model="formData.form.idNumber" :border="true" type="text" placeholder="请输入缴交对象的身份证号/手机号/业务水平认证证书编号" placeholder-style="font-size: 22rpx;"/></u-form-item>
  7. </u-form>
  8. </view>
  9. <view class="desc-box">
  10. <!-- <rich-text :nodes="explain"></rich-text> -->
  11. <mp-html :content="explain" />
  12. </view>
  13. <view class="bottom-box">
  14. <u-button type="primary" shape="circle" @click="onSubmit">查询</u-button>
  15. </view>
  16. </view>
  17. </template>
  18. <script setup>
  19. import { ref, reactive } from 'vue'
  20. import { onLoad, onReady } from '@dcloudio/uni-app'
  21. import { person } from '@/api/cost.js'
  22. const explain = `<p><span style="font-size: 14px;">批量缴交请联系协会秘书处,刘小姐&nbsp;13326440363</span></p>`
  23. const formRef = ref()
  24. const formData = reactive({
  25. form: {
  26. name: null, // 姓名
  27. idNumber: null, // 证件号码
  28. },
  29. rules: {
  30. name: [
  31. {
  32. required: true,
  33. message: '请输入缴交对象姓名',
  34. // 可以单个或者同时写两个触发验证方式
  35. trigger: 'blur',
  36. }
  37. ],
  38. idNumber: [
  39. {
  40. required: true,
  41. message: '请输入缴交对象的身份证号/手机号/业务水平认证证书编号',
  42. // 可以单个或者同时写两个触发验证方式
  43. trigger: 'blur',
  44. }
  45. ],
  46. }
  47. })
  48. function onSubmit() {
  49. formRef.value.validate((valid) => {
  50. if (valid) {
  51. // 查询到的ID
  52. const id = '1'
  53. person(formData.form).then(res => {
  54. if (res && res.message === 'success') {
  55. if (res.data.userId) {
  56. uni.navigateTo({
  57. url: `/pages/daiJiaoGeRenChaXunJieGuo/daiJiaoGeRenChaXunJieGuo?name=${formData.form.name}&idNumber=${formData.form.idNumber}`
  58. })
  59. }
  60. }
  61. })
  62. }
  63. })
  64. }
  65. onReady(() => {
  66. formRef.value.setRules(formData.rules)
  67. })
  68. onLoad(() => {
  69. console.log('onLoad')
  70. })
  71. </script>
  72. <style lang="scss" scoped>
  73. .container {
  74. height: 100vh;
  75. width: 100vw;
  76. background-color: $uni-bg-color;
  77. padding: 20rpx;
  78. .form-box {
  79. padding: 20rpx 0;
  80. }
  81. .bottom-box {
  82. margin-top: 150rpx;
  83. padding: 0 50rpx;
  84. }
  85. }
  86. </style>