Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bh_face_counter
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
黄天晨
bh_face_counter
Commits
c25de083
Commit
c25de083
authored
Aug 07, 2020
by
zeven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复无码商品无法扫码支付
parent
ed07bc6e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
22 deletions
+20
-22
CounterMixins.js
src/pages/CounterMixins.js
+20
-22
No files found.
src/pages/CounterMixins.js
View file @
c25de083
...
...
@@ -125,23 +125,16 @@ const CounterMixins = ComposeComponent => {
let
totalCount
=
this
.
totalCount
;
if
(
type
===
'waiting'
)
{
// 客户端等待,响应购物车列表
const
{
goodsArr
}
=
this
.
state
;
const
goods
=
{};
this
.
token
=
token
;
goodsArr
.
map
(({
barcode
,
num
})
=>
{
if
(
!
goods
[
barcode
])
{
goods
[
barcode
]
=
num
;
}
else
{
goods
[
barcode
]
+=
num
;
}
});
const
{
ids
,
noBarcode
}
=
this
.
getGoods
();
window
.
socket
.
emit
(
'counterGoods'
,
sid
,
JSON
.
stringify
(
goo
ds
),
JSON
.
stringify
(
i
ds
),
totalPrice
,
totalCount
,
payType
,
JSON
.
stringify
(
noBarcode
),
);
}
else
if
(
type
===
'fail'
)
{
// 下单失败
...
...
@@ -474,18 +467,7 @@ const CounterMixins = ComposeComponent => {
}
};
// 付款码支付
barcodepay
=
async
(
code
,
facepay
)
=>
{
if
(
this
.
barcodeBusy
)
{
return
true
;
}
const
isWxpay
=
code
.
toString
().
match
(
/1
[
0-5
]\d{16}
/
);
const
isAlipay
=
code
.
toString
().
match
(
/^
(
2
[
5-9
]
|30
)\d{14,22}
$/
);
if
(
!
isWxpay
&&
!
isAlipay
)
{
return
false
;
}
this
.
barcodeBusy
=
true
;
let
successPay
=
false
;
getGoods
=
()
=>
{
const
{
goodsArr
}
=
this
.
state
;
const
ids
=
{};
const
noBarcode
=
[];
...
...
@@ -508,6 +490,22 @@ const CounterMixins = ComposeComponent => {
});
}
});
return
{
ids
,
noBarcode
};
};
// 付款码支付
barcodepay
=
async
(
code
,
facepay
)
=>
{
if
(
this
.
barcodeBusy
)
{
return
true
;
}
const
isWxpay
=
code
.
toString
().
match
(
/1
[
0-5
]\d{16}
/
);
const
isAlipay
=
code
.
toString
().
match
(
/^
(
2
[
5-9
]
|30
)\d{14,22}
$/
);
if
(
!
isWxpay
&&
!
isAlipay
)
{
return
false
;
}
this
.
barcodeBusy
=
true
;
let
successPay
=
false
;
const
{
ids
,
noBarcode
}
=
this
.
getGoods
();
const
res
=
await
this
.
props
.
dispatch
({
type
:
'goods/barcodepay'
,
ids
,
...
...
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