Browse Source

no message

feature/v1.0
xpz2018 5 years ago
parent
commit
1da650f62e
22 changed files with 398 additions and 565 deletions
  1. 20
      components/count-down/index.js
  2. 32
      pages/api/saas.js
  3. 110
      pages/enterprise/address-new/index.js
  4. 8
      pages/enterprise/address-new/index.json
  5. 38
      pages/enterprise/address-new/index.wxml
  6. 1
      pages/enterprise/address-new/index.wxss
  7. 81
      pages/enterprise/address/index.js
  8. 8
      pages/enterprise/address/index.json
  9. 32
      pages/enterprise/address/index.wxml
  10. 1
      pages/enterprise/address/index.wxss
  11. 2
      pages/login/index.js
  12. 2
      pages/login/index.wxml
  13. 73
      pages/process/index.wxs
  14. 10
      pages/process/index/index.js
  15. 6
      pages/process/index/index.wxml
  16. 74
      pages/process/order-check/index.js
  17. 163
      pages/process/order-check/index.wxml
  18. 51
      pages/process/order-info/index.js
  19. 4
      pages/process/order-info/index.json
  20. 204
      pages/process/order-info/index.wxml
  21. 41
      pages/process/order-list/index.js
  22. 2
      pages/process/order-list/index.wxml

20
components/count-down/index.js

@ -49,33 +49,33 @@ VantComponent({
this.remain = this.data.time; this.remain = this.data.time;
this.setRemain(this.remain); this.setRemain(this.remain);
if (this.data.autoStart) { if (this.data.autoStart) {
this.start();
this.start()
} }
}, },
tick() { tick() {
if (this.data.millisecond) { if (this.data.millisecond) {
this.microTick();
this.microTick()
} }
else { else {
this.macroTick();
this.macroTick()
} }
}, },
microTick() { microTick() {
this.tid = simpleTick(() => { this.tid = simpleTick(() => {
this.setRemain(this.getRemain()); this.setRemain(this.getRemain());
if (this.remain !== 0) { if (this.remain !== 0) {
this.microTick();
this.microTick()
} }
}); });
}, },
macroTick() { macroTick() {
this.tid = simpleTick(() => { this.tid = simpleTick(() => {
const remain = this.getRemain();
const remain = this.getRemain()
if (!isSameSecond(remain, this.remain) || remain === 0) { if (!isSameSecond(remain, this.remain) || remain === 0) {
this.setRemain(remain);
this.setRemain(remain)
} }
if (this.remain !== 0) { if (this.remain !== 0) {
this.macroTick();
this.macroTick()
} }
}); });
}, },
@ -86,12 +86,12 @@ VantComponent({
this.remain = remain; this.remain = remain;
const timeData = parseTimeData(remain); const timeData = parseTimeData(remain);
if (this.data.useSlot) { if (this.data.useSlot) {
this.$emit('change', timeData);
this.$emit('change', timeData)
} }
this.setData({ formattedTime: parseFormat(this.data.format, timeData) }) this.setData({ formattedTime: parseFormat(this.data.format, timeData) })
if (remain === 0) { if (remain === 0) {
this.pause();
this.$emit('finish');
this.pause()
this.$emit('finish')
} }
} }
} }

32
pages/api/saas.js

@ -10,11 +10,39 @@ const sconfig = {
// *****************************************账户业务********************************************** // *****************************************账户业务**********************************************
const loginToken = (params) => mPost(`/recycle-user-center/authorize/get/product-line-token/by/login-token`, params, sconfig) const loginToken = (params) => mPost(`/recycle-user-center/authorize/get/product-line-token/by/login-token`, params, sconfig)
const getBaseInfo = () => mGet(`/ztb-factory/get/self-enterprise-profile-detail`, null, sconfig) const getBaseInfo = () => mGet(`/ztb-factory/get/self-enterprise-profile-detail`, null, sconfig)
const getOrderList = (params) => mGet(`/ztb-factory/get/self-enterprise-profile-detail`, params, sconfig)
const getOrderList = (params) => mGet(`/ztb-factory/factory-customer/get/order-list`, params, sconfig)
const getOrderInfo = (id) => mGet(`/ztb-factory/factory-customer/get/order-detail/${id}`, null, sconfig)
const pricingOrder = (params) => mPost(`/ztb-factory/factory/edit/order-price`, params, sconfig)
const cancelOrder = (params) => mPost(`/ztb-factory/factory/cancel/order`, params, sconfig)
const checkingOrder = (params) => mPost(`/ztb-factory/factory/edit/order-status`, params, sconfig)
const createOrder = (params) => mPost(`/ztb-factory/factory-customer/save/order`, params, sconfig)
const getFactoryOrderList = (status, params) => mGet(`/ztb-factory/factory/wechat-applet/get/order-list/${status}`, params, sconfig)
const getFactoryOrderInfo = (id) => mGet(`/ztb-factory/factory/wechat-applet/get/order-detail/${id}`, null, sconfig)
const getPaperPrice = (params) => mGet(`/ztb-factory/factory/get/product-price-list`, params, sconfig)
const savePaperPrice = (params) => mPost(`/ztb-factory/factory/save/product-price`, params, sconfig)
const updatePaperPrice = (params) => mPost(`/ztb-factory/factory/update/product-price`, params, sconfig)
const getCustomerList = (params) => mGet(`/ztb-factory/factory/wechat-applet/get/customer-list`, params, sconfig)
const editCustomer = (params) => mPost(`/ztb-factory/factory/edit/customer`, params, sconfig)
const deleteCustomer = (id) => mPost(`/ztb-factory/factory/delete/customer/${id}`, null, sconfig)
const getCustomerInfo = (id) => mPost(`/ztb-factory/factory/wechat-applet/get/customer-detail/${id}`, null, sconfig)
export { export {
sconfig, sconfig,
loginToken, loginToken,
getBaseInfo, getBaseInfo,
getOrderList
getFactoryOrderList,
getFactoryOrderInfo,
getOrderList,
getOrderInfo,
createOrder,
checkingOrder,
pricingOrder,
cancelOrder,
getPaperPrice,
savePaperPrice,
updatePaperPrice,
getCustomerList,
editCustomer,
deleteCustomer,
getCustomerInfo
} }

110
pages/enterprise/address-new/index.js

@ -1,110 +0,0 @@
// pages/enterprise/address-new/index.js
import { deleteAddress, saveAddress } from "../../api/user"
const util = require('../../../utils/util')
const region = require('../../../utils/area')
const storage = require('../../../utils/storage')
const event = require('../../../utils/event')
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
id: null,
show: false,
areaList: region.default,
form: {
receiver:'',
receiverMobile:'',
detail:'',
isDefault: 0,
provinceId: '',
provinceName: '',
cityId: '',
cityName: '',
districtId: '',
districtName: ''
},
requesting: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(options.id){
this.setData({ id: Number(options.id)})
}
var json = storage.get('gdw-address')
if(json){
storage.remove('gdw-address')
var form = JSON.parse(json)
form.areaStr = form.provinceName + ' ' + form.cityName + ' ' + form.districtName
this.setData({ form: form})
}
},
showRegion: function(){
if(this.data.disabled){
return
}
this.setData({ show: true })
},
bindinput: function(e){
this.data.form[e.target.id] = e.detail.value
},
onChange: function({ detail }) {
// 需要手动对 checked 状态进行更新
this.setData({ ['form.isDefault']: detail ? 1 : 0 })
},
onConfirm: function({ detail }){
this.data.form.enterpriseId = app.accountInfo.enterpriseId
this.data.form.provinceId = detail.values[0].code
this.data.form.provinceName = detail.values[0].name
this.data.form.cityId = detail.values[1].code
this.data.form.cityName = detail.values[1].name
this.data.form.districtId = detail.values[2].code
this.data.form.districtName = detail.values[2].name
var areaStr = detail.values[0].name + ' ' + detail.values[1].name + ' ' + detail.values[2].name
this.setData({ show: false, ['form.areaStr']: areaStr })
},
deleteForm: function(){
wx.showLoading({ title: '处理中', mask: true })
deleteAddress(this.data.form.id).then(result => {
wx.hideLoading()
event.emit('EventMessage', { what: 40, desc: 'Address' })
util.showBackToast('地址已删除')
}).catch(err => {
wx.hideLoading()
})
},
submitForm: function () {
if(util.isEmpty(this.data.form.receiver)){
util.showToast('请输入联系人')
return
}
if(util.isEmpty(this.data.form.receiverMobile)){
util.showToast('请输入联系电话')
return
}
if(util.isEmpty(this.data.form.districtId)){
util.showToast('请选择所在地区')
return
}
if(util.isEmpty(this.data.form.detail)){
util.showToast('请输入详细地址')
return
}
wx.showLoading({ title: '处理中', mask: true })
saveAddress(this.data.form).then(result => {
wx.hideLoading()
event.emit('EventMessage', { what: 40, desc: 'Address' })
util.showBackToast('添加成功')
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
},
onClose: function() {
this.setData({ show: false })
}
})

8
pages/enterprise/address-new/index.json

@ -1,8 +0,0 @@
{
"usingComponents": {
"van-switch": "/components/switch/index",
"van-popup": "/components/popup/index",
"van-area": "/components/area/index",
"van-button": "/components/button/index"
}
}

38
pages/enterprise/address-new/index.wxml

@ -1,38 +0,0 @@
<!--pages/enterprise/address-new/index.wxml-->
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">{{ id ? '编辑' : '新增' }}地址</view>
</cu-custom>
<view class="cu-form-group margin-top">
<view class="title">收货人:</view>
<input id="receiver" disabled="{{disabled}}" placeholder-style="color:#aaa" placeholder="请输入收货人" value="{{form.receiver}}" bindinput="bindinput"></input>
</view>
<view class="cu-form-group">
<view class="title">手机号码:</view>
<input id="receiverMobile" disabled="{{disabled}}" placeholder-style="color:#aaa" placeholder="请输入手机号码" value="{{form.receiverMobile}}" bindinput="bindinput"></input>
</view>
<view class="cu-form-group" data-index="1" style="border-top: 1px solid #f3f3f3" bindtap="showRegion">
<view class="flex text-sg">所在地区:
<view class="{{form.areaStr||'input-grey'}}">{{form.areaStr||'请选择所在地区'}}</view>
</view>
<text class="cuIcon-right text-gray" wx:if="{{!disabled}}"></text>
</view>
<view class="cu-form-group" style="border-top: 1rpx solid #f3f3f3">
<view class="title">详细地址:</view>
<input id="detail" disabled="{{disabled}}" placeholder-style="color:#aaa" placeholder="请输入详细地址" value="{{form.detail}}" bindinput="bindinput"></input>
</view>
<view class="cu-form-group" style="border-top: 1rpx solid #f3f3f3">
<view class="title">设为默认地址:</view>
<van-switch checked="{{ form.isDefault ? true : false }}" bind:change="onChange" />
</view>
<view style="margin-top:48rpx;padding:30rpx 60rpx;">
<van-button block type="danger" loading="{{requesting}}" wx:if="{{id}}" bind:click="deleteForm" custom-style="margin-bottom: 24rpx">删除</van-button>
<van-button block type="info" loading="{{requesting}}" bind:click="submitForm">保存</van-button>
</view>
<van-popup show="{{ show }}" position="bottom" bind:close="onClose">
<van-area area-list="{{ areaList }}" value="{{form.districtId}}" bind:confirm="onConfirm" bind:cancel="onClose"/>
</van-popup>

1
pages/enterprise/address-new/index.wxss

@ -1 +0,0 @@
/* pages/enterprise/address-new/index.wxss */

81
pages/enterprise/address/index.js

@ -1,81 +0,0 @@
// pages/enterprise/address/index.js
import Dialog from '../../../components/dialog/dialog'
import { getAddressList, deleteAddress } from "../../api/user"
const event = require('../../../utils/event')
const util = require('../../../utils/util')
const storage = require('../../../utils/storage')
Page({
/**
* 页面的初始数据
*/
data: {
type: 0,
addressList: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(options.type){
this.data.type = Number(options.type)
}
event.on('EventMessage', this, this.onEvent)
this.fetchAddressList()
},
onEvent: function (message) {
if (message.what == 40) {
this.fetchAddressList()
}
},
fetchAddressList: function(){
wx.showLoading({ title: '加载中', mask: true })
// /product/{id}产品详情
getAddressList().then(result => {
wx.hideLoading()
this.setData({ addressList: result.data})
}).catch(err => {
wx.hideLoading()
})
},
lookItem: function(e){
var item = this.data.addressList[e.currentTarget.dataset.index]
if(this.data.type == 1){
event.emit('EventMessage', { what: 41, obj: item, desc: 'Address' })
wx.navigateBack()
} else {
storage.put('gdw-address', JSON.stringify(item), 1)
wx.navigateTo({ url: '/pages/enterprise/address-new/index?id=' + item.id })
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
addAddress: function (e) {
if(e.currentTarget.dataset.index >= 0){
var item = this.data.addressList[e.currentTarget.dataset.index]
storage.put('gdw-address', JSON.stringify(item), 1)
wx.navigateTo({ url: '/pages/enterprise/address-new/index?id=' + item.id })
} else {
wx.navigateTo({ url: '/pages/enterprise/address-new/index' })
}
},
delAddress: function(e){
var item = this.data.addressList[e.currentTarget.dataset.index]
var that = this
Dialog.confirm({ title: '温馨提示', message: '确定删除该地址?' }).then(() => {
wx.showLoading({ title: '处理中', mask: true })
deleteAddress(item.id).then(result => {
wx.hideLoading()
util.showToast('地址已删除')
that.fetchAddressList()
}).catch(err => {
console.log(err)
wx.hideLoading()
})
})
},
onUnload: function(){
event.remove('EventMessage', this)
}
})

8
pages/enterprise/address/index.json

@ -1,8 +0,0 @@
{
"usingComponents": {
"van-cell": "/components/cell/index",
"van-checkbox": "/components/checkbox/index",
"van-button": "/components/button/index",
"van-dialog": "/components/dialog/index"
}
}

32
pages/enterprise/address/index.wxml

@ -1,32 +0,0 @@
<!--pages/enterprise/address/index.wxml-->
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content" style="color:black;font-size:36rpx">地址管理</view>
</cu-custom>
<view wx:for="{{ addressList }}" wx:key="index" style="margin-top:{{index > 0 ? 16: 0}}rpx">
<van-cell clickable data-index="{{index}}" bind:click="lookItem">
<view slot="title" class="flex flex-column">
<text class="flex">
<text class="text-sg text-bold">{{item.receiver}}</text>
<text class="text-df text-gray" style="margin-left:8rpx">{{item.receiverMobile}}</text>
</text>
<text class="text-df text-gray">{{item.provinceName + item.cityName + item.districtName + item.detail}}</text>
</view>
</van-cell>
<view class="bg-white flex flex-justify" style="padding:16rpx">
<view class="flex flex-center" style="padding-left:12rpx">
<van-checkbox value="true" icon-size="32rpx" wx:if="{{ item.isDefault == 1 }}"></van-checkbox>
<text class="text-blue" style="margin-left:12rpx" wx:if="{{ item.isDefault == 1 }}">已设为默认</text>
</view>
<view class="flex">
<view class="text-gray" style="padding:4rpx 20rpx" data-index="{{index}}" catchtap="delAddress">删除</view>
<view class="text-gray" style="padding:4rpx 20rpx;margin-left:24rpx" data-index="{{index}}" catchtap="addAddress">编辑</view>
</view>
</view>
</view>
<view style="margin-top:30rpx;padding:30rpx 60rpx;">
<van-button block type="info" bind:click="addAddress">新增地址</van-button>
</view>
<van-dialog id="van-dialog" />

1
pages/enterprise/address/index.wxss

@ -1 +0,0 @@
/* pages/enterprise/address/index.wxss */

2
pages/login/index.js

@ -140,7 +140,7 @@ Page({
this.setData({ loginEnable: true }) this.setData({ loginEnable: true })
} }
}, },
onChange: function(e) {
onCountChange: function(e) {
if(e.detail.minutes != 0){ if(e.detail.minutes != 0){
return return
} }

2
pages/login/index.wxml

@ -18,7 +18,7 @@
<view wx:if="{{type == 1}}" class="cu-form-group" style="min-height:120rpx;border-bottom:1rpx solid #eee;padding:0rpx;border-top:0rpx solid #eee;"> <view wx:if="{{type == 1}}" class="cu-form-group" style="min-height:120rpx;border-bottom:1rpx solid #eee;padding:0rpx;border-top:0rpx solid #eee;">
<input id="captcha" type="number" placeholder-style="color:#aaa" maxlength="6" placeholder="请输入{{type == 1 ? '验证码' : '密码'}}" bindinput="bindInput" /> <input id="captcha" type="number" placeholder-style="color:#aaa" maxlength="6" placeholder="请输入{{type == 1 ? '验证码' : '密码'}}" bindinput="bindInput" />
<van-button size="small" plain type="info" custom-style="width:220rpx" disabled="{{!mobileEnable || !codeEnable}}" bind:click="fetchCaptcha"> <van-button size="small" plain type="info" custom-style="width:220rpx" disabled="{{!mobileEnable || !codeEnable}}" bind:click="fetchCaptcha">
<van-count-down class="count-down" time="{{ 60000 }}" use-slot auto-start="{{false}}" bind:change="onChange" bind:finish="onFinished">
<van-count-down class="count-down" time="{{ 60000 }}" use-slot auto-start="{{false}}" bind:change="onCountChange" bind:finish="onFinished">
<text class="text-sm">{{second}}</text> <text class="text-sm">{{second}}</text>
</van-count-down> </van-count-down>
</van-button> </van-button>

73
pages/process/index.wxs

@ -1,66 +1,31 @@
function itemStatus(status) {
if(status == -1){
return '待设计工序'
} else if(status == 0){
return '生产中'
// 订单状态。0:待接单,10:待反馈, 1:待验货,2:待确认,23:待厂长审核 3:待付款,30:待运营审核,31:待会计审核 4:已完成,5:已取消,6:不通过
function orderStatus(status) {
if(status == 0){
return '待接单'
} else if(status == 10){
return '待反馈'
} else if(status == 1){ } else if(status == 1){
return '待生产'
return '待验货'
} else if(status == 2){
return '待确认'
} else if(status == 23){
return '待厂长审核'
} else if(status == 3){ } else if(status == 3){
return '已完成'
return '待付款'
} else if(status == 30){
return '待运营审核'
} else if(status == 31){
return '待会计审核'
} else if(status == 4){ } else if(status == 4){
return '待分配'
}
return ''
}
// 已完成:3;已发货:5;生成中:0
function orderStatus(status, type) {
if(status == -1){
return '待提交'
} else if(status == 0 || status == 4){
if(type == 1){
return '采购中'
} else {
return '进行中'
}
} else if(status == 3){
return '已完成' return '已完成'
} else if(status == 5){ } else if(status == 5){
return ''
return '已取消'
} else if(status == 6){ } else if(status == 6){
return '已终止'
}
return ''
}
// 生产单状态:待生产:1;已完成:3;生产中:0;已终止:6
function prodStatus(status) {
if(status == 1){
return '待生产'
} else if(status == 0){
return '生产中'
} else if(status == 3){
return '已完成'
} else if(status == 6){
return '已终止'
}
return ''
}
function orderType(type) {
if(type == 0){
return '加工件'
} else if(type == 1){
return '物料'
} else if(type == 2){
return '成品'
return '不通过'
} }
return '' return ''
} }
module.exports = { module.exports = {
itemStatus: itemStatus,
orderStatus: orderStatus,
prodStatus: prodStatus,
orderType: orderType
orderStatus: orderStatus
} }

10
pages/process/index/index.js

@ -14,11 +14,11 @@ Component({
data: { data: {
height: app.globalData.safeFragmentHeight, height: app.globalData.safeFragmentHeight,
tabList: [ tabList: [
{ status: 0, badge: 2, name: '定价', icon: '/assets/image/icon_pricing.png' },
{ status: 1, badge: 4, name: '过磅审核', icon: '/assets/image/icon_checking.png' },
{ status: 2, badge: '', name: '代付款', icon: '/assets/image/icon_payment.png' },
{ status: 3, badge: '', name: '已完成', icon: '/assets/image/icon_finish.png' },
{ status: 4, badge: '', name: '已关闭', icon: '/assets/image/icon_close.png' }
{ status: 1, badge: 2, name: '定价', icon: '/assets/image/icon_pricing.png' },
{ status: 2, badge: 4, name: '过磅审核', icon: '/assets/image/icon_checking.png' },
{ status: 3, badge: '', name: '代付款', icon: '/assets/image/icon_payment.png' },
{ status: 4, badge: '', name: '已完成', icon: '/assets/image/icon_finish.png' },
{ status: 5, badge: '', name: '已关闭', icon: '/assets/image/icon_close.png' }
] ]
}, },
lifetimes: { lifetimes: {

6
pages/process/index/index.wxml

@ -1,4 +1,4 @@
<!--pages/index/index.wxml-->
<!--pages/process/index.wxml-->
<cu-custom bgColor="bg-white"> <cu-custom bgColor="bg-white">
<view slot="content" style="color:black;font-size:36rpx">工作台</view> <view slot="content" style="color:black;font-size:36rpx">工作台</view>
</cu-custom> </cu-custom>
@ -51,7 +51,7 @@
</view> </view>
</view> </view>
<view style="padding: 0rpx 28rpx;margin-top:24rpx">
<!-- <view style="padding: 0rpx 28rpx;margin-top:24rpx">
<view class="bg-white" style="border-radius: 20rpx;padding: 24rpx 0rpx 8rpx 0rpx"> <view class="bg-white" style="border-radius: 20rpx;padding: 24rpx 0rpx 8rpx 0rpx">
<view class="flex flex-justify" style="padding: 0rpx 28rpx 24rpx 28rpx"> <view class="flex flex-justify" style="padding: 0rpx 28rpx 24rpx 28rpx">
<view class="text-black text-sg text-bold">出货统计</view> <view class="text-black text-sg text-bold">出货统计</view>
@ -89,6 +89,6 @@
</van-grid-item> </van-grid-item>
</van-grid> </van-grid>
</view> </view>
</view>
</view> -->
<view style="height:24rpx;"></view> <view style="height:24rpx;"></view>
</scroll-view> </scroll-view>

74
pages/process/order-check/index.js

@ -1,5 +1,8 @@
// pages/process/order-check/index.js // pages/process/order-check/index.js
import Dialog from '../../../components/dialog/dialog' import Dialog from '../../../components/dialog/dialog'
import { pricingOrder, cancelOrder, getFactoryOrderInfo, getPaperPrice} from "../../api/saas"
const event = require('../../../utils/event')
const util = require('../../../utils/util')
const app = getApp() const app = getApp()
Page({ Page({
@ -8,17 +11,32 @@ Page({
*/ */
data: { data: {
safeBottom: app.globalData.safeBottom, safeBottom: app.globalData.safeBottom,
form: {
plateNumber: null
}
paperList: null,
form: null,
deductType: 1,
columns: [],
visible: false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({
safeBottom: app.globalData.safeBottom
})
if(options.id){
wx.showLoading({ title: '正在获取', mask: true })
getPaperPrice().then(result => {
this.setData({ safeBottom: app.globalData.safeBottom, paperList: result.data })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
getFactoryOrderInfo(options.id).then(result => {
wx.hideLoading()
this.setData({ form: result.data })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
}
}, },
showPlate: function (e) { showPlate: function (e) {
this.keyboard = this.keyboard || this.selectComponent('#wux-keyboard') this.keyboard = this.keyboard || this.selectComponent('#wux-keyboard')
@ -30,7 +48,20 @@ Page({
} }
}, },
showCategory: function(){ showCategory: function(){
this.setData({ visible: true })
},
onConfirm: function({ picker, value, index }){
this.setData({ visible: false })
},
onHide: function(){
this.setData({ visible: false })
},
changeDeductType: function(e){
if(e.currentTarget.dataset.type == 1){
this.setData({ deductType: e.currentTarget.dataset.type, [form.deductPercent]: null })
} else {
this.setData({ deductType: e.currentTarget.dataset.type, [form.deductWeight]: null })
}
}, },
bindInput: function (e) { bindInput: function (e) {
this.data.form[e.target.id] = e.detail.value this.data.form[e.target.id] = e.detail.value
@ -40,19 +71,36 @@ Page({
this.setData({ ['form.isDefault']: detail ? 1 : 0 }) this.setData({ ['form.isDefault']: detail ? 1 : 0 })
}, },
paddingOrder: function(){ paddingOrder: function(){
this.setData({ ['form.checking']: !this.data.form.checking })
this.setData({ ['form.weighingType']: !this.data.form.weighingType })
}, },
cancelOrder: function(e){ cancelOrder: function(e){
Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => { Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => {
wx.showLoading({ title: '处理中', mask: true })
cancelOrder({ id: this.data.form.id }).then(result => {
wx.hideLoading()
util.showBackToast('订单已经删除')
event.emit('OrderMessage', { what: 12, desc: 'cancelOrder' })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
})
},
priceOrder: function(){
wx.showLoading({ title: '处理中', mask: true })
pricingOrder(this.data.form).then(result => {
wx.hideLoading()
util.showBackToast('定价成功')
event.emit('OrderMessage', { what: 12, desc: 'pricingOrder' })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
}) })
}, },
viewImage: function (e) { viewImage: function (e) {
var imgList = [] var imgList = []
for (let index = 0; index < this.data.imgList.length; index++) {
if (this.data.imgList[index].indexOf('.mp4') >= 0) {
continue
}
imgList.push(this.data.imgList[index])
for (let index = 0; index < this.data.form.preWeighingPicture.length; index++) {
imgList.push(this.data.this.data.form.preWeighingPicture[index].url)
} }
wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url }) wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url })
} }

163
pages/process/order-check/index.wxml

@ -3,92 +3,99 @@
<view slot="content">定价详情</view> <view slot="content">定价详情</view>
</cu-custom> </cu-custom>
<van-index-anchor index="订单信息" />
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">客户姓名</view>
<view class="text-gray">客户姓名</view>
</view>
</van-cell>
<van-cell bind:click="showPlate">
<view slot="title" class="flex flex-justify">
<view class="text-black">车牌号码</view>
<view class="text-gray">{{form.plateNumber || '请输入车牌号码'}}</view>
</view>
</van-cell>
<van-cell bind:click="showCategory">
<view slot="title" class="flex flex-justify">
<view class="text-black">
<text>废纸品类</text>
<text class="text-red text-xl">*</text>
<view wx:if="{{form}}">
<van-index-anchor index="订单信息" />
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">客户姓名</view>
<view class="text-gray">{{form.factoryCustomerName}}</view>
</view> </view>
<view class="text-gray">请选择废纸品类</view>
</view>
</van-cell>
<van-index-anchor index="定价信息" />
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">
<text>单价(元/KG)</text>
<text class="text-red text-xl">*</text>
</van-cell>
<van-cell bind:click="showPlate">
<view slot="title" class="flex flex-justify">
<view class="text-black">车牌号码</view>
<view class="text-gray">{{form.plateNumber || '请输入车牌号码'}}</view>
</view> </view>
<input id="price" type="number" placeholder-style="color:#aaa" style="text-align: right" maxlength="8"
placeholder="请输单价" value="{{form.price}}" bindinput="bindInput" />
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">
<text>扣重(KG)</text>
<text class="text-red text-xl">*</text>
</van-cell>
<van-cell bind:click="showCategory">
<view slot="title" class="flex flex-justify">
<view class="text-black">
<text>废纸品类</text>
<text class="text-red text-xl">*</text>
</view>
<view class="text-gray">请选择废纸品类</view>
</view> </view>
<input id="weight" type="number" placeholder-style="color:#aaa" style="text-align: right" maxlength="8"
placeholder="请输入扣重重量" value="{{form.account}}" bindinput="bindInput" />
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">
<text>扣点(%)</text>
<text class="text-red text-xl">*</text>
</van-cell>
<van-index-anchor index="定价信息" />
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">
<text>单价(元/KG)</text>
<text class="text-red text-xl">*</text>
</view>
<input id="settleUnitPrice" type="number" placeholder-style="color:#aaa" style="text-align: right" maxlength="8"
placeholder="请输单价" value="{{form.settleUnitPrice}}" bindinput="bindInput" />
</view> </view>
<input id="weight" type="number" placeholder-style="color:#aaa" style="text-align: right" maxlength="8"
placeholder="请输入扣点比例" value="{{form.account}}" bindinput="bindInput" />
</view>
</van-cell>
<van-cell bind:click="paddingOrder">
<view slot="title" class="flex flex-justify">
<view class="text-black">是否无皮过磅</view>
<van-checkbox value="{{ form.checking }}"></van-checkbox>
</view>
</van-cell>
<van-index-anchor index="过磅信息" />
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">毛重(KG)</view>
<view class="text-gray">2000.00</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">
<view>过毛重照片</view>
<view class="flex" style="margin-top:18rpx"></view>
<van-image use-loading-slot width="100" height="100" custom-class="page-icon" src="{{'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fa3.att.hudong.com%2F02%2F38%2F01300000237560123245382609951.jpg&refer=http%3A%2F%2Fa3.att.hudong.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1613740606&t=80056f95b1e837a4d0f770c72a09cfe5'}}" bind:click="viewImage">
<view class="image-load" slot="loading"><van-loading type="spinner" size="32" /></view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="flex flex-center" class="text-black" data-type="1" bindtap="changeDeductType">
<van-checkbox value="{{ deductType == 1 }}"></van-checkbox>
<text style="margin-left:8rpx">扣重(KG)</text>
<text class="text-red text-xl">*</text>
</view>
<input id="deductWeight" type="number" disabled="{{deductType == 2}}" placeholder-style="color:#aaa" style="text-align: right" maxlength="8"
placeholder="请输入扣重重量" value="{{form.deductWeight}}" bindinput="bindInput" />
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify" data-type="2" bindtap="changeDeductType">
<view class="flex flex-center" class="text-black">
<van-checkbox value="{{ deductType == 2 }}"></van-checkbox>
<text style="margin-left:8rpx">扣点(%)</text>
<text class="text-red text-xl">*</text>
</view>
<input id="deductPercent" type="number" disabled="{{deductType == 1}}" placeholder-style="color:#aaa" style="text-align: right" maxlength="8"
placeholder="请输入扣点比例" value="{{form.deductPercent}}" bindinput="bindInput" />
</view>
</van-cell>
<van-cell bind:click="paddingOrder">
<view slot="title" class="flex flex-justify">
<view class="text-black">是否无皮过磅</view>
<van-checkbox value="{{ form.weighingType }}"></van-checkbox>
</view>
</van-cell>
<van-index-anchor index="过磅信息" />
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">毛重(KG)</view>
<view class="text-gray">2000.00</view>
</view>
</van-cell>
<van-cell>
<view slot="title">
<view class="text-black">过毛重照片</view>
<view class="flex" style="margin-top:18rpx">
<van-image wx:for="{{form.preWeighingPicture}}" wx:key="index" use-loading-slot width="100" height="100"
custom-class="page-icon" data-url="{{item.url}}" src="{{item.url}}" bind:click="viewImage">
<view class="image-load" slot="loading">
<van-loading type="spinner" size="32" />
</view>
</van-image> </van-image>
<van-image use-loading-slot width="100" height="100" custom-class="page-icon" src="{{'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fa3.att.hudong.com%2F02%2F38%2F01300000237560123245382609951.jpg&refer=http%3A%2F%2Fa3.att.hudong.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1613740606&t=80056f95b1e837a4d0f770c72a09cfe5'}}" bind:click="viewImage">
<view class="image-load" slot="loading"><van-loading type="spinner" size="32" /></view>
</van-image>
</view>
</view> </view>
</view>
</van-cell>
</van-cell>
</view>
<view style="height:{{136 + safeBottom}}rpx;"></view> <view style="height:{{136 + safeBottom}}rpx;"></view>
<view class="cu-bar bg-white foot" style="height:{{120 + safeBottom}}rpx;padding:0rpx 32rpx {{safeBottom}}rpx 32rpx;" wx:if="{{form}}">
<view class="cu-bar bg-white foot" style="height:{{120 + safeBottom}}rpx;padding:0rpx 32rpx {{safeBottom}}rpx 32rpx;"
wx:if="{{form}}">
<van-button plain type="default" custom-style="height:88rpx;width:254rpx" bind:click="cancelOrder">取消</van-button> <van-button plain type="default" custom-style="height:88rpx;width:254rpx" bind:click="cancelOrder">取消</van-button>
<van-button type="info" custom-style="margin-left:32rpx;height:88rpx;width:400rpx" bind:click="priceOrder">提交</van-button>
<van-button type="info" custom-style="margin-left:32rpx;height:88rpx;width:400rpx" bind:click="priceOrder">提交
</van-button>
</view> </view>
<van-dialog id="van-dialog" /> <van-dialog id="van-dialog" />
<vehicle-keyboard id="wux-keyboard" safeBottom="{{safeBottom}}" bind:change="onPlatenumber"></vehicle-keyboard>
<vehicle-keyboard id="wux-keyboard" safeBottom="{{safeBottom}}" bind:change="onPlatenumber"></vehicle-keyboard>
<van-popup position="bottom" show="{{ visible }}" bind:close="onHide" z-index="29">
<van-picker show-toolbar title="选择纸品" columns="{{ columns }}" bind:cancel="onHide" bind:confirm="onConfirm" />
</van-popup>

51
pages/process/order-info/index.js

@ -1,5 +1,8 @@
// pages/process/order-check/index.js // pages/process/order-check/index.js
import Dialog from '../../../components/dialog/dialog' import Dialog from '../../../components/dialog/dialog'
import { cancelOrder, getFactoryOrderInfo, checkingOrder} from "../../api/saas"
const event = require('../../../utils/event')
const util = require('../../../utils/util')
const app = getApp() const app = getApp()
Page({ Page({
@ -8,17 +11,22 @@ Page({
*/ */
data: { data: {
safeBottom: app.globalData.safeBottom, safeBottom: app.globalData.safeBottom,
form: {
plateNumber: null
}
form: null
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({
safeBottom: app.globalData.safeBottom
})
if(options.id){
wx.showLoading({ title: '正在获取', mask: true })
getFactoryOrderInfo(options.id).then(result => {
wx.hideLoading()
this.setData({ safeBottom: app.globalData.safeBottom, form: result.data })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
}
}, },
showPlate: function (e) { showPlate: function (e) {
this.keyboard = this.keyboard || this.selectComponent('#wux-keyboard') this.keyboard = this.keyboard || this.selectComponent('#wux-keyboard')
@ -44,15 +52,38 @@ Page({
}, },
cancelOrder: function(e){ cancelOrder: function(e){
Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => { Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => {
wx.showLoading({ title: '正在获取', mask: true })
cancelOrder({ id: this.data.form.id }).then(result => {
wx.hideLoading()
util.showBackToast('订单已经删除')
event.emit('OrderMessage', { what: 12, desc: 'cancelOrder' })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
})
},
checkOrder: function(){
wx.showLoading({ title: '正在获取', mask: true })
checkingOrder({ id: this.data.form.id }).then(result => {
wx.hideLoading()
util.showBackToast('订单审核已通过')
event.emit('OrderMessage', { what: 12, desc: 'checkingOrder' })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
}) })
}, },
viewImage: function (e) { viewImage: function (e) {
var imgList = [] var imgList = []
for (let index = 0; index < this.data.imgList.length; index++) {
if (this.data.imgList[index].indexOf('.mp4') >= 0) {
continue
if(e.currentTarget.dataset.type == 0){
for (let index = 0; index < this.data.form.preWeighingPicture.length; index++) {
imgList.push(this.data.this.data.form.preWeighingPicture[index].url)
}
} else {
for (let index = 0; index < this.data.form.aftWeighingPicture.length; index++) {
imgList.push(this.data.this.data.form.aftWeighingPicture[index].url)
} }
imgList.push(this.data.imgList[index])
} }
wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url }) wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url })
} }

4
pages/process/order-info/index.json

@ -5,6 +5,8 @@
"van-button": "/components/button/index", "van-button": "/components/button/index",
"van-loading": "/components/loading/index", "van-loading": "/components/loading/index",
"van-image": "/components/image/index", "van-image": "/components/image/index",
"van-dialog": "/components/dialog/index"
"van-dialog": "/components/dialog/index",
"van-popup": "/components/popup/index",
"van-picker": "/components/picker/index"
} }
} }

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

@ -2,117 +2,119 @@
<cu-custom bgColor="bg-white" isBack="{{true}}"> <cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">过磅详情</view> <view slot="content">过磅详情</view>
</cu-custom> </cu-custom>
<view class="flex flex-center info_status" style="justify-content: flex-start;">
<image style="height:42rpx;width:42rpx" src="/assets/image/icon_uncheck.png"></image>
<view class="text-white text-sg" style="margin-left:12rpx">待过磅审核</view>
</view>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">客户姓名</view>
<view class="text-gray">刘财顺</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">车牌号码</view>
<view class="text-gray">{{form.plateNumber || '请输入车牌号码'}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">废纸品类</view>
<view class="text-gray">黄纸板</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">毛重(KG)</view>
<view class="text-gray">黄纸板</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">皮重(KG)</view>
<view class="text-gray">黄纸板</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">净重(KG)</view>
<view class="text-gray">黄纸板</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">定价员</view>
<view class="text-gray">黄纸板</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">定价时间</view>
<view class="text-gray">2021年1月20日 21:46:27</view>
<view wx:if="{{form}}">
<view class="flex flex-center info_status" style="justify-content: flex-start;">
<image style="height:42rpx;width:42rpx" src="/assets/image/icon_uncheck.png"></image>
<view class="text-white text-sg" style="margin-left:12rpx">待过磅审核</view>
</view> </view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">客户姓名</view>
<view class="text-gray">{{form.factoryCustomerName}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">车牌号码</view>
<view class="text-gray">{{form.plateNumber || '请输入车牌号码'}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">废纸品类</view>
<view class="text-gray">{{form.productId}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">毛重(KG)</view>
<view class="text-gray">{{form.totalWeight}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">皮重(KG)</view>
<view class="text-gray">{{form.emptyWeight}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">净重(KG)</view>
<view class="text-gray">{{form.netWeight}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">定价员</view>
<view class="text-gray">{{form.inspectorName}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">定价时间</view>
<view class="text-gray">{{form.inspectionTime}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="text-black">
<view>过毛重照片</view> <view>过毛重照片</view>
<view class="flex" style="margin-top:18rpx"></view>
<van-image use-loading-slot width="100" height="100" custom-class="page-icon" src="{{'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fa3.att.hudong.com%2F02%2F38%2F01300000237560123245382609951.jpg&refer=http%3A%2F%2Fa3.att.hudong.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1613740606&t=80056f95b1e837a4d0f770c72a09cfe5'}}" bind:click="viewImage">
<view class="image-load" slot="loading"><van-loading type="spinner" size="32" /></view>
<view class="flex" style="margin-top:18rpx">
<van-image wx:for="{{form.preWeighingPicture}}" wx:key="index" use-loading-slot width="100" height="100"
custom-class="page-icon" data-url="{{item.url}}" data-type="0" src="{{item.url}}" bind:click="viewImage">
<view class="image-load" slot="loading">
<van-loading type="spinner" size="32" />
</view>
</van-image> </van-image>
<van-image use-loading-slot width="100" height="100" custom-class="page-icon" src="{{'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fa3.att.hudong.com%2F02%2F38%2F01300000237560123245382609951.jpg&refer=http%3A%2F%2Fa3.att.hudong.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1613740606&t=80056f95b1e837a4d0f770c72a09cfe5'}}" bind:click="viewImage">
<view class="image-load" slot="loading"><van-loading type="spinner" size="32" /></view>
</van-image>
</view>
</view> </view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">
</van-cell>
<van-cell>
<view slot="title" class="text-black">
<view>过皮重照片</view> <view>过皮重照片</view>
<view class="flex" style="margin-top:18rpx"></view>
<van-image use-loading-slot width="100" height="100" custom-class="page-icon" src="{{'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fa3.att.hudong.com%2F02%2F38%2F01300000237560123245382609951.jpg&refer=http%3A%2F%2Fa3.att.hudong.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1613740606&t=80056f95b1e837a4d0f770c72a09cfe5'}}" bind:click="viewImage">
<view class="image-load" slot="loading"><van-loading type="spinner" size="32" /></view>
<view class="flex" style="margin-top:18rpx">
<van-image wx:for="{{form.aftWeighingPicture}}" wx:key="index" use-loading-slot width="100" height="100"
custom-class="page-icon" data-url="{{item.url}}" data-type="1" src="{{item.url}}" bind:click="viewImage">
<view class="image-load" slot="loading">
<van-loading type="spinner" size="32" />
</view>
</van-image> </van-image>
<van-image use-loading-slot width="100" height="100" custom-class="page-icon" src="{{'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fa3.att.hudong.com%2F02%2F38%2F01300000237560123245382609951.jpg&refer=http%3A%2F%2Fa3.att.hudong.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1613740606&t=80056f95b1e837a4d0f770c72a09cfe5'}}" bind:click="viewImage">
<view class="image-load" slot="loading"><van-loading type="spinner" size="32" /></view>
</van-image>
</view>
</view> </view>
</view>
</van-cell>
<van-index-anchor index="订单信息" />
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">单价(元/KG)</view>
<view class="text-gray">1.80</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">金额(元)</view>
<view class="text-gray">47001.80</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">订单时间</view>
<view class="text-gray">2021年1月20日 21:46:27</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">订单编号</view>
<view class="text-gray">XXP123456709978957</view>
</view>
</van-cell>
</van-cell>
<van-index-anchor index="订单信息" />
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">单价(元/KG)</view>
<view class="text-gray">{{form.settleUnitPrice}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">金额(元)</view>
<view class="text-gray">{{form.createTime}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">订单时间</view>
<view class="text-gray">{{form.createTime}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">订单编号</view>
<view class="text-gray">{{form.createTime}}</view>
</view>
</van-cell>
</view>
<view style="height:{{136 + safeBottom}}rpx;"></view> <view style="height:{{136 + safeBottom}}rpx;"></view>
<view class="cu-bar bg-white foot" style="height:{{120 + safeBottom}}rpx;padding:0rpx 32rpx {{safeBottom}}rpx 32rpx;" wx:if="{{form}}">
<view class="cu-bar bg-white foot" style="height:{{120 + safeBottom}}rpx;padding:0rpx 32rpx {{safeBottom}}rpx 32rpx;"
wx:if="{{form}}">
<van-button plain type="default" custom-style="height:88rpx;width:254rpx" bind:click="cancelOrder">重新过皮重</van-button> <van-button plain type="default" custom-style="height:88rpx;width:254rpx" bind:click="cancelOrder">重新过皮重</van-button>
<van-button type="info" custom-style="margin-left:32rpx;height:88rpx;width:400rpx" bind:click="priceOrder">通过审核</van-button>
<van-button type="info" custom-style="margin-left:32rpx;height:88rpx;width:400rpx" bind:click="checkOrder">通过审核
</van-button>
</view> </view>
<van-dialog id="van-dialog" /> <van-dialog id="van-dialog" />

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

@ -1,6 +1,6 @@
// pages/process/order-list/index.js // pages/process/order-list/index.js
import Dialog from '../../../components/dialog/dialog' import Dialog from '../../../components/dialog/dialog'
import { getOrderList, cancelOrder, receiptOrder} from "../../api/saas"
import { getFactoryOrderList, cancelOrder } from "../../api/saas"
const event = require('../../../utils/event') const event = require('../../../utils/event')
const util = require('../../../utils/util') const util = require('../../../utils/util')
const app = getApp() const app = getApp()
@ -20,7 +20,8 @@ Page({
form: { form: {
status: 0, status: 0,
pageNum: 1 pageNum: 1
}
},
title: '全部'
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -28,10 +29,27 @@ Page({
onLoad: function (options) { onLoad: function (options) {
if(options.status){ if(options.status){
this.data.form.status = Number(options.status) this.data.form.status = Number(options.status)
if(this.data.form.status == 1){
this.data.title = '定价列表'
} else if(this.data.form.status == 2){
this.data.title = '过磅审核'
} else if(this.data.form.status == 3){
this.data.title = '代付款'
} else if(this.data.form.status == 4){
this.data.title = '已完成'
} else if(this.data.form.status == 5){
this.data.title = '已关闭'
}
} }
this.setData({ height: app.globalData.fragmentHeight })
event.on('OrderMessage', this, this.onEvent)
this.setData({ height: app.globalData.fragmentHeight, title: this.data.title })
this.fetchOrderList() this.fetchOrderList()
}, },
onEvent: function(message){
if (message.what == 12) {
this.onRefreshList()
}
},
onRefreshList: function () { onRefreshList: function () {
this.setData({ this.setData({
orderList: [], orderList: [],
@ -50,8 +68,8 @@ Page({
} else { } else {
this.setData({ requesting: true }) this.setData({ requesting: true })
} }
getOrderList(this.data.form).then(result => {
if (result.data.records.length) {
getFactoryOrderList(this.data.form.status, this.data.form).then(result => {
if (result.data && result.data.records.length) {
var respList = result.data.records var respList = result.data.records
let nowList = `orderList[${this.data.orderList.length}]` let nowList = `orderList[${this.data.orderList.length}]`
var num = this.data.form.pageNum var num = this.data.form.pageNum
@ -78,17 +96,28 @@ Page({
this.setData({ finished: true, requesting: false, loading: false }) this.setData({ finished: true, requesting: false, loading: false })
} }
}).catch(err => { }).catch(err => {
//异常回调
this.setData({ requesting: false, loading: false }) this.setData({ requesting: false, loading: false })
util.showToast(err) util.showToast(err)
}) })
}, },
cancelOrder: function(e){ cancelOrder: function(e){
Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => { Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => {
wx.showLoading({ title: '正在获取', mask: true })
cancelOrder({ id: this.data.form.id }).then(result => {
wx.hideLoading()
util.showToast('订单已经删除')
this.onRefreshList()
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
}) })
}, },
priceOrder: function(e){ priceOrder: function(e){
wx.navigateTo({ url: '/pages/process/order-info/index?id=' }) wx.navigateTo({ url: '/pages/process/order-info/index?id=' })
},
onUnload: function(){
event.remove('OrderMessage', this)
} }
}) })

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

@ -1,6 +1,6 @@
<!--pages/process/order-list/index.wxml--> <!--pages/process/order-list/index.wxml-->
<cu-custom bgColor="bg-white" isBack="{{true}}"> <cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">定价列表</view>
<view slot="content">{{title}}</view>
</cu-custom> </cu-custom>
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchOrderList"> <refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchOrderList">

Loading…
Cancel
Save