Browse Source

创建项目

master
chenxuhui 7 years ago
commit
2a2d92bf6d
43 changed files with 1291 additions and 0 deletions
  1. +26
    -0
      app.js
  2. +40
    -0
      app.json
  3. +1
    -0
      app.wxss
  4. BIN
      imgs/backGroundImage.png
  5. BIN
      imgs/beijingtu.png
  6. BIN
      imgs/bindImage.png
  7. BIN
      imgs/btnBackGround.png
  8. BIN
      imgs/carsApply.png
  9. BIN
      imgs/homePage.png
  10. BIN
      imgs/homePageSelected.png
  11. BIN
      imgs/jiantou.png
  12. BIN
      imgs/message.png
  13. BIN
      imgs/messageSelected.png
  14. BIN
      imgs/mine.png
  15. BIN
      imgs/mineSelected.png
  16. BIN
      imgs/myOrder.png
  17. BIN
      imgs/outStore.png
  18. +8
    -0
      pages/headerTitleTemplate/headerTitleTemplate.wxml
  19. +35
    -0
      pages/headerTitleTemplate/headerTitleTemplate.wxss
  20. +36
    -0
      pages/homePage/homePage.js
  21. +5
    -0
      pages/homePage/homePage.json
  22. +21
    -0
      pages/homePage/homePage.wxml
  23. +50
    -0
      pages/homePage/homePage.wxss
  24. +66
    -0
      pages/message/message.js
  25. +1
    -0
      pages/message/message.json
  26. +2
    -0
      pages/message/message.wxml
  27. +1
    -0
      pages/message/message.wxss
  28. +30
    -0
      pages/mine/mine.js
  29. +3
    -0
      pages/mine/mine.json
  30. +16
    -0
      pages/mine/mine.wxml
  31. +53
    -0
      pages/mine/mine.wxss
  32. +98
    -0
      pages/orderList/orderDetail/orderDetail.js
  33. +5
    -0
      pages/orderList/orderDetail/orderDetail.json
  34. +111
    -0
      pages/orderList/orderDetail/orderDetail.wxml
  35. +145
    -0
      pages/orderList/orderDetail/orderDetail.wxss
  36. +166
    -0
      pages/orderList/orderList.js
  37. +5
    -0
      pages/orderList/orderList.json
  38. +47
    -0
      pages/orderList/orderList.wxml
  39. +106
    -0
      pages/orderList/orderList.wxss
  40. +59
    -0
      project.config.json
  41. +35
    -0
      utils/dateTimeUtil.js
  42. +101
    -0
      utils/net.js
  43. +19
    -0
      utils/util.js

+ 26
- 0
app.js View File

@ -0,0 +1,26 @@
//app.js
var app = getApp();
App({
onShow: function (options) {
var extraData = null;
//options.referrerInfo.extraData = { orderID: 33 };
// 判断是否点击其他小程序分享进入
if (options.referrerInfo.extraData) {
extraData = options.referrerInfo.extraData
this.globalData.shareOrderID = extraData.orderID;
};
},
globalData: {
UserName:"",
shareOrderID: 0,
OpenId: "",
AppId: "wx246fd8f3a0273f2f",
Phone: "",
From: "",
baseUrl: "https://miniprogram.food988.com/Rest.aspx",
TransferBaseUrl: "https://miniprogram.food988.com/RequestTransfer.aspx",
CustomerId: "",
}
})

+ 40
- 0
app.json View File

@ -0,0 +1,40 @@
{
"pages": [
"pages/homePage/homePage",
"pages/message/message",
"pages/mine/mine",
"pages/orderList/orderList",
"pages/orderList/orderDetail/orderDetail"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarTitleText": "畜司机易",
"navigationBarBackgroundColor": "#2689f8",
"navigationBarTextStyle": "#FFFFFF"
},
"tabBar": {
"borderStyle": "white",
"selectedColor": "#2689f8",
"color": "#999999",
"list": [
{
"pagePath": "pages/homePage/homePage",
"text": "首页",
"iconPath": "/imgs/homePage.png",
"selectedIconPath": "/imgs/homePageSelected.png"
},
{
"pagePath": "pages/message/message",
"text": "消息",
"iconPath": "/imgs/message.png",
"selectedIconPath": "/imgs/messageSelected.png"
},
{
"pagePath": "pages/mine/mine",
"text": "我的",
"iconPath": "/imgs/mine.png",
"selectedIconPath": "/imgs/mineSelected.png"
}
]
}
}

+ 1
- 0
app.wxss View File

@ -0,0 +1 @@
/**app.wxss**/

BIN
imgs/backGroundImage.png View File

Before After
Width: 1242  |  Height: 434  |  Size: 358 KiB

BIN
imgs/beijingtu.png View File

Before After
Width: 1242  |  Height: 433  |  Size: 68 KiB

BIN
imgs/bindImage.png View File

Before After
Width: 376  |  Height: 80  |  Size: 10 KiB

BIN
imgs/btnBackGround.png View File

Before After
Width: 1207  |  Height: 258  |  Size: 9.1 KiB

BIN
imgs/carsApply.png View File

Before After
Width: 140  |  Height: 140  |  Size: 13 KiB

BIN
imgs/homePage.png View File

Before After
Width: 81  |  Height: 81  |  Size: 2.3 KiB

BIN
imgs/homePageSelected.png View File

Before After
Width: 81  |  Height: 81  |  Size: 1.9 KiB

BIN
imgs/jiantou.png View File

Before After
Width: 50  |  Height: 50  |  Size: 1.6 KiB

BIN
imgs/message.png View File

Before After
Width: 81  |  Height: 81  |  Size: 2.8 KiB

BIN
imgs/messageSelected.png View File

Before After
Width: 81  |  Height: 81  |  Size: 2.4 KiB

BIN
imgs/mine.png View File

Before After
Width: 81  |  Height: 81  |  Size: 2.7 KiB

BIN
imgs/mineSelected.png View File

Before After
Width: 81  |  Height: 81  |  Size: 2.0 KiB

BIN
imgs/myOrder.png View File

Before After
Width: 140  |  Height: 140  |  Size: 10 KiB

BIN
imgs/outStore.png View File

Before After
Width: 140  |  Height: 140  |  Size: 10 KiB

+ 8
- 0
pages/headerTitleTemplate/headerTitleTemplate.wxml View File

@ -0,0 +1,8 @@
<template name="headerTitleTemplate">
<view class="swiper-tab">
<view class='lineView'></view>
<block wx:for="{{titleArr}}" wx:for-index="idx" wx:key="itemName">
<view class="swiper-tab-list {{currentTab==idx?'on':''}}" data-current="idx" bindtap="swichNav">{{itemName}} </view>
</block>
</view>
</template>

+ 35
- 0
pages/headerTitleTemplate/headerTitleTemplate.wxss View File

@ -0,0 +1,35 @@
.swiper-tab {
margin-left: 20px;
margin-right: 20px;
margin-top: 10px;
margin-bottom: 10px;
height: 25px;
text-align: center;
font-size: 30rpx;
line-height: 25px;
background: white;
display: flex;
flex-direction: row;
justify-content: space-around;
border-radius: 3px;
border: 1px solid#2E8CF5;
}
.lineView{
height: 25px;
width: 0.5px;
}
.swiper-tab-list {
width: 50%;
height: 100%;
background-color:red;
color: #999;
}
.on {
background-color:#2E8CF5;
color: #2E8CF5;
}

+ 36
- 0
pages/homePage/homePage.js View File

@ -0,0 +1,36 @@
// pages/homePage/homePage.js
Page({
data: {
},
onLoad: function (options) {
},
transBtnClicked: function (event) {
var btnID = event.currentTarget.dataset.itemid;
var transferURL = '';
switch (btnID) {
// 我的订单
case "1":
transferURL = '/pages/orderList/orderList';
break;
// 车辆申请
case "2":
transferURL = '/pages/orderList/orderList';
break;
// 销售出库
case "3":
transferURL = '/pages/outStoreOrderList/outStoreOrderList';
break;
}
wx.navigateTo({
url: transferURL,
})
},
})

+ 5
- 0
pages/homePage/homePage.json View File

@ -0,0 +1,5 @@
{
"navigationBarTitleText": "我的业务",
"navigationBarBackgroundColor": "#2689f8",
"navigationBarTextStyle": "white"
}

+ 21
- 0
pages/homePage/homePage.wxml View File

@ -0,0 +1,21 @@
<!--pages/homePage/homePage.wxml-->
<view class='imageContainer'>
<image class='beijingtu' src='/imgs/backGroundImage.png'></image>
</view>
<view class="body-box">
<view class="ico" catchtap='transBtnClicked' data-itemid='1'>
<image src="/imgs/myOrder.png"></image>
<text class='text'>我的订单</text>
</view>
<view class="ico" catchtap='transBtnClicked' data-itemid='2'>
<image src="/imgs/carsApply.png"></image>
<text class='text'>车辆申请</text>
</view>
<view class="ico" catchtap='transBtnClicked' data-itemid='3'>
<image src="/imgs/outStore.png"></image>
<text class='text'>销售出库</text>
</view>
</view>

+ 50
- 0
pages/homePage/homePage.wxss View File

@ -0,0 +1,50 @@
/* pages/homePage/homePage.wxss */
page{
background:#EAF1F8;
}
.imageContainer{
width: 100%;
height: 280rpx;
background-color: #2E8CF5;
}
.beijingtu{
width: 100%;
height: 100%;
}
.body-box{
width: 100%;
display: flex;
flex-wrap: wrap;
background: white;
background: #FEFFFF;
overflow: hidden;
margin-top: 1rpx;
}
.ico{
height: 190rpx;
width:25%;
text-align: center;
display: flex;
flex-direction: column;
padding-top: 15rpx;
}
.ico image{
display: block;
width: 50%;
height: 50%;
margin-left: 25%;
margin-top: 15rpx;
}
.text{
color: #353535;
margin-top: 10rpx;
font-size: 28rpx;
}

+ 66
- 0
pages/message/message.js View File

@ -0,0 +1,66 @@
// pages/message/message.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

+ 1
- 0
pages/message/message.json View File

@ -0,0 +1 @@
{}

+ 2
- 0
pages/message/message.wxml View File

@ -0,0 +1,2 @@
<!--pages/message/message.wxml-->
<text>pages/message/message.wxml</text>

+ 1
- 0
pages/message/message.wxss View File

@ -0,0 +1 @@
/* pages/message/message.wxss */

+ 30
- 0
pages/mine/mine.js View File

@ -0,0 +1,30 @@
// pages/mine/mine.js
var app = getApp()
var network = require("../../utils/net.js");
Page({
data: {
meName: "",
mePhone: 0,
avatarUrl: "../../imgs/carsApply.png"
},
onLoad: function(options) {
// var that = this;
// // 获取用户信息
// var method = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/AccountRpc/GetBindEmpolyee';
// var params = [
// app.globalData.openID,
// ];
// network.newRequestLoading(method, params, function(res) {
// //res就是我们请求接口返回的数据
// that.setData({
// meName: res.result.Bind_Name,
// mePhone: res.result.Phone,
// avatarUrl: res.result.HeadImgUrl
// })
// })
},
})

+ 3
- 0
pages/mine/mine.json View File

@ -0,0 +1,3 @@
{
"navigationBarTitleText": "我的"
}

+ 16
- 0
pages/mine/mine.wxml View File

@ -0,0 +1,16 @@
<!--pages/mine/mine.wxml-->
<view class='view_me_main'>
<image class="userinfo-avatar" src="{{avatarUrl}}" mode="cover"></image>
<view class='view_me_infos'>
<text class='view_me_text'>{{meName}}李丽丽</text>
<text class='view_me_text'>{{mePhone}}1234567890</text>
</view>
</view>
<view class='unregirst'>设置
<image class='unregirstImage' src='/imgs/jiantou.png'>
</image>
</view>

+ 53
- 0
pages/mine/mine.wxss View File

@ -0,0 +1,53 @@
/* pages/mine/mine.wxss */
page {
background:#EAF1F8;
}
.view_me_main {
display: flex;
flex-direction: row;
background: #2E8CF5;
padding-top: 40rpx;
padding-left: 5%;
padding-bottom: 40rpx;
}
.userinfo-avatar {
width: 128rpx;
height: 128rpx;
border-radius: 50%;
}
.view_me_infos {
display: flex;
flex-direction: column;
justify-content: center;
padding-left: 30rpx;
}
.view_me_text {
font-size: 32rpx;
color: white;
margin-top: 10rpx;
}
.unregirst {
font-size: 32rpx;
text-align: left;
background: white;
padding-left: 20rpx;
padding-top: 20rpx;
padding-bottom: 20rpx;
margin-top: 20rpx;
color: #353535;
}
.unregirstImage{
height: 30rpx;
width: 30rpx;
padding-top: 10rpx;
padding-bottom: 15rpx;
position: absolute;
right: 20rpx;
}

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

@ -0,0 +1,98 @@
// pages/orderList/orderBaseInfo/orderBaseInfo.js
var network = require("../../../utils/net.js");
const app = getApp();
function getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize) {
let getArr = [];
let method = outStoreMethod;
let params = [true, CheckedPageIndex, CheckedPageSize];
network.newRequestLoading(method, params, function(res) {
var array = res.result;
if (array.length <= 0) {
wx.showToast({
title: '无数据更新',
})
if (CheckedPageIndex > 0) {
CheckedPageIndex = CheckedPageIndex - 1;
}
return;
}
for (var i = 0; i < array.length; i++) {
var dmo = {
//是否显示审批按钮所在bottom
billState: false,
billType: array[i].BillType_Name,
billID: array[i].Bill_ID,
remark: array[i].Remark,
time: timechage.formatTimeTwo(array[i].CreateTime.substring(6, 19), 'Y/M/D h:m')
}
getArr.push(dmo);
}
let arrLast = that.data.checkedDataArr.concat(getArr);
that.setData({
checkedDataArr: arrLast,
})
})
}
Page({
data: {
currentTab: 0,
winHeight: 0,
winWidth: 0,
detaileList:[1,1,3,4,5,6,7,7,4,7,7,7,7,7,7,7,7,7,7,7,7,4,7,7,7],
},
onLoad: function(options) {
var that = this;
let ID = Number(options.ID);
wx.getSystemInfo({
success: function (res) {
that.setData({
winWidth: res.windowWidth,
winHeight: res.windowHeight
});
}
});
},
/**
* 滑动切换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
})
}
},
//未审核订单滑动到底部加载
unCheckedScrollLower: function(event) {
var that = this;
UnCheckPageIndex = UnCheckPageIndex + 1;
getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, function(res) {});
},
//已审核订单滑动到底部加载
CheckedScrollLower: function(event) {
var that = this;
CheckedPageIndex = CheckedPageIndex + 1;
getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize);
},
})

+ 5
- 0
pages/orderList/orderDetail/orderDetail.json View File

@ -0,0 +1,5 @@
{
"navigationBarBackgroundColor": "white",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "订单详情"
}

+ 111
- 0
pages/orderList/orderDetail/orderDetail.wxml View File

@ -0,0 +1,111 @@
<!--pages/orderList/orderBaseInfo/orderBaseInfo.wxml-->
<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>
<swiper current="{{currentTab}}" class="swiper-box" duration="300" style="height:{{winHeight - 55}}px" bindchange="bindChange">
<!-- 基本信息 -->
<swiper-item class="swiper-items1">
<view class='baseitem'>
<text class='baseitem_key'>订货时间</text>
<view class='baseitem_value'>
{{customerName}}基本信息
</view>
</view>
<view class='baseitem'>
<text class='baseitem_key'>提货时间</text>
<view class='baseitem_value'>
{{customerName}}
</view>
</view>
<view class='baseitem'>
<text class='baseitem_key'>会计单位</text>
<view class='baseitem_value'>
{{customerName}}
</view>
</view>
<view class='baseitem'>
<text class='baseitem_key'>购货客户</text>
<view class='baseitem_value'>
{{customerName}}
</view>
</view>
<view class='baseitem'>
<text class='baseitem_key'>销售部门</text>
<view class='baseitem_value'>
{{customerName}}
</view>
</view>
<view class='baseitem'>
<text class='baseitem_key'>送货地址</text>
<view class='baseitem_value'>
{{customerName}}
</view>
</view>
<view class='baseitem'>
<text class='baseitem_key'>运输车辆</text>
<view class='baseitem_value'>
{{customerName}}
</view>
</view>
<view class='baseitem'>
<text class='baseitem_key'>司机</text>
<view class='baseitem_value'>
{{customerName}}
</view>
</view>
<view class='baseitem'>
<text class='baseitem_key'>联系方式</text>
<view class='baseitem_value'>
{{customerName}}
</view>
</view>
</swiper-item>
<!-- 订单详细 -->
<swiper-item class="swiper-items2">
<scroll-view scroll-x="false" scroll-y="true" class='scroll-views'>
<view class='totalNumView'>
<view class='totalTopView'>
<view class='moneyKeyView'>总金额</view>
<view class='moneyValueView'>{{totalMoney}}¥200000</view>
</view>
<view class='totalBottomView'>
<view class='bottomTextView'>
<text class='lightGray'>主数量:</text>111{{mainNumber}}</view>
<view class='lineView'></view>
<view class='bottomTextView'>
<text class='lightGray'>辅数量:</text>222{{secondNumber}}
</view>
</view>
</view>
<view class='detaileListContainer'>
<block wx:for="{{detaileList}}" wx:key="item" wx:for-index="idx">
<template is="detailInfoTemplate" data="{{item}}" data="{{idx}}" />
</block>
</view>
</scroll-view>
</swiper-item>
</swiper>
<template name="detailInfoTemplate">
<view class='listNumberView'>
<text class='lightGray'>存货明细:</text>{{idx}}</view>
<view class='listItem'>
<text class='lightGray'>存货名称:</text>{{item.Goods_Name}}单据明细</view>
<view class='listItem'>
<text class='lightGray'>报价数量:</text>{{item.Number}}</view>
<view class='listItem'>
<text class='lightGray'>辅数量:</text>{{item.SecondNumber}}</view>
<view class='listItem'>
<text class='lightGray'>政策单价:</text>{{item.ProduceDate}}</view>
<view class='groupTwo'>
<view class='listItem'>
<text class='lightGray'>单价:</text>{{item.DeliveryDate}}</view>
<view class='listItem'>
<text class='lightGray'>金额:</text>{{item.ProduceRequest}}</view>
</view>
</template>

+ 145
- 0
pages/orderList/orderDetail/orderDetail.wxss View File

@ -0,0 +1,145 @@
/* pages/orderList/orderBaseInfo/orderBaseInfo.wxss */
page {
background:#EAF1F8;
height: calc(100%-10px);
}
.swiper-tab {
margin: 10px 20px;
text-align: center;
line-height: 30px;
background: white;
display: flex;
flex-direction: row;
border-radius: 5px;
border: 1px solid#2E8CF5;
overflow: hidden;
}
.swiper-tab-list {
height: 100%;
width: 50%;
font-size: 30rpx;
color: #777;
}
.on {
background-color:#2E8CF5 ;
color: white;
}
.swiper-box {
width: 100%;
display: block;
overflow: hidden;
}
.baseitem {
background: #fff;
width: 100%;
border-bottom: 0.1px solid #dbdbdb;
display: flex;
flex-direction: row;
align-items: center;
padding: 20rpx 20rpx;
font-size: 30rpx;
}
.baseitem_key {
color: #666;
width: 40%;
}
.baseitem_value {
color: rgb(48, 48, 48);
margin-left: 20rpx;
width: 160%;
text-align: center;
}
.scroll-views{
height: 100%;
}
.totalNumView{
width: 100%;
height: 300rpx;
background-color: #fff;
}
.totalTopView{
height: 200rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.moneyKeyView{
width: 100%;
color: #666;
font-size: 20px;
margin-top: 30rpx;
text-align: center;
}
.moneyValueView{
width: 100%;
color: #F68C38;
font-size: 30px;
margin-top: 0rpx;
text-align: center;
}
.totalBottomView{
width: 100%;
height: 100rpx;
border-bottom: 0.1px solid #dbdbdb;
border-top: 0.1px solid #dbdbdb;
display: flex;
flex-direction: row;
background-color: #fff;
justify-content: space-around;
}
.lineView{
margin-top: 10rpx;
height: 80rpx;
width: 2rpx;
background-color: #dbdbdb;
}
.bottomTextView{
line-height: 100rpx;
border-bottom: 0.1px solid #dbdbdb;
justify-content: space-between;
font-size: 20px;
color: black;
}
.detaileListContainer {
display: flex;
flex-direction: column;
background-color: #fff;
}
.listNumberView {
background-color:#EAF1F8;
padding: 10rpx 10rpx;
font-size: 16px;
color: #666;
}
.listItem {
padding: 20rpx 20rpx;
border-bottom: 0.1px solid #dbdbdb;
justify-content: space-between;
font-size: 16px;
color: black;
}
.groupTwo{
display: flex;
flex-direction: row;
justify-content: space-around;
background-color: #fff;
}
.lightGray{
color: #666;
}

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

@ -0,0 +1,166 @@
// pages/orderList/orderList.js
const app = getApp();
var network = require("../../utils/net.js");
var timechage = require("../../utils/dateTimeUtil.js");
var UnCheckPageIndex = 0
var UnCheckPageSize = 10
var CheckedPageIndex = 0
var CheckedPageSize = 10
var outStoreMethod = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/WorkFlowApproveRecordRpc/GetList'
// 未审核订单列表
function getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, successaction) {
let getArr = [];
let method = outStoreMethod;
let params = [false, UnCheckPageIndex, UnCheckPageSize];
network.newRequestLoading(method, params, function (res) {
var array = res.result;
successaction();
if (array.length <= 0) {
wx.showToast({
title: '无数据更新',
})
if (UnCheckPageIndex > 0) {
UnCheckPageIndex = UnCheckPageIndex - 1;
}
return;
}
for (var i = 0; i < array.length; i++) {
var dmo = {
//是否显示审批按钮所在bottom
billState: true,
billType: array[i].BillType_Name,
billID: array[i].Bill_ID,
remark: array[i].EndStateName,
time: timechage.formatTimeTwo(array[i].CreateTime.substring(6, 19), 'Y/M/D h:m')
}
getArr.push(dmo);
}
let arrLast = that.data.unCheckDataArr.concat(getArr);
that.setData({
unCheckDataArr: arrLast,
})
})
}
// 已审核订单列表
function getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize) {
let getArr = [];
let method = outStoreMethod;
let params = [true, CheckedPageIndex, CheckedPageSize];
network.newRequestLoading(method, params, function (res) {
var array = res.result;
if (array.length <= 0) {
wx.showToast({
title: '无数据更新',
})
if (CheckedPageIndex > 0) {
CheckedPageIndex = CheckedPageIndex - 1;
}
return;
}
for (var i = 0; i < array.length; i++) {
var dmo = {
//是否显示审批按钮所在bottom
billState: false,
billType: array[i].BillType_Name,
billID: array[i].Bill_ID,
remark: array[i].Remark,
time: timechage.formatTimeTwo(array[i].CreateTime.substring(6, 19), 'Y/M/D h:m')
}
getArr.push(dmo);
}
let arrLast = that.data.checkedDataArr.concat(getArr);
that.setData({
checkedDataArr: arrLast,
})
})
}
Page({
data: {
checkedDataArr: [1,2,3],
unCheckDataArr: [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3],
currentTab: 0,
winHeight: 0,
winWidth: 0,
},
/**
* 滑动切换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
})
}
},
//点击进入详情页面
transToOrderDetail: function (event) {
var itemID = event.currentTarget.dataset.detailitemid;
wx.navigateTo({
url: 'orderDetail/orderDetail?id=' + itemID,
})
},
onShow: function (options) {
// this.setData({
// checkedDataArr: [],
// unCheckDataArr: [],
// })
var that = this;
wx.getSystemInfo({
success: function (res) {
that.setData({
winWidth: res.windowWidth,
winHeight: res.windowHeight
});
}
});
// UnCheckPageIndex = 0;
// CheckedPageIndex = 0;
// getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, function (res) {
// getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize);
// });
},
//未审核订单滑动到底部加载
unCheckedScrollLower: function (event) {
var that = this;
UnCheckPageIndex = UnCheckPageIndex + 1;
getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, function (res) { });
},
//已审核订单滑动到底部加载
CheckedScrollLower: function (event) {
var that = this;
CheckedPageIndex = CheckedPageIndex + 1;
getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize);
},
/**
* 页面上拉触底事件的处理函数
*/
// onReachBottom: function () {
// var that = this;
// if (this.data.currentTab === 0) {
// UnCheckPageIndex = UnCheckPageIndex + 1;
// getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, function (res) { });
// } else {
// CheckedPageIndex = CheckedPageIndex + 1;
// getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize);
// }
// },
})

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

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

+ 47
- 0
pages/orderList/orderList.wxml View File

@ -0,0 +1,47 @@
<!--pages/orderList/orderList.wxml-->
<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>
<swiper current="{{currentTab}}" class="swiper-box" style='height:{{winHeight-55}}px' duration="300" bindchange="bindChange">
<!-- 未审核 -->
<swiper-item class="swiper-items1">
<scroll-view scroll-x="false" scroll-y="true" class='scroll-views' bindscrolltoupper="unCheckedScrollUpper" bindscrolltolower="unCheckedScrollLower">
<block wx:for="{{unCheckDataArr}}" wx:for-item="item">
<template is="outStoreOrderTemplate" data="{{item}}" />
</block>
</scroll-view>
</swiper-item>
<!-- 已审核 -->
<swiper-item class="swiper-items2">
<scroll-view scroll-x="false" scroll-y="true" class='scroll-views' bindscrolltoupper="checkedScrollUpper" bindscrolltolower="CheckedScrollLower">
<block wx:for="{{checkedDataArr}}" wx:for-item="item">
<template is="outStoreOrderTemplate" data="{{item}}" />
</block>
</scroll-view>
</swiper-item>
</swiper>
<template name="outStoreOrderTemplate">
<view class='listItem' catchtap='transToOrderDetail' data-detailitemid='{{item.orderID}}' data-detailitemstate='{{item.orderState}}'>
<view class='topView'>
<view class='goodsNum'>
<text class='goodsIDText'>{{item.orderID}}仙坛食品有限公司</text>
</view>
<view class='goodsMoney'>
<text class='goodsIDText'>业务员:梁方刚{{item.workFlowState}}</text>
</view>
</view>
<view class='bottomView'>
<view class='goodsNum'>
<text class='goodsNumText'>数量:1000{{item.Customer_Name}}</text>
</view>
<view class='goodsMoney'>
<text class='goodsMoneyText'>日期:2018.2.9{{item.time}}</text>
</view>
</view>
</view>
</template>

+ 106
- 0
pages/orderList/orderList.wxss View File

@ -0,0 +1,106 @@
/* pages/orderList/orderList.wxss */
/* @import "../headerTitleTemplate/headerTitleTemplate"; */
page {
background:#EAF1F8;
height: calc(100%-10px);
}
.swiper-tab {
/* height: 30px; */
margin: 10px 20px;
text-align: center;
line-height: 30px;
background: white;
display: flex;
flex-direction: row;
border-radius: 5px;
border: 1px solid#2E8CF5;
overflow: hidden;
}
.swiper-tab-list {
height: 100%;
width: 50%;
font-size: 30rpx;
color: #777;
}
.on {
background-color:#2E8CF5 ;
color: white;
}
.swiper-box {
width: 100%;
display: block;
overflow: hidden;
}
.swiper-items1 {
height: 100%;
}
.swiper-items2 {
height: 100%;
}
.scroll-views {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
}
.listItem{
display: flex;
flex-direction: column;
background-color: #fff;
padding: 20rpx 20rpx;
border-bottom: 1rpx solid #ddd;
background: white;
}
.orderID{
height: 50%;
width: 100%;
}
.topView{
height: 50%;
width: 100%;
display: flex;
flex-direction: row;
}
.bottomView{
margin-top: 10rpx;
height: 50%;
width: 100%;
display: flex;
flex-direction: row;
}
.goodsNum{
height: 100%;
width: 50%;
}
.goodsMoney{
height: 100%;
width: 50%;
text-align: right;
}
.goodsIDText{
font-size: 16px;
}
.goodsNumText{
font-size: 14px;
color: #666;
}
.goodsMoneyText{
font-size: 14px;
color: #666;
}

+ 59
- 0
project.config.json View File

@ -0,0 +1,59 @@
{
"description": "项目配置文件。",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true
},
"compileType": "miniprogram",
"libVersion": "2.3.0",
"appid": "wx246fd8f3a0273f2f",
"projectname": "%E7%95%9C%E5%8F%B8%E6%9C%BA%E6%98%93",
"isGameTourist": false,
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": 1,
"list": [
{
"id": 0,
"name": "测试",
"pathName": "pages/login/login",
"query": "",
"scene": "1038",
"referrerInfo": {
"appId": "wx862a803bfc8b0af0",
"extraData": "{\"orderID\":32}"
}
},
{
"id": 1,
"name": "测试",
"pathName": "pages/login/login",
"query": "",
"scene": "1011"
}
]
}
}
}

+ 35
- 0
utils/dateTimeUtil.js View File

@ -0,0 +1,35 @@
function formatNumber(n) {
n = n.toString()
return n[1] ? n : '0' + n
}
/**
* 时间戳转化为年
* number: 传入时间戳
* format返回格式支持自定义但参数必须与formateArr里保持一致
*/
function formatTimeTwo(number, format) {
var formateArr = ['Y', 'M', 'D', 'h', 'm', 's'];
var returnArr = [];
var date = new Date(number*1);
returnArr.push(date.getFullYear());
returnArr.push(formatNumber(date.getMonth() + 1));
returnArr.push(formatNumber(date.getDate()));
returnArr.push(formatNumber(date.getHours()));
returnArr.push(formatNumber(date.getMinutes()));
returnArr.push(formatNumber(date.getSeconds()));
for (var i in returnArr) {
format = format.replace(formateArr[i], returnArr[i]);
}
return format;
}
module.exports = {
formatTimeTwo: formatTimeTwo
}

+ 101
- 0
utils/net.js View File

@ -0,0 +1,101 @@
//不显示对话框的请求
const app = getApp()
function request(url, params, success, fail) {
this.requestLoading(url, params, "", success, fail)
}
//原来的请求方式 。现在首页五个接口沿用,直接在中转服务器获取数据
function previousRequestLoading(method, params, successaction) {
wx.showLoading({
title: "加载中",
});
var data = {
'id': 1,
'method': method,
'params': params
};
var baseUrl = app.globalData.baseUrl + "?appid=" + app.globalData.AppId + "&phone=" + app.globalData.Phone;
wx.request({
url: baseUrl,
data: data,
header: {
'content-type': 'application/json'
},
method: 'POST',
success: function(res) {
console.log(res)
if (res.data.error != null) {
wx.showModal({
showCancel: false,
title: '执行出错',
content: res.data.error.message,
})
} else {
successaction(res.data)
}
},
fail: function(res) {
console.log(res)
wx.showModal({
title: '执行出错',
content: res,
})
},
complete: function(res) {
wx.hideLoading()
},
})
}
// 新请求方式,添加中转服务器
function requestLoading(method, params, successaction) {
wx.showLoading({
title: "加载中",
})
var newData = {
"DecryptCookie": "",
"CustomerId": app.globalData.CustomerId,
"AppendUrlString": "?appid=" + app.globalData.AppId + "&phone=" + app.globalData.Phone,
"Method": method,
"Data": params,
};
// 中转服务器地址
var baseUrl = app.globalData.TransferBaseUrl;
wx.request({
url: baseUrl,
data: newData,
header: {
'content-type': 'application/json'
},
method: 'post',
success: function (res) {
console.log(res)
if (res.data.error != null) {
wx.showModal({
showCancel: false,
title: '执行出错',
content: res.data.error.message,
})
} else {
successaction(res.data)
}
},
fail: function (res) {
console.log(res)
wx.showModal({
title: '执行出错',
content: res,
})
},
complete: function (res) {
wx.hideLoading()
},
})
}
module.exports = {
request: request,
requestLoading: requestLoading,
previousRequestLoading: previousRequestLoading,
}

+ 19
- 0
utils/util.js View File

@ -0,0 +1,19 @@
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : '0' + n
}
module.exports = {
formatTime: formatTime
}

Loading…
Cancel
Save