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

抽离榜单名、榜单图标、名次图标等静态变量

上级 d71713b5
......@@ -2,13 +2,13 @@
<section class="hospital-grade-wrap rank-wrap">
<h5header
v-if="!isWeb"
:title="title.hospitalType"
:title="title[this.hospitalType]"
isGoHistory="1"
:isOpacity="false"
:shareObj="shareObj"/>
<div class="rank-list" :class="{'padBott60': isWeb}" :style="{ marginTop: isWeb?0:`${44+statusBarHeight}Px`}">
<div class="rank-item" v-for="(item, index) in rankList" :key="index">
<img v-if="index<=2" src="~/assets/img/stage3/rank-icon1.png" alt="" class="rank-icon">
<img v-if="index<=2" :src="rankIcon[index]" alt="" class="rank-icon">
<p v-else class="rank-num">{{index+1}}</p>
<div class="info">
<div class="details">
......@@ -60,10 +60,15 @@
personalData: {},
shareObj: wxShare,
title: {
0: '星火榜榜单',
1: '萌芽榜榜单',
2: '奋进榜榜单',
3: '超越榜榜单'
'0': '星火榜榜单',
'1': '萌芽榜榜单',
'2': '奋进榜榜单',
'3': '超越榜榜单'
},
rankIcon: {
0: require('../../assets/img/stage3/rank-icon1.png'),
1: require('../../assets/img/stage3/rank-icon2.png'),
2: require('../../assets/img/stage3/rank-icon3.png'),
}
}
},
......@@ -78,7 +83,7 @@
},
mounted() {
this.$rocNative.appInit();
this.isWeb = this.$rocNative.isWeb;
//this.isWeb = this.$rocNative.isWeb;
this.shareObj.shareUrl = location.href; //微信分享链接
if(!this.isWeb) {
this.getPersonScore();
......
......@@ -25,7 +25,7 @@
<p class="score">个人勤奋分 {{mainInfo.diligence?mainInfo.diligence:'-'}}</p>
</div>
<div class="right">
<p class="title">机构{{dealHospitalRankName(mainInfo.hospitalType)}}</p>
<p class="title">机构{{rankName[mainInfo.hospitalType]}}</p>
<p class="rank">{{mainInfo.hospitalRank}}</p>
<p class="score">机构勤奋分 {{mainInfo.hospitalDiligence}}</p>
</div>
......@@ -40,7 +40,7 @@
<!--未登录-->
<div class="person-details not-login" v-if="!isLogin">
<div class="description">登录查看个人和机构排名</div>
<div class="my-grade">立即登录</div>
<div class="my-grade" @click="goToLogin">立即登录</div>
<div class="bottom">
<p class="text">参与人数 {{joinDeatils.count}}</p>
<p class="line"></p>
......@@ -73,11 +73,11 @@
<div class="award-container hospital-awards">
<div class="item" v-for="(item, index) in hospitalTopVoList" :key="index">
<div class="top">
<div class="title">云鹊{{dealHospitalRankName(item.hospitalType)}}</div>
<div class="title">云鹊{{rankName[item.hospitalType]}}</div>
<div class="operation" @click="goRankList(1,item.hospitalType)">查看榜单<img src="~/assets/img/stage3/icon-right.png" alt=""></div>
</div>
<div class="content">
<img :src="dealHospitalRankIcon(item.hospitalType)" alt="">
<img :src="hospitalRankIcon[item.hospitalType]" alt="">
<div class="details">
<p class="name">{{item.hospitalName}}</p>
<p class="grade">机构勤奋分 {{item.hospitalDiligence}}</p>
......@@ -135,6 +135,18 @@
isWeb: false,
shareObj: wxShare,
mainInfoType: 1,//1,机构参加,2机构未参加
rankName: {
'0': '星火',
'1': '萌芽',
'2': '奋进',
'3': '超越'
},
hospitalRankIcon: {
'0': require('../../assets/img/stage3/hospital-rank1.png'),
'1': require('../../assets/img/stage3/hospital-rank2.png'),
'2': require('../../assets/img/stage3/hospital-rank3.png'),
'3': require('../../assets/img/stage3/hospital-rank4.png')
}
}
},
async asyncData() {
......@@ -154,7 +166,9 @@
mounted() {
this.$rocNative.appInit();
this.isWeb = this.$rocNative.isWeb;
this.getMainInfo();
/*if(getCookie('token')) {
this.getMainInfo();
}*/
this.shareObj.shareUrl = location.href; //微信分享链接
/*从app获取用户信息*/
this.getUserInfo();
......@@ -165,12 +179,17 @@
},
methods: {
goToLogin() {
this.$rocNative.gotoLogin();
},
getUserInfo() { // 判断是否登录
this.$rocNative.getUserInfo().then(res => {
if(res.userToken){
setCookie('token', res.userToken);
if(res.userMobile){
setCookie('token', res.userToken)
this.getMainInfo();
this.isLogin = true;
} else {
this.isLogin = false
this.isLogin = false;
}
})
},
......@@ -211,28 +230,6 @@
}
})
},
dealHospitalRankName(hospitalType) { //机构,医生榜单
if(hospitalType == 0) {
return '星火';
} else if(hospitalType == 1) {
return '萌芽';
} else if(hospitalType == 2) {
return '奋进';
} else if(hospitalType == 3) {
return '超越';
}
},
dealHospitalRankIcon(hospitalType) {
if(hospitalType == 0) {
return require('../../assets/img/stage3/hospital-rank1.png');
} else if(hospitalType == 1) {
return require('../../assets/img/stage3/hospital-rank2.png');
} else if(hospitalType == 2) {
return require('../../assets/img/stage3/hospital-rank3.png');
} else if(hospitalType == 3) {
return require('../../assets/img/stage3/hospital-rank4.png');
}
}
}
}
</script>
......
......@@ -8,7 +8,7 @@
:shareObj="shareObj"/>
<div class="rank-list" :class="{'padBott60': isWeb}" :style="{ marginTop: isWeb?0:`${44+statusBarHeight}Px`}">
<div class="rank-item" v-for="(item, index) in personList" :key="index">
<img v-if="index<=2" src="~/assets/img/stage3/rank-icon1.png" alt="" class="rank-icon">
<img v-if="index<=2" :src="rankIcon[index]" alt="" class="rank-icon">
<p v-else class="rank-num">{{index+1}}</p>
<div class="info">
<img :src="item.avatarImageUrl" alt="" class="photo">
......@@ -60,6 +60,11 @@
personalData: {},
isWeb: false,
shareObj: wxShare,
rankIcon: {
0: require('../../assets/img/stage3/rank-icon1.png'),
1: require('../../assets/img/stage3/rank-icon2.png'),
2: require('../../assets/img/stage3/rank-icon3.png'),
}
}
},
async asyncData( {query} ) {
......
import Vue from 'vue'
import PicaJsBridge from '@/utils/jsbridge'
// import Vconsole from 'vconsole';
// const vConsole = new Vconsole();
import Vconsole from 'vconsole';
const vConsole = new Vconsole();
Vue.prototype.$rocNative = new PicaJsBridge();
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册