liyongli 2 năm trước cách đây
mục cha
commit
7a618358f7

+ 3 - 1
package.json

@@ -40,7 +40,9 @@
     "parserOptions": {
       "parser": "babel-eslint"
     },
-    "rules": {}
+    "rules": {
+		"no-mixed-spaces-and-tabs":0
+	}
   },
   "browserslist": [
     "> 1%",

+ 1 - 5
src/view/SilkRoadSpringFestivalGala/index.vue

@@ -110,11 +110,7 @@ function tosecond() {
   }
   !audio.playing && audio.play();
 }
-// onMounted(() => {
-//   click();
-//   document.addEventListener("WeixinJSBridgeReady", click, false);
-//   document.addEventListener("touchstart", click, false);
-// });
+
 function changePage(type) {
   page.value = type;
 }

+ 25 - 38
src/view/SilkRoadSpringFestivalGala/pages/eight.vue

@@ -39,6 +39,7 @@
 	} from "vant";
 	import {
 		getDrawOri,
+		getStore
 	} from "@/api/SilkRoadSpringGala.js";
 	// import { onMounted, reactive } from "vue";
 	// import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
@@ -49,11 +50,9 @@
 	 */
 	let w = window.$originData.orginParames.availWidth || 0;
 	const show = ref(Array(12).fill(false));
-	const address = ref(localStorage.getItem("silkRoadAddress") || "");
-	// const gift = require("@/assets/img/")
+	let address = localStorage.getItem("silkRoadAddress") || "";
 	const next = false;
 	const emits = defineEmits(["showVideo", "showTitleFunc"]);
-
 	let t = setInterval(() => {
 		let index = Math.ceil(Math.random() * 12) - 1;
 		if (index < 0) index = 0;
@@ -75,17 +74,24 @@
 		getDrawOri({
 			phone
 		}).then(r => {
-			console.log("---->", r);
 			let isdraw = r.prizeId !== 1; // 非中将概率,后期接入接口后直接由接口提供是否中将
 			showDialog({
 				title: r.name,
 				message: () => {
 					if (isdraw) return drawIsTrue(r);
-					if (!isdraw) return drawIsFalse();
+					if (!isdraw) return <div > 很遗憾哟,新年礼物擦肩而过啦!点击下方刷个小视频吧,给手气充能,获取额外抽奖机会!</div>;
 				},
-			}).then(() => {
-				// on close
-				address.value && localStorage.setItem("silkRoadAddress", address.value);
+				beforeClose: type => {
+					console.log("type", type);
+					if (!isdraw) return true;
+					getStore({
+						"phone": localStorage.getItem("silkRoadPhone"),
+						"addr": address,
+					}).then(() => {
+						localStorage.setItem("silkRoadAddress", address);
+						return true
+					}).catch(() => false);
+				}
 			});
 		})
 	}
@@ -95,38 +101,19 @@
 			url: data.url,
 			name: data.name,
 		};
-		let ele = ( < div >
-			<
-			img class = "dialogImg"
-			src = {
-				gift.url
-			}
-			/> <br / >
-			<
-			p > 恭喜您获得 < span style = "color: red" > {
-				gift.name
-			} < /span>!</p >
-			<
-			/div>);
-			return ele;
-		}
-
-		function drawIsFalse() {
-			let ele = ( <
-				div >
-				很遗憾哟, 新年礼物擦肩而过啦! 点击下方刷个小视频吧, 给手气充能, 获取额外抽奖机会! <
-				/div>
-			);
-			return ele;
-		}
+		address = localStorage.getItem("silkRoadAddress") || "";
+		const field = <van-field required v-model={address}	label = "地址" type = "text"	placeholder = "请输入收获地址" /> ;
+		let ele = <div><img class = "dialogImg" src = { gift.url }/> <br / ><p > 恭喜您获得 < span style = "color: red" > {	gift.name} < /span>!</p > {!address ? field : ""} </div>;
+		return ele;
+	}
 
-		function playVideo(url) {
-			emits("showVideo", url);
-		}
+	function playVideo(url) {
+		emits("showVideo", url);
+	}
 
-		defineExpose({
-			draw
-		})
+	defineExpose({
+		draw
+	})
 </script>
 <style lang="scss" scoped>
 	.eight {

+ 1 - 1
src/view/SilkRoadSpringFestivalGala/pages/five.vue

@@ -40,7 +40,7 @@ let fiveT = setInterval(() => {
   clearInterval(fiveT);
   fiveT = setTimeout(() => {
     clearTimeout(fiveT);
-    emits("changePage", "sex");
+    emits("changePage", "six");
   }, 1000);
 }, 1000);
 

+ 18 - 18
src/view/SilkRoadSpringFestivalGala/pages/six.vue

@@ -167,9 +167,9 @@
 	const bgimg = ref(url.bg);
 	const kuangimg = ref(url.kuang);
 	const text2img = ref(url.text2);
-	const step = ref(5); // 动画步骤 默认0
-	const stepBody = ref(text.texts.length); // 首页文字显示动画 默认0
-	const nextStep = ref(2);
+	const step = ref(0); // 动画步骤 默认0
+	const stepBody = ref(0); // 首页文字显示动画 默认0
+	const nextStep = ref(0);
 	const eightRef = ref(null);
 
 	// 如果有手机号获取用户信息
@@ -181,21 +181,21 @@
 			r.userName && localStorage.setItem("silkRoadName", r.userName);
 		});
 	}
-	// let t = setTimeout(() => {
-	//   clearTimeout(t);
-	//   step.value += 1;
-	//   t = setInterval(() => {
-	//     stepBody.value += 1;
-	//     if (stepBody.value === text.texts.length) {
-	//       nextStep.value = 1;
-	//       clearInterval(t);
-	// 	  t = setInterval(() => {
-	// 	    nextStep.value === 2 && (step.value += 1);
-	// 	    if (step.value === 5) clearInterval(t);
-	// 	  }, 3000);
-	//     }
-	//   }, 2000);
-	// }, 200);
+	let t = setTimeout(() => {
+	  clearTimeout(t);
+	  step.value += 1;
+	  t = setInterval(() => {
+	    stepBody.value += 1;
+	    if (stepBody.value === text.texts.length) {
+	      nextStep.value = 1;
+	      clearInterval(t);
+	  		  t = setInterval(() => {
+	  		    nextStep.value === 2 && (step.value += 1);
+	  		    if (step.value === 5) clearInterval(t);
+	  		  }, 3000);
+	    }
+	  }, 2000);
+	}, 200);
 
 	function nextPage() {
 		if (step.value !== 5) return;