Commit e4da19af by wangshuo

邀请好友注册

parent 544f896f
import React, { Component } from 'react'
import {connect} from "react-redux";
import { http, getParam, is_weixin, wxShare } from '@/utils';
import { http, getParam } from '@/utils';
import './index.scss';
import {Toast} from "antd-mobile";
import jsCookie from 'js-cookie';
class Activity extends Component {
constructor(props) {
super(props);
}
componentWillMount() {
jsCookie.set('blessing_invite_code', getParam('shareuid'));
}
getGift = () => {
if(this.props.user.hasError) {
this.props.history.push('/passport');
......
import React, { Component } from 'react';
import {connect} from "react-redux"
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 jsCookie from 'js-cookie';
class Invite extends Component {
......@@ -17,8 +18,14 @@ class Invite extends Component {
}
componentWillMount() {
if(getParam('new')) {
this.props.history.push('/activity');
let uid = jsCookie.get('uid');
let shareuid = getParam('shareuid');
if(uid === shareuid) {
} else {
if(getParam('new')) {
this.props.history.push(`/activity?shareuid=${shareuid}`);
}
}
}
......@@ -72,7 +79,7 @@ class Invite extends Component {
wxShare({
title: "哈哈哈哈哈哈哈",
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'
});
this.setState({
......@@ -80,7 +87,7 @@ class Invite extends Component {
isWeiXin: true,
});
}else{
history.replaceState(null,null,'invite?new=1')
history.replaceState(null,null,`invite?shareuid=${jsCookie.get('uid')}&new=1`)
this.setState({
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