Browse Source

任务界面修改

zhaomiao 4 years ago
parent
commit
cb782e3a5a

+ 113 - 13
components/mine/addressBook/addressBook.vue

@@ -11,30 +11,55 @@
 			</cu-custom>
 		</view>
 		
+		
+		
+		
 		<!-- 搜索标签 -->
 		<view class="cu-bar bg-white search fixed" :style="[{top:CustomBar + 'px'}]">
 			<view class="search-form round">
 				<text class="cuIcon-search"></text>
-				<input type="text" placeholder="输入搜索的关键词" confirm-type="search"></input>
+				<input type="text" placeholder="输入搜索的关键词" confirm-type="search" v-model="search"></input>
 			</view>
 			<view class="action">
 				<button class="cu-btn bg-gradual-sisBlack shadow-blur round">搜索</button>
 			</view>
 		</view>
+		<!-- 搜索列表 -->
+		<view class="search-content" ref="search" v-for="item in userListData">
+		           
+		            	<block>
+		            		<view :class="'indexItem-' + item.name" :id="'indexes-' + item.name" :data-index="item.name">
+		            			<view class="padding"></view>
+		            			<view class="cu-list menu-avatar no-padding" >
+		            				<view class="cu-item"   @tap="common.navTo('/components/mine/addressBook/chat?name='+item+'&send='+send+'&receive='+receive+'&sendname='+sendname+'&receivename='+receivename)">
+		            					<view class="cu-avatar round lg"></view>
+		            					<view class="content" >
+		            						<view class="text-grey">{{item.name}}</view>
+		            						
+		            					</view>
+		            				</view>
+		            			</view>
+		            		</view>
+		            	</block>
+		            
+		</view>
 		
+		<!-- 通讯列表 -->
 		
 		<scroll-view scroll-y class="indexes" :scroll-into-view="'indexes-'+ listCurID" :style="[{height:'calc(100vh - '+ CustomBar + 'px - 50px)'}]"
 		 :scroll-with-animation="true" :enable-back-to-top="true" >
 			<block v-for="(item,index) in list" :key="index">
+				<!-- 控制侧导航栏 -->
 				<view :class="'indexItem-' + item.name" :id="'indexes-' + item.name" :data-index="item.name">
-					<view class="padding">{{item.name}}</view>
-					<view class="cu-list menu-avatar no-padding">
-						<view class="cu-item" v-for="(items,sub) in 2" :key="sub"  @tap="common.navTo('/components/mine/addressBook/chat?name='+list[index].name)">
-							<view class="cu-avatar round lg">{{item.name}}</view>
-							<view class="content">
-								<view class="text-grey">{{item.name}}<text class="text-abc">{{list[sub].name}}</text>君</view>
+					<!-- <view class="padding">{{item.name}}</view> -->
+					<view class="cu-list menu-avatar no-padding" >
+						<view class="cu-avatar">{{item.name}}</view>
+						<view class="cu-item" v-for="(items,sub) in 2" :key="sub"  @tap="common.navTo('/components/mine/addressBook/chat?name='+list[index].name+'&send='+send+'&receive='+receive+'&sendname='+sendname+'&receivename='+receivename)">
+							
+							<view class="content" >
+								<view class="text-grey">{{item.name}}yy<text class="text-abc">{{list[sub].name}}ll</text>君</view>
 								<view class="text-gray text-sm">
-									有{{sub+2}}条消息
+									有{{sub}}条消息
 								</view>
 							</view>
 						</view>
@@ -42,13 +67,13 @@
 				</view>
 			</block>
 		</scroll-view>
-		
+		<!-- 侧导航栏 -->
 		<view class="indexBar" :style="[{height:'calc(100vh - ' + CustomBar + 'px - 50px)'}]">
 			<view class="indexBar-box" @touchstart="tStart" @touchend="tEnd" @touchmove.stop="tMove">
 				<view class="indexBar-item" v-for="(item,index) in list" :key="index" :id="index" @touchstart="getCur" @touchend="setCur"> {{item.name}}</view>
 			</view>
 		</view>
-		<!--选择显示-->
+		<!--选择显示  keyword-->
 		<view v-show="!hidden" class="indexToast">
 			{{listCur}}
 		</view>
@@ -61,12 +86,33 @@
 			return {
 				StatusBar: this.StatusBar,
 				CustomBar: this.CustomBar,
-				hidden: true,
 				listCurID: '',
 				list: [],
 				listCur: '',
+				send:'1',
+				receive:'2',
+				hidden: true,
+				sendname:'ming',
+				receivename:'fang',
+				search:'',
+				timer: null,
+				userList:[],
+				
+				products:[
+				        //假数据
+				        {name:"数据1",date:'2018-01-04',depart:'泸化工1'},
+				        {name:"数据2",date:'2018-01-25',depart:'泸化工2'},
+				        {name:"数据3",date:'2018-02-10',depart:'泸化工3'},
+				        {name:"数据4",date:'2018-03-04',depart:'泸化工4'},
+				        {name:"数据5",date:'2018-05-24',depart:'泸化工5'},
+				        {name:"数据6",date:'2018-10-29',depart:'泸化工6'}
+				    	]
+				
 			};
 		},
+		created: function() {
+			/* this.getUserList(); */
+		},
 		onLoad() {
 			let list = [{}];
 			for (let i = 0; i < 26; i++) {
@@ -83,9 +129,34 @@
 			}).exec();
 			uni.createSelectorQuery().select('.indexes').boundingClientRect(function(res) {
 				that.barTop = res.top
-			}).exec()
+			}).exec();
+			/* this.getUserList(); */
 		},
+		computed: {
+			
+			userListData: function() {
+			var search = this.search;
+			 if(!this.search){
+				 return [];
+			 }
+			else if (search) {
+			return this.products.filter(function(product) {
+			return Object.keys(product).some(function(key) {
+			return String(product[key]).toLowerCase().indexOf(search) > -1
+			})
+			})
+			}
+			return this.products;
+			},
+		    hasNoData () {
+		      return !this.list.length
+		    }
+		  },
 		methods: {
+			 handleCityClick (city) {
+			      this.changeCity(city)
+			      this.$router.push('/')
+			    },
 			closeFrame: function() {
 				this.count = this.count + 1;
 				if (this.isFrameShow) {
@@ -93,6 +164,26 @@
 					this.sanJiao = 'sanJiaoDown';
 				}
 			},
+			getUserList: function() {
+				let _this = this;
+				
+				uni.request({
+					/* url: 'http://' + this.backStageIp + ':' + this.backStagePort + '/GyeeMatrixController/GyeeMatrixList?keyid=' +
+						this.FDC, */
+						url:'https://192.168.1.102:4397/websocket/usercontroller/selectUserList',
+					data: {},
+					method: 'GET',
+					success: function(res) {
+						_this.userList = res.data.data
+						console.log(_this.userList);
+						
+			
+					},
+					fail: () => {
+						_this.tips = '网络错误,小程序端请检查合法域名';
+					},
+				});
+			},
 			//获取文字信息
 			getCur(e) {
 				this.hidden = false;
@@ -137,7 +228,8 @@
 					}
 				}
 			}
-		}
+		},
+		
 	}
 </script>
 
@@ -233,4 +325,12 @@
 	.cu-list,.menu-avatar>.cu-item {
 			background-color: #242424;
 	}
+	.cu-avatar{
+		height: 20px;
+		width: 20px;
+		
+	}
+	.indexes{
+		margin-top: 50px;
+	}
 </style>

+ 10 - 4
components/mine/addressBook/chat.vue

@@ -6,7 +6,7 @@
 					<view style="height: 80rpx;line-height: 80rpx;color: silver;">返回</view>
 				</block>
 				<block slot="content">
-					<view style="color: silver;">{{name}}</view>
+					<view style="color: silver;">{{sendname}}</view>
 				</block>
 			</cu-custom>
 		</view>
@@ -18,13 +18,19 @@
 	export default {
 		data() {
 			return {
-				name:"",
+				name:'',
+				send:'',
+				receive:'',
+				sendname:'',
+				receivename:'',
 			}
 		},
 		onLoad(option){
 			_self = this;
-			this.name = option.name;
-			
+			this.send = option.send;
+			this.receive = option.receive;
+			this.receivename = option.receivename;
+			this.sendname = option.sendname;
 		},
 		methods: {
 			closeFrame: function() {

+ 3 - 1
components/task/taskCard/taskCard.vue

@@ -120,6 +120,8 @@ export default {
 		background-color: #242424;
 		color: white;
 	}
-	
+	.navigationBar{
+		color: #B7B6B7;
+	}
 	
 </style>

+ 3 - 5
pages/mine/Mine.vue

@@ -69,7 +69,9 @@
 				leftNavigationtitle:'我的功能分组',
 				buttonHeight:'',
 				address: '',
-				drawerList: [],
+				drawerList: [
+					{"name":"聊天通讯"},
+				],
 				plusDrawerList: [],
 				
 			}
@@ -95,10 +97,6 @@
 			this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
 		},
 		methods:{
-			
-			
-			
-			
 			openDrawer: function() {
 
 				if(this.$refs.drawer != undefined){

+ 9 - 5
pages/task/Task.vue

@@ -20,7 +20,7 @@
 		<scroll-view @tap="hideModal" scroll-y class="DrawerPage" :class="modalName == 'viewModal' ? 'show' : ''">
 		
 		<!-- 任务组件 -->
-		<view class="taskcard ">
+		<!-- <view class="taskcard "v-if="play">
 			<view class="tasktab " @tap="common.navTo('/components/task/taskCard/taskCard?taskName=' + taskName)"><view class="cu-tag solids-bottom" :class="'line-white'">任务一</view></view>
 
 			<view class="taskcontent   flex align-center" style="color: #FFFFFF;" @tap="common.navTo('/components/task/taskCard/taskCard?taskName=' + taskName)">
@@ -29,12 +29,12 @@
 
 			<view class="taskbutton align-center padding">
 				<button class="cu-btn bg-colorlan">确认</button>
-				<button class="cu-btn bg-color24">取消</button>
+				<button class="cu-btn bg-color24" @click="hiddencard">取消</button>
 			</view>
-		</view>
+		</view> -->
 
 		<!-- 任务组件 -->
-		<view class="taskcard ">
+		<view class="taskcard " v-if="play">
 			<view class="tasktab" @tap="common.navTo('/components/task/taskCard/taskCard?taskName=' + taskName)"><view class="cu-tag solids-bottom" :class="'line-white'">任务二</view></view>
 
 			<view class="taskcontent   flex align-center" style="color: #FFFFFF;" @tap="common.navTo('/components/task/taskCard/taskCard?taskName=' + taskName)">
@@ -43,7 +43,7 @@
 
 			<view class="taskbutton align-center  padding">
 				<button class="cu-btn bg-colorlan">确认</button>
-				<button class="cu-btn bg-color24">取消</button>
+				<button class="cu-btn bg-color24" @click="hiddencard">取消</button>
 			</view>
 		</view>
 		</scroll-view>
@@ -67,6 +67,7 @@ export default {
 			inconList: ['form', 'favor', 'question', 'edit'],
 			modalName: null,
 			address: '宁夏新能源公司',
+			play:true,
 			drawerList: [
 				{
 					name: '首页'
@@ -147,6 +148,9 @@ export default {
 		hideModal() {
 			this.modalName = null;
 			this.$refs.plusDrawer.hideModal(this.modalName);
+		},
+		hiddencard(){
+			 this.play = false;  
 		}
 	}
 };