From e546f6e157e79e4074ca23f7e4e48a5c9aea4fdb Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期四, 09 五月 2019 14:30:08 +0800
Subject: [PATCH] 房屋管理开发测试完成
---
WebService/src/main/resources/components/nav/nav.js | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/WebService/src/main/resources/components/nav/nav.js b/WebService/src/main/resources/components/nav/nav.js
index 7b2a6ff..ac84c2e 100644
--- a/WebService/src/main/resources/components/nav/nav.js
+++ b/WebService/src/main/resources/components/nav/nav.js
@@ -7,8 +7,15 @@
data:{
nav:{},
userName:"",
+ navCommunityInfo:{
+ _currentCommunity:{
+
+ },
+ communityInfos:[]
+ }
},
mounted:function(){
+ this.getNavCommunity();
this.getNavData();
this.getUserInfo();
},
@@ -70,6 +77,48 @@
console.log('璇锋眰澶辫触澶勭悊');
}
);
+ },
+ getNavCommunity:function(){
+ var _tmpCurrentCommunity = vc.getCurrentCommunity();
+ //娴忚鍣ㄧ紦瀛樹腑鑳借幏鍙栧埌
+ if(_tmpCurrentCommunity != null && _tmpCurrentCommunity != undefined){
+ this.navCommunityInfo._currentCommunity = _tmpCurrentCommunity;
+ this.navCommunityInfo.communityInfos = vc.getCommunitys();
+
+ return ;
+ }
+
+ //璇存槑缂撳瓨涓病鏈夋暟鎹�
+ //鍙戦�乬et璇锋眰
+ /**
+ [{community:"123123",name:"娴嬭瘯1灏忓尯"},{community:"223123",name:"娴嬭瘯2灏忓尯"}]
+ **/
+ vc.http.get('nav',
+ 'getCommunitys',
+ '',
+ function(json,res){
+ if(res.status == 200){
+ vm.navCommunityInfo.communityInfos = JSON.parse(json);
+
+ if(vm.navCommunityInfo.communityInfos == null || vm.navCommunityInfo.communityInfos.length == 0){
+ vm.navCommunityInfo._currentCommunity ={
+ name:"杩樻病鏈夊叆椹诲皬鍖�"
+ };
+ return;
+ }
+
+ vm.navCommunityInfo._currentCommunity = vm.navCommunityInfo.communityInfos[0];
+ vc.setCurrentCommunity(vm.navCommunityInfo._currentCommunity);
+ vc.setCommunitys(vm.navCommunityInfo.communityInfos);
+ }
+ },function(){
+ console.log('璇锋眰澶辫触澶勭悊');
+ }
+ );
+
+ },
+ changeCommunity:function(_community){
+ vc.setCurrentCommunity(_community);
}
}
--
Gitblit v1.8.0