Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
64dd28ef
ShopXO
项目概览
starsw001
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
64dd28ef
编写于
11月 21, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
小程序支付0成功错误修复
上级
a32249f4
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
319 addition
and
268 deletion
+319
-268
application/service/OrderService.php
application/service/OrderService.php
+1
-1
application/tags.php
application/tags.php
+30
-0
sourcecode/alipay/default/pages/user-order/user-order.js
sourcecode/alipay/default/pages/user-order/user-order.js
+54
-50
sourcecode/baidu/default/pages/user-order/user-order.js
sourcecode/baidu/default/pages/user-order/user-order.js
+49
-45
sourcecode/qq/default/pages/user-order/user-order.js
sourcecode/qq/default/pages/user-order/user-order.js
+64
-60
sourcecode/toutiao/default/pages/user-order/user-order.js
sourcecode/toutiao/default/pages/user-order/user-order.js
+66
-61
sourcecode/weixin/default/app.js
sourcecode/weixin/default/app.js
+1
-1
sourcecode/weixin/default/pages/user-order/user-order.js
sourcecode/weixin/default/pages/user-order/user-order.js
+54
-50
未找到文件。
application/service/OrderService.php
浏览文件 @
64dd28ef
...
@@ -171,7 +171,7 @@ class OrderService
...
@@ -171,7 +171,7 @@ class OrderService
// 是否直接跳转
// 是否直接跳转
if
(
$success_count
>
0
&&
$success_count
==
count
(
$order_data
))
if
(
$success_count
>
0
&&
$success_count
==
count
(
$order_data
))
{
{
return
DataReturn
(
'支付成功'
,
0
,
[
'data'
=>
MyUrl
(
'index/order/respond'
,
[
'appoint_status'
=>
0
])]);
return
DataReturn
(
'支付成功'
,
0
,
[
'data'
=>
MyUrl
(
'index/order/respond'
,
[
'appoint_status'
=>
0
])
,
'is_success'
=>
1
]);
}
}
// 支付入口文件检查
// 支付入口文件检查
...
...
application/tags.php
浏览文件 @
64dd28ef
...
@@ -37,11 +37,13 @@ return array (
...
@@ -37,11 +37,13 @@ return array (
0
=>
'app\\plugins\\ordergoodsform\\Hook'
,
0
=>
'app\\plugins\\ordergoodsform\\Hook'
,
1
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
2
=>
'app\\plugins\\multilingual\\Hook'
,
2
=>
'app\\plugins\\multilingual\\Hook'
,
3
=>
'app\\plugins\\coupon\\Hook'
,
),
),
'plugins_js'
=>
'plugins_js'
=>
array
(
array
(
0
=>
'app\\plugins\\ordergoodsform\\Hook'
,
0
=>
'app\\plugins\\ordergoodsform\\Hook'
,
1
=>
'app\\plugins\\multilingual\\Hook'
,
1
=>
'app\\plugins\\multilingual\\Hook'
,
2
=>
'app\\plugins\\coupon\\Hook'
,
),
),
'plugins_view_goods_detail_base_inventory_top'
=>
'plugins_view_goods_detail_base_inventory_top'
=>
array
(
array
(
...
@@ -67,6 +69,7 @@ return array (
...
@@ -67,6 +69,7 @@ return array (
array
(
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\blog\\Hook'
,
1
=>
'app\\plugins\\blog\\Hook'
,
2
=>
'app\\plugins\\coupon\\Hook'
,
),
),
'plugins_service_goods_handle_end'
=>
'plugins_service_goods_handle_end'
=>
array
(
array
(
...
@@ -79,6 +82,7 @@ return array (
...
@@ -79,6 +82,7 @@ return array (
'plugins_service_buy_group_goods_handle'
=>
'plugins_service_buy_group_goods_handle'
=>
array
(
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\coupon\\Hook'
,
),
),
'plugins_service_user_login_success_record'
=>
'plugins_service_user_login_success_record'
=>
array
(
array
(
...
@@ -119,11 +123,13 @@ return array (
...
@@ -119,11 +123,13 @@ return array (
'plugins_service_users_center_left_menu_handle'
=>
'plugins_service_users_center_left_menu_handle'
=>
array
(
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\coupon\\Hook'
,
),
),
'plugins_service_header_navigation_top_right_handle'
=>
'plugins_service_header_navigation_top_right_handle'
=>
array
(
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\multilingual\\Hook'
,
1
=>
'app\\plugins\\multilingual\\Hook'
,
2
=>
'app\\plugins\\coupon\\Hook'
,
),
),
'plugins_common_page_bottom'
=>
'plugins_common_page_bottom'
=>
array
(
array
(
...
@@ -145,5 +151,29 @@ return array (
...
@@ -145,5 +151,29 @@ return array (
array
(
array
(
0
=>
'app\\plugins\\multilingual\\Hook'
,
0
=>
'app\\plugins\\multilingual\\Hook'
,
),
),
'plugins_view_goods_detail_panel_bottom'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_view_buy_group_goods_inside_bottom'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_view_buy_form_inside'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_buy_order_insert_success'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_order_status_change_history_success_handle'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_user_register_end'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
);
);
?>
?>
\ No newline at end of file
sourcecode/alipay/default/pages/user-order/user-order.js
浏览文件 @
64dd28ef
...
@@ -233,9 +233,7 @@ Page({
...
@@ -233,9 +233,7 @@ Page({
// 支付方法
// 支付方法
pay_handle
(
order_ids
)
{
pay_handle
(
order_ids
)
{
var
self
=
this
;
var
self
=
this
;
// 加载loding
my
.
showLoading
({
content
:
"
请求中...
"
});
my
.
showLoading
({
content
:
"
请求中...
"
});
my
.
request
({
my
.
request
({
url
:
app
.
get_request_url
(
"
pay
"
,
"
order
"
),
url
:
app
.
get_request_url
(
"
pay
"
,
"
order
"
),
method
:
"
POST
"
,
method
:
"
POST
"
,
...
@@ -248,57 +246,63 @@ Page({
...
@@ -248,57 +246,63 @@ Page({
success
:
res
=>
{
success
:
res
=>
{
my
.
hideLoading
();
my
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
if
(
res
.
data
.
code
==
0
)
{
// 支付方式类型
// 是否直接支付成功
switch
(
res
.
data
.
data
.
is_payment_type
)
{
if
((
res
.
data
.
data
.
is_success
||
0
)
==
1
)
{
// 正常线上支付
self
.
order_item_pay_success_handle
(
order_ids
);
case
0
:
app
.
showToast
(
'
支付成功
'
,
'
success
'
);
var
data
=
res
.
data
.
data
;
}
else
{
my
.
tradePay
({
// 支付方式类型
tradeNO
:
data
.
data
,
switch
(
res
.
data
.
data
.
is_payment_type
)
{
success
:
res
=>
{
// 正常线上支付
if
(
res
.
resultCode
==
9000
)
{
case
0
:
// 数据设置
var
data
=
res
.
data
.
data
;
self
.
order_item_pay_success_handle
(
order_ids
);
my
.
tradePay
({
tradeNO
:
data
.
data
,
// 跳转支付页面
success
:
res
=>
{
my
.
navigateTo
({
if
(
res
.
resultCode
==
9000
)
{
url
:
// 数据设置
"
/pages/paytips/paytips?code=9000
"
self
.
order_item_pay_success_handle
(
order_ids
);
});
}
else
{
// 跳转支付页面
app
.
showToast
(
'
支付失败
'
);
my
.
navigateTo
({
url
:
"
/pages/paytips/paytips?code=9000
"
});
}
else
{
app
.
showToast
(
'
支付失败
'
);
}
},
fail
:
res
=>
{
app
.
showToast
(
'
唤起支付模块失败
'
);
}
}
},
});
fail
:
res
=>
{
break
;
app
.
showToast
(
'
唤起支付模块失败
'
);
}
// 线下支付
});
case
1
:
break
;
var
order_ids_arr
=
order_ids
.
split
(
'
,
'
);
var
temp_data_list
=
self
.
data
.
data_list
;
// 线下支付
for
(
var
i
in
temp_data_list
)
case
1
:
var
order_ids_arr
=
order_ids
.
split
(
'
,
'
);
var
temp_data_list
=
self
.
data
.
data_list
;
for
(
var
i
in
temp_data_list
)
{
if
(
order_ids_arr
.
indexOf
(
temp_data_list
[
i
][
'
id
'
])
!=
-
1
)
{
{
temp_data_list
[
i
][
'
is_under_line
'
]
=
1
;
if
(
order_ids_arr
.
indexOf
(
temp_data_list
[
i
][
'
id
'
])
!=
-
1
)
{
temp_data_list
[
i
][
'
is_under_line
'
]
=
1
;
}
}
}
}
self
.
setData
({
data_list
:
temp_data_list
});
self
.
setData
({
data_list
:
temp_data_list
});
app
.
alert
({
msg
:
res
.
data
.
msg
,
is_show_cancel
:
0
});
app
.
alert
({
msg
:
res
.
data
.
msg
,
is_show_cancel
:
0
})
;
break
;
break
;
// 钱包支付
// 钱包支付
case
2
:
case
2
:
self
.
order_item_pay_success_handle
(
order_ids
);
self
.
order_item_pay_success_handle
(
order_ids
);
app
.
showToast
(
'
支付成功
'
,
'
success
'
);
app
.
showToast
(
'
支付成功
'
,
'
success
'
)
;
break
;
break
;
// 默认
// 默认
default
:
default
:
app
.
showToast
(
'
支付类型有误
'
);
app
.
showToast
(
'
支付类型有误
'
);
}
}
}
}
else
{
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
app
.
showToast
(
res
.
data
.
msg
);
...
...
sourcecode/baidu/default/pages/user-order/user-order.js
浏览文件 @
64dd28ef
...
@@ -229,9 +229,7 @@ Page({
...
@@ -229,9 +229,7 @@ Page({
// 支付方法
// 支付方法
pay_handle
(
order_ids
)
{
pay_handle
(
order_ids
)
{
var
self
=
this
;
var
self
=
this
;
// 加载loding
swan
.
showLoading
({
title
:
"
请求中...
"
});
swan
.
showLoading
({
title
:
"
请求中...
"
});
swan
.
request
({
swan
.
request
({
url
:
app
.
get_request_url
(
"
pay
"
,
"
order
"
),
url
:
app
.
get_request_url
(
"
pay
"
,
"
order
"
),
method
:
"
POST
"
,
method
:
"
POST
"
,
...
@@ -243,50 +241,56 @@ Page({
...
@@ -243,50 +241,56 @@ Page({
success
:
res
=>
{
success
:
res
=>
{
swan
.
hideLoading
();
swan
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
if
(
res
.
data
.
code
==
0
)
{
// 支付方式类型
// 是否直接支付成功
switch
(
res
.
data
.
data
.
is_payment_type
)
{
if
((
res
.
data
.
data
.
is_success
||
0
)
==
1
)
{
// 正常线上支付
self
.
order_item_pay_success_handle
(
order_ids
);
case
0
:
app
.
showToast
(
'
支付成功
'
,
'
success
'
);
var
data
=
res
.
data
.
data
;
}
else
{
swan
.
requestPolymerPayment
({
// 支付方式类型
orderInfo
:
data
.
data
,
switch
(
res
.
data
.
data
.
is_payment_type
)
{
success
:
function
(
res
)
{
// 正常线上支付
// 数据设置
case
0
:
self
.
order_item_pay_success_handle
(
order_ids
);
var
data
=
res
.
data
.
data
;
swan
.
requestPolymerPayment
({
// 跳转支付页面
orderInfo
:
data
.
data
,
swan
.
navigateTo
({
success
:
function
(
res
)
{
url
:
"
/pages/paytips/paytips?code=9000
"
// 数据设置
});
self
.
order_item_pay_success_handle
(
order_ids
);
},
fail
:
function
(
res
)
{
// 跳转支付页面
app
.
showToast
(
'
支付失败
'
);
swan
.
navigateTo
({
}
url
:
"
/pages/paytips/paytips?code=9000
"
});
});
break
;
},
fail
:
function
(
res
)
{
// 线下支付
app
.
showToast
(
'
支付失败
'
);
case
1
:
}
var
order_ids_arr
=
order_ids
.
split
(
'
,
'
);
});
var
temp_data_list
=
self
.
data
.
data_list
;
break
;
for
(
var
i
in
temp_data_list
)
{
if
(
order_ids_arr
.
indexOf
(
temp_data_list
[
i
][
'
id
'
])
!=
-
1
)
{
// 线下支付
temp_data_list
[
i
][
'
is_under_line
'
]
=
1
;
case
1
:
var
order_ids_arr
=
order_ids
.
split
(
'
,
'
);
var
temp_data_list
=
self
.
data
.
data_list
;
for
(
var
i
in
temp_data_list
)
{
if
(
order_ids_arr
.
indexOf
(
temp_data_list
[
i
][
'
id
'
])
!=
-
1
)
{
temp_data_list
[
i
][
'
is_under_line
'
]
=
1
;
}
}
}
}
self
.
setData
({
data_list
:
temp_data_list
});
self
.
setData
({
data_list
:
temp_data_list
});
app
.
alert
({
msg
:
res
.
data
.
msg
,
is_show_cancel
:
0
});
app
.
alert
({
msg
:
res
.
data
.
msg
,
is_show_cancel
:
0
})
;
break
;
break
;
// 钱包支付
// 钱包支付
case
2
:
case
2
:
self
.
order_item_pay_success_handle
(
order_ids
);
self
.
order_item_pay_success_handle
(
order_ids
);
app
.
showToast
(
'
支付成功
'
,
'
success
'
);
app
.
showToast
(
'
支付成功
'
,
'
success
'
)
;
break
;
break
;
// 默认
// 默认
default
:
default
:
app
.
showToast
(
'
支付类型有误
'
);
app
.
showToast
(
'
支付类型有误
'
);
}
}
}
}
else
{
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
app
.
showToast
(
res
.
data
.
msg
);
...
...
sourcecode/qq/default/pages/user-order/user-order.js
浏览文件 @
64dd28ef
...
@@ -232,9 +232,7 @@ Page({
...
@@ -232,9 +232,7 @@ Page({
// 支付方法
// 支付方法
pay_handle
(
order_ids
)
{
pay_handle
(
order_ids
)
{
var
self
=
this
;
var
self
=
this
;
// 加载loding
qq
.
showLoading
({
title
:
"
请求中...
"
});
qq
.
showLoading
({
title
:
"
请求中...
"
});
qq
.
request
({
qq
.
request
({
url
:
app
.
get_request_url
(
"
pay
"
,
"
order
"
),
url
:
app
.
get_request_url
(
"
pay
"
,
"
order
"
),
method
:
"
POST
"
,
method
:
"
POST
"
,
...
@@ -246,67 +244,73 @@ Page({
...
@@ -246,67 +244,73 @@ Page({
success
:
res
=>
{
success
:
res
=>
{
qq
.
hideLoading
();
qq
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
if
(
res
.
data
.
code
==
0
)
{
// 支付方式类型
// 是否直接支付成功
switch
(
res
.
data
.
data
.
is_payment_type
)
{
if
((
res
.
data
.
data
.
is_success
||
0
)
==
1
)
{
// 正常线上支付
self
.
order_item_pay_success_handle
(
order_ids
);
case
0
:
app
.
showToast
(
'
支付成功
'
,
'
success
'
);
var
data
=
res
.
data
.
data
;
}
else
{
// 是否微信支付
// 支付方式类型
if
(
data
.
payment
.
payment
==
'
Weixin
'
)
{
switch
(
res
.
data
.
data
.
is_payment_type
)
{
qq
.
requestWxPayment
({
// 正常线上支付
url
:
data
.
data
,
case
0
:
referer
:
app
.
data
.
request_url
,
var
data
=
res
.
data
.
data
;
success
:
function
(
res
)
{
// 是否微信支付
app
.
alert
({
msg
:
'
支付成功后、请不要重复支付、如果订单状态未成功请联系客服处理
'
,
is_show_cancel
:
0
});
if
(
data
.
payment
.
payment
==
'
Weixin
'
)
{
self
.
get_data_list
();
qq
.
requestWxPayment
({
},
url
:
data
.
data
,
fail
:
function
(
res
)
{
referer
:
app
.
data
.
request_url
,
app
.
showToast
(
'
支付失败
'
);
success
:
function
(
res
)
{
}
app
.
alert
({
msg
:
'
支付成功后、请不要重复支付、如果订单状态未成功请联系客服处理
'
,
is_show_cancel
:
0
});
});
self
.
get_data_list
();
}
else
{
},
qq
.
requestPayment
({
fail
:
function
(
res
)
{
package
:
data
.
data
,
app
.
showToast
(
'
支付失败
'
);
success
:
function
(
res
)
{
}
// 数据设置
});
self
.
order_item_pay_success_handle
(
order_ids
);
}
else
{
qq
.
requestPayment
({
// 跳转支付页面
package
:
data
.
data
,
qq
.
navigateTo
({
success
:
function
(
res
)
{
url
:
"
/pages/paytips/paytips?code=9000
"
// 数据设置
});
self
.
order_item_pay_success_handle
(
order_ids
);
},
fail
:
function
(
res
)
{
// 跳转支付页面
app
.
showToast
(
'
支付失败
'
);
qq
.
navigateTo
({
}
url
:
"
/pages/paytips/paytips?code=9000
"
});
});
}
},
break
;
fail
:
function
(
res
)
{
app
.
showToast
(
'
支付失败
'
);
}
});
}
break
;
// 线下支付
// 线下支付
case
1
:
case
1
:
var
order_ids_arr
=
order_ids
.
split
(
'
,
'
);
var
order_ids_arr
=
order_ids
.
split
(
'
,
'
);
var
temp_data_list
=
self
.
data
.
data_list
;
var
temp_data_list
=
self
.
data
.
data_list
;
for
(
var
i
in
temp_data_list
)
for
(
var
i
in
temp_data_list
)
{
if
(
order_ids_arr
.
indexOf
(
temp_data_list
[
i
][
'
id
'
])
!=
-
1
)
{
{
temp_data_list
[
i
][
'
is_under_line
'
]
=
1
;
if
(
order_ids_arr
.
indexOf
(
temp_data_list
[
i
][
'
id
'
])
!=
-
1
)
{
temp_data_list
[
i
][
'
is_under_line
'
]
=
1
;
}
}
}
}
self
.
setData
({
data_list
:
temp_data_list
});
self
.
setData
({
data_list
:
temp_data_list
});
app
.
alert
({
msg
:
res
.
data
.
msg
,
is_show_cancel
:
0
});
app
.
alert
({
msg
:
res
.
data
.
msg
,
is_show_cancel
:
0
})
;
break
;
break
;
// 钱包支付
// 钱包支付
case
2
:
case
2
:
self
.
order_item_pay_success_handle
(
order_ids
);
self
.
order_item_pay_success_handle
(
order_ids
);
app
.
showToast
(
'
支付成功
'
,
'
success
'
);
app
.
showToast
(
'
支付成功
'
,
'
success
'
)
;
break
;
break
;
// 默认
// 默认
default
:
default
:
app
.
showToast
(
'
支付类型有误
'
);
app
.
showToast
(
'
支付类型有误
'
);
}
}
}
}
else
{
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
app
.
showToast
(
res
.
data
.
msg
);
...
...
sourcecode/toutiao/default/pages/user-order/user-order.js
浏览文件 @
64dd28ef
...
@@ -241,8 +241,7 @@ Page({
...
@@ -241,8 +241,7 @@ Page({
// 支付方法
// 支付方法
pay_handle
(
order_ids
)
{
pay_handle
(
order_ids
)
{
var
self
=
this
;
// 加载loding
var
self
=
this
;
tt
.
showLoading
({
tt
.
showLoading
({
title
:
"
请求中...
"
title
:
"
请求中...
"
});
});
...
@@ -256,72 +255,78 @@ Page({
...
@@ -256,72 +255,78 @@ Page({
dataType
:
"
json
"
,
dataType
:
"
json
"
,
success
:
res
=>
{
success
:
res
=>
{
tt
.
hideLoading
();
tt
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
if
(
res
.
data
.
code
==
0
)
{
// 支付方式类型
// 是否直接支付成功
switch
(
res
.
data
.
data
.
is_payment_type
)
{
if
((
res
.
data
.
data
.
is_success
||
0
)
==
1
)
// 正常线上支付
{
case
0
:
self
.
order_item_pay_success_handle
(
order_ids
);
var
data
=
res
.
data
.
data
;
app
.
showToast
(
'
支付成功
'
,
'
success
'
);
tt
.
pay
({
}
else
{
orderInfo
:
data
.
order_info
,
// 支付方式类型
service
:
data
.
service
,
switch
(
res
.
data
.
data
.
is_payment_type
)
{
success
(
res
)
{
// 正常线上支付
// if (res.code == 0) {
case
0
:
// // 数据设置
var
data
=
res
.
data
.
data
;
// self.order_item_pay_success_handle(index);
tt
.
pay
({
orderInfo
:
data
.
order_info
,
// // 跳转支付页面
service
:
data
.
service
,
// tt.navigateTo({
success
(
res
)
{
// url: "/pages/paytips/paytips?code=9000&total_price=" +
// if (res.code == 0) {
// self.data.data_list[index]['total_price']
// // 数据设置
// });
// self.order_item_pay_success_handle(index);
// } else {
// app.showToast('支付失败');
// // 跳转支付页面
// }
// tt.navigateTo({
// url: "/pages/paytips/paytips?code=9000&total_price=" +
// 由于头条支付无法监听支付状态,这里就不做接口轮询了,直接刷新页面
// self.data.data_list[index]['total_price']
self
.
setData
({
// });
data_page
:
1
// } else {
});
// app.showToast('支付失败');
self
.
get_data_list
(
1
);
// }
},
fail
(
res
)
{
// 由于头条支付无法监听支付状态,这里就不做接口轮询了,直接刷新页面
console
.
log
(
res
,
'
pay-fail
'
);
self
.
setData
({
app
.
showToast
(
'
调起收银台失败-
'
+
res
.
data
.
code
);
data_page
:
1
}
});
});
self
.
get_data_list
(
1
);
break
;
},
fail
(
res
)
{
console
.
log
(
res
,
'
pay-fail
'
);
app
.
showToast
(
'
调起收银台失败-
'
+
res
.
data
.
code
);
}
});
break
;
// 线下支付
// 线下支付
case
1
:
case
1
:
var
order_ids_arr
=
order_ids
.
split
(
'
,
'
);
var
order_ids_arr
=
order_ids
.
split
(
'
,
'
);
var
temp_data_list
=
self
.
data
.
data_list
;
var
temp_data_list
=
self
.
data
.
data_list
;
for
(
var
i
in
temp_data_list
)
{
for
(
var
i
in
temp_data_list
)
{
if
(
order_ids_arr
.
indexOf
(
temp_data_list
[
i
][
'
id
'
])
!=
-
1
)
{
if
(
order_ids_arr
.
indexOf
(
temp_data_list
[
i
][
'
id
'
])
!=
-
1
)
{
temp_data_list
[
i
][
'
is_under_line
'
]
=
1
;
temp_data_list
[
i
][
'
is_under_line
'
]
=
1
;
}
}
}
}
self
.
setData
({
self
.
setData
({
data_list
:
temp_data_list
data_list
:
temp_data_list
});
});
app
.
alert
({
app
.
alert
({
msg
:
res
.
data
.
msg
,
msg
:
res
.
data
.
msg
,
is_show_cancel
:
0
is_show_cancel
:
0
});
});
break
;
break
;
// 钱包支付
// 钱包支付
case
2
:
case
2
:
self
.
order_item_pay_success_handle
(
order_ids
);
self
.
order_item_pay_success_handle
(
order_ids
);
app
.
showToast
(
'
支付成功
'
,
'
success
'
);
app
.
showToast
(
'
支付成功
'
,
'
success
'
);
break
;
break
;
// 默认
// 默认
default
:
default
:
app
.
showToast
(
'
支付类型有误
'
);
app
.
showToast
(
'
支付类型有误
'
);
}
}
}
}
else
{
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
app
.
showToast
(
res
.
data
.
msg
);
...
...
sourcecode/weixin/default/app.js
浏览文件 @
64dd28ef
...
@@ -73,7 +73,7 @@ App({
...
@@ -73,7 +73,7 @@ App({
// 请求地址
// 请求地址
request_url
:
"
{{request_url}}
"
,
request_url
:
"
{{request_url}}
"
,
//
request_url: 'http://shopxo.com/',
request_url
:
'
http://shopxo.com/
'
,
// request_url: 'https://dev.shopxo.net/',
// request_url: 'https://dev.shopxo.net/',
// 基础信息
// 基础信息
...
...
sourcecode/weixin/default/pages/user-order/user-order.js
浏览文件 @
64dd28ef
...
@@ -232,9 +232,7 @@ Page({
...
@@ -232,9 +232,7 @@ Page({
// 支付方法
// 支付方法
pay_handle
(
order_ids
)
{
pay_handle
(
order_ids
)
{
var
self
=
this
;
var
self
=
this
;
// 加载loding
wx
.
showLoading
({
title
:
"
请求中...
"
});
wx
.
showLoading
({
title
:
"
请求中...
"
});
wx
.
request
({
wx
.
request
({
url
:
app
.
get_request_url
(
"
pay
"
,
"
order
"
),
url
:
app
.
get_request_url
(
"
pay
"
,
"
order
"
),
method
:
"
POST
"
,
method
:
"
POST
"
,
...
@@ -246,56 +244,62 @@ Page({
...
@@ -246,56 +244,62 @@ Page({
success
:
res
=>
{
success
:
res
=>
{
wx
.
hideLoading
();
wx
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
if
(
res
.
data
.
code
==
0
)
{
// 支付方式类型
// 是否直接支付成功
switch
(
res
.
data
.
data
.
is_payment_type
)
{
if
((
res
.
data
.
data
.
is_success
||
0
)
==
1
)
{
// 正常线上支付
self
.
order_item_pay_success_handle
(
order_ids
);
case
0
:
app
.
showToast
(
'
支付成功
'
,
'
success
'
);
var
data
=
res
.
data
.
data
;
}
else
{
wx
.
requestPayment
({
// 支付方式类型
timeStamp
:
data
.
data
.
timeStamp
,
switch
(
res
.
data
.
data
.
is_payment_type
)
{
nonceStr
:
data
.
data
.
nonceStr
,
// 正常线上支付
package
:
data
.
data
.
package
,
case
0
:
signType
:
data
.
data
.
signType
,
var
data
=
res
.
data
.
data
;
paySign
:
data
.
data
.
paySign
,
wx
.
requestPayment
({
success
:
function
(
res
)
{
timeStamp
:
data
.
data
.
timeStamp
,
// 数据设置
nonceStr
:
data
.
data
.
nonceStr
,
self
.
order_item_pay_success_handle
(
order_ids
);
package
:
data
.
data
.
package
,
signType
:
data
.
data
.
signType
,
// 跳转支付页面
paySign
:
data
.
data
.
paySign
,
wx
.
navigateTo
({
success
:
function
(
res
)
{
url
:
"
/pages/paytips/paytips?code=9000
"
// 数据设置
});
self
.
order_item_pay_success_handle
(
order_ids
);
},
fail
:
function
(
res
)
{
// 跳转支付页面
app
.
showToast
(
'
支付失败
'
);
wx
.
navigateTo
({
}
url
:
"
/pages/paytips/paytips?code=9000
"
});
});
break
;
},
fail
:
function
(
res
)
{
// 线下支付
app
.
showToast
(
'
支付失败
'
);
case
1
:
}
var
order_ids_arr
=
order_ids
.
split
(
'
,
'
);
});
var
temp_data_list
=
self
.
data
.
data_list
;
break
;
for
(
var
i
in
temp_data_list
)
{
// 线下支付
if
(
order_ids_arr
.
indexOf
(
temp_data_list
[
i
][
'
id
'
])
!=
-
1
)
case
1
:
var
order_ids_arr
=
order_ids
.
split
(
'
,
'
);
var
temp_data_list
=
self
.
data
.
data_list
;
for
(
var
i
in
temp_data_list
)
{
{
temp_data_list
[
i
][
'
is_under_line
'
]
=
1
;
if
(
order_ids_arr
.
indexOf
(
temp_data_list
[
i
][
'
id
'
])
!=
-
1
)
{
temp_data_list
[
i
][
'
is_under_line
'
]
=
1
;
}
}
}
}
self
.
setData
({
data_list
:
temp_data_list
});
self
.
setData
({
data_list
:
temp_data_list
});
app
.
alert
({
msg
:
res
.
data
.
msg
,
is_show_cancel
:
0
});
app
.
alert
({
msg
:
res
.
data
.
msg
,
is_show_cancel
:
0
})
;
break
;
break
;
// 钱包支付
// 钱包支付
case
2
:
case
2
:
self
.
order_item_pay_success_handle
(
order_ids
);
self
.
order_item_pay_success_handle
(
order_ids
);
app
.
showToast
(
'
支付成功
'
,
'
success
'
);
app
.
showToast
(
'
支付成功
'
,
'
success
'
)
;
break
;
break
;
// 默认
// 默认
default
:
default
:
app
.
showToast
(
'
支付类型有误
'
);
app
.
showToast
(
'
支付类型有误
'
);
}
}
}
}
else
{
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
app
.
showToast
(
res
.
data
.
msg
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录