qxj 1 неделя назад
Родитель
Сommit
033e6ee6a9

+ 1 - 1
App.vue

@@ -6,7 +6,7 @@
 		globalData: {
 			// wsUrl: 'wss://websocket.cdwjyyh.com',
 			wsUrl: '',
-			appId: 'wx44beed5640bcb1ba',
+			appId: 'wxd791d5933ed42218',
 		},
 		onLoad: function (){
 			

+ 10 - 0
common/request.js

@@ -12,6 +12,16 @@ export default class Request {
 
 		let path = 'https://userapp.klbycp.com/store'; //百域承品
 		let path2 = 'https://userapp.klbycp.com'; //百域承品
+<<<<<<< HEAD
+=======
+
+
+		// let path = 'http://j26df4a4.natappfree.cc/store'; //百域承品 夏伟
+		// let path2 = 'http://j26df4a4.natappfree.cc'; //百域承品 夏伟
+
+		// let path = 'http://d499966b.natappfree.cc/store'; //本地
+		// let path2 = 'http://d499966b.natappfree.cc'; //本地
+>>>>>>> db97a32e991ee7a9b5a59978a4bee9ad519591ce
 
 		//let path = 'http://e895a54d.natappfree.cc/store'; //百域承品 夏伟
 		//let path2 = 'http://e895a54d.natappfree.cc'; //百域承品 夏伟

+ 2 - 1
pages/shopping/productDetails.vue

@@ -86,7 +86,8 @@
 			</view>
 		</view>
 		<!-- 底部按钮 -->
-		<view class="btn-foot" v-if="userinfo.isShow==1&&isuser==false">
+		<!-- v-if="userinfo.isShow==1&&isuser==false" -->
+		<view class="btn-foot" >
 			<view class="menu-box">
 				<view class="item" @click="goHome">
 					<image src="https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/back_home.png"

+ 36 - 0
pages_course/living.vue

@@ -170,7 +170,11 @@
 
 				<view class="progress-countdown end" :class="liveItem.showType==2?' progress-vertical':''"
 					:style="{ 'display':isFocus?'none':''}"
+<<<<<<< HEAD
 					v-if="countdownPercentage!=100&&liveItem.completionPointsEnabled&&!receiveStatus&&liveItem.status==2&&!hasReceived&&!isPreview">
+=======
+					v-if="countdownPercentage!=100&&!receiveStatus&&liveItem.status==2&&!hasReceived">
+>>>>>>> db97a32e991ee7a9b5a59978a4bee9ad519591ce
 					<image class="title" src="/static/images/points_title.png"></image>
 					<view class="progress-bar-bg">
 						<view class="progress-bar-fill" :style="{ width: countdownPercentage + '%' }"></view>
@@ -2033,6 +2037,7 @@
 					total: totalSeconds // 确保total是处理后的有效数值
 				};
 			},
+<<<<<<< HEAD
 		getCountdownPercentage() {
 			// 1. 使用倒计时的 remainingTime 计算进度
 			if (!this.getRemainingTime) {
@@ -2072,6 +2077,37 @@
 			// 9. 限制在 0-100 范围内
 			return Math.min(100, Math.max(0, percentage));
 		},
+=======
+			getCountdownPercentage() {
+				// 1. 使用倒计时的 remainingTime 计算进度
+				if (!this.getRemainingTime) {
+					console.log('进度条计算:liveItem.duration无效', this.liveItem?.duration);
+					return 0;
+				}
+
+				// 2. 计算目标观看时间(90%的总时长)
+				// const targetWatchTime = this.liveItem.duration * this.completionRate;
+
+				// 3. 如果已经达到目标,直接返回100%
+				if (this.hasReachedTarget || this.pointsRemainingTime <= 0) {
+					return 100;
+				}
+				// remainingTime = 剩余需要观看的时间
+				// 已观看时间 = 总目标时间 - 剩余时间
+				// const watchedTime = this.videoDuration - this.pointsRemainingTime;
+
+				// 5. 确保数值有效
+				// if (watchedTime <= 0) {
+				// 	return 0;
+				// }
+
+				// 6. 计算百分比(已观看时间 / 目标时间)
+				const percentage = (this.watchedTime / this.videoDuration) * 100;
+
+				// 7. 限制在 0-100 范围内
+				return Math.min(100, Math.max(0, percentage));
+			},
+>>>>>>> db97a32e991ee7a9b5a59978a4bee9ad519591ce
 			// 更新倒计时显示(如果需要强制更新视图)
 			updateCountdownDisplay() {
 				// 如果需要,可以在这里触发视图更新

+ 609 - 0
pages_shopping/live/integral.vue

@@ -1,3 +1,4 @@
+<<<<<<< HEAD
 <template>
 	<view>
 		<view class="top-cont">
@@ -604,4 +605,612 @@
 			}
 		}
 	}
+=======
+<template>
+	<view>
+		<view class="top-cont">
+			<!-- 背景图片 -->
+			<image class="bg"
+				src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/ed4a8ff0406747a68e40988b210d1c78.png"
+				mode=""></image>
+			<view class="top-inner">
+				<!-- 这里是状态栏 -->
+				<view class="fixed-top-box" :style="{ background: bg }">
+					<view class="status_bar" :style="{height: statusBarHeight}"></view>
+					<view class="back-box" @click="back">
+						<text class="title">我的积分</text>
+						<text></text>
+					</view>
+				</view>
+				<!-- 顶部固定后站位元素 -->
+				<view style="padding-bottom: 88upx;">
+					<view :style="{height: statusBarHeight}"></view>
+				</view>
+				<!-- 可用积分 -->
+				<view class="available-points">
+					<text class="label">可用积分</text>
+					<text class="num">{{integral}}</text>
+				</view>
+
+			
+				<view class="content">
+					<!-- 积分列表 -->
+					<view class="points-cont">
+						<!-- 列表 -->
+						<view class="point-list">
+							<view v-for="(item,index) in list" :key="index" class="item">
+								<view class="left">
+									<text class="title">
+										<!-- {{item.logTypeName}} -->
+										<!-- 直播间完课积分 -->
+										 {{utils.getDictLabel2Name(typeOptions,item.logType)}}
+									</text>
+									<view class="time">{{item.createTime}}</view>
+								</view>
+								<view class="right">
+									<text v-if="item.integral<0" class="less">{{item.integral}}</text>
+									<text v-else class="add">+{{item.integral}}</text>
+								</view>
+							</view>
+						</view>
+					</view>
+				</view>
+
+			</view>
+		</view>
+
+	</view>
+</template>
+
+<script>
+	// 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 {getUserSign,getUserIntegralLogsList,doSign} from '@/api/integral';
+	// import {
+	// 	doSign
+	// } from '@/api/integral';
+	export default {
+		comments() {
+			Loading
+		},
+		data() {
+			return {
+				totalDays: null,
+				records: null,
+				liveId: 712,
+				signNum: 0,
+				typeOptions: [],
+				top: 0,
+				integral: 0,
+				sign: [],
+				// 状态栏的高度
+				statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
+				// tab切换
+				// {lable:'获得',value:1},{lable:'消耗',value:2}
+				// tags: [{lable:'最近十条',value:0},],
+				// 选中的tab
+				tabIndex: 0,
+				current: 0,
+				page: {
+					type: 0,
+					page: 1,
+					pageSize: 10
+				},
+				list: [],
+				loaded: false,
+				loading: false
+			};
+		},
+		onLoad(option) {
+			this.getDictByKey("sys_integral_log_type");
+			if (option.liveId) {
+				this.liveId = option.liveId
+			}
+			console.log("进入积分页面了")
+			// this.integrallogs()
+			// this.getUserIntegralInfo()
+			// this.completionRecords()
+			// this.completionInfo()
+			this.getUserSign()
+			this.getUserIntegralLogsList();
+		},
+		computed: {
+			// 计算属性的 getter
+			bg: function() {
+				return 'rgba(255,142,60, ' + this.top / 30 + ')';
+			},
+		},
+		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) => {
+
+			// 	});
+			// },
+
+			//查询用户积分余额和看直播信息统计
+			// 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().then(
+					res => {
+						if (res.code == 200) {
+							this.data = res.member;
+							this.signNum = res.signNum;
+							this.isDaySign = res.isDaySign;
+							this.integral = res.integral;
+							this.sign = JSON.parse(res.sign);
+
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: "请求失败",
+							});
+						}
+					},
+					rej => {}
+				);
+			},
+
+
+			// // 积分
+			// 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);
+
+			// 	});
+			// },
+
+
+
+			getDictByKey(key) {
+				var data = {
+					key: key
+				}
+				getDictByKey(data).then(
+					res => {
+						if (res.code == 200) {
+							this.typeOptions = res.data;
+						}
+					},
+					err => {}
+				);
+
+			},
+
+
+			getUserIntegralLogsList() {
+				let that = this;
+				if (that.loaded == true || that.loading == true) return;
+				that.loading = true;
+				uni.showLoading({
+					title: "加载中..."
+				})
+				getUserIntegralLogsList(that.page).then(
+					res => {
+						that.loading = false;
+						that.loaded = res.data.list.length < that.page.pageSize;
+						that.page.page = that.page.page + 1;
+						that.list.push.apply(that.list, res.data.list);
+						uni.hideLoading()
+					},
+					err => {
+						uni.hideLoading()
+						uni.showToast({
+							title: err.msg,
+							icon: 'none',
+							duration: 2000
+						});
+					}
+				);
+			},
+			// 返回上一页
+			back() {
+				uni.navigateBack()
+			},
+			// tab选择
+			// tabChange(item) {
+			// 	console.log(item)
+			// 	this.tabIndex = item.value
+			// 	this.page.type=this.tabIndex;
+			// 	this.page.page=1;
+			// 	this.list=[];
+			// 	this.loaded=false;
+			// 	this.loading=false;
+			// 	this.getUserIntegralLogsList();
+			// }
+		}
+	}
+</script>
+
+<style lang="scss">
+	.fixed-top-box {
+		width: 100%;
+		position: fixed;
+		top: 0;
+		left: 0;
+		z-index: 1000;
+		transition: all 0.5s;
+
+	}
+
+	.top-cont {
+		width: 100%;
+		height: 654upx;
+		position: relative;
+
+		.bg {
+			width: 100%;
+			height: 100%;
+			position: absolute;
+			top: 0;
+			left: 0;
+			z-index: 1;
+		}
+
+		.top-inner {
+			width: 100%;
+			height: 100%;
+			position: absolute;
+			top: 0;
+			left: 0;
+			z-index: 2;
+
+			.back-box {
+				height: 88upx;
+				padding-left: 22upx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				padding: 0 20upx;
+
+				image {
+					width: 40upx;
+					height: 40upx;
+				}
+
+				.title {
+					font-size: 36upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #FFFFFF;
+				}
+			}
+
+			.available-points {
+				margin-top: 140upx;
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+				justify-content: center;
+
+				.label {
+					font-size: 30upx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #FFFFFF;
+					line-height: 1;
+				}
+
+				.num {
+					font-size: 80upx;
+					font-family: Gilroy;
+					font-weight: 500;
+					color: #FFFFFF;
+					line-height: 1;
+					margin-top: 28upx;
+				}
+			}
+
+			.singn-content {
+				padding: 0 20upx;
+				margin-top: 50upx;
+			}
+
+			.sign-in-box {
+				height: 380upx;
+				background: #FFFFFF;
+				border-radius: 16upx;
+
+				.inner {
+					padding: 40upx 30upx;
+
+					.title-box {
+						font-size: 26upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #666666;
+						line-height: 1;
+
+						.num {
+							font-size: 32upx;
+							font-family: PingFang SC;
+							font-weight: Bold;
+							color: #FF7511;
+							margin: 0 10upx;
+							line-height: 1;
+						}
+					}
+
+					.sign-list {
+						display: flex;
+						align-items: center;
+						justify-content: space-between;
+						margin-top: 40upx;
+
+						.item {
+							display: flex;
+							justify-content: center;
+
+							.right {
+								display: flex;
+								flex-direction: column;
+								align-items: center;
+								justify-content: center;
+
+								image {
+									width: 44upx;
+									height: 44upx;
+									margin-bottom: 20upx;
+								}
+
+								.text {
+									font-size: 24upx;
+									font-family: PingFang SC;
+									font-weight: 500;
+									color: #FF7511;
+									line-height: 1;
+									white-space: nowrap;
+								}
+							}
+
+							.line {
+								width: 34upx;
+								height: 4upx;
+								background: #F6CDA7;
+								border-radius: 2upx;
+								margin-top: 22upx;
+							}
+
+							&:first-child {
+								.line {
+									display: none;
+								}
+							}
+
+							&.active {
+								.line {
+									background: #FF8E3C;
+								}
+							}
+						}
+					}
+				}
+
+				.sign-btn-box {
+					padding: 0 14upx;
+
+					.btn {
+						width: 100%;
+						height: 88upx;
+						box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.05);
+						background-color: #FF7511;
+						border-radius: 44rpx;
+						display: flex;
+						justify-content: center;
+						align-items: center;
+
+						image {
+							width: 32upx;
+							height: 32upx;
+						}
+
+						.text {
+							font-size: 30upx;
+							font-family: PingFang SC;
+							font-weight: bold;
+							color: #FFFFFF;
+							line-height: 1;
+						}
+					}
+				}
+			}
+
+		}
+	}
+
+	.content {
+		margin-top: 20upx;
+		padding: 0 20upx 40upx;
+
+		.points-cont {
+
+			background-color: #FFFFFF;
+			border-radius: 16upx;
+
+			.pub-tab-box {
+				padding: 0 80upx;
+
+				.tab-inner {
+					height: 88upx;
+					line-height: 88upx;
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+				}
+
+				.item {
+					font-size: 28upx;
+					white-space: nowrap;
+					line-height: 1;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #666666;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+
+					&.active {
+						font-weight: bold;
+						color: #333333;
+					}
+
+					.text {
+						position: relative;
+						z-index: 1;
+					}
+
+					.tab-bg {
+						width: 72upx;
+						height: 28upx;
+						position: absolute;
+						top: 17upx;
+						left: 50%;
+						transform: translateX(-36upx);
+						z-index: -1;
+					}
+				}
+			}
+
+			.point-list {
+				padding: 0 30upx;
+
+				.item {
+					padding: 30upx 0;
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+					border-bottom: 1px solid #F0F0F0;
+
+					&:last-child {
+						border-bottom: none;
+					}
+
+					.left {
+						.title {
+							font-size: 28upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #111111;
+							line-height: 1;
+						}
+
+						.time {
+							font-size: 24upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #999999;
+							line-height: 1;
+							margin-top: 22upx;
+						}
+					}
+
+					.right {
+						.add {
+							font-size: 28upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #111111;
+						}
+
+						.less {
+							font-size: 28upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #F56C6C;
+						}
+					}
+				}
+			}
+		}
+	}
+>>>>>>> db97a32e991ee7a9b5a59978a4bee9ad519591ce
 </style>

+ 180 - 0
pages_user/user/integralLogsList.vue

@@ -1,3 +1,4 @@
+<<<<<<< HEAD
 <template>
 	<view class="page">
 		<view class="content">
@@ -175,3 +176,182 @@
 	}
 	 
 </style>
+=======
+<template>
+	<view class="page">
+		<view class="content">
+			<mescroll-body      ref="mescrollRef" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
+			<view class="item" v-for="(item) in dataList">
+				<view class="left">
+					<!-- <text class="title"  >
+						完课积分领取记录
+					</text> -->
+					<text class="title"  >
+						{{utils.getDictLabel2Name(typeOptions,item.logType)}}
+					</text>
+					<view class="time">{{item.createTime}}</view>
+				</view>
+				<view class="right">
+					<text  :class="item.integral>0?'money green':'money red'">{{item.integral}}</text>
+					<text class="remark">剩余积分:{{item.balance}}</text>
+				</view>
+			</view>
+			</mescroll-body>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {getDictByKey} from '@/api/common.js'
+	import {getUserIntegralLogsList} from '@/api/integral.js'
+	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+	export default {
+		mixins: [MescrollMixin], // 使用mixin
+		data() {
+			return {
+				typeOptions:[],
+				mescroll:null,
+				downOption: {
+					auto:false//不要自动加载
+				},
+				upOption: {
+					onScroll:false,
+					use: true, // 是否启用上拉加载; 默认true
+					page: {
+						num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
+						size: 10 // 每页数据的数量,默认10
+					},
+					noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
+					textNoMore:"已经到底了",
+					empty: {
+						icon:'https://hdtobs.obs.cn-north-4.myhuaweicloud.com/hdt/empty_icon.png',
+						tip: '暂无数据'
+					}
+				},
+				dataList: []
+				 
+			}
+		},
+		onLoad() {
+			this.getDictByKey("sys_integral_log_type");
+		},
+		methods: {
+			getDictByKey(key){
+				var data={key:key}
+				getDictByKey(data).then(
+					res => {
+						if(res.code==200){
+							this.typeOptions=res.data;
+						}
+					},
+					err => {
+					}
+				);
+			},
+			mescrollInit(mescroll) {
+				this.mescroll = mescroll;
+			},
+			/*下拉刷新的回调 */
+			downCallback(mescroll) {
+				mescroll.resetUpScroll()
+			},
+			upCallback(page) {
+				//联网加载数据
+				var that = this;
+				var data = {
+					pageNum: page.num,
+					pageSize: page.size
+				};
+				// uni.showLoading({
+				// 	title:"加载中..."
+				// })
+				getUserIntegralLogsList(data).then(res => {
+					uni.hideLoading()
+					if(res.code==200){
+						//设置列表数据
+						if (page.num == 1) {
+							that.dataList = res.data.list; 
+							
+						} else {
+							that.dataList = that.dataList.concat(res.data.list);
+							 
+						}
+						that.mescroll.endBySize(res.data.list.length, res.data.total);
+						
+					}else{
+						uni.showToast({
+							icon:'none',
+							title: "请求失败",
+						});
+						that.dataList = null;
+						that.mescroll.endErr();
+					}
+				});
+			},
+			 
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.page{
+	}
+	.content{
+		display: flex;
+		flex-direction: column;
+		.item{
+			background-color: #fff;
+			padding: 20rpx 10rpx;
+			display: flex;
+			align-items: flex-start;
+			justify-content: space-between;
+			border-top: 1rpx solid #efefef;
+			.left{
+				display: flex;
+				flex-direction: column;
+				align-items: flex-start;
+				justify-content: flex-start;
+				.title{
+					font-size: 26rpx;
+					color: #111;
+				}
+				.time{
+					margin-top: 20rpx;
+					font-size: 24rpx;
+					color: #a5a5a5;
+				}
+			}
+			.right{
+				display: flex;
+				flex-direction: column;
+				align-items: flex-end;
+				justify-content: flex-end;
+				.money{
+					font-size: 28rpx;
+					font-weight: bold;
+					color: #111;
+				}
+				.green{
+					color: green;
+				}
+				.red{
+					color:#ff0000;
+				}
+				.remark{
+					margin-top: 20rpx;
+					font-size: 24rpx;
+					color: #a5a5a5;
+					.green{
+						color: green;
+					}
+					.red{
+						color: red;
+					}
+				}
+			}
+		}
+		
+	}
+	 
+</style>
+>>>>>>> db97a32e991ee7a9b5a59978a4bee9ad519591ce