优化代码

This commit is contained in:
wuxw 2024-09-12 23:11:36 +08:00
parent 9f21277e3f
commit f7cf50c8ea
3 changed files with 26 additions and 34 deletions

View File

@ -118,12 +118,10 @@
},
loadOwenrInfo: function() {
let _that = this;
context.getOwner(function(_ownerInfo) {
if (_ownerInfo) {
_that.ownerFlag = true;
} else {
_that.ownerFlag = false;
}
hasAuthOwner(this).then(_owner => {
_that.ownerFlag = true;
},()=>{
_that.ownerFlag = false;
});
},
/**
@ -137,8 +135,8 @@
communityId:getCommunityId()
}).then(_data=>{
//console.log(_data);
if(_data.url){
_that.headerImg = _data.url;
if(_data.faceUrl){
_that.headerImg = _data.faceUrl;
}else{
_that.headerImg =conf.imgUrl+'/h5/images/serve/head.png';
}

View File

@ -18,11 +18,7 @@
</picker>
</view>
<view class="cu-form-group">
<view class="title">年龄</view>
<input type="number" v-model="age" placeholder="请输入年龄"></input>
</view>
<view class="cu-form-group">
<view class="title">人员类型</view>
<view class="title">人员角色</view>
<picker :value="typeCdIndex" :range="typeCds" range-key="name" @change="_changeTypeCd">
<view class="picker">
{{typeCds[typeCdIndex].name}}
@ -30,8 +26,8 @@
</picker>
</view>
<view class="cu-form-group">
<view class="title">家庭住</view>
<input type="text" v-model="address" placeholder="选填,请输入家庭住址"></input>
<view class="title"></view>
<input type="text" v-model="address" placeholder="选填,请输入址"></input>
</view>
<view class="block__title">联系信息</view>
@ -39,11 +35,6 @@
<view class="title">手机号</view>
<input v-model="link" placeholder="请输入手机号(没有手机号随便写一个)"></input>
</view>
<!-- <view class="cu-form-group">
<view class="title">验证码</view>
<input v-model="msgCode" placeholder="请输入短信验证码" name="input"></input>
<button class='cu-btn bg-green shadow' :disabled="btnDisabled" @click="_sendMsgCode()">{{btnValue}}</button>
</view> -->
<view class="block__title">相关图片</view>
<uploadImageAsync ref="vcUploadRef" :communityId="communityId" :maxPhotoNum="uploadImage.maxPhotoNum" :canEdit="uploadImage.canEdit" :title="uploadImage.imgTitle" @sendImagesData="sendImagesData"></uploadImageAsync>
@ -81,22 +72,26 @@
"userId": "",
"typeCds": [
{
value: '1002',
value: '3',
name: '家庭成员'
},
{
value: '1003',
value: '2',
name: '租客'
},
{
value: '1005',
value: '4',
name: '公司员工'
},
{
value: '99',
name: '其他'
}
],
"typeCdIndex": 0,
"personRole":'3',
"ownerTypeCd": "1002",
"idCard": "",
"age": "",
"memberId": "-1",
"communityId": "",
"second": 60,
@ -104,7 +99,7 @@
"btnValue": "验证码",
"msgCode":'',
"address": "",
photos:[],
photos:'',
uploadImage: {
maxPhotoNum: 1,
imgTitle: '图片上传',
@ -134,7 +129,7 @@
onPullDownRefresh: function() {},
methods: {
sendImagesData: function(e){
this.photos = e[0].fileId
this.photos = e[0].url;
},
submitOwnerMember: function(e) {
let obj = {
@ -149,9 +144,10 @@
"memberId": this.memberId,
"communityId": this.communityId,
"idCard": this.idCard,
//"msgCode":this.msgCode,
"personRole":this.personRole,
"personType":'P',
"address": this.address,
"ownerPhoto": this.photos
"ownerPhotoUrl": this.photos
}
let msg = "";
@ -159,8 +155,6 @@
msg = "请填写业主";
} else if (obj.name == "") {
msg = "请填写姓名";
}else if (obj.age == "") {
msg = "请填写年龄";
} else if (obj.link == "") {
msg = "请填写手机号";
} else if (!checkPhoneNumber(obj.link)){
@ -212,7 +206,7 @@
},
_changeTypeCd: function(e){
this.typeCdIndex = e.detail.value;
this.ownerTypeCd = this.typeCds[this.typeCdIndex].value;
this.personRole = this.typeCds[this.typeCdIndex].value;
},
idCardChange: function(){
let idCard = this.idCard;

View File

@ -118,9 +118,9 @@
method: "GET",
data: _paramIn,
success: function(res) {
if (res.statusCode == 200) {
let _owners = res.data.owners;
that.owners = _owners;
let _json = res.data;
if (_json.code == 0) {
that.owners = _json.data;
that.loading = false;
}
},