优化代码

This commit is contained in:
wuxw 2024-02-29 11:13:36 +08:00
parent 55c6b92c84
commit 05b06d647e
3 changed files with 18 additions and 8 deletions

View File

@ -91,6 +91,16 @@ export function getCommunityName(){
return conf.DEFAULT_COMMUNITY_NAME; return conf.DEFAULT_COMMUNITY_NAME;
} }
export function getCommunityTel(){
let _currentCommunity = uni.getStorageSync("currentCommunityInfo")
if(_currentCommunity){
return _currentCommunity.sCommunityTel;
}
return '';
}
/** /**
* 查询当前小区 * 查询当前小区
* *

View File

@ -309,6 +309,7 @@ export function ownerLogin(_that, _data) {
uni.setStorageSync("currentCommunityInfo",{ uni.setStorageSync("currentCommunityInfo",{
communityId:_json.data.communityId, communityId:_json.data.communityId,
communityName:_json.data.communityName, communityName:_json.data.communityName,
sCommunityTel:_json.data.communityTel
}); });
uni.setStorageSync("ownerInfo",{ uni.setStorageSync("ownerInfo",{
memberId:_json.data.memberId, memberId:_json.data.memberId,

View File

@ -69,6 +69,8 @@
import { import {
getProperty getProperty
} from '../../api/property/propertyApi.js'; } from '../../api/property/propertyApi.js';
import {getCommunityName,getCommunityTel} from '../../api/community/communityApi.js';
export default { export default {
name: "indexMenu", name: "indexMenu",
@ -158,14 +160,11 @@
}); });
return; return;
} }
hasOwner();
uni.getStorage({ this.property.sCommunityTel = getCommunityTel();
key: 'ownerInfo', this.property.communityName = getCommunityName();
success: function(res) { _that.callPropertyModal = true;
_that.property = res.data;
_that.callPropertyModal = true;
}
});
}, },
_doCall: function() { _doCall: function() {