htc 1 هفته پیش
والد
کامیت
1319ba27be
2فایلهای تغییر یافته به همراه40 افزوده شده و 12 حذف شده
  1. 1 0
      pages/my.vue
  2. 39 12
      pagesHome/recruitsNumber.vue

+ 1 - 0
pages/my.vue

@@ -126,6 +126,7 @@
 			proxy.$api.get(`/wx/${JSON.parse(uni.getStorageSync('userInfo')).id}`).then(({data:res})=>{
 				if(res.code!==0) return proxy.$showToast(res.msg)
 				userInfo.value = res.data;
+				uni.setStorageSync('userInfo',JSON.stringify(userInfo.value));
 			})
 		}catch(e){
 			userInfo.value = null

+ 39 - 12
pagesHome/recruitsNumber.vue

@@ -7,13 +7,20 @@
 			<view class="num-pre">最少报名人数<text>{{recruitmentMax?(recruitmentMin+'人'):'无限制'}}</text></view>
 		</view>
 		<view class="box list" v-if="list.length">
-			<view class="list-pre adfacjb" v-for="(item,index) in list" :key="index">
-				<view class="list-pre-left adfac">
-					<image src="https://oss.familydaf.cn/sxsnfile/20251218/3821654e080945998d464f3c3aa64122.png"></image>
-					<text>{{item.name||''}}</text>
-				</view>
-				<view class="list-pre-right">{{item.createDate||''}}</view>
-			</view>
+			
+			<up-list @scrolltolower="scrolltolower" style="height: 100%;">
+				<up-list-item v-for="(item, index) in list" :key="item.id">
+					<view class="list-pre adfacjb">
+						<view class="list-pre-left adfac">
+							<image src="https://oss.familydaf.cn/sxsnfile/20251218/3821654e080945998d464f3c3aa64122.png"></image>
+							<text>{{item.name||''}}</text>
+							<image class="sex" v-if="item?.gender==1" src="https://oss.familydaf.cn/sxsnfile/20251218/473d5677fbdb4106acdb9a163377d27f.png"></image>
+							<image class="sex" v-else-if="item?.gender==0" src="https://oss.familydaf.cn/sxsnfile/20251218/02bc40a1c47b40f1a36b55cd0553211c.png"></image>
+						</view>
+						<view class="list-pre-right">{{item.createDate||''}}</view>
+					</view>
+				</up-list-item>
+			</up-list>
 		</view>
 		<view class="empty adffcacjc" v-else>
 			暂无善行少年报名<br>期待您的参与
@@ -27,23 +34,38 @@
 	import { ref, onMounted, getCurrentInstance } from 'vue'
 	const { proxy } = getCurrentInstance()
 	
+	const queryParams = ref({
+		page:1,
+		limit:10,
+		activityId:'',
+		signupState:1
+	})
+	const isOver = ref(false)
 	const list = ref([])
 	const recruitmentMax = ref('')
 	const recruitmentMin = ref('')
 	const ybmNum = ref(0)
 	
-	const getList = (activityId) => {
-		proxy.$api.get('/core/activity/signup/getSignupList',{page:1,limit:-1,activityId}).then(({data:res})=>{
+	const scrolltolower = () => {
+		if(isOver.value) return
+		getList()
+	}
+	
+	const getList = () => {
+		proxy.$api.get('/core/activity/signup/getSignupList',queryParams.value).then(({data:res})=>{
 			if(res.code!==0) return proxy.$showToast(res.msg)
-			list.value = res.data.list;
-			ybmNum.value = list.value.filter(l=>l.signupState==1).length||0;
+			list.value = [...list.value,...res.data.list];
+			ybmNum.value = res.data.total;
+			queryParams.value.page++;
+			if(res.data.list.length===0) isOver.value = true
 		})
 	}
 	
 	onLoad((options)=>{
 		recruitmentMax.value = +options.recruitmentMax??0;
 		recruitmentMin.value = +options.recruitmentMin??0;
-		getList(options?.activityId)
+		queryParams.value.activityId = options?.activityId||'';
+		getList()
 	})
 </script>
 
@@ -100,6 +122,11 @@
 						line-height: 42rpx;
 						margin-left: 30rpx;
 					}
+					.sex{
+						width: 44rpx;
+						height: 32rpx;
+						margin-left: 10rpx;
+					}
 				}
 				&-right{
 					font-family: PingFangSC, PingFang SC;