htc 15 saat önce
ebeveyn
işleme
908348c8d3

+ 4 - 3
common/api/baseApi.js

@@ -1,6 +1,7 @@
-const BaseApi = 'https://sxsn.ringzle.com/happytree-app/app' //线上
-const BaseApi2 = 'https://sxsn.ringzle.com/happytree-admin' //线上
-// const BaseApi = 'https://sxsn.ringzle.com/happytree-app/app' //开发
+// const BaseApi = 'https://sxsn.ringzle.com/happytree-app/app' //测试
+// const BaseApi2 = 'https://sxsn.ringzle.com/happytree-admin' //测试(文件上传pc端接口路径)
+const BaseApi = 'https://www.familydaf.cn/happytree-app/app' //生产
+const BaseApi2 = 'https://www.familydaf.cn/happytree-admin' //生产(文件上传pc端接口路径)
 // const BaseApi = 'http://192.168.2.19:9023/happytree-app/app' //李勇
 
 export {

+ 5 - 1
components/pages/nonprofitActivety/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="nonprofit-activety" @click.self="handleDetail(item)" v-if="item">
+	<view class="nonprofit-activety" @click.self="handleDetail(item)" v-if="item" :style="{'margin-top':index===0?0:'20rpx'}">
 		<view class="na-top adf">
 			<view class="na-top-left">
 				<image :src="item.coverFile"></image>
@@ -38,6 +38,10 @@
 		item:{
 			typeof:Object,
 			default:null
+		},
+		index:{
+			typeof:Number,
+			default:0
 		}
 	})
 	import { ref } from 'vue'

+ 1 - 1
manifest.json

@@ -50,7 +50,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wxb9a6bbfcc8449c16",
+        "appid" : "wxb412ad17f77c75c6",
         "setting" : {
             "urlCheck" : false,
             "minified" : true

+ 37 - 11
pages/home.vue

@@ -44,9 +44,11 @@
 				</scroll-view>
 			</view>
 			<view class="c-box-list" v-if="activityList.length">
-				<template v-for="item in activityList" :key="item.id">
-					<NonprofitActivety :item="item"></NonprofitActivety>
-				</template>
+				<up-list @scrolltolower="scrolltolower" style="height: 100%;">
+					<up-list-item v-for="(item, index) in activityList" :key="item.id">
+						<NonprofitActivety :item="item" :index="index"></NonprofitActivety>
+					</up-list-item>
+				</up-list>
 			</view>
 			<view class="dataEmpty" v-else>
 				<page-empty></page-empty>
@@ -72,7 +74,14 @@
 	const typeList = ref([])
 	const tlIndex = ref(0)
 	const scrollLeft = ref(0)
+	const isOver = ref(false)
 	const activityList = ref([])
+	const queryParams = ref({
+		page:1,
+		limit:10,
+		categoryId:'',
+		userId:''
+	})
 	
 	const bannerClick = e => {
 		let banner = bannarOrigin.value[e];
@@ -90,6 +99,7 @@
 	}
 	
 	const changeType = (item,index) => {
+		queryParams.value.categoryId = item.id;
 		tlIndex.value = index;
 		if(typeList.value.length>4){
 			if(index<3) scrollLeft.value = 0
@@ -97,7 +107,14 @@
 				scrollLeft.value = (index-2)*172/2;
 			}
 		}
-		getActivityList(item.id)
+		initList();
+		getActivityList();
+	}
+	
+	const initList = () => {
+		queryParams.value.page = 1;
+		isOver.value = false;
+		activityList.value = [];
 	}
 	
 	const toTurnPage = (url,needLogin) => {
@@ -122,16 +139,21 @@
 		})
 	}
 	
-	const getActivityList = (categoryId) => {
-		let userId = '';
-		if(uni.getStorageSync('userInfo')) userId = JSON.parse(uni.getStorageSync('userInfo'))?.id;
-		proxy.$api.get('/core/activity/page',{page:1,limit:2,categoryId,userId}).then(({data:res})=>{
+	const scrolltolower = () => {
+		if(isOver.value) return
+		getActivityList()
+	}
+	
+	const getActivityList = () => {
+		proxy.$api.get('/core/activity/page',queryParams.value).then(({data:res})=>{
 			if(res.code!==0) return proxy.$showToast(res.msg)
-			activityList.value = res.data.list;
+			activityList.value = [...activityList.value,...res.data.list];
 			activityList.value.forEach(a=>{
 				let cc = calculateCountdown(a?.signupEndTime);
 				a.endTimeText = cc===-1?a?.signupEndTime:(`还有${cc.days}天${cc.hours}小时${cc.minutes}分钟`)
 			})
+			queryParams.value.page++;
+			if(res.data.list.length===0) isOver.value = true;
 		})
 	}
 	
@@ -162,15 +184,18 @@
 				});
 			},200)
 			nextTick(()=>{
-				getActivityList('')
+				getActivityList()
 			})
 		}
 	})
 	
 	onMounted(()=>{
+		if(uni.getStorageSync('userInfo')){
+			queryParams.value.userId = JSON.parse(uni.getStorageSync('userInfo'))?.id;
+		}
 		getSwiperList()
 		getTypeList()
-		getActivityList('')
+		getActivityList()
 	})
 </script>
 
@@ -269,6 +294,7 @@
 				width: 100%;
 				flex: 1;
 				overflow-y: auto;
+				margin-top: 20rpx;
 			}
 		}
 	}

+ 1 - 1
pagesHome/allActivity.vue

@@ -35,7 +35,7 @@
 			<template v-if="list.length">
 				<up-list @scrolltolower="scrolltolower" style="height: 100%;">
 					<up-list-item v-for="(item, index) in list" :key="item.id">
-						<NonprofitActivety :item="item"></NonprofitActivety>
+						<NonprofitActivety :item="item" :index="index"></NonprofitActivety>
 					</up-list-item>
 				</up-list>
 			</template>