提交 d7757160 编写于 作者: Yuanzhao.dai's avatar Yuanzhao.dai

联调判断活动是否结束的接口,增加活动结束逻辑弹框

上级 6dc27a4f
<template>
<section class="active-finish-toast-wrap">
<div class="content">
<div class="top">活动已过期,感谢您的关注</div>
<div class="bottom">
<span @click="closePage">确认</span>
</div>
</div>
</section>
</template>
<script>
import {is_weixin} from '@/utils/wxLogin'
export default {
name: "finish-toast",
methods: {
isAndroid() {
let u = navigator.userAgent;
if (u.indexOf("Android") > -1 || u.indexOf("Linux") > -1) {
if (window.ShowFitness !== undefined) return true;
}
return false;
},
isIos() {
let u = navigator.userAgent;
if (u.indexOf("iPhone") > -1 || u.indexOf("iOS") > -1) {
return true;
}
return false;
},
closePage() {
if(this.$rocNative.isWeb) {
if(is_weixin()) {
if(this.isIos()) {
WeixinJSBridge.call('closeWindow');
} else if(this.isAndroid()){
document.addEventListener('WeixinJSBridgeReady', function(){ WeixinJSBridge.call('closeWindow'); }, false)
}
} else {
window.location.href="about:blank";
window.close();
}
} else {
this.$rocNative.goBack();
}
}
}
}
</script>
<style scoped lang="less">
.active-finish-toast-wrap {
width: 100%;
position: fixed;
top: 0;
bottom: 0;
background: rgba(0,0,0,0.5);
display: flex;
align-items: center;
justify-content: center;
.content {
width: 300px;
height: 131px;
background: #fff;
border-radius: 4px;
.top {
color: #373839;
font-size: 18px;
height: 80.5px;
line-height: 80.5px;
text-align: center;
position: relative;
}
.top:after {
position: absolute;
content: " ";
left: 0;
bottom: 0;
right: 0;
height: 1PX;
border-bottom: 1PX solid #F0F1F2;
color: #F0F1F2;
-webkit-transform-origin: 0 100%;
-ms-transform-origin: 0 100%;
transform-origin: 0 100%;
-webkit-transform: scaleY(0.5);
-ms-transform: scaleY(0.5);
transform: scaleY(0.5);
}
.bottom {
text-align: center;
color: #449284;
font-size: 17px;
line-height: 50px;
}
}
}
</style>
\ No newline at end of file
...@@ -43,16 +43,19 @@ ...@@ -43,16 +43,19 @@
:path="appCallUrl" :path="appCallUrl"
/> />
</no-ssr> </no-ssr>
<finish-toast v-if="isGameOver"></finish-toast>
</section> </section>
</template> </template>
<script> <script>
import { getHospitalRank, getPersonScore, } from '@/service/stage3Api'; import { getHospitalRank, getPersonScore, isGameOver } from '@/service/stage3Api';
import h5header from '@/components/h5header'; import h5header from '@/components/h5header';
import finishToast from '@/components/finish-toast';
export default { export default {
name: "hospital-grades", name: "hospital-grades",
components: { components: {
h5header h5header,
finishToast
}, },
data() { data() {
return { return {
...@@ -80,8 +83,10 @@ ...@@ -80,8 +83,10 @@
} }
}, },
async asyncData( { query } ) { async asyncData( { query } ) {
const res = await isGameOver();
const { data } = await getHospitalRank({ type: query.hospitalType }); const { data } = await getHospitalRank({ type: query.hospitalType });
return { return {
isGameOver: res.data,
hospitalType: query.hospitalType, hospitalType: query.hospitalType,
rankList: data rankList: data
} }
......
...@@ -113,19 +113,22 @@ ...@@ -113,19 +113,22 @@
:path="appCallUrl" :path="appCallUrl"
/> />
</no-ssr> </no-ssr>
<finish-toast v-if="isGameOver"></finish-toast>
</section> </section>
</template> </template>
<script> <script>
import { getThirdMainInfo, getMainRank } from '@/service/stage3Api' import { getThirdMainInfo, getMainRank, isGameOver } from '@/service/stage3Api'
import h5header from '@/components/h5header'; import h5header from '@/components/h5header';
import finishToast from '@/components/finish-toast';
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
import { setCookie, getCookie, delCookie } from '@/utils/cookieFun'; import { setCookie, getCookie, delCookie } from '@/utils/cookieFun';
export default { export default {
name: "index", name: "index",
components: { components: {
h5header h5header,
finishToast
}, },
data() { data() {
return { return {
...@@ -150,8 +153,10 @@ ...@@ -150,8 +153,10 @@
} }
}, },
async asyncData() { async asyncData() {
const res = await isGameOver();
const { data } = await getMainRank(); const { data } = await getMainRank();
return { return {
isGameOver: res.data,
joinDeatils:{ joinDeatils:{
count: data.count, count: data.count,
hospitalCount: data.hospitalCount hospitalCount: data.hospitalCount
...@@ -164,9 +169,8 @@ ...@@ -164,9 +169,8 @@
}, },
mounted() { mounted() {
this.getMainInfo();
this.$rocNative.appInit(); this.$rocNative.appInit();
// this.isWeb = this.$rocNative.isWeb; this.isWeb = this.$rocNative.isWeb;
this.shareObj = { this.shareObj = {
title1: '云鹊奖榜单公布', title1: '云鹊奖榜单公布',
title2: '来看看全中国最杰出的医院机构和医生个人', title2: '来看看全中国最杰出的医院机构和医生个人',
......
...@@ -79,18 +79,21 @@ ...@@ -79,18 +79,21 @@
:path="appCallUrl" :path="appCallUrl"
/> />
</no-ssr> </no-ssr>
<finish-toast v-if="isGameOver"></finish-toast>
</div> </div>
</section> </section>
</template> </template>
<script> <script>
import { getMyGrades } from '@/service/stage3Api'; import { getMyGrades,isGameOver } from '@/service/stage3Api';
import h5header from '@/components/h5header'; import h5header from '@/components/h5header';
import finishToast from '@/components/finish-toast';
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
export default { export default {
name: "personal-grade", name: "personal-grade",
components: { components: {
h5header h5header,
finishToast
}, },
data() { data() {
return { return {
...@@ -121,8 +124,10 @@ ...@@ -121,8 +124,10 @@
} }
}, },
async asyncData({query}) { async asyncData({query}) {
const res = await isGameOver();
const { data } = await getMyGrades({id: Base64.decode(query.encyptId)}); const { data } = await getMyGrades({id: Base64.decode(query.encyptId)});
return { return {
isGameOver: res.data,
encyptId: Base64.decode(query.encyptId),//加密doctorId encyptId: Base64.decode(query.encyptId),//加密doctorId
myGrades: data myGrades: data
} }
...@@ -130,7 +135,7 @@ ...@@ -130,7 +135,7 @@
created() { created() {
}, },
mounted() { mounted() {
getMyGrades({id: this.encyptId}) this.$rocNative.appInit();
this.isWeb = this.$rocNative.isWeb; this.isWeb = this.$rocNative.isWeb;
this.shareObj = { this.shareObj = {
title1: '云鹊奖全国医生成绩公布', title1: '云鹊奖全国医生成绩公布',
......
...@@ -44,16 +44,19 @@ ...@@ -44,16 +44,19 @@
:path="appCallUrl" :path="appCallUrl"
/> />
</no-ssr> </no-ssr>
<finish-toast v-if="isGameOver"></finish-toast>
</section> </section>
</template> </template>
<script> <script>
import { getPersonScore,getPersonList } from '@/service/stage3Api'; import { getPersonScore, getPersonList, isGameOver } from '@/service/stage3Api';
import h5header from '@/components/h5header'; import h5header from '@/components/h5header';
import finishToast from '@/components/finish-toast';
export default { export default {
name: "personal-rank", name: "personal-rank",
components: { components: {
h5header h5header,
finishToast
}, },
data() { data() {
return { return {
...@@ -69,8 +72,10 @@ ...@@ -69,8 +72,10 @@
} }
}, },
async asyncData( {query} ) { async asyncData( {query} ) {
const res = await isGameOver();
const { data } = await getPersonList(); const { data } = await getPersonList();
return { return {
isGameOver: res.data,
personList: data, personList: data,
appCallUrl: '' appCallUrl: ''
} }
......
...@@ -44,4 +44,10 @@ export const getPersonList = () => { ...@@ -44,4 +44,10 @@ export const getPersonList = () => {
url: '/campaign/third/share/person/rank', url: '/campaign/third/share/person/rank',
withCredentials: true withCredentials: true
}) })
}
/*判断活动是否结束*/
export const isGameOver = () => {
return request({
url: '/campaign/third/share/gameOver'
})
} }
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册