Commit d572dd3d by zhanghaozhe

微信分享文案

parent 8cb09317
...@@ -19,6 +19,8 @@ class Landing extends Component { ...@@ -19,6 +19,8 @@ class Landing extends Component {
joinSuccessPopup = null joinSuccessPopup = null
shareTipPopup = null shareTipPopup = null
swiper = null swiper = null
shareTitle = ''
shareDesc = ''
state = { state = {
...@@ -65,10 +67,12 @@ class Landing extends Component { ...@@ -65,10 +67,12 @@ class Landing extends Component {
activityEnd: data.status == 5 activityEnd: data.status == 5
}) })
this.setupWxShareConfig(data.member)
if (browser.isWeixin) { if (browser.isWeixin) {
wxShare({ wxShare({
title: `@${data.member[0].user_name} 邀您一起组队拿豪礼!`, title: this.shareTitle,
desc: `加入我的队伍,机械键盘,纸质书籍等超多奖品等你拿!`, desc: this.shareDesc,
link: `${window.location.origin}${location.pathname}?treasure_code=${getParam('treasure_code')}&origin=2`, link: `${window.location.origin}${location.pathname}?treasure_code=${getParam('treasure_code')}&origin=2`,
imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/wx-share-icon.png' imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/wx-share-icon.png'
}) })
...@@ -91,6 +95,13 @@ class Landing extends Component { ...@@ -91,6 +95,13 @@ class Landing extends Component {
}) })
} }
setupWxShareConfig = member => {
const len = member.length
let count = 5 - len <= 0 ? 4 : 5 - len
this.shareTitle = `还差${count}人即可开宝箱,100%有奖!`
this.shareDesc = '加入我的队伍,机械键盘,纸质书籍等超多奖品等你拿!--七月在线'
}
showSharePromptWithParam = () => { showSharePromptWithParam = () => {
if (sessionStorage.getItem('showShareTip') && !sessionStorage.getItem('closedRemind')) { if (sessionStorage.getItem('showShareTip') && !sessionStorage.getItem('closedRemind')) {
this.showShareTip() this.showShareTip()
...@@ -187,8 +198,8 @@ class Landing extends Component { ...@@ -187,8 +198,8 @@ class Landing extends Component {
const {history, match, user, location} = this.props const {history, match, user, location} = this.props
if (getParam('version')) { if (getParam('version')) {
let data = { let data = {
title: `@${user.data.username} 邀您一起组队拿豪礼!`, title: this.shareTitle,
desc: `加入我的队伍,机械键盘,纸质书籍等超多奖品等你拿!`, desc: this.shareDesc,
link: `${window.location.origin}${location.pathname}?treasure_code=${treasure_code}&origin=2`, link: `${window.location.origin}${location.pathname}?treasure_code=${treasure_code}&origin=2`,
imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/wx-share-icon.png' imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/wx-share-icon.png'
} }
...@@ -304,8 +315,8 @@ class Landing extends Component { ...@@ -304,8 +315,8 @@ class Landing extends Component {
if (browser.isAndroidApp || browser.isIOSApp) { if (browser.isAndroidApp || browser.isIOSApp) {
SendMessageToApp('toShare', { SendMessageToApp('toShare', {
title: `@${user.data.username} 邀您一起组队拿豪礼!`, title: this.shareTitle,
desc: `加入我的队伍,机械键盘,纸质书籍等超多奖品等你拿!`, desc: this.shareDesc,
link: `${window.location.origin}${location.pathname}?treasure_code=${getParam('treasure_code')}&origin=2`, link: `${window.location.origin}${location.pathname}?treasure_code=${getParam('treasure_code')}&origin=2`,
imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/wx-share-icon.png' imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/wx-share-icon.png'
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment