Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
h5-base
Project
Project
Details
Activity
Releases
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
new-sing
h5-base
Commits
bd0af7ae
Commit
bd0af7ae
authored
Feb 28, 2019
by
wangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
投放 去除客服
parent
31bd8272
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
260 additions
and
206 deletions
+260
-206
index.html
index.html
+3
-1
indexMaster.html
indexMaster.html
+3
-0
buy.vue
src/components/buy/buy.vue
+57
-62
index.vue
src/components/buy/index.vue
+197
-143
No files found.
index.html
View file @
bd0af7ae
...
@@ -9,7 +9,9 @@
...
@@ -9,7 +9,9 @@
<title>
唱唱启蒙英语
</title>
<title>
唱唱启蒙英语
</title>
<link
rel=
"stylesheet"
href=
"https://at.alicdn.com/t/font_822651_g9r2j7kybxu.css"
>
<link
rel=
"stylesheet"
href=
"https://at.alicdn.com/t/font_822651_g9r2j7kybxu.css"
>
<style>
<style>
.mint-toast
{
z-index
:
10001
!important
;
}
</style>
</style>
</head>
</head>
<body>
<body>
...
...
indexMaster.html
View file @
bd0af7ae
...
@@ -12,6 +12,9 @@
...
@@ -12,6 +12,9 @@
*
{
*
{
-webkit-overflow-scrolling
:
touch
;
-webkit-overflow-scrolling
:
touch
;
}
}
.mint-toast
{
z-index
:
10001
!important
;
}
</style>
</style>
</head>
</head>
<body>
<body>
...
...
src/components/buy/buy.vue
View file @
bd0af7ae
...
@@ -42,17 +42,17 @@
...
@@ -42,17 +42,17 @@
</div>
</div>
<footer>
<footer>
<!--
<div
v-if=
"groupDetail.is_real !== 1"
class=
"phone-block"
>
-->
<!--
<div
v-if=
"groupDetail.is_real !== 1"
class=
"phone-block"
>
-->
<!--
<input
placeholder=
"请输入手机号"
class=
"phone-input"
v-model=
"mobile"
/>
-->
<!--
<input
placeholder=
"请输入手机号"
class=
"phone-input"
v-model=
"mobile"
/>
-->
<!--
</div>
-->
<!--
</div>
-->
<div
class=
"sub-block"
>
<div
class=
"sub-block"
>
合计金额:
合计金额:
<span>
¥
{{
priceTotal
}}
</span>
<span>
¥
{{
priceTotal
}}
</span>
<div
class=
"pay-btn"
@
click=
"payOrder(orderFlag)"
>
提交订单
</div>
<div
class=
"pay-btn"
@
click=
"payOrder(orderFlag)"
>
确认支付
</div>
</div>
</div>
</footer>
</footer>
<transition
name=
"slide-fade"
>
<transition
name=
"slide-fade"
>
<sale-div
:salePop=
"salePop"
@
chooseSale=
"chooseSale"
></sale-div>
<sale-div
:salePop=
"salePop"
@
chooseSale=
"chooseSale"
></sale-div>
</transition>
</transition>
<transition
name=
"slide-fade"
>
<transition
name=
"slide-fade"
>
<div
v-if=
"addressPop"
class=
"address-pop"
>
<div
v-if=
"addressPop"
class=
"address-pop"
>
...
@@ -213,9 +213,9 @@
...
@@ -213,9 +213,9 @@
if
(
this
.
groupDetail
.
goods_type
===
2
&&
!
this
.
type
){
if
(
this
.
groupDetail
.
goods_type
===
2
&&
!
this
.
type
){
this
.
$router
.
push
({
name
:
'success'
,
query
:{
out_trade_no
:
res
.
out_trade_no
,
invite_code
:
this
.
invite_code
}});
this
.
$router
.
push
({
name
:
'success'
,
query
:{
out_trade_no
:
res
.
out_trade_no
,
invite_code
:
this
.
invite_code
}});
}
else
if
(
this
.
groupDetail
.
goods_type
===
4
){
}
else
if
(
this
.
groupDetail
.
goods_type
===
4
){
this
.
$router
.
push
({
name
:
'saleSuccess'
,
query
:{
out_trade_no
:
res
.
out_trade_no
,
invite_code
:
this
.
invite_code
}});
this
.
$router
.
push
({
name
:
'saleSuccess'
,
query
:{
out_trade_no
:
res
.
out_trade_no
,
invite_code
:
this
.
invite_code
}});
}
else
{
}
else
{
this
.
$router
.
push
({
name
:
'buySuccess'
,
query
:{
out_trade_no
:
res
.
out_trade_no
,
invite_code
:
this
.
invite_code
}});
this
.
$router
.
push
({
name
:
'buySuccess'
,
query
:{
out_trade_no
:
res
.
out_trade_no
,
invite_code
:
this
.
invite_code
}});
}
}
}
else
{
}
else
{
let
that
=
this
;
let
that
=
this
;
...
@@ -249,63 +249,58 @@
...
@@ -249,63 +249,58 @@
this
.
addressPop
=
true
this
.
addressPop
=
true
},
},
initPage
(){
initPage
(){
if
(
!
JSON
.
parse
(
localStorage
.
getItem
(
'userDesc'
)).
mobile
||
JSON
.
parse
(
localStorage
.
getItem
(
'userDesc'
)).
mobile
===
''
){
getwechatParam
({
api_list
:
'chooseWXPay'
}).
then
(
res
=>
{
this
.
$router
.
push
({
name
:
'bindMobile'
,
query
:{
retUrl
:
this
.
$route
.
fullPath
}})
wx
.
config
({
}
else
debug
:
false
,
{
appId
:
res
.
appId
,
getwechatParam
({
api_list
:
'chooseWXPay'
}).
then
(
res
=>
{
timestamp
:
parseInt
(
res
.
timestamp
),
wx
.
config
({
nonceStr
:
res
.
nonceStr
,
debug
:
false
,
signature
:
res
.
signature
,
appId
:
res
.
appId
,
jsApiList
:
res
.
jsApiList
timestamp
:
parseInt
(
res
.
timestamp
),
});
nonceStr
:
res
.
nonceStr
,
});
signature
:
res
.
signature
,
jsApiList
:
res
.
jsApiList
});
});
getUserAdressApi
().
then
(
res
=>
{
getUserAdressApi
().
then
(
res
=>
{
this
.
addressObj
=
res
this
.
addressObj
=
res
});
});
this
.
shopId
=
this
.
$route
.
query
.
shopId
;
this
.
shopId
=
this
.
$route
.
query
.
shopId
;
this
.
group_order_id
=
this
.
$route
.
query
.
group_order_id
;
this
.
group_order_id
=
this
.
$route
.
query
.
group_order_id
;
getCouponListApi
(
this
.
shopId
).
then
(
res
=>
{
getCouponListApi
(
this
.
shopId
).
then
(
res
=>
{
if
(
res
.
length
>
0
){
if
(
res
.
length
>
0
){
let
x
=
{
money
:
0
};
let
x
=
{
money
:
0
};
for
(
let
k
=
0
;
k
<
res
.
length
;
k
++
){
for
(
let
k
=
0
;
k
<
res
.
length
;
k
++
){
x
=
res
[
k
].
money
>
x
.
money
?
res
[
k
]
:
x
;
x
=
res
[
k
].
money
>
x
.
money
?
res
[
k
]
:
x
;
}
}
this
.
saleObj
=
x
;
this
.
saleObj
=
x
;
this
.
canSale
=
true
this
.
canSale
=
true
}
}
});
});
getStatusWechatApi
({
goods_id
:
this
.
shopId
}).
then
(
res
=>
{
getStatusWechatApi
({
goods_id
:
this
.
shopId
}).
then
(
res
=>
{
if
(
res
.
out_trade_no
){
if
(
res
.
out_trade_no
){
if
(
res
.
has_buy_goods_info
.
goods_type
===
2
){
if
(
res
.
has_buy_goods_info
.
goods_type
===
2
){
this
.
$router
.
push
({
name
:
'success'
,
query
:{
out_trade_no
:
res
.
out_trade_no
}});
this
.
$router
.
push
({
name
:
'success'
,
query
:{
out_trade_no
:
res
.
out_trade_no
}});
}
else
if
(
res
.
has_buy_goods_info
.
goods_type
===
4
){
}
else
if
(
res
.
has_buy_goods_info
.
goods_type
===
4
){
this
.
$router
.
push
({
name
:
'saleSuccess'
,
query
:{
out_trade_no
:
res
.
out_trade_no
,
invite_code
:
this
.
$route
.
query
.
invite_code
}});
this
.
$router
.
push
({
name
:
'saleSuccess'
,
query
:{
out_trade_no
:
res
.
out_trade_no
,
invite_code
:
this
.
$route
.
query
.
invite_code
}});
}
else
if
(
res
.
has_buy_goods_info
.
goods_type
!==
5
){
}
else
if
(
res
.
has_buy_goods_info
.
goods_type
!==
5
){
this
.
$router
.
push
({
name
:
'buySuccess'
,
query
:{
out_trade_no
:
res
.
out_trade_no
}});
this
.
$router
.
push
({
name
:
'buySuccess'
,
query
:{
out_trade_no
:
res
.
out_trade_no
}});
}
}
}
});
getGoodsDetailApi
(
this
.
shopId
).
then
(
data
=>
{
data
.
desc
=
JSON
.
parse
(
data
.
desc
);
data
.
goods_desc
=
JSON
.
parse
(
data
.
goods_desc
);
data
.
share_desc
=
JSON
.
parse
(
data
.
share_desc
);
this
.
groupDetail
=
data
;
this
.
invite_code
=
this
.
$route
.
query
.
invite_code
;
if
(
this
.
type
&&
this
.
type
===
0
){
this
.
price
=
data
.
single_price
/
100
}
else
{
this
.
price
=
data
.
group_price
/
100
}
this
.
$nextTick
(()
=>
{
this
.
orderFlag
=
true
})
});
}
}
});
getGoodsDetailApi
(
this
.
shopId
).
then
(
data
=>
{
data
.
desc
=
JSON
.
parse
(
data
.
desc
);
data
.
goods_desc
=
JSON
.
parse
(
data
.
goods_desc
);
data
.
share_desc
=
JSON
.
parse
(
data
.
share_desc
);
this
.
groupDetail
=
data
;
this
.
invite_code
=
this
.
$route
.
query
.
invite_code
;
if
(
this
.
type
&&
this
.
type
===
0
){
this
.
price
=
data
.
single_price
/
100
}
else
{
this
.
price
=
data
.
group_price
/
100
}
this
.
$nextTick
(()
=>
{
this
.
orderFlag
=
true
})
});
}
}
}
}
}
}
...
...
src/components/buy/index.vue
View file @
bd0af7ae
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
<span
class=
"price-content"
>
¥
{{
groupDetail
.
current_price
/
100
}}
元
</span>
<span
class=
"price-content"
>
¥
{{
groupDetail
.
current_price
/
100
}}
元
</span>
<span
style=
"text-decoration:line-through;color: #bbb;font-size: 14px"
v-if=
"groupDetail.goods_type === 1 && groupDetail.original_price > groupDetail.current_price"
>
¥
{{
groupDetail
.
original_price
/
100
}}
</span>
<span
style=
"text-decoration:line-through;color: #bbb;font-size: 14px"
v-if=
"groupDetail.goods_type === 1 && groupDetail.original_price > groupDetail.current_price"
>
¥
{{
groupDetail
.
original_price
/
100
}}
</span>
</div>
</div>
</div>
</div>
<div
class=
"head-icon"
>
<div
class=
"head-icon"
>
<img
class=
"icon"
v-for=
"(data,index) in groupDetail.header_url"
v-if=
"index
<5
"
:src=
"data"
:key=
"data"
>
<img
class=
"icon"
v-for=
"(data,index) in groupDetail.header_url"
v-if=
"index
<5
"
:src=
"data"
:key=
"data"
>
...
@@ -114,21 +113,41 @@
...
@@ -114,21 +113,41 @@
</div>
</div>
</footer>
</footer>
</div>
</div>
<mt-popup
v-model=
"bindMobile.show"
class=
"bindMobile-block"
position=
"bottom"
>
<div
class=
"bindMobile-main"
>
<img
:src=
"groupDetail.goods_desc.img[0].url"
class=
"header"
>
<div
class=
"title"
>
{{
groupDetail
.
name
}}
<br>
<span
style=
"color: red;font-weight: normal"
>
¥
{{
(
groupDetail
.
current_price
/
100
).
toFixed
(
2
)
}}
</span>
</div>
<mt-field
style=
"font-size: 14px"
label=
"手机号"
placeholder=
"请输入手机号"
v-model=
"bindMobile.mobile"
></mt-field>
<mt-field
label=
"图片验证"
placeholder=
"请输入验证码"
v-model=
"bindMobile.img_code"
>
<img
src=
"/api/public/img/verify"
style=
"width: 35vw;margin-left: 5px"
class=
"right-btn"
ref=
"imgCode"
@
click=
"refImgCode"
/>
</mt-field>
<mt-field
label=
"短信验证"
placeholder=
"短信验证码"
v-model=
"bindMobile.verify_code"
>
<button
class=
"codeMsg right-btn"
@
click=
"sendMobileCode"
v-if=
"time===0"
>
发送验证码
</button>
<button
class=
"codeMsg disabled right-btn"
v-if=
"time>0"
>
{{
time
}}
s后重新发送
</button>
</mt-field>
<mt-button
type=
"danger"
style=
"width: 100%;margin-top: 10px"
@
click=
"onBindMobile"
>
下一步
</mt-button>
</div>
</mt-popup>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
'swiper/dist/css/swiper.css'
import
'swiper/dist/css/swiper.css'
import
{
swiper
,
swiperSlide
}
from
'vue-awesome-swiper'
import
{
swiper
,
swiperSlide
}
from
'vue-awesome-swiper'
import
QRCode
from
'qrcodejs2'
import
{
Toast
}
from
'mint-ui'
;
import
{
Indicator
}
from
'mint-ui'
;
import
{
getwechatParam
,
getGoodsDetailApi
,
bindMobileApi
,
getUserDetailApi
,
sendMobileCodeApi
,
getGroupDetailApi
,
getStatusWechatApi
}
from
"../../service/api"
;
import
{
getwechatParam
,
getGoodsDetailApi
,
getGroupDetailApi
,
getStatusWechatApi
}
from
"../../service/api"
;
import
refBg
from
'../../assets/refBg.png'
import
refBg
from
'../../assets/refBg.png'
import
moreUrl
from
'../../assets/moreIcon.png'
import
moreUrl
from
'../../assets/moreIcon.png'
import
weChatIcon
from
'../../assets/wechatIcon.png'
import
weChatIcon
from
'../../assets/wechatIcon.png'
import
weChatQrUrl
from
'../../assets/weChatCode.png'
import
weChatQrUrl
from
'../../assets/weChatCode.png'
import
closeUrl
from
'../../assets/closemy.png'
import
closeUrl
from
'../../assets/closemy.png'
import
html2canvas
from
'html2canvas'
export
default
{
export
default
{
name
:
"index"
,
name
:
"index"
,
components
:
{
components
:
{
...
@@ -138,6 +157,12 @@
...
@@ -138,6 +157,12 @@
data
(){
data
(){
return
{
return
{
refBg
:
refBg
,
refBg
:
refBg
,
bindMobile
:{
show
:
false
,
mobile
:
''
,
img_code
:
''
,
verify_code
:
''
},
join
:
false
,
join
:
false
,
popType
:
false
,
popType
:
false
,
popFill
:
false
,
popFill
:
false
,
...
@@ -159,11 +184,13 @@
...
@@ -159,11 +184,13 @@
QRCodeB
:
false
,
QRCodeB
:
false
,
payFlag
:
true
,
payFlag
:
true
,
dataURL
:
null
,
dataURL
:
null
,
time
:
0
,
user_id
:
null
,
user_id
:
null
,
invite_code_f
:
true
,
invite_code_f
:
true
,
invite_code
:
''
,
invite_code
:
''
,
this_code
:
''
,
this_code
:
''
,
shopId
:
''
,
shopId
:
''
,
buyType
:
''
,
groupId
:
null
,
groupId
:
null
,
groupDetail
:
false
,
groupDetail
:
false
,
groupData
:
null
,
groupData
:
null
,
...
@@ -173,111 +200,135 @@
...
@@ -173,111 +200,135 @@
this
.
getDetail
();
this
.
getDetail
();
},
},
methods
:{
methods
:{
goToActivity
(){
onBindMobile
(){
let
query
=
{}
this
.
$sa
.
track
(
'clickSignUp'
,{});
if
(
window
.
location
.
href
.
indexOf
(
'shopId'
)
>-
1
){
if
(
this
.
payFlag
){
query
.
shopId
=
this
.
$route
.
query
.
shopId
;
this
.
payFlag
=
false
;
}
if
(
this
.
bindMobile
.
verify_code
===
''
||!
this
.
bindMobile
.
verify_code
)
{
if
(
window
.
location
.
href
.
indexOf
(
'groupId'
)
>-
1
){
Toast
(
'请填写手机验证码'
);
query
.
groupId
=
this
.
$route
.
query
.
groupId
;
return
false
;
}
let
json
=
{
verify_code
:
this
.
bindMobile
.
verify_code
};
let
mobileCheck
=
/^
(
13
[
0-9
]
|14
[
579
]
|15
[
0-3,5-9
]
|16
[
6
]
|17
[
0135678
]
|18
[
0-9
]
|19
[
89
])\d{8}
$/
;
if
(
this
.
bindMobile
.
mobile
.
match
(
mobileCheck
)){
json
.
mobile
=
this
.
bindMobile
.
mobile
}
else
{
Toast
(
'请正确填写手机号'
);
return
false
}
bindMobileApi
(
json
).
then
(
data
=>
{
getUserDetailApi
().
then
(
res
=>
{
localStorage
.
setItem
(
'userDesc'
,
JSON
.
stringify
(
res
));
this
.
payFlag
=
true
;
this
.
goToBuyPage
()
})
}).
catch
(
res
=>
{
this
.
refImgCode
();
this
.
payFlag
=
true
})
}
}
if
(
window
.
location
.
href
.
indexOf
(
'invite_code'
)
>
-
1
)
{
},
query
.
invite_code
=
this
.
$route
.
query
.
invite_code
;
timeO
(){
if
(
this
.
time
>
0
){
this
.
time
--
;
setTimeout
(()
=>
{
this
.
timeO
()
},
1000
)
}
}
this
.
$router
.
push
({
name
:
'activity'
,
query
:
query
})
},
},
refshow
(){
goToBuyPage
(){
Indicator
.
open
();
let
query
=
{
shopId
:
this
.
shopId
,
invite_code
:
this
.
invite_code
};
if
(
document
.
body
.
scrollTop
<
10
){
if
(
this
.
groupId
){
document
.
body
.
scrollTop
=
20
;
query
.
group_order_id
=
this
.
groupId
document
.
documentElement
.
scrollTop
=
20
;
}
}
if
(
localStorage
.
getItem
(
'cc_token'
)
&&
localStorage
.
getItem
(
'cc_token'
)
!==
''
){
if
(
this
.
buyType
===
0
&&
!
this
.
groupId
){
setTimeout
(()
=>
{
query
.
type
=
'single'
;
Indicator
.
close
();
this
.
buyType
=
'single'
;
if
(
!
this
.
invite_code
){
}
else
if
(
this
.
buyType
===
0
&&
this
.
groupId
){
this
.
invite_code
=
'CC-USER'
this
.
$router
.
push
({
name
:
'buyDetail'
,
query
:{
shopId
:
this
.
shopId
,
invite_code
:
this
.
invite_code
}
}
let
invite_code
=
this
.
invite_code
.
split
(
'-'
);
});
if
(
invite_code
.
length
>
2
&&
invite_code
[
1
]
===
'TEACHER'
){
window
.
location
.
reload
();
invite_code
[
1
]
=
'USER'
return
false
}
}
else
{
let
code
=
`
${
invite_code
[
0
]}
-
${
invite_code
[
1
]}
`
;
query
.
type
=
''
let
URL
=
`
${
process
.
env
.
BUY_URL
}
shopId=
${
this
.
shopId
}
&invite_code=
${
code
}
-
${
this
.
user_id
}
`
;
}
if
(
this
.
groupId
&&
this
.
groupId
!==
'null'
){
let
invite
=
this
.
invite_code
;
URL
+=
`&groupId=
${
this
.
groupId
}
`
this
.
$sa
.
track
(
'buyCourse'
,{
}
buyType
:
this
.
groupDetail
.
goods_type
===
2
&&
buyType
!==
'single'
?
'团购'
:
'直购'
,
this
.
qrcode
(
URL
);
goodsID
:
this
.
shopId
,
this
.
refVisible
=
true
;
salesType
:
invite
?
invite
.
split
(
'-'
)[
1
]:
'null'
,
this
.
$nextTick
(()
=>
{
salesID
:
invite
?
Number
(
invite
.
split
(
'-'
)[
2
]):
0
if
(
!
this
.
dataURL
){
});
setTimeout
(()
=>
{
let
{
height
,
width
}
=
document
.
getElementById
(
'capture'
).
getClientRects
()[
0
]
document
.
getElementById
(
'capture'
).
style
.
width
=
width
+
'px'
;
let
o
=
this
.
getOffsetRect
(
this
.
$refs
.
imageWrapper
);
let
{
height1
,
width1
}
=
document
.
getElementById
(
'capture'
).
getClientRects
()[
0
];
console
.
log
(
height1
)
html2canvas
(
document
.
getElementById
(
'capture'
),{
async
:
true
,
timeout
:
500
,
scrollX
:
1
,
scale
:
3
,
width
:
width1
,
height
:
height1
,
letterRendering
:
true
,
}).
then
((
canvas
)
=>
{
let
dataURL
=
canvas
.
toDataURL
(
"image/jpg"
);
this
.
dataURL
=
dataURL
;
}).
catch
(
res
=>
{
alert
(
res
);
console
.
log
()});
},
500
)
}
else
{
}
})
},
500
)
}
else
{
if
(
window
.
location
.
href
.
indexOf
(
'gdt_vid'
)
>-
1
){
let
query
=
{
retUrl
:
this
.
$route
.
fullPath
,
is_new_user_url
:
'1'
};
query
.
gdt_vid
=
this
.
$route
.
query
.
gdt_vid
this
.
$router
.
push
({
name
:
'author'
,
query
:
query
})
}
}
},
if
(
window
.
location
.
href
.
indexOf
(
'cct_user_id'
)
>-
1
){
getOffsetRect
(
ele
){
query
.
cct_user_id
=
this
.
$route
.
query
.
cct_user_id
var
box
=
ele
.
getBoundingClientRect
();
var
body
=
document
.
body
,
docElem
=
document
.
documentElement
;
//获取页面的scrollTop,scrollLeft(兼容性写法)
var
scrollTop
=
window
.
pageYOffset
||
docElem
.
scrollTop
||
body
.
scrollTop
,
scrollLeft
=
window
.
pageXOffset
||
docElem
.
scrollLeft
||
body
.
scrollLeft
;
var
clientTop
=
docElem
.
clientTop
||
body
.
clientTop
,
clientLeft
=
docElem
.
clientLeft
||
body
.
clientLeft
;
var
top
=
box
.
top
+
scrollTop
-
clientTop
,
left
=
box
.
left
+
scrollLeft
-
clientLeft
;
return
{
//Math.round 兼容火狐浏览器bug
top
:
Math
.
round
(
top
),
left
:
Math
.
round
(
left
)
}
}
this
.
$router
.
push
({
name
:
'buy'
,
query
:
query
});
this
.
$nextTick
(()
=>
{
this
.
payFlag
=
true
;
});
},
},
qrcode
(
data
){
refImgCode
(){
if
(
this
.
QRCodeB
){
this
.
$refs
.
imgCode
.
src
=
'/api/public/img/verify?flag='
+
Math
.
random
()
this
.
QRCodeB
.
makeCode
(
data
)
},
sendMobileCode
(){
if
(
this
.
bindMobile
.
img_code
===
''
||!
this
.
bindMobile
.
img_code
){
Toast
({
message
:
'请填写图形验证码'
});
return
false
;
}
let
json
=
{
img_code
:
this
.
bindMobile
.
img_code
};
let
mobileCheck
=
/^
(
13
[
0-9
]
|14
[
579
]
|15
[
0-3,5-9
]
|16
[
6
]
|17
[
0135678
]
|18
[
0-9
]
|19
[
89
])\d{8}
$/
;
if
(
this
.
bindMobile
.
mobile
.
match
(
mobileCheck
)){
json
.
mobile
=
this
.
bindMobile
.
mobile
}
else
{
}
else
{
this
.
QRCodeB
=
new
QRCode
(
'qrcode'
,
{
Toast
(
'请正确填写手机号'
);
width
:
80
,
return
false
height
:
80
,
// 高度
text
:
data
,
// 二维码内容
image
:
''
});
}
}
this
.
time
=
30
;
this
.
timeO
();
this
.
$sa
.
track
(
'clickSendcode'
,{});
sendMobileCodeApi
(
json
).
then
(
res
=>
{
if
(
res
===
'操作成功'
){
Toast
(
'验证码已发送'
);
}
else
{
this
.
time
=
0
;
this
.
refImgCode
();
Toast
(
res
);
}
}).
catch
(
res
=>
{
this
.
refImgCode
();
})
},
goToActivity
(){
let
query
=
{}
if
(
window
.
location
.
href
.
indexOf
(
'shopId'
)
>-
1
){
query
.
shopId
=
this
.
$route
.
query
.
shopId
;
}
if
(
window
.
location
.
href
.
indexOf
(
'groupId'
)
>-
1
){
query
.
groupId
=
this
.
$route
.
query
.
groupId
;
}
if
(
window
.
location
.
href
.
indexOf
(
'invite_code'
)
>
-
1
)
{
query
.
invite_code
=
this
.
$route
.
query
.
invite_code
;
}
this
.
$router
.
push
({
name
:
'activity'
,
query
:
query
})
},
},
// 分享
enableShare
:
function
(
option
)
{
enableShare
:
function
(
option
)
{
let
that
=
this
;
let
that
=
this
;
getwechatParam
({
getwechatParam
({
...
@@ -319,7 +370,6 @@
...
@@ -319,7 +370,6 @@
})
})
})
})
},
},
// 处理invite_code
handleInviteCode
(){
handleInviteCode
(){
if
(
!
this
.
invite_code
){
if
(
!
this
.
invite_code
){
this
.
this_code
=
'CC-USER-'
+
this
.
user_id
;
this
.
this_code
=
'CC-USER-'
+
this
.
user_id
;
...
@@ -444,50 +494,11 @@
...
@@ -444,50 +494,11 @@
});
});
},
},
groupPay
(
type
){
groupPay
(
type
){
if
(
this
.
payFlag
){
if
(
!
JSON
.
parse
(
localStorage
.
getItem
(
'userDesc'
)).
mobile
||
JSON
.
parse
(
localStorage
.
getItem
(
'userDesc'
)).
mobile
===
''
){
this
.
payFlag
=
false
;
this
.
bindMobile
.
show
=
true
let
query
=
{
shopId
:
this
.
shopId
,
invite_code
:
this
.
invite_code
};
}
else
{
let
buyType
this
.
buyType
=
type
;
if
(
this
.
groupId
){
this
.
goToBuyPage
();
query
.
group_order_id
=
this
.
groupId
}
if
(
type
===
0
&&
!
this
.
groupId
){
query
.
type
=
'single'
;
buyType
=
'single'
;
}
else
if
(
type
===
0
&&
this
.
groupId
){
this
.
$router
.
push
({
name
:
'buyDetail'
,
query
:{
shopId
:
this
.
shopId
,
invite_code
:
this
.
invite_code
}
});
window
.
location
.
reload
();
return
false
}
else
{
query
.
type
=
''
}
let
invite
=
this
.
invite_code
;
this
.
$sa
.
track
(
'buyCourse'
,{
buyType
:
this
.
groupDetail
.
goods_type
===
2
&&
buyType
!==
'single'
?
'团购'
:
'直购'
,
goodsID
:
this
.
shopId
,
salesType
:
invite
?
invite
.
split
(
'-'
)[
1
]:
'null'
,
salesID
:
invite
?
Number
(
invite
.
split
(
'-'
)[
2
]):
0
});
if
(
window
.
location
.
href
.
indexOf
(
'gdt_vid'
)
>-
1
){
query
.
gdt_vid
=
this
.
$route
.
query
.
gdt_vid
}
if
(
window
.
location
.
href
.
indexOf
(
'cct_user_id'
)
>-
1
){
query
.
cct_user_id
=
this
.
$route
.
query
.
cct_user_id
}
this
.
$router
.
push
({
name
:
'buy'
,
query
:
query
});
this
.
$nextTick
(()
=>
{
this
.
payFlag
=
true
;
});
}
}
}
}
}
}
...
@@ -563,6 +574,50 @@
...
@@ -563,6 +574,50 @@
padding-bottom: toVw(150);
padding-bottom: toVw(150);
background: #f0f0f0;
background: #f0f0f0;
font-family: PingFangSC-Regular;
font-family: PingFangSC-Regular;
.bindMobile-block.mint-popup{
border-radius: 0;
width: 100%;
font-size:14*@toVw;
background: transparent;
/deep/ .mint-cell-text{
font-size: 14*@toVw;
}
/deep/ .mint-field-core{
font-size: 14*@toVw;
}
.codeMsg{
border-radius:100*@toVw;
border:1*@toVw solid rgba(96,173,240,1);
background: white;
font-size: 12*@toVw;
color: rgb(96,173,240);
outline: none;
float: right;
padding: 4*@toVw 10*@toVw;
&.disabled{
opacity: 0.5;
}
}
.bindMobile-main{
background: white;
position: relative;
margin-top: 50*@toVw;
.header{
width: 70*@toVw;
top: -30*@toVw;
left: 15*@toVw;
height: 70*@toVw;
position: absolute;
}
.title{
padding-left: 95*@toVw;
padding-top: 5*@toVw;
font-family:PingFang-SC-Bold;
font-weight:bold;
}
}
}
.ref-icon{
.ref-icon{
position: fixed;
position: fixed;
height: 100/375 * 90vw ;
height: 100/375 * 90vw ;
...
@@ -776,5 +831,4 @@
...
@@ -776,5 +831,4 @@
}
}
}
}
}
}
</
style
>
</
style
>
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