优化代码

This commit is contained in:
wuxw 2021-11-27 13:21:45 +08:00
parent 853f8a37fb
commit 62c571eb26
4 changed files with 50 additions and 1 deletions

View File

@ -198,3 +198,35 @@ export function deleteOwnerMember(_data){
});
})
}
/**
* 判断是否存在业主
*
*/
export function hasOwner(){
let _ownerInfo = wx.getStorageSync(mapping.OWNER_INFO);
if(_ownerInfo){
uni.showToast({
icon:'none',
title:'未查询到业主房产'
})
throw new Error('业主不存在');
}
let _memberId = _ownerInfo.memberId;
if(!_memberId){
uni.showToast({
icon:'none',
title:'未查询到业主房产'
})
throw new Error('业主不存在');
}
if(_memberId != '-1'){
uni.showToast({
icon:'none',
title:'未查询到业主房产'
})
throw new Error('业主不存在');
}
}

View File

@ -3,7 +3,7 @@
<view>
<view class="padding">小区信息</view>
<view class="cu-list menu ">
<view class="cu-list menu " v-if="communitys.length>0">
<view class="cu-item" v-for="(item,sub) in communitys" :key="sub" @tap="_doChangeCommunity(item)">
<view class="content padding-tb-sm">
<view>
@ -15,6 +15,18 @@
</view>
</view>
</view>
<block v-else>
<view class="cu-list menu">
<view class="cu-item">
<view class="content">
<text class="cuIcon-notification text-grey"></text>
<text class="text-grey">暂无小区信息</text>
</view>
<view class="action">
</view>
</view>
</view>
</block>
</view>
</view>

View File

@ -92,6 +92,8 @@
import {getCurOwner} from '../../api/owner/ownerApi.js'
import {hasLogin} from '../../auth/Java110Auth.js'
import {hasOwner} from '../../api/owner/ownerApi.js'
export default {
data() {
return {
@ -304,6 +306,7 @@
this._loadActivites();
},
toPage: function(pageUrl) {
hasOwner();
this.vc.navigateTo({
url: pageUrl
});

View File

@ -130,6 +130,7 @@
_that.login = true;
_that.loadOwenrInfo();
_that.userInfo = context.getUserInfo();
console.log('用户信息',_that.userInfo)
this.loadOwnerHeaderImg();
},
bindingOwner: function() {
@ -151,6 +152,7 @@
loadOwnerHeaderImg: function() {
let _that = this;
context.getOwner(function(_owner) {
let _headerImg = constant.url.getOwnerPhotoPath + "?objId=" + _owner.memberId +
"&communityId=" + _owner.communityId +
"&fileTypeCd=10000";