Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cauchy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
cauchy-ui
Commits
ebe2eb93
Commit
ebe2eb93
authored
Jul 13, 2021
by
FE-安焕焕
👣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
联调
parent
44db59dc
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
265 additions
and
121 deletions
+265
-121
package-lock.json
package-lock.json
+3
-3
package.json
package.json
+1
-1
order.api.js
src/api/order.api.js
+3
-2
pay.api.js
src/api/pay.api.js
+14
-11
RecoGoods.vue
src/components/RecoGoods.vue
+3
-0
main.js
src/main.js
+1
-0
encrypt.js
src/service/encrypt.js
+1
-0
httpDecorator.js
src/service/httpDecorator.js
+8
-1
utils.service.js
src/service/utils.service.js
+52
-1
RechargeInput.vue
src/views/home/components/RechargeInput.vue
+64
-4
RechargeList.vue
src/views/home/components/RechargeList.vue
+2
-1
RechargeTop.vue
src/views/home/components/RechargeTop.vue
+7
-1
index.less
src/views/home/index.less
+6
-0
index.vue
src/views/home/index.vue
+30
-7
ListItem.vue
src/views/orderList/components/ListItem.vue
+1
-1
index.vue
src/views/orderList/index.vue
+5
-5
STATIC_DATA.js
src/views/pay/STATIC_DATA.js
+2
-2
Contract.vue
src/views/pay/components/Contract.vue
+0
-7
PayCardItem.vue
src/views/pay/components/PayCardItem.vue
+0
-3
index.vue
src/views/pay/index.vue
+36
-53
payResult.vue
src/views/pay/payResult.vue
+2
-3
payWaiting.vue
src/views/pay/payWaiting.vue
+13
-6
SpuList.vue
src/views/vipLife/components/SpuList.vue
+1
-1
index.less
src/views/vipLife/index.less
+1
-1
index.vue
src/views/vipLife/index.vue
+9
-7
No files found.
package-lock.json
View file @
ebe2eb93
...
...
@@ -3973,9 +3973,9 @@
}
},
"crypto-js"
:
{
"version"
:
"3.
1.9-1
"
,
"resolved"
:
"http://npmprivate.quantgroups.com/crypto-js/-/crypto-js-3.
1.9-1
.tgz"
,
"integrity"
:
"sha
1-/aGedh/Ad+Af+/3G6f38WeiAbNg
="
"version"
:
"3.
3.0
"
,
"resolved"
:
"http://npmprivate.quantgroups.com/crypto-js/-/crypto-js-3.
3.0
.tgz"
,
"integrity"
:
"sha
512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q=
="
},
"css"
:
{
"version"
:
"2.2.4"
,
...
...
package.json
View file @
ebe2eb93
...
...
@@ -16,7 +16,7 @@
"
@qg/ui-request
"
:
"
0.0.8
"
,
"
clipboard
"
:
"
^2.0.8
"
,
"
core-js
"
:
"
^3.6.5
"
,
"
crypto-js
"
:
"
^3.
1.9-1
"
,
"
crypto-js
"
:
"
^3.
3.0
"
,
"
js-cookie
"
:
"
^2.2.1
"
,
"
node-forge
"
:
"
^0.10.0
"
,
"
raven-js
"
:
"
^3.27.2
"
,
...
...
src/api/order.api.js
View file @
ebe2eb93
...
...
@@ -19,10 +19,11 @@ export default {
},
// 订单详情查询接口
orderDetail
(
data
)
{
return
http
.
get
(
`
${
talosHost
}
/api/kdsp/order-info/virtual-recharge/detail`
,
data
);
return
http
.
get
(
`
${
talosHost
}
/api/kdsp/order-info/virtual-recharge/detail`
,
{
params
:
data
}
);
},
// 订单创建
orderCreate
(
data
)
{
return
http
.
post
(
`
${
talosHost
}
/api/kdsp/order-info/e/vmSubmit`
,
{
data
:
encryption
(
data
)
});
console
.
log
(
data
);
return
http
.
post
(
`
${
talosHost
}
/api/kdsp/order-info/e/vmSubmit`
,
encryption
(
data
));
}
};
src/api/pay.api.js
View file @
ebe2eb93
import
request
from
'
@/service/httpDecorator
'
;
import
config
from
'
@/config
'
;
import
{
encryption
}
from
'
@/service/encrypt
'
;
import
{
saDeviceId
}
from
'
@/service/sa.service
'
;
const
{
talosHost
}
=
config
;
const
queryPayInfo
=
function
(
data
)
{
return
request
.
post
(
`
${
talosHost
}
/open/checkout`
,
data
);
};
const
prepay
=
function
(
data
)
{
console
.
log
(
'
prepay-param
'
,
data
);
return
request
.
post
(
`
${
talosHost
}
/open/checkout/prepay`
,
data
);
const
prepay
=
async
function
(
data
)
{
const
scDeviceId
=
await
saDeviceId
();
return
request
.
post
(
`
${
talosHost
}
/open/checkout/prepay`
,
data
,
{
customHeader
:
{
scDeviceId
}
});
};
const
pay
=
function
(
data
)
{
return
request
.
post
(
`
${
talosHost
}
/open/checkout/pay`
,
{
data
:
encryption
(
data
)
},
{
needScDeviceId
:
true
const
pay
=
async
function
(
data
)
{
const
scDeviceId
=
await
saDeviceId
();
return
request
.
post
(
`
${
talosHost
}
/open/checkout/pay`
,
data
,
{
customHeader
:
{
scDeviceId
}
);
}
);
};
const
queryPayStatus
=
function
(
data
)
{
...
...
src/components/RecoGoods.vue
View file @
ebe2eb93
...
...
@@ -48,6 +48,9 @@ export default {
return
this
.
list
.
filter
((
item
,
index
)
=>
index
%
2
);
}
},
mounted
()
{
this
.
onLoad
();
},
methods
:
{
async
onLoad
()
{
this
.
loading
=
true
;
...
...
src/main.js
View file @
ebe2eb93
...
...
@@ -20,6 +20,7 @@ if (process.env.SENTRY_ENV !== 'test' && process.env.NODE_ENV === 'production')
.
install
();
}
Vue
.
prototype
.
util
=
new
Bridge
();
window
.
Bridge
=
Bridge
;
saService
.
init
(
router
);
...
...
src/service/encrypt.js
View file @
ebe2eb93
...
...
@@ -39,6 +39,7 @@ export function encryption(data = '') {
* @return {String} 加密后的数据16进制
*/
export
async
function
encryptByDESModeEBC
(
message
)
{
console
.
log
(
message
);
const
[{
payPwdSalt
}]
=
await
desSalt
();
var
keyHex
=
CryptoJS
.
enc
.
Utf8
.
parse
(
payPwdSalt
);
var
encrypted
=
CryptoJS
.
DES
.
encrypt
(
message
,
keyHex
,
{
...
...
src/service/httpDecorator.js
View file @
ebe2eb93
import
HttpRequest
from
'
@qg/ui-request
'
;
import
{
Toast
}
from
'
@qg/cherry-ui
'
;
import
store
from
'
@/store
'
;
import
{
appVersion
}
from
'
@/service/validation.service
'
;
const
http
=
new
HttpRequest
(
{},
{},
{
headers
:
{
'
x-user-terminal
'
:
'
H5
'
,
version
:
appVersion
||
'
7.9.0
'
}
},
function
(
msg
)
{
Toast
(
msg
);
},
...
...
src/service/utils.service.js
View file @
ebe2eb93
import
{
isAndroid
,
isIOS
}
from
'
./validation.service
'
;
import
{
isAndroid
,
isIOS
,
isApp
}
from
'
./validation.service
'
;
import
Clipboard
from
'
clipboard
'
;
/**
...
...
@@ -378,3 +378,54 @@ export function setClipboardData(
fakeEl
.
click
();
document
.
body
.
removeChild
(
fakeEl
);
}
export
function
getTokenFromNative
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
isApp
)
{
reject
();
console
.
log
(
'
not app or wxmp
'
);
navToDlApp
();
return
;
}
const
nativeBridge
=
new
window
.
Bridge
();
window
.
xyqbNativeEvent
=
function
(
res
)
{
const
json
=
typeof
res
===
'
string
'
?
JSON
.
parse
(
res
)
:
res
;
if
(
json
.
event
===
'
getTokenSuccess
'
)
{
const
appData
=
json
.
data
||
{};
if
(
appData
&&
appData
.
token
)
{
localStorage
.
set
(
'
vccToken
'
,
appData
.
token
);
resolve
(
true
);
}
else
{
reject
();
}
}
else
{
reject
();
}
};
nativeBridge
.
getToken
();
});
}
export
function
navToDlApp
()
{
window
.
location
.
href
=
'
xyqb://openApp
'
;
setTimeout
(()
=>
{
window
.
location
.
href
=
APP_DOWN_URL
;
const
nextPage
=
document
.
createElement
(
'
a
'
);
nextPage
.
setAttribute
(
'
href
'
,
APP_DOWN_URL
);
nextPage
.
click
();
},
2000
);
}
export
const
APP_DOWN_URL
=
'
https://misc.lkbang.net/download/yxm.html
'
;
export
function
throttle
(
fn
,
wait
)
{
let
flag
=
true
;
console
.
log
(
fn
);
return
function
()
{
if
(
flag
)
{
fn
.
apply
(
this
,
arguments
);
flag
=
false
;
setTimeout
(()
=>
{
flag
=
true
;
},
wait
);
}
};
}
src/views/home/components/RechargeInput.vue
View file @
ebe2eb93
<
template
>
<
p
class=
"center-phone"
>
<
div
class=
"center-phone"
>
<span
v-if=
"rechargeTel"
class=
"center-phone-location"
>
{{
isDefaultphone
?
'
默认号码
'
:
'
未知号码
'
}}{{
phoneNoHome
?
`(${phoneNoHome
}
)`
:
''
}}
<
/spa
n
...
...
@@ -12,7 +12,19 @@
@
input
=
"
changeTelFormat
"
@
blur
=
"
searchPhoneNoHome
"
/>
<
/p
>
<
div
class
=
"
center-phone__list
"
:
class
=
"
{ show: inputBlur
}
"
>
<
div
v
-
for
=
"
(item, index) in list
"
:
key
=
"
index
"
class
=
"
center-phone__list-item
"
@
click
=
"
searchPhoneNoHome(item)
"
>
<
span
class
=
"
phone
"
>
{{
phoneFormat
(
item
.
phone
)
}}
<
/span
>
<
span
class
=
"
phone-home
"
>
{{
item
.
home
}}
<
/span
>
<
span
v
-
if
=
"
index === 0
"
class
=
"
current
"
>
上次充值
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/template
>
<
script
>
import
api
from
'
@/api/recharge.api
'
;
...
...
@@ -20,12 +32,14 @@ import { phoneFormat, phoneTrim, checkPhoneFormat } from '@/service/utils.servic
const
{
getPhoneHome
}
=
api
;
export
default
{
props
:
{
userPhoneInfo
:
Object
userPhoneInfo
:
Object
,
list
:
Array
}
,
data
()
{
return
{
phoneNoHome
:
null
,
rechargeTel
:
null
rechargeTel
:
null
,
inputBlur
:
false
}
;
}
,
computed
:
{
...
...
@@ -43,9 +57,13 @@ export default {
}
}
,
methods
:
{
phoneFormat
,
changeTelFormat
(
phone
)
{
this
.
phoneNoHome
=
''
;
this
.
rechargeTel
=
phoneFormat
(
phone
);
if
(
this
.
rechargeTel
.
length
>
12
)
{
this
.
queryhome
();
}
}
,
async
searchPhoneNoHome
()
{
if
(
!
this
.
phoneNo
)
return
;
...
...
@@ -54,6 +72,9 @@ export default {
this
.
$emit
(
'
input
'
,
{
phoneNo
:
''
,
phoneNoHome
:
this
.
phoneNoHome
}
);
return
;
}
this
.
$emit
(
'
input
'
,
{
phoneNo
:
this
.
phoneNo
,
phoneNoHome
:
this
.
phoneNoHome
}
);
}
,
async
queryhome
()
{
const
[
data
]
=
await
getPhoneHome
(
this
.
phoneNo
);
this
.
phoneNoHome
=
data
?.
phoneHome
;
this
.
$emit
(
'
input
'
,
{
phoneNo
:
this
.
phoneNo
,
phoneNoHome
:
this
.
phoneNoHome
}
);
...
...
@@ -63,6 +84,7 @@ export default {
<
/script
>
<
style
lang
=
"
less
"
>
.
center
{
position
:
relative
;
&-
phone
{
border
-
bottom
:
@
border
-
width
-
base
solid
@
gray
-
2
;
.
cr
-
cell__title
{
...
...
@@ -80,6 +102,44 @@ export default {
&-
field
{
text
-
indent
:
-
2
px
;
}
&
__list
{
// display: none;
position
:
absolute
;
top
:
50
px
;
left
:
-
@
padding
-
lg
;
right
:
-
@
padding
-
lg
;
z
-
index
:
3
;
background
-
color
:
@
white
;
box
-
shadow
:
0
px
7
px
12
px
0
px
rgba
(
0
,
0
,
0
,
0.1
);
&
.
show
{
display
:
block
;
}
&-
item
{
display
:
flex
;
align
-
items
:
center
;
padding
:
@
padding
-
lg
/
2
@
padding
-
lg
;
.
phone
{
color
:
@
text
-
color
;
.
text
-
14
();
margin
-
right
:
@
padding
-
xs
;
}
.
phone
-
home
{
color
:
@
text
-
color
;
.
text
-
12
();
max
-
width
:
180
px
;
display
:
-
webkit
-
box
;
-
webkit
-
box
-
orient
:
vertical
;
-
webkit
-
line
-
clamp
:
1
;
flex
-
shrink
:
0
;
overflow
:
hidden
;
}
.
current
{
color
:
@
text
-
grey
;
.
text
-
10
();
margin
-
left
:
auto
;
}
}
}
}
}
<
/style
>
src/views/home/components/RechargeList.vue
View file @
ebe2eb93
...
...
@@ -54,11 +54,12 @@ export default {
this
.
phoneRecharge
[
`
${
name
}
SpuNo`
],
this
.
phoneRecharge
[
`
${
name
}
Type`
]
);
this
.
$emit
(
'
changeRechargetype
'
,
name
);
this
.
rechargeList
[
name
]
=
data
?.
rechargeList
||
[];
},
handleSkuSelected
(
item
)
{
this
.
selectedRechargeInfo
=
item
;
this
.
$emit
(
'
selectedRecharge
'
,
item
);
this
.
$emit
(
'
selectedRecharge
'
,
{
rechargeInfo
:
item
}
);
}
}
};
...
...
src/views/home/components/RechargeTop.vue
View file @
ebe2eb93
...
...
@@ -20,6 +20,8 @@
</div>
</
template
>
<
script
>
import
{
getTokenFromNative
}
from
'
@/service/utils.service
'
;
import
localStorage
from
'
@/service/localStorage.service
'
;
export
default
{
props
:
{
value
:
Array
...
...
@@ -43,7 +45,11 @@ export default {
}
});
},
goOrderList
()
{
async
goOrderList
()
{
const
token
=
localStorage
.
get
(
'
vccToken
'
);
if
(
!
token
)
{
await
getTokenFromNative
();
}
this
.
$router
.
push
({
name
:
'
orderList
'
});
}
}
...
...
src/views/home/index.less
View file @
ebe2eb93
...
...
@@ -13,4 +13,10 @@
.text-18();
}
}
.slowRechargeTip{
.text-12();
color: @gray-4;
text-align: center;
margin-bottom: @padding-sm;
}
}
\ No newline at end of file
src/views/home/index.vue
View file @
ebe2eb93
...
...
@@ -2,8 +2,19 @@
<div
class=
"home"
>
<RechargeTop
v-model=
"vipLife"
/>
<div
class=
"center"
>
<RechargeInput
v-model=
"rechargePhoneInfo"
:user-phone-info=
"userPhoneInfo"
/>
<RechargeList
:phone-recharge=
"phoneRecharge"
@
selectedRecharge=
"selectedRecharge"
/>
<RechargeInput
v-model=
"rechargePhoneInfo"
:user-phone-info=
"userPhoneInfo"
:list=
"historyRecordList"
/>
<RechargeList
:phone-recharge=
"phoneRecharge"
@
selectedRecharge=
"selectedRecharge"
@
changeRechargetype=
"rechargeType = $event"
/>
<p
v-if=
"rechargeType === 'slowRecharge'"
class=
"slowRechargeTip"
>
充值后预计最迟48小时内到账,请耐心等待
</p>
<cr-button
block
type=
"primary"
...
...
@@ -24,6 +35,7 @@ import RechargeTop from './components/RechargeTop.vue';
import
RechargeList
from
'
./components/RechargeList.vue
'
;
import
RechargeInput
from
'
./components/RechargeInput.vue
'
;
import
localStorage
from
'
@/service/localStorage.service
'
;
import
{
getTokenFromNative
,
throttle
}
from
'
@/service/utils.service
'
;
const
{
getSpuList
}
=
api
;
export
default
{
components
:
{
...
...
@@ -37,7 +49,8 @@ export default {
rechargeAmount
:
0
,
phoneRecharge
:
{
}
,
userPhoneInfo
:
{
}
,
rechargeType
:
null
,
rechargeType
:
'
recharge
'
,
historyRecordList
:
[{
}
,
{
}
],
rechargePhoneInfo
:
{
}
,
selectedRechargeInfo
:
{
}
}
;
...
...
@@ -47,7 +60,9 @@ export default {
return
this
.
rechargePhoneInfo
.
phoneNo
&&
this
.
selectedRechargeInfo
.
salePrice
;
}
}
,
created
()
{
}
,
created
()
{
this
.
goOrder
=
throttle
.
call
(
this
,
this
.
goOrderApi
,
1000
);
}
,
async
mounted
()
{
const
[
data
]
=
await
getSpuList
();
if
(
data
)
{
...
...
@@ -59,13 +74,21 @@ export default {
}
}
,
methods
:
{
selectedRecharge
(
item
)
{
this
.
selectedRechargeInfo
=
item
;
throttle
,
selectedRecharge
({
rechargeInfo
}
)
{
this
.
selectedRechargeInfo
=
rechargeInfo
;
}
,
async
goOrder
()
{
async
goOrderApi
()
{
/* 需要加防抖 */
const
{
skuNo
,
salePrice
}
=
this
.
selectedRechargeInfo
;
const
token
=
localStorage
.
get
(
'
vccToken
'
);
if
(
!
token
)
{
await
getTokenFromNative
();
}
const
[
res
]
=
await
orderApi
.
orderCreate
({
totalFee
:
salePrice
,
terminal
:
'
H5
'
,
account
:
this
.
rechargePhoneInfo
.
phoneNo
,
registrationLocation
:
this
.
rechargePhoneInfo
.
phoneNoHome
,
virtualRechargeType
:
this
.
phoneRecharge
[
`${this.rechargeType
}
Type`
],
skuList
:
[
...
...
src/views/orderList/components/ListItem.vue
View file @
ebe2eb93
...
...
@@ -12,7 +12,7 @@
<div
v-if=
"it.count"
class=
"Ol__body-row"
>
<span
class=
"Ol__body-count"
>
{{
it
.
count
}}
件
</span>
</div>
<div
class=
"Ol__body-skus"
>
<div
v-if=
"it.virtualChargeAttrs"
class=
"Ol__body-skus"
>
<div
v-if=
"it.virtualChargeAttrs.account"
class=
"Ol__body-sku"
>
<span>
充值帐户:
</span>
<span
class=
"Ol__body-val"
>
{{
it
.
virtualChargeAttrs
.
account
}}
</span>
...
...
src/views/orderList/index.vue
View file @
ebe2eb93
...
...
@@ -44,22 +44,22 @@ export default {
...
JSON
.
parse
(
JSON
.
stringify
(
commonParams
))
},
{
state
:
1
,
state
:
1
1
,
title
:
'
待付款
'
,
...
JSON
.
parse
(
JSON
.
stringify
(
commonParams
))
},
{
state
:
2
,
state
:
2
1
,
title
:
'
待发货
'
,
...
JSON
.
parse
(
JSON
.
stringify
(
commonParams
))
},
{
state
:
3
,
state
:
3
1
,
title
:
'
待收货
'
,
...
JSON
.
parse
(
JSON
.
stringify
(
commonParams
))
},
{
state
:
4
,
state
:
4
1
,
title
:
'
已完成
'
,
...
JSON
.
parse
(
JSON
.
stringify
(
commonParams
))
}
...
...
@@ -118,7 +118,7 @@ export default {
if
(
finished
)
return
;
this
.
setNavListData
(
'
loading
'
,
true
);
const
[
res
]
=
await
orderApi
.
orderList
({
page
,
page
No
:
page
,
pageSize
,
orderStatus
});
...
...
src/views/pay/STATIC_DATA.js
View file @
ebe2eb93
...
...
@@ -71,7 +71,7 @@ function isDetentionFn() {
this
.
creditPayList
.
isGroupPay
)
{
this
.
$dialog
({
message
:
'
使用组合支付部分金额可免
洗
使用40天哦!
'
,
message
:
'
使用组合支付部分金额可免
息
使用40天哦!
'
,
confirmButtonText
:
'
组合支付
'
,
cancelButtonText
:
'
继续支付
'
,
confirmButtonColor
:
'
#EC1500
'
,
...
...
@@ -96,7 +96,7 @@ function isDetentionFn() {
!
this
.
creditPayList
.
isGroupPay
)
{
this
.
$dialog
({
message
:
'
使用享花卡支付可免
洗
使用40天哦
'
,
message
:
'
使用享花卡支付可免
息
使用40天哦
'
,
confirmButtonText
:
'
享花卡支付
'
,
cancelButtonText
:
'
继续支付
'
,
confirmButtonColor
:
'
#EC1500
'
,
...
...
src/views/pay/components/Contract.vue
View file @
ebe2eb93
...
...
@@ -49,14 +49,7 @@ export default {
align-items: flex-start;
color: @gray-5;
.text-10;
&-checkbox {
// margin-right: 2px;
// height: 14px;
}
&-list {
display: inline-flex;
justify-content: flex-start;
flex-wrap: wrap;
color: @gray-5;
span {
color: @red;
...
...
src/views/pay/components/PayCardItem.vue
View file @
ebe2eb93
...
...
@@ -18,9 +18,6 @@
</div>
<p>
{{
value
.
accountStatusDesc
}}
</p>
</div>
<!--
<p
v-if=
"isGroupPay && value.mergePayPretreatmentInfo"
class=
"content-info-amount"
>
{{
value
.
mergePayPretreatmentInfo
&&
value
.
mergePayPretreatmentInfo
.
creditPayAmt
}}
.00
</p>
-->
</div>
<div
v-if=
"showCoupon && value.payType === 1"
...
...
src/views/pay/index.vue
View file @
ebe2eb93
<
template
>
<div
class=
"pay"
>
<!-- 支付倒计时 -->
<div
class=
"price-box"
>
<p
class=
"price"
>
{{
displayInfo
.
orderAmt
}}
100
</p>
<div
v-if=
"success"
class=
"price-box"
>
<p
class=
"price"
>
{{
displayInfo
.
orderAmt
}}
</p>
<p
v-if=
"!overtime"
class=
"time"
>
支付剩余时间:
<cr-count-down
:time=
"displayInfo.periodSeconds"
@
finish=
"timeup"
/>
...
...
@@ -12,6 +12,7 @@
<!-- 推荐信用支付 -->
<cr-pay-card
v-if=
"getObjectKey(creditPayList.payList).length"
v-model=
"creditPayList"
:pay-type=
"payType"
:disabled=
"overtime"
...
...
@@ -25,6 +26,7 @@
<!-- 其他支付方式 -->
<cr-pay-card
v-if=
"getObjectKey(thirdPayList.payList).length"
v-model=
"thirdPayList"
:pay-type=
"payType"
:disabled=
"overtime"
...
...
@@ -54,7 +56,7 @@
</cr-button>
</p>
<p
v-if=
"overtime"
class=
"btn"
>
<cr-button
type=
"default"
class=
"btn-default"
@
click=
"goOrderDetail"
>
查看
订单
</cr-button>
<cr-button
type=
"default"
class=
"btn-default"
@
click=
"goOrderDetail"
>
我的
订单
</cr-button>
<cr-button
type=
"primary"
class=
"btn-primary"
@
click=
"goHome"
>
返回商城
</cr-button>
</p>
<p
class=
"placeholder"
/>
...
...
@@ -98,16 +100,14 @@ import { isWechat } from '@/service/validation.service';
import
{
encryptByDESModeEBC
}
from
'
@/service/encrypt
'
;
import
{
registeredEvents
}
from
'
@/service/sa.service
'
;
import
localStorage
from
'
@/service/localStorage.service
'
;
import
{
throttle
}
from
'
@/service/utils.service
'
;
import
{
status
,
codeArr
,
payTypeE
,
PAY_PAYING
,
CREDIT_PAY
,
WECHAT_PAY
,
ALIPAY_PAY
,
PAY_SUCCESS
,
payTypeText
,
creditStatus
,
IS_THIRD_PAY
,
IS_GROUP_PAY
,
...
...
@@ -148,12 +148,13 @@ export default {
error
:
''
,
random
:
''
,
orderNo
:
''
,
success
:
false
,
payType
:
null
,
isReady
:
false
,
overtime
:
false
,
pwdModal
:
false
,
smsModal
:
false
,
showCoupon
:
tru
e
,
showCoupon
:
fals
e
,
flowOrderNo
:
null
,
couponPopup
:
false
,
showGoFaceTip
:
false
,
// h5支付活体提示怎么处理
...
...
@@ -218,6 +219,12 @@ export default {
if
(
error
)
return
;
this
.
isReady
=
true
;
const
{
displayInfo
=
{},
payMethods
}
=
data
||
{};
this
.
overtime
=
displayInfo
.
periodSeconds
<=
0
;
this
.
success
=
true
;
if
(
this
.
overtime
)
{
this
.
displayInfo
.
orderAmt
=
displayInfo
.
orderAmt
;
return
;
}
if
(
displayInfo
.
payCouponInfo
&&
displayInfo
.
payCouponInfo
.
optimalPayCoupon
)
{
this
.
selectedCoupon
=
displayInfo
.
payCouponInfo
.
optimalPayCoupon
;
this
.
showCoupon
=
displayInfo
.
payCouponInfo
.
optimalType
===
3
;
...
...
@@ -274,7 +281,7 @@ export default {
this
.
displayInfo
=
displayInfo
||
{};
this
.
creditPayInfo
=
displayInfo
.
creditPayInfo
||
{};
this
.
overtime
=
displayInfo
.
periodSeconds
<=
0
;
displayInfo
.
periodSeconds
=
displayInfo
.
periodSeconds
*
100
0
;
this
.
getBtnStatus
(
this
.
isRiskLimit
());
},
checkStatus
({
accountStatus
,
canAmt
},
{
orderAmt
})
{
...
...
@@ -333,7 +340,7 @@ export default {
};
}
}
else
{
const
txt
=
`确认
付款
`
;
const
txt
=
`确认
支付
`
;
this
.
accountS
=
{
text
:
txt
,
fn
:
this
.
pay
...
...
@@ -353,40 +360,10 @@ export default {
}
});
}
this
.
payCouponList
=
[
{
id
:
33
,
name
:
'
仅新用户购买自营商品
'
,
startDate
:
'
2020.8.6
'
,
endDate
:
'
2021.8.16
'
,
faceValue
:
200
,
limitAmount
:
'
满99元可用
'
,
couponCategory
:
1
,
iconUrl
:
'
http://talos-image-fe.liangkebang.net/pcm/1599553158123.png
'
,
pickupAble
:
1
},
{
id
:
44
,
name
:
'
仅新用户购买自营商品
'
,
startDate
:
'
2020.8.6
'
,
endDate
:
'
2021.8.16
'
,
faceValue
:
200
,
limitAmount
:
'
满99元可用
'
,
couponCategory
:
1
,
iconUrl
:
'
http://talos-image-fe.liangkebang.net/pcm/1599553158123.png
'
,
pickupAble
:
1
}
];
},
nextAction
()
{
registeredEvents
(
'
PD_YXMMACP_UserClickCashierConfirmPaymentBtn
'
,
{
order_id
:
this
.
orderNo
,
pay_method
:
payTypeText
[
this
.
payType
-
1
],
vcc_state
:
status
[
this
.
creditPayInfo
.
accountStatus
-
1
],
buttons_name
:
this
.
accountS
.
text
});
nextAction
:
throttle
(
function
()
{
this
.
accountS
.
fn
();
},
},
1000
),
/* 预支付 */
async
pay
(
params
)
{
// 组合支付的提示和享花卡支付逻辑
...
...
@@ -405,6 +382,8 @@ export default {
}
const
paramsData
=
{
...
params
,
quitUrl
:
`
${
window
.
location
.
origin
}
/payWaiting`
,
returnUrl
:
`
${
window
.
location
.
origin
}
/payWaiting`
,
ocrAuth
:
{
isH5
:
true
},
...
...
@@ -437,14 +416,14 @@ export default {
payByWay
(
'
ALIWEB
'
,
aliPayInfo
);
return
;
}
// if (creditPayStatus === PAY_PAYING) {
// /* 支付中? */
// this.payResult('Waiting');
// return;
// }
console
.
log
(
creditPayStatus
);
if
(
creditPayStatus
===
PAY_SUCCESS
)
{
if
(
IS_GROUP_PAY
(
this
.
payType
))
{
//组合支付成功后跳转支付中
this
.
payResult
(
'
Waiting
'
);
return
;
}
/* 支付成功 */
this
.
close
();
this
.
payResult
(
'
Success
'
);
return
;
}
...
...
@@ -461,12 +440,12 @@ export default {
},
payResult
(
type
,
error
)
{
const
finalAmt
=
this
.
payType
===
WECHAT_PAY
||
!
this
.
showCoupon
IS_THIRD_PAY
(
this
.
payType
)
||
!
this
.
showCoupon
?
this
.
displayInfo
.
orderAmt
||
'
0.00
'
:
(
this
.
displayInfo
.
orderAmt
-
this
.
selectedCoupon
.
faceValue
||
0
).
toFixed
(
2
);
const
freeAmount
=
this
.
showCoupon
?
this
.
selectedCoupon
.
faceValue
||
'
0.00
'
:
'
0.00
'
;
/* 跳转支付结果页面 */
this
.
$router
.
push
({
this
.
$router
.
replace
({
name
:
`pay
${
type
}
`
,
query
:
{
freeAmount
,
...
...
@@ -531,7 +510,7 @@ export default {
return
;
}
const
[{
url
}]
=
await
h5AppyUrl
();
if
(
url
)
return
;
if
(
!
url
)
return
;
window
.
location
.
href
=
url
;
},
async
getKaGetNextUrl
()
{
...
...
@@ -563,16 +542,20 @@ export default {
},
/* 忘记密码 */
retrieveLink
()
{
const
url
=
`
${
this
.
creditPayInfo
.
forgetPwdJumpUrl
}
&vccChannel=
${
VCC_CHANNEL
}
`
;
let
url
=
`
${
this
.
creditPayInfo
.
forgetPwdJumpUrl
}
&vccChannel=
${
VCC_CHANNEL
}
&redirectUrl=
${
window
.
location
.
href
}
`
;
url
=
url
.
replace
(
'
{token}
'
,
localStorage
.
get
(
'
vccToken
'
));
window
.
location
.
href
=
url
;
},
goHome
()
{
// 商城地址
this
.
$router
.
push
({
name
:
'
home
'
});
this
.
$router
.
replace
({
name
:
'
home
'
});
},
goOrderDetail
()
{
this
.
$router
.
push
({
name
:
'
orderList
'
});
this
.
$router
.
replace
({
name
:
'
orderList
'
});
// 订单详情地址
},
getObjectKey
(
obj
)
{
return
Object
.
keys
(
obj
);
}
}
};
...
...
src/views/pay/payResult.vue
View file @
ebe2eb93
...
...
@@ -60,7 +60,6 @@ export default {
created
()
{
const
{
amount
,
orderNo
,
freeAmount
,
reason
}
=
this
.
$route
.
query
;
const
{
success
}
=
this
.
$route
.
meta
;
console
.
log
(
this
.
$route
.
meta
);
this
.
money
=
amount
;
this
.
orderNo
=
orderNo
;
this
.
reason
=
reason
||
''
;
...
...
@@ -77,13 +76,13 @@ export default {
order_id
:
this
.
orderNo
});
// 去订单详情页面
this
.
$router
.
push
({
name
:
'
orderList
'
});
this
.
$router
.
replace
({
name
:
'
orderList
'
});
},
goPay
()
{
registeredEvents
(
'
PD_YXMMAEC_UserClickCashierPaymentAgainBtn
'
,
{
order_id
:
this
.
orderNo
});
this
.
$router
.
push
({
name
:
'
pay
'
,
query
:
{
order
:
this
.
orderNo
}
});
this
.
$router
.
replace
({
name
:
'
pay
'
,
query
:
{
orderNo
:
this
.
orderNo
}
});
}
}
};
...
...
src/views/pay/payWaiting.vue
View file @
ebe2eb93
...
...
@@ -39,31 +39,38 @@ export default {
this
.
orderNo
=
orderNo
;
},
mounted
()
{
this
.
timer
=
setInterval
(()
=>
{
// eslint-disable-next-line space-before-function-paren
this
.
timer
=
setInterval
(
async
()
=>
{
this
.
time
-=
1
;
if
(
this
.
time
%
2
===
0
)
{
queryPayStatus
({
orderNo
:
this
.
orderNo
});
const
[
data
]
=
await
queryPayStatus
({
orderNo
:
this
.
orderNo
});
if
(
data
.
payStatus
===
3
)
{
this
.
goPay
();
}
// 结果处理,如果未支付弹窗提示是否支付成功,跳转支付中页面
}
if
(
this
.
time
<
1
)
{
clearInterval
(
this
.
timer
);
}
},
2000
);
},
beforeDestroy
()
{
clearInterval
(
this
.
timer
);
},
methods
:
{
goHome
()
{
// 去页面
this
.
$router
.
replace
({
name
:
'
home
'
});
},
goOrderDetail
()
{
registeredEvents
(
'
PD_YXMMAEC_UserClickCashierCheckOrderBtn
'
,
{
order_id
:
this
.
orderNo
});
this
.
$router
.
replace
({
name
:
'
orderDetail
'
,
query
:
{
order
:
this
.
orderNo
}
});
// 去订单详情页面
},
goPay
()
{
registeredEvents
(
'
PD_YXMMAEC_UserClickCashierPaymentAgainBtn
'
,
{
order_id
:
this
.
orderNo
});
this
.
$router
.
push
({
name
:
'
pay
'
,
query
:
{
order
:
this
.
orderNo
}
});
this
.
$router
.
replace
({
name
:
'
pay
'
,
query
:
{
order
:
this
.
orderNo
}
});
}
}
};
...
...
src/views/vipLife/components/SpuList.vue
View file @
ebe2eb93
...
...
@@ -25,7 +25,7 @@ export default {
type
:
Array
,
default
:
()
=>
[
{
spuNo
:
''
,
spuNo
s
:
''
,
icon
:
''
,
name
:
''
}
...
...
src/views/vipLife/index.less
View file @
ebe2eb93
...
...
@@ -34,7 +34,7 @@
position: fixed;
bottom: 0;
left: 0;
z-index:
2
;
z-index:
9
;
right: 0;
width: calc(100% - @padding-sm * 2);
background-color: @white;
...
...
src/views/vipLife/index.vue
View file @
ebe2eb93
...
...
@@ -19,11 +19,12 @@
<div
class=
"Vl__panel-tips"
v-html=
"tips"
/>
</
template
>
</div>
<div
v-if=
"!hideFixedBottom"
class=
"Vl__bottom"
>
<div
class=
"Vl__bottom"
>
<cr-button
type=
"primary"
block
shape=
"circle"
:disabled=
"disabled"
@
click=
"goOrder"
>
立即充值
</cr-button>
</div>
<!-- v-show="!hideFixedBottom" -->
</div>
</template>
<
script
>
...
...
@@ -34,6 +35,7 @@ import tipsData from '@/api/tips';
import
SpuList
from
'
./components/SpuList.vue
'
;
import
SkuList
from
'
./components/SkuList.vue
'
;
import
AccountInput
from
'
./components/AccountInput.vue
'
;
import
{
throttle
}
from
'
@/service/utils.service
'
;
export
default
{
name
:
'
VipLife
'
,
components
:
{
...
...
@@ -56,7 +58,7 @@ export default {
},
computed
:
{
disabled
()
{
return
this
.
spuInfo
.
rechargeAccountType
!==
2
&&
!
this
.
account
;
return
(
this
.
spuInfo
.
rechargeAccountType
!==
2
&&
!
this
.
account
)
||
!
this
.
skuList
.
length
;
},
spuList
()
{
return
this
.
spuData
[
this
.
currentTab
-
1
]
?
this
.
spuData
[
this
.
currentTab
-
1
].
itemList
:
[];
...
...
@@ -82,6 +84,7 @@ export default {
methods
:
{
handleTabChange
(
name
)
{
this
.
currentTab
=
name
;
this
.
skuInfo
=
{};
this
.
updateSpuInfo
(
this
.
spuData
[
this
.
currentTab
-
1
].
itemList
[
0
]);
this
.
getSkuListDebounce
();
},
...
...
@@ -122,16 +125,15 @@ export default {
}
this
.
showLoading
=
false
;
},
async
goOrder
()
{
goOrder
:
throttle
(
async
function
()
{
if
(
!
this
.
account
&&
this
.
spuInfo
.
rechargeAccountType
!==
2
)
return
this
.
$toast
.
fail
(
'
请填写账号!
'
);
if
(
!
this
.
skuInfo
.
skuNo
)
return
this
.
$toast
.
fail
(
'
请选择类型!
'
);
const
{
skuNo
,
salePrice
}
=
this
.
skuInfo
;
const
[
res
]
=
await
orderApi
.
orderCreate
({
account
:
this
.
account
,
totalFee
:
salePrice
,
orderCouponIds
:
''
,
freightCouponIds
:
''
,
virtualRechargeType
:
this
.
spuInfo
.
rechargeAccountType
,
virtualRechargeType
:
this
.
spuInfo
.
type
,
skuList
:
[
{
skuNo
,
...
...
@@ -140,7 +142,7 @@ export default {
]
});
res
&&
this
.
$router
.
push
({
path
:
'
/pay
'
,
query
:
{
orderNo
:
res
.
orderNo
}
});
}
}
,
1000
)
}
};
</
script
>
...
...
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