Browse Source

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
代办修改

1004749546@qq.com 4 years ago
parent
commit
28fece551f
1 changed files with 43 additions and 41 deletions
  1. 43 41
      pages/toDoList/toDoList.vue

+ 43 - 41
pages/toDoList/toDoList.vue

@@ -39,7 +39,8 @@
 						<scroll-view scroll-y class="scroll-view" @scrolltolower="onreachBottom">
 							<view  
 							class="check-order-list" 
-							v-for="(item,index) in list" 
+							v-if="index==current"
+							v-for="(item,sindex) in list" 
 							:key="item.id"
 							@click="viewRow(item)"
 							>
@@ -66,12 +67,12 @@
 										 <text class="mark">
 										 	抄送
 										 </text>
-										 <view class="status">{{item.status}}</view>
+										 <view :class="['status',clsStatus(item.status)]">{{item.status}}</view>
 									 </view>
 								 </view>
 							 </view>
 							 <u-empty :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
-							 <view style="padding: 20upx;">
+							 <view v-if="index==current" style="padding: 20upx;">
 								 <u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
 							 </view>
 						</scroll-view>
@@ -119,35 +120,7 @@
 				swiperCurrent: 0,
 				pageNo: 1,
 				pageSize: 10,
-				list: [
-					{
-						storeName: '常青二路店',
-						createDate: '2020-08-08 16:12:00',
-						clsName: '正常营业',
-						userName: '张三',
-						sourceType: '视频巡店',
-						status: '待整改',
-						id: 1
-					},
-					{
-						storeName: '常青二路店',
-						createDate: '2020-08-08 16:12:00',
-						clsName: '正常营业',
-						userName: '张三',
-						sourceType: '视频巡店',
-						status: '待整改',
-						id: 2
-					},
-					{
-						storeName: '常青二路店',
-						createDate: '2020-08-08 16:12:00',
-						clsName: '正常营业',
-						userName: '张三',
-						sourceType: '视频巡店',
-						status: '待整改',
-						id: 3
-					}
-				],
+				list: [],
 				total: 0,
 			}
 		},
@@ -158,11 +131,11 @@
 			// tabs通知swiper切换
 			tabsChange(index) {
 				this.swiperCurrent = index;
-				this.list = []
+				this.resetPage()
 			},
 			swiperChange(event){
-				console.log(event.detail)
-				this.list = []
+				this.list = [];
+				this.status = 'loading'
 			},
 			// swiper-item左右移动,通知tabs的滑块跟随移动
 			transition(e) {
@@ -173,12 +146,10 @@
 			// swiper滑动结束,分别设置tabs和swiper的状态
 			animationfinish(e) {
 				let current = e.detail.current;
-				if(current != this.current){
-					this.$refs.uTabs.setFinishCurrent(current);
-					this.swiperCurrent = current;
-					this.current = current;
-					this.getRow()
-				}
+				this.$refs.uTabs.setFinishCurrent(current);
+				this.swiperCurrent = current;
+				this.current = current;
+				this.resetPage()
 			},
 			// scroll-view到底部加载更多
 			onreachBottom() {
@@ -218,6 +189,11 @@
 				_this.status = "loadmore"
 			  })
 			},
+			resetPage(){
+				this.status = 'loading';
+				this.list = [];
+				this.getRow(1);
+			},
 			// 查询刷新
 			refresh(params){
 				console.log(params,'1111111111')
@@ -237,6 +213,21 @@
 					url: "/pages/toDoList/backlogDetail?id="+item.id
 				})
 			},
+			// 状态颜色处理
+			clsStatus(status){
+				if(status == '待审核'){
+					return 'dsh'
+				}
+				if(status == '待整改'){
+					return 'dzg'
+				}
+				if(status == '整改完成'){
+					return 'ywc'
+				}
+				if(status == '已过期'){
+					return 'ygq'
+				}
+			}
 		}
 	}
 </script>
@@ -350,8 +341,19 @@
 					.status {
 						display: inline-block;
 						width: 150upx;
+					}
+					.dsh{
 						color: red;
 					}
+					.dzg{
+						color: #007AFF;
+					}
+					.ygq {
+						color: #999;
+					}
+					.ywc {
+						color: #10c71e;
+					}
 				}
 			}
 		}