提交 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 @@
:path="appCallUrl"
/>
</no-ssr>
<finish-toast v-if="isGameOver"></finish-toast>
</section>
</template>
<script>
import { getHospitalRank, getPersonScore, } from '@/service/stage3Api';
import { getHospitalRank, getPersonScore, isGameOver } from '@/service/stage3Api';
import h5header from '@/components/h5header';
import finishToast from '@/components/finish-toast';
export default {
name: "hospital-grades",
components: {
h5header
h5header,
finishToast
},
data() {
return {
......@@ -80,8 +83,10 @@
}
},
async asyncData( { query } ) {
const res = await isGameOver();
const { data } = await getHospitalRank({ type: query.hospitalType });
return {
isGameOver: res.data,
hospitalType: query.hospitalType,
rankList: data
}
......
......@@ -113,19 +113,22 @@
:path="appCallUrl"
/>
</no-ssr>
<finish-toast v-if="isGameOver"></finish-toast>
</section>
</template>
<script>
import { getThirdMainInfo, getMainRank } from '@/service/stage3Api'
import { getThirdMainInfo, getMainRank, isGameOver } from '@/service/stage3Api'
import h5header from '@/components/h5header';
import finishToast from '@/components/finish-toast';
import { Base64 } from 'js-base64';
import { setCookie, getCookie, delCookie } from '@/utils/cookieFun';
export default {
name: "index",
components: {
h5header
h5header,
finishToast
},
data() {
return {
......@@ -150,8 +153,10 @@
}
},
async asyncData() {
const res = await isGameOver();
const { data } = await getMainRank();
return {
isGameOver: res.data,
joinDeatils:{
count: data.count,
hospitalCount: data.hospitalCount
......@@ -164,9 +169,8 @@
},
mounted() {
this.getMainInfo();
this.$rocNative.appInit();
// this.isWeb = this.$rocNative.isWeb;
this.isWeb = this.$rocNative.isWeb;
this.shareObj = {
title1: '云鹊奖榜单公布',
title2: '来看看全中国最杰出的医院机构和医生个人',
......
......@@ -79,18 +79,21 @@
:path="appCallUrl"
/>
</no-ssr>
<finish-toast v-if="isGameOver"></finish-toast>
</div>
</section>
</template>
<script>
import { getMyGrades } from '@/service/stage3Api';
import { getMyGrades,isGameOver } from '@/service/stage3Api';
import h5header from '@/components/h5header';
import finishToast from '@/components/finish-toast';
import { Base64 } from 'js-base64';
export default {
name: "personal-grade",
components: {
h5header
h5header,
finishToast
},
data() {
return {
......@@ -121,8 +124,10 @@
}
},
async asyncData({query}) {
const res = await isGameOver();
const { data } = await getMyGrades({id: Base64.decode(query.encyptId)});
return {
isGameOver: res.data,
encyptId: Base64.decode(query.encyptId),//加密doctorId
myGrades: data
}
......@@ -130,7 +135,7 @@
created() {
},
mounted() {
getMyGrades({id: this.encyptId})
this.$rocNative.appInit();
this.isWeb = this.$rocNative.isWeb;
this.shareObj = {
title1: '云鹊奖全国医生成绩公布',
......
......@@ -44,16 +44,19 @@
:path="appCallUrl"
/>
</no-ssr>
<finish-toast v-if="isGameOver"></finish-toast>
</section>
</template>
<script>
import { getPersonScore,getPersonList } from '@/service/stage3Api';
import { getPersonScore, getPersonList, isGameOver } from '@/service/stage3Api';
import h5header from '@/components/h5header';
import finishToast from '@/components/finish-toast';
export default {
name: "personal-rank",
components: {
h5header
h5header,
finishToast
},
data() {
return {
......@@ -69,8 +72,10 @@
}
},
async asyncData( {query} ) {
const res = await isGameOver();
const { data } = await getPersonList();
return {
isGameOver: res.data,
personList: data,
appCallUrl: ''
}
......
......@@ -44,4 +44,10 @@ export const getPersonList = () => {
url: '/campaign/third/share/person/rank',
withCredentials: true
})
}
/*判断活动是否结束*/
export const isGameOver = () => {
return request({
url: '/campaign/third/share/gameOver'
})
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册