提交 5409c0b5 编写于 作者: tao.wu's avatar tao.wu

修改分享参数

上级 8f9a14c6
export const wxShare = {
shareUrl: '',
title1: '您的好友邀请您领取医学课程',
title2: '参与云鹊奖活动,领取免费课程,赢取iphone11等丰厚奖品',
shareImageUrl: 'https://file.yunqueyi.com/h5/nzhd19/share2.png'
}
\ No newline at end of file
...@@ -223,9 +223,9 @@ ...@@ -223,9 +223,9 @@
import { Toast } from 'vant'; import { Toast } from 'vant';
import { setEventByModuleCode, getFirstAwards } from '@/utils'; import { setEventByModuleCode, getFirstAwards } from '@/utils';
import { ENV_CONFIG } from '@/utils/enumerate'; import { ENV_CONFIG } from '@/utils/enumerate';
import { wxShare } from '@/configs/wxShare';
const cookies = require('cookie-universal')(); const cookies = require('cookie-universal')();
let vm = null; let vm = null;
export default { export default {
data () { data () {
...@@ -303,12 +303,7 @@ ...@@ -303,12 +303,7 @@
id: '', id: '',
}, },
isWeb: false, isWeb: false,
shareObj: { shareObj: wxShare,
shareUrl: '',
title1: '您的好友邀请您领取医学课程',
title2: '参与云鹊奖活动,领取免费课程,赢取iphone11等丰厚奖品',
shareImageUrl: 'https://file.yunqueyi.com/h5/nzhd19/share2.png'
},
padTop: 0 padTop: 0
} }
}, },
...@@ -360,7 +355,6 @@ ...@@ -360,7 +355,6 @@
// vm.getTasks(); // vm.getTasks();
// // 这里需要删掉!!! // // 这里需要删掉!!!
vm.isWeb = vm.$rocNative.isWeb; vm.isWeb = vm.$rocNative.isWeb;
// vm.shareObj.shareUrl = `${getShareUrl()}year_end_ssr/shareActive?id=${vm.encryptId}&taskId=${vm.eachInviteAward.taskId}&activityId=${vm.eachInviteAward.activityId}`
// 取服务器时间,切换不同时间段的显示 // 取服务器时间,切换不同时间段的显示
vm.getServerTime(); vm.getServerTime();
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
<script> <script>
import { getInviteInfo, getCourseById, getCaptchaGet, getAuthCode } from '@/service'; import { getInviteInfo, getCourseById, getCaptchaGet, getAuthCode } from '@/service';
import { wxShare } from '@/configs/wxShare';
const TIMEALL = 60000; // 倒计时常量 60 秒 const TIMEALL = 60000; // 倒计时常量 60 秒
export default { export default {
data(){ data(){
...@@ -68,7 +69,8 @@ ...@@ -68,7 +69,8 @@
captchaAnswer: '', // 输入的图形验证码 captchaAnswer: '', // 输入的图形验证码
time: TIMEALL, time: TIMEALL,
btnMsg: '点击获取', btnMsg: '点击获取',
isReq: false isReq: false,
shareObj: wxShare,
} }
}, },
async asyncData({ query }){ async asyncData({ query }){
...@@ -93,17 +95,13 @@ ...@@ -93,17 +95,13 @@
document.querySelector('body').setAttribute('style', 'background: #FE9A51;'); document.querySelector('body').setAttribute('style', 'background: #FE9A51;');
this.checkCache(); this.checkCache();
// 微信分享 // 微信分享
this.shareObj = { this.shareObj.shareUrl = window.location.href;
shareUrl: window.location.href, window.localStorage.setItem('shareUrl', this.shareObj.shareUrl);
title1: '分享title分享title',
title2: '分享desc分享desc',
shareImageUrl: 'https://file.yunqueyi.com/h5/nzhd19/share.png'
}
this.$picaWxShare({ this.$picaWxShare({
// baseUrl: BASE_URL[process.env.NUXT_ENV_APP], // baseUrl: BASE_URL[process.env.NUXT_ENV_APP],
baseUrl: 'https://test1-sc.yunqueyi.com', baseUrl: 'https://test1-sc.yunqueyi.com',
type: 15, type: 15,
authUrl: window.location.href, authUrl: this.shareObj.shareUrl,
isDebug: false, isDebug: false,
jsApiList: [ jsApiList: [
'onMenuShareTimeline', 'onMenuShareTimeline',
...@@ -112,7 +110,7 @@ ...@@ -112,7 +110,7 @@
},(wx)=>{ },(wx)=>{
const title = this.shareObj.title1; const title = this.shareObj.title1;
const desc = this.shareObj.title2; const desc = this.shareObj.title2;
const link = window.location.href; const link = this.shareObj.shareUrl;
const imgUrl = this.shareObj.shareImageUrl; const imgUrl = this.shareObj.shareImageUrl;
// 分享给朋友 // 分享给朋友
wx.onMenuShareAppMessage({ wx.onMenuShareAppMessage({
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
</template> </template>
<script> <script>
import { wxShare } from '@/configs/wxShare';
export default { export default {
asyncData({ query }){ asyncData({ query }){
const { status } = query; // 上个页面传递过来领取结果, false 为已领取, true 为领取成功 const { status } = query; // 上个页面传递过来领取结果, false 为已领取, true 为领取成功
...@@ -61,20 +62,20 @@ ...@@ -61,20 +62,20 @@
statusTxt statusTxt
} }
}, },
data(){
return {
shareObj: wxShare,
}
},
mounted(){ mounted(){
document.querySelector('body').setAttribute('style', 'background: "";'); document.querySelector('body').setAttribute('style', 'background: "";');
// 微信分享 // 微信分享
this.shareObj = { this.shareObj.shareUrl = window.localStorage.getItem('shareUrl') || window.location.href;
shareUrl: window.location.href,
title1: '分享title分享title',
title2: '分享desc分享desc',
shareImageUrl: 'https://file.yunqueyi.com/h5/nzhd19/share.png'
}
this.$picaWxShare({ this.$picaWxShare({
// baseUrl: BASE_URL[process.env.NUXT_ENV_APP], // baseUrl: BASE_URL[process.env.NUXT_ENV_APP],
baseUrl: 'https://test1-sc.yunqueyi.com', baseUrl: 'https://test1-sc.yunqueyi.com',
type: 15, type: 15,
authUrl: window.location.href, authUrl: this.shareObj.shareUrl,
isDebug: false, isDebug: false,
jsApiList: [ jsApiList: [
'onMenuShareTimeline', 'onMenuShareTimeline',
...@@ -83,7 +84,7 @@ ...@@ -83,7 +84,7 @@
},(wx)=>{ },(wx)=>{
const title = this.shareObj.title1; const title = this.shareObj.title1;
const desc = this.shareObj.title2; const desc = this.shareObj.title2;
const link = window.location.href; const link = this.shareObj.shareUrl;
const imgUrl = this.shareObj.shareImageUrl; const imgUrl = this.shareObj.shareImageUrl;
// 分享给朋友 // 分享给朋友
wx.onMenuShareAppMessage({ wx.onMenuShareAppMessage({
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册