|
@@ -14,15 +14,15 @@
|
|
<div class="course-page-btns">
|
|
<div class="course-page-btns">
|
|
<div v-if="active > 0" class="course-page-btns-btn back" @click="back">Back</div>
|
|
<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 - 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>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { postRequest } from '../../http';
|
|
|
|
import { PlayType } from '../../types';
|
|
import { PlayType } from '../../types';
|
|
-import { getQueryString } from '../../utils/help';
|
|
|
|
|
|
+import axios from 'axios';
|
|
|
|
+import { getQueryString, baseURL, appVersionCode } from '../../utils/help';
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'course',
|
|
name: 'course',
|
|
@@ -45,8 +45,8 @@ export default {
|
|
isTreasureCpd() {
|
|
isTreasureCpd() {
|
|
return this.playType === PlayType.Treasure;
|
|
return this.playType === PlayType.Treasure;
|
|
},
|
|
},
|
|
- isTimeExpiredCpd() {
|
|
|
|
- return this.useful === '0';
|
|
|
|
|
|
+ isUsefulCpd() {
|
|
|
|
+ return getQueryString('useful') === '1';
|
|
},
|
|
},
|
|
tipTextCpd() {
|
|
tipTextCpd() {
|
|
if (this.isLottaryCpd) {
|
|
if (this.isLottaryCpd) {
|
|
@@ -59,18 +59,6 @@ export default {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
methods: {
|
|
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() {
|
|
next() {
|
|
if (this.active < this.course.length - 1) {
|
|
if (this.active < this.course.length - 1) {
|
|
this.active++;
|
|
this.active++;
|
|
@@ -85,9 +73,22 @@ export default {
|
|
window.open(`https://twitter.com/intent/retweet?tweet_id=${this.postId}`);
|
|
window.open(`https://twitter.com/intent/retweet?tweet_id=${this.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) {
|
|
|
|
+ console.log('detail', data.data, route);
|
|
|
|
+ return {
|
|
|
|
+ course: route.query.useful === '1' ? data.data.withRewardGuideImages : data.data.withoutRewardGuideImages,
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ },
|
|
mounted() {
|
|
mounted() {
|
|
- this.getCource();
|
|
|
|
- this.useful = getQueryString('useful');
|
|
|
|
this.playType = getQueryString('playType');
|
|
this.playType = getQueryString('playType');
|
|
this.rewardType = getQueryString('rewardType');
|
|
this.rewardType = getQueryString('rewardType');
|
|
this.postId = getQueryString('postId');
|
|
this.postId = getQueryString('postId');
|
|
@@ -119,6 +120,10 @@ body {
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
line-height: 22px;
|
|
line-height: 22px;
|
|
color: #fff;
|
|
color: #fff;
|
|
|
|
+ position: fixed;
|
|
|
|
+ top: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ z-index: 1;
|
|
.tip-icon {
|
|
.tip-icon {
|
|
width: 36px;
|
|
width: 36px;
|
|
margin-right: 20px;
|
|
margin-right: 20px;
|