yuanyiming 1 year ago
parent
commit
35d47ada35

+ 5 - 4
App.vue

@@ -4,6 +4,7 @@
 </style>
 <script>
 	import Vue from 'vue'
+	// import msgPop from './components/msgPop/msgPop.vue'
 	// import app from './utils/api.js'
 	export default {
 		onLaunch() {
@@ -100,6 +101,9 @@
 		},
 		onShow() {
 
+		},
+		onLoad() {
+			// this.animation = uni.createAnimation()
 		},
 		methods: {
 			// 获取未读信息
@@ -123,10 +127,7 @@
 					}
 				})
 			}
-
-		},
-		onLoad() {
-
+		
 		}
 	}
 </script>

+ 67 - 16
components/listBlock1/listBlock1.vue

@@ -1,10 +1,15 @@
 <template>
 	<view class="">
-		<view class="listBlock1" v-for="(i,index) in classList" :key="index+'a'" @click="gotoDetail" :data-aid="i.acId">
+
+		<msgPop :itemlist="animationDataArr"></msgPop>
+		<view class="listBlock1" v-for="(i,index) in classList" :key="index" @click="gotoDetail" :data-aid="i.acId">
 			<view class="img cell-img">
 				<image :src="i.pic" mode="aspectFill"></image>
+
 				<image class="star" @click.stop="coll" :data-e="i"
 					:src="collArr.includes(i.acId) ? pic_coll2 : pic_coll " mode="aspectFill"></image>
+
+
 			</view>
 
 			<view class="right">
@@ -70,6 +75,16 @@
 			return {
 				// 收藏list
 				collArr: [],
+
+
+				timer: null,
+				animationDataArr: [],
+
+				// 收藏悬浮窗
+				collpopulShow: false,
+
+				// 决定悬浮窗显示哪些内容0 取消 1收藏
+				collAoff: 0,
 				// subArr: [],
 				pic_coll: 'https://teacherapi.cocorobo.cn/teaching-file/static/Stara.png',
 				pic_coll2: 'https://teacherapi.cocorobo.cn/teaching-file/static/mine/Collect_yellow.png',
@@ -77,17 +92,24 @@
 				// pic_sub2: '../../static/mine/dingyue_blue.png'
 			};
 		},
+		onShow() {},
 
+		onUnload() {
+			this.timer.clear()
+		},
 		methods: {
 			// 收藏事件
 			coll(event) {
 				const value = this.$store.state.user.openid;
-				if(!value){
-					uni.showToast({title: '未登录,请登录',icon: 'none'})
-					setTimeout(this.goLog,1000)
+				if (!value) {
+					uni.showToast({
+						title: '未登录,请登录',
+						icon: 'none'
+					})
+					setTimeout(this.goLog, 1000)
 					return
 				}
-				
+
 				// return	console.log(event);
 				let aId = event.currentTarget.dataset.e.acId
 
@@ -108,29 +130,47 @@
 
 					// iscoll为true表示已经收藏过,执行删除  为true则收藏
 					if (iscoll) {
+						this.animationDataArr.push({
+							collAoff: 0
+						})
+						// this.praiseMe()
 						console.log('执行删除');
 						this.$request('/deleteOperator', 'POST', data).then(res => {
 							this.getdata()
+							setTimeout(() => {
+								this.animationDataArr.shift()
+								console.log(this.animationDataArr);
+							}, 1500)
 						})
 					} else {
+
+						this.animationDataArr.push({
+							collAoff: 1
+						})
 						console.log('执行添加');
 						this.$request('/insertOperator', 'POST', data).then(res => {
 							this.getdata()
+							setTimeout(() => {
+								this.animationDataArr.shift()
+								// console.log(this.animationDataArr);
+							}, 1500)
 						})
 					}
 				})
 			},
 
-
 			// 跳转到详情页
 			gotoDetail(e) {
 				const value = this.$store.state.user.openid;
-				if(!value){
-					uni.showToast({title: '未登录,请登录',icon: 'none'})
-					setTimeout(this.goLog,1000)
+				if (!value) {
+					uni.showToast({
+						title: '未登录,请登录',
+						icon: 'none'
+					})
+					setTimeout(this.goLog, 1000)
 					return
 				}
-				
+
 				let aid = e.currentTarget.dataset.aid;
 				uni.navigateTo({
 					url: `/pages/activityDetailNew/activityDetailNew?acId=${aid}`
@@ -140,12 +180,15 @@
 			//跳转到第三方链接
 			gotoLink(e) {
 				const value = this.$store.state.user.openid;
-				if(!value){
-					uni.showToast({title: '未登录,请登录',icon: 'none'})
-					setTimeout(this.goLog,1000)
+				if (!value) {
+					uni.showToast({
+						title: '未登录,请登录',
+						icon: 'none'
+					})
+					setTimeout(this.goLog, 1000)
 					return
 				}
-				
+
 				let link = e.currentTarget.dataset.link;
 				uni.navigateTo({
 					url: "/pages/skipone/skipone?url=" + encodeURIComponent(link),
@@ -154,9 +197,17 @@
 
 			// 获取收藏事件
 			getdata() {
+				console.log(111);
+				// this.timer=setInterval(() => {
+				// 	if(this.animationDataArr.length>0){
+				// 		console.log(this.animationDataArr.length);
+				// 		this.animationDataArr.unshift()
+				// 	}
+				// }, 1500)
+
 				const value = this.$store.state.user.openid;
-				if(!value) return this.collArr = []
-				
+				if (!value) return this.collArr = []
+
 				// 触发收藏事件
 				console.log('触发收藏事件');
 				// this.collArr: [],

+ 98 - 0
components/msgPop/msgPop.vue

@@ -0,0 +1,98 @@
+<template>
+	<view class="">
+			<view class="collpopul" @tap.stop v-for="(i,index) in itemlist" :key="index">
+				<view class="contxt">
+					<image src="../../static/mine/Collect_yellow.png" mode="aspectFill" style="width: 30rpx;height: 30rpx;">
+					</image>
+					{{i.collAoff?'收藏成功':'已取消'}}
+					<!-- 收藏成功 -->
+				</view>
+				<!-- <view class="goMore" @click="goMore"> -->
+				<view class="goMore" @click="goMore" v-if="i.collAoff">
+					<view class="">
+						去看看
+					</view>
+					<view class="" style="display: flex;height: 100%;justify-content: center;align-items: center;">
+						<image src="../../static/yyyou.png" mode="aspectFill" style="width: 30rpx;height: 32rpx;">
+						</image>
+					</view>
+					
+				</view>
+			</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: "msgPop",
+		props: {
+			itemlist: {
+				type: Array,
+				default () {
+					return []
+				}
+			},
+			goNum:{
+				type:Number,
+				default(){
+					return 0
+				}
+			}
+		},
+		data(){
+			return{
+			}
+		},
+		methods: {
+			// 跳转收藏页面
+			goMore() {
+				uni.navigateTo({
+					url: `/pages/mineCollNew/mineCollNew?ty=${this.goNum}`
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	
+	.collpopul {
+		position: fixed;
+		padding: 0 30rpx;
+		background-color: #fff;
+		top: 15%;
+		// bottom: 10%;
+		z-index: 100;
+		width: 650rpx;
+		height: 90rpx;
+		left: 50%;
+		transform: translate(-50%, 0);
+		border-radius: 30rpx;
+		display: flex;
+		align-items: center;
+
+		.contxt {
+			flex: 1;
+			font-weight: 580;
+			font-size: 30rpx;
+			display: flex;
+			align-items: center;
+
+			image {
+				padding-right: 10rpx;
+			}
+		}
+
+		.goMore {
+			// width: 120rpx;
+			display: flex;
+			// height: 35rpx;
+			height: 100%;
+			line-height: 30rpx;
+			align-items: center;
+			color: #F44265;
+			font-size: 30rpx;
+			font-weight: bold;
+		}
+	}
+</style>

+ 19 - 0
components/teaching-case/teaching-case.vue

@@ -1,5 +1,7 @@
 <template>
 	<view class="teaching_case">
+		<msgPop :itemlist="animationDataArr" :goNum="1"></msgPop>
+		
 		<view class="cont" @click="gotoWeb" v-for="(item, index) in acList" :key="index"
 			:data-kid="item.href">
 			<image class="star" :src="collArr.includes(item.cid) ? pic_coll2 : pic_coll " @click.stop="coll" :data-e="item"
@@ -34,6 +36,9 @@
 			return {
 				// 收藏列表
 				collArr: [],
+				
+				timer: null,
+				animationDataArr: [],
 				// 收藏星星
 				pic_coll: 'https://teacherapi.cocorobo.cn/teaching-file/static/Stara.png',
 				pic_coll2: 'https://teacherapi.cocorobo.cn/teaching-file/static/mine/Collect_yellow.png',
@@ -70,13 +75,27 @@
 					// iscoll为true表示已经收藏过,执行删除  为true则收藏
 					if (iscoll) {
 						console.log('执行删除');
+						this.animationDataArr.push({
+							collAoff: 0
+						})
 						this.$request('/deleteOperator', 'POST', data).then(res => {
 							this.getdata()
+							setTimeout(()=>{
+								this.animationDataArr.shift()
+								console.log(this.animationDataArr);
+							},1500)
 						})
 					} else {
 						console.log('执行添加');
+						this.animationDataArr.push({
+							collAoff: 1
+						})
 						this.$request('/insertOperator', 'POST', data).then(res => {
 							this.getdata()
+							setTimeout(()=>{
+								this.animationDataArr.shift()
+								// console.log(this.animationDataArr);
+							},1500)
 						})
 					}
 				})

+ 5 - 0
main.js

@@ -16,6 +16,11 @@ Vue.prototype.$store = store
 import uView from "uview-ui";
 Vue.use(uView);
 
+// 自定义全局组件
+// import msgPop from './components/msgPop.vue'
+// Vue.component("msgPop",msgPop)
+
+
 App.mpType = 'app'
 const app = new Vue({
 	store,

+ 11 - 2
manifest.json

@@ -17,7 +17,9 @@
             "delay" : 0
         },
         /* 模块配置 */
-        "modules" : {},
+        "modules" : {
+            "Share" : {}
+        },
         /* 应用发布信息 */
         "distribute" : {
             /* android打包配置 */
@@ -43,7 +45,14 @@
             /* ios打包配置 */
             "ios" : {},
             /* SDK配置 */
-            "sdkConfigs" : {}
+            "sdkConfigs" : {
+                "share" : {
+                    "weixin" : {
+                        "appid" : "wx1260af162664fd04",
+                        "UniversalLinks" : ""
+                    }
+                }
+            }
         }
     },
     /* 快应用特有相关 */

+ 54 - 22
pages/activityDetailNew/activityDetailNew.vue

@@ -36,9 +36,9 @@
 			<view class="acinfo">
 				<view class="acinfoAddress">
 					<view class="acinfoTit">
-						<text>时</text> 
+						<text>时</text>
 						<text>间</text>
-					</view>: 
+					</view>:
 					<text class="inf">{{actItemList.begin_at}}</text>
 				</view>
 				<!-- <view class="acinfoAddress">
@@ -61,7 +61,7 @@
 					活动介绍
 				</view>
 				<view class="bricon">
-					{{actItemList.brief}}
+					{{actItemList.brief}}<text style="color: blue;" @click="gotoLink" :data-link="actItemList.link">查看详情</text>
 				</view>
 				<image class="briImg" :src="actItemList.pic" mode="widthFix"></image>
 			</view>
@@ -78,11 +78,13 @@
 					</view>
 					<text class="icotxt">收藏</text>
 				</view>
-				<view class="ico" @click="share">
+				<!-- <view class="ico" style="position: relative;" @click="share"> -->
+				<view class="ico" style="position: relative;">
 					<view class="imgBlock">
 						<image class="icoimg" style="height: 70%;width: 65%;" src="../../static/union.png"
 							mode="aspectFill"></image>
 					</view>
+					<button open-type="share" style="background-color: aquamarine;opacity: 0; position: absolute;left: 0;width: 100%;height: 100%;"></button>
 					<text class="icotxt">分享</text>
 				</view>
 			</view>
@@ -153,7 +155,39 @@
 				// pic_sub2: 'https://teacherapi.cocorobo.cn/teaching-file/static/dingyue_blue.png',
 			};
 		},
+		onShareAppMessage(){
+			uni.share({
+				provider: "weixin",
+				scene: "WXSceneSession",
+				type: 1,
+				summary: "我正在使用HBuilderX开发uni-app,赶紧跟我一起来体验!",
+				success: function(res) {
+					console.log("success:" + JSON.stringify(res));
+				},
+				fail: function(err) {
+					console.log("fail:" + JSON.stringify(err));
+				}
+			});
+		},
 		methods: {
+			//跳转到第三方链接
+			gotoLink(e) {
+				
+				let link = e.currentTarget.dataset.link;
+				uni.navigateTo({
+					url: "/pages/skipone/skipone?url=" + encodeURIComponent(link),
+				});
+			},
+			share() {
+			
+				// onShareAppMessage() {
+				uni.showToast({
+					title: '暂未开发,还不能分享哦',
+					icon: 'none'
+				})
+				
+				
+			},
 			// 获取页面数据
 			getdata() {
 				let data = {
@@ -161,7 +195,7 @@
 					acId: this.acId,
 				}
 				this.$request('/selectActivityID', "POST", data).then(res => {
-					// console.log('页面数据', res[0][0]);
+					console.log('页面数据', res[0][0]);
 					this.actItemList = res[0][0]
 				})
 
@@ -182,7 +216,7 @@
 					acid: this.acId
 				}).then(res => {
 					let c = res[0][0]
-					console.log('报名人数',res[0][0]);
+					console.log('报名人数', res[0][0]);
 					console.log(c.bnum >= c.pers * 1);
 					if (c.bnum >= c.pers * 1) {
 						return uni.showToast({
@@ -196,13 +230,13 @@
 							ty: 2,
 						}
 						this.$request('/insertSignup', "POST", data).then(res => {
-				
-							console.log('报名返回',res);
-							
+
+							console.log('报名返回', res);
+
 							// 添加消息页面系统通知提示报名成功
 							this.addMessage()
-				
-				
+
+
 							// 弹窗关闭
 							this.showPopup = false
 							uni.reLaunch({
@@ -211,7 +245,7 @@
 						})
 					}
 				})
-				
+
 			},
 			// 添加消息页面系统通知提示报名成功
 			addMessage() {
@@ -221,7 +255,7 @@
 					type: 0,
 				}
 				this.$request('/insertMessage', "POST", data).then(res => {
-					console.log('添加消息页面系统通知提示报名成功',res);
+					console.log('添加消息页面系统通知提示报名成功', res);
 				})
 			},
 			// 查看更多报名同学
@@ -230,12 +264,7 @@
 					url: `/pages/dy/dy?acId=${this.acId}`
 				})
 			},
-			share() {
-				uni.showToast({
-					title: '暂未开发,还不能分享哦',
-					icon: 'none'
-				})
-			},
+			
 
 			//获取是否报名
 			btnEnroll() {
@@ -435,14 +464,17 @@
 					// padding: 20rpx 0;
 					display: flex;
 					padding-bottom: 20rpx;
-					.acinfoTit{
+
+					.acinfoTit {
 						width: 150rpx;
 						display: flex;
 						justify-content: space-between;
+
 						// text-align: justify;
-						.justified-text{
+						.justified-text {
 							text-align: justify;
-							text-justify: inter-word; /* 兼容性写法,用于处理中英文混排时的对齐效果 */
+							text-justify: inter-word;
+							/* 兼容性写法,用于处理中英文混排时的对齐效果 */
 						}
 					}
 				}

+ 24 - 24
pages/activityPageNew/activityPageNew.vue

@@ -1,14 +1,14 @@
 <template>
 	<view class="activityPageNew">
 		<statusBar :item="navBarData"></statusBar>
-
+	
 		<view class="search">
 			<uni-search-bar v-model="searchText" bgColor="#f0f2f5" class="btntop" placeholder="搜索" cancelButton="none"
 				clearButton="none"></uni-search-bar>
 		</view>
 
 		<view class="top">
-			
+
 			<view class="right" @click="accountLogin" :class="current == 0 ? info1 : info2">
 				<text class="">常规教研</text>
 				<view v-if="current == 0" class="yun">
@@ -16,7 +16,7 @@
 						mode="aspectFill"></image>
 				</view>
 			</view>
-			
+
 			<view class="left" @click="phoneLogin" :class="current == 1 ? info1 : info2">
 				<text class="">专题教研</text>
 				<view v-if="current == 1" class="yun">
@@ -24,7 +24,7 @@
 						mode="aspectFill"></image>
 				</view>
 			</view>
-			
+
 			<view class="right" @click="costClass" :class="current == 2 ? info1 : info2">
 				<text class="">付费教研</text>
 				<view v-if="current == 2" class="yun">
@@ -35,7 +35,7 @@
 		</view>
 
 		<swiper class="scroll-view-height" @change="swipeIndex" :current="current" :duration="300">
-			
+
 			<!-- 常规教研 -->
 			<swiper-item>
 				<scroll-view scroll-y="true" refresher-enabled='true' :refresher-triggered="putrigger"
@@ -49,8 +49,8 @@
 					</view>
 				</scroll-view>
 			</swiper-item>
-			
-			
+
+
 			<!-- 专题教研 -->
 			<swiper-item>
 				<scroll-view scroll-y="true" refresher-enabled='true' :refresher-triggered="trigger"
@@ -66,7 +66,7 @@
 
 			</swiper-item>
 
-			
+
 			<!-- 付费教研 -->
 			<swiper-item>
 				<scroll-view scroll-y="true" style="height: 100%;">
@@ -113,7 +113,6 @@
 				// 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发
 				trigger: false, //专题
 				putrigger: false, //常规
-				
 				// 付费
 				// monlist: [{
 				// 	acId: "92e11d93-8778-11ee-b98c-005056b86db5",
@@ -147,43 +146,44 @@
 			},
 		},
 		methods: {
+			
 			repulling() {
 				this.trigger = true
 				// this.isrepulling = true
 				setTimeout(() => {
 					this.trigger = false;
 				}, 1000);
-				
-				this.acLoading= 0 //0默认值  1加载中 2没有更多了
-				this.accurrentPage= 1 //页数
-				this.teclist= []// 教研
-				
+
+				this.acLoading = 0 //0默认值  1加载中 2没有更多了
+				this.accurrentPage = 1 //页数
+				this.teclist = [] // 教研
+
 				// this.puLoading= 0 //0默认值  1加载中 2没有更多了
 				// this.pucurrentPage=1
 				// this.pulist= []// 常规
-				
+
 				this.getTecData()
 				console.log(111);
 			},
-			purepulling(){
+			purepulling() {
 				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= []// 常规
-				
+
+				this.puLoading = 0 //0默认值  1加载中 2没有更多了
+				this.pucurrentPage = 1
+				this.pulist = [] // 常规
+
 				this.getpuData()
 				console.log(111);
 			},
-			
+
 			aclower() {
 				console.log('没触底?');
 				if (this.acLoading == 2) return
@@ -250,7 +250,7 @@
 			phoneLogin() {
 				this.current = 1;
 			},
-			
+
 			costClass() {
 				this.current = 2;
 			}

+ 5 - 0
pages/index/index.vue

@@ -1,6 +1,8 @@
 <template>
 	<view class="content">
 		<statusBar :item="navBarData"></statusBar>
+		
+		
 		<view class="top">
 			<image src="https://teacherapi.cocorobo.cn/teaching-file/static/yym/Rectangle25.png" mode="aspectFill"
 				@click="gotoHome">
@@ -150,6 +152,9 @@
 			},
 
 		},
+		onLoad() {
+					// this.animation = uni.createAnimation()	
+		},
 		onShow() {
 		
 			this.classList=[]

+ 2 - 1
pages/mine/mine.vue

@@ -1,6 +1,7 @@
 <template>
 	<view>
 		<statusBar :item="navBarData"></statusBar>
+		
 		<view class="mineBox">
 			<view class="userInformation" >
 				<view class="userAvatar" @click="gotoMineEdit">
@@ -128,7 +129,7 @@
 				</view>
 			</view>
 		</view>
-
+		
 	</view>
 </template>
 

+ 6 - 2
pages/mineCollNew/mineCollNew.vue

@@ -274,8 +274,12 @@
 				this.current = 1;
 			},
 		},
-		onLoad() {
-			
+		onLoad(e) {
+			console.log('e',e);
+			if(Object.keys(e).length!=0){
+				this.current=e.ty*1
+				console.log(99999);
+			}
 		},
 		onShow() {
 			this.aclist=[] //活动数据list

+ 28 - 12
pages/msg/msg.vue

@@ -51,23 +51,26 @@
 								<view class="contxt">
 									以下是一些额外信息,以确保您充分了解您的参与:
 								</view>
-								<view class="contxt1" style="display: flex;">
+								<!-- <view class="contxt1">
 									<view class="" style="width: 2em;text-align: center;">•</view>
-									<view class=""> 活动名称: [{{item.acName}}]</view>
-								</view>
-								<view class="contxt1" style="display: flex;">
+									<view class="uiTit"> <view class="uiAcTit">活动名称:</view> [{{item.acName}}]</view>
+								</view> -->
+								<!-- <view class="contxt1" style="display: flex;">
 									<view class="" style="width: 2em;text-align: center;">•</view>
-									<view class=""> 日期: [×××]</view>
+									<view class=""> 日期: [{{item.begin_at}}]</view>
+								</view> -->
+								<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>
-								<view class="contxt1" style="display: flex;">
+								<!-- <view class="contxt1" >
 									<view class="" style="width: 2em;text-align: center;">•</view>
-									<!-- <view class=""> 时间: [{{item.begin_at}}]</view> -->
-									<view class=""> 时间: [×××]</view>
+									<view class="uiTit"> <view class="uiAcTit">地点:</view>  [{{item.address}}]</view>
 								</view>
-								<view class="contxt1" style="display: flex;">
+								<view class="contxt1" >
 									<view class="" style="width: 2em;text-align: center;">•</view>
-									<view class=""> 地点: [{{item.address}}]</view>
-								</view>
+									<view class="uiTit"> <view class="uiAcTit">活动形式:</view> [{{item.acshape}}]</view>
+								</view> -->
 							</view>
 
 							<view class="msgBlock" v-if="item.type==1" @click="readOneMsg" :data-id="item">
@@ -295,9 +298,10 @@
 					// 未读提示红点重置为0,在后面赋值
 					this.msgn = 0
 					this.msgn2 = 0
-
+					// 获取全部未读信息
 					let arr = res[0]
 					if (arr.length != 0) {
+						// 遍历未读信息,展示信息切换栏右上红点信息
 						arr.forEach(e => {
 							if (e.type == 0) {
 								this.msgn = res[0][0].msg
@@ -310,6 +314,7 @@
 					}
 				})
 			},
+			// 切换消息页面
 			puMsg() {
 				this.current = 0;
 			},
@@ -321,7 +326,9 @@
 			},
 		},
 		onShow() {
+			// 消息通知
 			this.Msglist= []
+			//系统通知
 			this.syslist= []
 			this.getdata()
 			this.getdata2()
@@ -476,6 +483,15 @@
 					color: rgba(0, 0, 0, 0.6);
 					font-size: 28rpx;
 					line-height: 40rpx;
+					display: flex;
+					.uiTit{
+						display: flex;
+						.uiAcTit{
+							width: auto;
+							// width: 120rpx;
+							// flex-shrink: 0;
+						}
+					}
 				}
 			}
 

BIN
static/yyyou.png