Commit 2057bf98 by zhanghaozhe

视频安全问题

parent 4eb766ab
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
"API": "readonly", "API": "readonly",
"NoCaptcha": "readonly", "NoCaptcha": "readonly",
"WeixinJSBridge": "readonly", "WeixinJSBridge": "readonly",
"_czc": "readonly", "_czc": "writable",
"wx": "readonly" "wx": "readonly"
} }
}, },
......
...@@ -2,10 +2,6 @@ import React, { Component } from "react" ...@@ -2,10 +2,6 @@ import React, { Component } from "react"
import "./index.scss" import "./index.scss"
class WxLogin extends Component { class WxLogin extends Component {
constructor(props) {
super(props)
}
// 提示微信登录还是账号登录,微信授权登录不需要绑定手机号 // 提示微信登录还是账号登录,微信授权登录不需要绑定手机号
wxLogin = () => { wxLogin = () => {
let url = window.location.href let url = window.location.href
......
...@@ -132,7 +132,7 @@ class LiveRoom extends Component { ...@@ -132,7 +132,7 @@ class LiveRoom extends Component {
// 服务号预约 // 服务号预约
serverStep = () => { serverStep = () => {
if (this.state.isfollow == 2) { if (Number(this.state.isfollow) === 2) {
window.location.href = window.location.href =
"https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzIyMzMzMTIwNA==&scene=124#wechat_redirect" "https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzIyMzMzMTIwNA==&scene=124#wechat_redirect"
} else { } else {
......
/* eslint-disable eqeqeq */
import React, { Component } from "react" import React, { Component } from "react"
import "./index.scss" import "./index.scss"
import { Toast } from "antd-mobile" import { Toast } from "antd-mobile"
import classnames from "classnames" import classnames from "classnames"
import { browser, http } from "src/utils" import { http } from "src/utils"
import { WithFullSize } from "src/HOCs" import { WithFullSize } from "src/HOCs"
import { Link } from "react-router-dom" import { Link } from "react-router-dom"
import { compose } from "redux" import { compose } from "redux"
......
...@@ -2,9 +2,6 @@ import React, { Component } from "react" ...@@ -2,9 +2,6 @@ import React, { Component } from "react"
import "./index.scss" import "./index.scss"
export default class CommonContainer extends Component { export default class CommonContainer extends Component {
constructor(props) {
super(props)
}
render() { render() {
const { id } = this.props const { id } = this.props
return ( return (
......
...@@ -2,9 +2,6 @@ import React, { Component } from "react" ...@@ -2,9 +2,6 @@ import React, { Component } from "react"
import "./index.scss" import "./index.scss"
export default class index extends Component { export default class index extends Component {
constructor(props) {
super(props)
}
computedStyle = () => { computedStyle = () => {
return { return {
top: `${this.props.top}px`, top: `${this.props.top}px`,
......
...@@ -64,7 +64,7 @@ class UserBulletScreen extends Component { ...@@ -64,7 +64,7 @@ class UserBulletScreen extends Component {
getBulletScreenData = (initializeSwiper = false) => { getBulletScreenData = (initializeSwiper = false) => {
return http.get(`${API.home}/sys/barrage_data`).then((res) => { return http.get(`${API.home}/sys/barrage_data`).then((res) => {
const { data, code } = res.data const { data, code } = res.data
if (code == 200) { if (code === 200) {
if (initializeSwiper) { if (initializeSwiper) {
this.setState( this.setState(
{ {
......
/* eslint-disable eqeqeq */
import React, { Component } from "react" import React, { Component } from "react"
import { connect } from "react-redux" import { connect } from "react-redux"
import { HeaderBar } from "src/common" import { HeaderBar } from "src/common"
......
/* eslint-disable jsx-a11y/anchor-is-valid */ /* eslint-disable jsx-a11y/anchor-is-valid, eqeqeq */
import React, { Component } from "react" import React, { Component } from "react"
import "./index.scss" import "./index.scss"
import { http, SendMessageToApp, getParam, browser } from "src/utils" import { http, SendMessageToApp, getParam, browser } from "src/utils"
......
...@@ -7,9 +7,6 @@ import Prizes from "src/components/activity/newyear-2019/common/prizes" ...@@ -7,9 +7,6 @@ import Prizes from "src/components/activity/newyear-2019/common/prizes"
import UserBulletScreen from "src/components/activity/newyear-2019/common/user-bullet-screen" import UserBulletScreen from "src/components/activity/newyear-2019/common/user-bullet-screen"
class TreasureBox extends Component { class TreasureBox extends Component {
constructor(props) {
super(props)
}
render() { render() {
return ( return (
<CommonContainer id="year-treasure" title={"组队开宝箱"}> <CommonContainer id="year-treasure" title={"组队开宝箱"}>
......
...@@ -2,9 +2,6 @@ import React, { Component } from "react" ...@@ -2,9 +2,6 @@ import React, { Component } from "react"
import "./index.scss" import "./index.scss"
export default class CommonContainer extends Component { export default class CommonContainer extends Component {
constructor(props) {
super(props)
}
render() { render() {
const { id } = this.props const { id } = this.props
return ( return (
......
...@@ -2,9 +2,6 @@ import React, { Component } from "react" ...@@ -2,9 +2,6 @@ import React, { Component } from "react"
import "./index.scss" import "./index.scss"
export default class index extends Component { export default class index extends Component {
constructor(props) {
super(props)
}
computedStyle = () => { computedStyle = () => {
return { return {
top: `${this.props.top}px`, top: `${this.props.top}px`,
......
...@@ -64,7 +64,7 @@ class UserBulletScreen extends Component { ...@@ -64,7 +64,7 @@ class UserBulletScreen extends Component {
getBulletScreenData = (initializeSwiper = false) => { getBulletScreenData = (initializeSwiper = false) => {
return http.get(`${API.home}/sys/barrage_data`).then((res) => { return http.get(`${API.home}/sys/barrage_data`).then((res) => {
const { data, code } = res.data const { data, code } = res.data
if (code == 200) { if (code === 200) {
if (initializeSwiper) { if (initializeSwiper) {
this.setState( this.setState(
{ {
......
/* eslint-disable eqeqeq */
import React, { Component } from "react" import React, { Component } from "react"
import { connect } from "react-redux" import { connect } from "react-redux"
import { HeaderBar } from "src/common" import { HeaderBar } from "src/common"
......
...@@ -7,9 +7,6 @@ import Prizes from "src/components/activity/treasure-box/common/prizes" ...@@ -7,9 +7,6 @@ import Prizes from "src/components/activity/treasure-box/common/prizes"
import UserBulletScreen from "src/components/activity/treasure-box/common/user-bullet-screen" import UserBulletScreen from "src/components/activity/treasure-box/common/user-bullet-screen"
class TreasureBox extends Component { class TreasureBox extends Component {
constructor(props) {
super(props)
}
render() { render() {
return ( return (
<CommonContainer id="year-treasure" title={"组队开宝箱"}> <CommonContainer id="year-treasure" title={"组队开宝箱"}>
......
/* eslint-disable jsx-a11y/anchor-is-valid */
import React, { Component } from "react" import React, { Component } from "react"
import "./index.scss" import "./index.scss"
import { Tabs, Toast } from "antd-mobile" import { Tabs, Toast } from "antd-mobile"
...@@ -118,7 +119,7 @@ class Scores extends Component { ...@@ -118,7 +119,7 @@ class Scores extends Component {
getUserAddress = () => { getUserAddress = () => {
http.get(`${API.home}/sys/user_address_info`).then((res) => { http.get(`${API.home}/sys/user_address_info`).then((res) => {
const { code, msg, data } = res.data const { code, data } = res.data
if (code === 200) { if (code === 200) {
this.setState({ this.setState({
userAddress: data, userAddress: data,
...@@ -150,7 +151,7 @@ class Scores extends Component { ...@@ -150,7 +151,7 @@ class Scores extends Component {
return return
} }
http.post(`${API.home}/sys/update_address`, userAddress).then((res) => { http.post(`${API.home}/sys/update_address`, userAddress).then((res) => {
const { code, msg, data } = res.data const { code, msg } = res.data
if (code === 200) { if (code === 200) {
Toast.success("提交成功", 2, null, false) Toast.success("提交成功", 2, null, false)
this.setState({ this.setState({
......
/* eslint-disable jsx-a11y/anchor-is-valid */
import React, { Component } from "react" import React, { Component } from "react"
import "./bargain-middle-page.scss" import "./bargain-middle-page.scss"
import { HeaderBar, VList } from "src/common" import { HeaderBar, VList } from "src/common"
import { Course } from "src/common" import { Course } from "src/common"
import { api, getParam, http, browser, wxShare } from "src/utils" import { getParam, http, browser, wxShare } from "src/utils"
import { Toast } from "antd-mobile" import { Toast } from "antd-mobile"
import { Link, withRouter } from "react-router-dom" import { Link, withRouter } from "react-router-dom"
import Ranking from "./ranking" import Ranking from "./ranking"
...@@ -13,9 +14,7 @@ import { ...@@ -13,9 +14,7 @@ import {
differenceInDays, differenceInDays,
} from "date-fns" } from "date-fns"
import Overlay from "../detail/overlay" import Overlay from "../detail/overlay"
import { compose } from "redux"
import { connect } from "react-redux" import { connect } from "react-redux"
import { getCourses } from "./../detail/actions"
import classnames from "classnames" import classnames from "classnames"
import FollowBarcode from "./barcode/index" import FollowBarcode from "./barcode/index"
...@@ -159,7 +158,7 @@ class BargainMiddlePage extends Component { ...@@ -159,7 +158,7 @@ class BargainMiddlePage extends Component {
list: res.data.data.list, list: res.data.data.list,
outList: newList, outList: newList,
}) })
} else if (res.data.code == 4030 || res.data.code == 4040) { } else if (res.data.code === 4030 || res.data.code === 4040) {
} else { } else {
Toast.info(res.data.msg, 2) Toast.info(res.data.msg, 2)
} }
...@@ -317,7 +316,7 @@ class BargainMiddlePage extends Component { ...@@ -317,7 +316,7 @@ class BargainMiddlePage extends Component {
this.getBargainInfo() this.getBargainInfo()
this.getBargainRankList(getParam("id"), 1) this.getBargainRankList(getParam("id"), 1)
} else if (res.data.code == 4030 || res.data.code == 4040) { } else if (res.data.code === 4030 || res.data.code === 4040) {
if (browser.isWeixin) { if (browser.isWeixin) {
let redirectURI = window.location.href let redirectURI = window.location.href
if ( if (
...@@ -390,15 +389,12 @@ class BargainMiddlePage extends Component { ...@@ -390,15 +389,12 @@ class BargainMiddlePage extends Component {
} }
toCourseDetail = (id) => { toCourseDetail = (id) => {
const { dispatch, history } = this.props const { history } = this.props
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`) history.push(`/detail?id=${id}`)
return false return false
// }));
} }
render() { render() {
// console.log(this.props);
let thirdRow, btn let thirdRow, btn
// is_artifact 0-再邀请多少人可以使用 1-可以使用未领取 2-已领取 3-已使用 // is_artifact 0-再邀请多少人可以使用 1-可以使用未领取 2-已领取 3-已使用
if (this.state.bargainData.is_artifact === 0) { if (this.state.bargainData.is_artifact === 0) {
...@@ -513,8 +509,8 @@ class BargainMiddlePage extends Component { ...@@ -513,8 +509,8 @@ class BargainMiddlePage extends Component {
/> />
</ul> </ul>
<div className="bargain-detail"> <div className="bargain-detail">
{(this.state.data.bargain_status == 0 || {(Number(this.state.data.bargain_status) === 0 ||
this.state.data.bargain_status == 1) && ( Number(this.state.data.bargain_status) === 1) && (
<div> <div>
<div className="top"> <div className="top">
<div> <div>
...@@ -746,12 +742,12 @@ function CourseDes(props) { ...@@ -746,12 +742,12 @@ function CourseDes(props) {
<div className="price-bar"> <div className="price-bar">
<span className={"discount-price"}>{course.course_price}</span> <span className={"discount-price"}>{course.course_price}</span>
{/* is_originator 是否发起人 0-否 1-是 */} {/* is_originator 是否发起人 0-否 1-是 */}
{is_originator == 1 && bargain_status != 3 && ( {Number(is_originator) === 1 && Number(bargain_status) !== 3 && (
<button className={"purchase-btn"} onClick={toCart}> <button className={"purchase-btn"} onClick={toCart}>
¥{course.pay_price}去支付 ¥{course.pay_price}去支付
</button> </button>
)} )}
{is_originator == 1 && bargain_status == 3 && ( {Number(is_originator) === 1 && Number(bargain_status) === 3 && (
<span className="course-button__buy--done">已购买</span> <span className="course-button__buy--done">已购买</span>
)} )}
</div> </div>
...@@ -849,23 +845,6 @@ function CourseBottom(props) { ...@@ -849,23 +845,6 @@ function CourseBottom(props) {
) )
} }
function PublicNumber(props) {
return (
<div className="bargain-public-number">
<img className="avait" src={props.avatar} alt="" />
{props.firendBaigainPrice && (
<p className="status-title ff4">谢谢你帮我砍了{props.money}元!</p>
)}
<p className="status-dec">关注公众号,可以再砍一刀哦~</p>
<img
className="public-number-img"
src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/tinypng-common/right_weixin.png"
alt=""
/>
</div>
)
}
function BargainFirst(props) { function BargainFirst(props) {
return ( return (
<div className="bargain-first"> <div className="bargain-first">
......
...@@ -4,7 +4,7 @@ import listFrame from "./../listFrame/index" ...@@ -4,7 +4,7 @@ import listFrame from "./../listFrame/index"
import "./index.scss" import "./index.scss"
import { Toast } from "antd-mobile" import { Toast } from "antd-mobile"
import { connect } from "react-redux" import { connect } from "react-redux"
import { Link, withRouter } from "react-router-dom" import { withRouter } from "react-router-dom"
class ReserveCourse extends Component { class ReserveCourse extends Component {
constructor(props) { constructor(props) {
...@@ -33,7 +33,7 @@ class ReserveCourse extends Component { ...@@ -33,7 +33,7 @@ class ReserveCourse extends Component {
if (code === 200) { if (code === 200) {
this.setState({ this.setState({
courseData: courseData:
JSON.stringify(data) == "{}" JSON.stringify(data) === "{}"
? [] ? []
: data.filter((item, index) => index < 4), : data.filter((item, index) => index < 4),
courseDataAll: data, courseDataAll: data,
...@@ -46,7 +46,7 @@ class ReserveCourse extends Component { ...@@ -46,7 +46,7 @@ class ReserveCourse extends Component {
// 立即付定金 // 立即付定金
expandPaydj = (courseId) => { expandPaydj = (courseId) => {
const { user, history } = this.props const { user } = this.props
const uid = user && user.data && user.data.uid const uid = user && user.data && user.data.uid
if (!uid) { if (!uid) {
if (!getParam("version")) { if (!getParam("version")) {
...@@ -68,7 +68,7 @@ class ReserveCourse extends Component { ...@@ -68,7 +68,7 @@ class ReserveCourse extends Component {
} }
// 立即付尾款 // 立即付尾款
expandPaywk = (courseId, time, day) => { expandPaywk = (courseId, time, day) => {
const { user, history } = this.props const { user } = this.props
const uid = user && user.data && user.data.uid const uid = user && user.data && user.data.uid
if (!uid) { if (!uid) {
if (!getParam("version")) { if (!getParam("version")) {
...@@ -137,6 +137,7 @@ function CourseList(props) { ...@@ -137,6 +137,7 @@ function CourseList(props) {
{courseData.map((item, index) => { {courseData.map((item, index) => {
return ( return (
<li className="course-item-box" key={index}> <li className="course-item-box" key={index}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a onClick={() => tostudy(item.course_id)}> <a onClick={() => tostudy(item.course_id)}>
<div className="top"> <div className="top">
<div className="square"> <div className="square">
......
...@@ -7,7 +7,6 @@ import ListFrame from "./../listFrame/index" ...@@ -7,7 +7,6 @@ import ListFrame from "./../listFrame/index"
import CourseItem from "./../courseItem/index" import CourseItem from "./../courseItem/index"
import ListHeader from "./../listHeader" import ListHeader from "./../listHeader"
import "./index.scss" import "./index.scss"
import cookie from "js-cookie"
class CourseList extends Component { class CourseList extends Component {
constructor(props) { constructor(props) {
......
...@@ -64,7 +64,8 @@ class LuckDraw extends Component { ...@@ -64,7 +64,8 @@ class LuckDraw extends Component {
key={`${val.id}-${k}`} key={`${val.id}-${k}`}
> >
<div className="prize__image"> <div className="prize__image">
<img src={v.img} alt="image" /> {/* eslint-disable-next-line jsx-a11y/alt-text */}
<img src={v.img} />
</div> </div>
<p className="prize__desc">{v.name}</p> <p className="prize__desc">{v.name}</p>
<p className="prize__desc">*{v.num}</p> <p className="prize__desc">*{v.num}</p>
......
/* eslint-disable jsx-a11y/alt-text */
import React, { Component } from "react" import React, { Component } from "react"
import "./index.scss" import "./index.scss"
import { http } from "src/utils" import { http } from "src/utils"
......
import React from "react" import React from "react"
import "./banner.scss" import "./banner.scss"
export default (props) => { export default () => {
const { banner = "" } = props
const style = () => {
if (banner) {
return {
backgroundImage: `url(${banner})`,
}
}
return {}
}
return <div className="college-banner"></div> return <div className="college-banner"></div>
} }
...@@ -58,7 +58,7 @@ class Coupon extends PureComponent { ...@@ -58,7 +58,7 @@ class Coupon extends PureComponent {
}) })
.then((res) => { .then((res) => {
const { data } = res const { data } = res
if (data.code == 200) { if (data.code === 200) {
this.props.endExpansion(id, data.data.coupon_id) this.props.endExpansion(id, data.data.coupon_id)
} else { } else {
Toast.info(data.msg) Toast.info(data.msg)
...@@ -82,7 +82,7 @@ class Coupon extends PureComponent { ...@@ -82,7 +82,7 @@ class Coupon extends PureComponent {
} = this.props } = this.props
let top, bottom let top, bottom
/* eslint-disable default-case */
switch (ctype) { switch (ctype) {
case this.VOUCHER: case this.VOUCHER:
top = ( top = (
...@@ -96,11 +96,11 @@ class Coupon extends PureComponent { ...@@ -96,11 +96,11 @@ class Coupon extends PureComponent {
bottom = ( bottom = (
<> <>
<span className={"limit"}> <span className={"limit"}>
{limit_course == 0 {Number(limit_course) === 0
? "可用于大于代金券金额的课程" ? "可用于大于代金券金额的课程"
: `仅适用于《${course_title}》`} : `仅适用于《${course_title}》`}
</span> </span>
{showUseButton && ctype == this.VOUCHER && ( {showUseButton && Number(ctype) === this.VOUCHER && (
<button className="use" onClick={this.GoToUse}> <button className="use" onClick={this.GoToUse}>
立即使用 立即使用
</button> </button>
...@@ -118,7 +118,7 @@ class Coupon extends PureComponent { ...@@ -118,7 +118,7 @@ class Coupon extends PureComponent {
bottom = ( bottom = (
<> <>
<span className={"limit"}>{`仅适用于《${course_title}》`}</span> <span className={"limit"}>{`仅适用于《${course_title}》`}</span>
{showUseButton && ctype == this.FREE && ( {showUseButton && Number(ctype) === this.FREE && (
<button className="use" onClick={(e) => this.ExchangeCourse(e)}> <button className="use" onClick={(e) => this.ExchangeCourse(e)}>
立即兑换 立即兑换
</button> </button>
...@@ -176,6 +176,7 @@ class Coupon extends PureComponent { ...@@ -176,6 +176,7 @@ class Coupon extends PureComponent {
) )
break break
} }
/* eslint-enable default-case */
return ( return (
<BaseCoupon <BaseCoupon
......
...@@ -67,7 +67,7 @@ class UseCoupon extends PureComponent { ...@@ -67,7 +67,7 @@ class UseCoupon extends PureComponent {
const coupon = data.data const coupon = data.data
if (state.from === "/my") { if (state.from === "/my") {
if (coupon["ctype"] == 2) { if (Number(coupon["ctype"]) === 2) {
this.setState({ this.setState({
courseCouponData: coupon, courseCouponData: coupon,
courseCouponExchange: true, courseCouponExchange: true,
...@@ -119,16 +119,17 @@ class UseCoupon extends PureComponent { ...@@ -119,16 +119,17 @@ class UseCoupon extends PureComponent {
const [expansionCoupons, allCoupons] = coupons const [expansionCoupons, allCoupons] = coupons
const { data: all } = allCoupons const { data: all } = allCoupons
const { data: expansion } = expansionCoupons const { data: expansion } = expansionCoupons
if (expansion.code == 200) { if (expansion.code === 200) {
Array.isArray(expansion.data) && Array.isArray(expansion.data) &&
(expansion.data = expansion.data.map( (expansion.data = expansion.data.map(
/* eslint-disable-next-line no-sequences */
(item) => ((item.ctype = 4), item) (item) => ((item.ctype = 4), item)
)) && )) &&
(myCoupons = myCoupons.concat(expansion.data)) (myCoupons = myCoupons.concat(expansion.data))
} else { } else {
Toast.info(expansion.msg) Toast.info(expansion.msg)
} }
if (all.code == 200) { if (all.code === 200) {
Array.isArray(all.data) && (myCoupons = myCoupons.concat(all.data)) Array.isArray(all.data) && (myCoupons = myCoupons.concat(all.data))
} else { } else {
Toast.info(all.msg) Toast.info(all.msg)
......
...@@ -3,10 +3,6 @@ import "./index.scss" ...@@ -3,10 +3,6 @@ import "./index.scss"
import { CallApp } from "../../../common" import { CallApp } from "../../../common"
class Audition extends Component { class Audition extends Component {
constructor(props) {
super(props)
}
colse = () => { colse = () => {
this.props.boxHide(false) this.props.boxHide(false)
} }
......
...@@ -143,18 +143,13 @@ class ToGroup extends Component { ...@@ -143,18 +143,13 @@ class ToGroup extends Component {
render() { render() {
const { const {
data: { course_id, course_title, simpledescription, price0, price1 }, data: { course_id, course_title, simpledescription, price0, price1 },
pdd_price,
is_success, is_success,
person_num,
groupon_member,
course_list, course_list,
} = this.state } = this.state
const Info = ( const Info = (
<div className="info"> <div className="info">
<p className="title" onClick={() => this.toCourseDetail(course_id)}> <p className="title" onClick={() => this.toCourseDetail(course_id)}>
{/* <Link to={`/detail?id=${course_id}`}> */}
{course_title} {course_title}
{/* </Link> */}
</p> </p>
<p className="contact text-overflow-2">{simpledescription}</p> <p className="contact text-overflow-2">{simpledescription}</p>
<div className="des"> <div className="des">
...@@ -253,7 +248,7 @@ class ToGroup extends Component { ...@@ -253,7 +248,7 @@ class ToGroup extends Component {
} }
function GorupContent(props) { function GorupContent(props) {
let tip, btn, dec, groupTip, shareTip, groupSuccessMbc let tip, btn, dec, groupTip
const { const {
pdd_price, pdd_price,
data, data,
......
...@@ -3,7 +3,7 @@ import { CopyToClipboard } from "react-copy-to-clipboard" ...@@ -3,7 +3,7 @@ import { CopyToClipboard } from "react-copy-to-clipboard"
import classnames from "classnames" import classnames from "classnames"
import { isEmpty } from "lodash" import { isEmpty } from "lodash"
import { browser } from "src/utils" import { browser } from "src/utils"
import { http, getParam, validateTel } from "src/utils" import { http, getParam } from "src/utils"
import { Formik, Form, Field } from "formik" import { Formik, Form, Field } from "formik"
import { Toast } from "antd-mobile" import { Toast } from "antd-mobile"
import CaptchaAli from "src/common/Captcha-ali" import CaptchaAli from "src/common/Captcha-ali"
...@@ -662,7 +662,7 @@ class RedPacket extends PureComponent { ...@@ -662,7 +662,7 @@ class RedPacket extends PureComponent {
{type !== 0 && ( {type !== 0 && (
<div className={cls} onClick={this.clickMask}> <div className={cls} onClick={this.clickMask}>
{/* wechat */} {/* wechat */}
{type == 2 && ( {type === 2 && (
<div className="pupup-wechat"> <div className="pupup-wechat">
<h4 className="popup-wechat__title"> <h4 className="popup-wechat__title">
当前环境不支持领红包活动 当前环境不支持领红包活动
......
...@@ -2,7 +2,7 @@ import React, { Component } from "react" ...@@ -2,7 +2,7 @@ import React, { Component } from "react"
import "./index.scss" import "./index.scss"
import { getParam, http, browser } from "src/utils" import { getParam, http, browser } from "src/utils"
import { Toast } from "antd-mobile" import { Toast } from "antd-mobile"
import { Link, withRouter } from "react-router-dom" import { withRouter } from "react-router-dom"
import { compose } from "redux" import { compose } from "redux"
import { connect } from "react-redux" import { connect } from "react-redux"
import { import {
...@@ -143,7 +143,7 @@ class Single extends Component { ...@@ -143,7 +143,7 @@ class Single extends Component {
paySign: data.paySign, //微信签名 paySign: data.paySign, //微信签名
}, },
function (res) { function (res) {
if (res.err_msg == "get_brand_wcpay_request:ok") { if (res.err_msg === "get_brand_wcpay_request:ok") {
Toast.info("支付成功", 2) Toast.info("支付成功", 2)
_this.intervalPayStatus = setInterval(function () { _this.intervalPayStatus = setInterval(function () {
http http
...@@ -354,7 +354,6 @@ class Single extends Component { ...@@ -354,7 +354,6 @@ class Single extends Component {
} }
render() { render() {
const { showSingleBox } = this.state
if (this.state.endTime) { if (this.state.endTime) {
let date = this.state.endTime * 1000 let date = this.state.endTime * 1000
let now = Date.now() let now = Date.now()
......
...@@ -2,7 +2,7 @@ import React, { Component } from "react" ...@@ -2,7 +2,7 @@ import React, { Component } from "react"
import "./index.scss" import "./index.scss"
import { getParam, http, browser } from "src/utils" import { getParam, http, browser } from "src/utils"
import { Toast } from "antd-mobile" import { Toast } from "antd-mobile"
import { Link, withRouter } from "react-router-dom" import { withRouter } from "react-router-dom"
import { compose } from "redux" import { compose } from "redux"
import { connect } from "react-redux" import { connect } from "react-redux"
import { import {
...@@ -193,7 +193,6 @@ class Single extends Component { ...@@ -193,7 +193,6 @@ class Single extends Component {
} }
render() { render() {
let { singleBox } = this.state
if (this.state.endTime) { if (this.state.endTime) {
let date = this.state.endTime * 1000 let date = this.state.endTime * 1000
let now = Date.now() let now = Date.now()
......
...@@ -58,7 +58,7 @@ class PythonDes extends Component { ...@@ -58,7 +58,7 @@ class PythonDes extends Component {
} }
creatOid = (type) => { creatOid = (type) => {
let url = "" let url = ""
if (type == 3) { if (Number(type) === 3) {
url = `${API["base-api"]}/sys/it_baoming/create` url = `${API["base-api"]}/sys/it_baoming/create`
} else { } else {
url = `${API["base-api"]}/sys/trial_create` url = `${API["base-api"]}/sys/trial_create`
...@@ -115,7 +115,7 @@ class PythonDes extends Component { ...@@ -115,7 +115,7 @@ class PythonDes extends Component {
}) })
.then((res) => { .then((res) => {
const { code, msg } = res.data const { code, msg } = res.data
if (code == 200) { if (code === 200) {
if (!getParam("version")) { if (!getParam("version")) {
// H5 // H5
this.setState({ this.setState({
...@@ -230,7 +230,7 @@ class PythonDes extends Component { ...@@ -230,7 +230,7 @@ class PythonDes extends Component {
) )
.then((res) => { .then((res) => {
const { code, data, msg } = res.data const { code, data, msg } = res.data
if (code == 200) { if (code === 200) {
this.setState({ this.setState({
syllabus: data.syllabus.slice(0, 2), syllabus: data.syllabus.slice(0, 2),
allSyllabus: data.syllabus, allSyllabus: data.syllabus,
...@@ -319,7 +319,9 @@ class PythonDes extends Component { ...@@ -319,7 +319,9 @@ class PythonDes extends Component {
</div> </div>
)} )}
{this.state.isShowChannel == 1 && <CallApp className="toapp" />} {Number(this.state.isShowChannel) === 1 && (
<CallApp className="toapp" />
)}
{/* 课程介绍 */} {/* 课程介绍 */}
<Description /> <Description />
...@@ -358,24 +360,4 @@ class PythonDes extends Component { ...@@ -358,24 +360,4 @@ class PythonDes extends Component {
} }
} }
function DefineItem(props) {
const {
item,
item: { desInfo },
} = props
return (
<div className={"number_one"}>
<img className={"trophy"} src={item.titleUrl}></img>
<p className={"item__title"}>{item.title}</p>
<p className={"item__subtitle"} style={{ width: item.subWidth }}>
{item.subTitle}
</p>
<img
style={{ width: desInfo.width, height: desInfo.height }}
src={item.bottomUrl}
></img>
</div>
)
}
export default PythonDes export default PythonDes
...@@ -120,10 +120,6 @@ const MyForm = withFormik({ ...@@ -120,10 +120,6 @@ const MyForm = withFormik({
})(InnerForm) })(InnerForm)
class Orderinfo extends Component { class Orderinfo extends Component {
constructor(props) {
super(props)
}
render() { render() {
return ( return (
<div> <div>
......
...@@ -10,7 +10,7 @@ export default class Study extends Component { ...@@ -10,7 +10,7 @@ export default class Study extends Component {
let cs = Math.floor(Number(str) / 10) let cs = Math.floor(Number(str) / 10)
let cv = "" let cv = ""
if (str.length > 1) { if (str.length > 1) {
if (cs == 1) { if (cs === 1) {
cv = ci >= 1 ? cn[9] + cn[ci - 1] : cn[9] cv = ci >= 1 ? cn[9] + cn[ci - 1] : cn[9]
} else { } else {
cv = ci > 1 ? cn[cs - 1] + cn[9] + cn[ci - 1] : cn[cs - 1] + cn[9] cv = ci > 1 ? cn[cs - 1] + cn[9] + cn[ci - 1] : cn[cs - 1] + cn[9]
......
...@@ -10,7 +10,7 @@ export default class Test extends Component { ...@@ -10,7 +10,7 @@ export default class Test extends Component {
let cs = Math.floor(Number(str) / 10) let cs = Math.floor(Number(str) / 10)
let cv = "" let cv = ""
if (str.length > 1) { if (str.length > 1) {
if (cs == 1) { if (cs === 1) {
cv = ci >= 1 ? cn[9] + cn[ci - 1] : cn[9] cv = ci >= 1 ? cn[9] + cn[ci - 1] : cn[9]
} else { } else {
cv = ci > 1 ? cn[cs - 1] + cn[9] + cn[ci - 1] : cn[cs - 1] + cn[9] cv = ci > 1 ? cn[cs - 1] + cn[9] + cn[ci - 1] : cn[cs - 1] + cn[9]
......
/* eslint-disable eqeqeq */
import React, { Component } from "react" import React, { Component } from "react"
import { Accordion, Toast } from "antd-mobile" import { Accordion, Toast } from "antd-mobile"
import { HeaderBar, CallApp } from "src/common" import { HeaderBar, CallApp } from "src/common"
import { http, getParam } from "src/utils" import { http, getParam } from "src/utils"
import "./index.scss" import "./index.scss"
import { Link } from "react-router-dom"
import { connect } from "react-redux" import { connect } from "react-redux"
import Mask from "./../poup/index.js" import Mask from "./../poup/index.js"
import ShareRank from "src/components/detail/shareRank" import ShareRank from "src/components/detail/shareRank"
...@@ -49,7 +49,7 @@ class PythonStudy extends Component { ...@@ -49,7 +49,7 @@ class PythonStudy extends Component {
let cs = Math.floor(Number(str) / 10) let cs = Math.floor(Number(str) / 10)
let cv = "" let cv = ""
if (str.length > 1) { if (str.length > 1) {
if (cs == 1) { if (cs === 1) {
cv = ci >= 1 ? cn[9] + cn[ci - 1] : cn[9] cv = ci >= 1 ? cn[9] + cn[ci - 1] : cn[9]
} else { } else {
cv = ci > 1 ? cn[cs - 1] + cn[9] + cn[ci - 1] : cn[cs - 1] + cn[9] cv = ci > 1 ? cn[cs - 1] + cn[9] + cn[ci - 1] : cn[cs - 1] + cn[9]
......
...@@ -2,7 +2,6 @@ import React, { PureComponent } from "react" ...@@ -2,7 +2,6 @@ import React, { PureComponent } from "react"
import "./aist-share.scss" import "./aist-share.scss"
import withFullSize from "src/HOCs/WithFullSize" import withFullSize from "src/HOCs/WithFullSize"
import { http, wxShare } from "src/utils" import { http, wxShare } from "src/utils"
import { getWXObject } from "src/utils/wechat/base"
import { Link } from "react-router-dom" import { Link } from "react-router-dom"
class AistShare extends PureComponent { class AistShare extends PureComponent {
...@@ -34,7 +33,7 @@ class AistShare extends PureComponent { ...@@ -34,7 +33,7 @@ class AistShare extends PureComponent {
)}/${search.get("vId")}` )}/${search.get("vId")}`
) )
.then((res) => { .then((res) => {
if (res.data.errno == 200) { if (res.data.errno === 200) {
const data = res.data.data const data = res.data.data
this.setState({ this.setState({
course: { course: {
......
...@@ -56,17 +56,9 @@ class SharePoster extends Component { ...@@ -56,17 +56,9 @@ class SharePoster extends Component {
let qrCodePositionX = imgList[index].qr_code_x * $width // 二维码x轴位置 let qrCodePositionX = imgList[index].qr_code_x * $width // 二维码x轴位置
let qrCodePositionY = imgList[index].qr_code_y * $height + 7 // 二维码y轴位置 let qrCodePositionY = imgList[index].qr_code_y * $height + 7 // 二维码y轴位置
let qrCodeWidth = imgList[index].qr_code_width * $width // 二维码宽度
let qrCodeHeight =
imgList[index].qr_code_height * $height - avatarHeight / 2 // 二维码高度
let qrCodeLink = `https://m.julyedu.com/detail?id=${getParam(
"courseId"
)}&dist_code${getParam("dist_code")}`
var canvas = document.getElementById("canvas"), var canvas = document.getElementById("canvas"),
context = canvas.getContext("2d") context = canvas.getContext("2d")
// console.log(_this);
_this _this
.getBase64(imgSrc1) .getBase64(imgSrc1)
// 背景图片合成 // 背景图片合成
...@@ -74,11 +66,6 @@ class SharePoster extends Component { ...@@ -74,11 +66,6 @@ class SharePoster extends Component {
let bgImage = new Image() let bgImage = new Image()
bgImage.src = img bgImage.src = img
let qrCodeImg = document.getElementById("qrcode") let qrCodeImg = document.getElementById("qrcode")
let ua = navigator.userAgent.toLowerCase()
// Android终端
let isAndroid = ua.indexOf("Android") > -1 || ua.indexOf("Adr") > -1
// Ios终端
let isiOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
qrCodeImg = document.getElementById("qrcode") qrCodeImg = document.getElementById("qrcode")
} else if (/(Android)/i.test(navigator.userAgent)) { } else if (/(Android)/i.test(navigator.userAgent)) {
...@@ -167,7 +154,6 @@ class SharePoster extends Component { ...@@ -167,7 +154,6 @@ class SharePoster extends Component {
// 合成图片位置 // 合成图片位置
imgPosition = (ctx, img, x, y, r) => { imgPosition = (ctx, img, x, y, r) => {
ctx.save() ctx.save()
var d = 2 * r
var cx = x + r var cx = x + r
var cy = y + r var cy = y + r
ctx.beginPath() ctx.beginPath()
...@@ -229,8 +215,7 @@ class SharePoster extends Component { ...@@ -229,8 +215,7 @@ class SharePoster extends Component {
let ctx = canvas.getContext("2d") let ctx = canvas.getContext("2d")
ctx.drawImage(img, 0, 0, img.width, img.height) ctx.drawImage(img, 0, 0, img.width, img.height)
let ext = img.src.substring(img.src.lastIndexOf(".") + 1).toLowerCase() let ext = img.src.substring(img.src.lastIndexOf(".") + 1).toLowerCase()
let dataURL = canvas.toDataURL("image/" + ext) return canvas.toDataURL("image/" + ext)
return dataURL
} }
// canvas转换成img图片 // canvas转换成img图片
......
...@@ -76,7 +76,7 @@ class MyCourses extends Component { ...@@ -76,7 +76,7 @@ class MyCourses extends Component {
handleClick = (id, item) => { handleClick = (id, item) => {
const { history } = this.props const { history } = this.props
const { mode, course_id } = item const { mode, course_id } = item
if (mode && mode == 6) { if (mode && Number(mode) === 6) {
history.push(`/python?id=${course_id}`) history.push(`/python?id=${course_id}`)
return return
} }
...@@ -131,13 +131,13 @@ class MyCourses extends Component { ...@@ -131,13 +131,13 @@ class MyCourses extends Component {
)} )}
{!item.is_restricted && {!item.is_restricted &&
!item.is_aist && !item.is_aist &&
item.contact_type == 1 && Number(item.contact_type) === 1 &&
item.course_qq && ( item.course_qq && (
<div className="contact">QQ群:{item.course_qq}</div> <div className="contact">QQ群:{item.course_qq}</div>
)} )}
{!item.is_restricted && {!item.is_restricted &&
!item.is_aist && !item.is_aist &&
item.contact_type == 2 && Number(item.contact_type) === 2 &&
item.course_qq && ( item.course_qq && (
<div className="contact"> <div className="contact">
班主任微信:{item.course_qq} 班主任微信:{item.course_qq}
......
...@@ -2,9 +2,7 @@ import React, { useState } from "react" ...@@ -2,9 +2,7 @@ import React, { useState } from "react"
import { withRouter } from "react-router-dom" import { withRouter } from "react-router-dom"
const TSTest: React.FC = () => { const TSTest: React.FC = () => {
const [count, const [count, setCount] = useState(0)
setCount] =
useState(0)
function handleAlertClick() { function handleAlertClick() {
setTimeout(() => { setTimeout(() => {
...@@ -22,4 +20,8 @@ const TSTest: React.FC = () => { ...@@ -22,4 +20,8 @@ const TSTest: React.FC = () => {
) )
} }
function C(a=2, b=3,c=4,d=5,e=6) {
return d
}
export default withRouter(TSTest) export default withRouter(TSTest)
/* eslint-disable jsx-a11y/anchor-is-valid, no-script-url */
import React, { Component } from "react" import React, { Component } from "react"
import "./video-catalog.scss" import "./video-catalog.scss"
import { Link } from "react-router-dom" import { Link } from "react-router-dom"
......
...@@ -9,11 +9,11 @@ const PrivateRoute = ({ component: Component, path, user, ...rest }) => { ...@@ -9,11 +9,11 @@ const PrivateRoute = ({ component: Component, path, user, ...rest }) => {
const [authenticated, setAuthorization] = useState(false) const [authenticated, setAuthorization] = useState(false)
useEffect(() => { useEffect(() => {
let _auth = !user.hasError && user.code != 4040 let _auth = !user.hasError && user.code !== 4040
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
typeof _auth !== "undefined" && typeof _auth !== "undefined" &&
(setAuthorization(_auth), setLoadingState(false)) (setAuthorization(_auth), setLoadingState(false))
}, [user.hasError]) }, [user.hasError, user.code])
return ( return (
<Route <Route
......
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