xlh 1 سال پیش
والد
کامیت
6836566529

+ 85 - 6
components/listBlock1/listBlock1.vue

@@ -24,14 +24,14 @@
 					<view class="left">
 						<view class="opr" style="padding-right: 25rpx"  @click="coll" :data-e="i">
 							<view class="icon">
-								<image :src="collArr.includes(i.acId) ? pic2 : pic "
+								<image :src="collArr.includes(i.acId) ? pic_coll2 : pic_coll "
 									style="width: 28rpx; height: 26rpx" mode="aspectFill"></image>
 							</view>
 							<text class="fz-font">收藏</text>
 						</view>
-						<view class="opr">
+						<view class="opr" @click="sub" :data-e="i">
 							<view class="icon">
-								<image src="http://43.139.158.220:5007/img/static/yym/Vector (Stroke).png"
+								<image :src="subArr.includes(i.acId) ? pic_sub2 : pic_sub "
 									style="width: 22rpx; height: 26rpx" mode="aspectFill"></image>
 							</view>
 							<text class="fz-font">订阅</text>
@@ -58,15 +58,21 @@
 				default () {
 					return [];
 				},
-			}
+			},
+			indexId: {
+				type: Number,
+			},
 		},
 		// props:['classList'],
 		data() {
 			return {
 				collArr:[],
+				subArr:[],
 				// collArr.includes(i.acId) ? 'http://43.139.158.220:5007/img/static/yym/Star 1 (Stroke).png' : 'http://43.139.158.220:5007/img/static/yym/Vector (Stroke).png'
-				pic:'http://43.139.158.220:5007/img/static/yym/Star 1 (Stroke).png',
-				pic2:'https://teacherapi.cocorobo.cn/teaching-file/static//mine/Collect_yellow.png'
+				pic_coll:'http://43.139.158.220:5007/img/static/yym/Star 1 (Stroke).png',
+				pic_coll2:'https://teacherapi.cocorobo.cn/teaching-file/static//mine/Collect_yellow.png',
+				pic_sub:'http://43.139.158.220:5007/img/static/yym/Vector (Stroke).png',
+				pic_sub2:'../../static/mine/dingyue_blue.png'
 			};
 		},
 		
@@ -135,6 +141,70 @@
 					}
 				})
 			},
+			
+			// 订阅事件
+			sub(event){
+				console.log(this.$store.state.user.openid);
+				let aId=event.currentTarget.dataset.e.acId
+				// 先获取用户订阅信息
+				let data={
+					oid:this.$store.state.user.openid, //用户id
+				}
+				this.$request('/selectSub','POST',data).then(res=>{
+					// console.log('获取订阅信息',res);
+					// return console.log('获取订阅信息',res[0][0].coll=='');
+					let res2
+					let subs
+					if(res[0][0].sub!==null && res[0][0].sub !==""){
+						subs=JSON.parse(res[0][0].sub)
+						console.log('获取订阅信息',subs);
+						// 判断订阅表是否包含这个活动
+						res2 = subs.some((e)=>{
+							return e == aId
+						})
+						// console.log(res2);
+					}
+					
+					// return 	console.log('2',res2);
+					// 第一次存储返回值为null,然后存储订阅
+					if(res[0][0].sub==null || res[0][0].sub==""){
+						// 然后进行存储活动到用户coll字段
+						let arr={
+							oid:this.$store.state.user.openid, //用户id
+							acid:JSON.stringify([aId])
+						}
+						this.$request('/updateSub','POST',arr).then(res=>{
+							this.$request('/selectSub','POST',data).then(res=>{
+								this.subArr=JSON.parse(res[0][0].sub)
+							})
+						})
+					// 当数组中没有这个订阅活动时添加订阅
+					}else if(!res2){
+						subs.push(aId)
+						let arr2={
+							oid:this.$store.state.user.openid, //用户id
+							acid:JSON.stringify(subs) 
+						}
+						this.$request('/updateSub','POST',arr2).then(res=>{
+							this.$request('/selectSub','POST',data).then(res=>{
+								this.subArr=JSON.parse(res[0][0].sub)
+							})
+						})
+					// 取消订阅
+					}else if(res2){
+						const newArray = subs.filter(item => item !== aId);
+						let arr3={
+							oid:this.$store.state.user.openid, //用户id
+							acid:JSON.stringify(newArray) 
+						}
+						this.$request('/updateSub','POST',arr3).then(res=>{
+							this.$request('/selectSub','POST',data).then(res=>{
+								this.subArr=JSON.parse(res[0][0].sub)
+							})
+						})
+					}
+				})
+			},
 			join() {
 				const value = this.$store.state.user.openid;
 				if (value == '') {
@@ -167,6 +237,15 @@
 					this.collArr=JSON.parse(res[0][0].coll)
 					console.log('进来就显示',this.collArr);
 				})
+			},
+			getSub(){
+				let data={
+					oid:this.$store.state.user.openid, //用户id
+				}
+				this.$request('/selectSub','POST',data).then(res=>{
+					this.subArr=JSON.parse(res[0][0].sub)
+					console.log('进来就显示',this.subArr);
+				})
 			}
 		},
 		// created () {

+ 113 - 34
pages/activityPage/activityPage.vue

@@ -3,20 +3,20 @@
 		<statusBar :item="navBarData"></statusBar>
 		<viewX-Case class="mid">
 			<template #title>
-				<view class="title three-font" >直播活动</view>
+				<view class="title three-font">直播活动</view>
 			</template>
 			<template #lookMore>
 				<view class="lookMore fz-font" @click="gotoLiveList">查看更多</view>
 			</template>
 			<template #activeBlock>
-				<view class="activeData" v-for="(item, index) in liveList" :key="index" @click="gotoAnnoun" :data-index="index">
+				<view class="activeData" v-for="(item, index) in liveList" :key="index">
 					<!-- <image src="https://teacherapi.cocorobo.cn/teaching-file/static//activity/bg1.png" mode="aspectFill"></image> -->
-					<image :src="item.pic" mode="aspectFill"></image>
+					<image :src="item.pic" mode="aspectFill" @click="gotoAnnoun" :data-index="index"></image>
 
 					<view class="liveBroadcast">
 						<view class="title">
 							<view class="tag bqZ-font">类型</view>
-							<text three-font>{{ item.acName }}</text>
+							<text three-font @click="gotoAnnoun" :data-index="index">{{ item.acName }}</text>
 						</view>
 
 						<view class="operate">
@@ -26,11 +26,13 @@
 								</view>
 								<view class="user fwb-font">{{ item.username }}</view>
 							</view>
-							<view class="collection">
+							<view class="collection" @click="coll" :data-e="item">
 								<!-- <view class="" style="display: flex;margin-right: 10rpx;align-items: center;"> -->
 								<view class="img">
-									<image src="https://teacherapi.cocorobo.cn/teaching-file/static//yym/Vector (Stroke) (2).png"
-										mode="aspectFill"></image>
+									<!-- <image src="https://teacherapi.cocorobo.cn/teaching-file/static//yym/Vector (Stroke) (2).png"
+										mode="aspectFill"></image> -->
+									<image :src="collArr.includes(item.acId) ? pic_coll2 : pic_coll" mode="aspectFill">
+									</image>
 								</view>
 								<text class="fz-font">收藏</text>
 							</view>
@@ -53,7 +55,7 @@
 			</template>
 		</viewX-Case>
 
-		
+
 		<view class="" style="height: 30rpx; width: 100%"> </view>
 		<view class="qiu" @click="fabClick">
 			<image src="https://teacherapi.cocorobo.cn/teaching-file/static//yym/jia.png" mode="aspectFill"></image>
@@ -77,36 +79,112 @@
 				liveList: [],
 				// 教研活动列表
 				activeList: [],
+				collArr:[],
+				pic_coll:'http://43.139.158.220:5007/img/static/yym/Star 1 (Stroke).png',
+				pic_coll2:'https://teacherapi.cocorobo.cn/teaching-file/static//mine/Collect_yellow.png'
 			};
 		},
 		methods: {
 			// 获取教研活动
-			getData(){
-				let data={
-					openid:uni.getStorageSync('oId'),
-					ty:1,
-					page:1, //下拉获取更多的备用字段
-					lim:6   //一次获取多少数据
+			getData() {
+				let data = {
+					openid: uni.getStorageSync('oId'),
+					ty: 1,
+					page: 1, //下拉获取更多的备用字段
+					lim: 6 //一次获取多少数据
 				}
-					this.$request('/selectActivity',"POST",data).then(res=>{
-						console.log(res[0]);
-						// this.activeList=[...this.activeList,...res[0]]
-						this.activeList=res[0]
-					})
+				this.$request('/selectActivity', "POST", data).then(res => {
+					console.log(res[0]);
+					// this.activeList=[...this.activeList,...res[0]]
+					this.activeList = res[0]
+				})
 			},
 			// 获取直播活动
-			getData2(){
+			getData2() {
+				let data = {
+					openid: uni.getStorageSync('oId'),
+					ty: 0,
+					page: 1, //下拉获取更多的备用字段
+					lim: 6 //一次获取多少数据
+				}
+				this.$request('/selectActivity', "POST", data).then(res => {
+					console.log(res[0]);
+					// this.activeList=[...this.activeList,...res[0]]
+					this.liveList = res[0].slice(0, 6);
+				})
+			},
+			getcoll(){
+				let data={
+					oid:this.$store.state.user.openid, //用户id
+				}
+				this.$request('/selectColl','POST',data).then(res=>{
+					this.collArr=JSON.parse(res[0][0].coll)
+					console.log('进来就显示',this.collArr);
+				})
+			},
+			// 收藏事件
+			coll(event){
+				// console.log(event.currentTarget.dataset.e);
+				console.log(this.$store.state.user.openid);
+				let aId=event.currentTarget.dataset.e.acId
+				// 先获取用户收藏信息
 				let data={
-					openid:uni.getStorageSync('oId'),
-					ty:0,
-					page:1, //下拉获取更多的备用字段
-					lim:6   //一次获取多少数据
+					oid:this.$store.state.user.openid, //用户id
 				}
-					this.$request('/selectActivity',"POST",data).then(res=>{
-						console.log(res[0]);
-						// this.activeList=[...this.activeList,...res[0]]
-						this.liveList=res[0].slice(0, 6);
-					})
+				this.$request('/selectColl','POST',data).then(res=>{
+					// console.log('获取收藏信息',res);
+					// return console.log('获取收藏信息',res[0][0].coll=='');
+					let res2
+					let colls
+					if(res[0][0].coll!==null && res[0][0].coll !==""){
+						colls=JSON.parse(res[0][0].coll)
+						console.log('获取收藏信息',colls);
+						// 判断收藏表是否包含这个活动
+						res2 = colls.some((e)=>{
+							return e == aId
+						})
+						// console.log(res2);
+					}
+					
+					// return 	console.log('2',res2);
+					// 第一次存储返回值为null,然后存储收藏
+					if(res[0][0].coll==null || res[0][0].coll==""){
+						// 然后进行存储活动到用户coll字段
+						let arr={
+							oid:this.$store.state.user.openid, //用户id
+							acid:JSON.stringify([aId])
+						}
+						this.$request('/updateColl','POST',arr).then(res=>{
+							this.$request('/selectColl','POST',data).then(res=>{
+								this.collArr=JSON.parse(res[0][0].coll)
+							})
+						})
+					// 当数组中没有这个收藏活动时添加收藏
+					}else if(!res2){
+						colls.push(aId)
+						let arr2={
+							oid:this.$store.state.user.openid, //用户id
+							acid:JSON.stringify(colls) 
+						}
+						this.$request('/updateColl','POST',arr2).then(res=>{
+							this.$request('/selectColl','POST',data).then(res=>{
+								this.collArr=JSON.parse(res[0][0].coll)
+							})
+						})
+					// 取消收藏
+					}else if(res2){
+						const newArray = colls.filter(item => item !== aId);
+						let arr3={
+							oid:this.$store.state.user.openid, //用户id
+							acid:JSON.stringify(newArray) 
+						}
+						this.$request('/updateColl','POST',arr3).then(res=>{
+							this.$request('/selectColl','POST',data).then(res=>{
+								this.collArr=JSON.parse(res[0][0].coll)
+							})
+						})
+					}
+				})
 			},
 			lookMore() {
 				const value = this.$store.state.user.openid;
@@ -120,10 +198,10 @@
 					});
 				}
 			},
-			gotoLiveList(){
-					uni.navigateTo({
-						url:'/pages/liveActivityList/liveActivityList'
-					})
+			gotoLiveList() {
+				uni.navigateTo({
+					url: '/pages/liveActivityList/liveActivityList'
+				})
 			},
 			fabClick() {
 				const value = this.$store.state.user.openid;
@@ -165,11 +243,12 @@
 					// }
 				}
 			},
-			
+
 		},
 		onShow() {
 			this.getData()
 			this.getData2()
+			this.getcoll()
 		}
 	};
 </script>

+ 1 - 0
pages/index/index.vue

@@ -200,6 +200,7 @@
 			this.getData()
 			this.getlistBlock1Data()
 			this.$refs.listBlock1.getdata()
+			this.$refs.listBlock1.getSub()
 		}
 	};
 </script>

+ 40 - 3
pages/mineRelease/mineRelease.vue

@@ -42,6 +42,12 @@
 				</view>
 			</view>
 		</view>
+		
+		<view class="loading">
+			<view v-if="newsLoading==1">数据加载中...</view>
+			<view v-if="newsLoading==2">没有更多了~~</view>
+		</view>
+		
 		<view class="" style="width: 100%;height: 50rpx;"></view>
 		
 		<!-- 弹窗 -->
@@ -72,6 +78,9 @@
 				},
 				showPopup: false,
 				deleteAcId : '',
+				// 触底加载动画提示
+				newsLoading: 0, //0默认值  1加载中 2没有更多了
+				currentPage: 1,
 				activeList: [
 					// {
 					// 	pic: "https://teacherapi.cocorobo.cn/teaching-file/static//img/1695656271245-image.png",
@@ -87,17 +96,24 @@
 			getpublish() {
 				let data={
 					openid:uni.getStorageSync('oId'),
-					del: 0
+					del: 0,
+					page: this.currentPage, //下拉获取更多的备用字段
+					lim: 5 //一次获取多少数据
 				}
 				this.$request('/selectMyPublish', "POST", data).then(res => {
 					console.log(res[0]);
-					this.activeList = res[0]
+					if (!res[0].length) {
+						this.newsLoading = 2
+					} else {
+						this.newsLoading = 0
+					}
+					this.activeList = [...this.activeList, ...res[0]]
 					if (this.activeList.length < 1) {
 						uni.showToast({
 							title: '没有您发布的内容',
 							icon: 'none'
 						});
-						return;
+						// return;
 					}
 				})
 			},
@@ -140,6 +156,17 @@
 				this.deleteAcId = null
 			},
 		},
+		// 触底加载更多
+		onReachBottom() {
+			console.log(111);
+			if (this.newsLoading == 2) {
+				return
+			}
+			this.newsLoading = 1
+			this.currentPage++
+			setTimeout(this.getpublish, 2000)
+		
+		},
 		onShow() {
 			this.getpublish();
 		}
@@ -147,6 +174,16 @@
 </script>
 
 <style lang="scss" scoped>
+	.loading {
+		height: 50rpx;
+		text-align: center;
+		padding-top: 20rpx;
+		padding-bottom: 100rpx;
+		font-size: 26rpx;
+		color: #888;
+		line-height: 2em;
+	}
+	
 	.activeBox {
 		width: 100%;
 		background-color: #fff;

+ 33 - 24
pages/publish/publish.vue

@@ -408,7 +408,7 @@
 							this.activitytitle = item.acName
 							this.activityintro = item.brief
 							this.imageValue = item.pic
-							this.classify = item.type
+							this.index = item.type
 							this.recruitment = item.pers
 							this.activityform = item.acshape
 							this.address = item.address
@@ -487,6 +487,19 @@
 					url: '/pages/activityPage/activityPage'
 				})
 			},
+			//清空发布里的内容
+			contentClear() {
+				this.activitytitle = ''
+				this.activityintro = ''
+				this.imageValue = ''
+				this.index = null
+				this.recruitment = ''
+				this.activityform = '请选择'
+				this.address = '请选择'
+				this.funds = ''
+				this.activityDate = '请选择'
+				this.deadlineDate = '请选择'
+			},
 			// 上传发布
 			conf() {
 
@@ -517,6 +530,7 @@
 					// console.log(formData);
 					this.$request('/updateMyPublish', 'POST', this.formData).then(res => {
 						console.log(res);
+						this.contentClear()
 						setTimeout(() => {
 							uni.navigateBack();
 						}, 500)
@@ -525,16 +539,7 @@
 					this.$request('/insertActive', 'POST', this.formData).then(res => {
 						console.log(res.data);
 						if (res.code == 200) {
-							this.activitytitle = ''
-							this.activityintro = ''
-							this.imageValue = ''
-							this.index = null
-							this.recruitment = ''
-							this.activityform = '请选择'
-							this.address = '请选择'
-							this.funds = ''
-							this.activityDate = '请选择'
-							this.deadlineDate = '请选择'
+							this.contentClear()
 							setTimeout(() => {
 								uni.switchTab({
 									url: '/pages/activityPage/activityPage'
@@ -626,18 +631,20 @@
 			}
 
 			this.formData = this.$store.state.formData
-			let data = uni.getStorageSync('formData')
-			console.log(data);
-			this.activitytitle = data.activitytitle
-			this.activityintro = data.activityintro
-			this.imageValue = data.imageValue
-			this.index = data.classify
-			this.recruitment = data.recruitment
-			this.activityform = data.activityform
-			this.address = data.address
-			this.funds = data.funds
-			this.activityDate = data.activityDate
-			this.deadlineDate = data.deadlineDate
+			if (this.btntext !== '修改发布') {
+				let data = uni.getStorageSync('formData')
+				console.log(data);
+				this.activitytitle = data.activitytitle
+				this.activityintro = data.activityintro
+				this.imageValue = data.imageValue
+				this.index = data.classify
+				this.recruitment = data.recruitment
+				this.activityform = data.activityform
+				this.address = data.address
+				this.funds = data.funds
+				this.activityDate = data.activityDate
+				this.deadlineDate = data.deadlineDate
+			}
 
 			console.log(this.index);
 		},
@@ -655,7 +662,9 @@
 				activityDate: this.activityDate,
 				deadlineDate: this.deadlineDate
 			}
-			uni.setStorageSync('formData', data)
+			if (this.btntext !== '修改发布') {
+				uni.setStorageSync('formData', data)
+			}
 			// this.$store.commit('saveformData', this.formData);
 			// console.log('Submitted formData:', this.formData);
 			// console.log('Current state.formData:', this.$store.state.formData);

+ 169 - 14
pages/teachingDetail/teachingDetail.vue

@@ -11,14 +11,13 @@
 				<view class="cardTop">
 					<view class="title three-font">{{ item.acName }}</view>
 					<view class="icons">
-						<view class="icon">
-							<image
-								src="https://teacherapi.cocorobo.cn/teaching-file/static//yym/Star 1 (Stroke) (2).png"
-								style="width: 42rpx;height: 40rpx;" mode="aspectFill"></image>
+						<view class="icon" @click="coll">
+							<image :src="collArr.includes(item.acId) ? pic_coll2 : pic_coll "
+								style="width: 42rpx;height: 42rpx;" mode="aspectFill"></image>
 						</view>
-						<view class="icon">
+						<view class="icon" @click="sub">
 							<image
-								src="https://teacherapi.cocorobo.cn/teaching-file/static//yym/Vector (Stroke) (1).png"
+								:src="subArr.includes(item.acId) ? pic_sub2 : pic_sub "
 								style="width: 38rpx;height: 42rpx;" mode="aspectFill"></image>
 						</view>
 					</view>
@@ -120,6 +119,13 @@
 				isButtonDisabled: false,
 				btnText: '申请加入',
 				actItemList: [],
+				collArr:[],
+				subArr:[],
+				clickedAcId:'',
+				pic_coll:'https://teacherapi.cocorobo.cn/teaching-file/static//yym/Star 1 (Stroke) (2).png',
+				pic_coll2:'https://teacherapi.cocorobo.cn/teaching-file/static//mine/Collect_yellow.png',
+				pic_sub:'https://teacherapi.cocorobo.cn/teaching-file/static/yym/Vector (Stroke) (1).png',
+				pic_sub2:'../../static/mine/dingyue_blue.png',
 				perNum: [{
 						Name: '金晶',
 						img: 'https://teacherapi.cocorobo.cn/teaching-file/static//yym/Ellipse 4 (1).png'
@@ -153,31 +159,160 @@
 			};
 		},
 		methods: {
+			// 收藏事件
+			coll(event){
+				// console.log(event.currentTarget.dataset.e);
+				console.log(this.$store.state.user.openid);
+				let aId=this.clickedAcId
+				// 先获取用户收藏信息
+				let data={
+					oid:this.$store.state.user.openid, //用户id
+				}
+				this.$request('/selectColl','POST',data).then(res=>{
+					// console.log('获取收藏信息',res);
+					// return console.log('获取收藏信息',res[0][0].coll=='');
+					let res2
+					let colls
+					if(res[0][0].coll!==null && res[0][0].coll !==""){
+						colls=JSON.parse(res[0][0].coll)
+						console.log('获取收藏信息',colls);
+						// 判断收藏表是否包含这个活动
+						res2 = colls.some((e)=>{
+							return e == aId
+						})
+						// console.log(res2);
+					}
+					
+					// return 	console.log('2',res2);
+					// 第一次存储返回值为null,然后存储收藏
+					if(res[0][0].coll==null || res[0][0].coll==""){
+						// 然后进行存储活动到用户coll字段
+						let arr={
+							oid:this.$store.state.user.openid, //用户id
+							acid:JSON.stringify([aId])
+						}
+						this.$request('/updateColl','POST',arr).then(res=>{
+							this.$request('/selectColl','POST',data).then(res=>{
+								this.collArr=JSON.parse(res[0][0].coll)
+							})
+						})
+					// 当数组中没有这个收藏活动时添加收藏
+					}else if(!res2){
+						colls.push(aId)
+						let arr2={
+							oid:this.$store.state.user.openid, //用户id
+							acid:JSON.stringify(colls) 
+						}
+						this.$request('/updateColl','POST',arr2).then(res=>{
+							this.$request('/selectColl','POST',data).then(res=>{
+								this.collArr=JSON.parse(res[0][0].coll)
+							})
+						})
+					// 取消收藏
+					}else if(res2){
+						const newArray = colls.filter(item => item !== aId);
+						let arr3={
+							oid:this.$store.state.user.openid, //用户id
+							acid:JSON.stringify(newArray) 
+						}
+						this.$request('/updateColl','POST',arr3).then(res=>{
+							this.$request('/selectColl','POST',data).then(res=>{
+								this.collArr=JSON.parse(res[0][0].coll)
+							})
+						})
+					}
+				})
+			},
+			// 订阅事件
+			sub(event){
+				// console.log(event.currentTarget.dataset.e);
+				console.log(this.$store.state.user.openid);
+				let aId=this.clickedAcId
+				// 先获取用户订阅信息
+				let data={
+					oid:this.$store.state.user.openid, //用户id
+				}
+				this.$request('/selectSub','POST',data).then(res=>{
+					// console.log('获取订阅信息',res);
+					// return console.log('获取订阅信息',res[0][0].coll=='');
+					let res2
+					let subs
+					if(res[0][0].sub!==null && res[0][0].sub !==""){
+						console.log(res);
+						subs=JSON.parse(res[0][0].sub)
+						console.log('获取订阅信息',subs);
+						// 判断订阅表是否包含这个活动
+						res2 = subs.some((e)=>{
+							return e == aId
+						})
+						// console.log(res2);
+					}
+					
+					// return 	console.log('2',res2);
+					// 第一次存储返回值为null,然后存储订阅
+					if(res[0][0].sub==null || res[0][0].sub==""){
+						// 然后进行存储活动到用户coll字段
+						let arr={
+							oid:this.$store.state.user.openid, //用户id
+							acid:JSON.stringify([aId])
+						}
+						this.$request('/updateSub','POST',arr).then(res=>{
+							this.$request('/selectSub','POST',data).then(res=>{
+								this.subArr=JSON.parse(res[0][0].sub)
+							})
+						})
+					// 当数组中没有这个订阅活动时添加订阅
+					}else if(!res2){
+						subs.push(aId)
+						let arr2={
+							oid:this.$store.state.user.openid, //用户id
+							acid:JSON.stringify(subs) 
+						}
+						this.$request('/updateSub','POST',arr2).then(res=>{
+							this.$request('/selectSub','POST',data).then(res=>{
+								this.subArr=JSON.parse(res[0][0].sub)
+							})
+						})
+					// 取消订阅
+					}else if(res2){
+						const newArray = subs.filter(item => item !== aId);
+						let arr3={
+							oid:this.$store.state.user.openid, //用户id
+							acid:JSON.stringify(newArray) 
+						}
+						this.$request('/updateSub','POST',arr3).then(res=>{
+							this.$request('/selectSub','POST',data).then(res=>{
+								this.subArr=JSON.parse(res[0][0].sub)
+							})
+						})
+					}
+				})
+			},
 			gotoMorePer() {
 				uni.navigateTo({
 					url: '/pages/dy/dy'
 				})
 			},
 			applyAdd() {
-				const clickedAcId = this.actItemList[0].acId;
+				// const clickedAcId = this.actItemList[0].acId;
 				// console.log(clickedAcId);
 				uni.navigateTo({
-					url: '/pages/jys/jys?acId=' + clickedAcId
+					url: '/pages/jys/jys?acId=' + this.clickedAcId
 				})
 			},
 			//判断是否报名
-			btnEnroll(clickedAcId) {
+			btnEnroll() {
 				this.$request('/selectActivityEnrollid', "POST", {
-					acId: clickedAcId,
+					acId: this.clickedAcId,
 					openid: uni.getStorageSync('oId')
 				}).then(res => {
 					if (!res[0][0] || !res[0][0].hasOwnProperty('acId')) {
 						console.log('acId 未定义或不存在');
 						return
 					}
-					console.log(clickedAcId);
+					// console.log(clickedAcId);
 					console.log(res[0]);
-					if (clickedAcId === res[0][0].acId) {
+					if (this.clickedAcId === res[0][0].acId) {
 						this.isButtonDisabled = true
 						this.btnText = '已加入'
 					}
@@ -206,13 +341,33 @@
 					// this.activeList=[...this.activeList,...res[0]]
 					this.actItemList = res[0]
 					this.typetext = this.mapTypeToText(this.actItemList.type);
-					const clickedAcId = this.actItemList[0].acId;
-					this.btnEnroll(clickedAcId)
+					this.clickedAcId = this.actItemList[0].acId;
+					this.btnEnroll()
 				})
 			},
+			getdata(){
+				let data={
+					oid:this.$store.state.user.openid, //用户id
+				}
+				this.$request('/selectColl','POST',data).then(res=>{
+					this.collArr=JSON.parse(res[0][0].coll)
+					console.log('进来就显示',this.collArr);
+				})
+			},
+			getSub(){
+				let data={
+					oid:this.$store.state.user.openid, //用户id
+				}
+				this.$request('/selectSub','POST',data).then(res=>{
+					this.subArr=JSON.parse(res[0][0].sub)
+					console.log('进来就显示',this.subArr);
+				})
+			}
 		},
 		onShow() {
 			this.getActivity()
+			this.getdata()
+			this.getSub()
 		}
 	}
 </script>

+ 1 - 0
pages/teachingList/teachingList.vue

@@ -78,6 +78,7 @@
 			// 一进页面就加载数据
 			this.getData()
 			this.$refs.listBlock1.getdata()
+			this.$refs.listBlock1.getSub()
 		}
 	}
 </script>

BIN
static/mine/dingyue_blue.png