浏览代码

新增天降宝箱

XSLu08042 5 天之前
父节点
当前提交
4538bd41ec
共有 6 个文件被更改,包括 658 次插入21 次删除
  1. 18 0
      api/course.js
  2. 1 1
      pages/user/index.vue
  3. 281 0
      pages_course/components/appPopup.vue
  4. 275 0
      pages_course/components/treasureChest.vue
  5. 82 19
      pages_course/video.vue
  6. 1 1
      pages_course/videoOld.vue

+ 18 - 0
api/course.js

@@ -106,4 +106,22 @@ export function getWxConfig(data) {
  }
  export function getConfigByKey(data, type) {
  	return request('/app/common/getConfigByKey',data,'GET','','https://h5api.his.cdwjyyh.com');
+ }
+ 
+ // 获取积分礼品
+ export function getCourseIntegralGoods(data,type) {
+ 	return request('/app/course/getCourseIntegralGoods', null, 'GET','','https://h5api.his.cdwjyyh.com');
+ }
+ export function claim(data, type) {
+  	return request('/app/course/rewardRound/claim', data, 'POST','application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
+  }
+  export function isClaim(data, type) {
+  	return request('/app/course/rewardRound/isClaim', data, 'POST','application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
+ }
+ 
+ export function getVideoRewardTypes(data, type) {
+  	return request('/app/course/getVideoRewardTypes', data, 'POST','application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
+ }
+ export function getVideoRewardRules(data, type) {
+  	return request('/app/course/getVideoRewardRules', data, 'POST','application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
  }

+ 1 - 1
pages/user/index.vue

@@ -170,7 +170,7 @@
 				</view>
  
 				<view class="tip"  >
-					<view class="title">技术支持 重庆云联融智科技有限公司 </view>
+					<!-- <view class="title">技术支持 重庆云联融智科技有限公司 </view> -->
 					<!-- <view class="tel">联系电话 18696558100 </view> -->
 				</view>
 			</view>

+ 281 - 0
pages_course/components/appPopup.vue

@@ -0,0 +1,281 @@
+<template>
+	<!-- 礼品弹窗 -->
+	<uni-popup ref="appPopup" type="center" :is-mask-click="false">
+		<view class="appPopup-mask">
+			<image class="tipimg" src="https://cos.his.cdwjyyh.com/fs/20250909/d5736027b6ac4255bfa2415cf400969c.png"></image>
+			<image class="close_icon" src="https://cos.his.cdwjyyh.com/fs/20250909/c8a5a9f34e5a4bd786f9fd2a380508dd.png" mode="aspectFill" @click="closePop"></image>
+			<view class="appPopup-box">
+				<view class="appPopup-title">恭喜你,<text style="color: #FF5C03;">回答正确</text></view>
+				<view>百种好礼等你兑换</view>
+				<view class="goodslist">
+					<view class="goodsitem" v-for="(item,index) in products" :key="index" @click="handleItem(item,index)">
+						<image class="bg" src="https://cos.his.cdwjyyh.com/fs/20250909/13630e9a4a054fa487e5c50b7d5ab1d2.png" mode="widthFix"></image>
+						<image class="img" :src="item.imageUrl" mode="aspectFill"></image>
+						<view class="goodsitem-name ellipsis">{{item.productName}}</view>
+						<view class="goodsitem-integral">
+							<text class="goodsitem-integral-num">{{item.requiredPoints}}</text>
+							<text>芳华币</text>
+						</view>
+						<view class="goodsitem-price">原价{{item.otPrice&&item.otPrice.toFixed(2)}}元</view>
+					</view>
+				</view>
+				<view class="changebtn" @click="getInfo">换一批</view>
+				<view class="progress">
+					<text>奖品兑换进度</text><text class="num">{{goodsInfo.exchangeProgress || 0}}%</text>
+					<progress style="margin-top: 30rpx;" active-color="#FAA97F" backgroundColor="#F5F7FA" border-radius="12" :percent="goodsInfo.exchangeProgress" stroke-width="12"></progress>
+				</view>
+				<view class="my-integral">我的芳华币:<text>{{goodsInfo.currentPoints || 0}}</text> </view>
+				<view class="appPopup-btn" @click="navTo">去兑换</view>
+				<!-- <view class="appPopup-tips">放弃芳华币,领取红包></view> -->
+			</view>
+		</view>
+	</uni-popup>
+</template>
+
+<script>
+	import { getCourseIntegralGoods } from "@/api/course.js"
+	export default {
+		data() {
+			return {
+				goodsInfo: {},
+				products:  []
+			}
+		},
+		methods: {
+			openPop() {
+				this.$refs.appPopup.open("center")
+				this.getInfo()
+			},
+			closePop() {
+				this.$refs.appPopup.close()	
+			},
+			navTo() {
+				uni.navigateToMiniProgram({
+				  appId: 'wxc3f0a952b7bc2b94',
+				  path: '/pages_user/integralGoodsList',
+				  success(res) {
+				    this.$refs.appPopup.close()
+				  }
+				})
+				// this.postMessage({
+				// 	isFullscreen: false,
+				// 	login: 1,
+				// 	productId: '',
+				// 	pagesUrl:'/pages/user/integral/integralGoodsList'
+				// })
+			},
+			//app礼品列表
+			getInfo() {
+				uni.showLoading({
+					title: '加载中'
+				})
+				getCourseIntegralGoods().then(res=>{
+					uni.hideLoading()
+					if(res.code == 200) {
+						this.goodsInfo = res.data
+						this.products = res.data && res.data.products? res.data.products:[]
+					} else {
+						uni.showToast({
+							title: res.msg,
+							icon: 'none'
+						})
+					}
+				}).catch(()=>{
+					uni.hideLoading()
+				})
+			},
+			postMessage(data) {
+				this.uniReady(() => {
+					uni.webView.postMessage({
+					    data: data
+					});  
+				})	
+			},
+			uniReady(callback) {
+			  if (uni.webView) {
+				callback()
+			  } else {
+				document.addEventListener('UniAppJSBridgeReady', callback, { once: true })
+			  }
+			},
+			handleItem(item,index) {
+				uni.navigateToMiniProgram({
+				  appId: 'wxc3f0a952b7bc2b94',
+				  path: '/pages_user/integralGoodsDetails?goodsId='+item.productId,
+				  success(res) {
+					this.$refs.appPopup.close()
+				  }
+				})
+				// this.postMessage({
+				// 	isFullscreen: false,
+				// 	login: 1,
+				// 	productId: item.productId,
+				// 	pagesUrl:''
+				// })
+			}
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	@mixin u-flex($flexD, $alignI, $justifyC) {
+		display: flex;
+		flex-direction: $flexD;
+		align-items: $alignI;
+		justify-content: $justifyC;
+	}
+	.num {
+		margin-left: 12rpx;
+		font-family: DINPro, DINPro;
+		font-size: 40rpx;
+	}
+	.appPopup-mask {
+		margin-top: -88rpx;
+		width: 670rpx;
+		@include u-flex(column, center, center);
+		.tipimg {
+			height: 206rpx;
+			width: 206rpx;
+			z-index: 99;
+		}
+		.close_icon {
+			height: 48rpx;
+			width: 48rpx;
+			position: absolute;
+			top: 34rpx;
+			right: 20rpx;
+		}
+		.appPopup-box {
+			width: 670rpx;
+			padding-bottom: 32rpx;
+			background: linear-gradient( 180deg, #FFEBBD 0%, #FFFFFF 9%, #FFFFFF 100%);
+			border-radius: 32rpx 32rpx 32rpx 32rpx;
+			overflow: hidden;
+			margin-top: -103rpx;
+			padding-top: 103rpx;
+			box-sizing: border-box;
+			font-family: PingFang SC;
+			font-weight: 400;
+			font-size: 28rpx;
+			color: #757575;
+			text-align: center;
+		}
+		.appPopup-title {
+			margin-bottom: 10rpx;
+			font-family: PingFang SC;
+			font-weight: 600;
+			font-size: 40rpx;
+			color: #222222;
+		}
+	}
+	.goodslist {
+		margin-top: 58rpx;
+		padding: 24rpx 10rpx;
+		@include u-flex(row, center, space-evenly);
+	}
+	.bg {
+		width: 100%;
+		height: 100%;
+		position: absolute;
+		bottom: 0;
+		left: 0;
+		z-index: -1;
+	}
+	.goodsitem {
+		flex: 1;
+		max-width: 200rpx;
+		min-height: 124rpx;
+		border-radius: 10rpx;
+		@include u-flex(column, center, flex-start);
+		font-family: PingFang SC;
+		font-weight: 400;
+		font-size: 22rpx;
+		color: #999999;
+		position: relative;
+		z-index: 2;
+		.img {
+			width: 153rpx;
+			height: 126rpx;
+			margin-top: -44rpx;
+			border-radius: 10rpx;
+		}
+		&-name {
+			width: 100%;
+			padding: 8rpx 14rpx;
+			text-align: center;
+			font-family: PingFang SC;
+			font-weight: 500;
+			font-size: 24rpx;
+			color: #222222;
+			box-sizing: border-box;
+		}
+		&-integral {
+			min-width: 80%;
+			padding-bottom: 16rpx;
+			box-sizing: border-box;
+			font-family: PingFang SC;
+			font-weight: 400;
+			font-size: 22rpx;
+			color: #FF5C03;
+			border-bottom: 2px #999999 dotted;
+			&-num {
+				font-family: DINPro, DINPro;
+				font-weight: 500;
+				font-size: 36rpx;
+			}
+		}
+		&-price {
+			padding: 10rpx 0;
+		}
+	}
+	.appPopup-btn {
+		width: 560rpx;
+		height: 84rpx;
+		margin: 0 auto;
+		background: #FF5C03;
+		border-radius: 42rpx 42rpx 42rpx 42rpx;
+		@include u-flex(row, center, center);
+		font-family: PingFang SC;
+		font-weight: 500;
+		font-size: 32rpx;
+		color: #FFFFFF;
+	}
+	.changebtn {
+		width: 152rpx;
+		height: 64rpx;
+		margin: 0 auto;
+		border-radius: 32rpx 32rpx 32rpx 32rpx;
+		border: 1rpx solid #FF5C03;
+		@include u-flex(row, center, center);
+		font-family: PingFang SC;
+		font-weight: 400;
+		font-size: 24rpx;
+		color: #FF5C03;
+	}
+	.progress {
+		padding: 0 90rpx;
+		margin-top: 40rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		font-size: 32rpx;
+		color: #222222;
+	}
+	::v-deep {
+		.uni-progress-bar, .uni-progress-inner-bar {
+			border-radius: 6px;
+		}
+	}
+	.my-integral {
+		margin: 32rpx 0;
+		font-family: PingFang SC;
+		font-weight: 400;
+		font-size: 28rpx;
+		color: #222222;
+		text {
+			color: #FF5C03;
+		}
+	}
+	.appPopup-tips {
+		margin-top: 32rpx;
+	}
+</style>

+ 275 - 0
pages_course/components/treasureChest.vue

@@ -0,0 +1,275 @@
+<template>
+	<cover-view key="treasureBox" class="treasure-box" :style="{display: showBox&&isfull?'flex':'none'}"
+		:class="[{opening}, {fadeOut}, {dropIn},{swing}]" @click="open">
+		<cover-image :class="opening ? 'box-img openingGif' : 'box-img boxPng'"
+			:src="currentIdx >=0 ? opening ? boxList[currentIdx].openChestUrl : boxList[currentIdx].closeChestUrl :''"></cover-image>
+		<cover-view class="countdown" v-if="!opening">{{count}}s</cover-view>
+	</cover-view>
+</template>
+
+<script>
+	export default {
+		props: {
+			boxList: {
+				type: Array,
+				default: []
+			},
+			isfull: {
+				type: Boolean,
+				default: false
+			},
+			onHide: {
+				type: Boolean,
+				default: false
+			},
+		},
+		data() {
+			return {
+				showBox: false, // 控制宝箱显隐
+				opening: false, // 是否正在打开
+				fadeOut: false, // 控制自动消失的动画类
+				dropIn: false,
+				swing: false,
+				count: 20, // 倒计时
+				timer: null, // 倒计时句柄
+				timeout: null, // 20s 未点击自动消失句柄
+				currentIdx: -1,
+				flagTime: 0
+			}
+		},
+		watch: {
+			onHide(val) {
+				if (!this.showBox) return
+				if (val) { // 暂停
+					clearInterval(this.timer)
+					clearTimeout(this.timeout)
+					this.timer = null
+					this.timeout = null
+				} else { // 继续
+					if (!this.opening) {
+						const flag = this.boxList.some(item => this.flagTime >= item.time && this.flagTime <= item.time + 20);
+						if(flag) {
+							this.countDown()
+							this.setAutoHide() // 重新计算剩余时长
+						} else {
+							this.count = 20
+							clearInterval(this.timer)
+							clearTimeout(this.timeout)
+							this.timer = null
+							this.timeout = null
+						}
+					}
+				}
+			},
+		},
+		methods: {
+			close() {
+				this.swing = false
+				this.opening = true
+				this.showBox = false
+			},
+			showTreasure(flagTime) {
+				this.flagTime = flagTime
+				const idx = this.boxList.findIndex(v => v.time == flagTime && v.status == 0)
+				if (idx == -1) return
+
+				this.currentIdx = idx
+				this.showBox = true
+				this.opening = false
+				this.swing = false
+				this.fadeOut = false
+				this.dropIn = true
+				this.count = 20
+
+				clearInterval(this.timer)
+				clearTimeout(this.timeout)
+				this.countDown()
+				this.setAutoHide()
+			},
+
+			/* 倒计时 */
+			countDown() {
+				clearInterval(this.timer) // 防止重复启动
+				this.timer = setInterval(() => {
+					if (this.count > 0) {
+						this.count--
+					} else {
+						clearInterval(this.timer)
+						this.timer = null
+					}
+				}, 1000)
+			},
+
+			/* 用户点击宝箱 */
+			open() {
+				if (this.opening || this.swing) return
+				clearTimeout(this.timeout)
+				clearInterval(this.timer)
+				this.swing = true
+				this.claim(1)
+			},
+			claimSuccess(status) {
+				setTimeout(()=>{
+					this.swing = false
+					this.opening = true
+				},400)
+				this.boxList[this.currentIdx].status = status
+				setTimeout(() => {
+					this.showBox = false
+				}, 3000)
+			},
+			/* 设置/重置 autoHide 定时器 */
+			setAutoHide() {
+				clearTimeout(this.timeout)
+				const remainMs = this.count * 1000
+				if (remainMs <= 0) { // 已经过期
+					this.autoHide()
+					return
+				}
+				this.timeout = setTimeout(() => this.autoHide(), remainMs)
+			},
+			/* 20s 未点击,自动消失 */
+			autoHide() {
+				clearInterval(this.timer)
+				this.fadeOut = true
+
+				// 标记已打开
+				this.claim(2)
+				setTimeout(() => {
+					this.showBox = false
+				}, 600)
+			},
+			claim(status) {
+				this.$emit('claimFun', {
+					rewardId: this.boxList[this.currentIdx].rewardVideoRelation.rewardId,
+					status: status,
+					time: this.boxList[this.currentIdx].time
+				})
+			}
+		},
+		beforeDestroy() {
+			clearInterval(this.timer)
+			clearTimeout(this.timeout)
+		}
+	}
+</script>
+
+
+<style lang="scss" scoped>
+	@keyframes dropIn {
+		0% {
+			opacity: 0;
+			transform: translateY(-160px);
+		}
+
+		60% {
+			opacity: 1;
+			transform: translateY(12px);
+		}
+
+		100% {
+			opacity: 1;
+			transform: translateY(0);
+		}
+	}
+
+	.treasure-box.dropIn {
+		animation: dropIn 0.7s cubic-bezier(.25, .85, .45, 1.25) forwards,
+			pulse 1s ease-in-out infinite 0.7s;
+	}
+
+	@keyframes swing {
+		20% {
+			transform: rotate(-8deg);
+		}
+
+		40% {
+			transform: rotate(8deg);
+		}
+
+		60% {
+			transform: rotate(-6deg);
+		}
+
+		80% {
+			transform: rotate(6deg);
+		}
+
+		100% {
+			transform: rotate(0deg);
+		}
+	}
+
+	.treasure-box.swing {
+		animation: swing 0.4s ease-in-out infinite forwards; 
+	}
+
+	/* 宝箱 */
+	.treasure-box {
+		position: fixed;
+		left: 100px;
+		bottom: 80px;
+		width: 192px;
+		/* 128 × 1.5 */
+		height: 138px;
+		/* 92 × 1.5 */
+		animation: pulse 0.4s ease-in-out infinite;
+		// z-index: 999;
+		display: flex;
+		align-items: flex-end;
+	}
+
+	.openingGif {
+		width: 192px;
+		/* 128 × 1.5 */
+		height: 138px;
+		/* 92 × 1.5 */
+	}
+
+	.boxPng {
+		width: 135px;
+		height: 96px;
+		margin-left: 20px;
+	}
+
+	.countdown {
+		position: absolute;
+		top: 50%;
+		left: 50%;
+		transform: translate(-50%, -50%);
+		color: #fff;
+		font-size: 20px;
+		font-weight: bold;
+		text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
+	}
+
+	/* 动画 */
+	@keyframes pulse {
+
+		0%,
+		100% {
+			transform: scale(1);
+		}
+
+		50% {
+			transform: scale(1.15);
+		}
+	}
+
+	/* 打开后停止 pulse */
+	.treasure-box.opening {
+		animation: none;
+	}
+
+	/* 自动消失 */
+	.treasure-box.fadeOut {
+		animation: fadeOutUp .6s ease-out forwards;
+	}
+
+	@keyframes fadeOutUp {
+		to {
+			opacity: 0;
+			transform: translate(-50%, -40px);
+		}
+	}
+</style>

+ 82 - 19
pages_course/video.vue

@@ -54,6 +54,7 @@
 					 src="https://cos.his.cdwjyyh.com/fs/20250418/beaf9df1a6204b8babc3e28d9b563c62.png"
 					 @click="openDanmu(1)"></cover-image>
 				</cover-view>
+				<treasureChest ref="treasureChest" :isfull="isfull" :onHide="onHide" :boxList="fsUserCourseRewardRoundStatusVO" @claimFun="claimFun"></treasureChest>
 			</video>
 		</view>
 		<!-- 弹幕方法 -->
@@ -219,6 +220,8 @@
 				</view>
 			</view>
 		</uni-popup>
+		<!-- 展示兑换奖品弹窗 -->
+		<appPopup ref="appPopup"></appPopup>
 		<!-- 客服二维码弹窗 -->
 		<uni-popup ref="kfPopup" type="center" :mask-click="false">
 			<view class="kfqrcode-box">
@@ -247,7 +250,7 @@
 				<view>阅读并同意<text style="color: #ff5c03;" @click.stop="goWeb(0)">《用户协议》</text>和<text
 						style="color: #ff5c03;" @click.stop="goWeb(1)">《隐私协议》</text></view>
 			</view> -->
-			<view class="footer-tips">重庆云联融智提供技术支持</view>
+			<!-- <view class="footer-tips">重庆云联融智提供技术支持</view> -->
 		</view>
 		<view v-show="currentTab==2">
 			<view class="chatinput" :style="{bottom:danmuboxHeight>0?danmuboxHeight+'px':'calc(var(--window-bottom) + 24rpx)'}">
@@ -259,6 +262,8 @@
 </template>
 
 <script>
+	import appPopup from "./components/appPopup.vue"
+	import treasureChest from "./components/treasureChest.vue"
 	import networkError from "./components/networkError.vue"
 	import ques from "./components/ques.vue"
 	import descInfo from "./components/descInfo.vue"
@@ -279,7 +284,10 @@
 		loginByMp,
 		getRealLink,
 		errorLogUpload,
-		getConfigByKey
+		getConfigByKey,
+		claim,
+		getVideoRewardTypes,
+		getVideoRewardRules
 	} from "@/api/course.js"
 	export default {
 		components: {
@@ -287,20 +295,22 @@
 			descInfo,
 			commentBox,
 			ques,
-			networkError
+			networkError,
+			treasureChest,
+			appPopup
 		},
 		data() {
 			return {
 				baseUrl:uni.getStorageSync('requestPath'),
-				// 1 红包 2 积分
+				// 1 红包 2 芳华币
 				rewardType: [{
 					name: '红包奖励',
 					value: 1
 				}, {
-					name: '积分奖励',
+					name: '芳华币奖励',
 					value: 2
 				}],
-				currentReward: 1,
+				currentReward: 2,
 				player: null,
 				loading: true,
 				progress: 0,
@@ -352,7 +362,7 @@
 				checked: true,
 				isFinish: 0, // 是否完课
 				interval: null,
-				intervalIntegral: null, // 积分定时
+				intervalIntegral: null, // 芳华币定时
 				options: {
 					sources: [{
 						src: ""
@@ -395,7 +405,6 @@
 				// 是否获取到对应观看者的真实链接
 				isCheckRealUrl: false,
 				courseLogo: '',
-				isfull: false,
 				navList:[{
 					id: 0,
 					name: '介绍'
@@ -419,7 +428,9 @@
 				showDanmu: 1,
 				activeDanmus:[],
 				flagTime: 0,
-				notice: ''
+				notice: '',
+				fsUserCourseRewardRoundStatusVO: [],
+				onHide: false
 			}
 		},
 		onLoad(option) {
@@ -437,6 +448,7 @@
 			if (this.videoId) {
 				this.getH5CourseByVideo()
 				this.getConfigByKey()
+				// this.getVideoRewardTypes()
 			}
 			this.sortLink = this.urlOption.link || ''
 			this.getMenuButton()
@@ -445,6 +457,7 @@
 			// #endif
 		},
 		onShow() {
+			this.onHide = false
 			this.tipsOpen = false
 			// this.isLogin = this.$isLoginCourse()
 			this.uuId = generateRandomString(16)
@@ -467,6 +480,7 @@
 			this.getHeight()
 		},
 		onHide() {
+			this.onHide = true
 			// this.player = uni.createVideoContext('video-content-box');
 			if (this.player) {
 				this.player.pause()
@@ -502,6 +516,13 @@
 			// #endif
 		},
 		methods: {
+			getVideoRewardTypes() {
+				getVideoRewardTypes({...this.urlOption}).then(res=>{
+					if(res.code == 200) {
+						this.rewardType = res.data
+					}
+				})
+			},
 			refreshAll() {
 				if (this.videoId) {
 					this.getH5CourseByVideo()
@@ -574,9 +595,14 @@
 				} else {
 					this.showAnswerTip = false
 				}
-				if (Math.floor(e.detail.currentTime) != this.flagTime &&this.openCommentStatus == 2) {
+				if (Math.floor(e.detail.currentTime) != this.flagTime) {
 					this.flagTime = Math.floor(e.detail.currentTime)
-					this.$refs.danmuBox&&this.$refs.danmuBox.checkDanmu(this.flagTime)
+					if(this.fsUserCourseRewardRoundStatusVO&&this.fsUserCourseRewardRoundStatusVO.length>0) {
+						this.$refs.treasureChest&&this.$refs.treasureChest.showTreasure(this.flagTime)
+					}
+					if(this.openCommentStatus == 2) {
+						this.$refs.danmuBox&&this.$refs.danmuBox.checkDanmu(this.flagTime)
+					}
 				}
 			},
 			changeTime(that,e) {
@@ -637,7 +663,7 @@
 						.boundingClientRect((data) => {
 							if(data) {
 								this.height =
-									`calc(100vh - ${data.height}px - 420rpx - ${this.statusBarHeight}px - 100px - 88rpx)`
+									`calc(100vh - ${data.height}px - 420rpx - ${this.statusBarHeight}px - 80px - 88rpx)`
 							}
 						})
 						.exec();
@@ -666,7 +692,7 @@
 					clearInterval(this.intervalIntegral)
 					this.intervalIntegral = null
 				}
-				// 观看10分钟获得积分
+				// 观看10分钟获得芳华币
 				this.intervalIntegral = setInterval(function() {
 					that.getIntegralByH5Video()
 				}, 600000);
@@ -729,18 +755,20 @@
 							this.lineList = lineList
 							this.courseLogo = res.config&&res.config.courseLogo
 							this.viewCommentNum = res.config&&res.config.viewCommentNum || 200
-							if(this.openCommentStatus == 3) {
-								this.$refs.commentBox&&this.$refs.commentBox.closeWSocket()
-								this.$refs.danmuBox&&this.$refs.danmuBox.closeWSocket()
-							}
+							
 							const status = res.config&&res.config.openCommentStatus || 3
 							if(status != this.openCommentStatus) {
+								if(this.openCommentStatus != 3&&status==3) {
+									this.$refs.commentBox&&this.$refs.commentBox.closeWSocket()
+									this.$refs.danmuBox&&this.$refs.danmuBox.closeWSocket()
+								}
 								this.openCommentStatus = status
 							}
 							this.currentTab = 1
 							if(this.openCommentStatus!=2 || this.showDanmu!=1) {
 								this.activeDanmus = []
 							}
+							this.fsUserCourseRewardRoundStatusVO = this.getBox(res)
 							if (!this.player || type == 'error') {
 								this.lineIndex = this.config.defaultLine
 								this.videoUrl = lineList[this.lineIndex]
@@ -952,6 +980,9 @@
 							title: res.msg,
 							icon: 'none'
 						})
+						if(res.code == 200) {
+							this.$refs.appPopup.openPop()
+						}
 						// if(res.code == 200) {
 						// 	//重构 发红包,后台通过OPENID发零钱到 账
 						// 	//this.initWXConfig(res.package)
@@ -1064,7 +1095,7 @@
 				}
 				getFinishCourseVideo(param)
 			},
-			// 每十分钟获得积分
+			// 每十分钟获得芳华币
 			getIntegralByH5Video() {
 				if(!this.isLogin||!this.isCheckRealUrl) return
 				const param = {
@@ -1074,7 +1105,7 @@
 				getIntegralByH5Video(param).then(res => {
 					if (res.code == 200) {
 						uni.showToast({
-							title: "积分+10",
+							title: "芳华币+10",
 							icon: "none"
 						})
 					}
@@ -1317,6 +1348,38 @@
 				uni.navigateTo({
 					url: './feedback?userId='+userId+'&courseId='+courseId+'&videoId='+videoId
 				})
+			},
+			getBox(data) {
+				if(data.fsUserCourseRewardRoundStatusVO&&data.fsUserCourseRewardRoundStatusVO.length>0) {
+					const list = data.fsUserCourseRewardRoundStatusVO.map(item=>({
+						...item,
+						time: Math.round(this.duration * Number(item.question || 0) * 0.01)
+					}))
+					return list
+				} else {
+					return []
+				}
+			},
+			claimFun(val) {
+				claim({
+					...this.urlOption,
+					second: val.time,
+					rewardId: val.rewardId,
+					status: val.status
+				}).then(res=>{
+					if(res.code == 200) {
+						this.$refs.treasureChest.claimSuccess(val.status)
+					} else {
+						this.$refs.treasureChest.close()
+					}
+					if(res.msg!="success") {
+						uni.showToast({
+							title: res.msg,
+							icon: 'none',
+							duration: 3000
+						})
+					}
+				})
 			}
 		}
 	}

+ 1 - 1
pages_course/videoOld.vue

@@ -213,7 +213,7 @@
 				<view>阅读并同意<text style="color: #ff5c03;" @click.stop="goWeb(0)">《用户协议》</text>和<text
 						style="color: #ff5c03;" @click.stop="goWeb(1)">《隐私协议》</text></view>
 			</view> -->
-			<view class="footer-tips">重庆云联融智提供技术支持</view>
+			<!-- <view class="footer-tips">重庆云联融智提供技术支持</view> -->
 		</view>
 	</view>
 </template>