Commit 50e0a104 by xuzhenghua

pull

parents 6c9d16f6 3bda3529
import React, { Component } from 'react'
import React, {Component} from 'react'
import './index.scss'
import Bargain from './bargain'
import Group from './group'
import OutLine from './outline'
import { HeaderBar, CallApp } from '../../common'
import {HeaderBar, CallApp} from '../../common'
import ShareRank from "./shareRank"
import Audition from "./audition"
import Single from "./single"
import SingleSuccess from './single/singleSuccess';
import BtnStatus from "./btnstatus"
import Barrage from './barrage'
import { connect } from "react-redux"
import { getCourses, addCourseToCart } from "./actions"
import { getParam, http, browser, wxShare } from "@/utils"
import { Toast } from 'antd-mobile'
import { bindActionCreators } from "redux";
import {connect} from "react-redux"
import {getCourses, addCourseToCart} from "./actions"
import {getParam, http, browser, wxShare} from "@/utils"
import {Toast} from 'antd-mobile'
import {bindActionCreators} from "redux";
import {delCountryNum} from './../country/countryRedux';
import RedPacket from './redPacket';
......@@ -65,7 +65,7 @@ class Detail extends Component {
this.judgeIsRedPacket();
// 红包链接进入详情也
if(getParam('share_code')) {
if (getParam('share_code')) {
this.setState({
isRedPacket: true
});
......@@ -75,8 +75,8 @@ class Detail extends Component {
// 判断时候未红包课程
judgeIsRedPacket = () => {
http.get(`${API.home}/sys/redPacket/showShareActive/${getParam('id')}`).then(res => {
const { code, data } = res.data;
if(code === 200) {
const {code, data} = res.data;
if (code === 200) {
this.setState({
isRedPacket: data.is_show
});
......@@ -427,7 +427,7 @@ class Detail extends Component {
}
render() {
const { course: { course_info={} }, barInfo, singleBox, singleType, isRedPacket } = this.state;
const {course: {course_info = {}}, barInfo, singleBox, singleType, isRedPacket} = this.state;
let courseInfo = '',
service = '',
......@@ -496,20 +496,34 @@ class Detail extends Component {
{/*正常课程已购买时显示*/}
{
course_info.is_baoming === 1 &&
course_info.is_baoming === 1 && course_info.contact_type == 1 &&
<div className='group'>
上课QQ群:{course_info.course_qq},加群请备注您的学号:{course_info.uid}
</div>
}
{
course_info.is_baoming === 1 && course_info.contact_type == 2 &&
<div className='group'>
请添加班主任微信:{course_info.course_qq},添加时备注学号:{course_info.uid}
</div>
}
{/*vip课程显示*/}
{
course_info.vip_range &&
course_info.vip_range && course_info.contact_type == 1 &&
<div className="vip">
<p>已开通年会员:{course_info.vip_range}</p>
<p>年会员QQ群:{course_info.course_qq},加群请备注您的学号:{course_info.uid}</p>
</div>
}
{
course_info.vip_range && course_info.contact_type == 2 &&
<div className="vip">
<p>已开通年会员:{course_info.vip_range}</p>
<p>请添加班主任微信:{course_info.course_qq},添加时备注学号:{course_info.uid}</p>
</div>
}
{/*服务承诺*/}
<div className='promise'>
......@@ -565,7 +579,7 @@ class Detail extends Component {
{/* 红包 */}
{
isRedPacket &&
isRedPacket &&
<RedPacket
history={this.props.history}
country={this.props.country}
......
......@@ -39,7 +39,7 @@ class RedPacket extends PureComponent {
endTime: 10, // 手机绑定时限
countdownTimer: null,
countdown: '00分00秒', // 绑定时间
accountInfo: {},
accountInfo: {},
bindInfo: {},
country: {
num: '86'
......@@ -53,7 +53,7 @@ class RedPacket extends PureComponent {
// 分享链接进入
this.judgePopupType();
// 微信进入
const isWechat = getParam('wechat');
const { userInfo } = this.props;
......@@ -64,7 +64,7 @@ class RedPacket extends PureComponent {
http.get(`${API.home}/sys/redPacket/shareUrl/${getParam('id')}`).then(res => {
const { code, data } = res.data;
if(code === 200) {
// 检查收否领取过
http.post(
`${API.home}/sys/redPacket/split`,
......@@ -76,7 +76,7 @@ class RedPacket extends PureComponent {
const { code, data } = res.data;
if(code === 200) {
window.localStorage.removeItem('redpacket-click');
// is_receive 是否领取过 0-否 1-是
// is_receive 是否领取过 0-否 1-是
if(data.is_receive) {
this.judgeReceiveStatus(data, 8);
}else {
......@@ -105,6 +105,7 @@ class RedPacket extends PureComponent {
// 获取分享信息
fetchShareInfo = () => {
const share_code = getParam('share_code');
http.get(`${API.home}/sys/redPacket/shareUrl/${getParam('id')}`).then(res => {
const { code, data } = res.data;
......@@ -145,7 +146,7 @@ class RedPacket extends PureComponent {
});
}else {
// is_receive 是否领取过 0-否 1-是
// is_receive 是否领取过 0-否 1-是
if(data.is_receive) {
this.judgeReceiveStatus(data);
}else {
......@@ -188,7 +189,7 @@ class RedPacket extends PureComponent {
const { code, data } = res.data;
if(code === 200) {
// is_receive 是否领取过 0-否 1-是
// is_receive 是否领取过 0-否 1-是
if(data.is_receive) {
this.judgeReceiveStatus(data, 8);
}else {
......@@ -545,7 +546,7 @@ class RedPacket extends PureComponent {
const { accountInfo: { tel, code}, country: {num = '0086'} } = this.state;
// is_valid 是否验证 1:验证(默认),0不验证
http.post(
`${API['passport-api']}/m/personal/bindPhone`,
`${API['passport-api']}/m/personal/bindPhone`,
{
area_code: num.padStart(4, '0'),
phone_num: tel,
......@@ -577,17 +578,17 @@ class RedPacket extends PureComponent {
render() {
// console.log(this.props);
const { history, userInfo } = this.props;
const {
type,
isCopy,
validate,
isTimer,
seconds,
const {
type,
isCopy,
validate,
isTimer,
seconds,
shareInfo: {
command = '',
share_code = ''
},
money,
},
money,
doneInfo,
countdown,
endTime,
......@@ -612,7 +613,7 @@ class RedPacket extends PureComponent {
{/* wechat */}
{
type == 2 &&
type == 2 &&
<div className="pupup-wechat">
<h4 className="popup-wechat__title">当前环境不支持领红包活动</h4>
<p className="popup-wechat__desc">请点击右上角“ ··· ”,选择在浏览器中打开 然后参与活动!</p>
......@@ -633,7 +634,7 @@ class RedPacket extends PureComponent {
{!isCopy
? userInfo && userInfo.uid
? (
<CopyToClipboard
<CopyToClipboard
text={command}
onCopy={() => this.setState({
isCopy: true
......@@ -643,8 +644,8 @@ class RedPacket extends PureComponent {
</CopyToClipboard>
)
: (
<button
className="popup-password__button--copy"
<button
className="popup-password__button--copy"
onClick={() => {
window.localStorage.setItem('redpacket-click', 'copy');
history.push('/passport/login');
......@@ -659,8 +660,8 @@ class RedPacket extends PureComponent {
自己也可以领取哦~
</p>
</div>
<i
className="popup-password__button--close iconfont iconiconfront-2"
<i
className="popup-password__button--close iconfont iconiconfront-2"
onClick={() => {
if(getParam('wechat') === '1') {
if(userInfo && userInfo.uid) {
......@@ -683,14 +684,14 @@ class RedPacket extends PureComponent {
</div>
}
{/* red-packet--close */}
{/* red-packet--close */}
{
type === 3 &&
<Packet
<Packet
type={3}
packetInfo={{
title: '七月在线给你发了个红包~'
}}
handleToClose={() => this.handleToClose(false)}
handleToOpen={this.handleToOpen}
......@@ -700,7 +701,7 @@ class RedPacket extends PureComponent {
{/* red-packet--open */}
{
type === 4 &&
<Packet
<Packet
type={4}
packetInfo={{
money,
......@@ -721,7 +722,7 @@ class RedPacket extends PureComponent {
{/* red-packet--money success */}
{
type === 5 &&
<Packet
<Packet
type={5}
packetInfo={{
money,
......@@ -744,7 +745,7 @@ class RedPacket extends PureComponent {
{/* red-packet--fragment success */}
{
type === 6 &&
<Packet
<Packet
type={6}
packetInfo={{
money,
......@@ -767,7 +768,7 @@ class RedPacket extends PureComponent {
{/* red-packet--late 来完了 */}
{
type === 7 &&
<Packet
<Packet
type={7}
packetInfo={{
btn: {
......@@ -795,7 +796,7 @@ class RedPacket extends PureComponent {
}}
validate={({tel, code}) => {
const errors = {};
// if (!validateTel(tel)) {
if(!/^\d+$/.test(tel)) {
errors.tel = '请填写正确格式的手机号';
......@@ -803,7 +804,7 @@ class RedPacket extends PureComponent {
if (!/[0-9]{6}/.test(code)) {
errors.code = '请输入验证码';
}
return errors;
}}
onSubmit={(values, { setStatus, setSubmitting }) => {
......@@ -818,8 +819,8 @@ class RedPacket extends PureComponent {
<Form className="popup-form__content">
<h4 className="popup-form__title">绑定手机号</h4>
<div className="popup-form__item">
<a
className="popup-form__button--num"
<a
className="popup-form__button--num"
href={`/country?id=${getParam('id')}&share_code=${share_code}`}>
+{country.num}
<i className="iconfont iconiconfront-69"></i>
......@@ -828,9 +829,9 @@ class RedPacket extends PureComponent {
name="tel"
render={({field}) => {
return (
<input
<input
{...field}
className="popup-form__ipt"
className="popup-form__ipt"
data-bdrs="0 6px 6px 0"
data-type="tel"
type="text"
......@@ -840,7 +841,7 @@ class RedPacket extends PureComponent {
}}
/>
</div>
<Captcha
<Captcha
mrBtm={15}
getInstance={this.getCaptchaInstance}
onVerify={this.onVerify}
......@@ -854,8 +855,8 @@ class RedPacket extends PureComponent {
绑定超时,红包已失效!
</p>
</div>
<button
className="popup-packet__button--bundle"
<button
className="popup-packet__button--bundle"
data-status="do"
type="button"
onClick={() => {
......@@ -870,7 +871,7 @@ class RedPacket extends PureComponent {
name="code"
render={({field}) => {
return (
<input
<input
{...field}
className="popup-form__ipt popup-form__ipt--left"
type="text"
......@@ -879,7 +880,7 @@ class RedPacket extends PureComponent {
);
}}
/>
<button
<button
className="popup-form__button--code"
data-status={(validate && !isTimer)? 'do': ''}
type="button"
......@@ -890,8 +891,8 @@ class RedPacket extends PureComponent {
}
</button>
</div>
<button
className="popup-packet__button--bundle"
<button
className="popup-packet__button--bundle"
data-status={(tel && code && isEmpty(errors))? 'do': 'done'}
type="submit"
>
......@@ -903,8 +904,8 @@ class RedPacket extends PureComponent {
</Form>
)}
/>
<i
className="popup-password__button--close iconfont iconiconfront-2"
<i
className="popup-password__button--close iconfont iconiconfront-2"
onClick={() => this.handleToClose(false)}
/>
</div>
......@@ -923,8 +924,8 @@ class RedPacket extends PureComponent {
{doneInfo.txt}
</h4>
<p className="popup-done__desc">{doneInfo.desc}</p>
<button
className="popup-packet__button--bundle"
<button
className="popup-packet__button--bundle"
data-status="do"
type="submit"
onClick={() => {
......@@ -932,8 +933,8 @@ class RedPacket extends PureComponent {
}}
>获取更多奖励</button>
</div>
<i
className="popup-password__button--close iconfont iconiconfront-2"
<i
className="popup-password__button--close iconfont iconiconfront-2"
onClick={() => {
const isShare = getParam('share_code')? true : false;
this.handleToClose(false, isShare);
......@@ -944,7 +945,7 @@ class RedPacket extends PureComponent {
{/* 手机号绑定提示 */}
{
type === 10 &&
type === 10 &&
<div className="popup-bind">
<div className="popup-bind__content">
<h4 className="popup-bind__title">绑定确认</h4>
......@@ -953,7 +954,7 @@ class RedPacket extends PureComponent {
{
bindInfo['email'] &&
<li className="popup-bind__account">
{/* 邮箱 */}
<i className="iconfont iconduanxin"></i>
<p className="popup-bind__account--name">{bindInfo['email']}</p>
......@@ -988,16 +989,16 @@ class RedPacket extends PureComponent {
}
</ul>
<div className="popup-bind__button">
<button
className="popup-bind__button--cancle"
<button
className="popup-bind__button--cancle"
onClick={() => this.handleToClose(false)}>取消</button>
<button
className="popup-bind__button--confirm"
<button
className="popup-bind__button--confirm"
onClick={() => this.toContinueBind(0)}>继续绑定</button>
</div>
</div>
<i
className="popup-password__button--close iconfont iconiconfront-2"
<i
className="popup-password__button--close iconfont iconiconfront-2"
onClick={() => this.handleToClose(false)}
/>
</div>
......@@ -1059,7 +1060,7 @@ const Packet = ({type, packetInfo, handleToClose, handleToOpen }) => {
})
}
</p>
<button
<button
className="popup-packet__button--bundle"
onClick={btn.onClick}
>
......@@ -1075,7 +1076,7 @@ const Packet = ({type, packetInfo, handleToClose, handleToOpen }) => {
红包仅能当日领取,下次<br />
早点来哦~
</p>
<button
<button
className="popup-packet__button--bundle"
onClick={btn.onClick}
>
......@@ -1084,8 +1085,8 @@ const Packet = ({type, packetInfo, handleToClose, handleToOpen }) => {
</>
}
</div>
<i
className="popup-password__button--close iconfont iconiconfront-2"
<i
className="popup-password__button--close iconfont iconiconfront-2"
onClick={handleToClose}
/>
</div>
......
......@@ -64,10 +64,18 @@ class Purchased extends Component {
{/* </Link> */}
</p>
<p className='contact text-overflow-2'>{item.simpledescription}</p>
{
item.is_aist &&
<div className='des'>助教微信:{item.assist_weixin}</div>
}
{
!item.is_aist && item.contact_type == 1 &&
<div className='des'>QQ群:{item.course_qq}</div>
}
{
item.is_aist
? <div className='des'>助教微信:{item.assist_weixin}</div>
: <div className='des'>QQ群:{item.course_qq}</div>
!item.is_aist && item.contact_type == 2 &&
<div className='des'>班主任微信:{item.course_qq}</div>
}
</div>
)
......
......@@ -123,11 +123,19 @@ class MyCourses extends Component {
<div className="info">
<div className='title'>{item.course_title}</div>
{
item.is_aist
? <div className='contact'>助教微信:{item.assist_weixin}</div>
: <div className='contact'>QQ群:{item.course_qq}</div>
item.is_aist &&
<div className='contact'>助教微信:{item.assist_weixin}</div>
}
{
!item.is_aist && item.contact_type == 1 &&
<div className='contact'>QQ群:{item.course_qq}</div>
}
{
!item.is_aist && item.contact_type == 2 &&
<div className='contact'>班主任微信:{item.course_qq}</div>
}
{
item.is_aist && item.aist_schedule &&
<div className="process-status">
<div className="process-wrapper">
......
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