Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
b18dadfd
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,发现更多精彩内容 >>
提交
b18dadfd
编写于
11月 23, 2018
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pay
上级
7dacfecc
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
155 addition
and
56 deletion
+155
-56
alipay/app.acss
alipay/app.acss
+9
-9
alipay/pages/buy/buy.acss
alipay/pages/buy/buy.acss
+4
-0
alipay/pages/buy/buy.axml
alipay/pages/buy/buy.axml
+1
-1
alipay/pages/buy/buy.js
alipay/pages/buy/buy.js
+12
-1
alipay/pages/goods-detail/goods-detail.js
alipay/pages/goods-detail/goods-detail.js
+5
-5
alipay/pages/user-order-detail/user-order-detail.acss
alipay/pages/user-order-detail/user-order-detail.acss
+3
-0
alipay/pages/user-order-detail/user-order-detail.axml
alipay/pages/user-order-detail/user-order-detail.axml
+5
-5
alipay/pages/user-order-detail/user-order-detail.js
alipay/pages/user-order-detail/user-order-detail.js
+1
-0
alipay/pages/user-order/user-order.acss
alipay/pages/user-order/user-order.acss
+23
-4
alipay/pages/user-order/user-order.axml
alipay/pages/user-order/user-order.axml
+27
-10
alipay/pages/user-order/user-order.js
alipay/pages/user-order/user-order.js
+38
-11
alipay/pages/user-order/user-order.json
alipay/pages/user-order/user-order.json
+4
-1
service/Application/Api/Controller/BuyController.class.php
service/Application/Api/Controller/BuyController.class.php
+2
-2
service/Application/Api/Controller/OrderController.class.php
service/Application/Api/Controller/OrderController.class.php
+4
-0
service/Application/Service/BuyService.class.php
service/Application/Service/BuyService.class.php
+0
-4
service/Application/Service/OrderService.class.php
service/Application/Service/OrderService.class.php
+3
-3
service/Application/Service/ResourcesService.class.php
service/Application/Service/ResourcesService.class.php
+14
-0
未找到文件。
alipay/app.acss
浏览文件 @
b18dadfd
...
...
@@ -78,17 +78,17 @@ textarea {
/* 边框 */
.br { border: solid 1
r
px #efefef; }
.br-b { border-bottom: solid 1
r
px #efefef; }
.br-t { border-top: solid 1
r
px #efefef; }
.br-l { border-left: solid 1
r
px #efefef; }
.br-r { border-right: solid 1
r
px #efefef; }
.br { border: solid 1px #efefef; }
.br-b { border-bottom: solid 1px #efefef; }
.br-t { border-top: solid 1px #efefef; }
.br-l { border-left: solid 1px #efefef; }
.br-r { border-right: solid 1px #efefef; }
/* 虚线边框 */
.br-b-dashed { border-bottom: dashed 1
r
px #efefef; }
.br-t-dashed { border-top: dashed 1
r
px #efefef; }
.br-l-dashed { border-left: dashed 1
r
px #efefef; }
.br-r-dashed { border-right: dashed 1
r
px #efefef; }
.br-b-dashed { border-bottom: dashed 1px #efefef; }
.br-t-dashed { border-top: dashed 1px #efefef; }
.br-l-dashed { border-left: dashed 1px #efefef; }
.br-r-dashed { border-right: dashed 1px #efefef; }
/* 箭头符号 */
.arrow-right { background-image: url('data:image/svg+xml;charset=utf-8,<svg width="16" height="26" viewBox="0 0 16 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="UI-KIT_基础元件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="9.9基础元件" transform="translate(-5809.000000, -8482.000000)" fill="#C7C7CC"><polygon id="Disclosure-Indicator" points="5811 8482 5809 8484 5820.5 8495 5809 8506 5811 8508 5825 8495"></polygon></g></g></svg>'); background-size: 15px 10px; background-repeat: no-repeat; background-position: center right; }
...
...
alipay/pages/buy/buy.acss
浏览文件 @
b18dadfd
...
...
@@ -101,6 +101,10 @@
vertical-align: middle;
margin-right: 10rpx;
}
.payment-list .selected {
border: 1px solid #d2364c;
color: #d2364c;
}
/**
* 扩展数据
...
...
alipay/pages/buy/buy.axml
浏览文件 @
b18dadfd
...
...
@@ -57,7 +57,7 @@
<!-- 支付方式 -->
<view a:if="{{payment_list.length > 0}}" class="payment-list bg-white oh">
<view class="item tc fl" a:for="{{payment_list}}">
<view class="item-content br" data-value="{{item.id}}" onTap="payment_event">
<view class="item-content br
{{(item.selected || '')}}
" data-value="{{item.id}}" onTap="payment_event">
<image a:if="{{(item.logo || null) != null}}" class="icon" src="{{item.logo}}" mode="widthFix" />
<text>{{item.name}}</text>
</view>
...
...
alipay/pages/buy/buy.js
浏览文件 @
b18dadfd
...
...
@@ -172,7 +172,18 @@ Page({
// 支付方式选择
payment_event
(
e
)
{
var
payment_id
=
e
.
currentTarget
.
dataset
.
value
||
0
;
this
.
setData
({
payment_id
:
payment_id
});
var
temp_payment_list
=
this
.
data
.
payment_list
;
for
(
var
i
in
temp_payment_list
)
{
if
(
temp_payment_list
[
i
][
'
id
'
]
==
payment_id
)
{
temp_payment_list
[
i
][
'
selected
'
]
=
'
selected
'
;
}
else
{
temp_payment_list
[
i
][
'
selected
'
]
=
''
;
}
}
this
.
setData
({
payment_id
:
payment_id
,
payment_list
:
temp_payment_list
});
}
});
alipay/pages/goods-detail/goods-detail.js
浏览文件 @
b18dadfd
...
...
@@ -331,7 +331,7 @@ Page({
var
goods_attribute_choose
=
this
.
data
.
goods_attribute_choose
;
var
temp_attribute_active
=
this
.
data
.
temp_attribute_active
;
var
attr_count
=
goods_attribute_choose
.
length
;
var
attribute_all
=
[]
;
var
attribute_all
=
{}
;
if
(
attr_count
>
0
)
{
var
attr_active_count
=
app
.
get_length
(
temp_attribute_active
);
...
...
@@ -345,7 +345,7 @@ Page({
}
else
{
for
(
var
i
in
temp_attribute_active
)
{
attribute_all
.
push
(
goods_attribute_choose
[
i
][
'
id
'
]
+
'
:
'
+
goods_attribute_choose
[
i
][
'
find
'
][
temp_attribute_active
[
i
]][
'
id
'
])
;
attribute_all
[
goods_attribute_choose
[
i
][
'
id
'
]]
=
goods_attribute_choose
[
i
][
'
find
'
][
temp_attribute_active
[
i
]][
'
id
'
]
;
}
}
}
...
...
@@ -354,12 +354,12 @@ Page({
switch
(
this
.
data
.
buy_event_type
)
{
case
'
buy
'
:
// 进入订单确认页面
var
data
=
[
{
var
data
=
{
"
buy_type
"
:
"
goods
"
,
"
goods_id
"
:
this
.
data
.
goods
.
id
,
"
stock
"
:
this
.
data
.
temp_buy_number
,
"
attr
"
:
attribute_all
.
join
(
'
,
'
)
}
]
;
"
attr
"
:
JSON
.
stringify
(
attribute_all
)
};
my
.
navigateTo
({
url
:
'
/pages/buy/buy?data=
'
+
JSON
.
stringify
(
data
)
});
...
...
alipay/pages/user-order-detail/user-order-detail.acss
浏览文件 @
b18dadfd
...
...
@@ -24,6 +24,9 @@
line-height: 85rpx;
}
.goods-base {
min-height: 160rpx;
}
.goods .goods-item:not(:last-child) {
border-bottom: 1px dashed #efefef;
}
...
...
alipay/pages/user-order-detail/user-order-detail.axml
浏览文件 @
b18dadfd
...
...
@@ -21,11 +21,11 @@
{{attr.attr_type_name}}:{{attr.attr_name}}
</view>
</block>
<view class="oh goods-price"
>
<text class="sales-price">¥{{item.price}}</text
>
<text a:if="{{item.original_price > 0}}" class="original-price">¥{{item.original_
price}}</text>
<text class="buy-number">x{{item.buy_number
}}</text>
<
/view
>
</view
>
<view class="oh goods-price"
>
<text class="sales-price">¥{{item.
price}}</text>
<text a:if="{{item.original_price > 0}}" class="original-price">¥{{item.original_price
}}</text>
<
text class="buy-number">x{{item.buy_number}}</text
>
</view>
</navigator>
</view>
...
...
alipay/pages/user-order-detail/user-order-detail.js
浏览文件 @
b18dadfd
...
...
@@ -47,6 +47,7 @@ Page({
{
name
:
"
总价
"
,
value
:
data
.
total_price
},
{
name
:
"
优惠
"
,
value
:
data
.
preferential_price
},
{
name
:
"
支付金额
"
,
value
:
data
.
pay_price
},
{
name
:
"
支付方式
"
,
value
:
data
.
payment_name
},
{
name
:
"
快递公司
"
,
value
:
data
.
express_name
},
{
name
:
"
快递单号
"
,
value
:
data
.
expres_number
},
{
name
:
"
用户留言
"
,
value
:
data
.
user_note
},
...
...
alipay/pages/user-order/user-order.acss
浏览文件 @
b18dadfd
...
...
@@ -29,9 +29,6 @@
.search-btn .search-icon{
margin: 8rpx 0;
}
/*
end 头部搜索框
*/
/*
主体
...
...
@@ -39,7 +36,9 @@
.scroll-box{
height: calc(100vh - 120rpx);
}
.goods-base {
min-height: 160rpx;
}
.goods-title {
line-height: 36rpx;
}
...
...
@@ -77,4 +76,24 @@
}
.item-operation button {
padding: 0 35rpx;
}
/**
* 支付方式
*/
.payment-list {
padding: 40rpx 0;
}
.payment-list .item {
width: 50%;
}
.payment-list .item-content {
margin: 20rpx;
padding: 20rpx 10rpx;
}
.payment-list .item-content image {
width: 50rpx;
height: 50rpx !important;
vertical-align: middle;
margin-right: 10rpx;
}
\ No newline at end of file
alipay/pages/user-order/user-order.axml
浏览文件 @
b18dadfd
<!-- 搜索 -->
<view class="search-content bg-white">
<view class="search-box oh">
<input class="search" type="text" onInput="input_event" placeholder="收件人/电话/单号" />
...
...
@@ -6,6 +7,8 @@
</view>
</view>
</view>
<!-- 订单列表 -->
<scroll-view scroll-y="{{true}}" class="scroll-box" onScrollToLower="scroll_lower" lower-threshold="30">
<view class="list-content spacing">
<view class="list-item bg-white spacing-mb" a:if="{{data_list.length > 0}}" a:for="{{data_list}}">
...
...
@@ -23,11 +26,11 @@
{{attr.attr_type_name}}:{{attr.attr_name}}
</view>
</block>
<view class="oh goods-price"
>
<text class="sales-price">¥{{detail.price}}</text
>
<text a:if="{{detail.original_price > 0}}" class="original-price">¥{{detail.original_
price}}</text>
<text class="buy-number">x{{detail.buy_number
}}</text>
<
/view
>
</view
>
<view class="oh goods-price"
>
<text class="sales-price">¥{{detail.
price}}</text>
<text a:if="{{detail.original_price > 0}}" class="original-price">¥{{detail.original_price
}}</text>
<
text class="buy-number">x{{detail.buy_number}}</text
>
</view>
</navigator>
<view class="item-describe tr cr-666">{{item.describe}}
...
...
@@ -48,8 +51,22 @@
<template is="nodata" data="{{status: data_list_loding_status}}">
</template>
</view>
</view>
<import src="/pages/common/bottom_line.axml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}">
</template>
</scroll-view>
\ No newline at end of file
</view>
<import src="/pages/common/bottom_line.axml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}">
</template>
</scroll-view>
<!-- 支付方式 popup -->
<popup show="{{is_show_payment_popup}}" position="bottom" onClose="payment_popup_event_close">
<view a:if="{{payment_list.length > 0}}" class="payment-list oh bg-white">
<view class="item tc fl" a:for="{{payment_list}}">
<view class="item-content br" data-value="{{item.id}}" onTap="popup_payment_event">
<image a:if="{{(item.logo || null) != null}}" class="icon" src="{{item.logo}}" mode="widthFix" />
<text>{{item.name}}
</text>
</view>
</view>
</view>
<view a:else class="payment-list oh bg-white tc cr-888">没有支付方式</view>
</popup>
\ No newline at end of file
alipay/pages/user-order/user-order.js
浏览文件 @
b18dadfd
...
...
@@ -9,6 +9,11 @@ Page({
params
:
null
,
input_keyword_value
:
''
,
load_status
:
0
,
is_show_payment_popup
:
false
,
payment_list
:
[],
payment_id
:
0
,
temp_pay_value
:
0
,
temp_pay_index
:
0
,
},
onLoad
(
params
)
{
...
...
@@ -110,6 +115,7 @@ Page({
data_list_loding_status
:
3
,
data_page
:
this
.
data
.
data_page
+
1
,
load_status
:
1
,
payment_list
:
res
.
data
.
data
.
payment_list
||
[],
});
// 是否还有数据
...
...
@@ -167,10 +173,25 @@ Page({
},
// 支付
pay_event
(
e
,
order_id
,
index
)
{
var
id
=
e
.
target
.
dataset
.
value
;
var
index
=
e
.
target
.
dataset
.
index
;
this
.
pay_handle
(
id
,
index
);
pay_event
(
e
)
{
this
.
setData
({
is_show_payment_popup
:
true
,
temp_pay_value
:
e
.
target
.
dataset
.
value
,
temp_pay_index
:
e
.
target
.
dataset
.
index
,
});
},
// 支付弹窗关闭
payment_popup_event_close
(
e
)
{
this
.
setData
({
is_show_payment_popup
:
false
});
},
// 支付弹窗发起支付
popup_payment_event
(
e
)
{
var
payment_id
=
e
.
target
.
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
);
},
// 支付方法
...
...
@@ -182,7 +203,8 @@ Page({
url
:
app
.
get_request_url
(
"
Pay
"
,
"
Order
"
),
method
:
"
POST
"
,
data
:
{
id
:
order_id
id
:
order_id
,
payment_id
:
this
.
data
.
payment_id
,
},
dataType
:
"
json
"
,
success
:
res
=>
{
...
...
@@ -191,18 +213,23 @@ Page({
// 线下支付成功
if
(
res
.
data
.
data
.
is_under_line
==
1
)
{
var
temp_data_list
=
this
.
data
.
data_list
;
temp_data_list
[
index
][
"
status
"
]
=
2
;
temp_data_list
[
index
][
'
status
'
]
=
2
;
temp_data_list
[
index
][
'
status_name
'
]
=
'
待发货
'
;
this
.
setData
({
data_list
:
temp_data_list
});
my
.
showToast
({
type
:
"
success
"
,
content
:
'
支付成功
'
});
}
else
{
my
.
tradePay
({
orderStr
:
res
.
data
.
data
.
data
,
tradeNO
:
res
.
data
.
data
.
data
,
success
:
res
=>
{
// 数据设置
if
(
res
.
resultCode
==
"
9000
"
)
{
if
(
res
.
resultCode
==
9000
)
{
var
temp_data_list
=
this
.
data
.
data_list
;
temp_data_list
[
index
][
"
status
"
]
=
2
;
temp_data_list
[
index
][
'
status_
text
'
]
=
'
待发货
'
;
temp_data_list
[
index
][
'
status
'
]
=
2
;
temp_data_list
[
index
][
'
status_
name
'
]
=
'
待发货
'
;
this
.
setData
({
data_list
:
temp_data_list
});
}
...
...
@@ -212,7 +239,7 @@ Page({
"
/pages/paytips/paytips?code=
"
+
res
.
resultCode
+
"
&total_price=
"
+
t
emp_
data_list
[
index
][
'
total_price
'
]
t
his
.
data
.
data_list
[
index
][
'
total_price
'
]
});
},
fail
:
res
=>
{
...
...
alipay/pages/user-order/user-order.json
浏览文件 @
b18dadfd
{
"pullRefresh"
:
true
"pullRefresh"
:
true
,
"usingComponents"
:
{
"popup"
:
"mini-antui/es/popup/index"
}
}
\ No newline at end of file
service/Application/Api/Controller/BuyController.class.php
浏览文件 @
b18dadfd
...
...
@@ -48,7 +48,7 @@ class BuyController extends CommonController
public
function
Index
()
{
// 获取商品列表
$params
=
$
this
->
data_post
;
$params
=
$
_POST
;
$params
[
'user'
]
=
$this
->
user
;
$ret
=
BuyService
::
BuyTypeGoodsList
(
$params
);
...
...
@@ -94,7 +94,7 @@ class BuyController extends CommonController
*/
public
function
Add
()
{
$params
=
$
this
->
data_post
;
$params
=
$
_POST
;
$params
[
'user'
]
=
$this
->
user
;
$ret
=
BuyService
::
OrderAdd
(
$params
);
$this
->
ajaxReturn
(
$ret
[
'msg'
],
$ret
[
'code'
],
$ret
[
'data'
]);
...
...
service/Application/Api/Controller/OrderController.class.php
浏览文件 @
b18dadfd
...
...
@@ -65,11 +65,15 @@ class OrderController extends CommonController
);
$data
=
OrderService
::
OrderList
(
$data_params
);
// 支付方式
$payment_list
=
ResourcesService
::
BuyPaymentList
([
'is_enable'
=>
1
,
'is_open_user'
=>
1
]);
// 返回数据
$result
=
[
'total'
=>
$total
,
'page_total'
=>
$page_total
,
'data'
=>
$data
[
'data'
],
'payment_list'
=>
$payment_list
,
];
$this
->
ajaxReturn
(
L
(
'common_operation_success'
),
0
,
$result
);
}
...
...
service/Application/Service/BuyService.class.php
浏览文件 @
b18dadfd
...
...
@@ -344,10 +344,6 @@ class BuyService
$goods
[
0
][
'total_price'
]
=
$params
[
'stock'
]
*
$goods
[
0
][
'price'
];
// 属性
if
(
!
empty
(
$params
[
'attr'
]))
{
$params
[
'attr'
]
=
json_decode
(
$params
[
'attr'
],
true
);
}
$goods
[
0
][
'attribute'
]
=
self
::
GoodsAttrParsing
(
$params
);
return
DataReturn
(
L
(
'common_operation_success'
),
0
,
$goods
);
...
...
service/Application/Service/OrderService.class.php
浏览文件 @
b18dadfd
...
...
@@ -560,9 +560,6 @@ class OrderService
$order_pay_status
=
L
(
'common_order_pay_status'
);
foreach
(
$data
as
&
$v
)
{
// 订单基础
$v
[
'payment_name'
]
=
''
;
// 状态
$v
[
'status_name'
]
=
$order_status_list
[
$v
[
'status'
]][
'name'
];
...
...
@@ -572,6 +569,9 @@ class OrderService
// 快递公司
$v
[
'express_name'
]
=
ResourcesService
::
ExpressName
(
$v
[
'express_id'
]);
// 支付方式
$v
[
'payment_name'
]
=
(
$v
[
'status'
]
<=
1
)
?
null
:
ResourcesService
::
OrderPaymentName
(
$v
[
'id'
]);
// 收件人地址
$v
[
'receive_province_name'
]
=
ResourcesService
::
RegionName
(
$v
[
'receive_province'
]);
$v
[
'receive_city_name'
]
=
ResourcesService
::
RegionName
(
$v
[
'receive_city'
]);
...
...
service/Application/Service/ResourcesService.class.php
浏览文件 @
b18dadfd
...
...
@@ -39,6 +39,20 @@ class ResourcesService
return
empty
(
$express_id
)
?
null
:
M
(
'Express'
)
->
where
([
'id'
=>
intval
(
$express_id
)])
->
getField
(
'name'
);
}
/**
* 获取订单支付名称
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-19
* @desc description
* @param [int] $order_id [订单id]
*/
public
static
function
OrderPaymentName
(
$order_id
=
0
)
{
return
empty
(
$order_id
)
?
null
:
M
(
'PayLog'
)
->
where
([
'order_id'
=>
intval
(
$order_id
)])
->
getField
(
'payment_name'
);
}
/**
* 快递列表
* @author Devil
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录