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
2a072571
Commit
2a072571
authored
Sep 24, 2019
by
FE
Browse files
Options
Browse Files
Download
Plain Diff
solve
parents
f6ab32fc
30e40b6d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
161 additions
and
125 deletions
+161
-125
src/common/CallApp/index.js
+5
-59
src/components/bargainMiddlePage/barcode/index.js
+3
-2
src/components/detail/bargain/bargainInfo/bargain-info.scss
+92
-44
src/components/detail/bargain/bargainInfo/index.js
+0
-0
src/components/detail/bargain/index.js
+53
-17
src/components/detail/btnstatus/index.js
+1
-1
src/components/detail/index.js
+7
-2
No files found.
src/common/CallApp/index.js
View file @
2a072571
import
React
,
{
Component
}
from
'react'
;
import
{
LaunchApp
,
ua
,
isIos
,
inWeixin
,
detector
,
supportLink
}
from
'web-launch-app'
;
import
CallApp
from
'callapp-lib'
const
options
=
{
...
...
@@ -23,62 +22,10 @@ const options = {
fallback
:
"http://www.julyedu.com/weekend/redir1"
}
const
inApp
=
/appname
(
.*
)
/
.
test
(
ua
);
const
appVersion
=
inApp
?
/appname
\/(\d
+
(\.\d
+
)
*
)
/
.
exec
(
ua
)[
1
]
:
''
;
// 微信iOS7.0.5支持ulink(20190716)
const
wxSupportLink
=
isIos
&&
inWeixin
&&
detector
.
browser
.
fullVersion
>
'7.0.4'
;
const
config
=
{
inApp
:
inApp
,
appVersion
:
appVersion
,
pkgName
:
'julyedu'
,
deeplink
:
{
scheme
:
{
android
:
{
protocol
:
'julyedu'
,
index
:
{
path
:
'/'
,
},
frs
:
{
protocol
:
'app'
,
path
:
'forum/detail'
,
param
:
{
from
:
'h5'
},
paramMap
:
{
forumName
:
'kw'
}
}
},
ios
:
{
protocol
:
'julyedu'
,
index
:
{
path
:
'/'
,
},
frs
:
{
path
:
'forum/detail'
}
}
},
link
:
{
index
:
{
url
:
'https://link.app.com'
},
frs
:
{
url
:
'https://link.app.com/p/{forumName}'
}
},
},
pkgs
:
{
android
:
'https://cdn.app.com/package/app-defult.apk'
,
ios
:
'https://itunes.apple.com/cn/app/id1102275343?mt=8'
,
yyb
:
'hhttp://android.myapp.com/myapp/detail.htm?apkName=com.julyapp.julyonline'
,
},
useUniversalLink
:
supportLink
,
useAppLink
:
supportLink
,
autodemotion
:
true
,
useYingyongbao
:
inWeixin
,
useGuideMethod
:
inWeixin
&&
!
wxSupportLink
,
// 受限情况下使用引导方案
landPage
:
'http://www.julyedu.com/weekend/redir1'
};
class
OpenApp
extends
Component
{
//
callApp = new CallApp(options)
lanch
App
=
null
callApp
=
new
CallApp
(
options
)
// call
App = null
static
defaultProps
=
{
text
:
'在APP打开'
...
...
@@ -86,13 +33,12 @@ class OpenApp extends Component {
componentWillMount
()
{
// this.callApp = new CallApp(
options
);
this
.
lanchApp
=
new
LaunchApp
(
config
);
// this.callApp = new CallApp(
{}
);
}
handleClick
=
()
=>
{
// this.callApp.open({})
this
.
lanchApp
.
open
();
this
.
callApp
.
open
({});
}
render
()
{
...
...
src/components/bargainMiddlePage/barcode/index.js
View file @
2a072571
...
...
@@ -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
();
});
...
...
src/components/detail/bargain/bargainInfo/bargain-info.scss
View file @
2a072571
.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
src/components/detail/bargain/bargainInfo/index.js
View file @
2a072571
This diff is collapsed.
Click to expand it.
src/components/detail/bargain/index.js
View file @
2a072571
...
...
@@ -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
}
/
>
}
...
...
src/components/detail/btnstatus/index.js
View file @
2a072571
...
...
@@ -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
>
...
...
src/components/detail/index.js
View file @
2a072571
...
...
@@ -621,10 +621,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
}
/
>
}
{
/*课程介绍、大纲*/
}
...
...
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