xlh 1 gadu atpakaļ
vecāks
revīzija
28d9aa2cdf
1 mainītis faili ar 78 papildinājumiem un 26 dzēšanām
  1. 78 26
      pages/mineSubscribe/mineSubscribe.vue

+ 78 - 26
pages/mineSubscribe/mineSubscribe.vue

@@ -19,26 +19,26 @@
 			<swiper-item>
 				<scroll-view scroll-y="true" style="height: 80vh;">
 					<view class="activeClass">
-						<view class="classBox" @click="gotoWeb(index)" v-for="(item,index) in classList" :key="index">
+						<view class="classBox" @click="" v-for="(item,index) in classList" :key="index">
 
 							<view class="classLeft">
 								<view class="class_Img">
-									<image :src="classList[index].img" mode="aspectFill"></image>
+									<image :src="item.pic" mode="aspectFill"></image>
 								</view>
 								<view class="class_Text">
 									<view class="text_Title">
 										<text class="manage">类型</text>
-										<text>{{ item.className }}</text>
+										<text>{{ item.acName }}</text>
 
 									</view>
 									<view class="text_Intro">
-										<text>{{ item.intro }}</text>
+										<text>{{ item.brief }}</text>
 									</view>
 								</view>
 							</view>
 							<view class="classright">
 								<!-- <image src="../../static/mine/Union.png" mode="aspectFill"></image> -->
-								<image src="../../static/mine/Union.png" mode="aspectFill"></image>
+								<image src="../../static/mine/Union.png" mode="aspectFill" @click="sub" :data-e="item"></image>
 
 							</view>
 						</view>
@@ -93,28 +93,31 @@
 				active: 'active', //类名
 				test: 'test',
 				yun: 'yun',
-				classList: [{
-						img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/1695656271245-image.png",
-						className: "丽湖职教双创教育国际虚拟教研室启动大会暨双创教育国际论坛圆满举行",
-						intro: "丽湖职教双创教育国际虚拟教研室为立足全国,辐射海外的国际化教研室,围绕创新创业教育的人才培养与课程建设开展深度研究。教研室以贯彻落实立德树人根本任务,通过加强跨专业、跨校、跨地域的教研交流,推动高校协同打造国际化的精品教学资",
-					},
-					{
-						img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/img1.png",
-						className: "丽湖职教双创教育国际虚拟教研室2023年常规教研活动安排",
-						intro: "丽湖职教双创教育国际虚拟教研室为立足全国,辐射海外的国际化教研室,围绕创新创业教育的人才培养与课程建设开展深度研究。教研室以贯彻落实立德树人根本任务,通过加强跨专业、跨校、跨地域的教研交流,推动高校协同打造国际化的精品教学资",
-					},
-					{
-						img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/img3.png",
-						className: "产教融合情境下的双创通识课程建设 | 丽湖职教双创教育国际虚拟教研室常规教研活动第2期顺利举行",
-						intro: "【图片】为提升职业院校双创课程建设水平,促进双创课程的改革与发展,丽湖职教双创教育国际虚拟教研室于3月29日组织举办了以“产教融合情境下的双创通识课程建设”为主题的第2期线上教研活动,来自全国各职业院校的60多位教师参会。本",
-					},
-					{
-						img: "https://teacherapi.cocorobo.cn/teaching-file/static//yym/83b48be81d4ed9c93908737496f2a54.png",
-						className: "丽湖职教双创教育国际虚拟教研室 • 常规教研活动 第9期",
-						intro: "丽湖职教双创教育国际虚拟教研室 • 常规教研活动 第9期:主题为创新创业在线课程建设与运营。【图片】【图片】【图片】【图片】【图片】"
-					},
+				subArr: [],
+				classList: [
+					// {
+					// 	img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/1695656271245-image.png",
+					// 	className: "丽湖职教双创教育国际虚拟教研室启动大会暨双创教育国际论坛圆满举行",
+					// 	intro: "丽湖职教双创教育国际虚拟教研室为立足全国,辐射海外的国际化教研室,围绕创新创业教育的人才培养与课程建设开展深度研究。教研室以贯彻落实立德树人根本任务,通过加强跨专业、跨校、跨地域的教研交流,推动高校协同打造国际化的精品教学资",
+					// },
+					// {
+					// 	img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/img1.png",
+					// 	className: "丽湖职教双创教育国际虚拟教研室2023年常规教研活动安排",
+					// 	intro: "丽湖职教双创教育国际虚拟教研室为立足全国,辐射海外的国际化教研室,围绕创新创业教育的人才培养与课程建设开展深度研究。教研室以贯彻落实立德树人根本任务,通过加强跨专业、跨校、跨地域的教研交流,推动高校协同打造国际化的精品教学资",
+					// },
+					// {
+					// 	img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/img3.png",
+					// 	className: "产教融合情境下的双创通识课程建设 | 丽湖职教双创教育国际虚拟教研室常规教研活动第2期顺利举行",
+					// 	intro: "【图片】为提升职业院校双创课程建设水平,促进双创课程的改革与发展,丽湖职教双创教育国际虚拟教研室于3月29日组织举办了以“产教融合情境下的双创通识课程建设”为主题的第2期线上教研活动,来自全国各职业院校的60多位教师参会。本",
+					// },
+					// {
+					// 	img: "https://teacherapi.cocorobo.cn/teaching-file/static//yym/83b48be81d4ed9c93908737496f2a54.png",
+					// 	className: "丽湖职教双创教育国际虚拟教研室 • 常规教研活动 第9期",
+					// 	intro: "丽湖职教双创教育国际虚拟教研室 • 常规教研活动 第9期:主题为创新创业在线课程建设与运营。【图片】【图片】【图片】【图片】【图片】"
+					// },
 				],
-				activeList: [{
+				activeList: [
+					{
 						img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/img1.png",
 						count: "17",
 						price: "188",
@@ -153,6 +156,52 @@
 			}
 		},
 		methods: {
+			getData() {
+				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.collArr);
+					// let a=this.collArr.join(', ');
+					// return console.log({a});
+					let data = {
+						oid: this.$store.state.user.openid, //用户id
+						list: this.subArr
+					}
+					// return console.log(data);
+					this.$request('/selectSubList', 'POST', data).then(res => {
+						console.log("要渲染的数据",res);
+						// this.collArr=res[0]
+						this.classList = res[0]
+					})
+				})
+			},
+			// 这里获取的活动肯定是已订阅的,就不用判断直接删除就可以了
+			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=>{
+					
+					let subs=JSON.parse(res[0][0].sub)
+					
+					// 把未取消订阅的数据提取出来
+					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.getData()
+					})
+				})
+			},
 			swipeIndex(index) {
 				this.current = index.detail.current;
 			},
@@ -190,6 +239,9 @@
 					});
 				}
 			}
+		},
+		onShow() {
+			this.getData()
 		}
 	}
 </script>