Commit fe0518b7 by xuzhenghua

旧版app

parents eabfd915 9b06f2b7
......@@ -16,6 +16,7 @@ class Invite extends Component {
hot_schedule: '',
userList: [],
inviteCode: '',
isshowAppTip:false
}
}
......@@ -28,8 +29,28 @@ class Invite extends Component {
this.props.history.push(`/activity?shareuid=${shareuid}&inviteCode=${getParam('inviteCode')}`);
}
}
this.distinguishVersion()
}
distinguishVersion = () => {
// plat_form 1ios 2android
// version 1->3.704 2->4.5.1.20191105
if(getParam('plat_form') == 1){
let version = Number(getParam('version'))
this.setState({
isshowAppTip: version < 3.704 ? true : false
});
}
if(getParam('plat_form') == 2){
let version = getParam('version').replace(/\./g, '').slice(0, 3)
this.setState({
isshowAppTip: Number(version) < 451 ? true:false
});
}
}
componentDidMount() {
if(!this.props.user.hasError) {
this.getUserList();
......@@ -100,19 +121,23 @@ class Invite extends Component {
inviteFriends = () => {
const { user, history } = this.props;
const {inviteCode} = this.state;
const {inviteCode,isshowAppTip} = this.state;
// 未登录先去登录
if (getParam('version')) {
if(user.hasError) {
SendMessageToApp("toLogin");
}else {
let data = {
title: 'AI充电节,积福气享1折秒课,超10万元奖品来就送!!',
desc: '把这门超5万人报名的【Python基础入门 升级版】课程送给你,附200元红包,请笑纳!--七月在线',
link: API.m + `/invite?shareuid=${jsCookie.get('uid')}&new=1&inviteCode=${inviteCode}`,
imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/index-share-img.png',
if(isshowAppTip){
Toast.info('请前往h5/pc端使用该功能', 2);
} else {
let data = {
title: 'AI充电节,积福气享1折秒课,超10万元奖品来就送!!',
desc: '把这门超5万人报名的【Python基础入门 升级版】课程送给你,附200元红包,请笑纳!--七月在线',
link: API.m + `/invite?shareuid=${jsCookie.get('uid')}&new=1&inviteCode=${inviteCode}`,
imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/index-share-img.png',
}
SendMessageToApp("toShare", data)
}
SendMessageToApp("toShare", data)
}
}else {
if(user.hasError) {
......
......@@ -105,11 +105,7 @@ class ReserveCourse extends Component {
if (!getParam('version')) {
this.props.history.push(`/getDetail?id=${courseId}`)
} else {
let data = {
courseId: courseId,
type: 0 // 正常跳课程详情页type:0,积福气浏览课程详情页-没有浏览过type:1 已浏览过type:2
}
SendMessageToApp("toCourse", data);
SendMessageToApp("toCourse", courseId);
}
}
// 查看更多
......
......@@ -181,7 +181,7 @@ class CollectBlessing extends Component {
}
}else {
if(getParam('version')) {
history.push('/invite?version=' + getParam('version'))
history.push('/invite?version=' + getParam('version') + '&plat_form='+ getParam('plat_form'))
} else {
history.push('/invite')
}
......@@ -264,7 +264,7 @@ class CollectBlessing extends Component {
</>
}
{
index === 1 &&
index === 1 &&
<>
{
isFollow === 1
......
......@@ -301,11 +301,7 @@ class CourseList extends Component {
if (!getParam('version')) {
history.push(`/detail?id=${courseId}`);
} else {
let data = {
courseId: courseId,
type: 0 // 正常跳课程详情页type:0,积福气浏览课程详情页-没有浏览过type:1 已浏览过type:2
};
SendMessageToApp("toCourse", data);
SendMessageToApp("toCourse", courseId);
}
}
......
......@@ -8,14 +8,33 @@ class CoursePopup extends Component {
constructor(props) {
super(props);
this.state = {
courseList: []
courseList: [],
isshowAppTip:false
};
}
componentDidMount() {
this.fetchCourseData();
this.distinguishVersion();
}
distinguishVersion = () => {
// plat_form 1ios 2android
// version 1->3.704 2->4.5.1.20191105
if(getParam('plat_form') == 1){
let version = Number(getParam('version'))
this.setState({
isshowAppTip: version < 3.704 ? true : false
});
}
if(getParam('plat_form') == 2){
let version = getParam('version').replace(/\./g, '').slice(0, 3)
this.setState({
isshowAppTip: Number(version) < 451 ? true:false
});
}
}
fetchCourseData = () => {
Promise.all([
http.get(`${API.home}/sys/browse/blessing/courses`),
......@@ -41,22 +60,24 @@ class CoursePopup extends Component {
toCourseDetail = (item) => {
console.log(this.props);
const {isLogin, history, toLogin} = this.props;
// to={`/detail?id=${item.course_id}&ac=11`}
// to={`/detail?id=${item.course_id}&ac=11`}
if(isLogin) {
if(!getParam('version')) {
history.push(`/detail?id=${item.course_id}&ac=11`);
}else{
let type = 0;
if(item.blessing) {
type = 2;
let data = {
courseId: item.course_id,
type: 2
}
SendMessageToApp("toBlessingCourse", data);
}else{
type = 1;
let data = {
courseId: item.course_id,
type: 1 // 正常跳课程详情页type:0,积福气浏览课程详情页-没有浏览过type:1 已浏览过type:2
}
SendMessageToApp("toBlessingCourse", data);
}
let data = {
courseId: item.course_id,
type: type // 正常跳课程详情页type:0,积福气浏览课程详情页-没有浏览过type:1 已浏览过type:2
}
SendMessageToApp("toCourse", data);
}
}else{
toLogin();
......@@ -64,7 +85,7 @@ class CoursePopup extends Component {
}
render() {
const { courseList } = this.state;
const { courseList,isshowAppTip } = this.state;
const { handleToHide } = this.props;
return (
<div className="course-popup__container">
......@@ -76,19 +97,26 @@ class CoursePopup extends Component {
<span
className={classnames("course-popup__item", {
"course-popup__item--active": item.blessing
})}
})}
key={item.course_id}
onClick={()=>{this.toCourseDetail(item)}}
>
<span className="course-popup__name">{item.course_title}</span>
{
item.blessing &&
item.blessing &&
<span>+2</span>
}
</span>
))
}
</div>
{
isshowAppTip &&
<div className="course-popup-apptip">
当前版本浏览课程暂不能增加福气值,可以前往h5/pc端浏览课程增加福气值
</div>
}
</div>
<i className="iconfont iconiconfront-2" onClick={handleToHide}></i>
</div>
......
......@@ -9,6 +9,7 @@
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .5);
z-index: 2;
.iconfont {
margin: 16px 0 0;
......@@ -20,8 +21,7 @@
.course-popup {
width: 300px;
height: 275px;
padding: 20px 0 0;
padding: 20px 0;
border-radius: 10px;
box-sizing: border-box;
background-color: #fff;
......@@ -78,4 +78,10 @@
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.course-popup-apptip{
padding: 10px 15px 0 15px;
color: #FF0000;
text-align: center;
}
\ No newline at end of file
......@@ -166,7 +166,7 @@ class Live extends Component {
return (
<div key={index}>
{
todayLives.map((item, index) => {
todayLives && todayLives.map((item, index) => {
return (
<LiveContent item={item} key={index} makeSubscribe={this.makeSubscribe}
toLiveRoom={this.toLiveRoom}/>
......@@ -181,7 +181,7 @@ class Live extends Component {
return (
<div key={index}>
{
todayLives.map((item, index) => {
todayLives && todayLives.map((item, index) => {
return (
<LiveContent item={item} key={index} makeSubscribe={this.makeSubscribe}
toLiveRoom={this.toLiveRoom}/>
......
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