Browse Source

no message

feature/v1.0
xpz2018 5 years ago
parent
commit
35c01855de
8 changed files with 74 additions and 44 deletions
  1. 16
      pages/home/employee/index.js
  2. 4
      pages/login/index.js
  3. 2
      pages/process/index/index.wxml
  4. 8
      pages/process/index/index.wxss
  5. 2
      pages/process/order-info/index.wxml
  6. 23
      pages/process/order-list/index.js
  7. 55
      pages/process/order-list/index.wxml
  8. 8
      pages/process/order-list/index.wxss

16
pages/home/employee/index.js

@ -21,21 +21,18 @@ Page({
*/
onLoad: function (options) {
this.setData({ height: app.globalData.fragmentHeight })
// wx.showLoading({ title: '加载中', mask: true })
// this.fetchMemberList()
wx.showLoading({ title: '加载中', mask: true })
this.fetchMemberList()
},
fetchMemberList: function(){
getCheckList({enterpriseId: app.accountInfo.enterpriseId}).then(result => {
//成功回调
getCheckList({enterpriseId: app.userInfo.enterpriseId}).then(result => {
this.setData({ checkList: result.data, loading: false})
}).catch(err => {
//异常回调
wx.hideLoading()
util.showToast(err)
})
this.data.eemidList = []
getEmployeList({enterpriseId: app.accountInfo.enterpriseId, isPassFromBackstage: 1}).then(result => {
//成功回调
getEmployeList({enterpriseId: app.userInfo.enterpriseId, isPassFromBackstage: 1}).then(result => {
for (let index = 0; index < result.data.length; index++) {
const element = result.data[index]
if(element.position == 'ADMINISTRATOR'){
@ -45,7 +42,6 @@ Page({
this.setData({ memberList: result.data, loading: false })
wx.hideLoading()
}).catch(err => {
//异常回调
wx.hideLoading()
util.showToast(err)
})
@ -84,11 +80,9 @@ Page({
}
}
adminEmploye({ids: this.data.eemidList }).then(result => {
//成功回调
this.setData({ ['memberList[' + index + '].position'] : item.position == 'ADMINISTRATOR' ? 'ORDINARY' : 'ADMINISTRATOR'})
wx.hideLoading()
}).catch(err => {
//异常回调
wx.hideLoading()
util.showToast(err)
})
@ -96,10 +90,8 @@ Page({
deleteItem: function(index, item){
wx.showLoading({ title: '加载中', mask: true })
deleteEmploye({idList: [item.id] }).then(result => {
//成功回调
this.fetchMemberList()
}).catch(err => {
//异常回调
wx.hideLoading()
util.showToast(err)
})

4
pages/login/index.js

@ -23,8 +23,8 @@ Page({
loging: false,
regist: false,
metaData: null,
code: null,
// code: '?mark=cloudprint&QrCodeRecordId=552615937199706112'
// code: null,
code: '?mark=cloudprint&QrCodeRecordId=554273274725535744'
},
/************************************** 初始化登录流程 ********************************************/
onLoad: function (options) {

2
pages/process/index/index.wxml

@ -7,7 +7,7 @@
<view style="height:250rpx;background-color:#008AFF;border-radius: 0rpx 0rpx 12rpx 12rpx;">
<view class="flex flex-center" style="padding:32rpx 28rpx;justify-content: flex-start">
<image style="width:100rpx;height:100rpx" src="/assets/image/icon_logo.png"></image>
<view class="text-xxl text-bold" style="color:white;margin-left:32rpx">{{userInfo.factoryName}}</view>
<view class="text-xxl text-bold name">{{userInfo.enterpriseName}}</view>
</view>
</view>

8
pages/process/index/index.wxss

@ -1,4 +1,12 @@
/* pages/index/index.wxss */
.menu:active {
opacity: .5
}
.name{
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
color:white;
margin-left:32rpx;
}

2
pages/process/order-info/index.wxml

@ -35,7 +35,7 @@
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">废纸品类</view>
<view class="text-gray">{{form.productCategoryName}}</view>
<view class="text-gray">{{form.productName}}</view>
</view>
</van-cell>
<van-cell>

23
pages/process/order-list/index.js

@ -19,7 +19,8 @@ Page({
pageNum: 1,
pageSize: 10
},
title: '全部'
title: '全部',
lastTime: null
},
// * 生命周期函数--监听页面加载
onLoad: function (options) {
@ -53,6 +54,7 @@ Page({
loading: true,
finished: false
})
this.data.lastTime = null
this.fetchOrderList()
},
//1:待定价,2:待过皮重,3:待过磅审核,4:待付款,5:已完成
@ -68,6 +70,25 @@ Page({
getFactoryOrderList(this.data.form).then(result => {
if (result.data && result.data.records.length) {
var respList = result.data.records
// 对返回的消息列表进行处理,将同一天的消息显示在一起
for (let i = 0; i < respList.length; i++) {
if (util.isEmpty(this.data.lastTime)) {
this.data.lastTime = respList[i].createTime
if (this.data.lastTime.length > 10) {
this.data.lastTime = this.data.lastTime.substring(0, 10)
}
respList[i].tipsTime = this.data.lastTime
} else {
var itemTime = respList[i].createTime
if (itemTime.length > 10) {
itemTime = itemTime.substring(0, 10)
}
if (this.data.lastTime !== itemTime) {
respList[i].tipsTime = itemTime
}
this.data.lastTime = itemTime
}
}
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

55
pages/process/order-list/index.wxml

@ -11,35 +11,38 @@
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image>
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view>
</view>
<van-index-bar index-list="{{null}}" wx:else>
<van-index-anchor index="01月13日" />
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex">
<van-cell wx:for="{{pageItem}}" wx:key="index" data-page="{{pageIndex}}" data-index="{{index}}" bind:click="lookItem">
<view slot="title" class="flex flex-justify" style="align-items: flex-start">
<view style="height: 100rpx">
<view class="flex" class="text-sg text-black">
<text>客户名称:{{item.factoryCustomerName}}</text>
<text wx:if="{{item.status != 1 && item.factoryCustomerMobile}}">({{item.factoryCustomerMobile}})</text>
</view>
<view class="text-sm text-gray">毛重:{{item.totalWeight}}KG</view>
</view>
<view class="flex flex-center" wx:if="{{item.status == 1}}" style="height: 100rpx">
<van-button plain type="default" custom-style="height:64rpx;width:132rpx" data-id="{{item.id}}" bind:click="cancelOrder">取消</van-button>
<van-button plain type="info" custom-style="margin-left:24rpx;height:64rpx;width:132rpx" data-id="{{item.id}}" bind:click="priceOrder">定价</van-button>
</view>
<view class="flex flex-center" wx:if="{{item.status == 3}}" style="height: 100rpx">
<van-button plain type="info" custom-style="height:64rpx;width:132rpx" data-id="{{item.id}}" bind:click="checkOrder">审核</van-button>
</view>
<view class="flex flex-center" wx:if="{{item.status == 4}}">
<view class="text-df" style="color:#FA541C">待付款</view>
</view>
<view class="flex flex-center" wx:if="{{item.status == 5}}">
<view class="text-df" style="color:#028A00">已完成</view>
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex">
<view class="bg-white" wx:for="{{pageItem}}" wx:key="index">
<view style="background-color:#f3f3f3;" wx:if="{{item.tipsTime}}">
<text class="text-sg" style="line-height:64rpx;padding-left:32rpx">{{item.tipsTime}}</text>
</view>
<view class="flex flex-justify item-content" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem">
<view style="height: 88rpx">
<view class="flex flex-center text-sg text-black">
<text>客户名称:{{item.factoryCustomerName}}</text>
<text wx:if="{{item.status != 1 && item.factoryCustomerMobile}}">({{item.factoryCustomerMobile}})</text>
</view>
<view class="text-sm text-gray" style="margin-top:12rpx">毛重:{{item.totalWeight}}KG</view>
</view>
<view class="flex flex-center" wx:if="{{item.status == 1}}" style="height: 88rpx">
<van-button plain type="default" custom-style="height:64rpx;width:132rpx" data-id="{{item.id}}"
bind:click="cancelOrder">取消</van-button>
<van-button plain type="info" custom-style="margin-left:24rpx;height:64rpx;width:132rpx" data-id="{{item.id}}"
bind:click="priceOrder">定价</van-button>
</view>
</van-cell>
<view class="flex flex-center" wx:if="{{item.status == 3}}" style="height: 88rpx">
<van-button plain type="info" custom-style="height:64rpx;width:132rpx" data-id="{{item.id}}"
bind:click="checkOrder">审核</van-button>
</view>
<view class="flex flex-center" wx:if="{{item.status == 4}}">
<view class="text-df" style="color:#FA541C">待付款</view>
</view>
<view class="flex flex-center" wx:if="{{item.status == 5}}">
<view class="text-df" style="color:#028A00">已完成</view>
</view>
</view>
</view>
</van-index-bar>
</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}}" />

8
pages/process/order-list/index.wxss

@ -1 +1,7 @@
/* pages/process/order-list/index.wxss */
/* 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;
}
Loading…
Cancel
Save