|
@@ -14,15 +14,15 @@
|
|
|
<div class="course-page-btns">
|
|
|
<div v-if="active > 0" class="course-page-btns-btn back" @click="back">Back</div>
|
|
|
<div v-if="active < this.course.length - 1" class="course-page-btns-btn next" @click="next">Next</div>
|
|
|
- <div v-if="active < this.course.length && (isLottaryCpd || isTreasureCpd || isCommonCpd)" @click="retweer" class="course-page-btns-btn retweer">Retweet</div>
|
|
|
+ <div v-if="active === this.course.length - 1 && isUsefulCpd && (isLottaryCpd || isTreasureCpd || isCommonCpd)" @click="retweer" class="course-page-btns-btn retweer">Retweet</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { postRequest } from '../../http';
|
|
|
import { PlayType } from '../../types';
|
|
|
-import { getQueryString } from '../../utils/help';
|
|
|
+import axios from 'axios';
|
|
|
+import { getQueryString, baseURL, appVersionCode } from '../../utils/help';
|
|
|
|
|
|
export default {
|
|
|
name: 'course',
|
|
@@ -37,21 +37,21 @@ export default {
|
|
|
return `translateX(${-this.active * 100}vw)`;
|
|
|
},
|
|
|
isLottaryCpd() {
|
|
|
- return this.playType === PlayType.lottery;
|
|
|
+ return +getQueryString('playType') === PlayType.lottery;
|
|
|
},
|
|
|
isCommonCpd() {
|
|
|
- return this.playType === PlayType.common;
|
|
|
+ return +getQueryString('playType') === PlayType.common;
|
|
|
},
|
|
|
isTreasureCpd() {
|
|
|
- return this.playType === PlayType.Treasure;
|
|
|
+ return +getQueryString('playType') === PlayType.Treasure;
|
|
|
},
|
|
|
- isTimeExpiredCpd() {
|
|
|
- return this.useful === '0';
|
|
|
+ isUsefulCpd() {
|
|
|
+ return getQueryString('useful') === '1';
|
|
|
},
|
|
|
tipTextCpd() {
|
|
|
if (this.isLottaryCpd) {
|
|
|
return 'Install DeNet chrome extension to claim your prize';
|
|
|
- } else if (this.isCommonCpd || this.is) {
|
|
|
+ } else if (this.isCommonCpd || this.isTreasureCpd) {
|
|
|
return 'Install Denet Chrome Extension to complete the quest';
|
|
|
} else {
|
|
|
return 'How to install Denet Chrome Extension';
|
|
@@ -59,38 +59,31 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
- getCource() {
|
|
|
- postRequest(`/base/guide/getAllMobilePageGuide`, {}).then(({ code, data }) => {
|
|
|
- if (code == 0) {
|
|
|
- console.log('%c [ data ]-78', 'font-size:13px; background:pink; color:#bf2c9f;', data);
|
|
|
- if (this.useful === 1) {
|
|
|
- this.course = data.withRewardGuideImages;
|
|
|
- } else {
|
|
|
- this.course = data.withoutRewardGuideImages;
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
next() {
|
|
|
- if (this.active < this.course.length - 1) {
|
|
|
- this.active++;
|
|
|
- } else {
|
|
|
- window.location.replace(`https://twitter.com/intent/retweet?tweet_id=${this.postId}`);
|
|
|
- }
|
|
|
+ this.active++;
|
|
|
},
|
|
|
back() {
|
|
|
this.active--;
|
|
|
},
|
|
|
retweer() {
|
|
|
- window.open(`https://twitter.com/intent/retweet?tweet_id=${this.postId}`);
|
|
|
+ if (getQueryString('postId')) {
|
|
|
+ window.open(`https://twitter.com/intent/retweet?tweet_id=${getQueryString('postId')}`);
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.getCource();
|
|
|
- this.useful = getQueryString('useful');
|
|
|
- this.playType = getQueryString('playType');
|
|
|
- this.rewardType = getQueryString('rewardType');
|
|
|
- this.postId = getQueryString('postId');
|
|
|
+ async asyncData(params) {
|
|
|
+ let { route } = params;
|
|
|
+ let { data } = await axios.post(`${baseURL}/denet/base/guide/getAllMobilePageGuide`, {
|
|
|
+ baseInfo: {
|
|
|
+ appVersionCode: appVersionCode,
|
|
|
+ mid: '00000000-0000-0000-0000-000000000000',
|
|
|
+ },
|
|
|
+ });
|
|
|
+ if (data.code == 0) {
|
|
|
+ return {
|
|
|
+ course: route.query.useful === '1' ? data.data.withRewardGuideImages : data.data.withoutRewardGuideImages,
|
|
|
+ };
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -119,6 +112,10 @@ body {
|
|
|
font-size: 16px;
|
|
|
line-height: 22px;
|
|
|
color: #fff;
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ z-index: 1;
|
|
|
.tip-icon {
|
|
|
width: 36px;
|
|
|
margin-right: 20px;
|