From 16ce65260285933e1031cb8c84f38d7209f1f56f Mon Sep 17 00:00:00 2001
From: xpz2018 <107107461@qq.com>
Date: Thu, 25 Feb 2021 16:36:32 +0800
Subject: [PATCH] no message
---
api/request.js | 17 ++--
api/saas.js | 4 +-
app.json | 2 +
pages/client/order-list/index.js | 8 +-
pages/home/customer-info/index.js | 3 +-
pages/home/customer-info/index.wxml | 4 +-
pages/home/customer-list/index.js | 3 +-
pages/home/customer-list/index.wxml | 3 +-
pages/home/index/index.js | 2 +-
pages/login/index.js | 10 +-
pages/process/check-list/index.js | 153 ++++++++++++++++++++++++++++
pages/process/check-list/index.json | 12 +++
pages/process/check-list/index.wxml | 53 ++++++++++
pages/process/check-list/index.wxss | 7 ++
pages/process/index/index.js | 2 +-
pages/storage/index/index.js | 66 ++++++++++++
pages/storage/index/index.json | 3 +
pages/storage/index/index.wxml | 2 +
pages/storage/index/index.wxss | 1 +
19 files changed, 331 insertions(+), 24 deletions(-)
create mode 100644 pages/process/check-list/index.js
create mode 100644 pages/process/check-list/index.json
create mode 100644 pages/process/check-list/index.wxml
create mode 100644 pages/process/check-list/index.wxss
create mode 100644 pages/storage/index/index.js
create mode 100644 pages/storage/index/index.json
create mode 100644 pages/storage/index/index.wxml
create mode 100644 pages/storage/index/index.wxss
diff --git a/api/request.js b/api/request.js
index 035f5c5..1b9304b 100644
--- a/api/request.js
+++ b/api/request.js
@@ -37,17 +37,16 @@ axios.interceptors.request.use(
*/
axios.interceptors.response.use(
async (res) => {
- const { data, statusCode: status } = res
- try {
- return await handleResponse({ data, status })
- } catch (err) {
- return Promise.reject(err)
- }
- },
- (err) => {
- console.error(err)
+ const { data, statusCode: status } = res
+ try {
+ return await handleResponse({ data, status })
+ } catch (err) {
return Promise.reject(err)
}
+ },
+ (err) => {
+ return Promise.reject(err)
+ }
)
/**
diff --git a/api/saas.js b/api/saas.js
index 3efd498..606b504 100644
--- a/api/saas.js
+++ b/api/saas.js
@@ -34,6 +34,7 @@ const editCustomer = (params) => mPost(`/ztb-factory/factory/edit/customer`, par
const deleteCustomer = (id) => mPost(`/ztb-factory/factory/delete/customer/${id}`, null, sconfig)
const getCustomerInfo = (id) => mGet(`/ztb-factory/factory/wechat-applet/get/customer-detail/${id}`, null, sconfig)
const bindCustomer = (params) => mPost(`/ztb-factory/user/binding/factory-customer`, params, sconfig)
+const getCustomerOrderList = (params) => mGet(`ztb-factory/factory-customer/get/order-list`, params, sconfig)
export {
sconfig,
@@ -61,5 +62,6 @@ export {
bindCustomer,
getPaperList,
repeatOrder,
- getStatisticsInfo
+ getStatisticsInfo,
+ getCustomerOrderList
}
\ No newline at end of file
diff --git a/app.json b/app.json
index 2d2a015..f78e979 100644
--- a/app.json
+++ b/app.json
@@ -9,6 +9,7 @@
"pages/home/customer-info/index",
"pages/home/authory/index",
"pages/home/qrcode/index",
+ "pages/process/check-list/index",
"pages/process/order-list/index",
"pages/process/order-price/index",
"pages/process/order-info/index",
@@ -17,6 +18,7 @@
"pages/htmls/agreement/index",
"pages/htmls/auths/index",
"pages/message/detail/index",
+ "pages/storage/index/index",
"pages/client/index/index",
"pages/client/home/index",
"pages/client/order-list/index",
diff --git a/pages/client/order-list/index.js b/pages/client/order-list/index.js
index 35f01a4..78b6bfc 100644
--- a/pages/client/order-list/index.js
+++ b/pages/client/order-list/index.js
@@ -1,5 +1,5 @@
// pages/client/order-list/index.js
-import { getFactoryOrderList } from "../../../api/saas"
+import { getCustomerOrderList } from "../../../api/saas"
const util = require('../../../utils/util')
const app = getApp()
@@ -23,7 +23,7 @@ Page({
top: 0,
orderList: [],
form: {
- funcType: 0,
+ status: '',
pageNum: 1,
pageSize: 10
},
@@ -68,7 +68,7 @@ Page({
} else {
this.setData({ requesting: true })
}
- getFactoryOrderList(this.data.form).then(result => {
+ getCustomerOrderList(this.data.form).then(result => {
if (result.data && result.data.records.length) {
var respList = result.data.records
// 对返回的消息列表进行处理,将同一天的消息显示在一起
@@ -116,7 +116,7 @@ Page({
}
}).catch(err => {
this.setData({ requesting: false, loading: false })
- util.showToast(err)
+ console.log(err)
})
},
lookItem: function (e) {
diff --git a/pages/home/customer-info/index.js b/pages/home/customer-info/index.js
index 66e530d..94b756f 100644
--- a/pages/home/customer-info/index.js
+++ b/pages/home/customer-info/index.js
@@ -39,7 +39,8 @@ Page({
factoryId: app.userInfo.factoryId,
factoryName: app.userInfo.factoryName,
factoryCustomerId: this.data.form.id,
- factoryCustomerName: this.data.form.name
+ factoryCustomerName: this.data.form.name,
+ factoryCustomerMobile: this.data.form.mobile
}
generateCode(params).then(result => {
this.setData({ showEmbedded: true, base64: result.data, customerName: this.data.form.name })
diff --git a/pages/home/customer-info/index.wxml b/pages/home/customer-info/index.wxml
index ad4aba1..73f682e 100644
--- a/pages/home/customer-info/index.wxml
+++ b/pages/home/customer-info/index.wxml
@@ -39,8 +39,8 @@
- 邀请注册纸通宝
-
+ 邀请注册纸通宝
+
保存
diff --git a/pages/home/customer-list/index.js b/pages/home/customer-list/index.js
index 2930a1e..73d951f 100644
--- a/pages/home/customer-list/index.js
+++ b/pages/home/customer-list/index.js
@@ -102,7 +102,8 @@ Page({
factoryId: app.userInfo.factoryId,
factoryName: app.userInfo.factoryName,
factoryCustomerId: item.id,
- factoryCustomerName: item.name
+ factoryCustomerName: item.name,
+ factoryCustomerMobile: item.mobile
}
generateCode(form).then(result => {
this.setData({ showEmbedded: true, base64: result.data, customerName: item.name })
diff --git a/pages/home/customer-list/index.wxml b/pages/home/customer-list/index.wxml
index 545722a..da39edb 100644
--- a/pages/home/customer-list/index.wxml
+++ b/pages/home/customer-list/index.wxml
@@ -23,7 +23,8 @@
{{item.name || ''}}
{{item.mobile || ('卡号:' + item.cardNo)}}
- 邀请注册纸通宝
+ 邀请注册纸通宝
diff --git a/pages/home/index/index.js b/pages/home/index/index.js
index a778491..d0e7217 100644
--- a/pages/home/index/index.js
+++ b/pages/home/index/index.js
@@ -71,7 +71,7 @@ Component({
}
},
orderList: function(){
- wx.navigateTo({ url: '/pages/mall/order-list/index' })
+ wx.navigateTo({ url: '/pages/process/order-list/index' })
},
tipApply: function(){
wx.navigateTo({ url: '/pages/htmls/auths/index' })
diff --git a/pages/login/index.js b/pages/login/index.js
index 4bc762d..617339b 100644
--- a/pages/login/index.js
+++ b/pages/login/index.js
@@ -25,7 +25,7 @@ Page({
regist: false,
metaData: null,
code: null
- // code: '?mark=ztb_saas&QrCodeRecordId=561997269805699072'
+ // code: '?mark=ztb_saas&QrCodeRecordId=562333739288498176'
},
/************************************** 初始化登录流程 ********************************************/
onLoad: function (options) {
@@ -108,8 +108,12 @@ Page({
// 这里要进行账号的绑定,对工厂进行绑定;或者进行申请操作;
if(this.data.metaData.qrPage == '/page/index/register'){
this.data.metaData.userName = this.data.metaData.factoryCustomerName || '默认姓名'
- }
- this.setData({ loging: false, metaData: this.data.metaData })
+ }
+ if(!util.isEmpty(this.data.metaData.factoryCustomerMobile)){
+ this.setData({ loging: false, metaData: this.data.metaData, ['form.account']: this.data.metaData.factoryCustomerMobile })
+ } else {
+ this.setData({ loging: false, metaData: this.data.metaData })
+ }
} else {
if(app.userInfo.factoryId){
wx.redirectTo({ url: '/pages/index/index' })
diff --git a/pages/process/check-list/index.js b/pages/process/check-list/index.js
new file mode 100644
index 0000000..c278217
--- /dev/null
+++ b/pages/process/check-list/index.js
@@ -0,0 +1,153 @@
+// pages/process/order-list/index.js
+import Dialog from '../../../components/dialog/dialog'
+import { getFactoryOrderList, cancelOrder } from "../../../api/saas"
+const event = require('../../../utils/event')
+const util = require('../../../utils/util')
+const app = getApp()
+
+Page({
+ // * 页面的初始数据
+ data: {
+ height: app.globalData.fragmentHeight,
+ loading: true,
+ requesting: false,
+ finished: false,
+ top: 0,
+ orderList: [],
+ form: {
+ funcType: 0,
+ pageNum: 1,
+ pageSize: 10
+ },
+ title: '全部',
+ lastTime: null
+ },
+ // * 生命周期函数--监听页面加载
+ onLoad: function (options) {
+ if(options.status){
+ this.data.form.funcType = Number(options.status)
+ if(this.data.form.funcType == 1){
+ this.data.title = '待定价订单'
+ } else if(this.data.form.funcType == 2){
+ this.data.title = '过磅审核订单'
+ } else if(this.data.form.funcType == 3){
+ this.data.title = '待付款订单'
+ } else if(this.data.form.funcType == 4){
+ this.data.title = '已完成订单'
+ } else if(this.data.form.funcType == 5){
+ this.data.title = '已关闭订单'
+ }
+ }
+ event.on('OrderMessage', this, this.onEvent)
+ this.setData({ height: app.globalData.fragmentHeight, title: this.data.title })
+ this.fetchOrderList()
+ },
+ onEvent: function(message){
+ if (message.what == 12) {
+ this.onRefreshList()
+ }
+ },
+ onRefreshList: function () {
+ this.setData({
+ orderList: [],
+ ['form.pageNum']: 1,
+ loading: true,
+ finished: false
+ })
+ this.data.lastTime = null
+ this.fetchOrderList()
+ },
+ //1:待定价,2:待过皮重,3:待过磅审核,4:待付款,5:已完成
+ fetchOrderList: function () {
+ if (this.data.requesting || this.data.finished) {
+ return
+ }
+ if (this.data.loading) {
+ this.data.requesting = true
+ } else {
+ this.setData({ requesting: true })
+ }
+ getFactoryOrderList(this.data.form).then(result => {
+ this.handResult(result)
+ }).catch(err => {
+ this.setData({ requesting: false, loading: false })
+ util.showToast(err)
+ })
+ },
+ handResult: function(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
+ if(this.data.form.pageNum == 1){
+ this.setData({
+ [nowList]: respList,
+ ['form.pageNum']: (num + 1),
+ top: 0,
+ finished,
+ requesting: false,
+ loading: false
+ })
+ } else {
+ this.setData({
+ [nowList]: respList,
+ ['form.pageNum']: (num + 1),
+ finished,
+ requesting: false,
+ loading: false
+ })
+ }
+ } else {
+ this.setData({ finished: true, requesting: false, loading: false })
+ }
+ },
+ cancelOrder: function(e){
+ Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => {
+ wx.showLoading({ title: '正在获取', mask: true })
+ cancelOrder(e.currentTarget.dataset.id).then(result => {
+ wx.hideLoading()
+ util.showToast('订单已经删除')
+ this.onRefreshList()
+ }).catch(err => {
+ wx.hideLoading()
+ util.showToast(err)
+ })
+ })
+ },
+ lookItem: function (e) {
+ var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index]
+ if(item.status == 2 || item.status == 3 || item.status == 4 || item.status == 5){
+ wx.navigateTo({ url: '/pages/process/order-info/index?id=' + item.id })
+ }
+ },
+ priceOrder: function(e){
+ wx.navigateTo({ url: '/pages/process/order-price/index?id=' + e.currentTarget.dataset.id })
+ },
+ checkOrder: function(e){
+ wx.navigateTo({ url: '/pages/process/order-info/index?id=' + e.currentTarget.dataset.id })
+ },
+ onUnload: function(){
+ event.remove('OrderMessage', this)
+ }
+
+})
\ No newline at end of file
diff --git a/pages/process/check-list/index.json b/pages/process/check-list/index.json
new file mode 100644
index 0000000..83b51ac
--- /dev/null
+++ b/pages/process/check-list/index.json
@@ -0,0 +1,12 @@
+{
+ "usingComponents": {
+ "refresh-view": "/components/refresher/index",
+ "van-button": "/components/button/index",
+ "van-index-bar": "/components/index-bar/index",
+ "van-index-anchor": "/components/index-anchor/index",
+ "van-cell": "/components/cell/index",
+ "van-divider": "/components/divider/index",
+ "van-loading": "/components/loading/index",
+ "van-dialog": "/components/dialog/index"
+ }
+}
\ No newline at end of file
diff --git a/pages/process/check-list/index.wxml b/pages/process/check-list/index.wxml
new file mode 100644
index 0000000..818942c
--- /dev/null
+++ b/pages/process/check-list/index.wxml
@@ -0,0 +1,53 @@
+
+
+ {{title}}
+
+
+
+
+
+
+
+
+ {{loading? '正在加载' : '暂无数据'}}
+
+
+
+
+ {{item.tipsTime}}
+
+
+
+
+ 客户名称:{{item.factoryCustomerName}}
+ ({{item.factoryCustomerMobile}})
+
+ 毛重:{{item.totalWeight}}KG
+
+
+ 取消
+ 定价
+
+
+ 审核
+
+
+ 待付款
+
+
+ 已完成
+
+
+
+
+
+
+
+ {{finished?'到底啦~':'加载中...'}}
+
+
+
+
\ No newline at end of file
diff --git a/pages/process/check-list/index.wxss b/pages/process/check-list/index.wxss
new file mode 100644
index 0000000..bc19567
--- /dev/null
+++ b/pages/process/check-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;
+}
\ No newline at end of file
diff --git a/pages/process/index/index.js b/pages/process/index/index.js
index 8da4624..a9e56d2 100644
--- a/pages/process/index/index.js
+++ b/pages/process/index/index.js
@@ -72,7 +72,7 @@ Component({
if(e.currentTarget.dataset.status == 3){
wx.navigateTo({ url: '/pages/process/payment-list/index?status=' + e.currentTarget.dataset.status })
} else {
- wx.navigateTo({ url: '/pages/process/order-list/index?status=' + e.currentTarget.dataset.status })
+ wx.navigateTo({ url: '/pages/process/check-list/index?status=' + e.currentTarget.dataset.status })
}
},
outList: function(e){
diff --git a/pages/storage/index/index.js b/pages/storage/index/index.js
new file mode 100644
index 0000000..3286650
--- /dev/null
+++ b/pages/storage/index/index.js
@@ -0,0 +1,66 @@
+// pages/storage/index/index.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/storage/index/index.json b/pages/storage/index/index.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/storage/index/index.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/storage/index/index.wxml b/pages/storage/index/index.wxml
new file mode 100644
index 0000000..ab41676
--- /dev/null
+++ b/pages/storage/index/index.wxml
@@ -0,0 +1,2 @@
+
+pages/storage/index/index.wxml
diff --git a/pages/storage/index/index.wxss b/pages/storage/index/index.wxss
new file mode 100644
index 0000000..c3de589
--- /dev/null
+++ b/pages/storage/index/index.wxss
@@ -0,0 +1 @@
+/* pages/storage/index/index.wxss */
\ No newline at end of file