zhengkaixin 2 年之前
父節點
當前提交
9e76b05055
共有 4 個文件被更改,包括 70 次插入102 次删除
  1. 二進制
      assets/img/nt/news-activity-1.png
  2. 二進制
      assets/img/nt/news-activity-2.png
  3. 69 90
      pages/index/index.vue
  4. 1 12
      pages/login/welcome.vue

二進制
assets/img/nt/news-activity-1.png


二進制
assets/img/nt/news-activity-2.png


+ 69 - 90
pages/index/index.vue

@@ -73,7 +73,7 @@
 					<u-image width="600"  style="margin: auto;min-height: 250px;"
 					mode="widthFix" 
 					v-show="showNtStep==0"
-					src="@/assets/img/nt/nt-activity-1.png">
+					src="@/assets/img/nt/news-activity-2.png">
 					
 						<view slot="loading" style="height: 200px;" >
 							<u-loading mode="flower" size="186" >
@@ -98,7 +98,7 @@
 					<u-image width="600"  style="margin: auto;min-height: 250px;"
 					mode="widthFix" @click="showNtStepClick"
 						v-show="showNtStep==1"
-					src="@/assets/img/nt/nt-activity-2.png">
+					src="@/assets/img/nt/news-activity-1.png">
 					
 					</u-image>
 					<view 
@@ -115,62 +115,7 @@
 					 </view>
 					 
 					 
-					 <u-image width="600"  style="margin: auto;min-height: 250px;"
-					 mode="widthFix" @click="showNtStepClick"
-					 	v-show="showNtStep==2||showNtStep==3||showNtStep==4"
-					 src="@/assets/img/nt/nt-activity-3.png">
-					 
-					 
-					 	
-					 </u-image>
-					 <u-image width="500"  style="color: #FFFFFF;
-							font-size: 64rpx;
-							position: relative;
-							top: -540rpx;
-							right: -60rpx;height: 0;
-						"
-					 mode="widthFix" @click="showNtStepClick"
-					 	v-show="showNtStep==2"
-					 src="@/assets/img/nt/nt-activity-4.png">
-					  </u-image>
-					 <u-image width="500"  style="color: #FFFFFF;
-					 							font-size: 64rpx;
-					 							position: relative;
-					 							top: -540rpx;
-					 							right: -60rpx;height: 0;
-					 						"
-					 mode="widthFix" @click="showNtStepClick"
-					 	v-show="showNtStep==3"
-					 src="@/assets/img/nt/nt-activity-5.png">
-					 
-					 	
-					 	
-					 </u-image>
-					 <u-image width="500"  style="color: #FFFFFF;
-					 							font-size: 64rpx;
-					 							position: relative;
-					 							top: -540rpx;
-					 							right: -60rpx;height: 0;
-					 						"
-					 mode="widthFix" @click="showNtStepClick"
-					 	v-show="showNtStep==4"
-					 src="@/assets/img/nt/nt-activity-6.png">
-					 
-					 	
-					 	
-					 </u-image>
-					 <view
-					  style="color: #ecc07d;
-					 		font-size: 64rpx;
-					 		position: relative;
-					 		top: -180rpx;
-					 		right: -130rpx;
-							 width: 340rpx;"
-					 		@click="showNtStepClick"
-					 
-					  v-show="showNtStep==2||showNtStep==3||showNtStep==4" >
-					  <span >.</span>
-					  </view>
+					
 					 
 			</view>
 		</u-modal>
@@ -598,18 +543,6 @@
 				}
 			}
 			
-			if(op.nt){
-				var  ntobj=this.carhelp.get("netie_activity")
-				if(ntobj&&ntobj.nt==op.nt){
-					 
-				}else{
-					this.carhelp.set("netie_activity",{
-						nt:op.nt,
-						status:0
-					})
-					
-				}
-			}
 			
 			
 		},
@@ -665,18 +598,17 @@
 			})
 
 			this.getBannerInfo("homepage");
-			var obj=this.carhelp.get("netie_activity")
 			
-			if(obj&&obj.status==0&&!this.showNt){
+			var obj=this.carhelp.get("newyear_activity2023")
+			
+			if(obj==null||obj==""||(obj&&obj.status==0)){
 				var userInfo= this.carhelp.getPersonInfo();
 				
 				if(userInfo&&userInfo.id){
 					
-						this.exchangeDetail(obj.nt)
+						this.getNewYear()
 				}else{
-					uni.navigateTo({
-						url: '/pages/login/login?member=1'
-					})	
+					this.getBannerInfoTop("home-top");	
 				}
 				
 				//this.showNtStep=2
@@ -690,6 +622,56 @@
 		
 		},
 		methods: {
+			getNewYear(){
+				var obj=this.carhelp.get("newyear_activity2023")
+				if(obj&&obj.status==0){
+					this.exchangeDetail(obj.nt);
+				}else{
+					var sz=["1615623336912621569","1615623336912621568"];
+					var code=parseInt(Math.random()*2) 
+					this.carhelp.set("newyear_activity2023",{
+						nt:sz[code],
+						code:code,
+						status:0
+					})
+					//先查询另一个领取过没
+					userApi.exchangeDetail({
+						key: sz[code==0?1:0]
+					}).then((res) => {
+						 
+						 if(!res.data.enabled){
+						
+							if(res.data.code==2){
+						 		//未开始
+						 	}else{
+						 		//已经结束
+						 	}
+						 	
+						 
+						 }else if(res.data.status==1){
+						 	
+							//已经兑换,或者不能兑换
+						 } else if(res.data.status==2){
+							// this.showNtValue=res.data.totalDiscount
+							 this.exchangeDetail(sz[code]);
+						 }else{
+						 	//res.data.status==0
+						 	//this.showNtValue=res.data.totalDiscount
+							this.exchangeDetail(sz[code]);
+						 }
+						 
+						  
+					}).catch(error => {
+						this.showNt=false;
+						uni.showToast({
+							title: error,
+							icon: "none"
+						})
+					})
+				}
+				
+				
+			},
 			exchangeDetail(exchangeCode) {
 				uni.showLoading({
 					title: "加载中",
@@ -698,26 +680,23 @@
 				userApi.exchangeDetail({
 					key: exchangeCode
 				}).then((res) => {
-					this.showNt=true
+					uni.hideLoading();
+					//
+					
 					if(!res.data.enabled){
-						this.carhelp.set("netie_activity",null)
+						
 						if(res.data.code==2){
-							this.showNtStep=4
+							//未开始
 						}else{
-							this.showNtStep=3
+							//已经结束
 						}
 						
-						uni.hideLoading();
 					}else if(res.data.status==1||res.data.status==2){
-						this.carhelp.set("netie_activity",{
-							nt:exchangeCode,
-							status:1
-						})
-						this.showNtStep=2
-						uni.hideLoading();
+						//已经兑换,或者不能兑换
 					}else{
 						
-						
+						this.showNt=true
+						this.showNtStep=0;
 						this.showNtValue=res.data.totalDiscount
 					}
 					
@@ -739,7 +718,7 @@
 				}).then((res) => {
 					uni.hideLoading();
 					this.showNtStep=1
-					this.carhelp.set("netie_activity",{
+					this.carhelp.set("newyear_activity2023",{
 						nt:exchangeCode,
 						status:1
 					})
@@ -753,7 +732,7 @@
 			},
 			showNtStepClick(){
 				if(this.showNtStep==0){
-					var obj=this.carhelp.get("netie_activity")
+					var obj=this.carhelp.get("newyear_activity2023")
 				
 					
 					if(this.personInfo.userType!=1){

+ 1 - 12
pages/login/welcome.vue

@@ -188,18 +188,7 @@
 			
 			this.findNoLTextConfigure()
 			this.findByOpenId()
-			this.carhelp.set("netie_activity",null)
-			if(op.nt){
-				//var  ntobj=this.carhelp.get("netie_activity")
-				
-				this.carhelp.set("netie_activity",{
-					nt:op.nt,
-					status:0
-				})
-				
-				this.onReadyIng()
-				
-			}else if(op.friends){
+			if(op.friends){
 				
 				this.carhelp.set("friends_invitation",{
 					op:op,