Commit e4da19af by wangshuo

邀请好友注册

parent 544f896f
import React, { Component } from 'react' import React, { Component } from 'react'
import {connect} from "react-redux"; import {connect} from "react-redux";
import { http, getParam, is_weixin, wxShare } from '@/utils'; import { http, getParam } from '@/utils';
import './index.scss'; import './index.scss';
import {Toast} from "antd-mobile"; import {Toast} from "antd-mobile";
import jsCookie from 'js-cookie';
class Activity extends Component { class Activity extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
} }
componentWillMount() {
jsCookie.set('blessing_invite_code', getParam('shareuid'));
}
getGift = () => { getGift = () => {
if(this.props.user.hasError) { if(this.props.user.hasError) {
this.props.history.push('/passport'); this.props.history.push('/passport');
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import {connect} from "react-redux" import {connect} from "react-redux"
import './index.scss'; import './index.scss';
import { http, getParam, is_weixin, wxShare } from '@/utils'; import { http, getParam, is_weixin, wxShare, getC } from '@/utils';
import {Toast} from "antd-mobile"; import {Toast} from "antd-mobile";
import jsCookie from 'js-cookie';
class Invite extends Component { class Invite extends Component {
...@@ -17,8 +18,14 @@ class Invite extends Component { ...@@ -17,8 +18,14 @@ class Invite extends Component {
} }
componentWillMount() { componentWillMount() {
let uid = jsCookie.get('uid');
let shareuid = getParam('shareuid');
if(uid === shareuid) {
} else {
if(getParam('new')) { if(getParam('new')) {
this.props.history.push('/activity'); this.props.history.push(`/activity?shareuid=${shareuid}`);
}
} }
} }
...@@ -72,7 +79,7 @@ class Invite extends Component { ...@@ -72,7 +79,7 @@ class Invite extends Component {
wxShare({ wxShare({
title: "哈哈哈哈哈哈哈", title: "哈哈哈哈哈哈哈",
desc: "你的老相好在七月在线学习呢你来不来", desc: "你的老相好在七月在线学习呢你来不来",
link: encodeURI(location.origin + '/invite?new=1'), link: encodeURI(location.origin + `/invite?shareuid=${shareuid}new=1`),
imgUrl: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/20a86c1353.jpg' imgUrl: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/20a86c1353.jpg'
}); });
this.setState({ this.setState({
...@@ -80,7 +87,7 @@ class Invite extends Component { ...@@ -80,7 +87,7 @@ class Invite extends Component {
isWeiXin: true, isWeiXin: true,
}); });
}else{ }else{
history.replaceState(null,null,'invite?new=1') history.replaceState(null,null,`invite?shareuid=${jsCookie.get('uid')}&new=1`)
this.setState({ this.setState({
showTip: true, showTip: true,
}); });
......
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