| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 | <script setup>	import {		ref	} from 'vue'	import {		onLoad,		onUnload,		onPullDownRefresh,		onReachBottom,		onPageScroll	} from "@dcloudio/uni-app"	import {		getOverseeList,	} from "@/api/work/oversee.js"	function backToBefore() {		uni.reLaunch({			url: "/pages/index"		});	};	let scrollTop = ref(0)	let loading = ref(true)	// 参数	let searchInfo = ref({		pageNo: 1,		pageSize: 10,	})	let show = ref(false)	let content = ref('')	function wacthMore(e) {		show.value = true		content.value = e	}	function searchClick() {		goToPage('/pages/oversee/search/index')	}	function getList() {		if (searchInfo.value.pageNo == 1) {			loading.value = true		}		getOverseeList(searchInfo.value).then(res => {			loading.value = false;			itemList.value = itemList.value.concat(res.data.list)			listTotal.value = res.data.total			if (res.data.total == searchInfo.value.pageNo * searchInfo.value.pageSize - (10 - res.data.list					.length)) moreListFlag = false;		}).catch(() => {			loading.value = false		})	}	let itemList = ref([])	let listTotal = ref(0)	// 触底加载flag	let moreListFlag = true	function gotoDetail(type, id, subName) {		if (type === "project") {			uni.navigateTo({				url: `/pages/projectInfo/detail/index?id=${id}&subName=${subName}`			})		} else {			uni.navigateTo({				url: `/pages/oversee/detail/index?id=${id}`			})		}	}	function goToPage(url) {		uni.navigateTo({			url		})	}	onLoad((options) => {		uni.$on('overseeSearch', resolve => {			searchInfo.value = Object.assign({				pageNo: 1,				pageSize: 10			}, resolve);			searchInfo.value.pageNo = 1;			itemList.value = [];			listTotal.value = 0;			moreListFlag =				true;			getList();		})		searchInfo.value = Object.assign(searchInfo.value, options, {			projectsStatus: options.status		});		searchInfo.value.status = null;		getList();	});	onUnload(() => {		uni.$off('overseeSearch');	});	onPageScroll((e) => {		scrollTop.value = e.scrollTop	})	onPullDownRefresh(() => {		searchInfo.value.pageNo = 1;		itemList.value = [];		moreListFlag = true;		try {			getList();		} finally {			uni.stopPullDownRefresh()		}	})	onReachBottom(() => {		if (!moreListFlag) {			return uni.showToast({				title: "已经到底了。",				icon: "none",				duration: 2000			})		}		searchInfo.value.pageNo++;		getList();	})</script><template>	<view class="container">		<page-title @searchClick='searchClick' showSearch>问题清单</page-title>		<view class="cards-list">			<view class="card" v-for="(item,index) in itemList" :key="index">				<view v-if="item.usersub == 1">					<view style="height:20rpx"></view>					<view class="special-item">						<card-title :numerator="index+1" :denominator="listTotal" isSpecial></card-title>						<view class="card-name">							<view class="card-name-title">								<text class="card-name-description">申报单位</text>							</view>							<text class="card-name-text">{{item.unitTitle || "--"}}</text>						</view>					</view>				</view>				<view v-else>					<card-title :numerator="index+1" :denominator="listTotal"></card-title>					<!-- 申报单位 -->					<view class="card-name">						<view class="card-name-title">							<text class="card-name-description">申报单位</text>						</view>						<text class="card-name-text">{{item.unitTitle || "--"}}</text>					</view>				</view>				<view class="card-item">					<view class="card-item-name">项目名称</view>					<view class="card-item-content">{{item.sub_name || "--"}}</view>				</view>				<view class="card-item">					<view class="card-item-name">当前状态</view>					<view class="card-item-content">{{item.status || "--"}}</view>				</view>				<view class="card-item">					<view class="card-item-name">问题描述</view>					<view class="card-item-content">						<view class="text">							{{item.title || "--"}}						</view>						<view class="morebtn" @click="wacthMore(item.title)">							查看更多						</view>					</view>				</view>				<view class="card-item">					<view class="card-item-name">要求解决日期</view>					<view class="card-item-content">{{item.date_conf || "--"}}</view>				</view>				<view class="card-item">					<view class="card-btn" @click="gotoDetail('project',item.sub_id,item.sub_name)">项目查看</view>					<view class="card-btn empty-btn" @click="gotoDetail('problem',item.id)">问题查看</view>				</view>				<view class="card-icon" :class="item.stu === '已关闭' ? 'question-closed' : 'question-not-close'"></view>			</view>			<empty-show v-if=" itemList.length===0"></empty-show>		</view>		<u-back-top :scroll-top="scrollTop"></u-back-top>		<u-popup :show="show" mode='center' @close="show=false" bgColor='transparent'>			<view class="popup-box">				<view class="box-title">问题描述</view>				<view class="box-icon"><u-icon name="close" size="20" @click="show=false"></u-icon></view>				<scroll-view scroll-y="true" style="height: 700rpx;">					<text class="box-text">{{content}}</text>				</scroll-view>			</view>		</u-popup>		<u-loading-page :loading="loading"></u-loading-page>	</view></template><style lang="scss" scoped>	.text {		overflow: hidden;		word-break: break-all;		text-overflow: ellipsis;		display: -webkit-box;		-webkit-box-orient: vertical;		-webkit-line-clamp: 3;	}	.popup-box {		position: relative;		width: 90vw;		margin: auto;		background-color: #fff;		padding: 40rpx;		border-radius: 20rpx;		// font-size: 30;		.box-icon {			position: absolute;			top: 40rpx;			right: 40rpx;		}		.box-title {			width: 100%;			font-size: 40rpx;			font-weight: 500;			font-family: OPPOSans-M;			display: flex;			justify-content: center;			align-items: center;			padding-bottom: 20rpx;		}		.box-text {			letter-spacing: 3rpx;		}	}	.morebtn {		float: right;		margin-top: 20rpx;		width: 190rpx;		display: flex;		justify-content: center;		align-items: center;		padding: 10rpx 0 10rpx 0;		font-size: 20rpx;		border-radius: 28rpx;		background-color: #1869F6;		color: #fff;	}</style>
 |