41 changed files with 246 additions and 572 deletions
Split View
Diff Options
-
2app.js
-
11app.json
-
1pages/agent/order/index.js
-
1pages/agent/order/index.wxml
-
2pages/agent/order/index.wxss
-
69pages/home/index/index.js
-
25pages/login/index.js
-
4pages/mall/detail/index.js
-
7pages/message/index/index.js
-
240pages/morder/index/index.js
-
168pages/morder/index/index.wxml
-
5pages/shop/bidding/index.js
-
1pages/shop/bidding/index.wxml
-
1pages/shop/bidding/index.wxss
-
3pages/shop/order/index.js
-
1pages/shop/order/index.wxml
-
1pages/shop/order/index.wxss
-
0submodel/images/icon-jjsuccess.png
-
0submodel/pages/bidding/bidding.wxs
-
13submodel/pages/bidding/detail/index.js
-
0submodel/pages/bidding/detail/index.json
-
17submodel/pages/bidding/detail/index.wxml
-
1submodel/pages/bidding/detail/index.wxss
-
11submodel/pages/bidding/index/index.js
-
0submodel/pages/bidding/index/index.json
-
3submodel/pages/bidding/index/index.wxml
-
1submodel/pages/bidding/index/index.wxss
-
13submodel/pages/morder/create/index.js
-
0submodel/pages/morder/create/index.json
-
3submodel/pages/morder/create/index.wxml
-
1submodel/pages/morder/create/index.wxss
-
11submodel/pages/morder/detail/index.js
-
0submodel/pages/morder/detail/index.json
-
3submodel/pages/morder/detail/index.wxml
-
1submodel/pages/morder/detail/index.wxss
-
127submodel/pages/morder/index/index.js
-
0submodel/pages/morder/index/index.json
-
62submodel/pages/morder/index/index.wxml
-
1submodel/pages/morder/index/index.wxss
-
0submodel/pages/morder/order.wxs
-
8utils/util.js
@ -1,3 +1 @@ |
|||
/* pages/bidding/index/index.wxss */ |
|||
|
|||
|
|||
@ -1,240 +0,0 @@ |
|||
// pages/bidding/index/index.js
|
|||
import { getUserOrderList,getProxyOrderList } from "../../../api/ztb" |
|||
const util = require('../../../utils/util') |
|||
const event = require('../../../utils/event.js') |
|||
const tdsdk = require('../../../libs/tdweapp') |
|||
const app = getApp() |
|||
const status = ['', 1, 2, 3, 4, 5, 6, 7, 8, 9] |
|||
|
|||
Page({ |
|||
data: { |
|||
height: app.globalData.fragmentHeight, |
|||
kg: app.globalData.kg, |
|||
StatusBar: app.globalData.StatusBar || 40, |
|||
CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 80), |
|||
Custom: app.globalData.Custom, |
|||
loading: true, |
|||
requesting: false, |
|||
finished: false, |
|||
tabList: [ '全部', '待付诚意金', '待上传资料', '待上传资料确认', '待支付尾款', '待收货', '待扣点确认', '待退货确认', '已完成', '已关闭' ], |
|||
tabIndex: 0, |
|||
top: 0, |
|||
orderList: [], |
|||
form: { |
|||
status: '', |
|||
pageNum: 1, |
|||
pageSize:15 |
|||
}, |
|||
bidType: 1, |
|||
|
|||
height2: app.globalData.fragmentHeight, |
|||
loading2: true, |
|||
requesting2: false, |
|||
finished2: false, |
|||
tabList2: ['全部', '待预约', '待送货', '结算中', '已完成', '已关闭' ], |
|||
tabIndex2: 0, |
|||
top2: 0, |
|||
orderList2: [], |
|||
form2: { |
|||
status: '', |
|||
pageNum: 1, |
|||
pageSize:15 |
|||
} |
|||
}, |
|||
onLoad: function (options) { |
|||
this.setData({ |
|||
height: app.globalData.fragmentHeight - 90, |
|||
kg: app.globalData.kg, |
|||
CustomBar: app.globalData.CustomBar, |
|||
['form.status']: options.status ? statusList[parseInt(options.status)] : '', |
|||
tabIndex: options.status ? parseInt(options.status) : 0 |
|||
}) |
|||
event.on('EventMessage', this, this.onEvent) |
|||
this.fetchOrderList() |
|||
}, |
|||
onEvent: function (message) { |
|||
if (message.what == 320) { |
|||
this.onRefreshList() |
|||
} |
|||
}, |
|||
onRefreshList: function () { |
|||
if (this.data.requesting) { |
|||
return |
|||
} |
|||
this.setData({ |
|||
orderList: [], |
|||
['form.status']: this.data.form.status, |
|||
['form.pageNum']: 1, |
|||
loading: true, |
|||
finished: false |
|||
}) |
|||
this.fetchOrderList() |
|||
}, |
|||
fetchOrderList: function () { |
|||
if (this.data.requesting || this.data.finished) { |
|||
return |
|||
} |
|||
if (this.data.loading) { |
|||
this.data.requesting = true |
|||
} else { |
|||
this.setData({ requesting: true }) |
|||
} |
|||
getUserOrderList(this.data.form).then(result => { |
|||
if (result.data.records.length) { |
|||
var respList = result.data.records |
|||
let nowList = `orderList[${this.data.orderList.length}]` |
|||
var num = this.data.form.pageNum |
|||
var finished = this.data.form.pageNum >= result.data.pages |
|||
if(this.data.form.pageNum == 1){ |
|||
this.setData({ |
|||
[nowList]: respList, |
|||
total: result.data.total, |
|||
['form.pageNum']: (num + 1), |
|||
top: 0, |
|||
finished, |
|||
requesting: false, |
|||
loading: false |
|||
}) |
|||
} else { |
|||
this.setData({ |
|||
[nowList]: respList, |
|||
total: result.data.total, |
|||
['form.pageNum']: (num + 1), |
|||
finished, |
|||
requesting: false, |
|||
loading: false |
|||
}) |
|||
} |
|||
} else { |
|||
this.setData({ |
|||
finished: true, |
|||
requesting: false, |
|||
loading: false |
|||
}) |
|||
} |
|||
}).catch(err => { |
|||
this.setData({ |
|||
requesting: false, |
|||
loading: false |
|||
}) |
|||
util.showToast(err) |
|||
}) |
|||
}, |
|||
lookItem: function (e) { |
|||
var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index] |
|||
wx.navigateTo({ |
|||
url: '/pages/morder/detail/index?orderId=' + item.orderId |
|||
}) |
|||
}, |
|||
onTabChange: function ({detail}) { |
|||
if (this.data.tabIndex == detail.index) { |
|||
return |
|||
} |
|||
this.data.tabIndex = detail.index |
|||
this.data.form.status = status[this.data.tabIndex] |
|||
this.onRefreshList() |
|||
}, |
|||
onUnload: function(){ |
|||
event.remove('EventMessage', this) |
|||
}, |
|||
backspace() { |
|||
wx.navigateBack() |
|||
}, |
|||
onTabChangeTop: function (e) { |
|||
if (this.data.bidType == Number(e.currentTarget.dataset.index)) { |
|||
return |
|||
} |
|||
var tabIndex = Number(e.currentTarget.dataset.index) |
|||
this.setData({ |
|||
['bidType']: tabIndex |
|||
}) |
|||
if(this.data.bidType==1){ |
|||
this.onRefreshList() |
|||
} |
|||
if(this.data.bidType==2){ |
|||
this.onRefreshList2() |
|||
} |
|||
}, |
|||
onTabTopChange2: function ({detail}) { |
|||
if (this.data.tabIndex2 == detail.index) { |
|||
return |
|||
} |
|||
this.data.tabIndex2 = detail.index |
|||
this.data.form2.status = status2[this.data.tabIndex2] |
|||
this.onRefreshList2() |
|||
}, |
|||
onRefreshList2: function () { |
|||
this.setData({ |
|||
orderList2: [], |
|||
['form2.status']: this.data.form2.status, |
|||
['form2.pageNum']: 1, |
|||
loading2: true, |
|||
finished2: false |
|||
}) |
|||
this.fetchOrderList2() |
|||
}, |
|||
fetchOrderList2: function () { |
|||
if (this.data.requesting2 || this.data.finished2) { |
|||
return |
|||
} |
|||
if (this.data.loading2) { |
|||
this.data.requesting2 = true |
|||
} else { |
|||
this.setData({ requesting2: true }) |
|||
} |
|||
getProxyOrderList(this.data.form2).then(result => { |
|||
if (result.data.records.length) { |
|||
var respList = result.data.records |
|||
let nowList2 = `orderList2[${this.data.orderList2.length}]` |
|||
var num = this.data.form2.pageNum |
|||
var finished = this.data.form2.pageNum >= result.data.pages |
|||
if(this.data.form2.pageNum == 1){ |
|||
this.setData({ |
|||
[nowList2]: respList, |
|||
total2: result.data.total, |
|||
['form.pageNum']: (num + 1), |
|||
top: 0, |
|||
finished2, |
|||
requesting2: false, |
|||
loading2: false |
|||
}) |
|||
} else { |
|||
this.setData({ |
|||
[nowList2]: respList, |
|||
total2: result.data.total, |
|||
['form2.pageNum']: (num + 1), |
|||
finished2, |
|||
requesting2: false, |
|||
loading2: false |
|||
}) |
|||
} |
|||
} else { |
|||
this.setData({ |
|||
finished2: true, |
|||
requesting2: false, |
|||
loading2: false |
|||
}) |
|||
} |
|||
}).catch(err => { |
|||
//异常回调
|
|||
this.setData({ |
|||
requesting2: false, |
|||
loading2: false |
|||
}) |
|||
util.showToast(err) |
|||
}) |
|||
}, |
|||
lookItem2: function (e) { |
|||
var item = this.data.orderList2[e.currentTarget.dataset.page][e.currentTarget.dataset.index] |
|||
wx.navigateTo({ url: '/pages/agent/detail/index?id=' + item.orderId }) |
|||
}, |
|||
onShow: function () { |
|||
tdsdk.Page.onShow() |
|||
}, |
|||
onHide: function(){ |
|||
tdsdk.Page.onHide() |
|||
}, |
|||
onUnload: function () { |
|||
tdsdk.Page.onUnload() |
|||
} |
|||
}) |
|||
@ -1,168 +0,0 @@ |
|||
<!--pages/bidding/index/index.wxml--> |
|||
<wxs module="order" src="../../morder/order.wxs"></wxs> |
|||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">我的订单</view> |
|||
</cu-custom> |
|||
<!-- <view class="cu-custom" style="height:{{CustomBar}}px;z-index: 99;"> |
|||
<view class="cu-bar fixed" style="height:{{CustomBar}}px;padding-top:{{StatusBar}}rpx;{{shadow?'box-shadow: none': ''}};{{shadow?'border-bottom: none': ''}};background-color:white"> |
|||
<view class="action" bindtap="backspace" wx:if="true"> |
|||
<text class="weui_goback"></text> |
|||
<slot name="backText"></slot> |
|||
</view> |
|||
<view class="" style="top:{{StatusBar}}rpx;color:black;font-size:32rpx"> |
|||
<view style="width:260rpx"> |
|||
<view data-index="1" style="width:128rpx;color:{{bidType == 1 ? '#008AFF' : '#333'}};z-index: 100;float:left" bindtap="onTabChangeTop"><text>交易订单</text></view> |
|||
<view data-index="2" style="width:128rpx;color:{{bidType == 2 ? '#008AFF' : '#333'}};z-index: 100;float:right" bindtap="onTabChangeTop"><text>代卖订单</text></view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> --> |
|||
|
|||
<view wx:if="{{bidType == 1}}" class="nav bg-white fixed" style="top:{{CustomBar}}px;"> |
|||
<wux-tabi tab-data="{{tabList}}" tab-index="{{tabIndex}}" scroll="{{true}}" bind:change="onTabChange"></wux-tabi> |
|||
</view> |
|||
<view wx:if="{{bidType == 1}}" style="height:90rpx;width:100%"></view> |
|||
|
|||
<refresh-view wx:if="{{bidType == 1}}" bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchOrderList"> |
|||
<view wx:if="{{!orderList.length}}"> |
|||
<view class="list-empty" style="height:{{height}}rpx"> |
|||
<view class="load-spinner text-gray" style="margin-bottom:24px" wx:if="{{loading}}" /> |
|||
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image> |
|||
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view> |
|||
</view> |
|||
</view> |
|||
<view wx:else> |
|||
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex"> |
|||
<view wx:for="{{pageItem}}" wx:key="index"> |
|||
<view style="height:16rpx" wx:if="{{pageIndex != 0 || index != 0 }}"></view> |
|||
<view data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem"> |
|||
<view class="flex flex-justify item-content"> |
|||
<view> |
|||
<view class="page-name"> |
|||
<text>{{item.bidType == 1 ? '一口价' : '竞拍订单'}}</text> |
|||
<text style="margin-left:6rpx;font-size:28rpx">({{item.storeName}})</text> |
|||
</view> |
|||
<view class="page-num">单号:{{item.orderId}}</view> |
|||
</view> |
|||
<view class="page-name">{{order.orderStatus(item.status)}}</view> |
|||
</view> |
|||
<wux-divider show-text="{{ false }}" dashed></wux-divider> |
|||
<view class="flex item-content"> |
|||
<wux-image width="{{80}}" height="{{80}}" shape="rounded" lazyLoad="true" src="{{item.coverImgUrl}}" mode="aspectFill"> |
|||
<image class="image-load" slot="loading" src="/assets/image/def_image.png"></image> |
|||
</wux-image> |
|||
<view style="flex:1;padding-left:20rpx;padding-top:8rpx;height:80px"> |
|||
<view class="flex flex-justify" style="height:20px;"> |
|||
<view class="page-name">{{item.secondCategoryName}}</view> |
|||
<view class="page-num">单价:{{formate.formatePrice2(item.unitPrice, kg)}}</view> |
|||
</view> |
|||
<view style="height:50px"> |
|||
<view class="page-outline">{{item.description}}</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<!--加载更多的UI--> |
|||
<view wx:if="{{form.pageNum>1}}" style="padding:20rpx"> |
|||
<wux-divider> |
|||
<view class="loadmore"> |
|||
<text class="icon--refresher" wx:if="{{!finished}}"></text> |
|||
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text> |
|||
</view> |
|||
</wux-divider> |
|||
</view> |
|||
</view> |
|||
</refresh-view> |
|||
|
|||
<!-- 代卖订单--> |
|||
|
|||
<!-- <view wx:if="{{bidType == 2}}" class="nav bg-white fixed" style="top:{{CustomBar}}px;"> |
|||
<wux-tabi tab-data="{{tabList2}}" tab-index="{{tabIndex2}}" bind:change="onTabTopChange2"></wux-tabi> |
|||
</view> |
|||
<view style="height:90rpx;width:100%"></view> |
|||
|
|||
<refresh-view wx:if="{{bidType == 2}}" bind:refresh="onRefreshList2" height="{{height2}}" triggered="{{requesting2}}" scrollTop="{{top2}}" bind:scrolltolower="fetchOrderList2"> |
|||
<view wx:if="{{!orderList2.length}}"> |
|||
<view class="list-empty" style="height:{{height2}}rpx"> |
|||
<view class="load-spinner text-gray" style="margin-bottom:24px" wx:if="{{loading2}}" /> |
|||
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image> |
|||
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view> |
|||
</view> |
|||
</view> |
|||
<view wx:else> |
|||
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList2}}" wx:key="pageIndex"> |
|||
<view wx:for="{{pageItem}}" wx:key="index"> |
|||
<view data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem2"> |
|||
<view style="height:20rpx" wx:if="{{pageIndex != 0 || index != 0 }}"></view> |
|||
<view class="flex flex-justify item-content"> |
|||
<view class="flex flex-center"> |
|||
<wux-image width="{{20}}" height="{{20}}" shape="circle" src="{{item.logoImg}}" mode="aspectFill"> |
|||
<image class="image-load" slot="loading" src="/assets/image/def_image.png"></image> |
|||
<image class="image-load" slot="error" src="/assets/image/def_image.png"></image> |
|||
</wux-image> |
|||
<text class="text-sg" style="margin-left:8rpx">{{item.paperMillName}}</text> |
|||
</view> |
|||
<view class="page-name" style="color:{{statusColor(item.status)}}">{{agent.orderStatus(item.status)}}</view> |
|||
</view> |
|||
<view class="item-content" style="border-top:2rpx solid #f3f3f3"> |
|||
<view class="flex flex-justify text-df"> |
|||
<text class="text-black">订单编号</text> |
|||
<text class="text-gray">{{item.orderId}}</text> |
|||
</view> |
|||
<view class="flex flex-justify text-df" style="margin-top:8rpx"> |
|||
<text class="text-black">纸品分类:</text> |
|||
<text class="text-gray">{{item.paperCategoryName}}</text> |
|||
</view> |
|||
<view class="flex flex-justify text-df" style="margin-top:8rpx"> |
|||
<text class="text-black">预估重量:</text> |
|||
<text class="text-gray">{{formate.formateWeight(item.totalEstimatedWeight)}}</text> |
|||
</view> |
|||
<view class="flex flex-justify text-df" style="margin-top:8rpx"> |
|||
<text class="text-black">货车数量:</text> |
|||
<text class="text-gray">{{item.carNum}}辆</text> |
|||
</view> |
|||
<view class="flex flex-justify text-df" style="margin-top:8rpx"> |
|||
<text class="text-black">货到时间:</text> |
|||
<text class="text-gray">{{item.deliveryTime}}</text> |
|||
</view> |
|||
<view class="flex flex-justify text-df" style="margin-top:8rpx" wx:if="{{item.orderItems}}" wx:for="{{item.orderItems}}" wx:for-item="cell" wx:key="index"> |
|||
<text class="text-black">货车车牌{{index+1}}:{{cell.logisticcsInfo.plateNumber}}</text> |
|||
<text class="text-gray" >{{cell.status==50?'待预约':(cell.status==51?'待送货':(cell.status==52?'结算中':(cell.status==53?'已完成':(cell.status==54?'已关闭':'---'))))}}</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view wx:if="{{form2.pageNum>1}}" style="padding:20rpx"> |
|||
<wux-divider> |
|||
<view class="loadmore"> |
|||
<text class="icon--refresher" wx:if="{{!finished2}}"></text> |
|||
<text class="text-sm" style="margin-left:8rpx">{{finished2?'到底啦~':'加载中...'}}</text> |
|||
</view> |
|||
</wux-divider> |
|||
</view> |
|||
</view> |
|||
</refresh-view> --> |
|||
|
|||
<wxs module="statusColor"> |
|||
function statusColor(status) { |
|||
if (status == 50) { |
|||
return '#F12C20' |
|||
} else if (status == 51) { |
|||
return '#F12C20' |
|||
} else if (status == 52) { |
|||
return '#F12C20' |
|||
} else if (status == 53) { |
|||
return '#008AFF' |
|||
} else if (status == 54) { |
|||
return '#09BB07' |
|||
} else if (status == 55) { |
|||
return '#888888' |
|||
} |
|||
return '' |
|||
} |
|||
module.exports = statusColor |
|||
</wxs> |
|||
@ -1,4 +1,3 @@ |
|||
/* pages/bidding/detail/index.wxss */ |
|||
.item-content { |
|||
background-color: white; |
|||
padding: 0rpx 32rpx; |
|||
@ -1,6 +1,5 @@ |
|||
<!--pages/morder/index/index.wxml--> |
|||
<wxs module="bidding" src="../../bidding/bidding.wxs"></wxs> |
|||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|||
<wxs module="formate" src="../../../../pages/formate.wxs"></wxs> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">我的报价</view> |
|||
</cu-custom> |
|||
@ -1,4 +1,3 @@ |
|||
/* pages/morder/index/index.wxss */ |
|||
.item-status { |
|||
font-size: 30rpx; |
|||
font-family: PingFang-SC-Medium, PingFang-SC; |
|||
@ -1,5 +1,4 @@ |
|||
<!--pages/bidding/details/index.wxml--> |
|||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|||
<wxs module="formate" src="../../../../pages/formate.wxs"></wxs> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">下单</view> |
|||
</cu-custom> |
|||
@ -1,4 +1,3 @@ |
|||
/* pages/bidding/create/index.wxss */ |
|||
.page-btn { |
|||
height: 27px; |
|||
background: rgba(255, 66, 43, 1); |
|||
@ -1,9 +1,8 @@ |
|||
// pages/morder/detail/index.js
|
|||
import { zconfig, getStoreOrderInfo, getUserOrderInfo, uploadStoreOrder, payOffline, getCancelUserOrder, returnOrderTrade, confirmUserOrder, confirmStorerOrder, confirmOrderTrade, applyUserOrder } from "../../../api/ztb" |
|||
const util = require('../../../utils/util') |
|||
const math = require('../../../utils/math') |
|||
const event = require('../../../utils/event') |
|||
const tdsdk = require('../../../libs/tdweapp') |
|||
import { zconfig, getStoreOrderInfo, getUserOrderInfo, uploadStoreOrder, payOffline, getCancelUserOrder, returnOrderTrade, confirmUserOrder, confirmStorerOrder, confirmOrderTrade, applyUserOrder } from "../../../../api/ztb" |
|||
const util = require('../../../../utils/util') |
|||
const math = require('../../../../utils/math') |
|||
const event = require('../../../../utils/event') |
|||
const tdsdk = require('../../../../libs/tdweapp') |
|||
const app = getApp() |
|||
|
|||
Page({ |
|||
@ -1,6 +1,5 @@ |
|||
<!--pages/morder/detail/index.wxml--> |
|||
<wxs module="order" src="../../morder/order.wxs"></wxs> |
|||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|||
<wxs module="formate" src="../../../../pages/formate.wxs"></wxs> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">订单详情</view> |
|||
</cu-custom> |
|||
@ -1,4 +1,3 @@ |
|||
/* pages/morder/detail/index.wxss */ |
|||
.item-content { |
|||
background-color: white; |
|||
padding: 0rpx 32rpx; |
|||
@ -0,0 +1,127 @@ |
|||
import { getUserOrderList } from "../../../../api/ztb" |
|||
const util = require('../../../../utils/util') |
|||
const event = require('../../../../utils/event.js') |
|||
const tdsdk = require('../../../../libs/tdweapp') |
|||
const app = getApp() |
|||
const status = ['', 1, 2, 3, 4, 5, 6, 7, 8, 9] |
|||
|
|||
Page({ |
|||
data: { |
|||
height: app.globalData.fragmentHeight, |
|||
kg: app.globalData.kg, |
|||
loading: true, |
|||
requesting: false, |
|||
finished: false, |
|||
tabList: [ '全部', '待付诚意金', '待上传资料', '待上传资料确认', '待支付尾款', '待收货', '待扣点确认', '待退货确认', '已完成', '已关闭' ], |
|||
tabIndex: 0, |
|||
top: 0, |
|||
orderList: [], |
|||
form: { |
|||
status: '', |
|||
pageNum: 1, |
|||
pageSize:15 |
|||
} |
|||
}, |
|||
onLoad: function (options) { |
|||
this.setData({ |
|||
height: app.globalData.fragmentHeight - 90, |
|||
kg: app.globalData.kg, |
|||
['form.status']: options.status ? statusList[parseInt(options.status)] : '', |
|||
tabIndex: options.status ? parseInt(options.status) : 0 |
|||
}) |
|||
event.on('EventMessage', this, this.onEvent) |
|||
this.fetchOrderList() |
|||
}, |
|||
onEvent: function (message) { |
|||
if (message.what == 320) { |
|||
this.onRefreshList() |
|||
} |
|||
}, |
|||
onRefreshList: function () { |
|||
if (this.data.requesting) { |
|||
return |
|||
} |
|||
this.setData({ |
|||
orderList: [], |
|||
['form.status']: this.data.form.status, |
|||
['form.pageNum']: 1, |
|||
loading: true, |
|||
finished: false |
|||
}) |
|||
this.fetchOrderList() |
|||
}, |
|||
fetchOrderList: function () { |
|||
if (this.data.requesting || this.data.finished) { |
|||
return |
|||
} |
|||
if (this.data.loading) { |
|||
this.data.requesting = true |
|||
} else { |
|||
this.setData({ requesting: true }) |
|||
} |
|||
getUserOrderList(this.data.form).then(result => { |
|||
if (result.data.records.length) { |
|||
var respList = result.data.records |
|||
let nowList = `orderList[${this.data.orderList.length}]` |
|||
var num = this.data.form.pageNum |
|||
var finished = this.data.form.pageNum >= result.data.pages |
|||
if(this.data.form.pageNum == 1){ |
|||
this.setData({ |
|||
[nowList]: respList, |
|||
total: result.data.total, |
|||
['form.pageNum']: (num + 1), |
|||
top: 0, |
|||
finished, |
|||
requesting: false, |
|||
loading: false |
|||
}) |
|||
} else { |
|||
this.setData({ |
|||
[nowList]: respList, |
|||
total: result.data.total, |
|||
['form.pageNum']: (num + 1), |
|||
finished, |
|||
requesting: false, |
|||
loading: false |
|||
}) |
|||
} |
|||
} else { |
|||
this.setData({ |
|||
finished: true, |
|||
requesting: false, |
|||
loading: false |
|||
}) |
|||
} |
|||
}).catch(err => { |
|||
this.setData({ |
|||
requesting: false, |
|||
loading: false |
|||
}) |
|||
util.showToast(err) |
|||
}) |
|||
}, |
|||
lookItem: function (e) { |
|||
var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index] |
|||
wx.navigateTo({ url: '/submodel/pages/morder/detail/index?orderId=' + item.orderId }) |
|||
}, |
|||
onTabChange: function ({detail}) { |
|||
if (this.data.tabIndex == detail.index) { |
|||
return |
|||
} |
|||
this.data.tabIndex = detail.index |
|||
this.data.form.status = status[this.data.tabIndex] |
|||
this.onRefreshList() |
|||
}, |
|||
onUnload: function(){ |
|||
event.remove('EventMessage', this) |
|||
}, |
|||
onShow: function () { |
|||
tdsdk.Page.onShow() |
|||
}, |
|||
onHide: function(){ |
|||
tdsdk.Page.onHide() |
|||
}, |
|||
onUnload: function () { |
|||
tdsdk.Page.onUnload() |
|||
} |
|||
}) |
|||
@ -0,0 +1,62 @@ |
|||
<wxs module="order" src="../../morder/order.wxs"></wxs> |
|||
<wxs module="formate" src="../../../../pages/formate.wxs"></wxs> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">交易订单</view> |
|||
</cu-custom> |
|||
|
|||
<view class="bg-white" style="height:90rpx;width:100%;border-bottom: 1rpx solid #f3f3f3;"> |
|||
<wux-tabi tab-data="{{tabList}}" tab-index="{{tabIndex}}" scroll="{{true}}" bind:change="onTabChange"></wux-tabi> |
|||
</view> |
|||
|
|||
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchOrderList"> |
|||
<view wx:if="{{!orderList.length}}"> |
|||
<view class="list-empty" style="height:{{height}}rpx"> |
|||
<view class="load-spinner text-gray" style="margin-bottom:24px" wx:if="{{loading}}" /> |
|||
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image> |
|||
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view> |
|||
</view> |
|||
</view> |
|||
<view wx:else> |
|||
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex"> |
|||
<view wx:for="{{pageItem}}" wx:key="index"> |
|||
<view style="height:16rpx" wx:if="{{pageIndex != 0 || index != 0 }}"></view> |
|||
<view data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem"> |
|||
<view class="flex flex-justify item-content"> |
|||
<view> |
|||
<view class="page-name"> |
|||
<text>{{item.bidType == 1 ? '一口价' : '竞拍订单'}}</text> |
|||
<text style="margin-left:6rpx;font-size:28rpx">({{item.storeName}})</text> |
|||
</view> |
|||
<view class="page-num">单号:{{item.orderId}}</view> |
|||
</view> |
|||
<view class="page-name">{{order.orderStatus(item.status)}}</view> |
|||
</view> |
|||
<wux-divider show-text="{{ false }}" dashed></wux-divider> |
|||
<view class="flex item-content"> |
|||
<wux-image width="{{80}}" height="{{80}}" shape="rounded" lazyLoad="true" src="{{item.coverImgUrl}}" mode="aspectFill"> |
|||
<image class="image-load" slot="loading" src="/assets/image/def_image.png"></image> |
|||
</wux-image> |
|||
<view style="flex:1;padding-left:20rpx;padding-top:8rpx;height:80px"> |
|||
<view class="flex flex-justify" style="height:20px;"> |
|||
<view class="page-name">{{item.secondCategoryName}}</view> |
|||
<view class="page-num">单价:{{formate.formatePrice2(item.unitPrice, kg)}}</view> |
|||
</view> |
|||
<view style="height:50px"> |
|||
<view class="page-outline">{{item.description}}</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<!--加载更多的UI--> |
|||
<view wx:if="{{form.pageNum>1}}" style="padding:20rpx"> |
|||
<wux-divider> |
|||
<view class="loadmore"> |
|||
<text class="icon--refresher" wx:if="{{!finished}}"></text> |
|||
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text> |
|||
</view> |
|||
</wux-divider> |
|||
</view> |
|||
</view> |
|||
</refresh-view> |
|||
@ -1,4 +1,3 @@ |
|||
/* pages/bidding/index/index.wxss */ |
|||
.item-content { |
|||
background-color: white; |
|||
padding: 24rpx 32rpx; |
|||
Write
Preview
Loading…
Cancel
Save