Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
db5de29f
Commit
db5de29f
authored
Sep 23, 2019
by
FE
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue-20190920' into pre
parents
b97d503b
a0e250db
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
20 deletions
+67
-20
src/common/VList/index.js
+6
-1
src/components/bargainMiddlePage/bargain-middle-page.scss
+16
-0
src/components/bargainMiddlePage/index.js
+45
-19
No files found.
src/common/VList/index.js
View file @
db5de29f
...
...
@@ -3,7 +3,12 @@ import './index.scss'
const
VList
=
(
props
)
=>
{
return
(
<
li
className
=
'v-list-item'
onClick
=
{()
=>
props
.
toDetail
(
props
.
id
)}
>
<
li
className
=
'v-list-item'
onClick
=
{()
=>
{
typeof
props
.
toDetail
===
'function'
&&
props
.
toDetail
(
props
.
id
)
}}
>
<
div
className
=
"content"
>
<
div
className
=
"cover"
>
{
props
.
status
}
...
...
src/components/bargainMiddlePage/bargain-middle-page.scss
View file @
db5de29f
...
...
@@ -721,3 +721,19 @@
color
:
#fff
;
}
.course-button__buy--done
{
position
:
absolute
;
top
:
0
;
right
:
0
;
bottom
:
0
;
width
:
61px
;
height
:
18px
;
margin
:
auto
0
;
border-radius
:
9px
;
font-size
:
12px
;
color
:
$white
;
text-align
:
center
;
line-height
:
18px
;
background-color
:
$bg_active
;
}
src/components/bargainMiddlePage/index.js
View file @
db5de29f
...
...
@@ -339,6 +339,7 @@ class BargainMiddlePage extends Component {
}
render
()
{
// console.log(this.state.data);
let
thirdRow
,
btn
// is_artifact 0-再邀请多少人可以使用 1-可以使用未领取 2-已领取 3-已使用
if
(
this
.
state
.
bargainData
.
is_artifact
===
0
)
{
...
...
@@ -353,19 +354,38 @@ class BargainMiddlePage extends Component {
btn
=
<
button
className
=
{
'artifact-btn'
}
onClick
=
{
this
.
useArtifact
}
>
立即使用
<
/button
>
}
let
bargainBtn
if
(
this
.
state
.
isOriginator
!==
1
&&
this
.
state
.
data
.
assist_status
===
0
&&
this
.
state
.
data
.
bargain_status
===
0
)
{
bargainBtn
=
<
button
className
=
'active-btn'
onClick
=
{
this
.
friendBargainFirst
}
>
帮好友砍一刀
<
/button
>
}
else
if
(
this
.
state
.
isOriginator
!==
1
&&
this
.
state
.
data
.
assist_status
===
1
)
{
bargainBtn
=
<
button
className
=
'active-btn'
onClick
=
{
this
.
friendBargainSecond
}
>
再砍一刀
<
/button
>
}
else
if
(
this
.
state
.
isOriginator
!==
1
&&
this
.
state
.
data
.
assist_status
===
2
)
{
bargainBtn
=
<
button
className
=
{
'invalid-btn'
}
>
已帮好友助力
<
/button
>
}
else
if
(
this
.
state
.
data
.
bargain_status
===
1
||
this
.
state
.
data
.
bargain_status
===
2
)
{
bargainBtn
=
<
button
className
=
{
'invalid-btn'
}
>
砍价结束
<
/button
>
}
else
if
(
this
.
state
.
isOriginator
===
1
&&
this
.
state
.
data
.
bargain_status
===
0
)
{
bargainBtn
=
<
button
className
=
'active-btn'
onClick
=
{
this
.
shareFriendBargain
}
>
邀请好友砍价
<
/button
>
const
{
data
:
{
is_originator
=
0
,
assist_status
=
0
,
bargain_status
=
0
}
}
=
this
.
state
;
let
bargainBtn
=
''
;
// assist_status 助力状态 0-未助力,1-已助力一次 2-已助力两次,不能再助力
// is_originator 是否发起人 0-否 1-是
// bargain_status 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买
if
(
is_originator
)
{
if
(
bargain_status
===
0
)
{
bargainBtn
=
<
button
className
=
'active-btn'
onClick
=
{
this
.
shareFriendBargain
}
>
邀请好友砍价
<
/button
>
}
}
else
{
if
(
assist_status
===
0
&&
bargain_status
===
0
)
{
bargainBtn
=
<
button
className
=
'active-btn'
onClick
=
{
this
.
friendBargainFirst
}
>
帮好友砍一刀
<
/button
>
}
else
if
(
assist_status
===
1
&&
bargain_status
===
0
)
{
bargainBtn
=
<
button
className
=
'active-btn'
onClick
=
{
this
.
friendBargainSecond
}
>
再砍一刀
<
/button
>
}
else
if
(
assist_status
===
2
&&
bargain_status
===
0
)
{
bargainBtn
=
<
button
className
=
{
'invalid-btn'
}
>
已帮好友助力
<
/button
>
}
else
if
(
bargain_status
!==
0
)
{
bargainBtn
=
<
button
className
=
{
'invalid-btn'
}
>
砍价结束
<
/button
>
}
}
// if (this.state.isOriginator !== 1 && this.state.data.assist_status === 0 && this.state.data.bargain_status === 0) {
// bargainBtn = <button className='active-btn' onClick={this.friendBargainFirst}>帮好友砍一刀</button>
// } else if (this.state.isOriginator !== 1 && this.state.data.assist_status === 1) {
// bargainBtn = <button className='active-btn' onClick={this.friendBargainSecond}>再砍一刀1</button>
// } else if (this.state.isOriginator !== 1 && this.state.data.assist_status === 2) {
// bargainBtn = <button className={'invalid-btn'}>已帮好友助力</button>
// } else if (this.state.data.bargain_status === 1 || this.state.data.bargain_status === 2) {
// bargainBtn = <button className={'invalid-btn'}>砍价结束</button>
// } else if (this.state.isOriginator === 1 && this.state.data.bargain_status === 0) {
// bargainBtn = <button className='active-btn' onClick={this.shareFriendBargain}>邀请好友砍价</button>
// }
return
(
<
div
className
=
{
'bargain-middle-page'
}
>
<
HeaderBar
title
=
'砍价详情'
arrow
=
{
true
}
cart
=
{
true
}
toHref
=
{
'/'
}
><
/HeaderBar
>
...
...
@@ -571,24 +591,30 @@ class BargainMiddlePage extends Component {
}
}
// 课程信息 -- 右侧
function
CourseDes
(
props
)
{
const
data
=
props
.
data
&&
props
.
data
.
course
const
{
data
:
{
bargain_status
=
0
,
course
=
{},
is_originator
=
0
},
toCart
}
=
props
;
return
(
<
div
className
=
{
'des'
}
>
<
div
className
=
"course-title text-overflow-2"
>
{
data
.
course_title
}
{
course
.
course_title
}
<
/div
>
<
div
className
=
"price-bar"
>
<
span
className
=
{
'discount-price'
}
>
¥
{
data
.
course_price
}
<
/span
>
<
span
className
=
{
'discount-price'
}
>
¥
{
course
.
course_price
}
<
/span
>
{
/* is_originator 是否发起人 0-否 1-是 */
}
{
props
.
isOriginator
===
1
&&
<
button
className
=
{
'purchase-btn'
}
onClick
=
{
props
.
toCart
}
>
¥
{
data
.
pay_price
}
去支付
(
is_originator
===
1
&&
bargain_status
!==
3
)
&&
<
button
className
=
{
'purchase-btn'
}
onClick
=
{
toCart
}
>
¥
{
course
.
pay_price
}
去支付
<
/button
>
}
{
(
is_originator
===
1
&&
bargain_status
===
3
)
&&
<
span
className
=
"course-button__buy--done"
>
已购买
<
/span
>
}
<
/div
>
<
/div
>
)
)
;
}
function
CourseBottom
(
props
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment