Browse Source

Signed-off-by: liujiaxin <2289135621@qq.com>

liujiaxin 2 ngày trước cách đây
mục cha
commit
5c4724a6d5

+ 3 - 3
pages_course/living.vue

@@ -1892,9 +1892,9 @@
 				// const watchedTime = this.videoDuration - this.pointsRemainingTime;
 				// const watchedTime = this.videoDuration - this.pointsRemainingTime;
 
 
 				// 5. 确保数值有效
 				// 5. 确保数值有效
-				if (watchedTime <= 0) {
-					return 0;
-				}
+				// if (watchedTime <= 0) {
+				// 	return 0;
+				// }
 
 
 				// 6. 计算百分比(已观看时间 / 目标时间)
 				// 6. 计算百分比(已观看时间 / 目标时间)
 				const percentage = (this.watchedTime / this.videoDuration) * 100;
 				const percentage = (this.watchedTime / this.videoDuration) * 100;

+ 113 - 152
pages_shopping/live/integral.vue

@@ -24,75 +24,24 @@
 					<text class="num">{{integral}}</text>
 					<text class="num">{{integral}}</text>
 				</view>
 				</view>
 
 
-				<!-- 签到 -->
-				<!-- <view class="singn-content">
-					<view class="sign-in-box">
-						<view class="inner">
-							<view class="title-box">已连续签到<text class="num">{{totalDays}}</text>天</view>
-							<view class="sign-list">
-								<view v-for="(item,index) in records" :key="index"
-									:class="totalDays >= index+ 1?'item active':'item'">
-									<view class="line"></view>
-									<view class="right">
-										<image v-if="totalDays >= index+ 1"
-											src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/f3bdd5d388854e9a8f365904840c3b32.png"
-											mode=""></image>
-										<image v-else
-											src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/c593e551e4b246b981aaa58deb1fe725.png"
-											mode=""></image>
-										<text class="text">第{{ item.continuousDays}}天</text>
-									</view>
-								</view>
-							</view>
-						</view>
-						<view class="sign-btn-box">
-							<view class="btn" v-if="isDaySign==false" @click="doSign()">
-								<image
-									src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/295aa046433d4feb95b467c83f8b4096.png"
-									mode=""></image>
-								<text class="text">签到</text>
-							</view>
-							<view class="btn" v-else>
-								<image
-									src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/295aa046433d4feb95b467c83f8b4096.png"
-									mode=""></image>
-								<text class="text">签到</text>
-							</view>
-						</view>
-					</view>
-				</view> -->
+			
 				<view class="content">
 				<view class="content">
 					<!-- 积分列表 -->
 					<!-- 积分列表 -->
 					<view class="points-cont">
 					<view class="points-cont">
-						<!-- tab切换 -->
-						<!-- <view class="pub-tab-box">
-							<view class="tab-inner">
-								<view 
-									v-for="(item,index) in tags" 
-									:key="index"
-									:class="tabIndex == item.value?'item active':'item'"
-									@click="tabChange(item)">
-									<view class="text">
-										{{ item.lable }}
-										<image v-show="tabIndex == item.value" class="tab-bg" src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/1828ea6b3b124b5f84e3556267a8d9ef.png" mode=""></image>
-									</view>
-								</view>
-							</view>
-						</view> -->
-
 						<!-- 列表 -->
 						<!-- 列表 -->
 						<view class="point-list">
 						<view class="point-list">
 							<view v-for="(item,index) in list" :key="index" class="item">
 							<view v-for="(item,index) in list" :key="index" class="item">
 								<view class="left">
 								<view class="left">
 									<text class="title">
 									<text class="title">
 										<!-- {{item.logTypeName}} -->
 										<!-- {{item.logTypeName}} -->
-										直播间完课积分
+										<!-- 直播间完课积分 -->
+										 {{utils.getDictLabel2Name(typeOptions,item.logType)}}
 									</text>
 									</text>
 									<view class="time">{{item.createTime}}</view>
 									<view class="time">{{item.createTime}}</view>
 								</view>
 								</view>
 								<view class="right">
 								<view class="right">
 									<text v-if="item.integral<0" class="less">{{item.integral}}</text>
 									<text v-if="item.integral<0" class="less">{{item.integral}}</text>
-									<text v-else class="add">+{{item.pointsAwarded}}</text>
+									<text v-else class="add">+{{item.integral}}</text>
 								</view>
 								</view>
 							</view>
 							</view>
 						</view>
 						</view>
@@ -106,16 +55,16 @@
 </template>
 </template>
 
 
 <script>
 <script>
-	import {
-		getUserIntegralInfo
-	} from '@/api/living.js' // 积分
-	import {
-		completionRecords,
-		completionInfo,doSign
-	} from '@/api/integral.js'
-
+	// import {
+	// 	getUserIntegralInfo
+	// } from '@/api/living.js' // 积分
+	// import {
+	// 	completionRecords,
+	// 	completionInfo,doSign
+	// } from '@/api/integral.js'
+	import {getUserIntegralLogsList,getUserSign} from '@/api/integral';
 
 
-	// import {getDictByKey} from '@/api/common.js'
+	import {getDictByKey} from '@/api/common.js'
 	// import {getUserSign,getUserIntegralLogsList,doSign} from '@/api/integral';
 	// import {getUserSign,getUserIntegralLogsList,doSign} from '@/api/integral';
 	// import {
 	// import {
 	// 	doSign
 	// 	doSign
@@ -153,13 +102,17 @@
 			};
 			};
 		},
 		},
 		onLoad(option) {
 		onLoad(option) {
+			this.getDictByKey("sys_integral_log_type");
 			if (option.liveId) {
 			if (option.liveId) {
 				this.liveId = option.liveId
 				this.liveId = option.liveId
 			}
 			}
 			console.log("进入积分页面了")
 			console.log("进入积分页面了")
+			// this.integrallogs()
 			// this.getUserIntegralInfo()
 			// this.getUserIntegralInfo()
-			this.completionRecords()
-			this.completionInfo()
+			// this.completionRecords()
+			// this.completionInfo()
+			this.getUserSign()
+			this.getUserIntegralLogsList();
 		},
 		},
 		computed: {
 		computed: {
 			// 计算属性的 getter
 			// 计算属性的 getter
@@ -168,71 +121,79 @@
 			},
 			},
 		},
 		},
 		methods: {
 		methods: {
+			// integrallogs() {
+			// 	integrallogs(data).then((res) => {
+			// 		if (res.code == 200) {
+			// 			console.log("用户领取看课积分", res)
+			// 			// receiveList
+			// 		}
+			// 	}).catch((error) => {});
+			// },
 			// 查询用户积分领取记录
 			// 查询用户积分领取记录
-			completionRecords() {
-				if (!this.liveId) return;
-				const data = {
-					liveId: this.liveId
-				}
-				completionRecords(data).then((res) => {
-					if (res.code == 200) {
-						this.list = res.data
-						console.log("查询用户积分领取记录", res)
-					}
-				}).catch((error) => {
-
-				});
-			},
+			// completionRecords() {
+			// 	if (!this.liveId) return;
+			// 	const data = {
+			// 		liveId: this.liveId
+			// 	}
+			// 	completionRecords(data).then((res) => {
+			// 		if (res.code == 200) {
+			// 			this.list = res.data
+			// 			console.log("查询用户积分领取记录", res)
+			// 		}
+			// 	}).catch((error) => {
+
+			// 	});
+			// },
 
 
 			//查询用户积分余额和看直播信息统计
 			//查询用户积分余额和看直播信息统计
-			completionInfo() {
-				if (!this.liveId) return;
-				const data = {
-					liveId: this.liveId
-				}
-				completionInfo(data).then((res) => {
-					if (res.code == 200) {
-						this.integral = res.data.integral
-						this.records = res.data.records
-						this.totalDays = res.data.totalDays
-						console.log("查询用户积分余额和看直播信息统计", res)
-					}
-				}).catch((error) => {
-
-				});
-			},
-
-
-			doSign() {
-				var data = {};
-				// uni.showLoading({
-				// 	title:"正在加载中..."
-				// })
-				doSign(data).then(
-					res => {
-						// uni.hideLoading()
-						if (res.code == 200) {
-							uni.showToast({
-								icon: 'success',
-								title: res.msg,
-							});
-							this.list = [];
-							this.page.page = 1;
-							this.list = [];
-							this.loaded = false;
-							this.loading = false;
-							this.getUserIntegralLogsList();
-							this.getUserSign();
-						} else {
-							uni.showToast({
-								icon: 'none',
-								title: res.msg,
-							});
-						}
-					},
-					rej => {}
-				);
-			},
+			// completionInfo() {
+			// 	if (!this.liveId) return;
+			// 	const data = {
+			// 		liveId: this.liveId
+			// 	}
+			// 	completionInfo(data).then((res) => {
+			// 		if (res.code == 200) {
+			// 			this.integral = res.data.integral
+			// 			this.records = res.data.records
+			// 			this.totalDays = res.data.totalDays
+			// 			console.log("查询用户积分余额和看直播信息统计", res)
+			// 		}
+			// 	}).catch((error) => {
+
+			// 	});
+			// },
+
+
+			// doSign() {
+			// 	var data = {};
+			// 	// uni.showLoading({
+			// 	// 	title:"正在加载中..."
+			// 	// })
+			// 	doSign(data).then(
+			// 		res => {
+			// 			// uni.hideLoading()
+			// 			if (res.code == 200) {
+			// 				uni.showToast({
+			// 					icon: 'success',
+			// 					title: res.msg,
+			// 				});
+			// 				this.list = [];
+			// 				this.page.page = 1;
+			// 				this.list = [];
+			// 				this.loaded = false;
+			// 				this.loading = false;
+			// 				this.getUserIntegralLogsList();
+			// 				this.getUserSign();
+			// 			} else {
+			// 				uni.showToast({
+			// 					icon: 'none',
+			// 					title: res.msg,
+			// 				});
+			// 			}
+			// 		},
+			// 		rej => {}
+			// 	);
+			// },
 			getUserSign() {
 			getUserSign() {
 				getUserSign().then(
 				getUserSign().then(
 					res => {
 					res => {
@@ -255,30 +216,30 @@
 			},
 			},
 
 
 
 
-			// 积分
-			getUserIntegralInfo() {
-				uni.showLoading({
-					title: "正在加载中..."
-				})
-				getUserIntegralInfo().then(res => {
-					uni.hideLoading()
-					if (res.code == 200) {
-						console.log("积分>>", res)
-						// 处理列表数据,将"积分"替换为"积分"
-						this.list = res.data.logs.map(item => {
-							return {
-								...item,
-								logTypeName: item.logTypeName ? item.logTypeName.replace(/积分/g, '积分') :
-									item.logTypeName
-							}
-						})
-						this.integral = res.data.integral
-					}
-				}).catch(error => {
-					console.error("获取积分数据失败:", error);
-
-				});
-			},
+			// // 积分
+			// getUserIntegralInfo() {
+			// 	uni.showLoading({
+			// 		title: "正在加载中..."
+			// 	})
+			// 	getUserIntegralInfo().then(res => {
+			// 		uni.hideLoading()
+			// 		if (res.code == 200) {
+			// 			console.log("积分>>", res)
+			// 			// 处理列表数据,将"积分"替换为"积分"
+			// 			this.list = res.data.logs.map(item => {
+			// 				return {
+			// 					...item,
+			// 					logTypeName: item.logTypeName ? item.logTypeName.replace(/积分/g, '积分') :
+			// 						item.logTypeName
+			// 				}
+			// 			})
+			// 			this.integral = res.data.integral
+			// 		}
+			// 	}).catch(error => {
+			// 		console.error("获取积分数据失败:", error);
+
+			// 	});
+			// },
 
 
 
 
 
 

+ 4 - 2
pages_user/user/integralLogsList.vue

@@ -4,9 +4,11 @@
 			<mescroll-body      ref="mescrollRef" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
 			<mescroll-body      ref="mescrollRef" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
 			<view class="item" v-for="(item) in dataList">
 			<view class="item" v-for="(item) in dataList">
 				<view class="left">
 				<view class="left">
-					<text class="title"  >
+					<!-- <text class="title"  >
 						完课积分领取记录
 						完课积分领取记录
-						<!-- {{utils.getDictLabel2Name(typeOptions,item.logType)}} -->
+					</text> -->
+					<text class="title"  >
+						{{utils.getDictLabel2Name(typeOptions,item.logType)}}
 					</text>
 					</text>
 					<view class="time">{{item.createTime}}</view>
 					<view class="time">{{item.createTime}}</view>
 				</view>
 				</view>