Commit 76d9e8a8 by xuzhenghua

app

parent e3116e1d
...@@ -10,6 +10,7 @@ import { browser, getParam, http, wxShare, SendMessageToApp } from "@/utils" ...@@ -10,6 +10,7 @@ import { browser, getParam, http, wxShare, SendMessageToApp } from "@/utils"
import { Link } from "react-router-dom" import { Link } from "react-router-dom"
import QRCode from "qrcode" import QRCode from "qrcode"
import YearCourse from '../preheat/YearCourse' import YearCourse from '../preheat/YearCourse'
import jsCookie from "js-cookie"
class Landing extends Component { class Landing extends Component {
...@@ -163,6 +164,16 @@ class Landing extends Component { ...@@ -163,6 +164,16 @@ class Landing extends Component {
inviteMembers = treasure_code => { inviteMembers = treasure_code => {
const {history, match, user, location} = this.props const {history, match, user, location} = this.props
if (getParam('version')) {
let data = {
title: `@${user.data.username} 邀您一起组队拿豪礼!`,
desc: `加入我的队伍,机械键盘,纸质书籍等超多奖品等你拿!`,
link: `${window.location.origin}/${location.pathname}?treasure_code=${treasure_code}&origin=2`,
//todo 分享图片更换
imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newIndex/community/tou5_bj.png'
}
SendMessageToApp("toShare", data)
}
if (browser.isWeixin) { if (browser.isWeixin) {
wxShare({ wxShare({
title: `@${user.data.username} 邀您一起组队拿豪礼!`, title: `@${user.data.username} 邀您一起组队拿豪礼!`,
......
...@@ -66,7 +66,7 @@ class TeamInfo extends Component { ...@@ -66,7 +66,7 @@ class TeamInfo extends Component {
} }
this.props.history.push(`/year/yearTreasure${search}`); this.props.history.push(`/year/yearTreasure${search}`);
} }
} }
// 去登录 // 去登录
...@@ -86,14 +86,24 @@ class TeamInfo extends Component { ...@@ -86,14 +86,24 @@ class TeamInfo extends Component {
const {is_my_team, my_team: {treasure_code}} = this.state; const {is_my_team, my_team: {treasure_code}} = this.state;
if(is_my_team) { // 有自己的队伍 if(is_my_team) { // 有自己的队伍
// 直接跳转 // 直接跳转
this.props.history.push('/activity/newyear-2019/landing?origin=1&treasure_code=' + treasure_code);
if (!getParam('version')) {
this.props.history.push('/activity/newyear-2019/landing?origin=1&treasure_code=' + treasure_code);
} else {
this.props.history.push('/activity/newyear-2019/landing?origin=1&treasure_code=' + treasure_code + '&version='+ getParam('version'));
}
}else{ // 没自己的队伍 }else{ // 没自己的队伍
// 请求创建队伍的接口 // 请求创建队伍的接口
http.get(`${API.home}/sys/treasure/createMyTeam`).then(res => { http.get(`${API.home}/sys/treasure/createMyTeam`).then(res => {
const { code, data, msg } = res.data; const { code, data, msg } = res.data;
if (code === 200) { if (code === 200) {
const { treasure_code } = data; const { treasure_code } = data;
this.props.history.push('/activity/newyear-2019/landing?origin=1&treasure_code=' + treasure_code); if (!getParam('version')) {
this.props.history.push('/activity/newyear-2019/landing?origin=1&treasure_code=' + treasure_code);
} else {
this.props.history.push('/activity/newyear-2019/landing?origin=1&treasure_code=' + treasure_code + '&version='+ getParam('version'));
}
} else { } else {
Toast.info(msg); Toast.info(msg);
} }
......
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