浏览代码

change data

jihuaqiang 2 年之前
父节点
当前提交
f486438054
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      pages/course/index.vue

+ 7 - 4
pages/course/index.vue

@@ -29,6 +29,7 @@ export default {
 	data() {
 	data() {
 		return {
 		return {
 			active: 0,
 			active: 0,
+			useful: '',
 			course: [],
 			course: [],
 		};
 		};
 	},
 	},
@@ -37,16 +38,16 @@ export default {
 			return `translateX(${-this.active * 100}vw)`;
 			return `translateX(${-this.active * 100}vw)`;
 		},
 		},
 		isLottaryCpd() {
 		isLottaryCpd() {
-			return +getQueryString('playType') === PlayType.lottery;
+			return +this.playType === PlayType.lottery;
 		},
 		},
 		isCommonCpd() {
 		isCommonCpd() {
-			return +getQueryString('playType') === PlayType.common;
+			return +this.playType === PlayType.common;
 		},
 		},
 		isTreasureCpd() {
 		isTreasureCpd() {
-			return +getQueryString('playType') === PlayType.Treasure;
+			return +this.playType === PlayType.Treasure;
 		},
 		},
 		isUsefulCpd() {
 		isUsefulCpd() {
-			return getQueryString('useful') === '1';
+			return this.useful === '1';
 		},
 		},
 		tipTextCpd() {
 		tipTextCpd() {
 			if (this.isLottaryCpd) {
 			if (this.isLottaryCpd) {
@@ -81,6 +82,8 @@ export default {
 		});
 		});
 		if (data.code == 0) {
 		if (data.code == 0) {
 			return {
 			return {
+				useful: route.query.useful,
+				playType: route.query.playType,
 				course: route.query.useful === '1' ? data.data.withRewardGuideImages : data.data.withoutRewardGuideImages,
 				course: route.query.useful === '1' ? data.data.withRewardGuideImages : data.data.withoutRewardGuideImages,
 			};
 			};
 		}
 		}