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

处理不同页面及状态微信分享文案图标展示

上级 b53c4486
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<section class="hospital-grade-wrap rank-wrap"> <section class="hospital-grade-wrap rank-wrap">
<h5header <h5header
v-if="!isWeb" v-if="!isWeb"
:title="title[this.hospitalType]" :title="`${title[this.hospitalType]}榜榜单`"
isGoHistory="1" isGoHistory="1"
:isOpacity="false" :isOpacity="false"
:shareObj="shareObj"/> :shareObj="shareObj"/>
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
<script> <script>
import { getHospitalRank, getPersonScore, } from '@/service/stage3Api'; import { getHospitalRank, getPersonScore, } from '@/service/stage3Api';
import { wxShare } from '@/configs/wxShare';
import h5header from '@/components/h5header'; import h5header from '@/components/h5header';
export default { export default {
name: "hospital-grades", name: "hospital-grades",
...@@ -59,12 +58,18 @@ ...@@ -59,12 +58,18 @@
return { return {
isWeb: false, isWeb: false,
personalData: {}, personalData: {},
shareObj: wxShare, shareObj: {},
title: { title: {
'0': '星火榜榜单', '0': '星火',
'1': '萌芽榜榜单', '1': '萌芽',
'2': '奋进榜榜单', '2': '奋进',
'3': '超越榜榜单' '3': '超越'
},
hospitalTypeName: {
'0': '微型',
'1': '小型',
'2': '中型',
'3': '大型'
}, },
rankIcon: { rankIcon: {
0: require('../../assets/img/stage3/rank-icon1.png'), 0: require('../../assets/img/stage3/rank-icon1.png'),
...@@ -83,7 +88,7 @@ ...@@ -83,7 +88,7 @@
}, },
head () { head () {
return { return {
title: `${this.title[this.hospitalType]}`, title: `${this.title[this.hospitalType]}榜榜单`,
} }
}, },
created() { created() {
...@@ -91,17 +96,22 @@ ...@@ -91,17 +96,22 @@
mounted() { mounted() {
this.$rocNative.appInit(); this.$rocNative.appInit();
this.isWeb = this.$rocNative.isWeb; this.isWeb = this.$rocNative.isWeb;
this.shareObj.shareUrl = location.href; //微信分享链接 this.shareObj = {
title1: `云鹊${this.title[this.hospitalType]}奖榜单公布`,
title2: `全国最杰出的${this.hospitalTypeName[this.hospitalType]}机构在这里`,
shareImageUrl: 'https://file.yunqueyi.com/h5/images/hd/icon-share.png',
shareUrl: location.href, //微信分享链接
};
this.appCallUrl = location.href; //唤起app页面 this.appCallUrl = location.href; //唤起app页面
//微信分享初始化--start //微信分享初始化--start
this.$picaWxShare({ this.$picaWxShare({
type: (process.env.NUXT_ENV_APP != 'prod') ? 15 : '', type: (process.env.NUXT_ENV_APP != 'prod') ? 15 : '',
authUrl: window.location.href, authUrl: window.location.href,
},(wx)=>{ },(wx)=>{
const title = wxShare.title1; const title = this.shareObj.title1;
const desc = wxShare.title2; const desc = this.shareObj.title2;
const link = window.location.href; const link = window.location.href;
const imgUrl = wxShare.shareImageUrl; const imgUrl = this.shareObj.shareImageUrl;
// 分享给朋友 // 分享给朋友
wx.onMenuShareAppMessage({ wx.onMenuShareAppMessage({
title,desc,link,imgUrl title,desc,link,imgUrl
......
...@@ -121,7 +121,6 @@ ...@@ -121,7 +121,6 @@
import h5header from '@/components/h5header'; import h5header from '@/components/h5header';
import { wxShare } from '@/configs/wxShare';
import { setCookie, getCookie, delCookie } from '@/utils/cookieFun'; import { setCookie, getCookie, delCookie } from '@/utils/cookieFun';
export default { export default {
name: "index", name: "index",
...@@ -133,7 +132,7 @@ ...@@ -133,7 +132,7 @@
isLogin: true, isLogin: true,
mainInfo: {},//顶部个人信息等相关数据 mainInfo: {},//顶部个人信息等相关数据
isWeb: false, isWeb: false,
shareObj: wxShare, shareObj: {},
mainInfoType: 1,//1,机构参加,2机构未参加 mainInfoType: 1,//1,机构参加,2机构未参加
rankName: { rankName: {
'0': '星火', '0': '星火',
...@@ -170,17 +169,22 @@ ...@@ -170,17 +169,22 @@
/*if(getCookie('token')) { /*if(getCookie('token')) {
this.getMainInfo(); this.getMainInfo();
}*/ }*/
this.shareObj.shareUrl = location.href; //微信分享链接 this.shareObj = {
title1: '云鹊奖榜单公布',
title2: '来看看全中国最杰出的医院机构和医生个人',
shareImageUrl: 'https://file.yunqueyi.com/h5/images/hd/icon-share.png',
shareUrl: location.href, //微信分享链接
};
this.appCallUrl = location.href; //唤起app页面 this.appCallUrl = location.href; //唤起app页面
//微信分享初始化--start //微信分享初始化--start
this.$picaWxShare({ this.$picaWxShare({
type: (process.env.NUXT_ENV_APP != 'prod') ? 15 : '', type: (process.env.NUXT_ENV_APP != 'prod') ? 15 : '',
authUrl: window.location.href, authUrl: window.location.href,
},(wx)=>{ },(wx)=>{
const title = wxShare.title1; const title = this.shareObj.title1;
const desc = wxShare.title2; const desc = this.shareObj.title2;
const link = window.location.href; const link = window.location.href;
const imgUrl = wxShare.shareImageUrl; const imgUrl = this.shareObj.shareImageUrl;
// 分享给朋友 // 分享给朋友
wx.onMenuShareAppMessage({ wx.onMenuShareAppMessage({
title,desc,link,imgUrl title,desc,link,imgUrl
......
...@@ -85,7 +85,6 @@ ...@@ -85,7 +85,6 @@
<script> <script>
import { getMyGrades } from '@/service/stage3Api'; import { getMyGrades } from '@/service/stage3Api';
import { wxShare } from '@/configs/wxShare';
import h5header from '@/components/h5header'; import h5header from '@/components/h5header';
export default { export default {
name: "personal-grade", name: "personal-grade",
...@@ -94,9 +93,7 @@ ...@@ -94,9 +93,7 @@
}, },
data() { data() {
return { return {
/* rightText1: '',//右侧文案 shareObj: {},
rightText2: '',//右侧文案*/
shareObj: wxShare,
isWeb: false, isWeb: false,
appCallUrl: '', appCallUrl: '',
rewardIcon: { rewardIcon: {
...@@ -132,17 +129,22 @@ ...@@ -132,17 +129,22 @@
mounted() { mounted() {
getMyGrades({id: this.encyptId}) getMyGrades({id: this.encyptId})
this.isWeb = this.$rocNative.isWeb; this.isWeb = this.$rocNative.isWeb;
this.shareObj.shareUrl = location.href; //微信分享链接 this.shareObj = {
title1: '云鹊奖全国医生成绩公布',
title2: '【点击查看】天呐!我在全国医生中的排名居然在这里',
shareImageUrl: 'https://file.yunqueyi.com/h5/images/hd/icon-share.png',
shareUrl: location.href, //微信分享链接
};
this.appCallUrl = location.href; //唤起app页面 this.appCallUrl = location.href; //唤起app页面
//微信分享初始化--start //微信分享初始化--start
this.$picaWxShare({ this.$picaWxShare({
type: (process.env.NUXT_ENV_APP != 'prod') ? 15 : '', type: (process.env.NUXT_ENV_APP != 'prod') ? 15 : '',
authUrl: window.location.href, authUrl: window.location.href,
},(wx)=>{ },(wx)=>{
const title = wxShare.title1; const title = this.shareObj.title1;
const desc = wxShare.title2; const desc = this.shareObj.title2;
const link = window.location.href; const link = window.location.href;
const imgUrl = wxShare.shareImageUrl; const imgUrl = this.shareObj.shareImageUrl;
// 分享给朋友 // 分享给朋友
wx.onMenuShareAppMessage({ wx.onMenuShareAppMessage({
title,desc,link,imgUrl title,desc,link,imgUrl
......
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
<script> <script>
import { getPersonScore,getPersonList } from '@/service/stage3Api'; import { getPersonScore,getPersonList } from '@/service/stage3Api';
import { wxShare } from '@/configs/wxShare';
import h5header from '@/components/h5header'; import h5header from '@/components/h5header';
export default { export default {
name: "personal-rank", name: "personal-rank",
...@@ -60,7 +59,7 @@ ...@@ -60,7 +59,7 @@
return { return {
personalData: {}, personalData: {},
isWeb: false, isWeb: false,
shareObj: wxShare, shareObj: {},
rankIcon: { rankIcon: {
0: require('../../assets/img/stage3/rank-icon1.png'), 0: require('../../assets/img/stage3/rank-icon1.png'),
1: require('../../assets/img/stage3/rank-icon2.png'), 1: require('../../assets/img/stage3/rank-icon2.png'),
...@@ -81,17 +80,22 @@ ...@@ -81,17 +80,22 @@
mounted() { mounted() {
this.$rocNative.appInit(); this.$rocNative.appInit();
// this.isWeb = this.$rocNative.isWeb; // this.isWeb = this.$rocNative.isWeb;
this.shareObj.shareUrl = location.href; //微信分享链接 this.shareObj = {
title1: '云鹊奖个人榜单公布',
title2: '全中国最杰出的医生个人在这里',
shareImageUrl: 'https://file.yunqueyi.com/h5/images/hd/icon-share.png',
shareUrl: location.href, //微信分享链接
};
this.appCallUrl = location.href; //唤起app页面 this.appCallUrl = location.href; //唤起app页面
//微信分享初始化--start //微信分享初始化--start
this.$picaWxShare({ this.$picaWxShare({
type: (process.env.NUXT_ENV_APP != 'prod') ? 15 : '', type: (process.env.NUXT_ENV_APP != 'prod') ? 15 : '',
authUrl: window.location.href, authUrl: window.location.href,
},(wx)=>{ },(wx)=>{
const title = wxShare.title1; const title = this.shareObj.title1;
const desc = wxShare.title2; const desc = this.shareObj.title2;
const link = window.location.href; const link = window.location.href;
const imgUrl = wxShare.shareImageUrl; const imgUrl = this.shareObj.shareImageUrl;
// 分享给朋友 // 分享给朋友
wx.onMenuShareAppMessage({ wx.onMenuShareAppMessage({
title,desc,link,imgUrl title,desc,link,imgUrl
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册