| | |
| | | <template> |
| | | <view class=""> |
| | | |
| | | <u-form labelPosition="left" :model="info" :rules="rules" ref="form" labelWidth="100" |
| | | <u-form labelPosition="left" :model="info" :rules="rules" ref="form" labelWidth="120" |
| | | :labelStyle="{fontSize:'28rpx'}"> |
| | | <view class="flex j-c-s-b a-i-c bgc-ff" style="padding:24rpx; margin: 20rpx 30rpx;"> |
| | | <!-- <view class="box-title" style="width:50%;"> |
| | | <box-title title="房东信息"></box-title> |
| | | </view> --> |
| | | <!-- #ifdef MP-WEIXIN --> |
| | | <ocr-navigator @onSuccess="recognizeSuccess($event)" certificateType="idCard" :opposite="false"> |
| | | <view class="recognize-btn flex a-i-c"> |
| | | <u-icon name="scan" color="#fff" size="24"></u-icon> |
| | | <text class="f-26 c-ff" style="margin-left: 10rpx;">身份证信息识别</text> |
| | | </view> |
| | | </ocr-navigator> |
| | | <!-- #endif --> |
| | | </view> |
| | | |
| | | <view class="content"> |
| | | <u-form-item label="场所名称" prop="districtName" borderBottom required> |
| | | <u-input v-model="info.districtName" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | |
| | | message: '请输入交易人姓名', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | goodsNums:[ |
| | | { |
| | | type: 'number', |
| | | required: true, |
| | | message: '请输入物品数量', |
| | | trigger: ['blur', 'change'] |
| | | } |
| | | ], |
| | | goodsNums: [{ |
| | | type: 'number', |
| | | required: true, |
| | | message: '请输入物品数量', |
| | | trigger: ['blur', 'change'] |
| | | }], |
| | | phoneNumber: [{ |
| | | type: 'number', |
| | | required: true, |
| | |
| | | } |
| | | ], |
| | | idCard: [{ |
| | | type: 'string', |
| | | // type: 'string', |
| | | required: false, |
| | | message: '请输入身份证号码', |
| | | trigger: ['change', 'blur'] |
| | | }, |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | const idCardRegex = |
| | | /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/ |
| | | return idCardRegex.test(value) |
| | | // const idCardRegex = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/ |
| | | return uni.$u.test.idCard(value) |
| | | // return idCardRegex.test(value) |
| | | }, |
| | | |
| | | message: '身份证号码有误', |
| | | trigger: ['change', 'blur'] |
| | | } |
| | | ], |
| | | |
| | | transactionMoney: { |
| | | required: true, |
| | | message: '请输入交易金额', |
| | |
| | | } |
| | | }, |
| | | onLoad(option) { |
| | | console.log(option,99999); |
| | | const {houseCode} = option; |
| | | console.log(option, 99999); |
| | | const { |
| | | houseCode |
| | | } = option; |
| | | if (option.id) { |
| | | this.isEdit = true; |
| | | this.id = option.id; |
| | |
| | | this.$set(this.info, "districtName", siteInfo.name); |
| | | this.$set(this.info, "userId", userInfo.user_id); |
| | | } |
| | | |
| | | if(houseCode){ |
| | | |
| | | if (houseCode) { |
| | | // 获取地址 |
| | | this.getPlaceDetail(houseCode) |
| | | } |
| | | }, |
| | | onReady() { |
| | | //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。 |
| | | this.$refs.form.setRules(this.rules) |
| | | }, |
| | | methods: { |
| | | getPlaceDetail(houseCode){ |
| | | //识别成功 |
| | | recognizeSuccess(e, key) { |
| | | let { |
| | | detail: { |
| | | name, |
| | | id |
| | | } |
| | | } = e; |
| | | |
| | | this.info.owner = name.text; |
| | | this.info.idCard = id.text; |
| | | }, |
| | | |
| | | getPlaceDetail(houseCode) { |
| | | getPlaceDetail({ |
| | | houseCode: houseCode |
| | | }).then(res => { |
| | |
| | | background-color: #F5F5F5; |
| | | } |
| | | |
| | | .recognize-btn { |
| | | padding: 12rpx; |
| | | border-radius: 6rpx; |
| | | background-color: #3c9cff; |
| | | margin-left: 30rpx; |
| | | } |
| | | |
| | | .content { |
| | | margin: 20rpx 30rpx; |
| | | padding: 0 30rpx; |