Commit 19d5212d by wangshuo

试听 打包

parent cd9c5f31
......@@ -62,15 +62,9 @@ class App extends Component {
const routeMatchRule = /binding-tel|forgot|set-password/
const {history} = this.props
history.listen((location, action) => {
<<<<<<< HEAD
this.utm()
this.firstLoad = false
this.setNavigationRecord(location, action)
=======
this.firstLoad = false
this.setNavigationRecord(location, action)
this.utm()
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
if (cookie.get('uid') && this.props.user.hasError) {
this.getUser()
}
......@@ -94,21 +88,14 @@ class App extends Component {
setNavigationRecord = (location, action) => {
const {pathname, search, hash} = location
<<<<<<< HEAD
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
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
switch (action) {
case 'POP':
this.firstLoad ? this.records.push({pathname, search, hash}) : this.records.pop()
break
case 'REPLACE':
<<<<<<< HEAD
this.records.length > 1 && (this.records[this.records.length - 1] = {pathname, search, hash})
=======
this.records[this.records.length - 1] = {pathname, search, hash}
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
break
default:
!isLastRecord && this.records.push({pathname, search, hash})
......@@ -116,10 +103,7 @@ class App extends Component {
location.state && location.state.records
? (location.state.records = this.records)
<<<<<<< HEAD
: location.state? location.state = {...location.state, records: this.records}
=======
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
: (location.state = {records: this.records})
}
......@@ -186,11 +170,6 @@ class App extends Component {
}
componentDidUpdate() {
<<<<<<< HEAD
=======
this.setPreviousLocation()
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
if (!this.props.user.hasError && getParam('redirect')) {
window.location.href = getParam('redirect')
......@@ -199,19 +178,12 @@ class App extends Component {
setPreviousLocation = () => {
const {location, history: {action}} = this.props
<<<<<<< HEAD
if (location.pathname.startsWith('/passport')) {
/*let index = this.records.findIndex(item => item.pathname.startsWith('/passport'))
=======
if (location.pathname.startsWith('/passport')) {
let index = this.records.findIndex(item => item.pathname.startsWith('/passport'))
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
this.previousLocation = index > 0
? this.records[index - 1]
: this.records.length
? this.records[this.records.length - 1]
<<<<<<< HEAD
: null*/
} else {
if (action === 'POP' || action === 'REPLACE') {
......@@ -223,17 +195,6 @@ class App extends Component {
}
=======
: 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
}
}
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
}
transformUser = res => {
......
......@@ -24,32 +24,13 @@ const options = {
class OpenApp extends Component {
<<<<<<< HEAD
callApp = new CallApp(options)
// callApp = null
=======
// callApp = new CallApp(options)
callApp = null
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
static defaultProps = {
text: '在APP打开'
}
<<<<<<< HEAD
componentWillMount() {
// this.callApp = new CallApp({});
=======
componentWillMount() {
this.callApp = new CallApp({
...options,
path: this.props.path || '/'
});
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
}
handleClick = () => {
this.callApp.open({
path: '',
......
......@@ -13,12 +13,8 @@ class Captcha extends Component {
}
componentDidMount() {
<<<<<<< HEAD
const {getInstance, handleError, onVerify} = this.props;
const _this = this;
=======
const {getInstance, handleError, onVerify} = this.props
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
const el = document.getElementById('captcha');
el && initCaptcha(function () {
initNECaptcha({
......
......@@ -8,12 +8,8 @@ class FollowBarcode extends Component {
constructor(props) {
super(props);
this.state = {
<<<<<<< HEAD
url: '',
codeUrl: ''
=======
url: ''
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
}
}
......@@ -28,21 +24,12 @@ class FollowBarcode extends Component {
this.setState({
url: data.url
});
<<<<<<< HEAD
const _this = this;
return new Promise(resolve => {
QRCode.toDataURL(data.url, {}, function (err, url) {
console.log(url);
_this.setState({
codeUrl: url
});
=======
return new Promise(resolve => {
QRCode.toDataURL(data.url, {}, function (err, url) {
this.setState({
codeUrl: url
})
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
});
resolve();
});
......@@ -52,11 +39,7 @@ class FollowBarcode extends Component {
}
render() {
<<<<<<< HEAD
const { codeUrl } = this.state;
=======
const { codeSrc } = this.state;
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
const { firendBaigainPrice, userInfo: { avatar }, money } = this.props;
return (
<div className='bargain-popup__barcode'>
......@@ -66,11 +49,7 @@ class FollowBarcode extends Component {
<p className='bargain-popup__title'>谢谢你帮我砍了{money}元!</p>
}
<p className='bargain-popup__desc'>关注公众号,可以再砍一刀哦~</p>
<<<<<<< HEAD
<img className="bargain-popup__imgage" src={codeUrl} alt="" />
=======
<i className="bargain-popup__imgage" style={{backgroundImage: `url(${codeSrc})`}}></i>
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
</div>
);
}
......
......@@ -34,14 +34,7 @@
}
.bargain-popup__imgage {
<<<<<<< HEAD
display: block;
width: 106px;
margin: 15px auto 0;
=======
width: 86px;
height: 86px;
margin-top: 15px;
background-size: cover;
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
}
\ No newline at end of file
......@@ -80,11 +80,7 @@ class Bargain extends Component {
});
// 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买
<<<<<<< HEAD
if (data.bargain_status === 0 || data.bargain_status === 1 ) {
=======
if (data.bargain_status === 0) {
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
this.getBargainRankList({
type: 0,
bargain_code: data.bargain_code
......
......@@ -319,19 +319,12 @@ class Detail extends Component {
}
// 点击子组件试听按钮
<<<<<<< HEAD
toAudition = (v_course_id, video_id) => {
=======
toAudition = (vCourseId,videoId) => {
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
const {user} = this.props
const uid = user && user.data && user.data.uid
if (!uid) {
this.props.history.push('/passport/login')
} else {
<<<<<<< HEAD
this.props.history.push(`/play/video?id=${v_course_id}&video_id=${video_id}`);
=======
if(videoId == '' || videoId == 0 || videoId == undefined){
return false;
}
......@@ -345,7 +338,6 @@ class Detail extends Component {
// this.setState({
// auditionBox: true,
// })
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
}
}
// 点击子组件单集购买按钮
......
......@@ -123,11 +123,7 @@ const formikConfig = {
phone_num: values.tel,
phone_code: values.veriCode,
mkey: getParam('mkey'),
<<<<<<< HEAD
area_code: '00'+props.country.num,
=======
area_code: props.country.num,
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
plat: 5
}).then(res => {
const data = res.data
......
......@@ -87,11 +87,7 @@ class VeriCodeInput extends Component {
http.post(`${API['passport-api']}/quick_sms`, {
phone_num: tel || account,
action: action || 'login',
<<<<<<< HEAD
area_code: '00'+country.num,
=======
area_code: country.num,
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
challenge,
checking
}).then(res => {
......
......@@ -123,11 +123,7 @@ const formikConfig = {
http.post(`${API['passport-api']}/check_phone_code`, {
phone: values.tel,
code: values.veriCode,
<<<<<<< HEAD
area_code: '00'+props.country.num
=======
area_code: props.country.num
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
}).then(res => {
if (res.data.errno == 0) {
props.history.push('/passport/set-password', {from: props.location})
......
......@@ -133,11 +133,7 @@ const FormikConfig = {
props.quickLogin({
phone_num: values.tel,
phone_code: values.veriCode,
<<<<<<< HEAD
area_code: '00'+props.country.num
=======
area_code: props.country.num
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
}).then(res => {
if (res.hasError) {
Toast.info(res.msg);
......
......@@ -15,11 +15,6 @@ import { connect } from "react-redux";
class SetPassword extends Component {
<<<<<<< HEAD
=======
>>>>>>> 1fc750fdc1798d51d70f5528d18340721dff9ef8
render() {
let {values, errors, location} = this.props
let {from} = location.state || {from: {pathname: '/'}}
......
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