8 changed files with 151 additions and 23 deletions
Split View
Diff Options
-
1app.json
-
65pages/agent/select-list/index.js
-
10pages/agent/select-list/index.json
-
33pages/agent/select-list/index.wxml
-
7pages/agent/select-list/index.wxss
-
2pages/login/index.js
-
37pages/storage/order-create/index.js
-
19pages/storage/order-create/index.wxml
@ -0,0 +1,65 @@ |
|||
// pages/process/order-list/index.js
|
|||
import Scene from '../../index/scene' |
|||
import { getPeymentList } from "../../../api/saas" |
|||
const util = require('../../../utils/util') |
|||
const app = getApp() |
|||
|
|||
Scene({ |
|||
// * 页面的初始数据
|
|||
data: { |
|||
height: app.globalData.fragmentHeight, |
|||
loading: true, |
|||
requesting: false, |
|||
finished: false, |
|||
orderList: [], |
|||
form: { |
|||
pageNum: 1, |
|||
pageSize: 10 |
|||
}, |
|||
lastTime: null |
|||
}, |
|||
// * 生命周期函数--监听页面加载
|
|||
onLoad: function (options) { |
|||
this.setData({ height: app.globalData.fragmentHeight }) |
|||
this.fetchOrderList() |
|||
}, |
|||
onRefreshList: function (isame) { |
|||
if (this.data.requesting) { |
|||
return |
|||
} |
|||
this.setData({ orderList: [], ['form.pageNum']: 1, ['form.isSameCustomer']: isame == 1 ? 1 : 0, loading: true, finished: false }) |
|||
this.fetchOrderList() |
|||
}, |
|||
//1:待定价,2:待过皮重,3:待过磅审核,4:待付款,5:已完成
|
|||
fetchOrderList: function () { |
|||
if (this.data.requesting || this.data.finished) { |
|||
return |
|||
} |
|||
this.data.requesting = true |
|||
getPeymentList(this.data.form).then(result => { |
|||
if (result.data && result.data.records.length) { |
|||
var respList = result.data.records |
|||
let nowList = `orderList[${this.data.orderList.length}]` |
|||
var num = this.data.form.pageNum |
|||
var finished = ((num - 1) * this.data.form.pageSize + respList.length) >= result.data.total |
|||
this.setData({ [nowList]: respList, ['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) |
|||
}).finally(() => { |
|||
this.refresh = this.refresh || this.selectComponent('#refresh') |
|||
this.refresh.setRefresh(false) |
|||
}) |
|||
}, |
|||
lookItem: function (e) { |
|||
var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index] |
|||
const channel = this.getOpenerEventChannel() |
|||
channel.emit('onCallback', { what: 62, detail: item }) |
|||
wx.navigateBack() |
|||
|
|||
} |
|||
|
|||
}) |
|||
@ -0,0 +1,10 @@ |
|||
{ |
|||
"usingComponents": { |
|||
"refresh-view": "/components/refresh-view/index", |
|||
"van-cell": "/components/cell/index", |
|||
"van-image": "/components/image/index", |
|||
"van-divider": "/components/divider/index", |
|||
"van-loading": "/components/loading/index", |
|||
"notification": "/pages/message/notification/index" |
|||
} |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
<!--pages/process/order-list/index.wxml--> |
|||
<wxs module="formate" src="../../formate.wxs"></wxs> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">选择代卖单</view> |
|||
</cu-custom> |
|||
|
|||
<refresh-view id="refresh" bind:refresh="onRefreshList" height="{{height}}" bind:loadmore="fetchOrderList"> |
|||
<view class="list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}"> |
|||
<view style="margin-bottom:24px" wx:if="{{loading}}"> |
|||
<van-loading type="spinner" size="32" /> |
|||
</view> |
|||
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image> |
|||
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view> |
|||
</view> |
|||
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex"> |
|||
<van-cell clickable is-link center wx:for="{{pageItem}}" wx:key="index"> |
|||
<view slot="title" class="flex flex-justify" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem"> |
|||
<van-image round width="80rpx" height="80rpx" src="{{ item.avatarUrl || '/assets/image/ygImg.png' }}" /> |
|||
<view style="margin-left:18rpx;width:100%;flex:1"> |
|||
<view class="text-sg text-bold">{{item.name || ''}}</view> |
|||
<view class="text-sm text-gray" style="line-height:32rpx">{{item.mobile || ('卡号:' + item.cardNo)}}</view> |
|||
</view> |
|||
</view> |
|||
</van-cell> |
|||
</view> |
|||
<!--加载更多的UI--> |
|||
<van-divider content-position="center" wx:if="{{ form.pageNum > 1}}" custom-style="padding:0rpx 120rpx"> |
|||
<van-loading type="spinner" size="16" wx:if="{{!finished}}" /> |
|||
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text> |
|||
</van-divider> |
|||
</refresh-view> |
|||
|
|||
<notification id="qn-notification"/> |
|||
@ -0,0 +1,7 @@ |
|||
/* pages/process/order-list/index.wxss */ |
|||
.item-content{ |
|||
padding: 20rpx 32rpx 20rpx 0rpx; |
|||
border-bottom:1rpx solid #f3f3f3; |
|||
margin-left:32rpx; |
|||
align-items: flex-start; |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save