Browse Source

司机销售订单列表区分已确认未确认,页面完成,待变更接口

master
chenxuhui 7 years ago
parent
commit
06026fed13
3 changed files with 127 additions and 16 deletions
  1. +98
    -0
      pages/orderList/orderList.js
  2. +27
    -5
      pages/orderList/orderList.wxml
  3. +2
    -11
      pages/orderList/orderList.wxss

+ 98
- 0
pages/orderList/orderList.js View File

@ -2,10 +2,86 @@
const app = getApp(); const app = getApp();
var network = require("../../utils/net.js"); var network = require("../../utils/net.js");
var timechage = require("../../utils/dateTimeUtil.js"); var timechage = require("../../utils/dateTimeUtil.js");
var PageSize = 10
var UnCheckPageIndex = 0
var CheckedPageIndex = 0
var getOrderList = '/MainSystem/B3MiniProgramRpc/XuRpcs/Driver/CarRecordRpc/GetList' 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({ Page({
data: { data: {
checkedDataArr: [],
unCheckDataArr: [],
winHeight: app.globalData.winHeight,
currentTab: 0,
orderList: [], orderList: [],
}, },
@ -45,6 +121,28 @@ Page({
url: 'orderDetail/orderDetail?id=' + itemID, 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
})
}
},
}) })

+ 27
- 5
pages/orderList/orderList.wxml View File

@ -1,11 +1,33 @@
<!--pages/orderList/orderList.wxml--> <!--pages/orderList/orderList.wxml-->
<view class='container'>
<block wx:for="{{orderList}}" wx:key="item">
<template is="outStoreOrderTemplate" data="{{item}}" />
</block>
<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-item class="swiper-items1">
<scroll-view scroll-y="true" class='scroll-views' bindscrolltolower="unCheckedScrollLower">
<block wx:for="{{orderList}}" wx:key="item">
<template is="outStoreOrderTemplate" data="{{item}}" />
</block>
</scroll-view>
</swiper-item>
<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>
</swiper-item>
</swiper>
<template name="outStoreOrderTemplate"> <template name="outStoreOrderTemplate">
<view class='listContainer'> <view class='listContainer'>
<view class='listItem' catchtap='transToOrderDetail' data-detailitemid='{{item.ID}}'> <view class='listItem' catchtap='transToOrderDetail' data-detailitemid='{{item.ID}}'>


+ 2
- 11
pages/orderList/orderList.wxss View File

@ -37,21 +37,12 @@ page {
overflow: hidden; overflow: hidden;
} }
.swiper-items1 {
height: 100%;
}
.swiper-items2 {
height: 100%;
}
.scroll-views {
height: 100%;
.scroll-views {
width: 100%; width: 100%;
height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.listContainer{ .listContainer{
background-color: #fff; background-color: #fff;
} }


Loading…
Cancel
Save