Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
scrm-wx-merchant-activity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ab9d69e6
authored
Sep 27, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改新用户购买相关BUG
1 parent
909e46e1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
116 additions
and
49 deletions
src/api/shopmallApi.js
src/components/Action.vue
src/components/PayModal.vue
src/components/createOrderImg.vue
src/config/env.development.js
src/api/shopmallApi.js
View file @
ab9d69e
...
@@ -27,7 +27,8 @@ export default {
...
@@ -27,7 +27,8 @@ export default {
data
.
method
=
'scrm.api.shopmall.weapp.order.create'
data
.
method
=
'scrm.api.shopmall.weapp.order.create'
return
window
.
$HTTP
({
return
window
.
$HTTP
({
url
,
url
,
data
data
,
returnAll
:
true
})
})
},
},
/**创建支付订单(去付款) */
/**创建支付订单(去付款) */
...
...
src/components/Action.vue
View file @
ab9d69e
<
template
>
<
template
>
<div
:class=
"['action isFullSucreen flex',
{ bgBlack: bgBlack }]"
<div
v-if="show">
:class=
"['action isFullSucreen flex',
{ bgBlack: bgBlack }]"
<div
class=
"btn-box flex"
v-if="show"
v-show=
"!bgBlack"
>
>
<div
class=
"item"
<div
@
click=
"getPoster"
>
class=
"btn-box flex"
v-show=
"!bgBlack"
>
<div
class=
"item"
@
click=
"getPoster"
>
<div
class=
"sprite-icon icon-poster"
></div>
<div
class=
"sprite-icon icon-poster"
></div>
海报
海报
</div>
</div>
...
@@ -14,10 +20,12 @@
...
@@ -14,10 +20,12 @@
{{
detail
.
price
}}
{{
detail
.
price
}}
<span>
.
{{
detail
.
decimal
}}
</span>
<span>
.
{{
detail
.
decimal
}}
</span>
</div>
</div>
<div
:class=
"['btn text-center',
{ disabled: iSMiniprogram || detail.activityStatus == 3 || detail.buyFlag == 2 }, { short: detail.buyFlag == 3 }]"
<div
:class=
"['btn text-center',
{ disabled: iSMiniprogram || detail.activityStatus == 3 || detail.buyFlag == 2 }, { short: detail.buyFlag == 3 }]"
@click="submit"
@click="submit"
@touchstart="touchstart"
@touchstart="touchstart"
@touchend="touchend">
@touchend="touchend"
>
<template
v-if=
"detail.activityStatus == 1 && detail.buyFlag != 2"
>
预热下单
</
template
>
<template
v-if=
"detail.activityStatus == 1 && detail.buyFlag != 2"
>
预热下单
</
template
>
<
template
v-else-if=
"detail.activityStatus == 3"
>
活动已结束
</
template
>
<
template
v-else-if=
"detail.activityStatus == 3"
>
活动已结束
</
template
>
<
template
v-else
>
<
template
v-else
>
...
@@ -26,22 +34,32 @@
...
@@ -26,22 +34,32 @@
<
template
v-else
>
立即参团
</
template
>
<
template
v-else
>
立即参团
</
template
>
</template>
</template>
</div>
</div>
<pay-modal
v-model=
"showModal"
<pay-modal
v-model=
"showModal"
:list=
"formList"
:list=
"formList"
@
cancel=
"showModal = false"
@
cancel=
"showModal = false"
@
pay=
"checkOut"
@
pay=
"checkOut"
:payStatus=
"payStatus"
:payStatus=
"payStatus"
:carInfo=
"carInfo"
/>
:carInfo=
"carInfo"
<van-overlay
:show=
"showPoster"
/>
@
click
.
self=
"showPoster = false"
>
<van-overlay
<div
class=
"wrapper"
:show=
"showPoster"
@
click
.
stop
>
@
click
.
self=
"showPoster = false"
<van-image
:src=
"posterImg"
>
<div
class=
"wrapper"
@
click
.
stop
>
<van-image
:src=
"posterImg"
width=
"100%"
width=
"100%"
height=
"100%"
>
height=
"100%"
>
<
template
v-slot:loading
>
<
template
v-slot:loading
>
<van-loading
type=
"spinner"
<van-loading
size=
"20"
/>
type=
"spinner"
size=
"20"
/>
</
template
>
</
template
>
</van-image>
</van-image>
</div>
</div>
...
@@ -57,7 +75,7 @@ export default {
...
@@ -57,7 +75,7 @@ export default {
watch
:
{
watch
:
{
watchUpdataCarInfo
:
{
watchUpdataCarInfo
:
{
immediate
:
true
,
immediate
:
true
,
handler
(
n
)
{
handler
(
n
)
{
let
{
let
{
activityInfo
:
{
carInfo
},
activityInfo
:
{
carInfo
},
activityInfo
}
activityInfo
}
...
@@ -68,7 +86,7 @@ export default {
...
@@ -68,7 +86,7 @@ export default {
},
},
watchInfo
:
{
watchInfo
:
{
immediate
:
true
,
immediate
:
true
,
handler
(
n
)
{
handler
(
n
)
{
if
(
n
.
id
)
{
if
(
n
.
id
)
{
let
[
price
,
decimal
]
=
this
.
centsToyuan
(
n
.
retailPrice
).
toString
().
split
(
'.'
)
let
[
price
,
decimal
]
=
this
.
centsToyuan
(
n
.
retailPrice
).
toString
().
split
(
'.'
)
if
(
!
decimal
)
decimal
=
'00'
if
(
!
decimal
)
decimal
=
'00'
...
@@ -121,14 +139,14 @@ export default {
...
@@ -121,14 +139,14 @@ export default {
}
}
},
},
computed
:
{
computed
:
{
watchInfo
()
{
watchInfo
()
{
return
this
.
$store
.
state
.
app
.
activityInfo
return
this
.
$store
.
state
.
app
.
activityInfo
},
},
watchUpdataCarInfo
()
{
watchUpdataCarInfo
()
{
return
this
.
$store
.
state
.
app
.
updataCarInfo
return
this
.
$store
.
state
.
app
.
updataCarInfo
}
}
},
},
data
()
{
data
()
{
return
{
return
{
show
:
false
,
show
:
false
,
showModal
:
false
,
showModal
:
false
,
...
@@ -146,11 +164,11 @@ export default {
...
@@ -146,11 +164,11 @@ export default {
default
:
false
default
:
false
}
}
},
},
mounted
()
{
mounted
()
{
this
.
iSMiniprogram
=
window
.
__wxjs_environment
===
'miniprogram'
this
.
iSMiniprogram
=
window
.
__wxjs_environment
===
'miniprogram'
},
},
methods
:
{
methods
:
{
submit
()
{
submit
()
{
let
{
detail
,
iSMiniprogram
}
=
this
let
{
detail
,
iSMiniprogram
}
=
this
if
(
iSMiniprogram
)
{
if
(
iSMiniprogram
)
{
this
.
showToast
(
'参团请拨打短信中咨询热线'
)
this
.
showToast
(
'参团请拨打短信中咨询热线'
)
...
@@ -183,11 +201,15 @@ export default {
...
@@ -183,11 +201,15 @@ export default {
shareStaffName
:
linkParams
.
shareStaffName
||
''
,
shareStaffName
:
linkParams
.
shareStaffName
||
''
,
shareStaffImageUrl
:
linkParams
.
shareStaffImageUrl
||
''
shareStaffImageUrl
:
linkParams
.
shareStaffImageUrl
||
''
}
}
shopmallApi
.
createOrder
(
params
).
then
(
data
=>
{
shopmallApi
.
createOrder
(
params
).
then
(({
data
,
code
,
message
})
=>
{
that
.
pay
(
data
)
if
(
code
==
'0'
)
that
.
pay
(
data
)
else
{
that
.
payStatus
=
Date
.
now
()
that
.
showToast
(
message
)
}
})
})
},
1
e3
),
},
1
e3
),
pay
(
orderInfo
)
{
pay
(
orderInfo
)
{
this
.
showLoading
(
'结算中'
)
this
.
showLoading
(
'结算中'
)
this
.
payStatus
=
Date
.
now
()
this
.
payStatus
=
Date
.
now
()
shopmallApi
.
payOrder
({
shopmallApi
.
payOrder
({
...
@@ -228,7 +250,7 @@ export default {
...
@@ -228,7 +250,7 @@ export default {
}
else
this
.
showToast
(
message
)
}
else
this
.
showToast
(
message
)
})
})
},
},
getPoster
()
{
getPoster
()
{
let
{
id
}
=
this
.
detail
let
{
id
}
=
this
.
detail
let
userInfo
=
this
.
getUserInfo
()
let
userInfo
=
this
.
getUserInfo
()
let
{
phone
,
nickName
,
logo
}
=
userInfo
let
{
phone
,
nickName
,
logo
}
=
userInfo
...
...
src/components/PayModal.vue
View file @
ab9d69e
<
template
>
<
template
>
<van-action-sheet
v-model=
"showBox"
@
click-overlay=
"onCancel"
:lock-scroll=
"false"
>
<van-action-sheet
v-model=
"showBox"
@
click-overlay=
"onCancel"
:lock-scroll=
"false"
>
<div
class=
"box"
>
<div
class=
"box"
>
<template
v-for=
"(i, index) in items"
>
<template
v-for=
"(i, index) in items"
>
<template
v-if=
"i.name"
>
<template
v-if=
"i.name"
>
<div
class=
"item flex"
:key=
"index"
>
<div
class=
"item flex"
:key=
"index"
>
<div
class=
"label text-hide"
>
<div
class=
"label text-hide"
>
<span>
*
</span>
<span>
*
</span>
{{
i
.
name
}}
{{
i
.
name
}}
</div>
</div>
<div
class=
"value"
>
<div
class=
"value"
>
<template
v-if=
"i.route"
>
<template
v-if=
"i.route"
>
<van-field
readonly
:placeholder=
"`请选择您的$
{i.name}`" @click="jumpCarBrands(i.route)" v-model="params[i.key]" class="readonly" right-icon="arrow">
</van-field>
<van-field
readonly
:placeholder=
"`请选择您的$
{i.name}`"
@click="jumpCarBrands(i.route)"
v-model="params[i.key]"
class="readonly"
right-icon="arrow"
>
</van-field>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<van-field
v-model=
"params[i.key]"
:placeholder=
"`请填写您的$
{i.name}`" :maxlength="i.maxlength" :type="i.type" clearable />
<van-field
v-model=
"params[i.key]"
:placeholder=
"`请填写您的$
{i.name}`"
:maxlength="i.maxlength"
:type="i.type"
clearable
/>
</
template
>
</
template
>
</div>
</div>
</div>
</div>
...
@@ -23,10 +43,19 @@
...
@@ -23,10 +43,19 @@
本人已阅读且同意<span @click="jump('agreement')">《隐私协议》</span>
本人已阅读且同意<span @click="jump('agreement')">《隐私协议》</span>
</div> -->
</div> -->
<
template
v-if=
"ISWXWORK"
>
<
template
v-if=
"ISWXWORK"
>
<van-button
color=
"#b1b1b1"
class=
"btn disabled"
>
企微暂不支持支付
</van-button>
<van-button
color=
"#b1b1b1"
class=
"btn disabled"
>
企微暂不支持支付
</van-button>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<van-button
color=
"#f13c3d"
class=
"btn"
@
click=
"pay"
loading-text=
"支付中..."
:loading=
"payLoading"
>
立即支付
</van-button>
<van-button
color=
"#f13c3d"
class=
"btn"
@
click=
"pay"
loading-text=
"支付中..."
:loading=
"payLoading"
>
立即支付
</van-button>
</
template
>
</
template
>
</div>
</div>
</van-action-sheet>
</van-action-sheet>
...
@@ -60,13 +89,17 @@ export default {
...
@@ -60,13 +89,17 @@ export default {
// { name: '电话', key: 'userPhone', maxlength: 11, type: 'tel' },
// { name: '电话', key: 'userPhone', maxlength: 11, type: 'tel' },
...
this
.
list
...
this
.
list
]
]
console
.
log
(
this
.
items
)
let
params
=
{}
let
params
=
{}
this
.
items
.
map
(
e
=>
{
this
.
items
.
map
(
e
=>
{
params
[
e
.
key
]
=
''
params
[
e
.
key
]
=
''
if
(
e
.
route
)
this
.
hasCarBrand
=
true
if
(
e
.
route
)
this
.
hasCarBrand
=
true
if
(
e
.
key
==
'userPhone'
)
{
this
.
hasPhoneSelect
=
true
if
(
phone
)
params
[
e
.
key
]
=
phone
}
})
})
this
.
params
=
params
this
.
params
=
params
if
(
!
this
.
params
.
userPhone
)
this
.
params
.
userPhone
=
phone
let
{
hasDefaultBrands
,
brandInfo
}
=
this
.
$parent
.
detail
let
{
hasDefaultBrands
,
brandInfo
}
=
this
.
$parent
.
detail
if
(
hasDefaultBrands
&&
!
this
.
params
.
carBrandsText
)
{
if
(
hasDefaultBrands
&&
!
this
.
params
.
carBrandsText
)
{
this
.
params
.
carBrandsText
=
`
${
brandInfo
.
vehicleBrandName
}
${
brandInfo
.
vehicleSubBrandName
}
`
this
.
params
.
carBrandsText
=
`
${
brandInfo
.
vehicleBrandName
}
${
brandInfo
.
vehicleSubBrandName
}
`
...
@@ -78,17 +111,20 @@ export default {
...
@@ -78,17 +111,20 @@ export default {
},
},
carInfo
(
n
)
{
carInfo
(
n
)
{
console
.
table
([
JSON
.
parse
(
JSON
.
stringify
(
n
))])
console
.
table
([
JSON
.
parse
(
JSON
.
stringify
(
n
))])
if
(
this
.
params
)
{
this
.
params
.
carBrandsText
=
`
${
n
.
vehicleBrandName
}
${
n
.
vehicleSubBrandName
}
`
this
.
params
.
carBrandsText
=
`
${
n
.
vehicleBrandName
}
${
n
.
vehicleSubBrandName
}
`
this
.
params
.
carTypeText
=
`
${
n
.
vehicleSeriesName
}
${
n
.
vehicleShapeName
}
`
this
.
params
.
carTypeText
=
`
${
n
.
vehicleSeriesName
}
${
n
.
vehicleShapeName
}
`
}
}
},
},
},
data
()
{
data
()
{
return
{
return
{
showBox
:
false
,
showBox
:
false
,
payLoading
:
false
,
payLoading
:
false
,
items
:
[],
items
:
[],
params
:
null
,
params
:
null
,
hasCarBrand
:
false
hasCarBrand
:
false
,
hasPhoneSelect
:
false
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -99,7 +135,7 @@ export default {
...
@@ -99,7 +135,7 @@ export default {
this
.
$emit
(
'cancel'
)
this
.
$emit
(
'cancel'
)
},
},
pay
()
{
pay
()
{
let
{
params
,
items
,
hasCarBrand
,
carInfo
}
=
this
,
let
{
params
,
items
,
hasCarBrand
,
carInfo
,
hasPhoneSelect
}
=
this
,
obj
=
{},
obj
=
{},
phoneRex
=
/^
[
1
]([
3-9
])[
0-9
]{9}
$/
,
phoneRex
=
/^
[
1
]([
3-9
])[
0-9
]{9}
$/
,
userInfo
=
this
.
getUserInfo
(),
userInfo
=
this
.
getUserInfo
(),
...
@@ -116,7 +152,7 @@ export default {
...
@@ -116,7 +152,7 @@ export default {
this
.
showToast
(
`请填写
${
error
}
`
)
this
.
showToast
(
`请填写
${
error
}
`
)
return
return
}
}
if
(
!
phoneRex
.
test
(
params
.
userPhone
))
{
if
(
params
.
userPhone
&&
!
phoneRex
.
test
(
params
.
userPhone
))
{
this
.
showToast
(
'请填写正确的手机号'
)
this
.
showToast
(
'请填写正确的手机号'
)
return
return
}
}
...
@@ -139,6 +175,8 @@ export default {
...
@@ -139,6 +175,8 @@ export default {
}
}
}
}
if
(
userInfo
.
phone
)
this
.
emit
(
obj
)
if
(
userInfo
.
phone
)
this
.
emit
(
obj
)
else
{
if
(
!
hasPhoneSelect
)
this
.
emit
(
obj
)
else
ssoApi
.
captchaLogin
({
else
ssoApi
.
captchaLogin
({
mobile
:
params
.
userPhone
,
mobile
:
params
.
userPhone
,
captcha
:
8888
,
captcha
:
8888
,
...
@@ -152,6 +190,7 @@ export default {
...
@@ -152,6 +190,7 @@ export default {
}
}
else
Notify
(
message
)
else
Notify
(
message
)
})
})
}
},
},
emit
(
obj
)
{
emit
(
obj
)
{
console
.
log
(
obj
)
console
.
log
(
obj
)
...
...
src/components/createOrderImg.vue
View file @
ab9d69e
<
template
>
<
template
>
<canvas
:id=
"canvasId"
class=
"create"
></canvas>
<canvas
:id=
"canvasId"
class=
"create"
></canvas>
</
template
>
</
template
>
<
script
type=
"text/ecmascript-6"
>
<
script
type=
"text/ecmascript-6"
>
...
@@ -58,21 +61,22 @@ export default {
...
@@ -58,21 +61,22 @@ export default {
canvasWidth
=
337
,
canvasWidth
=
337
,
canvasHeight
=
561
,
canvasHeight
=
561
,
carText
=
''
,
carText
=
''
,
labelList
=
[
'姓名:'
,
'手机:'
],
labelList
=
[
'姓名:'
],
spacing
=
0
,
spacing
=
0
,
textYList
=
[],
textYList
=
[],
labelEndX
=
80
,
labelEndX
=
80
,
lineNum
=
2
,
lineNum
=
2
,
lineHeight
=
24
lineHeight
=
24
,
valueList
=
[
userName
]
const
draw
=
new
Draw
(
this
,
{
const
draw
=
new
Draw
(
this
,
{
width
:
canvasWidth
,
width
:
canvasWidth
,
height
:
canvasHeight
,
height
:
canvasHeight
,
// pixelRatio: 1
// pixelRatio: 1
})
})
let
valueList
=
[
if
(
userPhone
)
{
userName
,
labelList
.
push
(
'手机:'
)
userPhone
,
valueList
.
push
(
userPhone
)
]
}
if
(
plateNo
)
{
if
(
plateNo
)
{
labelList
.
push
(
'车牌号:'
)
labelList
.
push
(
'车牌号:'
)
valueList
.
push
(
plateNo
)
valueList
.
push
(
plateNo
)
...
@@ -84,7 +88,7 @@ export default {
...
@@ -84,7 +88,7 @@ export default {
}
}
labelList
=
[...
labelList
,
'商品名称:'
,
'支付时间:'
]
labelList
=
[...
labelList
,
'商品名称:'
,
'支付时间:'
]
valueList
=
[...
valueList
,
goodsName
,
new
Date
(
createdDate
).
format
(
'yyyy年M月d日 hh:mm:ss'
)]
valueList
=
[...
valueList
,
goodsName
,
new
Date
(
createdDate
).
format
(
'yyyy年M月d日 hh:mm:ss'
)]
if
(
orderStatus
!=
10
&&
outTradeNo
)
{
if
(
orderStatus
!=
10
&&
outTradeNo
)
{
labelList
.
push
(
'商户订单号:'
)
labelList
.
push
(
'商户订单号:'
)
valueList
.
push
(
outTradeNo
)
valueList
.
push
(
outTradeNo
)
}
}
...
@@ -176,6 +180,7 @@ export default {
...
@@ -176,6 +180,7 @@ export default {
value
.
y
=
textYList
[
index
]
+
5
value
.
y
=
textYList
[
index
]
+
5
}
}
draw
.
drawText
(
label
)
draw
.
drawText
(
label
)
console
.
log
(
'---------------'
,
e
,
value
)
draw
.
drawText
(
value
)
draw
.
drawText
(
value
)
}))
}))
draw
.
drawLine
({
draw
.
drawLine
({
...
...
src/config/env.development.js
View file @
ab9d69e
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
module
.
exports
=
{
module
.
exports
=
{
title
:
'加载中...'
,
title
:
'加载中...'
,
request
:
{
request
:
{
baseURL
:
'http://scrm.
test
.glsx.com.cn'
,
// 本地测试项目地址,
baseURL
:
'http://scrm.
dev
.glsx.com.cn'
,
// 本地测试项目地址,
// 设置超时时间
// 设置超时时间
timeout
:
180000
,
timeout
:
180000
,
// 携带凭证
// 携带凭证
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment