order
parent
9c45b046e3
commit
c1d3a73038
|
|
@ -47,7 +47,7 @@ App({
|
|||
|
||||
// 请求地址
|
||||
request_url: "https://demo.shopxo.net/",
|
||||
//request_url: 'http://localhost/project/shopxo/service/',
|
||||
request_url: 'http://localhost/project/shopxo/service/',
|
||||
|
||||
// 基础信息
|
||||
application_title: "ShopXO电商系统",
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"pages": [
|
||||
"pages": ["pages/user/user",
|
||||
"pages/index/index",
|
||||
"pages/goods-category/goods-category",
|
||||
"pages/cart/cart",
|
||||
"pages/user/user",
|
||||
|
||||
"pages/web-view/web-view",
|
||||
"pages/login/login",
|
||||
"pages/paytips/paytips",
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
|
|
@ -16,7 +16,7 @@ Page({
|
|||
temp_pay_index: 0,
|
||||
nav_status_list: [
|
||||
{ name: "全部", value: "-1" },
|
||||
{ name: "待付款", value: "0,1" },
|
||||
{ name: "待付款", value: "1" },
|
||||
{ name: "待发货", value: "2" },
|
||||
{ name: "待收货", value: "3" },
|
||||
{ name: "已完成", value: "4" },
|
||||
|
|
@ -26,7 +26,21 @@ Page({
|
|||
},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({params: params});
|
||||
// 是否指定状态
|
||||
var nav_status_index = 0;
|
||||
if ((params.status || null) != null) {
|
||||
for (var i in this.data.nav_status_list) {
|
||||
if (this.data.nav_status_list[i]['value'] == params.status) {
|
||||
nav_status_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
params: params,
|
||||
nav_status_index: nav_status_index,
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
|
|
@ -122,7 +136,6 @@ Page({
|
|||
data_page: this.data.data_page + 1,
|
||||
load_status: 1,
|
||||
payment_list: res.data.data.payment_list || [],
|
||||
nav_status_list: res.data.data.nav_status_list || [],
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
padding: 30rpx 10rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.head-item .portrait{
|
||||
.head-item .avatar {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 50%;
|
||||
|
|
@ -27,6 +27,7 @@
|
|||
}
|
||||
.nav-box .nav-item .item-icon{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.nav-box .nav-item .item-name{
|
||||
|
|
@ -35,4 +36,24 @@
|
|||
.nav-box .nav-item .item-arrow{
|
||||
width: 25rpx;
|
||||
}
|
||||
|
||||
.items-list {
|
||||
padding: 15rpx 0;
|
||||
}
|
||||
.items-list .items {
|
||||
width: 25%;
|
||||
position: relative;
|
||||
}
|
||||
.items-list .items .items-icon {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
margin-bottom: 6rpx;
|
||||
}
|
||||
.items-list .items .am-badge {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: calc(50% + 30rpx);
|
||||
}
|
||||
|
||||
|
||||
.user-notice { margin-top: 20rpx; padding: 0 10rpx 20rpx 10rpx; }
|
||||
|
|
@ -1,17 +1,32 @@
|
|||
<view class="head-box bg-main">
|
||||
<view class="head-item oh tc">
|
||||
<image onTap="preview_event" onError="user_avatar_error" class="portrait" src="{{avatar}}" mode="widthFix" />
|
||||
<image onTap="preview_event" onError="user_avatar_error" class="avatar" src="{{avatar}}" mode="widthFix" />
|
||||
<text class="item-name dis-block cr-fff">{{nickname}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="nav-box bg-white">
|
||||
<navigator a:for="{{lists}}" a:if="{{item.is_show == 1}}" url="/pages/{{item.url}}/{{item.url}}" class="nav-item br-b">
|
||||
<block a:for="{{lists}}">
|
||||
<view a:if="{{item.is_show == 1}}">
|
||||
<navigator url="/pages/{{item.url}}/{{item.url}}" class="nav-item br-b">
|
||||
<view class="arrow-right">
|
||||
<image src="/images/{{item.icon}}.png" class="item-icon" mode="widthFix" />
|
||||
<text class="item-name">{{item.name}}</text>
|
||||
<image src="/images/{{item.icon}}.png" class="item-icon" mode="widthFix" />
|
||||
<text class="item-name">{{item.name}}</text>
|
||||
</view>
|
||||
</navigator>
|
||||
</navigator>
|
||||
</view>
|
||||
<view a:if="{{item.url == 'user-order' && user_order_status_list.length > 0}}" class="items-list br-b oh">
|
||||
<block a:for="{{user_order_status_list}}" a:for-item="items">
|
||||
<navigator url="/pages/{{item.url}}/{{item.url}}?status={{items.status}}">
|
||||
<view class="items fl tc">
|
||||
<badge a:if="{{items.count > 0}}" text="{{items.count}}" dot="{{false}}"></badge>
|
||||
<image src="/images/user-index-nav-order-icon-{{items.status}}.png" class="items-icon" mode="aspectFill" />
|
||||
<view class="items-name">{{items.name}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<view class="nav-item br-b" onTap="clear_storage">
|
||||
<image src="/images/user-nav-cache-icon.png" class="item-icon" mode="widthFix" />
|
||||
|
|
|
|||
|
|
@ -8,20 +8,25 @@ Page({
|
|||
agreement_url: '',
|
||||
customer_service_tel: null,
|
||||
common_user_center_notice: null,
|
||||
|
||||
user_order_status_list: [
|
||||
{ name: "待付款", status: 1, count: 0 },
|
||||
{ name: "待发货", status: 2, count: 0 },
|
||||
{ name: "待收货", status: 3, count: 0 },
|
||||
{ name: "已完成", status: 4, count: 0 },
|
||||
],
|
||||
lists: [
|
||||
{
|
||||
url: "user-order",
|
||||
icon: "user-nav-order-icon",
|
||||
is_show: 1,
|
||||
name: "我的订单",
|
||||
},
|
||||
{
|
||||
url: "user-address",
|
||||
icon: "user-nav-address-icon",
|
||||
is_show: 1,
|
||||
name: "我的地址"
|
||||
},
|
||||
{
|
||||
url: "user-order",
|
||||
icon: "user-nav-booking-order-icon",
|
||||
is_show: 1,
|
||||
name: "我的订单"
|
||||
},
|
||||
{
|
||||
url: "user-faovr",
|
||||
icon: "user-nav-faovr-icon",
|
||||
|
|
@ -83,22 +88,28 @@ Page({
|
|||
my.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
|
||||
// 订单数量处理
|
||||
var temp_user_order_status_list = this.data.user_order_status_list;
|
||||
if ((data.user_order_status || null) != null && data.user_order_status.length > 0) {
|
||||
for (var i in temp_user_order_status_list) {
|
||||
for (var t in data.user_order_status) {
|
||||
if (temp_user_order_status_list[i]['status'] == data.user_order_status[t]['status']) {
|
||||
temp_user_order_status_list[i]['count'] = data.user_order_status[t]['count'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
user_order_status_list: temp_user_order_status_list,
|
||||
customer_service_tel: data.customer_service_tel || null,
|
||||
common_user_center_notice: data.common_user_center_notice || null,
|
||||
avatar: (data.avatar != null) ? data.avatar : this.data.avatar,
|
||||
nickname: (data.nickname != null) ? data.nickname : this.data.nickname,
|
||||
integral: (data.integral != null) ? data.integral : this.data.integral,
|
||||
});
|
||||
if(data.avatar != null)
|
||||
{
|
||||
this.setData({avatar: data.avatar});
|
||||
}
|
||||
if(data.nickname != null)
|
||||
{
|
||||
this.setData({nickname: data.nickname});
|
||||
}
|
||||
if(data.integral != null)
|
||||
{
|
||||
this.setData({integral: data.integral});
|
||||
}
|
||||
} else {
|
||||
my.showToast({
|
||||
type: "fail",
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
{
|
||||
"pullRefresh": true
|
||||
"pullRefresh": true,
|
||||
"usingComponents": {
|
||||
"badge": "mini-antui/es/badge/index"
|
||||
}
|
||||
}
|
||||
|
|
@ -68,23 +68,12 @@ class OrderController extends CommonController
|
|||
// 支付方式
|
||||
$payment_list = ResourcesService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1]);
|
||||
|
||||
// 导航状态列表
|
||||
$nav_status_list = [
|
||||
['name'=>'全部', 'value'=>'-1'],
|
||||
['name'=>'待付款', 'value'=>'0,1'],
|
||||
['name'=>'待发货', 'value'=>'2'],
|
||||
['name'=>'待收货', 'value'=>'3'],
|
||||
['name'=>'已完成', 'value'=>'4'],
|
||||
['name'=>'已失效', 'value'=>'5,6'],
|
||||
];
|
||||
|
||||
// 返回数据
|
||||
$result = [
|
||||
'total' => $total,
|
||||
'page_total' => $page_total,
|
||||
'data' => $data['data'],
|
||||
'payment_list' => $payment_list,
|
||||
'nav_status_list' => $nav_status_list,
|
||||
];
|
||||
$this->ajaxReturn(L('common_operation_success'), 0, $result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Api\Controller;
|
||||
|
||||
use Service\OrderService;
|
||||
|
||||
/**
|
||||
* 用户
|
||||
* @author Devil
|
||||
|
|
@ -235,6 +237,9 @@ class UserController extends CommonController
|
|||
// 登录校验
|
||||
$this->Is_Login();
|
||||
|
||||
// 用户订单状态
|
||||
$user_order_status = OrderService::OrderStatusStepTotal(['user_type'=>'user', 'user'=>$this->user, 'is_comments'=>1]);
|
||||
|
||||
// 初始化数据
|
||||
$result = array(
|
||||
'integral' => $this->user['integral'],
|
||||
|
|
@ -243,6 +248,7 @@ class UserController extends CommonController
|
|||
'username' => $this->user['username'],
|
||||
'customer_service_tel' => MyC('common_customer_service_tel'),
|
||||
'common_user_center_notice' => MyC('common_user_center_notice'),
|
||||
'user_order_status' => $user_order_status['data'],
|
||||
);
|
||||
|
||||
// 返回数据
|
||||
|
|
|
|||
|
|
@ -1245,7 +1245,7 @@ class OrderService
|
|||
$order_status_list = L('common_order_user_status');
|
||||
foreach(L('common_order_user_status') as $v)
|
||||
{
|
||||
$result[$v['id']] = [
|
||||
$result[] = [
|
||||
'name' => $v['name'],
|
||||
'status' => $v['id'],
|
||||
'count' => 0,
|
||||
|
|
@ -1255,15 +1255,17 @@ class OrderService
|
|||
// 数据处理
|
||||
if(!empty($data))
|
||||
{
|
||||
|
||||
foreach($data as $v)
|
||||
foreach($result as &$v)
|
||||
{
|
||||
if(isset($result[$v['status']]))
|
||||
foreach($data as $vs)
|
||||
{
|
||||
$result[$v['status']]['count'] = $v['count'];
|
||||
if($v['status'] == $vs['status'])
|
||||
{
|
||||
$v['count'] = $vs['count'];
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
sort($result);
|
||||
}
|
||||
|
||||
// 待评价状态站位100
|
||||
|
|
|
|||
Loading…
Reference in New Issue