|
@@ -12,19 +12,23 @@
|
|
|
<uni-forms-item label="联系电话" required name="phone">
|
|
|
<uni-easyinput v-model="form.phone" placeholder="请输入联系电话" maxlength="13"/>
|
|
|
</uni-forms-item>
|
|
|
- <uni-forms-item label="证照信息" required name="path">
|
|
|
+ <uni-forms-item label="证照信息" required class="onePic" v-if="form.id != null">
|
|
|
+ <image :src="loadImgSrc(item)" v-for="(item, index1) in imageList" :key="index1">
|
|
|
+ </image>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="证照信息" required name="path" v-if="form.id == null">
|
|
|
<upload :imgArr="imageList" name="path" v-model="form.path" :fileSize="1" :limit="2"
|
|
|
@updateImg="updateImg"></upload>
|
|
|
</uni-forms-item>
|
|
|
</uni-forms>
|
|
|
- <button type="primary" @click="submitForm('customForm')">提交</button>
|
|
|
+ <button type="primary" @click="submitForm('customForm')" v-if="form.id==null">提交</button>
|
|
|
</view>
|
|
|
</uni-section>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import upload from '../../components/upload/index.vue'
|
|
|
- import {appletAdd} from '@/api/me/officialAuthentication.js'
|
|
|
+ import {appletAdd,getUserInfo} from '@/api/me/officialAuthentication.js'
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
@@ -33,6 +37,8 @@
|
|
|
onReady() {
|
|
|
// 设置自定义表单校验规则,必须在节点渲染完毕后执行
|
|
|
this.$refs.customForm.setRules(this.customRules)
|
|
|
+ this.userId = getApp().globalData.userId
|
|
|
+ this.getUserInfoByUserId(this.userId)
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -87,18 +93,28 @@
|
|
|
})
|
|
|
}else{
|
|
|
appletAdd(this.form).then(res => {
|
|
|
- console.log("1111111111")
|
|
|
uni.navigateBack();
|
|
|
- console.log("2222222222222")
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ //图片上传
|
|
|
updateImg(imgList) {
|
|
|
this.imageList = imgList;
|
|
|
this.form.path = this.imageList.join(',');
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ //按userId查询实名认证信息
|
|
|
+ getUserInfoByUserId(userId){
|
|
|
+ getUserInfo(userId).then(res =>{
|
|
|
+ if(res.data!=null){
|
|
|
+ this.form = res.data;
|
|
|
+ this.imageList = res.data.path.split(",")
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|