Ver código fonte

我的抽奖码调整

DELL 3 anos atrás
pai
commit
ac82d8fc79
2 arquivos alterados com 43 adições e 19 exclusões
  1. 41 18
      packageOperate/activity/index.vue
  2. 2 1
      pages/activity/index.vue

+ 41 - 18
packageOperate/activity/index.vue

@@ -123,10 +123,11 @@
 					<view class="codethree">
 						<image src="../static/activity/off.png" mode="" class="codeimg"></image>
 					</view>
-					<text class="codesix" style="">还没有抽奖码</text>
+					<text class="codesix">还没有抽奖码</text>
 				</view>
-				<view class="wrap-description-codesix">邀请好友助力,获取抽奖码</view>
-				<view class="wrap-description-codesixtwo">每邀请一位好友助力成功,即可获得1个抽奖码,抽奖码越多中奖概率越大。</view>
+				<view class="wrap-description-codesix" v-if="info.codeList && info.codeList.length > 0">再获取1个抽奖码可超过当前<view class="view">{{ (info.codeList.length + 4)*5 > 80 ? 80 : (info.codeList.length + 4)*5}}%</view>  的人</view>
+				<view class="wrap-description-codesixtwo">每邀请一位好友助力成功,即可获得1个抽奖码</view>
+				<view class="wrap-description-codesixtwo">抽奖码越多中奖概率越大</view>
 			</view>
 
 			<!-- 关注公众号 -->
@@ -148,14 +149,17 @@
 
 		<view class="footer-fixed">
 			<view class="flex btn">
-				<button v-if="info.status && JSON.parse(info.status).value == 3" type="default" @click="exChange"
-					open-type="share">获取抽奖码</button>
-				<u-count-down v-else :time="activityTimeTwo" format="DD:HH:mm:ss" autoStart millisecond
+				<button v-if="info.codeType == 2" type="default" @click="exChange"
+					open-type="share">分享给好友,参与抽奖</button>
+				<button v-if="info.codeType == 1 && info.codeList.length < 1" type="default" @click="exChangeCode">立即参与抽奖</button>
+				<button v-if="info.codeType == 1 && info.codeList.length >= 1" type="default" @click="exChange"
+					open-type="share">分享给好友,提升中奖概率</button>
+<!-- 				<u-count-down v-else :time="activityTimeTwo" format="DD:HH:mm:ss" autoStart millisecond
 					@change="onChange">
 					<button class="buttoncol" type="default">
 						开始倒计时:{{timeData.days}}&nbsp;天{{ timeData.hours>=10?timeData.hours:'0'+timeData.hours}}&nbsp;:{{timeData.minutes>=10?timeData.minutes:'0'+timeData.minutes}}&nbsp;:{{timeData.seconds>=10?timeData.seconds:'0'+timeData.seconds}}
 					</button>
-				</u-count-down>
+				</u-count-down> -->
 			</view>
 		</view>
 
@@ -278,14 +282,22 @@
 			exChange() {
 				//弹出层打开
 				// this.popupShow = true
-
 				uni.requestSubscribeMessage({
 					tmplIds: ['3y_My-yRmqmGd3-f-vAwNaK4LQeehzXBSNDi_5wcnFI',
 						'FGcPOV1j9ApESr3VUlWjFr6E1vF4X_h0LLN82T2CLL0',
 						'92xxL8XTRPLROyNUtmN04OT0kyq4iwSCH3sz-j6zbZs'
 					],
 					success(res) {
-
+					}
+				})
+			},
+			//立即参与抽奖
+			exChangeCode(){
+				$http.post(`/api/v1/mp/user/marketing/generateCode/${this.id}`, {}).then( res => {
+					console.log(res);
+					if(res.code == 0){
+						this.getDetail()
+						uni.$u.toast('参与成功,您已获得1个抽奖码');
 					}
 				})
 			},
@@ -627,6 +639,7 @@
 			background-color: #fff;
 			margin: 30rpx 30rpx;
 			border-radius: 18rpx;
+			padding-bottom: 40rpx;
 
 			&-code {
 				font-size: 30rpx;
@@ -637,7 +650,7 @@
 			&-codetwo {
 				text-align: center;
 				margin-top: 20rpx;
-				margin-bottom: 50rpx;
+				margin-bottom: 40rpx;
 
 				.codeList {
 					text-align: center;
@@ -646,12 +659,12 @@
 					&-bottom {
 						margin: 0 auto;
 						width: 526rpx;
-						height: 94rpx;
+						height: 70rpx;
 						background-color: #F8832C;
 						color: #fff;
 						border-radius: 12rpx;
-						font-size: 38rpx;
-						line-height: 94rpx;
+						font-size: 36rpx;
+						line-height: 70rpx;
 
 					}
 				}
@@ -670,8 +683,10 @@
 
 				.codesix {
 					line-height: 1rpx;
-					color: #9A9FB4;
+					color: #F8832C;
 					font-size: 30rpx;
+					display: inline-block;
+					margin-bottom: 80rpx;
 				}
 			}
 
@@ -679,16 +694,24 @@
 				padding: 10rpx 0;
 				text-align: center;
 				line-height: 60rpx;
-				font-size: 30rpx;
+				font-size: 28rpx;
 				font-weight: bold;
-				color: #F9822C;
+				color: #666666;
+				margin-bottom: 20rpx;
+				.view {
+					font-size: 28rpx;
+					color: #F9822C;
+					display: inline-block;
+				}
 			}
 			&-codesixtwo {
 				margin: 0 auto;
 				width: 600rpx;
 				font-size: 26rpx;
 				color: #999;
-				padding-bottom: 40rpx;
+				line-height: 40rpx;
+				// padding-bottom: 40rpx;
+				text-align: center;
 			}
 		}
 
@@ -770,7 +793,7 @@
 				line-height: 90rpx;
 				font-size: 34rpx;
 				color: #fff;
-				background-color: #FF6000;
+				background-color: #f9822c;
 				border: none;
 				border-radius: 48rpx;
 			}

+ 2 - 1
pages/activity/index.vue

@@ -196,10 +196,11 @@
 						}
 
 						.bor-title {
-							font-size: 34rpx;
+							font-size: 32rpx;
 						}
 
 						.timetwo {
+							background: rgba(249, 130, 44, 0.08);
 							margin-top: 10rpx;
 							border: 2rpx solid #F9822C;
 							font-size: 26rpx;