Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-miniapp-eshop
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yyq
7 years ago
Commit
6395a1ed5a13ffbaa1393b7fc556d42d2692dace
1 parent
1a6f0256
app type
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
10 deletions
app/ext.json
app/pages/cart/cart.js
app/pages/cart/ensure/ensure.js
app/project.config.json
app/utils/wechat-pay.js
app/ext.json
View file @
6395a1e
...
...
@@ -13,4 +13,4 @@
]
}
}
}
\ No newline at end of file
}
...
...
app/pages/cart/cart.js
View file @
6395a1e
...
...
@@ -17,7 +17,7 @@ function _queryFromServiceAsync(fn) {
args
[
0
]
=
args
[
0
]
||
{};
Object
.
assign
(
args
[
0
],
{
uid
:
app
.
getUid
()
appType
:
app
.
getAppType
()
});
return
fn
(...
args
);
...
...
@@ -430,5 +430,5 @@ console.log(e);
}
});
},
...
Picker
.
pickerAction
...
Picker
.
pickerAction
// eslint-disable-line
});
...
...
app/pages/cart/ensure/ensure.js
View file @
6395a1e
...
...
@@ -18,6 +18,23 @@ const ORDER_TYPE = { // 结算订单类型
const
app
=
getApp
();
let
yas
;
function
_queryFromServiceAsync
(
fn
)
{
if
(
fn
)
{
let
args
=
[...
arguments
];
args
.
shift
();
args
[
0
]
=
args
[
0
]
||
{};
Object
.
assign
(
args
[
0
],
{
appType
:
app
.
getAppType
()
});
return
fn
(...
args
);
}
else
{
return
Promise
.
reject
();
}
}
function
formatPaymentData
(
data
,
yasInfo
)
{
data
=
data
||
{};
...
...
@@ -227,7 +244,7 @@ Page({
loadShoppingPayment
(
options
)
{
this
.
orderType
=
ORDER_TYPE
.
ORDINARY
;
return
ensureModel
.
shoppingPayment
(
{
return
_queryFromServiceAsync
(
ensureModel
.
shoppingPayment
,
{
cart_type
:
options
.
cartType
||
'ordinary'
,
yoho_coin_mode
:
0
}).
then
(
res
=>
{
...
...
@@ -247,7 +264,7 @@ Page({
Object
.
assign
(
this
.
orderData
,
data
);
}
return
ensureModel
.
shoppingCompute
(
{
return
_queryFromServiceAsync
(
ensureModel
.
shoppingCompute
,
{
cart_type
:
'ordinary'
,
payment_type
:
1
,
// 支付方式,1 在线支付 2 货到付款
delivery_way
:
this
.
orderData
.
deliveryWayId
,
// 快递方式,1 普通 2 加急
...
...
@@ -271,7 +288,7 @@ Page({
if
(
options
.
productSku
)
{
this
.
orderType
=
ORDER_TYPE
.
BUYNOW
;
ensureModel
.
buynowPayment
(
{
_queryFromServiceAsync
(
ensureModel
.
buynowPayment
,
{
sku_type
:
SKU_TYPE
,
product_sku
:
options
.
productSku
,
buy_number
:
options
.
buyNumber
||
1
,
...
...
@@ -311,7 +328,7 @@ Page({
Object
.
assign
(
this
.
orderData
,
data
);
}
ensureModel
.
buynowCompute
(
{
_queryFromServiceAsync
(
ensureModel
.
buynowCompute
,
{
cart_type
:
'ordinary'
,
sku_type
:
SKU_TYPE
,
product_sku
:
this
.
orderData
.
productSku
,
...
...
@@ -506,7 +523,7 @@ Page({
this
.
orderSubmiting
=
true
;
ensureModel
.
buynowSubmit
(
param
).
then
(
res
=>
{
_queryFromServiceAsync
(
ensureModel
.
buynowSubmit
,
param
).
then
(
res
=>
{
this
.
orderSubmiting
=
false
;
if
(
res
.
code
===
200
)
{
...
...
@@ -592,7 +609,7 @@ Page({
this
.
orderSubmiting
=
true
;
return
ensureModel
.
shoppingSubmit
(
param
).
then
(
res
=>
{
return
_queryFromServiceAsync
(
ensureModel
.
shoppingSubmit
,
param
).
then
(
res
=>
{
this
.
orderSubmiting
=
false
;
if
(
res
.
code
!==
200
)
{
...
...
app/project.config.json
View file @
6395a1e
...
...
@@ -52,4 +52,4 @@
]
}
}
}
}
\ No newline at end of file
...
...
app/utils/wechat-pay.js
View file @
6395a1e
...
...
@@ -79,6 +79,7 @@ function wechatPay(order) {
payModel
.
wechatPay
({
app_id
:
app
.
getAppId
(),
payment
:
app
.
getPaymentCode
(),
order_code
:
orderCode
,
payment_code
:
PAYMENT_CODE
,
'3rd_session'
:
wechatSession
...
...
Please
register
or
login
to post a comment