Commit 854a13ab by FE

del build

parents de62c028 078c92f7
......@@ -209,7 +209,7 @@ module.exports = function(webpackEnv) {
// https://github.com/facebook/create-react-app/issues/5250
// Pending futher investigation:
// https://github.com/terser-js/terser/issues/120
inline: 2,
inline: 2
},
mangle: {
safari10: true,
......
......@@ -3692,11 +3692,6 @@
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz",
"integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk="
},
"clipboard-copy": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/clipboard-copy/-/clipboard-copy-3.1.0.tgz",
"integrity": "sha512-Xsu1NddBXB89IUauda5BIq3Zq73UWkjkaQlPQbLNvNsd5WBMnTWPNKYR6HGaySOxGYZ+BKxP2E9X4ElnI3yiPA=="
},
"cliui": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz",
......@@ -3989,6 +3984,14 @@
"resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
"integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40="
},
"copy-to-clipboard": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.2.0.tgz",
"integrity": "sha512-eOZERzvCmxS8HWzugj4Uxl8OJxa7T2k1Gi0X5qavwydHIfuSHq2dTD09LOg/XyGq4Zpb5IsR/2OJ5lbOegz78w==",
"requires": {
"toggle-selection": "^1.0.6"
}
},
"core-js": {
"version": "2.6.5",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz",
......@@ -12084,6 +12087,15 @@
}
}
},
"react-copy-to-clipboard": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.1.tgz",
"integrity": "sha512-ELKq31/E3zjFs5rDWNCfFL4NvNFQvGRoJdAKReD/rUPA+xxiLPQmZBZBvy2vgH7V0GE9isIQpT9WXbwIVErYdA==",
"requires": {
"copy-to-clipboard": "^3",
"prop-types": "^15.5.8"
}
},
"react-dev-utils": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-8.0.0.tgz",
......@@ -14502,6 +14514,11 @@
"repeat-string": "^1.6.1"
}
},
"toggle-selection": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz",
"integrity": "sha1-bkWxJj8gF/oKzH2J14sVuL932jI="
},
"topo": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/topo/-/topo-2.0.2.tgz",
......@@ -15067,6 +15084,11 @@
"minimalistic-assert": "^1.0.0"
}
},
"web-launch-app": {
"version": "2.1.9",
"resolved": "https://registry.npmjs.org/web-launch-app/-/web-launch-app-2.1.9.tgz",
"integrity": "sha512-9zBCrr2msXKMh7qcYg1zqG+CCtzwSA1g9AM+4IPljklzcd2krTJAE7XdVwwWANFemwQyjRRWUVaAuEi8+z55kg=="
},
"web-namespaces": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-1.1.2.tgz",
......
......@@ -80,6 +80,7 @@
"terser-webpack-plugin": "1.2.2",
"url-loader": "1.1.2",
"video.js": "^7.6.0",
"web-launch-app": "^2.1.9",
"webpack": "4.28.3",
"webpack-dev-server": "3.1.14",
"webpack-manifest-plugin": "2.0.4",
......
import React, { Component } from 'react'
import React, {Component} from 'react'
import Routes from './router'
import cookie from 'js-cookie'
import { connect } from "react-redux";
import { setCurrentUser, startFetchUser } from "@/store/userAction";
import { withRouter } from 'react-router-dom'
import { compose } from 'redux'
import { getParam, http, browser } from "@/utils";
import { Toast } from "antd-mobile";
import { addDays } from 'date-fns'
import {connect} from "react-redux";
import {setCurrentUser, startFetchUser} from "@/store/userAction";
import {withRouter} from 'react-router-dom'
import {compose} from 'redux'
import {getParam, http, browser} from "@/utils";
import {Toast} from "antd-mobile";
import {addDays} from 'date-fns'
//拦截ajax请求,返回mock数据
......@@ -57,15 +57,14 @@ class App extends Component {
if (browser.isWeixin && browser.isIOS) {
sessionStorage.setItem('enter_url', window.location.href)
}
this.getUser()
this.utm()
const routeMatchRule = /binding-tel|forgot|set-password/
const {history} = this.props
history.listen((location, action) => {
this.utm()
this.firstLoad = false
this.setNavigationRecord(location, action)
this.utm()
if (cookie.get('uid') && this.props.user.hasError) {
this.getUser()
}
......@@ -89,13 +88,13 @@ class App extends Component {
setNavigationRecord = (location, action) => {
const {pathname, search, hash} = location
let isLastRecord = location.pathname === this.records.length && this.records[this.records.length - 1].pathname
let isLastRecord = location.pathname === (this.records.length && this.records[this.records.length - 1].pathname)
switch (action) {
case 'POP':
this.firstLoad ? this.records.push({pathname, search, hash}) : this.records.pop()
break
case 'REPLACE':
this.records[this.records.length - 1] = {pathname, search, hash}
this.records.length > 1 && (this.records[this.records.length - 1] = {pathname, search, hash})
break
default:
!isLastRecord && this.records.push({pathname, search, hash})
......@@ -171,8 +170,6 @@ class App extends Component {
componentDidUpdate() {
this.setPreviousLocation()
if (!this.props.user.hasError && getParam('redirect')) {
window.location.href = getParam('redirect')
}
......@@ -180,22 +177,23 @@ class App extends Component {
setPreviousLocation = () => {
const {location, history: {action}} = this.props
if (location.pathname.startsWith('/passport')) {
let index = this.records.findIndex(item => item.pathname.startsWith('/passport'))
/*let index = this.records.findIndex(item => item.pathname.startsWith('/passport'))
this.previousLocation = index > 0
? this.records[index - 1]
: this.records.length
? this.records[this.records.length - 1]
: null
: null*/
} else {
if (action === 'POP' || action === 'REPLACE') {
let index = this.records.findIndex(item => item.pathname.startsWith('/passport'))
this.previousLocation = index > 0 ? this.records[index - 1] : this.records[this.records.length - 1]
} else {
this.previousLocation = location
}
if (action === 'POP' || action === 'REPLACE') {
let index = this.records.findIndex(item => item.pathname.startsWith('/passport'))
this.previousLocation = index > 0 ? this.records[index - 1] : this.records[this.records.length - 1]
} else {
this.previousLocation = location
}
}
}
transformUser = res => {
......
import React, { Component } from 'react'
import React, { Component } from 'react';
import CallApp from 'callapp-lib'
const options = {
......@@ -24,23 +24,29 @@ const options = {
class OpenApp extends Component {
// callApp = new CallApp(options)
callApp = null
callApp = new CallApp(options)
// callApp = null
static defaultProps = {
text: '在APP打开'
}
componentWillMount() {
this.callApp = new CallApp({
...options,
path: this.props.path || '/'
});
// this.callApp = new CallApp({});
}
handleClick = () => {
this.callApp.open({})
this.callApp.open({
path: '',
param: {
},
callback: () => {
window.location.href = "http://www.julyedu.com/weekend/redir1";
}
});
}
render() {
......
import React, { Component } from 'react';
import { initCaptcha } from '@/utils';
import { BarLoader } from 'react-spinners';
import './index.scss';
const CAPTCHAID = '6b0f5f6c8f334f3693ee754ba5692e36'
class Captcha extends Component {
state = {
isReady: false
}
componentDidMount() {
const {getInstance, handleError, onVerify} = this.props
const {getInstance, handleError, onVerify} = this.props;
const _this = this;
const el = document.getElementById('captcha');
el && initCaptcha(function () {
initNECaptcha({
......@@ -14,6 +22,13 @@ class Captcha extends Component {
captchaId: CAPTCHAID,
mode: 'float',
width: 'auto',
onReady: function (instance) {
// 验证码一切准备就绪,此时可正常使用验证码的相关功能
console.log(_this);
_this.setState({
isReady: true
});
},
onVerify: function (err, data) {
onVerify(err,data)
}
......@@ -30,7 +45,25 @@ class Captcha extends Component {
render() {
return (
<div id={'captcha'} style={{'marginBottom': this.props.mrBtm}}></div>
<div
className="captcha-container"
style={{
'marginBottom': this.props.mrBtm
}}
>
{
!this.state.isReady &&
<div className="captcha-animation">
<BarLoader />
</div>
}
<div
id={'captcha'}
style={{
'marginBottom': this.props.mrBtm
}}
/>
</div>
);
}
}
......
.captcha-container {
position: relative;
width: 100%;
height: 40px;
}
.captcha-animation {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
\ No newline at end of file
......@@ -15,6 +15,8 @@ class HeaderBar extends Component {
}
if(state.records && state.records.length > 1){
window.history.go(-1);
}else if(state.from && state.from.pathname) {
location.replace(`${state.from.pathname}${state.from.search}`)
}else{
window.location.href = window.location.origin
}
......
......@@ -36,12 +36,18 @@ class Loading extends Component {
})
}, fake)
}else {
if(prevProps.isLoading != isLoading){
this.setState({
isLoading
})
if(prevProps.isLoading) {
this.setState(()=>({
isLoading: false
}))
}
}
}else{
if(prevProps.isLoading !== isLoading) {
this.setState(()=>({
isLoading: true
}))
}
}
}
......
......@@ -23,11 +23,12 @@ class FollowBarcode extends Component {
this.setState({
url: data.url
});
const _this = this;
return new Promise(resolve => {
QRCode.toDataURL(data.url, {}, function (err, url) {
this.setState({
_this.setState({
codeUrl: url
})
});
});
resolve();
});
......
......@@ -171,6 +171,7 @@ class BargainMiddlePage extends Component {
// }
// })
}
// 我要砍价列表的去支付
toCartBottom = (id) => {
http.get(`${API['base-api']}/m/cart/addtopreorder/[${id}]`).then((res) => {
......@@ -195,6 +196,7 @@ class BargainMiddlePage extends Component {
isShowMore: true
})
}
// 自组件传给父组件的boxHide
boxHide = (val) => {
this.setState({isShowMore: val})
......@@ -202,8 +204,9 @@ class BargainMiddlePage extends Component {
// 领取砍价神器
toArtifact = () => {
const { course: { course_id = '' } } = this.state;
let data = {
courseId: getParam('id')
courseId: getParam('id')? getParam('id') : course_id
}
http.post(`${API.home}/m/bargain/receiveLimit`, data).then((res) => {
if (res.data.code === 200) {
......@@ -219,7 +222,9 @@ class BargainMiddlePage extends Component {
// 使用砍价神器
useArtifact = () => {
this.toKanjia(getParam('id'), 2, 0)
const { course: { course_id = '' } } = this.state;
const id = getParam('id')? getParam('id') : course_id;
this.toKanjia(id, 2, 0);
}
// 砍价接口
......@@ -298,12 +303,16 @@ class BargainMiddlePage extends Component {
// 帮好友砍价第一刀
friendBargainFirst = () => {
this.toKanjia(getParam('id'), 3, this.state.originatorUid)
const { course: { course_id = '' } } = this.state;
const id = getParam('id')? getParam('id') : course_id;
this.toKanjia(id, 3, this.state.originatorUid);
}
// 帮好友砍价第二刀
friendBargainSecond = () => {
this.toKanjia(getParam('id'), 4, this.state.originatorUid)
const { course: { course_id = '' } } = this.state;
const id = getParam('id')? getParam('id') : course_id;
this.toKanjia(id, 4, this.state.originatorUid);
}
// 邀请好友砍价
......@@ -312,8 +321,7 @@ class BargainMiddlePage extends Component {
isShowOverlay: true,
status: 7,
isshowYindao: browser.isWeixin ? true : false
})
});
wxShare({
title: `我发现一门好课,快来帮我砍价吧!`,
......@@ -328,7 +336,7 @@ class BargainMiddlePage extends Component {
this.setState({
isShowOverlay: false,
status: '',
})
});
}
toCourseDetail = (id) => {
......@@ -634,6 +642,9 @@ function CourseBottom(props) {
} else if (props.item.bargain_status === 3) {
Buttons = <Link to={`/play/video?id=${props.item.v_course_id}`}
className={classnames('bargain', 'button--study')}>去学习</Link>
if(props.item.course_id === 139) {
Buttons = <a onClick={() => props.toDetail(props.item.course_id)} className={'bargain bargian-study'}>我要砍价</a>
}
} else {
Buttons = (
<div className="btns">
......
......@@ -82,6 +82,9 @@ class Classify extends Component {
// 获取课程接口
getList = () => {
const _this = this
_this.setState((state, props)=>({
isLoading: true
}));
http.get(`${API.home}/m/course/list/${getParam('id')}`).then((res) => {
if (res.data.code === 200) {
_this.setState({
......
......@@ -29,6 +29,10 @@ html,body,#root {
background: #fff;
}
.am-tabs-top {
height: 93vh;
}
.v-list-item {
padding: 10px 0 0;
......
......@@ -22,7 +22,8 @@ export default (state = {num: 86, code: null}, action) => {
return {
...state,
num: '',
code: ''
code: '',
from: ''
};
default:
return state;
......
......@@ -1069,7 +1069,8 @@ class Country extends Component {
const { history, addCountryNum } = this.props;
addCountryNum({
num,
code: getParam('share_code')
code: getParam('share_code'),
from: getParam('from')
});
// history.push(`/detail?id=${getParam('id')}`);
history.go(-1)
......
.bargain-bind-phone {
display: flex;
flex-flow: column;
.bargain-phone-popup {
width: 300px;
height: 195px;
margin: 200px auto 20px;
padding: 20px;
background: $white;
border-radius: 3px;
margin: 200px auto 20px auto;
.title {
text-align: center;
font-size: $font_16;
margin-bottom: 12px;
}
background-color: $white;
}
button, .button {
display: inline-block;
width: 260px;
height: 30px;
background: $bg_999;
line-height: 28px;
text-align: center;
-webkit-appearance: none;
border: none;
.bargain-phone-popup__title {
margin: 0 0 12px;
font-size: 15px;
font-weight: normal;
text-align: center;
line-height: 1;
}
font-size: $font_16;
color: $white;
.bargain-phone-popup__item {
display: flex;
align-items: center;
width: 100%;
height: 30px;
margin-top: 15px;
border: 1px solid #ddd;
box-sizing: border-box;
&.active {
background-color: #FADD29;
color: #FF4000;
}
&.active {
border: 1px solid $active;
color: $active;
}
input {
width: 100%;
height: 30px;
-webkit-appearance: none;
outline: 0;
border: 1px solid #DDDDDD;
margin-bottom: 15px;
padding-left: 10px;
border-style: none;
outline: 0;
-webkit-appearance: none;
&::-webkit-input-placeholder {
color: $color_999;
}
&:focus {
border: 1px solid $active;
color: $active;
&.bargain-phone-popup__ipt {
border-left: 1px solid #ddd;
}
}
}
label {
display: block;
position: relative;
.bargain-phone-popup__button--num {
display: inline-flex;
align-items: center;
padding: 0 5px;
color: $color_999;
}
.bargain-phone-popup__button--send {
width: 136px;
border-style: none;
font-size: 13px;
color: $color_999;
text-align: right;
background-color: transparent;
cursor: pointer;
outline: none;
&.active {
color: $active;
}
}
.bargain-phone-popup__button--bargain {
display: block;
width: 100%;
height: 30px;
margin-top: 20px;
border-style: none;
font-size: 15px;
color: $white;
line-height: 30px;
text-align: center;
background-color: $bg_999;
outline: none;
-webkit-appearance: none;
&.active {
color: #FF4000;
background-color: #FADD29;
}
}
.send-code {
position: absolute;
right: 15px;
top: 8px;
font-size: 13px;
color: $color_999;
.popup-bind--bargain {
.popup-bind__content {
width: 300px;
margin: 200px auto 20px;
padding: 20px;
border-radius: 3px;
}
.popup-bind__title {
margin: 0 0 12px;
font-size: 15px;
font-weight: normal;
}
.popup-bind__desc {
padding: 0;
font-size: 12px;
}
.popup-bind__button {
padding: 0;
}
}
\ No newline at end of file
......@@ -24,14 +24,31 @@ class Bargain extends Component {
status: '',
bargainCode: '',
time: '',
barInfo: {}
barInfo: {},
country: '86'
}
}
componentDidMount() {
this.getBargainInfo();
this.judgePopupTypeFromCountry();
}
// 选择区号后进入
judgePopupTypeFromCountry = () => {
const { country, delCountryNum } = this.props;
if(country.from && country.from === 'bargain') {
this.setState({
country: country.num,
isShowOverlay: true,
status: 3,
});
// 清除
delCountryNum();
}
}
// 获取助理好友
getBargainRankList = (params = {}) => {
http.post(`${API.home}/m/bargain/rankList`, params).then((res) => {
......@@ -63,7 +80,7 @@ class Bargain extends Component {
});
// 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买
if (data.bargain_status === 0) {
if (data.bargain_status === 0 || data.bargain_status === 1 ) {
this.getBargainRankList({
type: 0,
bargain_code: data.bargain_code
......@@ -131,12 +148,12 @@ class Bargain extends Component {
// 我要砍价
iWantBargain = () => {
const {user} = this.props
const uid = user && user.data && user.data.uid
const { history, user } = this.props
const uid = user && user.data && user.data.uid;
if(!uid){
this.props.history.push('/passport/login')
history.push('/passport/login');
} else {
this.toKanjia(getParam('id'), 1, 0)
this.toKanjia(getParam('id'), 1, 0);
}
}
......@@ -146,26 +163,44 @@ class Bargain extends Component {
course_id: id,
type: type, // 1 用户自己砍价 2 使用砍价神器 3 好友助力砍价 4 好友第二次助力
parent_uid: uid // 被助力人id 【自己本人操作传0】
}
};
const { history } = this.props;
http.post(`${API.home}/m/bargain/toBargain`, data).then((res) => {
const { data: { data, code } } = res;
if (code === 200) {
if (type === 2) {
// user_status 用户状态 1-关注公众号,2-绑定手机号 3-再砍一刀 (是发起人没有这个字段)
if(data.user_status === 2) {
this.setState({
isShowOverlay: true,
status: 2,
})
} else {
if (data.user_status === 2) {
status: 3,
});
}else {
if(type === 2) {
this.setState({
isShowOverlay: true,
status: 3,
})
} else {
status: 2,
});
}else {
history.push(`/bargain-middle-page?id=${getParam('id')}&bargaincode=${data.bargain_code}&is_originator=1`)
}
}
// if (type === 2) {
// this.setState({
// isShowOverlay: true,
// status: 2,
// })
// } else {
// // user_status 用户状态 1-关注公众号,2-绑定手机号 3-再砍一刀 (是发起人没有这个字段)
// if (data.user_status === 2) {
// this.setState({
// isShowOverlay: true,
// status: 3,
// })
// } else {
// history.push(`/bargain-middle-page?id=${getParam('id')}&bargaincode=${data.bargain_code}&is_originator=1`)
// }
// }
} else {
Toast.info(res.data.msg, 2)
}
......@@ -182,7 +217,7 @@ class Bargain extends Component {
}
render() {
const { list, outList, barInfo } = this.state;
const { list, outList, barInfo, country } = this.state;
const {user} = this.props
const uid = user && user.data && user.data.uid
return (
......@@ -190,7 +225,7 @@ class Bargain extends Component {
{/*bargain_status 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买*/}
{
(barInfo.bargain_status === 2 || !uid) &&
(barInfo.bargain_status === 2 || (getParam('id') === '139' && barInfo.bargain_status === 3) || !uid) &&
<BargainIntro limitPeople={barInfo.limit_people} iWantBargain={this.iWantBargain}/>
}
{
......@@ -212,7 +247,7 @@ class Bargain extends Component {
{/*绑定手机号*/}
{
this.state.status === 3 &&
<BargainInfo iWantBargain={this.iWantBargain}/>
<BargainInfo country={country} iWantBargain={this.iWantBargain} toClose={this.close} />
}
......
......@@ -332,7 +332,7 @@ class BtnStatus extends Component {
<span onClick={this.tobuy}>直接购买</span>
</button>
{
(barInfo.bargain_status === 2 || !uid) &&
(barInfo.bargain_status === 2|| (getParam('id') === '139' && barInfo.bargain_status === 3) || !uid) &&
<button className='btn btn-s bg-E02E24' onClick={this.toKanjia}>
我要砍价
</button>
......
......@@ -318,15 +318,13 @@ class Detail extends Component {
}
// 点击子组件试听按钮
toAudition = () => {
toAudition = (v_course_id, video_id) => {
const {user} = this.props
const uid = user && user.data && user.data.uid
if (!uid) {
this.props.history.push('/passport/login')
} else {
this.setState({
auditionBox: true,
})
this.props.history.push(`/play/video?id=${v_course_id}&video_id=${video_id}`);
}
}
// 点击子组件单集购买按钮
......@@ -621,10 +619,18 @@ class Detail extends Component {
/>
}
{/*砍价*/}
{/*
* 砍价
* is_baoming 否报名 0-未购买弹出报名 1-已购买弹出开始学习
* is_dist 是否分销课程
* is_bargain 是否砍价课程
*/}
{
course_info.is_baoming === 0 && (!course_info.is_aist) && course_info.is_bargain &&
<Bargain/>
<Bargain
country={this.props.country}
delCountryNum={this.props.delCountryNum}
/>
}
{/*课程介绍、大纲*/}
......
......@@ -93,9 +93,9 @@ class OutLine extends Component {
6-可试听但无试听权限
*/}
{ // 试听
!introduce.is_aist && item.class_status === 6 &&
!introduce.is_aist && (item.class_status === 6 || item.class_status === 5) &&
<span className='btn-right-10 audition'
onClick={this.props.toAudition}>试听
onClick={e => this.props.toAudition(introduce.v_course_id, item.video_id)}>试听
<i className='iconfont iconcelluar'></i>
</span>
}
......
......@@ -125,7 +125,6 @@ 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;
......@@ -467,7 +466,7 @@ class RedPacket extends PureComponent {
}
handleToSend = ({tel, code}) => {
let { validate, seconds, isFirst, isTimer, captchaInstance, country: {num = '0086'} } = this.state;
let { validate, seconds, isFirst, isTimer, captchaInstance, country: {num = '86'} } = this.state;
if(validate) {
if (!isFirst) {
Toast.info('请重新进行滑块验证', 2, null, false);
......@@ -489,7 +488,7 @@ class RedPacket extends PureComponent {
http.post(
`${API['passport-api']}/m/personal/bindPhoneSendCode`,
{
area_code: '00'+num,
area_code: `00${num}`,
phone_num: tel
}
).then(res => {
......@@ -570,12 +569,12 @@ class RedPacket extends PureComponent {
// 绑定手机
toContinueBind = (isValid = 1) => {
const { accountInfo: { tel, code}, country: {num = '0086'} } = this.state;
const { accountInfo: { tel, code}, country: {num = '86'} } = this.state;
// is_valid 是否验证 1:验证(默认),0不验证
http.post(
`${API['passport-api']}/m/personal/bindPhone`,
{
area_code: '00'+num,
area_code: `00${num}`,
phone_num: tel,
code: code,
type: 1,
......
......@@ -340,6 +340,11 @@ class Single extends Component {
</div>
<div className='payment-type'>
<label>支付方式:</label>
<p onClick={this.check.bind(this, '0')}>
<i className='iconfont iconweixinzhifu buy'></i>
<span>微信支付</span>
<i className={`iconfont icondanseshixintubiao-5 redio ${this.state.payType === '0' ? 'redioed' : ''}`}></i>
</p>
{
!browser.isWeixin &&
<p onClick={this.check.bind(this, '1')}>
......@@ -349,11 +354,6 @@ class Single extends Component {
</p>
}
<p onClick={this.check.bind(this, '0')}>
<i className='iconfont iconweixinzhifu buy'></i>
<span>微信支付</span>
<i className={`iconfont icondanseshixintubiao-5 redio ${this.state.payType === '0' ? 'redioed' : ''}`}></i>
</p>
</div>
<div className='btn btn-18B4ED' onClick={this.toBuy}>确认购买</div>
</div>
......
......@@ -18,8 +18,8 @@ if (browser.isWeixin) {
];
} else {
mockData = [
{value: 0, label: '支付宝', icon: 'iconalipay'},
{value: 1, label: '微信支付', icon: 'iconweixinzhifu'},
{value: 0, label: '支付宝', icon: 'iconalipay'},
// { value: 2, label: '花呗分期', icon: 'iconhuabei' },
];
}
......@@ -30,7 +30,7 @@ export default class PayOrder extends Component {
super(props);
this.state = {
pay_amount: 0,
payType: 0,
payType: 1,
stageNumber: 0,
checkPeriod: false,
singleMoney: 0,
......
......@@ -15,8 +15,6 @@ import { connect } from "react-redux";
class SetPassword extends Component {
render() {
let {values, errors, location} = this.props
let {from} = location.state || {from: {pathname: '/'}}
......
......@@ -76,34 +76,47 @@ class SearchResult extends PureComponent {
}
handleScroll = throttle(() => {
let y = window.scrollY, headY = this.searchHead.current.offsetTop
if (y < this.prevScrollY) {
let y = window.scrollY,
headY = this.searchHead.current.offsetTop;
console.log(headY,'headY');
console.log(document.querySelector('body').offsetHeight);
// 向上滑动
if (y < this.prevScrollY && y > 0) {
console.log(0);
console.log(this.state.swipeDirection);
if (this.state.swipeDirection === this.swipeDown) {
console.log(1);
y <= headY && this.state.searchHeadStyle.position !== 'fixed' && this.setState({
y <= headY && this.state.searchHeadStyle.position !== 'fixed' &&
this.setState({
searchHeadStyle: {
top: `0`,
position: 'fixed'
}
})
} else {
console.log(2);
this.setState({
swipeDirection: this.swipeDown
}, () => {
if (this.state.swipeDirection === this.swipeDown) {
this.setState({
searchHeadStyle: {
top: `${y > headY ? y - 44 : y}px`
}
})
let h = y > document.querySelector('body').offsetHeight? document.querySelector('body').offsetHeight: y;
let h1 = this.searchHead.current.offsetHeight
this.setState({
searchHeadStyle: {
// top: `${h > headY ? h - h1 : h}px`
top: `${y}px`
}
})
}
})
}
} else {
console.log(3);
this.state.swipeDirection !== this.swipeUp &&
this.setState({
swipeDirection: this.swipeUp,
......@@ -112,9 +125,8 @@ class SearchResult extends PureComponent {
top: `${y}px`
}
})
}
this.prevScrollY = y
this.prevScrollY = y;
}, 0)
render() {
......
......@@ -756,7 +756,11 @@ class Video extends Component {
}}/>
<Loading isLoading={this.state.isLoading}>
<div className="video">
<video className={'video-js'} ref={el => this.video = el}>
<video className={'video-js'} ref={el => this.video = el}
webkit-playsinline="true"
playsInline={true}
x-webkit-airplay="allow"
x5-video-player-type="h5">
<source src={'/'} type='application/x-mpegURL'/>
</video>
{
......
......@@ -2772,11 +2772,6 @@ cli-width@^2.0.0:
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639"
integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=
clipboard-copy@^3.1.0:
version "3.1.0"
resolved "https://registry.npm.taobao.org/clipboard-copy/download/clipboard-copy-3.1.0.tgz#4c59030a43d4988990564a664baeafba99f78ca4"
integrity sha1-TFkDCkPUmImQVkpmS66vupn3jKQ=
cliui@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d"
......@@ -11598,6 +11593,11 @@ wbuf@^1.1.0, wbuf@^1.7.3:
dependencies:
minimalistic-assert "^1.0.0"
web-launch-app@^2.1.9:
version "2.1.9"
resolved "https://registry.npm.taobao.org/web-launch-app/download/web-launch-app-2.1.9.tgz#8da6e2b53331881d00e4ee3a8c2d630c29fc4550"
integrity sha1-jabitTMxiB0A5O46jC1jDCn8RVA=
web-namespaces@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.2.tgz#c8dc267ab639505276bae19e129dbd6ae72b22b4"
......
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