Commit 30e40b6d by FE

bargain bind phone modify

parent bec5585c
......@@ -24,18 +24,15 @@ 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({});
}
......
......@@ -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();
});
......
.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: 120px;
border-style: none;
font-size: 13px;
color: $color_999;
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,32 @@ class Bargain extends Component {
status: '',
bargainCode: '',
time: '',
barInfo: {}
barInfo: {},
country: '86'
}
}
componentDidMount() {
this.getBargainInfo();
this.judgePopupTypeFromCountry();
}
// // 选择区号后进入
judgePopupTypeFromCountry = () => {
// console.log(this.props);
const { country, delCountryNum } = this.props;
if(country.num) {
this.setState({
country: country.num,
isShowOverlay: true,
status: 3,
});
// 清除
delCountryNum();
}
}
// 获取助理好友
getBargainRankList = (params = {}) => {
http.post(`${API.home}/m/bargain/rankList`, params).then((res) => {
......@@ -131,12 +149,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 +164,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 +218,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 +226,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 +248,7 @@ class Bargain extends Component {
{/*绑定手机号*/}
{
this.state.status === 3 &&
<BargainInfo iWantBargain={this.iWantBargain}/>
<BargainInfo country={country} iWantBargain={this.iWantBargain} toClose={this.close} />
}
......
......@@ -320,7 +320,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>
......
......@@ -610,10 +610,15 @@ 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} />
}
{/*课程介绍、大纲*/}
......
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