Browse Source

页面功能修改

shilin 4 years ago
parent
commit
0199ca1617

+ 4 - 4
components/mine/Mine.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="content">
-<!-- 		<cu-custom bgColor="bg-blacks" :isBack="false">
+		<cu-custom bgColor="bg-blacks" :isBack="false">
 		    <block slot="right">
 				<image src="../../static/picture/fourLine.png" style="width: 30px;height: 30px;margin-left: 2%;" @tap="openDrawer"></image>
 			</block>
@@ -18,12 +18,12 @@
 			<block slot="right">
 				<view class="plus" @tap="showModal" data-target="viewModal">+</view>
 			</block>
-		</cu-custom> -->
+		</cu-custom>
 		<!-- 抽屉组件 -->
-		<!-- <div>
+		 <div>
 			<drawer ref="drawer"></drawer>
 		</div>
-		<div class="plusDrawer" @tap="hideModal">
+		<!--<div class="plusDrawer" @tap="hideModal">
 			<plusDrawer ref="plusDrawer"></plusDrawer>
 		</div> -->
 		<view>

+ 82 - 74
components/mine/addressBook/InitializeThe.vue

@@ -7,6 +7,13 @@
 <script>
 	var wv = [];
 	export default {
+		name: "initial",
+		props: {
+			showModal: {
+				type: String,
+				default: '0'
+			}
+		},
 		data() {
 			return {
 				userList: [],
@@ -40,107 +47,108 @@
 			},
 		},
 		methods: {
-		
+	
 			getUserList() {
-				this.lastUserName = uni.getStorageSync('gyeeusername');
-				this.userid = uni.getStorageSync('userid');
-
-				let _this = this;
-				uni.request({
-					url: 'http://' + this.sisStageIp + ':' + this.sisStagePort + '/GyeeuserController/selectUserList',
-					data: {},
-					method: 'GET',
-					success: function(res) {
-						_this.userList = [];
-
-						for (var i = 0; i < res.data.length; i++) {
-
-							if (res.data[i].id != _this.userid) {
-
-								var pages = getCurrentPages();
-								var page = pages[pages.length - 1];
-								let webView = plus.webview.create("", "webview"+res.data[i].id, {
-									plusrequire: "none", //禁止远程网页使用plus的API,有些使用mui制作的网页可能会监听plus.key,造成关闭页面混乱,可以通过这种方式禁止
-									'uni-app': 'none', //不加载uni-app渲染层框架,避免样式冲突
-									top: uni.getSystemInfoSync().statusBarHeight + 44 //放置在titleNView下方。如果还想在webview上方加个地址栏的什么的,可以继续降低TOP值
-								})
-
-								let url = '';
-								if (_this.identify == res.data[i].id && _this.bool == 0) {
-									url = "https://" + _this.backStageIp + ":" + _this.backStagePort +
-										"/websocket/usercontroller/viewoffline?send=" + _this
-										.userid + "&receive=" + res.data[i].id + "&sendname=" + _this.lastUserName + "&receivename=" + res.data[i].nickName;
-								} else {
-									url = "https://" + _this.backStageIp + ":" + _this.backStagePort + "/websocket/usercontroller/view?send=" +
-										_this.userid + "&receive=" + res.data[i].id + "&sendname=" + _this.lastUserName + "&receivename=" + res.data[i].nickname;
+
+				let im_show =uni.getStorageSync('im_show');
+				if (im_show == "1") {
+					this.lastUserName = uni.getStorageSync('gyeeusername');
+					this.userid = uni.getStorageSync('userid');
+
+					let _this = this;
+					uni.request({
+						url: 'http://' + this.sisStageIp + ':' + this.sisStagePort + '/GyeeuserController/selectUserList',
+						data: {},
+						method: 'GET',
+						success: function(res) {
+							_this.userList = [];
+
+							for (var i = 0; i < res.data.length; i++) {
+
+								if (res.data[i].id != _this.userid) {
+
+									var pages = getCurrentPages();
+									var page = pages[pages.length - 1];
+									let webView = plus.webview.create("", "webview" + res.data[i].id, {
+										plusrequire: "none", //禁止远程网页使用plus的API,有些使用mui制作的网页可能会监听plus.key,造成关闭页面混乱,可以通过这种方式禁止
+										'uni-app': 'none', //不加载uni-app渲染层框架,避免样式冲突
+										top: uni.getSystemInfoSync().statusBarHeight + 44 //放置在titleNView下方。如果还想在webview上方加个地址栏的什么的,可以继续降低TOP值
+									})
+
+									let url = '';
+									if (_this.identify == res.data[i].id && _this.bool == 0) {
+										url = "https://" + _this.backStageIp + ":" + _this.backStagePort +
+											"/websocket/usercontroller/viewoffline?send=" + _this
+											.userid + "&receive=" + res.data[i].id + "&sendname=" + _this.lastUserName + "&receivename=" + res.data[i]
+											.nickName;
+									} else {
+										url = "https://" + _this.backStageIp + ":" + _this.backStagePort + "/websocket/usercontroller/view?send=" +
+											_this.userid + "&receive=" + res.data[i].id + "&sendname=" + _this.lastUserName + "&receivename=" + res.data[
+												i].nickname;
+									}
+									webView.loadURL(url)
+									var currentWebview = page.$getAppWebview(); //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效,非v3编译模式使用this.$mp.page.$getAppWebview()
+									currentWebview.append(webView); //一定要append到当前的页面里!!!才能跟随当前页面一起做动画,一起关闭
+									//wv.setStyle({top:70,height:height});
+									webView.hide();
+
+									wv.push(webView)
+
 								}
-								webView.loadURL(url)
-								var currentWebview = page.$getAppWebview(); //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效,非v3编译模式使用this.$mp.page.$getAppWebview()
-								currentWebview.append(webView); //一定要append到当前的页面里!!!才能跟随当前页面一起做动画,一起关闭
-								//wv.setStyle({top:70,height:height});
-								webView.hide();
-								
-								wv.push(webView)
 
-							}
+							};
 
-						};
 
+						},
+						fail: () => {
+							_this.tips = '网络错误,小程序端请检查合法域名';
+						},
+					});
+					
+					 uni.setStorageSync('im_show','0');
+					
+				}
 
-					},
-					fail: () => {
-						_this.tips = '网络错误,小程序端请检查合法域名';
-					},
-				});
 
 			},
-			childMethod(id, bool,state) {
+			childMethod(id, bool, state) {
 				console.log(id);
 				this.identify = id;
 				this.bool = bool;
 				//this.getUserList();
 				let webview;
 				for (var i = 0; i < wv.length; i++) {
-					if(wv[i].id=="webview"+id)
-					{
-						
-						webview=wv[i];
-						let url=webview.getURL();
-						if(bool!=null)
-						{
-							if(bool==1)
-							{
-												
-								if(url.indexOf("/view?")<0)
-								{
-									url=url.replace("/viewoffline?","/view?");
+					if (wv[i].id == "webview" + id) {
+
+						webview = wv[i];
+						let url = webview.getURL();
+						if (bool != null) {
+							if (bool == 1) {
+
+								if (url.indexOf("/view?") < 0) {
+									url = url.replace("/viewoffline?", "/view?");
 									webview.loadURL(url);
 								}
-							}else
-							{
-								if(url.indexOf("/viewoffline?")<0)
-								{
-									url=url.replace("/view?","/viewoffline?");
+							} else {
+								if (url.indexOf("/viewoffline?") < 0) {
+									url = url.replace("/view?", "/viewoffline?");
 									webview.loadURL(url);
 								}
 							}
 						}
-						
-						
-						if(state==1)
-						{
-	
+
+
+						if (state == 1) {
+
 							webview.show()
-						}else
-						{
+						} else {
 							webview.hide();
 						}
 						break;
 					}
 				}
-								
-			}
 
+			}
 
 		}
 	}

+ 4 - 1
components/mine/addressBook/addressBook.vue

@@ -179,7 +179,7 @@
 
 		</scroll-view>
 		
-		<initial ref="initial"></initial>
+		<initial ></initial>
 	
 	</view>
 </template>
@@ -206,6 +206,7 @@
 		},
 		data() {
 			return {
+		
 				content1: '',
 				but1: true,
 				but2: false,
@@ -260,6 +261,7 @@
 			
 			this.getUserList();
 			this.drawerList = uni.getStorageSync('leftlist5');
+			
 			/* this.pinyin(); */
 		},
 		mounted() {
@@ -328,6 +330,7 @@
 			}
 		},
 		methods: {
+	
 			initial() {
 				let userid = uni.getStorageSync('userid');
 				this.theLastStatement(userid);

+ 39 - 126
pages/mine/Mine.vue

@@ -1,52 +1,23 @@
 <template>
 	<view class="content">
-		<cu-custom bgColor="bg-blacks" :isBack="false" v-if="pageDisplay==1">
-		    <block slot="right">
-				<image src="../../static/picture/fourLine.png" style="width: 30px;height: 30px;margin-left: 2%;" @tap="openDrawer"></image>
-			</block>
-			<block slot="right">	
-					<view class="icon cuIcon-notice text-white" v-if="badge != 0" style="margin-left: -70%;">
-						<view class="cu-tag looknumber" style="margin-top: -2%;">
-							<block v-if="badge != 1">{{ badge > 99 ? '99+' : badge }}</block>
-						</view>
-					</view>
-			</block>
-			<block slot="right">
-					
-			</block>
-		    <block slot="content">{{address}}</block>
-			<block slot="right">
-				<view class="plus" @tap="" data-target="viewModal">+</view>
-			</block>
-		</cu-custom>
-		<!-- 抽屉组件 -->
-		<div>
-			<drawer ref="drawer"></drawer>
-		</div>
-		<div class="plusDrawer" @tap="hideModal">
-			<plusDrawer ref="plusDrawer"></plusDrawer>
-		</div>
-<!-- 		<view>
-			<button class="cu-btn bg-red lg" @tap="falseLogin" type="" :style="{ 'height': buttonHeight}">注销账号</button>
-		</view> -->
 		<view v-if="pageDisplay==1">
-		<view v-if="toggleid==12">
-			<mine ref="r1"></mine>
-		</view>
-		
-		<view v-if="toggleid==13">
-			<chatindex ref="r1"></chatindex>
-		</view>
+			<view v-if="toggleid==12">
+				<mine ref="r1"></mine>
+			</view>
+
+			<view v-if="toggleid==13">
+				<chatindex ref="r1"></chatindex>
+			</view>
 		</view>
 		<view v-if="pageDisplay==2">
 			<addressBook></addressBook>
 		</view>
-		
+
 	</view>
-	
-	
-	
-	
+
+
+
+
 </template>
 
 <script>
@@ -56,98 +27,39 @@
 	import addressBook from '../../components/mine/addressBook/addressBook.vue';
 	import mine from '../../components/mine/Mine.vue';
 	import chatindex from '../../components/mine/chat/Chatindex.vue';
-	
+
 	export default {
 		components: {
-			drawer: drawer,
-			plusDrawer: plusDrawer,
-			mine:mine,
-			chatindex:chatindex,
-			addressBook:addressBook
+			mine: mine,
+			chatindex: chatindex,
+			addressBook: addressBook
 		},
-		data:function(){
-			return{
-				pageDisplay:1,
-				toggleid:12,//12我的主页,13聊天通讯,默认12
+		data: function() {
+			return {
+				pageDisplay: 1,
+				toggleid: 12, //12我的主页,13聊天通讯,默认12
 				badge: 22,
-				inconList:["form","favor","question","edit"],
-				modalName:null,
-				leftNavigationtitle:'我的功能分组',
-				buttonHeight:'',
+				inconList: ["form", "favor", "question", "edit"],
+				modalName: null,
+				leftNavigationtitle: '我的功能分组',
+				buttonHeight: '',
 				address: '',
-				drawerList: [
-					{"name":"聊天通讯"},
-				],
+				drawerList: [{
+					"name": "聊天通讯"
+				}, ],
 				plusDrawerList: [],
-				
+
 			}
-		},created: function() {
-			this.viewUserid();
-			this.monitoringAuthority();
-			this.address = this.dataprocessing.getWindPowerStationName();
-			this.FDC=this.dataprocessing.getWindPowerStationId();
-			this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
-			this.plusDrawerList=uni.getStorageSync('plusList');
-			this.drawerList=uni.getStorageSync('leftlist5');
-			console.log(this.drawerList);
 		},
-		onHide() {
-			this.$refs.drawer.closeDrawer();
-			this.hideModal();
+		created: function() {
+		 uni.setStorageSync('im_show','1');
 		},
-		onShow(){
-			this.viewUserid();
-			this.monitoringAuthority();
-			this.address = this.dataprocessing.getWindPowerStationName();
-			this.FDC=this.dataprocessing.getWindPowerStationId();
-			this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
+		onShow() {
+		
 		},
-		methods:{
-			openDrawer: function() {
-
-				if(this.$refs.drawer != undefined){
-					this.$refs.drawer.openDrawer(250, this.drawerList, this.inconList,this.leftNavigationtitle);
-				}else{
+		methods: {
+			
 			
-				}
-			},
-			closeDrawer: function() {				
-				this.drawerIsShow = false;
-				
-			},viewUserid: function() {
-				this.plusDrawerList=uni.getStorageSync('plusList');
-			},
-			monitoringAuthority: function() {
-				this.drawerList=uni.getStorageSync('leftlist5');
-			},
-			pushWindPowerStationNameToSessionStorage(windpowerstationName) {
-				uni.setStorageSync('windpowerstationName', windpowerstationName);
-				//sessionStorage.setItem('windpowerstationName', windpowerstationName);
-				//alert("v"+ sessionStorage.getItem("windpowerstationName"));
-				//this.common.goback('/pages/index/Index');
-			},
-			getWindPowerStationNameToSessionStorage() {
-				uni.getStorageSync('windpowerstationName');
-				return uni.getStorageSync('windpowerstationName');
-			},
-			showModal(e) {
-				this.modalName = e.currentTarget.dataset.target;
-				this.$refs.plusDrawer.showModal(this.plusDrawerList, this.modalName);
-			},
-			hideModal() {
-				this.modalName = null;
-				this.$refs.plusDrawer.hideModal(this.modalName);
-			},
-			falseLogin: function() {
-				this.removeUsernamePassword();
-				uni.navigateTo({
-				    url: '/components/login/Login'
-				});
-			},
-			removeUsernamePassword: function() {
-				uni.removeStorageSync('gyeeusername');
-				uni.removeStorageSync('gyeepassword');
-			},
 		}
 	};
 </script>
@@ -159,12 +71,12 @@
 		color: silver;
 		background: #000;
 	}
-	
+
 	@font-face {
 		font-family: '方正兰亭细黑_GBK';
 		src: url(../../static/fzltxh.TTF);
 	}
-	
+
 	page {
 		background-color: #1f1f1f;
 		font-family: '方正兰亭细黑_GBK';
@@ -218,14 +130,15 @@
 		text-align: right;
 		margin-right: 2.5%;
 	}
-	
-	.textWindpowerstation{
+
+	.textWindpowerstation {
 		width: 180px;
 		height: 45px;
 		float: left;
 		text-align: center;
 		margin-left: 18px;
 	}
+
 	.cu-btn {
 		width: 80%;
 		height: 40px;