mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-02-23 21:36:38 +08:00
优化代码
This commit is contained in:
parent
853f8a37fb
commit
62c571eb26
@ -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('业主不存在');
|
||||
}
|
||||
}
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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
|
||||
});
|
||||
|
||||
@ -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";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user