Parcourir la source

活动详情页,获奖名单页订阅消息跳转的页面返回

DELL il y a 3 ans
Parent
commit
6e00083596
3 fichiers modifiés avec 115 ajouts et 19 suppressions
  1. 28 2
      packageOperate/activity/index.vue
  2. 82 17
      packageOperate/activity/record.vue
  3. 5 0
      pages/activity/index.vue

+ 28 - 2
packageOperate/activity/index.vue

@@ -1,6 +1,17 @@
 <template>
 	<view style="background-image: linear-gradient(#FF8000,#FFA524,#FF8000); width: 100%; height: 100%;">
-		<u-navbar title="免费抽奖" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
+		
+		<view v-if="pagesNum > 1">
+			<u-navbar title="免费抽奖" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
+		</view>
+		<view v-else>
+			<u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" title="免费抽奖">
+				<view class="nav-left flex" slot="left" @click="toActivity">
+					<u-icon name="arrow-left" size="20" color="#333"></u-icon>
+				</view>
+			</u-navbar>
+		</view>
+		
 		<view class="wrap">
 			<view class="wrap-fakeNum">
 				<view class="fakeNum">{{info.fakeNum}}人已参与</view>
@@ -141,6 +152,15 @@
 				<button type="default" class="popupcodethree-default" open-type="share">立即邀请好友助力</button>
 			</view>
 		</u-popup> -->
+		
+		<!-- <u-popup v-if="info.status && JSON.parse(info.status).value == 4"   mode="bottom" @close="close" closeable> -->
+		<u-popup v-if="info.status && JSON.parse(info.status).value == 4" show="true" mode="center" @close="close" round="11">
+			<view style="text-align: center;width: 700rpx; height: 600rpx;">
+					<view style="color: #666;margin-top: 160rpx;font-size: 40rpx;">来晚了,活动已结束</view>
+					<view style="color: #666;margin-top: 50rpx;font-size: 40rpx;">是否前往查看新的免费抽奖活动</view> 
+					<button @click="toActivity" type="default" style="background-color: #FF8000;color: #fff; width: 400rpx;margin-top: 70rpx;">确定</button>
+			</view>
+		</u-popup>	
 	</view>
 </template>
 
@@ -159,6 +179,7 @@
 				inviteCode: '', //邀请码
 				activityTime: 0,
 				activityTimeTwo: 0,
+				pagesNum: "",
 			}
 		},
 		onLoad(opthios) {
@@ -166,9 +187,14 @@
 			this.getDetail()
 		},
 		onShow() {
-
+			this.pagesNum = getCurrentPages().length
 		},
 		methods: {
+			toActivity() {
+				uni.reLaunch({
+					url: `/pages/activity/index?triggerStatus=0`
+				})
+			},
 			getDetail() {
 				uni.showLoading({
 					title: '加载中'

+ 82 - 17
packageOperate/activity/record.vue

@@ -1,6 +1,15 @@
 <template>
 	<view>
-		<u-navbar title="获奖名单" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
+		<view v-if="pagesNum > 1">
+			<u-navbar title="获奖名单" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
+		</view>
+		<view v-else>
+			<u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" title="获奖名单">
+				<view class="nav-left flex" slot="left" @click="toActivity">
+					<u-icon name="arrow-left" size="20" color="#333"></u-icon>
+				</view>
+			</u-navbar>
+		</view>
 		<view class="list">
 			<view v-for="(item,index) in list" :key="index" class="list-view">
 				<view class="award flex">
@@ -25,8 +34,8 @@
 								<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; " class="ells-one">{{item.prizeTitle}}</view>
+						<view class="prize">中奖码:{{item.code}}</view>
+						<view class="ells-one prize">{{item.prizeTitle}}</view>
 					</view>
 				</view>
 			</view>
@@ -38,20 +47,17 @@
 			<view class="activityShow-wrap">
 				<view class="activityShow-wrap-award">
 					<view class="award">恭喜你 获得{{listData.awardName}}</view>
-					<view class="award-name">{{listData.prizeTitle}}title名字</view>
+					<view class="award-name">{{listData.prizeTitle}}</view>
 				</view>
-				<view class="activityShow-wrap-rela" style="position: relative;">
-					<image :src="listData.prizePicUrl" mode="aspectFit" style="position: absolute;top: -260rpx;left: 170rpx; width: 350rpx;"></image>
-					<!-- <image src="../static/activity/effectstwo.png" mode="aspectFit"
-						style="position: absolute;top: -260rpx;left: 170rpx; width: 350rpx;"></image> -->
+				<view class="activityShow-wrap-rela">
+					<image :src="listData.prizePicUrl" mode="aspectFit" class="relaimg"></image>
+					<!-- <image src="../static/activity/effectstwo.png" mode="aspectFit" class="relaimg"></image> -->
 				</view>
-				<view style="text-align: center;margin-top: 120rpx;font-size: 24rpx;color: #999;line-height: 80rpx;">
+				<view class="activityShow-wrap-library">
 					奖品已放入我的奖品库</view>
-				<view class="flex" style="padding-bottom: 40rpx;">
-					<button @click="toPrize()"
-						style="width: 288rpx;height: 100rpx;font-size: 30rpx; line-height: 90rpx; background-color: #fff;color: #F8832C;border: 2rpx solid #F8832C;">前往查看</button><button
-						@click="close()"
-						style="width: 288rpx;height: 100rpx;font-size: 30rpx; line-height: 90rpx; background-color: #F8832C;color: #fff;border: 2rpx solid #F8832C;">关闭</button>
+				<view class="flex activityShow-wrap-btn">
+					<button @click="toPrize()" class="btnone" style="">前往查看</button><button @click="close()"
+						class="btntwo" style="">关闭</button>
 
 				</view>
 
@@ -80,15 +86,24 @@
 				list: [],
 				marketingId: '',
 				closeShow: false,
-				activityShow: false,
-				listData: {}
+				activityShow: true,
+				listData: {},
+				pagesNum: "",
 			}
 		},
 		onLoad(opthios) {
 			this.marketingId = opthios.id
 			this.pageList()
 		},
+		onShow() {
+			this.pagesNum = getCurrentPages().length
+		},
 		methods: {
+			toActivity() {
+				uni.reLaunch({
+					url: `/pages/activity/index?triggerStatus=1`
+				})
+			},
 
 			pageList() {
 				this.pageNum = 1
@@ -147,7 +162,8 @@
 					res => {
 						console.log(res)
 						if (res.code == 0 && res.data && res.data.isHit == 1) {
-							res.data.prizePicUrl = env.filePublic + res.data.prizePicUrl + '?imageView2/2/w/170'
+							let prizePicUrlArr = res.data.prizePicUrl.split(',')
+							res.data.prizePicUrl = env.filePublic + prizePicUrlArr[0] + '?imageView2/2/w/170'
 							this.listData = res.data
 							this.activityShow = true
 						}
@@ -188,6 +204,11 @@
 					flex: 1;
 					padding: 30rpx 0;
 
+					.prize {
+						line-height: 46rpx;
+						color: #666666;
+					}
+
 					.nickName {
 						line-height: 60rpx;
 						font-size: 30rpx;
@@ -224,6 +245,19 @@
 		overflow: hidden;
 		width: 700rpx;
 
+		&-rela {
+			position: relative;
+
+			.relaimg {
+				margin-top: 100rpx;
+				height: 310rpx;
+				position: absolute;
+				top: -260rpx;
+				left: 170rpx;
+				width: 350rpx;
+			}
+		}
+
 		&-award {
 			width: 100%;
 			height: 350rpx;
@@ -246,6 +280,37 @@
 			}
 		}
 
+		&-library {
+			text-align: center;
+			margin-top: 140rpx;
+			font-size: 24rpx;
+			color: #999;
+			line-height: 80rpx;
+		}
+
+		&-btn {
+			padding-bottom: 40rpx;
+
+			.btnone {
+				width: 288rpx;
+				height: 100rpx;
+				font-size: 30rpx;
+				line-height: 90rpx;
+				background-color: #fff;
+				color: #F8832C;
+				border: 2rpx solid #F8832C;
+			}
+
+			.btntwo {
+				width: 288rpx;
+				height: 100rpx;
+				font-size: 30rpx;
+				line-height: 90rpx;
+				background-color: #F8832C;
+				color: #fff;
+				border: 2rpx solid #F8832C;
+			}
+		}
 	}
 
 	.choiceShow-wrap {}

+ 5 - 0
pages/activity/index.vue

@@ -65,6 +65,11 @@
 				triggerStatus: 0,
 			}
 		},
+		onLoad(opthios) {
+			if(opthios.triggerStatus){
+				this.triggerStatus = opthios.triggerStatus
+			}
+		},
 		onShow() {
 			this.pageList()
 		},