yuanyiming 1 год назад
Родитель
Сommit
e041351ffb

+ 0 - 1
api/request.js

@@ -8,7 +8,6 @@ const request = (url = '', method = 'GET', data = {}, header = {   //这里这
 		// console.log(header);
 		uni.request({
 			url: 'https://teacherapi.cocorobo.cn/api/pbl' + url, //接口地址:前缀+方法中传入的地址
-			// url: 'http://10.3.13.84:7333/api/pbl' + url, //接口地址:前缀+方法中传入的地址
 			// url: 'http://127.0.0.1:7333/api/pbl' + url, //接口地址:前缀+方法中传入的地址
 			method: method, //请求方法
 			data: data, //传递参数

+ 3 - 3
components/listBlock1/listBlock1.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="">
 
-		<view class="listBlock1" v-for="(i,index) in classList" :key="index" @click="gotoDetail" :data-aid="i.acId">
+		<view class="listBlock1" v-for="(i,index) in classList" :key="index" @click="gotoLink" :data-link="i.link">
 			<view class="img cell-img">
 				<image :src="i.pic" mode="aspectFill"></image>
 
@@ -37,8 +37,8 @@
 					<view class="left">
 						<view class="add fz-font">已报名{{i.bnum}}/{{i.pers}}人</view>
 					</view>
-					<view class="Oright" v-if="!indexId" @click.stop="gotoLink" :data-link="i.link">
-						<view class="text">查看详情</view>
+					<view class="Oright" v-if="!indexId"  @click.stop="gotoDetail" :data-aid="i.acId">
+						<view class="text">报名</view>
 						<view class="arrow">
 							<image src="https://teacherapi.cocorobo.cn/teaching-file/static/mine/arrow-right-blue.png"
 								mode="aspectFill"></image>

+ 18 - 3
components/msgPop/msgPop.vue

@@ -27,7 +27,7 @@
 		name: "msgPop",
 		computed: {
 			msgpop() {
-			      return this.$store.state.msgpop; // 直接访问 Vuex 中的状态数据
+				return this.$store.state.msgpop; // 直接访问 Vuex 中的状态数据
 			}
 		},
 		props: {
@@ -69,9 +69,8 @@
 		position: fixed;
 		padding: 0 30rpx;
 		background-color: #fff;
-		top: 15%;
+		// top: 15%;
 		box-shadow: 0rpx 10rpx 10rpx 5rpx rgba(0, 0, 0, .1);
-		// bottom: 10%;
 		z-index: 100;
 		width: 650rpx;
 		height: 90rpx;
@@ -80,6 +79,7 @@
 		border-radius: 30rpx;
 		display: flex;
 		align-items: center;
+		// animation: collpopul 1s cubic-bezier(0,0,0.25,1) forwards;
 
 		.contxt {
 			flex: 1;
@@ -105,4 +105,19 @@
 			font-weight: bold;
 		}
 	}
+
+	@keyframes collpopul {
+		0% {
+			// background: red;
+			top: 0;
+		}
+
+		100% {
+			// background: red;
+			top: 15%;
+		}
+		// 100%{
+		// 	opacity: 0;
+		// }
+	}
 </style>

+ 52 - 27
pages/activityDetailNew/activityDetailNew.vue

@@ -4,7 +4,7 @@
 		<statusBar :item="navbar"></statusBar>
 		<!-- 消息提示 -->
 		<msgPop></msgPop>
-		
+
 		<view class="top">
 			<image class="img1" src="https://teacherapi.cocorobo.cn/teaching-file/static/yym/Rectangle25.png"
 				mode="widthFix">
@@ -58,24 +58,28 @@
 					</view>: <text style="color:rgba(0, 86, 168, 1) ;">{{actItemList.acshape}}</text>
 				</view>
 			</view>
+			<!-- 活动介绍 -->
 			<view class="acbrief">
 				<view class="britit">
 					活动介绍
 				</view>
-				<view class="bricon" >
-					{{actItemList.brief}}
-					<view style="color: blue;display: inline-block;" :data-link="actItemList.link"  @click="gotoLink">
-						<!-- 查看更多 -->
-						<!-- <uni-icons type="forward" size="17"  color="blue"></uni-icons> -->
+
+				<!-- 	<web-view :src="actItemList.link"  webview-styles="{'height': '700rpx';}"></web-view> -->
+				<!-- <br /> -->
+				<view class="bricon">
+					<!-- <rich-text :nodes="">{{actItemList.brief}}</rich-text> -->
+					<rich-text  :nodes="actItemList.brief"></rich-text>
+					<!-- <view style="color: blue;display: inline-block;" :data-link="actItemList.link"  @click="gotoLink">
 						<u-icon name="arrow-right" labelSize='14' size='14' labelColor='blue' space='2' color='blue' labelPos='left' label='查看更多'></u-icon>
-					</view>
-					<!-- <u-icon name="arrow-right" label='查看更多'></u-icon> -->
+					</view> -->
 				</view>
-				<image class="briImg" :src="actItemList.pic" mode="widthFix"></image>
+				<!-- <image class="briImg" :src="actItemList.pic" mode="widthFix"></image> -->
 			</view>
 
 		</view>
 
+
+		<!-- 按钮 -->
 		<view class="btnBlock">
 			<view class="icos">
 				<view class="ico">
@@ -151,9 +155,9 @@
 
 				// 用户订阅列表
 				// subArr: [],
-				
+
 				// 收藏按钮节流
-				stopTimer:0,
+				stopTimer: 0,
 
 				//控制弹窗
 				showPopup: false,
@@ -163,11 +167,26 @@
 				// 报名列表
 				applyUserlist: [],
 				pic_coll2: 'https://teacherapi.cocorobo.cn/teaching-file/static/mine/Collect_yellow.png',
+
+				nodes: [{
+					name: 'div',
+					attrs: {
+						class: 'div-class',
+						style: 'line-height: 60px; color: red; text-align:center;'
+					},
+					children: [{
+						type: 'text',
+						text: 'Hello&nbsp;uni-app!'
+					}]
+				}],
+				strings: '<div style="text-align:center;"><img src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png"/></div>'
 				// pic_sub: 'https://teacherapi.cocorobo.cn/teaching-file/static/yym/Vector (Stroke) (1).png',
 				// pic_sub2: 'https://teacherapi.cocorobo.cn/teaching-file/static/dingyue_blue.png',
 			};
 		},
+		// 分享
 		onShareAppMessage() {
+
 			uni.share({
 				provider: "weixin",
 				scene: "WXSceneSession",
@@ -181,9 +200,9 @@
 				}
 			});
 		},
-		onUnload() {
-			this.$store.dispatch('asyncDelAll')
-		},
+		// onUnload() {
+		// 	this.$store.dispatch('asyncDelAll')
+		// },
 		methods: {
 			//跳转到第三方链接
 			gotoLink(e) {
@@ -296,16 +315,16 @@
 			// 收藏事件
 			coll() {
 				// this.stopTimer=0
-				if(this.stopTimer) return uni.showToast({
-					icon:'none',
-					title:'点击过快'
+				if (this.stopTimer) return uni.showToast({
+					icon: 'none',
+					title: '点击过快'
 				})
-				this.stopTimer=1
-				
-				setTimeout(()=>{
-					this.stopTimer=0
-				},500)
-				
+				this.stopTimer = 1
+
+				setTimeout(() => {
+					this.stopTimer = 0
+				}, 500)
+
 				//判断是否收藏
 				let iscoll = null
 
@@ -318,10 +337,12 @@
 				this.$request('/selectOneOperator', 'POST', data).then(res => {
 					// console.log('查询是否收藏过',res);
 					res[0].length ? iscoll = true : iscoll = false;
-					
+
 					// iscoll为true表示已经收藏过,执行删除  为true则收藏
 					if (iscoll) {
-						this.$store.dispatch('asyncUpdatemsg',{collAoff: 0})
+						this.$store.dispatch('asyncUpdatemsg', {
+							collAoff: 0
+						})
 						console.log('执行删除');
 						this.$request('/deleteOperator', 'POST', data).then(res => {
 							// console.log(res);
@@ -331,7 +352,9 @@
 							}, 1500)
 						})
 					} else {
-						this.$store.dispatch('asyncUpdatemsg',{collAoff: 1})
+						this.$store.dispatch('asyncUpdatemsg', {
+							collAoff: 1
+						})
 						console.log('执行添加');
 						this.$request('/insertOperator', 'POST', data).then(res => {
 							// console.log(res);
@@ -386,6 +409,8 @@
 			// 获取是否报名
 			this.btnEnroll()
 
+			// WebviewObject plus.webview.create( url, id, styles, extras );
+
 			// this.getActivity()
 			// 获取页面数据
 			this.getdata()
@@ -402,7 +427,7 @@
 
 <style lang="scss">
 	.activityDetailNew {
-		background-color: #000;
+		background-color: #fff;
 
 		.top {
 			width: 750rpx;

+ 126 - 68
pages/activityPageNew/activityPageNew.vue

@@ -4,8 +4,8 @@
 		<!-- 消息提示 -->
 		<msgPop></msgPop>
 		<view class="search">
-			<uni-search-bar v-model="searchText" bgColor="#f0f2f5" class="btntop" placeholder="搜索" cancelButton="none"
-				clearButton="none"></uni-search-bar>
+			<uni-search-bar v-model.trim="searchText" bgColor="#f0f2f5" class="btntop" placeholder="搜索"
+				cancelButton="none" clearButton="none"></uni-search-bar>
 		</view>
 
 		<view class="top">
@@ -41,8 +41,9 @@
 			<swiper-item>
 				<scroll-view scroll-y="true" refresher-enabled='true' :refresher-triggered="putrigger"
 					@refresherrefresh='purepulling' @scrolltolower="pulower" style="height: 100%;">
+					<view class="searchPagedata" v-if="!pulist.length">暂无数据</view>
 					<view>
-						<listBlock1 ref="listBlock2" :classList="filteredClassList2"></listBlock1>
+						<listBlock1 ref="listBlock2" :classList="pulist"></listBlock1>
 					</view>
 					<view class="loading">
 						<view v-if="puLoading==1">数据加载中...</view>
@@ -56,8 +57,11 @@
 			<swiper-item>
 				<scroll-view scroll-y="true" refresher-enabled='true' :refresher-triggered="trigger"
 					@refresherrefresh='repulling' @scrolltolower="aclower" style="height: 100%;">
+
+					<view class="searchPagedata" v-if="!teclist.length">暂无数据</view>
+
 					<view class="">
-						<listBlock1 ref="listBlock1" :classList="filteredClassList"></listBlock1>
+						<listBlock1 ref="listBlock1" :classList="teclist"></listBlock1>
 					</view>
 					<view class="loading">
 						<view v-if="acLoading==1">数据加载中...</view>
@@ -114,44 +118,81 @@
 				// 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发
 				trigger: false, //专题
 				putrigger: false, //常规
-				// 付费
-				// monlist: [{
-				// 	acId: "92e11d93-8778-11ee-b98c-005056b86db5",
-				// 	acName: "丽湖职教双创教育国际虚拟教研室2023年常规教研活动安排",
-				// 	acshape: "户外活动",
-				// 	avatar: "http://139.159.246.165:7006/uploads/20231122/file-1700619408170.jpeg",
-				// 	bnum: 0,
-				// 	brief: "丽湖职教双创教育国际虚拟教研室为立足全国,辐射海外的国际化教研室,围绕创新创业教育的人才培养与课程建设开展深度研究。教研室以贯彻落实立德树人根本任务,通过加强跨专业、跨校、跨地域的教研交流,推动高校协同打造国际化的精品教学资源库、优秀教学案例库、优质教师培训资源库等,全面提高教师",
-				// 	cost: "5000",
-				// 	create_at: "2023.11.20 03:11",
-				// 	pers: "15",
-				// 	pic: "http://139.159.246.165:7006/uploads/20231120/file-1700466209242.png",
-				// 	type: "1",
-				// 	username: "袁一鸣",
-				// }]
+
+				// 触底
+				// SearchLoading: 0, //0默认值  1加载中 2没有更多了
+				// 搜索页数
+				Searchpage: 1,
+				
+				// 在搜索框有文字的时候下拉刷新禁止触发watch,防止数据叠加
+				bansearchData: false
 			};
 		},
-		// 模糊搜索
-		computed: {
-			filteredClassList() {
-				const filteredList = this.teclist.filter((item) =>
-					item.acName.includes(this.searchText)
-				);
-				return this.searchText ? filteredList : this.teclist;
-			},
-			filteredClassList2() {
-				const filterdList2 = this.pulist.filter((item) =>
-					item.acName.includes(this.searchText)
-				);
-				return this.searchText ? filterdList2 : this.pulist;
-			},
-		},
-		onUnload() {
-			this.$store.dispatch('asyncDelAll')
+
+		watch: {
+			searchText(val) {
+				// console.log(val);
+				if (this.bansearchData) return
+				if (val === '') {
+					
+					this.acLoading = 0 //0默认值  1加载中 2没有更多了
+					this.accurrentPage = 1 //页数
+					this.teclist = [] // 教研
+					this.getTecData()
+					
+					
+					this.puLoading = 0 //0默认值  1加载中 2没有更多了
+					this.pucurrentPage = 1
+					this.pulist = [] // 常规
+					
+					this.getpuData()
+					return
+				}
+				this.selectSearchdata()
+			}
 		},
+		// onUnload() {
+		// 	this.$store.dispatch('asyncDelAll')
+		// },
 		methods: {
-
+			// 搜索
+			selectSearchdata() {
+				if (this.current === 2) return
+				let type = null
+				if (this.current == 0) {
+					type = 2
+				} else if (this.current == 1) {
+					type = 1
+				}else{
+					return 
+				}
+				// console.log(111);
+				let data = {
+					openid: uni.getStorageSync('oId'),
+					txt: this.searchText,
+					ty: type,
+					// page: this.Searchpage,
+					// lim: 15
+				}
+				// return console.log(data);
+				this.$request('/selectSearchdata', "get", data).then(res => {
+					console.log('常规', res);
+					if (this.current == 0) {
+						this.pulist = res[0]
+					} else if (this.current == 1) {
+						this.teclist = res[0]
+					}
+					// if (!res[0].length) {
+					// 	this.puLoading = 2
+					// } else {
+					// 	this.puLoading = 0
+					// }
+					// this.pulist = [...this.pulist, ...res[0]]
+				})
+			},
+			// 专题教研下拉刷新
 			repulling() {
+				this.bansearchData = true
 				this.trigger = true
 				// this.isrepulling = true
 				setTimeout(() => {
@@ -161,46 +202,58 @@
 				this.acLoading = 0 //0默认值  1加载中 2没有更多了
 				this.accurrentPage = 1 //页数
 				this.teclist = [] // 教研
-
-				// this.puLoading= 0 //0默认值  1加载中 2没有更多了
-				// this.pucurrentPage=1
-				// this.pulist= []// 常规
+				
+				if (this.searchText !== '') {
+					this.puLoading = 0 //0默认值  1加载中 2没有更多了
+					this.pucurrentPage = 1
+					this.pulist = [] // 常规
+					this.getpuData()
+				}
+				this.searchText = ''
 
 				this.getTecData()
-				console.log(111);
+				// console.log(111);
 			},
+			// 常规教研下拉刷新
 			purepulling() {
+				this.bansearchData = true
 				this.putrigger = true
 				// this.isrepulling = true
 				setTimeout(() => {
 					this.putrigger = false;
 				}, 1000);
 
-				// this.acLoading= 0 //0默认值  1加载中 2没有更多了
-				// this.accurrentPage= 1 //页数
-				// this.teclist= []// 教研
-
 				this.puLoading = 0 //0默认值  1加载中 2没有更多了
 				this.pucurrentPage = 1
 				this.pulist = [] // 常规
+				if (this.searchText !== '') {
+					this.acLoading = 0 //0默认值  1加载中 2没有更多了
+					this.accurrentPage = 1 //页数
+					this.teclist = [] // 教研
+					this.getTecData()
+				}
+				this.searchText = ''
 
 				this.getpuData()
-				console.log(111);
+				// console.log(111);
 			},
-
+			// 专题教研触底
 			aclower() {
+				if (this.searchText !== '') return console.log('禁止触底');
 				console.log('没触底?');
 				if (this.acLoading == 2) return
 				this.acLoading = 1
 				this.accurrentPage++
 				setTimeout(this.getTecData, 1000)
 			},
+			// 常规教研触底
 			pulower() {
+				if (this.searchText !== '') return console.log('禁止触底');
 				console.log('没触底?');
 				if (this.puLoading == 2) return
 				this.puLoading = 1
 				this.pucurrentPage++
-				setTimeout(this.getpuData, 1000)
+				setTimeout(this.getpuData(), 1000)
 			},
 			// 获取专题
 			getTecData() {
@@ -219,18 +272,24 @@
 						this.acLoading = 0
 					}
 					this.teclist = [...this.teclist, ...res[0]]
+					this.bansearchData = false
 				})
+			},
+			secherData() {
+
 			},
 			// 获取常规
 			getpuData() {
 				let data = {
 					openid: uni.getStorageSync('oId'),
 					ty: 2,
+					// txt: (e ? e : ''),
 					page: this.pucurrentPage, //下拉获取更多的备用字段
 					lim: 15 //一次获取多少数据
 				}
+				// return console.log('获取常规', data);
 				this.$request('/selectActivity', "POST", data).then(res => {
-					// console.log('常规', res[0]);
+					console.log('常规', res[0]);
 					// this.pulist = res[0]
 					if (!res[0].length) {
 						this.puLoading = 2
@@ -238,12 +297,19 @@
 						this.puLoading = 0
 					}
 					this.pulist = [...this.pulist, ...res[0]]
+					this.bansearchData = false
 				})
 			},
 
 			// 区域滑动变换头部
 			swipeIndex(index) {
+				// console.log(111);
+
 				this.current = index.detail.current;
+				if (this.searchText !== '') {
+					this.selectSearchdata()
+				}
+				// this.selectSearchdata()
 				// this.$refs.listBlock1.getdata()
 			},
 
@@ -251,37 +317,21 @@
 			accountLogin() {
 				this.current = 0;
 			},
+			// 点击专题教研
 			phoneLogin() {
 				this.current = 1;
 			},
-
+			// 点击常规教研
 			costClass() {
 				this.current = 2;
 			}
 		},
 		onLoad() {
-
-
-			// 刷新
-			// 教研
-			// this.teclist = []
-			// // 常规
-			// this.pulist = []
-			// this.accurrentPage = 1
-			// this.pucurrentPage = 1
-
-			// console.log('刷新',this.teclis);
-
 			this.getpuData() //获取常规列表
 			this.getTecData() //获取专题列表
-
-			// 因为组件没有onshow
-			// 获取订阅事件
-			// this.$refs.listBlock1.getSub()
 		},
 		onShow() {
 
-
 			this.getAllMessage() // 调用app.js中的方法
 			// 获取收藏事件
 			this.$refs.listBlock1.getdata() //专题
@@ -295,6 +345,14 @@
 		width: 100%;
 	}
 
+	.searchPagedata {
+		width: 750rpx;
+		height: 40%;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+
 	.activityPageNew {
 		display: flex;
 		flex-direction: column;

+ 4 - 4
pages/index/index.vue

@@ -163,19 +163,19 @@
 		},
 		onLoad() {
 			// this.animation = uni.createAnimation()	
-
+			
 		},
 		onShow() {
 			// 清空推荐课程
 			// this.classList = []
-
+			console.log(this.$store.state.msgpop);
 			// 获取数据
 			this.getlistBlock1Data()
 
 			this.getAllMessage() // 调用app.js中的方法
 
-			// 因为组件没有onshow
-			// 获取收藏事件
+			// // 因为组件没有onshow
+			// // 获取收藏事件
 			this.$refs.listBlock1.getdata()
 
 		}

+ 3 - 3
pages/mineActive/mineActive.vue

@@ -31,9 +31,9 @@
 				currentPage: 1, //页数
 			};
 		},
-		onUnload() {
-			this.$store.dispatch('asyncDelAll')
-		},
+		// onUnload() {
+		// 	this.$store.dispatch('asyncDelAll')
+		// },
 		methods: {
 			gotoDetail(e) {
 				let data=e.currentTarget.dataset.all

+ 44 - 31
pages/mineCollNew/mineCollNew.vue

@@ -1,6 +1,9 @@
 <template>
 	<view class="mineCollNew">
 		<statusBar :item="navBarData"></statusBar>
+		<!-- 消息提示 -->
+
+		<msgPop></msgPop>
 		<view class="top">
 			<view class="left" @click="acpag" :class="current == 0 ? info1 : info2">
 				<text class="">活动</text>
@@ -22,14 +25,13 @@
 				<scroll-view scroll-y="true" @scrolltolower="lower" style="height: 100%;">
 					<view class="">
 						<view class="classListFlex" v-if="aclist.length==0">
-							
+
 						</view>
-						<view class="listBlock1" v-for="(i,index) in aclist" :key="index+'a'" @click="gotoDetail"
-							:data-aid="i.acId">
+						<view class="listBlock1" v-for="(i,index) in aclist" :key="index+'a'" @click.stop="gotoLink"
+							:data-link="i.link">
 							<view class="img cell-img">
 								<image :src="i.pic" mode="aspectFill"></image>
-								<image class="star" @click.stop="coll" :data-e="i"
-									:src="pic_coll2" mode=""></image>
+								<image class="star" @click.stop="coll" :data-e="i" :src="pic_coll2" mode=""></image>
 							</view>
 
 							<view class="right">
@@ -55,8 +57,8 @@
 									<view class="left">
 										<view class="add fz-font">已报名{{i.bnum}}人</view>
 									</view>
-									<view class="Oright" @click.stop="gotoLink" :data-link="i.link">
-										<view class="text">查看详情</view>
+									<view class="Oright" @click="gotoDetail" :data-aid="i.acId">
+										<view class="text">报名</view>
 										<view class="arrow">
 											<image
 												src="https://teacherapi.cocorobo.cn/teaching-file/static/mine/arrow-right-blue.png"
@@ -68,7 +70,7 @@
 							</view>
 						</view>
 					</view>
-					
+
 					<view class="loading">
 						<view v-if="newsLoading==1">数据加载中...</view>
 						<view v-if="newsLoading==2">没有更多了~~</view>
@@ -77,7 +79,7 @@
 			</swiper-item>
 
 			<swiper-item>
-				<scroll-view scroll-y="true"  @scrolltolower="cllower" style="height: 100%;">
+				<scroll-view scroll-y="true" @scrolltolower="cllower" style="height: 100%;">
 					<view class="classListFlex">
 						<view class="cont" @click="gotoWeb" v-for="(item, index) in classlist" :index="index"
 							:key="index" :data-kid="item.href">
@@ -143,7 +145,7 @@
 					page: this.currentPage, //下拉获取更多的备用字段
 					lim: 15 //一次获取多少数据
 				}
-				console.log('data',data);
+				console.log('data', data);
 				this.$request('/selectCollAcList', 'POST', data).then(res => {
 					console.log('获取活动数据', res);
 					if (!res[0].length) {
@@ -174,11 +176,11 @@
 						this.clLoading = 0
 					}
 
-					this.classlist = [...this.classlist,...res[0]]
+					this.classlist = [...this.classlist, ...res[0]]
 					// this.classlist = res[0]
 				})
 			},
-			
+
 			// 跳转活动详情页
 			gotoDetail(e) {
 				let aid = e.currentTarget.dataset.aid;
@@ -206,9 +208,14 @@
 					oid: this.$store.state.user.openid, //用户id
 					ty: 0
 				}
-
+				this.$store.dispatch('asyncUpdatemsg', {
+					collAoff: 0
+				})
 				this.$request('/deleteOperator', 'POST', data).then(res => {
-					console.log(res);
+					// console.log(res);
+					setTimeout(() => {
+						this.$store.dispatch('asyncDelMsg')
+					}, 1500)
 					this.aclist = this.aclist.filter(e => {
 						return e.acId != aId
 					})
@@ -227,9 +234,14 @@
 					oid: this.$store.state.user.openid, //用户id
 					ty: 1
 				}
-				
+				this.$store.dispatch('asyncUpdatemsg', {
+					collAoff: 0
+				})
 				this.$request('/deleteOperator', 'POST', data).then(res => {
-					console.log('取消课程收藏',res);
+					// console.log('取消课程收藏', res);
+					setTimeout(() => {
+						this.$store.dispatch('asyncDelMsg')
+					}, 1500)
 					this.classlist = this.classlist.filter(e => {
 						return e.cid != cId
 					})
@@ -256,7 +268,7 @@
 				setTimeout(this.getTeachData, 1000)
 			},
 			//跳转到第三方链接
-			gotoLink(e){
+			gotoLink(e) {
 				let link = e.currentTarget.dataset.link;
 				uni.navigateTo({
 					url: "/pages/skipone/skipone?url=" + encodeURIComponent(link),
@@ -274,25 +286,25 @@
 			},
 		},
 		onLoad(e) {
-			console.log('e',e);
-			if(Object.keys(e).length!=0){
-				this.current=e.ty*1
-				console.log(99999);
+			console.log('e', e);
+			if (Object.keys(e).length != 0) {
+				this.current = e.ty * 1
+				// console.log(99999);
 			}
 		},
 		onShow() {
-			this.aclist=[] //活动数据list
-			this.classlist= [] //课程数据list
-			
+			this.aclist = [] //活动数据list
+			this.classlist = [] //课程数据list
+
 			this.clcurrentPage = 1;
 			this.currentPage = 1;
-			
+
 			// 获取数据
 			this.getData()
 			this.getTeachData()
-			
-			
-		
+
+
+
 		}
 	}
 </script>
@@ -462,15 +474,15 @@
 					width: 500rpx;
 					justify-content: flex-start;
 					align-items: center;
-						
-					.titTxt{
+
+					.titTxt {
 						flex: 1;
 						font-weight: bold;
 						overflow: hidden;
 						text-overflow: ellipsis;
 						white-space: nowrap;
 					}
-	
+
 					text {
 						font-weight: bold;
 						overflow: hidden;
@@ -560,6 +572,7 @@
 				color: #00b2b6;
 				line-height: 32rpx;
 			}
+
 			.tag1 {
 				border: 1px rgba(0, 86, 168, 1) solid;
 				flex-shrink: 0;

+ 25 - 11
pages/msg/msg.vue

@@ -45,8 +45,9 @@
 										{{item.create_at}}
 									</view>
 								</view>
-								<view class="contxt">恭喜!您已成功完成<text
-										style="color: rgba(0, 86, 168, 1);">“{{item.acName}}”</text>活动报名。您的参与信息已经成功提交,您现在是我们活动的一部分,我们非常期待与您共度美好时光。
+								<view class="contxt">恭喜!您已成功完成<text style="color: rgba(0, 86, 168, 1);"
+										@click.stop="gotoDetail"
+										:data-link="item.link">“{{item.acName}}”</text>活动报名。您的参与信息已经成功提交,您现在是我们活动的一部分,我们非常期待与您共度美好时光。
 								</view>
 								<!-- <view class="contxt">
 									以下是一些额外信息,以确保您充分了解您的参与:
@@ -59,9 +60,11 @@
 									<view class="" style="width: 2em;text-align: center;">•</view>
 									<view class=""> 日期: [{{item.begin_at}}]</view>
 								</view> -->
-								<view class="contxt1" >
+								<view class="contxt1">
 									<view class="" style="width: 2em;flex-shrink: 1; text-align: center;">•</view>
-									<view class="uiTit"><view class="uiAcTit">时间:</view>   [{{item.begin_at}}]</view>
+									<view class="uiTit">
+										<view class="uiAcTit">时间:</view> [{{item.begin_at}}]
+									</view>
 								</view>
 								<!-- <view class="contxt1" >
 									<view class="" style="width: 2em;text-align: center;">•</view>
@@ -167,8 +170,6 @@
 
 				clcurrentPage: 1, //页数
 				syscurrentPage: 1, //页数
-
-
 			};
 		},
 		methods: {
@@ -241,7 +242,18 @@
 					})
 				}
 			},
-
+			gotoDetail(e) {
+				
+				let link = e.currentTarget.dataset.link;
+				uni.navigateTo({
+					url: "/pages/skipone/skipone?url=" + encodeURIComponent(link),
+				});
+				// let cid=e.currentTarget.dataset.link
+				// console.log(e.currentTarget.dataset.cid);
+				// uni.navigateTo({
+				// 	url: `/pages/activityDetailNew/activityDetailNew?acId=${cid}`
+				// })
+			},
 			// 消息通知触底
 			informlower() {
 				console.log('没触底?');
@@ -327,9 +339,9 @@
 		},
 		onShow() {
 			// 消息通知
-			this.Msglist= []
+			this.Msglist = []
 			//系统通知
-			this.syslist= []
+			this.syslist = []
 			this.getdata()
 			this.getdata2()
 			this.getMag()
@@ -485,9 +497,11 @@
 					margin-top: 10rpx;
 					line-height: 40rpx;
 					display: flex;
-					.uiTit{
+
+					.uiTit {
 						display: flex;
-						.uiAcTit{
+
+						.uiAcTit {
 							width: auto;
 							// width: 120rpx;
 							// flex-shrink: 0;

+ 102 - 49
pages/resource/resource.vue

@@ -4,8 +4,8 @@
 		<!-- 消息提示 -->
 		<msgPop :goNum='1'></msgPop>
 		<view class="search">
-			<uni-search-bar v-model="searchText" bgColor="#f0f2f5" class="btntop" placeholder="搜索" cancelButton="none"
-				clearButton="none"></uni-search-bar>
+			<uni-search-bar v-model.trim="searchText" bgColor="#f0f2f5" class="btntop" placeholder="搜索"
+				cancelButton="none" clearButton="none"></uni-search-bar>
 		</view>
 
 		<view class="top">
@@ -36,8 +36,9 @@
 			<swiper-item>
 				<scroll-view scroll-y="true" refresher-enabled='true' :refresher-triggered="trigger"
 					@refresherrefresh='repulling' @scrolltolower="relower" style="height: 100%;">
+					<view class="searchPagedata" v-if="!classList.length">暂无数据</view>
 					<view class="">
-						<teaching-case ref="reso" :acList='filteredClassList'></teaching-case>
+						<teaching-case ref="reso" :acList='classList'></teaching-case>
 					</view>
 					<view class="loading">
 						<view v-if="reLoading==1">数据加载中...</view>
@@ -49,8 +50,9 @@
 			<swiper-item>
 				<scroll-view scroll-y="true" refresher-enabled='true' :refresher-triggered="putrigger"
 					@refresherrefresh='purepulling' @scrolltolower="tealower" style="height: 100%;">
+					<view class="searchPagedata" v-if="!classList2.length">暂无数据</view>
 					<view class="">
-						<teaching-case ref="tech" :acList='filteredClassList2'></teaching-case>
+						<teaching-case ref="tech" :acList='classList2'></teaching-case>
 					</view>
 					<view class="loading">
 						<view v-if="teaLoading==1">数据加载中...</view>
@@ -79,8 +81,8 @@
 					title: "课程",
 					btn: 0,
 				},
-				
-				
+
+
 				indexId: 1,
 				current: 0, //页面切换
 				info1: "info1", //类名
@@ -105,30 +107,72 @@
 				// 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发
 				trigger: false, //专题
 				putrigger: false, //常规
-			};
-		},
-		// 模糊搜索
-		computed: {
-			filteredClassList() {
-				const filteredList = this.classList.filter((item) =>
-					item.ctit.includes(this.searchText)
-				);
-				return this.searchText ? filteredList : this.classList;
-			},
-			filteredClassList2() {
-				const filterdList2 = this.classList2.filter((item) =>
-					item.ctit.includes(this.searchText)
-				);
-				return this.searchText ? filterdList2 : this.classList2;
-			},
 
+				// 在搜索框有文字的时候下拉刷新禁止触发watch,防止数据叠加
+				bansearchData: false
+			};
 		},
-		onUnload() {
-			this.$store.dispatch('asyncDelAll')
+		watch: {
+			searchText(val) {
+				if (this.bansearchData) return
+				// console.log('巴尔纳广播in而哦啊办呢日内');
+				// console.log('searchText', val);
+				if (val === '') {
+					// 资源库
+					// if (this.current == 0) {
+					this.classList = []
+					this.reLoading = 0 //0默认值  1加载中 2没有更多了
+					this.recurrentPage = 1 //页数
+					this.getreList()
+					// console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
+					// }
+					// if (this.current == 1) {
+					this.classList2 = []
+					this.teaLoading = 0 //0默认值  1加载中 2没有更多了
+					this.teacurrentPage = 1
+					this.getteaList()
+					// }
+					// console.log(1111);
+					// 精品课程
+
+					return
+				}
+				// console.log(888888);
+				// if(val===''){
+				// 	this.pu
+				// }
+				this.selectSearchdata()
+			}
 		},
+
+		// onUnload() {
+		// 	this.$store.dispatch('asyncDelAll')
+		// },
 		methods: {
+			selectSearchdata() {
+
+				if (this.current === 2) return
+
+				let data = {
+					openid: uni.getStorageSync('oId'),
+					txt: this.searchText,
+					ty: this.current,
+					// page: this.Searchpage,
+					// lim: 15
+				}
+				// return console.log(data);
+				this.$request('/selectActSearch', "get", data).then(res => {
+					console.log('常规', res);
+					if (this.current == 0) {
+						this.classList = res[0]
+					} else if (this.current == 1) {
+						this.classList2 = res[0]
+					}
+				})
+			},
 			// 资源库下拉刷新
 			repulling() {
+				this.bansearchData = true
 				this.trigger = true
 				// this.isrepulling = true
 				setTimeout(() => {
@@ -139,13 +183,20 @@
 				this.classList = []
 				this.reLoading = 0 //0默认值  1加载中 2没有更多了
 				this.recurrentPage = 1 //页数
-
+				if (this.searchText !== '') {
+					this.classList2 = []
+					this.teaLoading = 0 //0默认值  1加载中 2没有更多了
+					this.teacurrentPage = 1
+					this.getteaList()
+				}
+				this.searchText = ''
 
 
 				this.getreList()
 			},
 			// 精品慕课下拉刷新
 			purepulling() {
+				this.bansearchData = true
 				this.putrigger = true
 				// this.isrepulling = true
 				setTimeout(() => {
@@ -156,9 +207,15 @@
 				this.classList2 = []
 				this.teaLoading = 0 //0默认值  1加载中 2没有更多了
 				this.teacurrentPage = 1
-
+				if (this.searchText !== '') {
+					this.classList = []
+					this.reLoading = 0 //0默认值  1加载中 2没有更多了
+					this.recurrentPage = 1 //页数
+					this.getreList()
+				}
+				this.searchText = ''
 				this.getteaList()
-				console.log(111);
+
 			},
 			// 获取资源库
 			getreList() {
@@ -176,6 +233,7 @@
 						this.reLoading = 0
 					}
 					this.classList = [...this.classList, ...res[0]]
+					this.bansearchData = false
 					// this.classList2 = res[1]
 				})
 			},
@@ -194,12 +252,16 @@
 					} else {
 						this.teaLoading = 0
 					}
+					// console.log('前',this.classList2);
 					this.classList2 = [...this.classList2, ...res[0]]
+					this.bansearchData = false
+					// console.log('后',this.classList2);
 					// this.classList2 = res[1]
 				})
 			},
 			// 资源库触底
 			relower() {
+				if (this.searchText !== '') return console.log('禁止触底');
 				console.log('没触底?');
 				if (this.reLoading == 2) return
 				this.reLoading = 1
@@ -208,6 +270,7 @@
 			},
 			// 精品慕课触底
 			tealower() {
+				if (this.searchText !== '') return console.log('禁止触底');
 				console.log('没触底?');
 				if (this.teaLoading == 2) return
 				this.teaLoading = 1
@@ -216,7 +279,11 @@
 			},
 
 			swipeIndex(index) {
+
 				this.current = index.detail.current;
+				if (this.searchText !== '') {
+					this.selectSearchdata()
+				}
 			},
 			// 区域滑动
 			phoneLogin() {
@@ -230,33 +297,11 @@
 			}
 		},
 		onLoad() {
-			// this.classList: []
-
-			// 精品课程
-			// this.classList2: []
-
-			// this.reLoading: 0 //0默认值  1加载中 2没有更多了
-			// this.recurrentPage: 1 //页数
-
-			// this.teaLoading: 0 //0默认值  1加载中 2没有更多了
-			// this.teacurrentPage: 1
 			this.getreList()
 			this.getteaList()
 
-
 		},
 		onShow() {
-			// 精品课程
-			// this.classList2= []
-			// this.teaLoading= 0 //0默认值  1加载中 2没有更多了
-			// this.teacurrentPage= 1
-
-			// 资源库
-			// this.classList= []
-			// this.reLoading= 0 //0默认值  1加载中 2没有更多了
-			// this.recurrentPage= 1 //页数
-
-
 
 			this.getAllMessage() // 调用app.js中的方法
 			// 获取收藏
@@ -271,6 +316,14 @@
 		width: 100%;
 	}
 
+	.searchPagedata {
+		width: 750rpx;
+		height: 40%;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+
 	.resource {
 		display: flex;
 		flex-direction: column;

+ 14 - 11
store/index.js

@@ -41,19 +41,22 @@ const store = new Vuex.Store({
 			state.user.nc = data;
 		},
 		// 添加消息提示
-		updatemsg(state,msg) {
+		updatemsg(state, msg) {
 			// console.log('data:',msg);
 			state.msgpop.push(msg);
 			// state.msgpop.splice(0,1,msg);
 		},
 		// 删除消息提示
 		delMsg(state, data) {
+			// setTimeout(() => {
+			// 	console.log('删除了');
+			// }, 2000)
 			state.msgpop.shift();
 		},
 		delAll(state, data) {
-			state.msgpop=[];
+			state.msgpop = [];
 		},
-		
+
 		// 保存发布内容
 		// saveformData(state, formData) {
 		// 	state.formData = formData;
@@ -66,21 +69,21 @@ const store = new Vuex.Store({
 	state: {
 		//公共的变量,存储数据,这里的变量不能随便修改,只能通过触发mutations的方法才能改变
 		user: {
-			
+
 			openid: '',
 			avatar: '', //头像
 			username: '', //用户名
-			sex:'', //用户性别
-			school:'',//学校
-			spe:'',//专业
-			rankl:'',//职称
+			sex: '', //用户性别
+			school: '', //学校
+			spe: '', //专业
+			rankl: '', //职称
 			brief: '', //用户简介
-			tel: "",//联系方式
+			tel: "", //联系方式
 		},
-		msgpop:[]
+		msgpop: []
 		// 聊天记录
 		// message: [],
-		
+
 		// formData: {}
 	},
 	getters: {