Browse Source

订单列表改回到原来的样子了,加完分页,去掉确认数量的字段了

master
chenxuhui 7 years ago
parent
commit
015dccda00
3 changed files with 23 additions and 110 deletions
  1. +15
    -99
      pages/orderList/orderList.js
  2. +0
    -2
      pages/orderList/orderList.json
  3. +8
    -9
      pages/orderList/orderList.wxml

+ 15
- 99
pages/orderList/orderList.js View File

@ -3,97 +3,30 @@ const app = getApp();
var network = require("../../utils/net.js");
var timechage = require("../../utils/dateTimeUtil.js");
var PageSize = 10
var UnCheckPageIndex = 0
var CheckedPageIndex = 0
var PageIndex = 0
var getOrderList = '/MainSystem/B3MiniProgramRpc/XuRpcs/Driver/CarRecordRpc/GetList'
// 未审核订单列表
function getUnCheckOrderList(that, UnCheckPageIndex, successaction) {
let getArr = [];
let method = getListPath;
let params = [false, app.globalData.Phone, UnCheckPageIndex, PageSize];
network.transfer_request(method, params, function (res) {
successaction();
var array = res.result;
if (array.length <= 0) {
wx.showToast({
title: '无数据更新',
})
UnCheckPageIndex = UnCheckPageIndex - 1;
return;
}
for (var i = 0; i < array.length; i++) {
var dmo = {
OrderState: "未审核",
ID: array[i].ID,
Employee_Name: array[i].Employee_Name,
TotalNumber: array[i].TotalNumber,
Customer_Name: array[i].Customer_Name,
LoadTime: timechage.formatTimeTwo(array[i].LoadTime.substring(6, 19), 'Y/M/D'),
Address: array[i].Address,
}
getArr.push(dmo);
}
let arrLast = that.data.unCheckDataArr.concat(getArr);
that.setData({
unCheckDataArr: arrLast,
})
})
}
// 已审核订单列表
function getCheckedOrderList(that, CheckedPageIndex) {
let getArr = [];
let method = getListPath;
let params = [true, app.globalData.Phone, CheckedPageIndex, PageSize];
network.transfer_request(method, params, function (res) {
var array = res.result;
if (array.length <= 0) {
wx.showToast({
title: '无数据更新',
})
CheckedPageIndex = CheckedPageIndex - 1;
return;
}
for (var i = 0; i < array.length; i++) {
var dmo = {
//添加单据状态的传递,在详情页面判断此值,进行是否允许提交的操作
OrderState: "已审核",
ID: array[i].ID,
Employee_Name: array[i].Employee_Name,
TotalNumber: array[i].TotalNumber,
Customer_Name: array[i].Customer_Name,
LoadTime: timechage.formatTimeTwo(array[i].LoadTime.substring(6, 19), 'Y/M/D'),
Address: array[i].Address,
}
getArr.push(dmo);
}
let arrLast = that.data.checkedDataArr.concat(getArr);
// console.log(arrLast);
that.setData({
checkedDataArr: arrLast,
})
})
}
Page({
data: {
checkedDataArr: [],
unCheckDataArr: [],
winHeight: app.globalData.winHeight,
currentTab: 0,
orderList: [],
},
onShow: function(options) {
PageIndex = 0;
this.getOrderList();
},
getOrderList:function (){
var that = this;
var method = getOrderList;
network.transfer_request(method, [app.globalData.Phone], function(res) {
network.transfer_request(method, [app.globalData.Phone, PageIndex, PageSize], function (res) {
var array = res.result;
if (array.length <= 0) {
wx: wx.showToast({
title: '暂无订单数据',
})
PageIndex = PageIndex - 1;
return;
}
let getArr = [];
@ -108,8 +41,9 @@ Page({
}
getArr.push(dmo);
}
let arrLast = that.data.orderList.concat(getArr);
that.setData({
orderList: getArr,
orderList: arrLast,
})
})
},
@ -121,28 +55,10 @@ Page({
url: 'orderDetail/orderDetail?id=' + itemID,
})
},
/**
* 滑动切换tab
*/
bindChange: function (e) {
var that = this;
that.setData({
currentTab: e.detail.current
});
},
/**
* 点击tab切换
*/
swichNav: function (e) {
var that = this;
if (this.data.currentTab === e.target.dataset.current) {
return false;
} else {
that.setData({
currentTab: e.target.dataset.current
})
}
},
onReachBottom :function(){
PageIndex = PageIndex + 1;
this.getOrderList();
}
})

+ 0
- 2
pages/orderList/orderList.json View File

@ -1,5 +1,3 @@
{
"navigationBarBackgroundColor": "white",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "我的订单"
}

+ 8
- 9
pages/orderList/orderList.wxml View File

@ -1,11 +1,10 @@
<!--pages/orderList/orderList.wxml-->
<view class="swiper-tab">
<!-- <view class="swiper-tab">
<view class="swiper-tab-list {{currentTab==0 ? 'on' : ''}}" data-current="0" bindtap="swichNav">未确认</view>
<view class="swiper-tab-list {{currentTab==1 ? 'on' : ''}}" data-current="1" bindtap="swichNav">已确认</view>
</view>
</view> -->
<swiper current="{{currentTab}}" class="swiper-box" style='height:{{winHeight -55}}px' duration="300" bindchange="bindChange">
<!-- 未审核 -->
<!-- <swiper current="{{currentTab}}" class="swiper-box" style='height:{{winHeight -55}}px' duration="300" bindchange="bindChange">
<swiper-item class="swiper-items1">
<scroll-view scroll-y="true" class='scroll-views' bindscrolltolower="unCheckedScrollLower">
@ -14,18 +13,18 @@
</block>
</scroll-view>
</swiper-item>
</swiper-item> -->
<swiper-item class="swiper-items2">
<scroll-view scroll-y="true" class='scroll-views' bindscrolltolower="checkedScrollLower">
<!-- <swiper-item class="swiper-items2">
<scroll-view scroll-y="true" class='scroll-views' bindscrolltolower="checkedScrollLower"> -->
<block wx:for="{{orderList}}" wx:key="item">
<template is="outStoreOrderTemplate" data="{{item}}" />
</block>
</scroll-view>
<!-- </scroll-view>
</swiper-item>
</swiper>
</swiper> -->
<template name="outStoreOrderTemplate">


Loading…
Cancel
Save