Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jcy2004x
ShopXO
提交
fdf4c9fb
ShopXO
项目概览
jcy2004x
/
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 搜索 >>
提交
fdf4c9fb
编写于
8月 04, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
微信小程序
上级
5b8f667c
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
222 addition
and
142 deletion
+222
-142
application/service/BuyService.php
application/service/BuyService.php
+6
-5
extend/payment/QQ.php
extend/payment/QQ.php
+3
-6
extend/payment/Weixin.php
extend/payment/Weixin.php
+3
-6
sourcecode/alipay/pages/buy/buy.axml
sourcecode/alipay/pages/buy/buy.axml
+1
-1
sourcecode/alipay/pages/cart/cart.axml
sourcecode/alipay/pages/cart/cart.axml
+4
-4
sourcecode/alipay/pages/cart/cart.js
sourcecode/alipay/pages/cart/cart.js
+1
-1
sourcecode/baidu/pages/buy/buy.swan
sourcecode/baidu/pages/buy/buy.swan
+1
-1
sourcecode/baidu/pages/cart/cart.js
sourcecode/baidu/pages/cart/cart.js
+1
-1
sourcecode/baidu/pages/cart/cart.swan
sourcecode/baidu/pages/cart/cart.swan
+4
-4
sourcecode/qq/pages/buy/buy.qml
sourcecode/qq/pages/buy/buy.qml
+1
-1
sourcecode/qq/pages/cart/cart.js
sourcecode/qq/pages/cart/cart.js
+1
-1
sourcecode/qq/pages/cart/cart.qml
sourcecode/qq/pages/cart/cart.qml
+4
-4
sourcecode/toutiao/pages/buy/buy.ttml
sourcecode/toutiao/pages/buy/buy.ttml
+1
-1
sourcecode/toutiao/pages/cart/cart.js
sourcecode/toutiao/pages/cart/cart.js
+1
-1
sourcecode/toutiao/pages/cart/cart.ttml
sourcecode/toutiao/pages/cart/cart.ttml
+4
-4
sourcecode/weixin/pages/buy/buy.js
sourcecode/weixin/pages/buy/buy.js
+52
-21
sourcecode/weixin/pages/buy/buy.wxml
sourcecode/weixin/pages/buy/buy.wxml
+13
-23
sourcecode/weixin/pages/cart/cart.js
sourcecode/weixin/pages/cart/cart.js
+1
-1
sourcecode/weixin/pages/cart/cart.wxml
sourcecode/weixin/pages/cart/cart.wxml
+4
-4
sourcecode/weixin/pages/paytips/paytips.js
sourcecode/weixin/pages/paytips/paytips.js
+0
-1
sourcecode/weixin/pages/paytips/paytips.wxml
sourcecode/weixin/pages/paytips/paytips.wxml
+0
-4
sourcecode/weixin/pages/paytips/paytips.wxss
sourcecode/weixin/pages/paytips/paytips.wxss
+0
-3
sourcecode/weixin/pages/user-order/user-order.js
sourcecode/weixin/pages/user-order/user-order.js
+76
-40
sourcecode/weixin/pages/user-order/user-order.wxml
sourcecode/weixin/pages/user-order/user-order.wxml
+13
-4
sourcecode/weixin/pages/user-order/user-order.wxss
sourcecode/weixin/pages/user-order/user-order.wxss
+19
-0
sourcecode/weixin/utils/tools.wxs
sourcecode/weixin/utils/tools.wxs
+8
-0
未找到文件。
application/service/BuyService.php
浏览文件 @
fdf4c9fb
...
...
@@ -1002,7 +1002,7 @@ class BuyService
$user_note
=
empty
(
$params
[
'user_note'
])
?
''
:
str_replace
([
'"'
,
"'"
],
''
,
strip_tags
(
$params
[
'user_note'
]));
// 订单默认状态
$status
=
(
intval
(
MyC
(
'common_order_is_booking'
,
0
))
==
1
)
?
0
:
1
;
$
order_
status
=
(
intval
(
MyC
(
'common_order_is_booking'
,
0
))
==
1
)
?
0
:
1
;
// 订单来源
$client_type
=
(
APPLICATION_CLIENT_TYPE
==
'pc'
&&
IsMobile
())
?
'h5'
:
APPLICATION_CLIENT_TYPE
;
...
...
@@ -1047,7 +1047,7 @@ class BuyService
'user_id'
=>
$params
[
'user'
][
'id'
],
'warehouse_id'
=>
$v
[
'id'
],
'user_note'
=>
$user_note
,
'status'
=>
$status
,
'status'
=>
$
order_
status
,
'preferential_price'
=>
(
$v
[
'order_base'
][
'preferential_price'
]
<=
0.00
)
?
0.00
:
$v
[
'order_base'
][
'preferential_price'
],
'increase_price'
=>
(
$v
[
'order_base'
][
'increase_price'
]
<=
0.00
)
?
0.00
:
$v
[
'order_base'
][
'increase_price'
],
'price'
=>
(
$v
[
'order_base'
][
'total_price'
]
<=
0.00
)
?
0.00
:
$v
[
'order_base'
][
'total_price'
],
...
...
@@ -1192,13 +1192,14 @@ class BuyService
// 返回信息
$result
=
[
'order_ids'
=>
$order_ids
,
'jump_url'
=>
MyUrl
(
'index/order/index'
),
'order_status'
=>
$order_status
,
'order_ids'
=>
$order_ids
,
'jump_url'
=>
MyUrl
(
'index/order/index'
),
];
// 获取订单信息
switch
(
$status
)
switch
(
$
order_
status
)
{
// 预约成功
case
0
:
...
...
extend/payment/QQ.php
浏览文件 @
fdf4c9fb
...
...
@@ -288,10 +288,10 @@ class QQ
$data
=
[
'appid'
=>
$this
->
config
[
'appid'
],
'mch_id'
=>
$this
->
config
[
'mch_id'
],
'nonce_str'
=>
md5
(
time
()
.
rand
()
.
$params
[
'order_no'
]),
'nonce_str'
=>
md5
(
time
()
.
$params
[
'order_no'
]),
'body'
=>
$params
[
'site_name'
]
.
'-'
.
$params
[
'name'
],
'notify_url'
=>
$notify_url
,
'out_trade_no'
=>
$params
[
'order_no'
]
.
GetNumberCode
(
6
)
,
'out_trade_no'
=>
$params
[
'order_no'
],
'fee_type'
=>
'CNY'
,
'total_fee'
=>
(
int
)
((
$params
[
'total_price'
]
*
1000
)
/
10
),
'spbill_create_ip'
=>
GetClientIP
(),
...
...
@@ -355,13 +355,10 @@ class QQ
*/
private
function
ReturnData
(
$data
)
{
// 参数处理
$out_trade_no
=
substr
(
$data
[
'out_trade_no'
],
0
,
strlen
(
$data
[
'out_trade_no'
])
-
6
);
// 返回数据固定基础参数
$data
[
'trade_no'
]
=
$data
[
'transaction_id'
];
// 支付平台 - 订单号
$data
[
'buyer_user'
]
=
isset
(
$data
[
'openid'
])
?
$data
[
'openid'
]
:
''
;
// 支付平台 - 用户
$data
[
'out_trade_no'
]
=
$
out_trade_no
;
// 本系统发起支付的 - 订单号
$data
[
'out_trade_no'
]
=
$
data
[
'out_trade_no'
];
// 本系统发起支付的 - 订单号
$data
[
'subject'
]
=
isset
(
$data
[
'attach'
])
?
$data
[
'attach'
]
:
''
;
// 本系统发起支付的 - 商品名称
$data
[
'pay_price'
]
=
$data
[
'total_fee'
]
/
100
;
// 本系统发起支付的 - 总价
return
$data
;
...
...
extend/payment/Weixin.php
浏览文件 @
fdf4c9fb
...
...
@@ -359,10 +359,10 @@ class Weixin
'appid'
=>
$appid
,
'mch_id'
=>
$this
->
config
[
'mch_id'
],
'body'
=>
$params
[
'site_name'
]
.
'-'
.
$params
[
'name'
],
'nonce_str'
=>
md5
(
time
()
.
rand
()
.
$params
[
'order_no'
]),
'nonce_str'
=>
md5
(
time
()
.
$params
[
'order_no'
]),
'notify_url'
=>
$notify_url
,
'openid'
=>
(
$trade_type
==
'JSAPI'
)
?
$openid
:
''
,
'out_trade_no'
=>
$params
[
'order_no'
]
.
GetNumberCode
(
6
)
,
'out_trade_no'
=>
$params
[
'order_no'
],
'spbill_create_ip'
=>
GetClientIP
(),
'total_fee'
=>
(
int
)
((
$params
[
'total_price'
]
*
1000
)
/
10
),
'trade_type'
=>
$trade_type
,
...
...
@@ -441,13 +441,10 @@ class Weixin
*/
private
function
ReturnData
(
$data
)
{
// 参数处理
$out_trade_no
=
substr
(
$data
[
'out_trade_no'
],
0
,
strlen
(
$data
[
'out_trade_no'
])
-
6
);
// 返回数据固定基础参数
$data
[
'trade_no'
]
=
$data
[
'transaction_id'
];
// 支付平台 - 订单号
$data
[
'buyer_user'
]
=
$data
[
'openid'
];
// 支付平台 - 用户
$data
[
'out_trade_no'
]
=
$
out_trade_no
;
// 本系统发起支付的 - 订单号
$data
[
'out_trade_no'
]
=
$
data
[
'out_trade_no'
];
// 本系统发起支付的 - 订单号
$data
[
'subject'
]
=
$data
[
'attach'
];
// 本系统发起支付的 - 商品名称
$data
[
'pay_price'
]
=
$data
[
'total_fee'
]
/
100
;
// 本系统发起支付的 - 总价
return
$data
;
...
...
sourcecode/alipay/pages/buy/buy.axml
浏览文件 @
fdf4c9fb
...
...
@@ -89,7 +89,7 @@
<!-- 导航 -->
<view class="buy-nav oh wh-auto">
<view class="nav-base bg-white fl single-text">
<view class="nav-base bg-white fl
br-t
single-text">
<text>合计:</text>
<text class="sales-price">{{price_symbol}}{{total_price}}</text>
</view>
...
...
sourcecode/alipay/pages/cart/cart.axml
浏览文件 @
fdf4c9fb
<view a:if="{{data_list.length > 0}}" class="page">
<view a:for="{{data_list}}" class="goods-item oh bg-white {{common_site_type == 1 ? 'exhibition-mode-data' : ''}}">
<!-- 选择 -->
<view a:if="{{common_site_type != 1}}" onTap="selected
t
_event" data-type="node" data-index="{{index}}" class="fl selected">
<view a:if="{{common_site_type != 1}}" onTap="selected_event" data-type="node" data-index="{{index}}" class="fl selected">
<image class="icon" src="/images/default-select{{(item.is_error || 0) == 1 ? '-disabled' : ((item.selected || false) ? '-active' : '')}}-icon.png" mode="widthFix" />
</view>
...
...
@@ -42,7 +42,7 @@
</view>
<!-- 操作导航 -->
<view a:if="{{data_list.length > 0}}" class="buy-nav oh wh-auto
br-t
">
<view a:if="{{data_list.length > 0}}" class="buy-nav oh wh-auto">
<!-- 展示型 -->
<block a:if="{{common_site_type == 1}}">
<view class="exhibition-mode">
...
...
@@ -52,8 +52,8 @@
<!-- 销售,自提,虚拟销售 -->
<block a:else>
<view class="nav-base bg-white fl single-text">
<view onTap="selected
t
_event" data-type="all" class="fl selected">
<view class="nav-base bg-white fl
br-t
single-text">
<view onTap="selected_event" data-type="all" class="fl selected">
<image class="icon" src="/images/default-select{{is_selected_all ? '-active' : ''}}-icon.png" mode="widthFix" />
<text>全选</text>
</view>
...
...
sourcecode/alipay/pages/cart/cart.js
浏览文件 @
fdf4c9fb
...
...
@@ -340,7 +340,7 @@ Page({
},
// 选中处理
selected
t
_event
(
e
)
{
selected_event
(
e
)
{
var
type
=
e
.
target
.
dataset
.
type
||
null
;
if
(
type
!=
null
)
{
...
...
sourcecode/baidu/pages/buy/buy.swan
浏览文件 @
fdf4c9fb
...
...
@@ -88,7 +88,7 @@
<!-- 导航 -->
<view class="buy-nav oh wh-auto">
<view class="nav-base bg-white fl single-text">
<view class="nav-base bg-white fl
br-t
single-text">
<text>合计:</text>
<text class="sales-price">{{price_symbol}}{{total_price}}</text>
</view>
...
...
sourcecode/baidu/pages/cart/cart.js
浏览文件 @
fdf4c9fb
...
...
@@ -293,7 +293,7 @@ Page({
},
// 选中处理
selected
t
_event
(
e
)
{
selected_event
(
e
)
{
var
type
=
e
.
currentTarget
.
dataset
.
type
||
null
;
if
(
type
!=
null
)
{
var
temp_data_list
=
this
.
data
.
data_list
;
...
...
sourcecode/baidu/pages/cart/cart.swan
浏览文件 @
fdf4c9fb
<view s-if="data_list.length > 0" class="page">
<view s-for="item, index in data_list" s-key="key" class="goods-item oh bg-white {{common_site_type == 1 ? 'exhibition-mode-data' : ''}}">
<!-- 选择 -->
<view s-if="common_site_type != 1" bindtap="selected
t
_event" data-type="node" data-index="{{index}}" class="fl selected">
<view s-if="common_site_type != 1" bindtap="selected_event" data-type="node" data-index="{{index}}" class="fl selected">
<image class="icon" src="/images/default-select{{(item.is_error || 0) == 1 ? '-disabled' : ((item.selected || false) ? '-active' : '')}}-icon.png" mode="widthFix" />
</view>
...
...
@@ -44,7 +44,7 @@
</view>
<!-- 操作导航 -->
<view s-if="data_list.length > 0" class="buy-nav oh wh-auto
br-t
">
<view s-if="data_list.length > 0" class="buy-nav oh wh-auto">
<!-- 展示型 -->
<block s-if="common_site_type == 1">
<view class="exhibition-mode">
...
...
@@ -54,8 +54,8 @@
<!-- 销售,自提,虚拟销售 -->
<block s-else>
<view class="nav-base bg-white fl single-text">
<view bindtap="selected
t
_event" data-type="all" class="fl selected">
<view class="nav-base bg-white fl
br-t
single-text">
<view bindtap="selected_event" data-type="all" class="fl selected">
<image class="icon" src="/images/default-select{{is_selected_all ? '-active' : ''}}-icon.png" mode="widthFix" />
<text>全选</text>
</view>
...
...
sourcecode/qq/pages/buy/buy.qml
浏览文件 @
fdf4c9fb
...
...
@@ -88,7 +88,7 @@
<!--
导航
-->
<
view
class
=
"
buy-nav oh wh-auto
"
>
<
view
class
=
"
nav-base bg-white fl single-text
"
>
<
view
class
=
"
nav-base bg-white fl
br-t
single-text
"
>
<
text
>
合计
:
<
/text
>
<
text
class
=
"
sales-price
"
>
{{
price_symbol
}}{{
total_price
}}
<
/text
>
<
/view
>
...
...
sourcecode/qq/pages/cart/cart.js
浏览文件 @
fdf4c9fb
...
...
@@ -294,7 +294,7 @@ Page({
},
// 选中处理
selected
t
_event
(
e
)
{
selected_event
(
e
)
{
var
type
=
e
.
currentTarget
.
dataset
.
type
||
null
;
if
(
type
!=
null
)
{
...
...
sourcecode/qq/pages/cart/cart.qml
浏览文件 @
fdf4c9fb
<
view
qq
:
if
=
"
{{data_list.length > 0}}
"
class
=
"
page
"
>
<
view
qq
:
for
=
"
{{data_list}}
"
qq
:
key
=
"
key
"
class
=
"
goods-item oh bg-white {{common_site_type == 1 ? 'exhibition-mode-data' : ''}}
"
>
<!--
选择
-->
<
view
qq
:
if
=
"
{{common_site_type != 1}}
"
bindtap
=
"
selected
t
_event
"
data
-
type
=
"
node
"
data
-
index
=
"
{{index}}
"
class
=
"
fl selected
"
>
<
view
qq
:
if
=
"
{{common_site_type != 1}}
"
bindtap
=
"
selected_event
"
data
-
type
=
"
node
"
data
-
index
=
"
{{index}}
"
class
=
"
fl selected
"
>
<
image
class
=
"
icon
"
src
=
"
/images/default-select{{(item.is_error || 0) == 1 ? '-disabled' : ((item.selected || false) ? '-active' : '')}}-icon.png
"
mode
=
"
widthFix
"
/>
<
/view
>
...
...
@@ -42,7 +42,7 @@
<
/view
>
<!--
操作导航
-->
<
view
qq
:
if
=
"
{{data_list.length > 0}}
"
class
=
"
buy-nav oh wh-auto
br-t
"
>
<
view
qq
:
if
=
"
{{data_list.length > 0}}
"
class
=
"
buy-nav oh wh-auto
"
>
<!--
展示型
-->
<
block
qq
:
if
=
"
{{common_site_type == 1}}
"
>
<
view
class
=
"
exhibition-mode
"
>
...
...
@@ -52,8 +52,8 @@
<!--
销售
,
自提
,
虚拟销售
-->
<
block
qq
:
else
>
<
view
class
=
"
nav-base bg-white fl single-text
"
>
<
view
bindtap
=
"
selected
t
_event
"
data
-
type
=
"
all
"
class
=
"
fl selected
"
>
<
view
class
=
"
nav-base bg-white fl
br-t
single-text
"
>
<
view
bindtap
=
"
selected_event
"
data
-
type
=
"
all
"
class
=
"
fl selected
"
>
<
image
class
=
"
icon
"
src
=
"
/images/default-select{{is_selected_all ? '-active' : ''}}-icon.png
"
mode
=
"
widthFix
"
/>
<
text
>
全选
<
/text
>
<
/view
>
...
...
sourcecode/toutiao/pages/buy/buy.ttml
浏览文件 @
fdf4c9fb
...
...
@@ -88,7 +88,7 @@
<!-- 导航 -->
<view class="buy-nav oh wh-auto">
<view class="nav-base bg-white fl single-text">
<view class="nav-base bg-white fl
br-t
single-text">
<text>合计:</text>
<text class="sales-price">{{price_symbol}}{{total_price}}</text>
</view>
...
...
sourcecode/toutiao/pages/cart/cart.js
浏览文件 @
fdf4c9fb
...
...
@@ -294,7 +294,7 @@ Page({
},
// 选中处理
selected
t
_event
(
e
)
{
selected_event
(
e
)
{
var
type
=
e
.
currentTarget
.
dataset
.
type
||
null
;
if
(
type
!=
null
)
{
...
...
sourcecode/toutiao/pages/cart/cart.ttml
浏览文件 @
fdf4c9fb
<view tt:if="{{data_list.length > 0}}" class="page">
<view tt:for="{{data_list}}" tt:key="key" class="goods-item oh bg-white {{common_site_type == 1 ? 'exhibition-mode-data' : ''}}">
<!-- 选择 -->
<view tt:if="{{common_site_type != 1}}" bindtap="selected
t
_event" data-type="node" data-index="{{index}}" class="fl selected">
<view tt:if="{{common_site_type != 1}}" bindtap="selected_event" data-type="node" data-index="{{index}}" class="fl selected">
<image class="icon" src="/images/default-select{{(item.is_error || 0) == 1 ? '-disabled' : ((item.selected || false) ? '-active' : '')}}-icon.png" mode="widthFix" />
</view>
...
...
@@ -42,7 +42,7 @@
</view>
<!-- 操作导航 -->
<view tt:if="{{data_list.length > 0}}" class="buy-nav oh wh-auto
br-t
">
<view tt:if="{{data_list.length > 0}}" class="buy-nav oh wh-auto">
<!-- 展示型 -->
<block tt:if="{{common_site_type == 1}}">
<view class="exhibition-mode">
...
...
@@ -52,8 +52,8 @@
<!-- 销售,自提,虚拟销售 -->
<block tt:else>
<view class="nav-base bg-white fl single-text">
<view bindtap="selected
t
_event" data-type="all" class="fl selected">
<view class="nav-base bg-white fl
br-t
single-text">
<view bindtap="selected_event" data-type="all" class="fl selected">
<image class="icon" src="/images/default-select{{is_selected_all ? '-active' : ''}}-icon.png" mode="widthFix" />
<text>全选</text>
</view>
...
...
sourcecode/weixin/pages/buy/buy.js
浏览文件 @
fdf4c9fb
...
...
@@ -26,9 +26,10 @@ Page({
// 优惠劵
plugins_coupon_data
:
null
,
plugins_use_coupon_id
:
0
,
plugins_choice_coupon_value
:
'
选择优惠劵
'
,
plugins_use_coupon_id
s
:
[]
,
plugins_choice_coupon_value
:
[]
,
popup_plugins_coupon_status
:
false
,
popup_plugins_coupon_index
:
null
,
},
onLoad
(
params
)
{
//params['data'] = '{"buy_type":"goods","goods_id":"1","stock":"1","spec":"[]"}';
...
...
@@ -80,12 +81,11 @@ Page({
var
data
=
this
.
data
.
params
;
data
[
'
address_id
'
]
=
this
.
data
.
address_id
;
data
[
'
payment_id
'
]
=
this
.
data
.
payment_id
;
data
[
'
coupon_id
'
]
=
this
.
data
.
plugins_use_coupon_id
;
data
[
'
site_model
'
]
=
this
.
data
.
site_model
;
wx
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
buy
"
),
method
:
"
POST
"
,
data
:
data
,
data
:
this
.
request_data_coupon_merge
(
data
)
,
dataType
:
"
json
"
,
success
:
res
=>
{
wx
.
stopPullDownRefresh
();
...
...
@@ -110,13 +110,19 @@ Page({
// 优惠劵选择处理
if
((
data
.
plugins_coupon_data
||
null
)
!=
null
)
{
if
((
data
.
plugins_coupon_data
.
coupon_choice
||
null
)
!=
null
)
var
plugins_choice_coupon_value
=
[];
for
(
var
i
in
data
.
plugins_coupon_data
)
{
this
.
setData
({
plugins_choice_coupon_value
:
data
.
plugins_coupon_data
.
coupon_choice
.
coupon
.
desc
});
}
else
{
var
coupon_count
=
((
data
.
plugins_coupon_data
.
coupon_list
||
null
)
!=
null
)
?
data
.
plugins_coupon_data
.
coupon_list
.
length
:
0
;
this
.
setData
({
plugins_choice_coupon_value
:
(
coupon_count
>
0
)
?
'
可选优惠劵
'
+
coupon_count
+
'
张
'
:
'
暂无可用优惠劵
'
});
var
cupk
=
data
.
plugins_coupon_data
[
i
][
'
warehouse_id
'
];
if
((
data
.
plugins_coupon_data
[
i
][
'
coupon_data
'
][
'
coupon_choice
'
]
||
null
)
!=
null
)
{
plugins_choice_coupon_value
[
cupk
]
=
data
.
plugins_coupon_data
[
i
][
'
coupon_data
'
][
'
coupon_choice
'
][
'
desc
'
];
}
else
{
var
coupon_count
=
(
data
.
plugins_coupon_data
[
i
][
'
coupon_data
'
][
'
coupon_list
'
]
||
null
)
!=
null
?
data
.
plugins_coupon_data
[
i
][
'
coupon_data
'
].
coupon_list
.
length
:
0
;
plugins_choice_coupon_value
[
cupk
]
=
(
coupon_count
>
0
)
?
'
可选优惠劵
'
+
coupon_count
+
'
张
'
:
'
暂无可用优惠劵
'
;
}
}
this
.
setData
({
plugins_choice_coupon_value
:
plugins_choice_coupon_value
});
}
// 地址
...
...
@@ -155,6 +161,19 @@ Page({
});
},
// 请求参数合并优惠券参数
request_data_coupon_merge
(
data
)
{
var
coupon_ids
=
this
.
data
.
plugins_use_coupon_ids
;
if
((
coupon_ids
||
null
)
!=
null
&&
coupon_ids
.
length
>
0
)
{
for
(
var
i
in
coupon_ids
)
{
data
[
'
coupon_id_
'
+
i
]
=
coupon_ids
[
i
];
}
}
return
data
;
},
// 下拉刷新
onPullDownRefresh
()
{
this
.
init
();
...
...
@@ -172,7 +191,6 @@ Page({
data
[
'
address_id
'
]
=
this
.
data
.
address_id
;
data
[
'
payment_id
'
]
=
this
.
data
.
payment_id
;
data
[
'
user_note
'
]
=
this
.
data
.
user_note_value
;
data
[
'
coupon_id
'
]
=
this
.
data
.
plugins_use_coupon_id
;
data
[
'
site_model
'
]
=
this
.
data
.
site_model
;
// 数据验证
...
...
@@ -193,14 +211,14 @@ Page({
wx
.
request
({
url
:
app
.
get_request_url
(
"
add
"
,
"
buy
"
),
method
:
"
POST
"
,
data
:
data
,
data
:
this
.
request_data_coupon_merge
(
data
)
,
dataType
:
"
json
"
,
success
:
res
=>
{
wx
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
if
(
res
.
data
.
data
.
order
.
status
==
1
)
{
if
(
res
.
data
.
data
.
order
_
status
==
1
)
{
wx
.
redirectTo
({
url
:
'
/pages/user-order/user-order?is_pay=1&order_id
=
'
+
res
.
data
.
data
.
order
.
id
url
:
'
/pages/user-order/user-order?is_pay=1&order_id
s=
'
+
res
.
data
.
data
.
order_ids
.
join
(
'
,
'
)
});
}
else
{
wx
.
redirectTo
({
url
:
'
/pages/user-order/user-order
'
});
...
...
@@ -243,7 +261,11 @@ Page({
// 优惠劵弹层开启
plugins_coupon_open_event
(
e
)
{
this
.
setData
({
popup_plugins_coupon_status
:
true
});
var
index
=
e
.
currentTarget
.
dataset
.
index
;
this
.
setData
({
popup_plugins_coupon_status
:
true
,
popup_plugins_coupon_index
:
index
,
});
},
// 优惠劵弹层关闭
...
...
@@ -253,19 +275,28 @@ Page({
// 优惠劵选择
plugins_coupon_use_event
(
e
)
{
var
index
=
e
.
currentTarget
.
dataset
.
index
;
var
wid
=
e
.
currentTarget
.
dataset
.
wid
;
var
value
=
e
.
currentTarget
.
dataset
.
value
;
this
.
setData
({
plugins_use_coupon_id
:
value
,
popup_plugins_coupon_status
:
false
,
});
this
.
init
();
var
temp
=
this
.
data
.
plugins_use_coupon_ids
;
// 是否已选择优惠券id
if
(
temp
.
indexOf
(
value
)
==
-
1
)
{
temp
[
wid
]
=
value
;
this
.
setData
({
plugins_use_coupon_ids
:
temp
,
popup_plugins_coupon_status
:
false
,
});
this
.
init
();
}
},
// 不使用优惠劵
plugins_coupon_not_use_event
(
e
)
{
var
wid
=
e
.
currentTarget
.
dataset
.
wid
;
var
temp
=
this
.
data
.
plugins_use_coupon_ids
;
temp
[
wid
]
=
0
;
this
.
setData
({
plugins_use_coupon_id
:
0
,
plugins_use_coupon_id
s
:
temp
,
popup_plugins_coupon_status
:
false
,
});
this
.
init
();
...
...
sourcecode/weixin/pages/buy/buy.wxml
浏览文件 @
fdf4c9fb
...
...
@@ -63,6 +63,11 @@
</text>
</view>
</view>
<!-- 优惠劵 -->
<view wx:if="{{(plugins_coupon_data || null) != null && (plugins_coupon_data[index] || null) != null && (plugins_coupon_data[index].coupon_data || null) != null && (plugins_coupon_data[index].coupon_data.coupon_list || null) != null && plugins_coupon_data[index].coupon_data.coupon_list.length > 0}}" class="plugins-coupon bg-white spacing-mb arrow-right" data-index="{{index}}" bindtap="plugins_coupon_open_event">
<text class="cr-666">优惠劵</text>
<text class="cr-ccc fr">{{((plugins_choice_coupon_value || null) != null && (plugins_choice_coupon_value[group.id] || null) != null) ? plugins_choice_coupon_value[group.id] : '请选择优惠券'}}</text>
</view>
<!-- 扩展数据展示 -->
<view wx:if="{{group.order_base.extension_data.length > 0}}" class="extension-list spacing-mt">
<view wx:for="{{group.order_base.extension_data}}" wx:key="key" class="item oh">
...
...
@@ -85,22 +90,6 @@
<view wx:if="{{popup_plugins_coupon_status}}" class="cr-888">{{user_note_value || '留言'}}</view>
</view>
<!-- 优惠劵 -->
<view wx:if="{{(plugins_coupon_data || null) != null && plugins_coupon_data.coupon_list.length > 0}}" class="plugins-coupon bg-white spacing-mb arrow-right" bindtap="plugins_coupon_open_event">
<text class="cr-666">优惠劵</text>
<text class="cr-ccc fr">{{plugins_choice_coupon_value}}</text>
</view>
<!-- 扩展数据展示 -->
<view wx:if="{{extension_data.length > 0}}" class="extension-list spacing-mb">
<view wx:for="{{extension_data}}" wx:key="key" class="item oh">
<text class="cr-666 fl">{{item.name}}
</text>
<text class="text-tips fr">{{item.tips}}
</text>
</view>
</view>
<!-- 支付方式 -->
<view wx:if="{{payment_list.length > 0 && common_order_is_booking != 1}}" class="payment-list bg-white oh">
<view class="item tc fl" wx:for="{{payment_list}}" wx:key="key">
...
...
@@ -113,7 +102,7 @@
<!-- 导航 -->
<view class="buy-nav oh wh-auto">
<view class="nav-base bg-white fl single-text">
<view class="nav-base bg-white fl
br-t
single-text">
<text>合计:</text>
<text class="sales-price">{{price_symbol}}{{total_price}}</text>
</view>
...
...
@@ -130,18 +119,19 @@
<!-- 优惠劵选择 -->
<component-popup prop-show="{{popup_plugins_coupon_status}}" prop-position="bottom" bindonclose="plugins_coupon_close_event">
<wxs src="../../utils/tools.wxs" module="tools" />
<view class="plugins-coupon-popup bg-white">
<view class="close oh">
<view class="fr" catchtap="plugins_coupon_close_event">
<icon type="clear" size="20" />
</view>
</view>
<view wx:if="{{
(plugins_coupon_data || null) != null && plugins_
coupon_data.coupon_list.length > 0}}" class="coupon-container oh br-b">
<view wx:if="{{
popup_plugins_coupon_index != null && (plugins_coupon_data || null) != null && (plugins_coupon_data[popup_plugins_coupon_index] || null) != null && (plugins_coupon_data[popup_plugins_coupon_index].coupon_data || null) != null && (plugins_coupon_data[popup_plugins_coupon_index].coupon_data.coupon_list || null) != null && plugins_coupon_data[popup_plugins_coupon_index].
coupon_data.coupon_list.length > 0}}" class="coupon-container oh br-b">
<view class="not-use-tips tc">
<text bindtap="plugins_coupon_not_use_event">不使用优惠劵</text>
<text
data-wid="{{plugins_coupon_data[popup_plugins_coupon_index].warehouse_id}}"
bindtap="plugins_coupon_not_use_event">不使用优惠劵</text>
</view>
<block wx:for="{{plugins_coupon_data.coupon_list}}" wx:key="item">
<view class="item spacing-mt bg-white" style="border:1px solid {{item.coupon.bg_color_value}};">
<block wx:for="{{plugins_coupon_data
[popup_plugins_coupon_index].coupon_data
.coupon_list}}" wx:key="item">
<view class="item spacing-mt bg-white
{{tools.indexOf(plugins_use_coupon_ids, item.id) ? 'item-disabled' : ''}}
" style="border:1px solid {{item.coupon.bg_color_value}};">
<view class="v-left fl">
<view class="base single-text" style="color:{{item.coupon.bg_color_value}};">
<text class="symbol">{{price_symbol}}</text>
...
...
@@ -152,9 +142,9 @@
<view wx:if="{{(item.coupon.use_limit_type_name || null) != null}}" class="base-tips cr-666 single-text">{{item.coupon.use_limit_type_name}}</view>
<view class="base-time cr-888 single-text">{{item.time_start_text}} 至 {{item.time_end_text}}</view>
</view>
<view class="v-right fr" style="background:{{item.coupon.bg_color_value}};" data-
index="{{index
}}" data-value="{{item.id}}" bindtap="plugins_coupon_use_event">
<view class="v-right fr" style="background:{{item.coupon.bg_color_value}};" data-
wid="{{plugins_coupon_data[popup_plugins_coupon_index].warehouse_id
}}" data-value="{{item.id}}" bindtap="plugins_coupon_use_event">
<text class="circle"></text>
<text>{{
plugins_use_coupon_id == item.id
? '已选' : '选择'}}</text>
<text>{{
tools.indexOf(plugins_use_coupon_ids, item.id)
? '已选' : '选择'}}</text>
</view>
</view>
</block>
...
...
sourcecode/weixin/pages/cart/cart.js
浏览文件 @
fdf4c9fb
...
...
@@ -294,7 +294,7 @@ Page({
},
// 选中处理
selected
t
_event
(
e
)
{
selected_event
(
e
)
{
var
type
=
e
.
currentTarget
.
dataset
.
type
||
null
;
if
(
type
!=
null
)
{
...
...
sourcecode/weixin/pages/cart/cart.wxml
浏览文件 @
fdf4c9fb
<view wx:if="{{data_list.length > 0}}" class="page">
<view wx:for="{{data_list}}" wx:key="key" class="goods-item oh bg-white {{common_site_type == 1 ? 'exhibition-mode-data' : ''}}">
<!-- 选择 -->
<view wx:if="{{common_site_type != 1}}" bindtap="selected
t
_event" data-type="node" data-index="{{index}}" class="fl selected">
<view wx:if="{{common_site_type != 1}}" bindtap="selected_event" data-type="node" data-index="{{index}}" class="fl selected">
<image class="icon" src="/images/default-select{{(item.is_error || 0) == 1 ? '-disabled' : ((item.selected || false) ? '-active' : '')}}-icon.png" mode="widthFix" />
</view>
...
...
@@ -42,7 +42,7 @@
</view>
<!-- 操作导航 -->
<view wx:if="{{data_list.length > 0}}" class="buy-nav oh wh-auto
br-t
">
<view wx:if="{{data_list.length > 0}}" class="buy-nav oh wh-auto">
<!-- 展示型 -->
<block wx:if="{{common_site_type == 1}}">
<view class="exhibition-mode">
...
...
@@ -52,8 +52,8 @@
<!-- 销售,自提,虚拟销售 -->
<block wx:else>
<view class="nav-base bg-white fl single-text">
<view bindtap="selected
t
_event" data-type="all" class="fl selected">
<view class="nav-base bg-white fl
br-t
single-text">
<view bindtap="selected_event" data-type="all" class="fl selected">
<image class="icon" src="/images/default-select{{is_selected_all ? '-active' : ''}}-icon.png" mode="widthFix" />
<text>全选</text>
</view>
...
...
sourcecode/weixin/pages/paytips/paytips.js
浏览文件 @
fdf4c9fb
const
app
=
getApp
();
Page
({
data
:
{
price_symbol
:
app
.
data
.
price_symbol
,
params
:
{},
default_round_success_icon
:
app
.
data
.
default_round_success_icon
,
default_round_error_icon
:
app
.
data
.
default_round_error_icon
,
...
...
sourcecode/weixin/pages/paytips/paytips.wxml
浏览文件 @
fdf4c9fb
...
...
@@ -2,10 +2,6 @@
<image class="pay-icon" wx:if="{{params.code == '9000'}}" mode="widthFix" src="{{default_round_success_icon}}" />
<image class="pay-icon" wx:else mode="widthFix" src="{{default_round_error_icon}}" />
<text class="dis-block">{{params.msg}}</text>
<view wx:if="{{params.code == '9000'}}" class="price-box">
<text class="sales-price">{{price_symbol}}{{params.total_price}}</text>
<text class="price-unit cr-888">元</text>
</view>
</view>
<view class="btn-box">
...
...
sourcecode/weixin/pages/paytips/paytips.wxss
浏览文件 @
fdf4c9fb
...
...
@@ -28,6 +28,3 @@ page{
.dis-block {
font-size: 48rpx;
}
.price-box {
margin-top: 20rpx;
}
\ No newline at end of file
sourcecode/weixin/pages/user-order/user-order.js
浏览文件 @
fdf4c9fb
...
...
@@ -13,8 +13,7 @@ Page({
is_show_payment_popup
:
false
,
payment_list
:
[],
payment_id
:
0
,
temp_pay_value
:
0
,
temp_pay_index
:
0
,
temp_pay_value
:
''
,
nav_status_list
:
[
{
name
:
"
全部
"
,
value
:
"
-1
"
},
{
name
:
"
待付款
"
,
value
:
"
1
"
},
...
...
@@ -24,6 +23,7 @@ Page({
{
name
:
"
已失效
"
,
value
:
"
5,6
"
},
],
nav_status_index
:
0
,
order_select_ids
:
[],
},
onLoad
(
params
)
{
...
...
@@ -115,16 +115,9 @@ Page({
// 下订单支付处理
if
(
this
.
data
.
load_status
==
0
)
{
if
((
this
.
data
.
params
.
is_pay
||
0
)
==
1
&&
(
this
.
data
.
params
.
order_id
||
0
)
!=
0
)
if
((
this
.
data
.
params
.
is_pay
||
0
)
==
1
&&
(
this
.
data
.
params
.
order_id
s
||
null
)
!=
null
)
{
for
(
var
i
in
temp_data_list
)
{
if
(
this
.
data
.
params
.
order_id
==
temp_data_list
[
i
][
'
id
'
])
{
this
.
pay_handle
(
this
.
data
.
params
.
order_id
,
i
);
break
;
}
}
this
.
pay_handle
(
this
.
data
.
params
.
order_ids
);
}
}
}
else
{
...
...
@@ -200,7 +193,6 @@ Page({
this
.
setData
({
is_show_payment_popup
:
true
,
temp_pay_value
:
e
.
currentTarget
.
dataset
.
value
,
temp_pay_index
:
e
.
currentTarget
.
dataset
.
index
,
});
},
...
...
@@ -214,11 +206,11 @@ Page({
var
payment_id
=
e
.
currentTarget
.
dataset
.
value
||
0
;
this
.
setData
({
payment_id
:
payment_id
});
this
.
payment_popup_event_close
();
this
.
pay_handle
(
this
.
data
.
temp_pay_value
,
this
.
data
.
temp_pay_index
);
this
.
pay_handle
(
this
.
data
.
temp_pay_value
);
},
// 支付方法
pay_handle
(
order_id
,
index
)
{
pay_handle
(
order_id
s
)
{
var
self
=
this
;
// 加载loding
wx
.
showLoading
({
title
:
"
请求中...
"
});
...
...
@@ -227,7 +219,7 @@ Page({
url
:
app
.
get_request_url
(
"
pay
"
,
"
order
"
),
method
:
"
POST
"
,
data
:
{
id
:
order_id
,
id
s
:
order_ids
,
payment_id
:
this
.
data
.
payment_id
,
},
dataType
:
"
json
"
,
...
...
@@ -246,12 +238,11 @@ Page({
paySign
:
res
.
data
.
data
.
data
.
paySign
,
success
:
function
(
res
)
{
// 数据设置
self
.
order_item_pay_success_handle
(
index
);
self
.
order_item_pay_success_handle
(
order_ids
);
// 跳转支付页面
wx
.
navigateTo
({
url
:
"
/pages/paytips/paytips?code=9000&total_price=
"
+
self
.
data
.
data_list
[
index
][
'
total_price
'
]
url
:
"
/pages/paytips/paytips?code=9000
"
});
},
fail
:
function
(
res
)
{
...
...
@@ -262,15 +253,22 @@ Page({
// 线下支付
case
1
:
var
order_ids_arr
=
order_ids
.
split
(
'
,
'
);
var
temp_data_list
=
self
.
data
.
data_list
;
temp_data_list
[
index
][
'
is_under_line
'
]
=
1
;
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
});
app
.
alert
({
msg
:
res
.
data
.
msg
,
is_show_cancel
:
0
});
break
;
// 钱包支付
case
2
:
self
.
order_item_pay_success_handle
(
index
);
self
.
order_item_pay_success_handle
(
order_ids
);
app
.
showToast
(
'
支付成功
'
,
'
success
'
);
break
;
...
...
@@ -290,27 +288,35 @@ Page({
},
// 支付成功数据设置
order_item_pay_success_handle
(
index
)
{
// 数据设置
order_item_pay_success_handle
(
order_ids
)
{
var
order_ids_arr
=
order_ids
.
split
(
'
,
'
);
var
temp_data_list
=
this
.
data
.
data_list
;
switch
(
parseInt
(
temp_data_list
[
index
][
'
order_model
'
]))
{
// 销售模式
case
0
:
temp_data_list
[
index
][
'
status
'
]
=
2
;
temp_data_list
[
index
][
'
status_name
'
]
=
'
待发货
'
;
break
;
// 自提模式
case
2
:
temp_data_list
[
index
][
'
status
'
]
=
2
;
temp_data_list
[
index
][
'
status_name
'
]
=
'
待取货
'
;
break
;
// 虚拟模式
case
3
:
temp_data_list
[
index
][
'
status
'
]
=
3
;
temp_data_list
[
index
][
'
status_name
'
]
=
'
待收货
'
;
break
;
// 数据设置
for
(
var
i
in
temp_data_list
)
{
if
(
order_ids_arr
.
indexOf
(
temp_data_list
[
i
][
'
id
'
])
!=
-
1
)
{
switch
(
parseInt
(
temp_data_list
[
i
][
'
order_model
'
]))
{
// 销售模式
case
0
:
temp_data_list
[
i
][
'
status
'
]
=
2
;
temp_data_list
[
i
][
'
status_name
'
]
=
'
待发货
'
;
break
;
// 自提模式
case
2
:
temp_data_list
[
i
][
'
status
'
]
=
2
;
temp_data_list
[
i
][
'
status_name
'
]
=
'
待取货
'
;
break
;
// 虚拟模式
case
3
:
temp_data_list
[
i
][
'
status
'
]
=
3
;
temp_data_list
[
i
][
'
status_name
'
]
=
'
待收货
'
;
break
;
}
}
}
this
.
setData
({
data_list
:
temp_data_list
});
},
...
...
@@ -413,7 +419,10 @@ Page({
this
.
setData
({
nav_status_index
:
e
.
currentTarget
.
dataset
.
index
||
0
,
data_page
:
1
,
order_select_ids
:
[],
});
// 重新拉取数据
this
.
get_data_list
(
1
);
},
...
...
@@ -439,4 +448,31 @@ Page({
url
:
"
/pages/user-order-comments/user-order-comments?id=
"
+
e
.
currentTarget
.
dataset
.
value
});
},
// 选中处理
selected_event
(
e
)
{
var
oid
=
e
.
currentTarget
.
dataset
.
oid
||
0
;
var
temp_select_ids
=
this
.
data
.
order_select_ids
;
if
(
temp_select_ids
.
indexOf
(
oid
)
==
-
1
)
{
temp_select_ids
.
push
(
oid
);
}
else
{
for
(
var
i
in
temp_select_ids
)
{
if
(
temp_select_ids
[
i
]
==
oid
)
{
temp_select_ids
.
splice
(
i
,
1
);
}
}
}
this
.
setData
({
order_select_ids
:
temp_select_ids
});
},
// 合并支付
pay_merge_event
(
e
)
{
this
.
setData
({
is_show_payment_popup
:
true
,
temp_pay_value
:
this
.
data
.
order_select_ids
.
join
(
'
,
'
)
});
},
});
sourcecode/weixin/pages/user-order/user-order.wxml
浏览文件 @
fdf4c9fb
<wxs src="../../utils/tools.wxs" module="tools" />
<!-- 导航 -->
<view class="nav">
<block wx:for="{{nav_status_list}}" wx:key="key">
...
...
@@ -11,10 +12,13 @@
<view class="list-content">
<view class="list-item bg-white spacing-mb" wx:if="{{data_list.length > 0}}" wx:for="{{data_list}}" wx:key="key">
<view class="item-base oh br-b">
<text class="cr-666 fl">{{item.add_time}}</text>
<text class="fr cr-main">
{{item.status_name}}<text wx:if="{{(item.is_under_line_text || null) != null}}">({{item.is_under_line_text}})</text>
</text>
<!-- 选择 -->
<view wx:if="{{nav_status_index == 1}}" bindtap="selected_event" data-type="node" data-oid="{{item.id}}" class="fl selected">
<image class="icon" src="/images/default-select{{tools.indexOf(order_select_ids, item.id) ? '-active' : ''}}-icon.png" mode="widthFix" />
</view>
<!-- 基础信息 -->
<text class="fl cr-666">{{item.warehouse_name}}</text>
<text class="fr cr-main">{{item.status_name}}<text wx:if="{{(item.is_under_line_text || null) != null}}">({{item.is_under_line_text}})</text></text>
</view>
<view wx:for="{{item.items}}" wx:key="key" wx:for-item="detail" class="goods-item br-b-dashed oh">
<navigator url="/pages/user-order-detail/user-order-detail?id={{item.id}}" hover-class="none">
...
...
@@ -56,6 +60,11 @@
</view>
</scroll-view>
<!-- 合并支付 -->
<view wx:if="{{nav_status_index == 1 && order_select_ids.length > 0}}">
<button class="submit-fixed pay-merge-submit" type="default" size="mini" hover-class="none" bindtap="pay_merge_event">合并支付</button>
</view>
<!-- 支付方式 popup -->
<component-popup prop-show="{{is_show_payment_popup}}" prop-position="bottom" bindonclose="payment_popup_event_close">
<view wx:if="{{payment_list.length > 0}}" class="payment-list oh bg-white">
...
...
sourcecode/weixin/pages/user-order/user-order.wxss
浏览文件 @
fdf4c9fb
...
...
@@ -85,4 +85,23 @@
height: 50rpx !important;
vertical-align: middle;
margin-right: 10rpx;
}
/**
* 多选
*/
.selected .icon {
width: 35rpx;
height: 35rpx !important;
margin: 0 20rpx 0 10rpx;
vertical-align: middle;
}
/**
* 合并支付按钮
*/
.pay-merge-submit {
width: 220rpx;
left: calc(50% - 110rpx);
bottom: 50rpx;
}
\ No newline at end of file
sourcecode/weixin/utils/tools.wxs
0 → 100644
浏览文件 @
fdf4c9fb
function indexOf(arr, value) {
if (arr.indexOf(value) < 0) {
return false;
} else {
return true;
}
}
module.exports.indexOf = indexOf;
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录