| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 | 
							- <template>
 
- 	<view class="content">
 
- 		<view class="top-fixed">
 
- 			 <u-tabs
 
- 			  :scrollable="false"
 
- 			  :list="tabs"  
 
- 			  lineColor="#2583EB"
 
- 			 @change="statusChange">
 
- 			 </u-tabs>
 
- 		</view>
 
- 		<mescroll-body top="88rpx" bottom="0" ref="mescrollRef" @init="mescrollInit"    :down="downOption" :up="upOption" @down="downCallback" @up="upCallback">
 
- 		<view class="order-list">
 
- 			<view class="order-item"  v-for="(item) in dataList" @click="navTo('./inquiryOrderDetails?orderId='+item.orderId)">
 
- 				<view class="order-top"  >
 
- 					<view class="left"  >
 
- 						<view class="title" >
 
- 							{{item.tempName}}   
 
- 						</view>
 
- 					</view>
 
- 					<view class="status red" v-if="item.writeStatus==0">
 
- 						未完成
 
- 					</view>
 
- 					<view class="status green" v-if="item.writeStatus==1">
 
- 						已完成
 
- 					</view>
 
- 				</view>
 
- 				<view class="order-cont">
 
- 					<view class="order-time-box">
 
- 						<view class="order-time">
 
- 							<view class="time">{{item.planTime}}   </view>
 
- 							<view class="count"> {{item.num}}/{{item.totalNum}}期</view>
 
- 						</view>
 
- 						<view class="right">
 
- 							<view class="btn red" v-if="item.writeStatus==0" @click.stop="doFoloow(item)">去填写</view>
 
- 							<view class="btn green" v-if="item.writeStatus==1" @click.stop="showDetails(item)">查看</view>
 
- 						</view>
 
- 					</view>
 
- 				</view>
 
- 			</view>
 
- 		</view>
 
- 		</mescroll-body>
 
- 	</view>
 
- </template>
 
- <script>
 
- 	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 
- 	import {getFollowList} from '@/api/follow.js'
 
- 	export default {
 
- 		mixins: [MescrollMixin], // 使用mixin
 
- 		data() {
 
- 			return {
 
- 				tabs:[
 
- 					{
 
- 						id:-1,
 
- 						name:'全部'
 
- 					},
 
- 					{
 
- 						id:0,
 
- 						name:'未完成'
 
- 					},
 
- 					{
 
- 						id:1,
 
- 						name:'已完成'
 
- 					}
 
- 					 
 
- 				],
 
- 				writeStatus:-1,
 
- 				mescroll:null,
 
- 				downOption: {   //下拉刷新
 
- 				 	use:true,
 
- 					auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
 
- 				},
 
- 				upOption: {
 
- 					onScroll:false,
 
- 					use: true, // 是否启用上拉加载; 默认true
 
- 					page: {
 
- 						pae: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
 
- 						size: 10 // 每页数据的数量,默认10
 
- 					},
 
- 					noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
 
- 					textNoMore:"已经到底了",
 
- 					empty: {
 
- 						icon:'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/empty_icon.png',
 
- 						tip: '暂无数据'
 
- 					}
 
- 				},
 
- 				dataList: []
 
- 			}
 
- 		},
 
- 		onLoad() {
 
- 			var that=this;
 
- 			uni.$on('refreshFollowList', () => {
 
- 				that.mescroll.resetUpScroll()
 
- 			})
 
- 		},
 
- 		onShow() {
 
- 		},
 
- 		methods: {
 
- 			doFoloow(item){
 
- 				uni.navigateTo({
 
- 					url: "./doFollow?followId="+item.followId
 
- 				})
 
- 			},
 
- 			showDetails(item){
 
- 				uni.navigateTo({
 
- 					url: "./followDetails?followId="+item.followId
 
- 				})
 
- 			},
 
- 			statusChange(item){
 
- 				this.writeStatus=item.id
 
- 				console.log(item)
 
- 				this.mescroll.resetUpScroll()
 
- 			},
 
- 			navTo(url){
 
- 				uni.navigateTo({
 
- 					url: url
 
- 				})
 
- 			},
 
- 			mescrollInit(mescroll) {
 
- 				this.mescroll = mescroll;
 
- 			},
 
- 			/*下拉刷新的回调 */
 
- 			downCallback() {
 
- 				this.mescroll.resetUpScroll()
 
- 			},
 
- 			/*上拉加载的回调*/
 
- 			upCallback(page) {   
 
- 				//联网加载数据
 
- 				var that = this;
 
- 				var data = {
 
- 					pageNum: page.num,
 
- 					pageSize: page.size
 
- 				};
 
- 				if(this.writeStatus!=-1){
 
- 					data.writeStatus=this.writeStatus
 
- 				}
 
- 				getFollowList(data).then(res => {
 
- 					if(res.code==200){
 
- 						if (page.num == 1) {
 
- 							that.dataList = res.data.list; 
 
- 							
 
- 						} else {
 
- 							that.dataList = that.dataList.concat(res.data.list);
 
- 							 
 
- 						}
 
- 						that.mescroll.endBySize(res.data.list.length, res.data.total);
 
- 						
 
- 					}else{
 
- 						uni.showToast({
 
- 							icon:'none',
 
- 							title: "请求失败",
 
- 						});
 
- 						that.dataList = null;
 
- 						that.mescroll.endErr();
 
- 					}
 
- 				});
 
- 			},
 
- 			
 
- 		}
 
- 	}
 
- </script>
 
- <style lang="scss">
 
- 	page{
 
- 		
 
- 		height: 100%;
 
- 		background: #f6f6f6;
 
- 	}
 
- </style>
 
- <style scoped lang="scss">
 
- 	.content{
 
- 		height: 100%;
 
- 		.top-fixed{
 
- 			width: 100%;
 
- 			position: fixed;
 
- 			top: 0;
 
- 			left: 0;
 
- 			z-index: 10;
 
- 			height: 88upx;
 
- 			background-color: #fff;
 
- 		}
 
- 		.order-list{
 
- 			width: 100%;
 
- 			padding: 15rpx;
 
- 			display: flex;
 
- 			flex-direction: column;
 
- 			align-items: flex-start;
 
- 			justify-content: flex-start;
 
- 			.order-item{
 
- 				margin-bottom: 20rpx;
 
- 				width: 100%;
 
- 				padding: 20rpx;
 
- 				box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
 
- 				background-color: #fff;
 
- 				border-radius: 15rpx;
 
- 				display: flex;
 
- 				flex-direction: column;
 
- 				align-items: flex-start;
 
- 				justify-content: flex-start;
 
- 				.order-top{
 
- 					display: flex;
 
- 					align-items: center;
 
- 					justify-content: space-between;
 
- 					width: 100%;
 
- 					padding-bottom: 15rpx;
 
- 					border-bottom: 1px solid #efefef;
 
- 					.left{
 
- 						display: flex;
 
- 						align-items: center;
 
- 						justify-content: flex-start;
 
- 						.title{
 
- 							font-size: 32upx;
 
- 							font-family: PingFang SC;
 
- 							font-weight: bold;
 
- 							color: #111111;
 
- 						}
 
- 						 
 
- 					}
 
- 					.status{
 
- 						font-size: 28upx;
 
- 						font-family: PingFang SC;
 
- 					}
 
- 					.red{
 
- 						
 
- 						color: #db5053;
 
- 					}
 
- 					.green{
 
- 						color: #2583EB;
 
- 					}
 
- 					 
 
- 				}
 
- 				.order-cont{
 
- 					width: 100%;
 
- 					margin-top: 20rpx;
 
- 					.order-time-box{
 
- 						width: 100%;
 
- 						display: flex;
 
- 						align-items: center;
 
- 						justify-content: space-between;
 
- 						.order-time{
 
- 							display: flex;
 
- 							align-items: center;
 
- 							justify-content: flex-start;
 
- 							.time{
 
- 								font-size: 28upx;
 
- 								font-family: PingFang SC;
 
- 								color: #9a9a9c;
 
- 							}
 
- 							.count{
 
- 								margin-left: 10rpx;
 
- 								font-size: 28upx;
 
- 								font-family: PingFang SC;
 
- 								color: #111;
 
- 							}
 
- 						}
 
- 						.right{
 
- 							.btn{
 
- 								padding: 10rpx 30rpx;
 
- 								font-size: 28rpx;
 
- 								border-radius: 30rpx;
 
- 							}
 
- 							.red{
 
- 								background-color: #2583EB;
 
- 								color: #fff;
 
- 							}
 
- 							.green{
 
- 								border: 1rpx solid #2583EB;
 
- 								color: #2583EB;
 
- 							}
 
- 						}
 
- 					}
 
- 				}
 
- 				
 
- 			}
 
- 		} 
 
- 		
 
- 	}
 
- 	 
 
- </style>
 
 
  |