Browse Source

no message

feature/v1.4
xpz2018 5 years ago
parent
commit
4044ecfa7b
8 changed files with 151 additions and 23 deletions
  1. 1
      app.json
  2. 65
      pages/agent/select-list/index.js
  3. 10
      pages/agent/select-list/index.json
  4. 33
      pages/agent/select-list/index.wxml
  5. 7
      pages/agent/select-list/index.wxss
  6. 2
      pages/login/index.js
  7. 37
      pages/storage/order-create/index.js
  8. 19
      pages/storage/order-create/index.wxml

1
app.json

@ -35,6 +35,7 @@
"pages/agent/focus-list/index",
"pages/agent/order-detail/index",
"pages/agent/appointment/index",
"pages/agent/select-list/index",
"pages/agent/result/index",
"pages/moment/index/index",
"pages/moment/new-list/index",

65
pages/agent/select-list/index.js

@ -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()
}
})

10
pages/agent/select-list/index.json

@ -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"
}
}

33
pages/agent/select-list/index.wxml

@ -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"/>

7
pages/agent/select-list/index.wxss

@ -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;
}

2
pages/login/index.js

@ -128,7 +128,7 @@ Page({
})
return
}
// headerFactoryId(app.userInfo.factoryId)
headerFactoryId(app.userInfo.factoryId)
// wx.redirectTo({ url: '/pages/agent/result/index' })
wx.redirectTo({ url: '/pages/index/index' })
} else {

37
pages/storage/order-create/index.js

@ -58,25 +58,26 @@ Scene({
})
}
},
chooseFactory: function(){
chooseList: function(e){
console.log(e.currentTarget.id == 'orderId')
var that = this
wx.navigateTo({
url: `/pages/home/factory-list/index?type=1`,
events: {
onCallback: (data) => {
if (data.what == 140) {
if(data.detail.paperMillId){
that.data.form.deliveryChannelType = 2
that.data.form.factoryDeliveryChannelId = data.detail.paperMillId
} else {
that.data.form.deliveryChannelType = 1
that.data.form.factoryDeliveryChannelId = data.detail.id
}
that.setData({ ['form.factoryName']: data.detail.name })
}
}
}
})
// wx.navigateTo({
// url: `/pages/home/factory-list/index?type=1`,
// events: {
// onCallback: (data) => {
// if (data.what == 140) {
// if(data.detail.paperMillId){
// that.data.form.deliveryChannelType = 2
// that.data.form.factoryDeliveryChannelId = data.detail.paperMillId
// } else {
// that.data.form.deliveryChannelType = 1
// that.data.form.factoryDeliveryChannelId = data.detail.id
// }
// that.setData({ ['form.factoryName']: data.detail.name })
// }
// }
// }
// })
},
showPlate: function (e) {
this.keyboard = this.keyboard || this.selectComponent('#wux-keyboard')

19
pages/storage/order-create/index.wxml

@ -1,11 +1,22 @@
<!--pages/storage/index/index.wxml-->
<wxs module="formate" src="../../formate.wxs"></wxs>
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">出货信息</view>
<view slot="content">出货订单</view>
</cu-custom>
<view wx:if="{{form}}">
<van-cell center is-link bind:click="chooseFactory">
<view style="background-color:#f3f3f3;">
<text class="text-sg" style="line-height:64rpx;padding-left:32rpx">出货信息</text>
</view>
<van-cell id="orderId" clickable center is-link bind:click="chooseList">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">
<text>关联代卖单</text>
</view>
<view class="text-gray">{{form.factoryName || '请选择代卖订单'}}</view>
</view>
</van-cell>
<van-cell id="factoryId" center is-link bind:click="chooseList">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">
<view class="text-red text-xl" style="line-height: 10px; padding-top: 8px">*</view>
@ -14,7 +25,7 @@
<view class="text-gray">{{form.factoryName || '请选择收货方'}}</view>
</view>
</van-cell>
<van-cell center is-link bind:click="showCategory">
<van-cell clickable center is-link bind:click="showCategory">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">
<view class="text-red text-xl" style="line-height: 10px; padding-top: 8px">*</view>
@ -30,7 +41,7 @@
placeholder="请输入纸品包数" value="{{form.packageQuantity || ''}}" bindinput="bindInput" />
</view>
</van-cell>
<van-cell center bind:click="showPlate">
<van-cell clickable center bind:click="showPlate">
<view class="flex flex-justify text-black">
<view class="flex flex-center text-black">
<view class="text-red text-xl" style="line-height: 10px; padding-top: 8px">*</view>

Loading…
Cancel
Save