Explorar o código

免费抽奖模块新增获奖名单页面

DELL %!s(int64=3) %!d(string=hai) anos
pai
achega
aa9f0f264e

+ 14 - 6
packageOperate/activity/index.vue

@@ -13,7 +13,6 @@
 			</view>
 		</u-count-down>
 
-
 		<view>
 			<view v-for="(item,index) in awardsList" :key="index">
 				<view v-if="item.name == '一等奖'">
@@ -28,14 +27,14 @@
 						<view style="text-align: center;">
 							<image :src="itemTwo.picUrl" mode="" style="width: 400rpx;"></image>
 							<view>{{itemTwo.title}}</view>
-							<view>¥{{itemTwo.value}}</view>
+							<view>¥{{itemTwo.value / 100}}</view>
 						</view>
 					</view>
 					<view v-if="item.prizeList.length > 1 " style="text-align: center;">以上奖品随机获得一件</view>
 				</view>
 			</view>
 			<view v-for="(item,index) in awardsList" :key="index">
-				<view v-if="item.name == '一等奖'">
+				<view v-if="item.name != '一等奖'">
 					<view style="height: 60rpx;">
 						<view style="float: left;"> 
 							<text style="display: inline-block; background-color: #bbbbbb;width: 200rpx;height: 60rpx;line-height:60rpx;text-align: center;">{{item.name}}</text>
@@ -49,7 +48,7 @@
 							</view>
 							<view style="display: inline-block;width: 60%;margin-left: 20rpx;">
 								<view>{{itemTwo.title}}</view>
-								<view>¥{{itemTwo.value}}</view>
+								<view>¥{{itemTwo.value / 100}}</view>
 							</view>
 
 						</view>
@@ -94,7 +93,7 @@
 				<text style="color: #8c8c8c; font-size: 24rpx;">每邀请一位好友助力成功,即可获得1个抽奖码,没有上限</text>
 			</view>
 			<view style="padding: 0rpx 20rpx 50rpx ; ">
-				<button type="default" @click="exChange" style="background-color: #f7682b; color: #fff;"  open-type="share">立即邀请好友助力</button>
+				<button type="default" style="background-color: #f7682b; color: #fff;"  open-type="share">立即邀请好友助力</button>
 			</view>
 
 
@@ -165,8 +164,14 @@
 				$http.post('/api/v1/mp/user/marketing/inviteCode', {}).then(res=>{
 					if(res.code == 0){
 						this.inviteCode = res.data
+						console.log(this.inviteCode);
+					}
+				})
+				uni.requestSubscribeMessage({
+					tmplIds:['3y_My-yRmqmGd3-f-vAwNaK4LQeehzXBSNDi_5wcnFI','FGcPOV1j9ApESr3VUlWjFr6E1vF4X_h0LLN82T2CLL0','92xxL8XTRPLROyNUtmN04OT0kyq4iwSCH3sz-j6zbZs'],
+					success (res) {
+						console.log(res);
 					}
-					
 				})
 			},
 			close() {
@@ -247,5 +252,8 @@
 				border-radius: 20rpx;
 			}
 		}
+		// 设置ios刘海屏底部横线安全区域
+		padding-bottom: constant(safe-area-inset-bottom);
+		padding-bottom: env(safe-area-inset-bottom);
 	}
 </style>

+ 136 - 3
packageOperate/activity/record.vue

@@ -1,9 +1,142 @@
 <template>
-	<view>中奖记录</view>
+	<view>
+		<u-navbar title="获奖名单" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
+		<view class="list">
+			<view v-for="(item,index) in list" :key="index" class="list-view">
+				<view class="award">
+					<view class="award-avatar">
+						<image :src="item.avatar" mode=""></image>
+					</view>
+					<view class="award-nickNames">
+						<view class="nickName"><text>{{item.nickName}}</text>
+							<view v-if="item.awardName == '一等奖'" class="awardName">
+								<image src="../../static/activity/one.png" mode="">
+								</image>
+								<text style="color: #FFD225;">{{item.awardName}}</text>
+							</view>
+							<view v-else-if="item.awardName == '二等奖'" class="awardName">
+								<image src="../../static/activity/two.png" mode="">
+								</image>
+								<text style="color: #94CBEC;">{{item.awardName}}</text>
+							</view>
+							<view v-else-if="item.awardName == '三等奖'" class="awardName">
+								<image src="../../static/activity/three.png" mode=""></image>
+								<text style="color: #F2B47A;">{{item.awardName}}</text>
+							</view>
+						</view>
+						<view style="line-height: 46rpx; color: #666666;">中奖码:{{item.code}}</view>
+						<view style="line-height: 46rpx; color: #666666;">{{item.prizeTitle}}</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
 </template>
 
 <script>
+	import env from '../../config/env.js'
+	import $http from '@/utils/request.js'
+	export default {
+		data() {
+			return {
+				list: [],
+				marketingId: '',
+				total: '',
+			}
+		},
+		onLoad(opthios) {
+			this.marketingId = opthios.id
+			this.pageList()
+		},
+		methods: {
+			pageList() {
+				this.pageNum = 1
+				this.list = []
+				this.getList()
+			},
+			getList() {
+				uni.showLoading({
+					title: '加载中'
+				});
+				this.loading = true
+				$http.post(`/api/v1/mp/user/marketing/hit/prize/list`, {
+					marketingId: this.marketingId,
+				}).then(res => {
+					console.log(res);
+					uni.hideLoading();
+					this.loading = false
+					if (res.code == 0) {
+						res.rows.forEach(item => {
+							let prizePicUrlArr = item.prizePicUrl.split(',')
+							item.prizePicUrl = env.filePublic + prizePicUrlArr[0] + '?imageView2/2/w/170'
+							item.avatar = env.filePublic + item.avatar + '?imageView2/2/w/170'
+						})
+						this.total = res.total
+						this.list = this.list.concat(res.rows)
+					}
+				}).catch(() => {
+					uni.hideLoading();
+					this.loading = false
+				})
+			},
+
+		}
+	}
 </script>
 
-<style>
-</style>
+<style lang="scss" scoped>
+	.list {
+
+		&-view {
+			padding: 10rpx 20rpx;
+
+			.award {
+				border-radius: 22rpx;
+				width: 381px;
+				height: 108px;
+				background-color: #fff;
+				overflow: hidden;
+
+				&-avatar {
+					float: left;
+					padding: 50rpx 32rpx;
+
+					image {
+						height: 100rpx;
+						width: 100rpx;
+						border-radius: 100rpx;
+					}
+				}
+
+				&-nickNames {
+					float: left;
+					padding: 30rpx 0;
+
+					.nickName {
+						line-height: 60rpx;
+						font-size: 30rpx;
+
+						.awardName {
+							display: inline-block;
+							image {
+								width: 40rpx;
+								height: 36rpx;
+								margin-left: 30rpx;
+								vertical-align: -10%;
+							}
+							text {
+								display: inline-block;
+								font-size: 26rpx;
+								line-height: 26rpx;
+							}
+						}
+
+					}
+				}
+			}
+		}
+		// 设置ios刘海屏底部横线安全区域
+		padding-bottom: constant(safe-area-inset-bottom);
+		padding-bottom: env(safe-area-inset-bottom);
+	}
+</style>

+ 103 - 36
pages/activity/index.vue

@@ -1,41 +1,42 @@
 <template>
-	<view style="width: 100%;height: 100%;">
+	<view class="activity">
 		<u-navbar leftIconSize="0" :placeholder="true" bgColor="#ffffff">
-			<view class="u-nav-slot" slot="left">
-				<u-tabs @change="changeTab" :scrollable="false" :list="statusArr" lineWidth="30" lineHeight="1"
-					lineColor="#E96737" :activeStyle="{
-										color: '#E96737',
-										transform: 'scale(1)',
-										width: '65px',
-										
-									}" :inactiveStyle="{
-										color: '#333',
-										transform: 'scale(1)',
-										width: '65px'
-									}" itemStyle="padding-left: 11px; padding-right: 11px; height: 44px;text-align: center;">
-				</u-tabs>
-			</view>
+			<view class="u-nav-slot" slot="left" style="font-size: 32rpx;">免费抽奖</view>
 		</u-navbar>
-		<view class="list" style="padding: 0 10rpx;">
-			<view v-for="(item,index) in list" :key="index" style="text-align: center;">
-				<view class="" style="background-color: #FFFFFF;margin-bottom: 20rpx;">
-					<view style="">
-						<image :src="item.picUrl" mode="" style="width: 730rpx;height: 350rpx;"></image>
-					</view>
-					<view class="" style="width: 730rpx;height: 100rpx; margin: 0 auto;">
-						<view style="text-align: left; float: left;">
-							<view>活动名称:{{item.title}}</view>
-							<view>开始时间:{{item.startTime}}</view>
+		<view class="u-nav-slot" slot="left" style="background-color: #ffffff;width: 100%;">
+			<u-tabs @change="changeTab" :scrollable="false" :list="statusArr" lineWidth="30" lineHeight="1"
+				lineColor="#E96737" :activeStyle="{
+									color: '#E96737',
+									transform: 'scale(1)',
+									width: '130rpx',
+									
+								}" :inactiveStyle="{
+									color: '#999999',
+									transform: 'scale(1)',
+									width: '130rpx'
+								}" itemStyle="padding-left: 11px; padding-right: 11px; height: 44px;text-align: center;  ">
+			</u-tabs>
+		</view>
+		<view class="list">
+			<view v-for="(item,index) in list" :key="index" class="list-view">
+				<view class="list-view-slot">
+					<navigator :url="item.status.value == 4 ?`/packageOperate/activity/record?id=${ item.id }`:`/packageOperate/activity/index?id=${ item.id }`">
+						<view>
+							<image :src="item.picUrl" mode="" class="list-view-slot-img"></image>
 						</view>
-						<view style="float: right;">
-							<navigator :url="`/packageOperate/activity/index?id=${ item.id }`">
-								<button v-if="item.status.value == 3"
-									style="height: 65rpx;line-height: 65rpx;background-color:#901199;color: #fff;margin-top: 16rpx;">查看详情</button>
-								<button v-else
-									style="height: 65rpx;line-height: 65rpx;background-color:#901199;color: #fff;margin-top: 16rpx;">即将开始</button>
-							</navigator>
+						<view class="list-view-slot-bor">
+							<view  class="list-view-slot-bor-title">
+								<view class="time bor-title">{{item.title}}</view>
+								<view class="time" >开奖时间:{{ $parseTime(item.startTime, '{y}-{m}-{d} {h}:{i}:{s}')}}</view>
+							</view>
+							<view class="details">
+								<button class="details-button" v-if="item.status.value == 3" >查看详情</button>
+								<button class="details-buttonTwo" v-else-if="item.isHit == 0" >未中奖</button>
+								<button class="details-buttonTwo" v-else-if="item.isHit == 1">已中奖</button>
+								<button class="details-buttonTwo" v-else >即将开始</button>
+							</view>
 						</view>
-					</view>
+					</navigator>
 				</view>
 
 			</view>
@@ -56,10 +57,10 @@
 			return {
 				list: [],
 				statusArr: [{
-					name: '待开奖'
+					name: '参与抽奖'
 				}, {
 					name: '已开奖',
-				}],
+				},{disabled: true},{disabled: true},{disabled: true}],
 				triggerStatus: 0,
 			}
 		},
@@ -111,7 +112,73 @@
 </script>
 
 <style lang="scss" scoped>
-	.list {}
+	.activity {
+		width: 100%;
+		height: 100%;
+		// 设置ios刘海屏底部横线安全区域
+		padding-bottom: constant(safe-area-inset-bottom);
+		padding-bottom: env(safe-area-inset-bottom);
+	}
+	.list {
+		padding: 0 20rpx;
+		&-view {
+			text-align: center;
+			height: 530rpx;
+			&-slot {
+				background-color: #FFFFFF;
+				// margin-bottom: 20rpx;
+				border-radius: 22rpx;
+				&-img {
+					 width: 100%;
+					 height: 370rpx;
+					 border-radius: 22rpx 22rpx 0 0;
+					
+				}
+				&-bor {
+					line-height: 50rpx;
+					width: 700rpx;
+					height: 120rpx;
+					margin: 0 auto;
+					padding:10rpx 20rpx 0 20rpx;
+					border-radius: 0 0 22rpx 22rpx ;
+					&-title {
+						text-align: left; float: left;
+						.time {
+							color: #333333;
+						}
+						.bor-title {
+							font-size: 34rpx;
+						}
+					}
+					.details {
+						float: right;
+						.details-button{
+							width: 200rpx;
+							height: 72rpx;
+							line-height: 72rpx;
+							background-color: #F9822C;
+							color: #fff;
+							margin-top: 18rpx;
+							font-size: 30rpx;
+							border-radius: 36rpx;
+						}
+						.details-buttonTwo{
+							width: 200rpx;
+							height: 72rpx;
+							line-height: 72rpx;
+							background-color: #BBBBBB;
+							color: #fff;
+							margin-top: 18rpx;
+							font-size: 30rpx;
+							border-radius: 36rpx;
+						}
+					}
+					
+				}
+			}
+		}
+
+	}
 
 	.empty {
 		height: 60vh;

+ 9 - 0
pages/index/index.vue

@@ -176,6 +176,15 @@
 				uni.setStorageSync('shareUid', this.sceneArr[0])
 				uni.setStorageSync('shareType', this.sceneArr[1])
 			}
+			/**
+			 * 免费活动邀请助力分享跳转接收参数
+			 * inviteCode: 邀请码
+			 * marketingId: 活动id
+			 * */
+			if (opthios.inviteCode) {
+				console.log(opthios.inviteCode)
+				console.log(opthios.marketingId)
+			}
 			
 			// #ifdef MP-WEIXIN
 			const res = uni.getMenuButtonBoundingClientRect()

BIN=BIN
static/activity/one.png


BIN=BIN
static/activity/three.png


BIN=BIN
static/activity/two.png