Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
singleStore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Max
singleStore
Commits
05a96ae7
Commit
05a96ae7
authored
Apr 14, 2022
by
伍啸山
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【金山文档】 格利食品网全站(PC、格利食品+、专属小程序)货到付款开启设置需求v1.0.0
https://kdocs.cn/l/cn5uIUwReD4E
需求提交
parent
6b802fae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
10 deletions
+34
-10
apis/order.js
apis/order.js
+14
-0
pages/order/confirm-order.vue
pages/order/confirm-order.vue
+20
-10
No files found.
apis/order.js
View file @
05a96ae7
...
...
@@ -198,4 +198,18 @@ export function safeOrigin(og_id) {
},
needMask
:
true
})
}
/**
* @desc 判断是否可以货到付款
* @param { Number } shop_id 商家id
*/
export
function
isSupportCashOnDelivery
(
shop_id
)
{
return
request
({
url
:
'
wxxcx/getShopCashIsUse.htm
'
,
method
:
'
post
'
,
data
:
{
shop_id
},
})
}
\ No newline at end of file
pages/order/confirm-order.vue
View file @
05a96ae7
...
...
@@ -108,12 +108,12 @@
</view>
<view>
<view
class=
"mt-3"
>
选择支付方式
</view>
<view
class=
"pay-item p
t
-3"
@
click=
"handlePayWay(form.goods_before_pay)"
>
<view
class=
"pay-item p
y
-3"
@
click=
"handlePayWay(form.goods_before_pay)"
>
<view>
在线支付
</view>
<view
:class=
"!form.goods_before_pay ? 'select' : 'unselect'"
></view>
</view>
<view
class=
"pay-item p
y-3"
@
click=
"handlePayWay(form.goods_before_pay)
"
>
<view>
先货后
款
</view>
<view
class=
"pay-item p
b-3"
@
click=
"handlePayWay(form.goods_before_pay)"
v-if=
"isSupportCOD==1
"
>
<view>
货到付
款
</view>
<view
:class=
"form.goods_before_pay ? 'select' : 'unselect'"
></view>
</view>
</view>
...
...
@@ -152,7 +152,7 @@
</
script
>
<
script
>
import
{
preConfirmOrderData
,
confirmOrder
}
from
'
@/apis/order.js
'
import
{
preConfirmOrderData
,
confirmOrder
,
isSupportCashOnDelivery
}
from
'
@/apis/order.js
'
import
{
makePhoneCall
}
from
'
@/utils/common.js
'
import
{
baseUrl
}
from
'
@/config/index.js
'
import
Validator
from
'
@/utils/validate.js
'
...
...
@@ -170,14 +170,15 @@ export default {
form
:
{
from
:
6
,
// 来源:6专属小程序
buy_type
:
0
,
//购买类型:0默认加入购物车 1立即购买
goods_before_pay
:
0
,
// 是否为
先货后
款:0否 1是
goods_before_pay
:
0
,
// 是否为
货到付
款:0否 1是
sku_ids
:
''
,
// SKUIDs,多个则使用逗号分隔(buy_type=1时必填)
shipping_type
:
1
,
// 配送类型1格利冷运2第三方(自提)
address_id
:
''
,
// 收货地址ID(shipping_type=1时必填)
cart_ids
:
''
,
// 选中的购物车IDs,多个则使用逗号分隔(buy_type=0时必填)
postscript
:
''
,
// 订单附言,由用户提交订单前填写
cart_numbers
:
''
// 购买数量s,多个则使用逗号分隔(buy_type=1时必填)
}
},
isSupportCOD
:
0
,
//判读是否支持货到付款(0不支持,1支持)
}
},
...
...
@@ -231,8 +232,10 @@ export default {
try
{
const
{
status
,
data
}
=
await
preConfirmOrderData
(
params
)
if
(
status
)
{
this
.
orderDetail
=
data
this
.
form
.
address_id
=
data
.
address
.
address_id
||
''
let
shop_id
=
data
.
shop
.
shop_id
;
this
.
supportCashOnDelivery
(
shop_id
);
this
.
orderDetail
=
data
;
this
.
form
.
address_id
=
data
.
address
.
address_id
||
''
;
}
else
{
uni
.
navigateBack
()
}
...
...
@@ -241,7 +244,14 @@ export default {
//TODO handle the exception
}
},
// 获取判断商家是否支持货到付款
async
supportCashOnDelivery
(
shop_id
){
const
{
code
,
data
}
=
await
isSupportCashOnDelivery
(
shop_id
);
this
.
isSupportCOD
=
data
;
},
// 提交订单
async
handleConfirm
()
{
try
{
...
...
@@ -292,7 +302,7 @@ export default {
}
else
if
(
this
.
form
.
goods_before_pay
===
1
)
{
return
this
.
$modal
({
title
:
'
提示
'
,
content
:
'
订单包含
先货后
款商品,需商户确认下单,是否继续下单?
'
,
content
:
'
订单包含
货到付
款商品,需商户确认下单,是否继续下单?
'
,
cb
:
()
=>
{
this
.
confirm2Order
(
form
,
()
=>
{
uni
.
redirectTo
({
...
...
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