Commit 594dc211 by FE

merge and del build

parents 5d79ae99 e1767bec
......@@ -25,7 +25,7 @@
.close {
position: absolute;
bottom: -88px;
bottom: -74px;
left: 50%;
transform: translateX(-50%);
font-size: 36px;
......
......@@ -19,7 +19,7 @@ class Activity extends Component {
jsCookie.set('blessing_invite_code', getParam('inviteCode'), {domain: '.julyedu.com', expires: 30});
if(cookie.get('uid')) {
this.setState(()=>({
butText: '已领取'
butText: '已领取,去使用'
}));
}
}
......@@ -28,8 +28,7 @@ class Activity extends Component {
if(this.props.user.hasError) {
this.props.history.push('/passport', {from: this.props.location.pathname});
} else {
Toast.info('领取成功,你可前往七月在线官网/APP进行查看', 2);
localStorage.setItem('lingqu', 1);
this.props.history.push('/blessingPreheat');
}
}
......
......@@ -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,12 +121,15 @@ 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 {
if(isshowAppTip){
Toast.info('请前往h5/pc端使用该功能', 2);
} else {
let data = {
title: 'AI充电节,积福气享1折秒课,超10万元奖品来就送!!',
desc: '把这门超5万人报名的【Python基础入门 升级版】课程送给你,附200元红包,请笑纳!--七月在线',
......@@ -114,6 +138,7 @@ class Invite extends Component {
}
SendMessageToApp("toShare", data)
}
}
}else {
if(user.hasError) {
history.push('/passport');
......@@ -158,7 +183,7 @@ class Invite extends Component {
</div>
<div className="content__two">
福气值越高,热力值越高,中奖概率越大!
福气值越高,中奖概率越大!
</div>
<div className="box__out">
......
......@@ -34,7 +34,7 @@ class ReserveCourse extends Component {
const {code, data, msg} = res.data;
if (code === 200) {
this.setState({
courseData: data.filter((item, index) => index < 4),
courseData: JSON.stringify(data) == '{}' ? []:data.filter((item, index) => index < 4),
courseDataAll: data
})
} else {
......@@ -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);
}
}
// 查看更多
......
......@@ -24,11 +24,11 @@
li{
flex: 1;
width: 63px;
height: 30px;
height: 40px;
font-size: 11px;
color: #fff;
text-align: center;
line-height: 30px;
line-height: 40px;
&.active{
background: #FF42F9;
}
......
......@@ -18,7 +18,7 @@ class CollectBlessing extends Component {
rules: [
'app/h5/pc端活动页签到+5点福气值(每天一次)',
'关注七月在线微信服务号+30点福气值(仅限一次)',
'分享活动页到朋友圈、qq,分别+2点福气值(每个平台每天一次)',
'分享活动页到朋友圈、qq、微博,分别+2点福气值(每个平台每天一次)',
'浏览指定课程详情页,一门课程+2点福气值(每天一次)',
'邀请好友注册,+10点福气值/人(无上限)',
'活动期间每购买一门课程+20点福气值',
......@@ -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')
}
......@@ -252,7 +252,7 @@ class CollectBlessing extends Component {
(isLogin && isSign)
? (
<button className="collect-blessing__content" data-status="done">
+5<br/>福气值
已加5
</button>
)
: (
......
......@@ -47,6 +47,7 @@
justify-content: center;
width: 64px;
height: 100%;
padding: 0;
border-style: none;
border-radius: 5px;
font-size: 12px;
......
......@@ -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);
}
}
......
import React, { Component } from 'react';
import classnames from 'classnames';
import { http, SendMessageToApp } from "@/utils";
import { Link } from 'react-router-dom';
import './index.scss';
import { getParam } from '../../../utils';
......@@ -8,12 +8,31 @@ 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 = () => {
......@@ -46,17 +65,23 @@ class CoursePopup extends Component {
if(!getParam('version')) {
history.push(`/detail?id=${item.course_id}&ac=11`);
}else{
let type = 0;
if(this.state.isshowAppTip){
SendMessageToApp("toCourse", item.course_id);
} else {
if(item.blessing) {
type = 2;
}else{
type = 1;
let data = {
courseId: item.course_id,
type: 2
}
SendMessageToApp("toBlessingCourse", data);
}else{
let data = {
courseId: item.course_id,
type: type // 正常跳课程详情页type:0,积福气浏览课程详情页-没有浏览过type:1 已浏览过type:2
type: 1 // 正常跳课程详情页type:0,积福气浏览课程详情页-没有浏览过type:1 已浏览过type:2
}
SendMessageToApp("toBlessingCourse", data);
}
}
SendMessageToApp("toCourse", data);
}
}else{
toLogin();
......@@ -64,7 +89,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">
......@@ -74,7 +99,9 @@ class CoursePopup extends Component {
{
courseList.map(item => (
<span
className="course-popup__item"
className={classnames("course-popup__item", {
"course-popup__item--active": item.blessing
})}
key={item.course_id}
onClick={()=>{this.toCourseDetail(item)}}
>
......@@ -87,6 +114,13 @@ class CoursePopup extends Component {
))
}
</div>
{
isshowAppTip &&
<div className="course-popup-apptip">
当前版本浏览课程暂不能增加福气值,可以前往h5/pc端浏览课程增加福气值
</div>
}
</div>
<i className="iconfont iconiconfront-2" onClick={handleToHide}></i>
</div>
......
......@@ -9,10 +9,11 @@
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .5);
z-index: 2;
.iconfont {
margin: 16px 0 0;
font-size: 24px;
font-size: 28px;
color: #fff;
cursor: pointer;
}
......@@ -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;
......@@ -64,10 +64,24 @@
}
}
.course-popup__item--active {
.course-popup__name {
color:rgba(82,92,101,.6);
}
}
.course-popup__name {
width: 200px;
font-size: 12px;
color:rgba(82,92,101,1);
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
......@@ -50,18 +50,16 @@ class LevelTest extends Component {
}
startTest = () => {
const {history, isLogin, toLogin} = this.props;
const {isLogin, toLogin} = this.props;
if(isLogin) {
// history.push('/levelTest/test');
// if(getParam('version')) {
if(getParam('version')) {
window.location.href = `${API.m}/levelTest/test?version=${getParam('version')}`;
}else{
window.location.href = `${API.m}/levelTest/test`;
// }else{
// history.push('/levelTest/test');
// }
}
}else{
toLogin();
}
}
render() {
......
import React, { Component } from 'react'
import './index.scss'
import { Tabs, Toast } from "antd-mobile"
import { getParam, http, SendMessageToApp } from "@/utils"
import { getParam, http, SendMessageToApp, browser } from "@/utils"
import { Popup } from "@common/index"
import QRCode from 'qrcode'
import { uniqBy } from 'lodash'
......@@ -12,12 +12,15 @@ import { withRouter } from 'react-router-dom'
@connect(state => ({user: state.user}))
class Live extends Component {
popupInstance = null
state = {
tabs: [],
lives: {},
preheatLives: [],
today: '',
isApp: getParam('version')
isApp: getParam('version'),
QRCodeUrl: '',
}
......@@ -69,22 +72,33 @@ class Live extends Component {
}
toLiveRoom = id => {
const {history,isLogin} = this.props;
const {history, isLogin} = this.props
if (this.state.isApp) {
if(isLogin){
if (isLogin) {
SendMessageToApp('toLiveRoom', id)
}else {
} else {
SendMessageToApp("toLogin")
}
} else {
if(isLogin){
if (isLogin) {
window.location.href = `${window.location.protocol}//www.julyedu.com/live/m_room/${id}`
}else {
} else {
history.push('/passport')
}
}
}
saveImage = () => {
let version = getParam('version')
version = typeof version === 'string' ? version.replace('.', '').replace('.', '').slice(0, 3) : ''
const {QRCodeUrl} = this.state
if (version && parseInt(version) < 451) {
Toast.info('当前不支持此功能,升级到最新版本app可以点击保存二维码!', 2, null, false)
} else {
SendMessageToApp('generateQRCode', QRCodeUrl)
}
}
makeSubscribe = id => {
const {user, history} = this.props
if (user.hasError) {
......@@ -94,12 +108,30 @@ class Live extends Component {
.then(res => {
const {data} = res
if (data.errno == 200) {
this.setState(() => ({
QRCodeUrl: data.data.url,
}))
QRCode.toDataURL(data.data.url, (err, url) => {
Popup({
if (!this.popupInstance) {
this.popupInstance = Popup({
title: '扫码关注“七月在线”服务号即可预约',
content: <img id={'live-qr-code'} src={url} alt=""/>
content: (
<>
<img id={'live-qr-code'} src={url} alt=""/>
{
browser.isAndroidApp ? (
<button className={'save-image'} onClick={this.saveImage}>保存二维码</button>
) : null
}
</>
),
close: () => new Promise(resolve => {
this.popupInstance = null
resolve()
})
})
}
})
} else {
Toast.info(data.msg, 2, null, false)
}
......@@ -134,23 +166,25 @@ 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}/>
<LiveContent item={item} key={index} makeSubscribe={this.makeSubscribe}
toLiveRoom={this.toLiveRoom}/>
)
})
}
</div>
)
})
:tabs.map((item, index) => {
: tabs.map((item, index) => {
const todayLives = preheatLives[item.title]
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}/>
<LiveContent item={item} key={index} makeSubscribe={this.makeSubscribe}
toLiveRoom={this.toLiveRoom}/>
)
})
}
......@@ -201,7 +235,9 @@ function LiveContent({item, makeSubscribe, toLiveRoom}) {
</div>
{
item['on_live']
? <button className={'on-living'} onClick={() => {toLiveRoom(item['room_url'])}}>正在直播</button>
? <button className={'on-living'} onClick={() => {
toLiveRoom(item['room_url'])
}}>正在直播</button>
:
item['is_end']
? <button className={'subscribed'}>已结束</button>
......
......@@ -189,8 +189,7 @@
.am-tabs-tab-bar-wrap {
height: 33px;
border: 1px solid rgba(255, 246, 4, 1);
border-radius: 0 0 6px 6px;
}
.am-tabs-default-bar-tab {
......@@ -214,8 +213,15 @@
.am-tabs-default-bar-tab-active {
background: #FFF604;
border-radius: 0 0 5px 5px;
}
.am-tabs-default-bar-top{
.am-tabs-default-bar-content{
border: 1px solid rgba(255, 246, 4, 1);
border-radius: 0 0 6px 6px;
}
}
}
}
......@@ -227,12 +233,27 @@
.content {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
img {
width: 120px;
height: 120px;
margin-top: 10px;
}
}
.save-image {
width: 133px;
height: 30px;
margin-top: 16px;
background: rgba(83, 39, 250, 1);
border-radius: 15px;
font-size: 14px;
color: #fff;
-webkit-appearance: none;
outline: 0;
border: none;
}
}
......@@ -74,7 +74,7 @@
.prize__content {
display: flex;
flex-wrap: nowrap;
padding: 10px 7px 0;
padding: 10px 7px 0 0;
overflow-y: auto;
}
......
......@@ -21,6 +21,15 @@ export default class RecordPopup extends Component {
});
}
handleToTestRecord = (e, id) => {
e.preventDefault();
if(getParam('version')) {
history.push(`/levelTest/report?id=${id}&version=${getParam('version')}`)
} else {
history.push(`/levelTest/report?id=${id}`)
}
}
render() {
let {recordList} = this.state;
......@@ -41,6 +50,7 @@ export default class RecordPopup extends Component {
</div>
<div className="table__body">
{
recordList.length>0?
recordList.map((item, index) => {
return (<div className="tr__container" key={index}>
<span className="tr">{item.submit_time}</span>
......@@ -48,13 +58,14 @@ export default class RecordPopup extends Component {
<span className="tr">
{
index === 0 ? (
<a href={`/levelTest/report?id=${item.id}`}>测试记录</a>
<a onClick={(e) => this.handleToTestRecord(e, item.id)}>测试记录</a>
) : (null)
}
</span>
</div>
)
})
}):
<div className={'notdata'}>暂无测试记录</div>
}
</div>
</div>
......
......@@ -14,10 +14,9 @@
.gift__record {
width: 300px;
height: 250px;
background: rgba(255, 255, 255, 1);
border-radius: 5px;
padding: 18px 24px 0 24px;
padding: 18px 24px 30px 24px;
position: relative;
span.tr {
display: flex;
......@@ -60,7 +59,6 @@
}
.table__body {
width: 250px;
height: 102px;
border: 1px solid rgba(207, 219, 229, 0.4);
border-radius: 0px 0px 1px 1px;
box-sizing: border-box;
......@@ -76,12 +74,21 @@
&:last-child {
border-bottom: none;
}
p {
color: #525c65;
}
}
}
.notdata{
text-align: center;
color: #999999;
line-height: 35px;
}
.close__button {
width: 32px;
height: 32px;
width: 24px;
height: 24px;
border-radius: 50%;
position: absolute;
left: 50%;
......@@ -92,7 +99,7 @@
justify-content: center;
align-items: center;
i {
font-size: 32px;
font-size: 24px;
color: #fff;
}
}
......
......@@ -19,7 +19,7 @@ export default class SharePopup extends Component {
<div className="share__content">
<p className="share__text">分享活动页到朋友圈、qq、微博分别</p>
<div className='share__rule'>
<img src='https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/add2.png' />
<img className={'share__add2'} src='https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/add2.png' />
<span>(每个平台每天一次)</span>
</div>
</div>
......
......@@ -45,5 +45,8 @@
font-size: 12px;
color: #525C65;
}
.share__add2{
width: 95px;
}
}
}
\ No newline at end of file
......@@ -95,9 +95,14 @@
}
.rank__table-user {
display: inline-flex;
display: flex;
align-items: center;
justify-content: center;
padding: 0 5px;
span {
flex: 1;
text-align: left;
}
}
.rank__table-portrait {
......
......@@ -91,7 +91,7 @@ class ExpandShare extends Component {
this.props.history.push('/passport/login')
} else {
this.props.history.push(
`/deposit-order?oid=${getParam('id')}&source=${1}`,
`/deposit-order?oid=${courseId}&source=${1}`,
{
id: courseId,
isexpand: 1,
......
......@@ -400,8 +400,9 @@ class FinalDepositOrder extends Component {
getBalanceOffset = () => {
let originalTotalPrice = this.getOriginTotalPrice()
let offset = parseFloat(this.state.user_account) - parseFloat(originalTotalPrice)
offset = offset >= 0 ? originalTotalPrice : this.state.user_account
let currentPrice = this.moneyOff(originalTotalPrice)
let offset = parseFloat(this.state.user_account) - parseFloat(currentPrice)
offset = offset >= 0 ? currentPrice : this.state.user_account
return offset
}
......
......@@ -43,7 +43,7 @@ class Preferential extends Component {
http.get(`${API.home}/m/home/bargainZone`).then((res) => {
if (res.data.code === 200) {
this.setState({
dataList: res.data.data,
dataList: JSON.stringify(res.data.data) == '{}' ? []:res.data.data,
isLoading: false,
})
} else {
......@@ -83,7 +83,7 @@ class Preferential extends Component {
}
toCourseDetail = (id) => {
const { dispatch, history } = this.props;
const {dispatch, history} = this.props;
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`)
// }));
......@@ -95,11 +95,11 @@ class Preferential extends Component {
{title: '砍价专区'},
{title: '一键拼团'}
]
const { user ={} } = this.props;
let isLogin = user.data && user.data.uid? true : false;
const {user = {}} = this.props;
let isLogin = user.data && user.data.uid ? true : false;
return (
<div className='preferential'>
<HeaderSearch isLogin={isLogin} />
<HeaderSearch isLogin={isLogin}/>
<Loading isLoading={this.state.isLoading}>
<div className='class-content'>
<WhiteSpace/>
......@@ -116,11 +116,14 @@ class Preferential extends Component {
>
</Tabs>
<div className='tabs'>
{
this.state.dataList.length>0?
<ul>
{this.state.dataList.map((item, index) => {
const Info = (
<div className="info">
<p className='title' onClick={() => this.toCourseDetail(item.course_id)}>
<p className='title'
onClick={() => this.toCourseDetail(item.course_id)}>
{/* <Link to={`/detail?id=${item.course_id}`}> */}
{item.course_title}
{/* </Link> */}
......@@ -167,7 +170,8 @@ class Preferential extends Component {
/>
)
})}
</ul>
</ul>:<div className={'notdata'}>砍价的课程已被设置为双十一活动课程,参加双十一活动购买课程优惠更多哦!</div>
}
</div>
<WhiteSpace/>
......
......@@ -148,5 +148,14 @@
}
}
.notdata{
width: 100%;
padding: 0 35px;
text-align: center;
margin-top: 100px;
color: #666;
font-size: 14px;
}
}
......@@ -109,6 +109,7 @@ class Search extends PureComponent {
})
: <div style={{textAlign: 'center', padding: '20px'}}>暂无热门</div>
}
</div>
</div>
</div>
......
......@@ -207,7 +207,7 @@ export default [
},
// 定金-邀请好友助力
{
path: '/expand/indexactivity',
path: '/expand/index',
component: ExpandShare
},
{
......
......@@ -83,7 +83,9 @@ const browser = (function () {
isWeixin: /MicroMessenger/i.test(ua),
isAndroid: /Android/i.test(ua),
isIOS: /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(ua),
isIPad: /iPad/i.test(ua)
isIPad: /iPad/i.test(ua),
isAndroidApp: /Android/i.test(ua) && getParam('version'),
isIOSApp: /iPhone/i.test(ua) && getParam('version')
}
})()
......
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