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 | 101 ++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 96 insertions(+), 5 deletions(-)
diff --git a/WebService/src/main/resources/components/nav/nav.js b/WebService/src/main/resources/components/nav/nav.js
index ca5bebb..ac84c2e 100644
--- a/WebService/src/main/resources/components/nav/nav.js
+++ b/WebService/src/main/resources/components/nav/nav.js
@@ -5,10 +5,19 @@
var vm = new Vue({
el:'#nav',
data:{
- nav:{}
+ nav:{},
+ userName:"",
+ navCommunityInfo:{
+ _currentCommunity:{
+
+ },
+ communityInfos:[]
+ }
},
mounted:function(){
+ this.getNavCommunity();
this.getNavData();
+ this.getUserInfo();
},
methods:{
getNavData:function(){
@@ -17,20 +26,102 @@
};
//鍙戦�乬et璇锋眰
- vc.http.call('nav',
+ vc.http.get('nav',
'getNavData',
param,
- {
- emulateJSON:true
- },function(json){
+ function(json){
vm.nav = JSON.parse(json);
},function(){
console.log('璇锋眰澶辫触澶勭悊');
}
);
+ },
+ logout:function(){
+ var param = {
+ msg:123
+ };
+ //鍙戦�乬et璇锋眰
+ vc.http.post('nav',
+ 'logout',
+ JSON.stringify(param),
+ {
+ emulateJSON:true
+ },
+ function(json,res){
+ if(res.status == 200){
+ vc.jumpToPage("/flow/login");
+ return ;
+ }
+ },function(){
+ console.log('璇锋眰澶辫触澶勭悊');
+ }
+ );
+ },
+ getUserInfo:function(){
+ //鑾峰彇鐢ㄦ埛鍚�
+ var param = {
+ msg:'123',
+ };
+
+ //鍙戦�乬et璇锋眰
+ vc.http.get('nav',
+ 'getUserInfo',
+ param,
+ function(json,res){
+ if(res.status == 200){
+ var tmpUserInfo = JSON.parse(json);
+ vm.userName = tmpUserInfo.name;
+ }
+ },function(){
+ 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);
}
}
+
});
})(window.vc);
\ No newline at end of file
--
Gitblit v1.8.0