lhl 1 gadu atpakaļ
vecāks
revīzija
1924e079b3

+ 7 - 0
api/zero.js

@@ -154,4 +154,11 @@ export function cancelBuy(data) {
 		method: 'post',
 		data
 	});
+}
+
+export function lotteryLst() {
+	return request({
+		url: '/api/lottery/lst',
+		method: 'get'
+	});
 }

+ 12 - 7
components/uni-countdown/uni-countdown.vue

@@ -57,7 +57,6 @@
 		},
 		watch: {
 			day(val) {
-				console.log(val,'day')
 				this.changeFlag()
 			},
 			hour(val) {
@@ -71,6 +70,7 @@
 			}
 		},
 		created: function(e) {
+			clearInterval(this.timer)
 			this.startData();
 		},
 		beforeDestroy() {
@@ -115,6 +115,9 @@
 			},
 			startData() {
 				this.seconds = this.toSeconds(this.day, this.hour, this.minute, this.second)
+				if(this.timer) {
+					clearInterval(this.timer)
+				}
 				if (this.seconds <= 0) {
 					return
 				}
@@ -131,7 +134,6 @@
 			changeFlag() {
 				if (!this.syncFlag) {
 					this.seconds = this.toSeconds(this.day, this.hour, this.minute, this.second)
-					console.log(this.seconds)
 					this.startData();
 					this.syncFlag = true;
 				}
@@ -141,8 +143,8 @@
 </script>
 <style lang="scss" scoped>
 	@import '~@/uni.scss';
-	$countdown-height: 40rpx;
-	$countdown-width: 40rpx;
+	$countdown-height: 80rpx;
+	$countdown-width:80rpx;
 
 	.uni-countdown {
 		/* #ifndef APP-NVUE */
@@ -161,8 +163,9 @@
 		/* #endif */
 		justify-content: center;
 		line-height: $countdown-height;
-		padding: 5rpx;
-		font-size: $uni-font-size-sm;
+		padding: 5rpx 20rpx;
+		// font-size: $uni-font-size-sm;
+		font-size: 60rpx;
 	}
 
 	.uni-countdown__number {
@@ -176,7 +179,9 @@
 		line-height: $countdown-height;
 		// margin: 5rpx;
 		text-align: center;
-		font-size: $uni-font-size-sm;
+		// font-size: $uni-font-size-sm;
+		font-size: 48rpx;
 		border-radius: 8rpx;
+		font-weight: bold;
 	}
 </style>

+ 1 - 0
manifest.json

@@ -127,6 +127,7 @@
             "proxy" : {
                 "/api" : {
                     "target" : "https://www.jlxnykj.cn/api",
+					// "target" : "http://7131.frp.qiniu1314.com/api",
                     // "changeOrigin": true,
                     "pathRewrite" : {
                         "/api" : "" // rewrite path

+ 14 - 2
pages/index/gift.vue

@@ -36,22 +36,33 @@
 		},
 		data() {
 			return {
+				is_pack: 0,
 				goodList: [], //商品列表
 				loadingType: 'more',
 				page: 1,
 				limit: 10,
 				type: 0,
 				loaded: false,
-				pUser: {}
+				pUser: {},
+				is_zero: 0,
 			}
 		},
 		onLoad(opt) {
 			if (opt.type) {
 				this.type = opt.type
+				
+			}
+			if(opt.tit) {
 				uni.setNavigationBarTitle({
 					title: opt.tit
 				})
 			}
+			if(opt.is_pack) {
+				this.is_pack = opt.is_pack
+			}
+			if(opt.is_zero) {
+				this.is_zero = opt.is_zero
+			}
 			this.getGoodList()
 		},
 		onShow() {
@@ -115,7 +126,8 @@
 					})
 				} else {
 					getProducts({
-						is_pack: 1,
+						is_pack: obj.is_pack,
+						is_zero: obj.is_zero,
 						page: obj.page,
 						limit: obj.limit,
 					}).then(res => {

+ 2 - 2
pages/index/index.vue

@@ -133,7 +133,7 @@
 				muted: false,
 				cateList: [
 					{
-						path: '/pages/index/gift',
+						path: '/pages/index/gift?is_pack=1',
 						img: '../../static/icon/inx1.png',
 						tit: 'VIP商品'
 					},
@@ -158,7 +158,7 @@
 						tit: '本地生活'
 					},
 					{
-						path: '/pages/index/gift?type=13',
+						path: '/pages/index/gift?is_zero=1',
 						img: '../../static/icon/inx6.png',
 						tit: '超级秒杀'
 					},

+ 1 - 1
pages/index/zero.vue

@@ -26,7 +26,7 @@
 		</view>
 		<view class="flex banne">
 			<image src="../../static/img/zjf.png" mode="" @click="navto('/pages/zero/task')"></image>
-			<image src="../../static/img/yj.png" mode="" @click="navto('/pages/index/dkf')"></image>
+			<image src="../../static/img/yj.png" mode="" @click="navto('/pages/zero/chou')"></image>
 		</view>
 		<view class="flex nav">
 			<view class="nav-item" v-for="(item,index) in navList" :class="{'action': current == index}"

+ 1 - 0
pages/money/pay.vue

@@ -260,6 +260,7 @@ export default {
 			let prepage = obj.$api.prePage();
 
 			let data = {
+				is_zero: prepage.is_zero,
 				is_pack: prepage.is_pack,//是否礼包商品
 				real_name: prepage.addressData.real_name, //联系人名称
 				phone: prepage.addressData.phone, //联系人号码

+ 4 - 0
pages/order/createOrder.vue

@@ -279,6 +279,7 @@
 				payType: true, //是否可支付
 				pinkid: '' ,//保存拼团商品id
 				is_pack: 0,
+				is_zero: 0,
 				affiliation_uid: 0,
 			};
 		},
@@ -286,6 +287,9 @@
 			if(option.is_pack) {
 				this.is_pack = option.is_pack
 			}
+			if(option.is_zero) {
+				this.is_zero = option.is_zero
+			}
 			if(option.affiliation_uid) {
 				this.affiliation_uid = option.affiliation_uid
 			}

+ 3 - 2
pages/product/product.vue

@@ -463,7 +463,8 @@
 					uniqueId: obj.uniqueId, //商品标签
 					new: '1', //商品是否新增加到购物车1为不加入0为加入
 					mer_id: obj.shopId,
-					is_pack: obj.goodsObjact.is_pack
+					is_pack: obj.goodsObjact.is_pack,
+					is_zero: obj.goodsObjact.is_zero
 					// type: 0,//0为余额支付  1为消费券支付 2为积分支付
 				};
 				if (obj.type == 2) {
@@ -500,7 +501,7 @@
 							uni.navigateTo({
 								url: '/pages/order/createOrder?id=' + data.cartId + '&goodsType=' + obj
 									.goodsType + '&is_pack=' + obj.goodsObjact.is_pack + '&affiliation_uid=' +
-									obj.goodsObjact.affiliation_uid
+									obj.goodsObjact.affiliation_uid + '&is_zero=' + obj.goodsObjact.is_zero
 							});
 						}
 						if (obj.type == 2) {

+ 43 - 16
pages/zero/award.vue

@@ -8,17 +8,40 @@
 			</view>
 			<view class="content-bg"><image src="../../static/img/tg-bg.png" mode=""></image></view>
 			<view class="money-box">
-				<template v-if="type == 9">
+				<!-- <template v-if="type == 9">
 					<view class="money" v-if="pUser && pUser.recommend">{{ pUser.recommend.total|| 0 }}</view>
 					<view class="money" v-else>0</view>
 				</template>
 				<template v-if="type == 10">
 					<view class="money" v-if="pUser && pUser.pass_integral">{{ pUser.pass_integral.total|| 0 }}</view>
 					<view class="money" v-else>0</view>
-				</template>
+				</template> -->
+				<view class="info-item">
+					<view class="info-font">待释放</view>
+					<template v-if="type == 9">
+						<view class="info-num" v-if="pUser && pUser.recommend">{{pUser.recommend.progress || '0'}}</view>
+						<view class="info-num" v-else>0</view>
+					</template>
+					<template v-if="type == 10">
+						<view class="info-num" v-if="pUser && pUser.pass_integral">{{pUser.pass_integral.progress || '0'}}</view>
+						<view class="info-num" v-else>0</view>
+					</template>
+				</view>
+				<view class="shu"></view>
+				<view class="info-item">
+					<view class="info-font">已释放</view>
+					<template v-if="type == 9">
+						<view class="info-num" v-if="pUser && pUser.recommend">{{pUser.recommend.use_recommend || '0'}}</view>
+						<view class="info-num" v-else >{{pUser.recommend.use_recommend || '0'}}</view>
+					</template>
+					<template v-if="type == 10">
+						<view class="info-num" v-if="pUser && pUser.pass_integral">{{pUser.pass_integral.use_recommend || '0'}}</view>
+						<view class="info-num" v-else >{{pUser.pass_integral.use_recommend || '0'}}</view>
+					</template>
+				</view>
 			</view>
 		</view>
-		<view class="info-box flex">
+		<!-- <view class="info-box flex">
 			<view class="info-item">
 				<view class="info-font">待释放</view>
 				<template v-if="type == 9">
@@ -42,7 +65,7 @@
 					<view class="info-num" v-else >{{pUser.pass_integral.use_recommend || '0'}}</view>
 				</template>
 			</view>
-		</view>
+		</view> -->
 		<view class="navbar">
 			<view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
 		</view>
@@ -267,6 +290,7 @@ export default {
 page {
 	background: #f1f1f1;
 	height: 100%;
+	font-family: PingFang SC;
 }
 .status_bar {
 	height: var(--status-bar-height);
@@ -274,14 +298,14 @@ page {
 }
 .content-money {
 	position: relative;
-	height: 480rpx;
+	height: 400rpx;
 	.content-bg {
 		position: absolute;
 		top: 0;
 		left: 0;
 		right: 0;
 		width: 750rpx;
-		height: 480rpx;
+		height: 100%;
 		image {
 			width: 100%;
 			height: 100%;
@@ -298,7 +322,6 @@ page {
 			top: 0;
 			width: 100%;
 			font-size: 36rpx;
-			font-family: PingFang SC;
 			font-weight: bold;
 			color: #fffeff;
 			height: 80rpx;
@@ -342,14 +365,12 @@ page {
 		line-height: 1;
 		.info-font {
 			font-size: 30rpx;
-			font-family: PingFang SC;
 			font-weight: bold;
 			color: #999999;
 		}
 		.info-num {
 			margin-top: 30rpx;
 			font-size: 30rpx;
-			font-family: PingFang SC;
 			font-weight: bold;
 			color: #181818;
 		}
@@ -370,17 +391,25 @@ page {
 	text-align: center;
 	/* #ifdef APP-PLUS */
 	height: 200rpx;
-	display: flex;
-	flex-direction: column;
-	justify-content: center;
+	// flex-direction: column;
+	// justify-content: center;
 	/* #endif */
 	/* #ifdef MP-WEIXIN */
 	padding-top: 40rpx;
 	/* #endif */
-
+	display: flex;
+	justify-content: space-around;
+	.info-font {
+		font-size: 30rpx;
+		font-weight: bold;
+	}
+	.info-num {
+		margin-top: 30rpx;
+		font-size: 30rpx;
+		font-weight: bold;
+	}
 	.money {
 		font-size: 72rpx;
-		font-family: PingFang SC;
 		font-weight: bold;
 		color: #ffffff;
 	}
@@ -396,7 +425,6 @@ page {
 	color: #ffffff;
 	padding: 0rpx 50rpx;
 	font-size: 30rpx;
-	font-family: PingFang SC;
 	font-weight: bold;
 	color: #ffffff;
 }
@@ -479,7 +507,6 @@ page {
 	background: linear-gradient(0deg, #2e58ff, #32c6ff);
 	border-radius: 44rpx;
 	font-size: 36rpx;
-	font-family: PingFang SC;
 	font-weight: 500;
 	color: #ffffff;
 	text-align: center;

+ 193 - 60
pages/zero/chou.vue

@@ -1,99 +1,232 @@
 <template>
-	<view class="content">
-		<image src="../../static/img/ttchou.png" mode="" class="bg"></image>
-		<view class="flex v-list">
-			<view class="action">
-				已观看
-			</view>
-			<view class="">
-				未看完
+	<view class="wap">
+		<view class="base-pst djs-wrap flex">
+			<uni-countdown color="#000000" background-color="#fff" splitor-color="#FFFFFF" :show-day="false" :day="0"
+				:hour="seckillObj.stopTimeH" :minute="seckillObj.stopTimeM" :second="seckillObj.stopTimeS"
+				@timeup="goStop"></uni-countdown>
+		</view>
+		<image src="../../static/img/goto.png" mode="" class="base-pst goto" @click="golock"></image>
+		<view class="base-pst content-wrap">
+			<view class="tit">
+				只要完成视频任务,即可参与抽奖
 			</view>
-			<view class="">
-				未看完
+			<view class="jl-list flex" v-for="item in puser.draw">
+				<view class="jl-tit">
+					{{item.awards}}:{{item.name}}
+				</view>
+				<view class="jl-mun">
+					{{item.num}} 份
+				</view>
 			</view>
-		</view>
-		<image src="../../static/img/golock.png" mode="" class="golock" @click="golock"></image>
-		<view class="zj-wrap">
-			
+			<image src="../../static/img/zjmd.png" mode="" class="zjmd"></image>
+			<scroll-view scroll-y="true" class="jl-end">
+				<view class="end-list flex" v-for="(item,index) in endList">
+					<view class="">
+						{{showTime(item.add_time)}}
+					</view>
+					<view class="">
+						{{showPhone(item.phone) }}
+					</view>
+					<view class="">
+						{{showTit(item.draw_id)}}
+					</view>
+				</view>
+			</scroll-view>
 		</view>
 	</view>
 </template>
 
 <script>
+	import {
+		passUser,lotteryLst
+	} from '@/api/zero.js'
+	import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
 	export default {
+		components: {
+			uniCountdown
+		},
 		data() {
 			return {
-				
+				seckillObj: {
+					stopTime: 0, //结束时间
+					stop: false, //是否结束
+					stopTimeH: 0, //小时
+					stopTimeM: 0, //分钟
+					stopTimeS: 5 //秒钟
+				},
+				puser: {},
+				endList: []
 			}
 		},
 		onLoad() {
-			
+
 		},
 		onShow() {
-			
+			this.passUser()
+			this.lotteryLst()
 		},
 		onReachBottom() {
-			
+
 		},
 		onReady() {
-			
+
 		},
 		methods: {
+			showPhone(phone) {
+				const phoneNumber = phone + ''; // 手机号
+				const hiddenNumber = phoneNumber.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
+				return hiddenNumber
+			},
+			showTime(time) {
+				const timestamp = time*1000; // 时间戳
+				
+				const date = new Date(timestamp); // 创建 Date 对象
+				
+				const year = date.getFullYear(); // 获取年份
+				const month = date.getMonth() + 1; // 获取月份(注意月份是从 0 开始计数的,所以要加 1)
+				const day = date.getDate(); // 获取日期
+				const hours = date.getHours(); // 获取小时
+				const minutes = date.getMinutes(); // 获取分钟
+				const seconds = date.getSeconds(); // 获取秒钟
+				
+				// const formattedTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+				return `${month}-${day} ${hours}:${minutes}:${seconds}`
+				// console.log(formattedTime);
+
+			},
+			passUser() {
+				passUser().then(res => {
+					// console.log(res)
+					let data = res.data
+					this.puser = res.data
+					this.getStep(data.service_time,data.lottery)
+				})
+			},
+			lotteryLst() {
+				lotteryLst().then(res => {
+					this.endList = res.data.list
+				})
+			},
+			showTit(id) {
+				let qdata = this.puser.draw.find(item => item.id == id)
+				return qdata.name
+			},
+			goStop() {
+				// console.log('is_end')
+				this.lotteryLst()
+			},
 			golock() {
 				uni.navigateTo({
-					url:'/pages/zero/ren'
+					url: '/pages/zero/ren'
 				})
+			},
+			getStep(timestamp1, timestamp2) {
+				//timestamp1 服务器时间
+				//timestamp2 开奖时间
+				const diff = (timestamp2 - timestamp1)*1000; // 计算时间戳差值(毫秒)
+				if (diff < 0) {
+					this.seckillObj = {
+						stopTime: 0, //结束时间
+						stop: true, //是否结束
+						stopTimeH: 0, //小时
+						stopTimeM: 0, //分钟
+						stopTimeS: 0 //秒钟
+					}
+					this.lotteryLst()
+				}else {
+					this.seckillObj = {
+						stopTime: timestamp2, //结束时间
+						stop: false, //是否结束
+						stopTimeH: Math.floor(diff / (1000 * 60 * 60)), //小时
+						stopTimeM: Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60)), //分钟
+						stopTimeS: Math.floor((diff % (1000 * 60)) / 1000) //秒钟
+					}
+				}
 			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
-	page {
-		background-color: #fb8048;
-		height: 100%;
-	}
-	.content {
-		padding-top: 95rpx;
-	}
-	.bg {
-		display: block;
-		width: 706rpx;
-		height: 1185rpx;
+	.base-pst {
+		position: absolute;
+		left: 0;
+		right: 0;
 		margin: auto;
 	}
-	.v-list {
-		width: 370rpx;
-		height: 30rpx;
-		// background-color: red;
-		// border: 1px solid red;
-		position: absolute;
-		top: 740rpx;
-		left: 215rpx;
-		font-size: 19rpx;
-		text-align: center;
-		view {
-			width: 29%;
-			color: #D0373D;
+
+	.wap {
+		width: 100%;
+		height: 1800rpx;
+		background-image: url('../../static/img/choubg.png');
+		background-size: 100% 100%;
+
+		.djs-wrap {
+			width: 698rpx;
+			height: 247rpx;
+			top: 323rpx;
+			background-image: url('../../static/img/djs-wap-bg.png');
+			background-size: 100% 100%;
+			justify-content: center;
+			padding-top: 80rpx;
 		}
-		.action {
-			color: #999999;
+
+		.goto {
+			width: 354rpx;
+			height: 104rpx;
+			top: 600rpx;
+		}
+
+		.content-wrap {
+			// background-color: red;
+			color: #C90605;
+			height: 960rpx;
+			top: 750rpx;
+			width: 630rpx;
+			text-align: center;
+			font-size: 30rpx;
+
+			.tit {
+				padding-top: 50rpx;
+				padding-bottom: 20rpx;
+			}
+
+			.jl-list {
+				background-image: url('../../static/img/jllist.png');
+				background-size: 100% 100%;
+				width: 444rpx;
+				height: 69rpx;
+				margin: 20rpx auto;
+
+				.jl-tit {
+					font-weight: 500;
+					font-size: 32rpx;
+					color: #A10920;
+					padding-left: 30rpx;
+				}
+
+				.jl-mun {
+					text-align: center;
+					width: 100rpx;
+					font-weight: 800;
+					font-size: 26rpx;
+					color: #FFF2D6;
+				}
+			}
+
+			.zjmd {
+				width: 414rpx;
+				height: 73rpx;
+				margin: 30rpx auto;
+			}
 		}
 	}
-	.golock {
-		width: 354rpx;
-		height: 105rpx;
-		position: absolute;
-		left: 215rpx;
-		top: 890rpx;
+
+	.jl-end {
+		height: 300rpx;
 	}
-	.zj-wrap {
-		width: 560rpx;
-		height: 254rpx;
-		// background-color: #fff;
-		border: 1px solid red;
-		position: absolute;
-		left: 118rpx;
-		top: 1030rpx;
+
+	.end-list {
+		padding: 0 30rpx;
 	}
 </style>

BIN
static/img/choubg.png


BIN
static/img/djs-wap-bg.png


BIN
static/img/goto.png


BIN
static/img/jllist.png


BIN
static/img/zjmd.png