Commit 76d9e8a8 by xuzhenghua

app

parent e3116e1d
......@@ -10,6 +10,7 @@ import { browser, getParam, http, wxShare, SendMessageToApp } from "@/utils"
import { Link } from "react-router-dom"
import QRCode from "qrcode"
import YearCourse from '../preheat/YearCourse'
import jsCookie from "js-cookie"
class Landing extends Component {
......@@ -163,6 +164,16 @@ class Landing extends Component {
inviteMembers = treasure_code => {
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) {
wxShare({
title: `@${user.data.username} 邀您一起组队拿豪礼!`,
......
......@@ -86,15 +86,25 @@ class TeamInfo extends Component {
const {is_my_team, my_team: {treasure_code}} = this.state;
if(is_my_team) { // 有自己的队伍
// 直接跳转
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{ // 没自己的队伍
// 请求创建队伍的接口
http.get(`${API.home}/sys/treasure/createMyTeam`).then(res => {
const { code, data, msg } = res.data;
if (code === 200) {
const { treasure_code } = data;
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 {
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