From 05a9bc94bc668aad3ddd3093196f1167dbb05877 Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Wed, 24 Jul 2024 10:08:40 +0800
Subject: [PATCH] fix
---
order/addCourse/addCourse.vue | 4 +++
order/editCourse/editCourse.vue | 38 ++++++++++++++++++++--------
order/orderDetail/orderDetail.vue | 42 ++++++++++++++++++++-----------
pages/orders/orders.vue | 8 ++++--
4 files changed, 65 insertions(+), 27 deletions(-)
diff --git a/order/addCourse/addCourse.vue b/order/addCourse/addCourse.vue
index 9b03c23..de4eb62 100644
--- a/order/addCourse/addCourse.vue
+++ b/order/addCourse/addCourse.vue
@@ -234,6 +234,7 @@
serviceFee: 0, // 平台服务费(前端计算后展示,不入库)
mallNonAssociatedLinks: e.mallNonAssociatedLinks, // 产品链接
typeName: e.typeName,
+ classificationId: e.classificationId,
}
},
// 判断是否为客户已有的课程
@@ -262,6 +263,9 @@
if (list.length) {
if (this.submiting) return false
this.submiting = true
+ uni.showLoading({
+ title: '加载中'
+ })
const result = this.courses
const list1 = [] // 实训、理论
diff --git a/order/editCourse/editCourse.vue b/order/editCourse/editCourse.vue
index feda620..62b3304 100644
--- a/order/editCourse/editCourse.vue
+++ b/order/editCourse/editCourse.vue
@@ -6,7 +6,7 @@
{{ c.name }}
- {{ units.find(e => e.id === c.unit).text }}
+ {{ c.unit !== '' ? units.find(e => e.id === c.unit).text : '请选择' }}
@@ -134,16 +134,17 @@
// 产品分类
productCategoryList().then(res => {
res.classificationList.forEach(e => {
- courses['list' + this.$util.getOrderType(e.classificationId)] = {
+ courses['list' + e.classificationId] = {
shrink: false,
name: e.classificationName,
deadline: '',
- unit: 2,
+ unit: '',
list: []
}
})
const { provinceId, cityId } = this
const isTrial = this.orderType == 2
+
list.map(async e => {
// 查询产品管理设置的平台结算价
if (provinceId) {
@@ -167,7 +168,7 @@
if (isTrial) {
this.calcDate(e, !e.authority)
}
- courses['list' + e.authority].list.push(e)
+ courses['list' + e.classificationId].list.push(e)
})
this.courses = courses
}).catch(e => {})
@@ -186,11 +187,13 @@
title: '标题',
itemList: that.unitText,
success: ({ tapIndex }) => {
- c.unit = tapIndex
- c.list.map(e => {
- e.options = tapIndex
- that.calcDate(e, !e.authority)
- })
+ if (tapIndex !== '') {
+ c.unit = tapIndex
+ c.list.map(e => {
+ e.options = tapIndex
+ that.calcDate(e, !e.authority)
+ })
+ }
}
})
},
@@ -201,8 +204,10 @@
title: '标题',
itemList: that.unitText,
success: ({ tapIndex }) => {
- item.options = tapIndex
- that.calcDate(item)
+ if (tapIndex !== '') {
+ item.options = tapIndex
+ that.calcDate(item)
+ }
}
})
},
@@ -388,6 +393,11 @@
msg = '请输入使用期限!'
break
}
+ if (e.options === '') {
+ this.err = 'accountNum' + suf
+ msg = '请选择期限!'
+ break
+ }
if (!e.startTime) {
this.err = 'startTime' + suf
msg = '请选择起止日期!'
@@ -407,6 +417,9 @@
if (msg) return this.$util.errMsg(msg)
if (this.orderRepeat.length) return this.$util.errMsg(this.repeatMsg) // 有重复订单不能提交
this.submiting = true
+ uni.showLoading({
+ title: '加载中'
+ })
list.forEach(e => {
e.edited = 1 // 未编辑过的标识,编辑过了的产品在编辑产品页不再显示
})
@@ -449,6 +462,9 @@
.unit {
min-width: 80rpx;
text-align: center;
+ &.placeholder {
+ color: #797979;
+ }
}
}
}
diff --git a/order/orderDetail/orderDetail.vue b/order/orderDetail/orderDetail.vue
index 4dc3174..c025a07 100644
--- a/order/orderDetail/orderDetail.vue
+++ b/order/orderDetail/orderDetail.vue
@@ -35,11 +35,11 @@
邮箱
{{ form.email }}
-
+
订单编号
@@ -226,7 +226,7 @@
email: '',
customerId: '', // 客户id
customerName: '',
- orderType: 2,
+ orderType: '',
cityId: '',
cityName: '',
phone: '',
@@ -297,6 +297,9 @@
if (this.orderId) {
this.getInfo()
} else if (options.edited && store) { // 不是从购物车进来,并且有产品缓存(即是从当前页面点下一步编辑完产品回来的情况),则处理缓存里的产品
+ uni.showLoading({
+ title: '加载中'
+ })
// 新增取缓存,取了删除
const list = []
for (const i in store) {
@@ -320,6 +323,9 @@
uni.removeStorageSync('courses')
} catch (e) {}
this.calcTotal()
+ this.$nextTick(() => {
+ uni.hideLoading()
+ })
}
// 如果是客户订单记录页面点的新增,会有客户id,要默认选中该客户
@@ -530,6 +536,16 @@
},
// 跳转
toAdd(add) {
+ const { form } = this
+ if (!form.customerId) {
+ this.err = 'customerName'
+ return this.$util.errMsg('请选择客户!')
+ }
+ if (!form.orderType) {
+ this.err = 'orderType'
+ return this.$util.errMsg('请选择订单类型!')
+ }
+
add && uni.setStorageSync('courses', this.courses)
uni.setStorageSync('orderForm', this.form)
const { customerId, orderType } = this.form
@@ -537,9 +553,7 @@
const url = this.shopCart ?
`../editCourse/editCourse` :
`../addCourse/addCourse`
- customerId ?
- this.$util.to(url + `?orderType=${orderType}&customerId=${customerId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`) :
- this.$util.errMsg('请先选择客户!')
+ this.$util.to(url + `?orderType=${orderType}&customerId=${customerId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`)
},
// 前往创建客户
toClient() {
@@ -609,8 +623,8 @@
profit += +e.finalPrice - curPurchase
}
})
- form.purchaseCost = purchase
- form.profit = profit
+ form.purchaseCost = purchase.toFixed(2)
+ form.profit = profit.toFixed(2)
form.orderAmount = (+form.purchaseCost + +form.profit).toFixed(2)
},
// 计算订单总额
@@ -1160,15 +1174,15 @@
.action {
z-index: 2;
position: fixed;
- bottom: 0;
+ bottom: 24rpx;
display: flex;
- justify-content: space-around;
+ justify-content: flex-end;
width: 100%;
- padding: 5px 10px;
+ padding-right: 50rpx;
padding-bottom: env(safe-area-inset-bottom);
- background-color: #fff;
- border-top: 1px solid #f3f3f3;
- box-shadow: 0 -2px 2px #f5f5f5;
+ // background-color: #fff;
+ // border-top: 1px solid #f3f3f3;
+ // box-shadow: 0 -2px 2px #f5f5f5;
box-sizing: border-box;
&:empty {
padding: 0 !important;
diff --git a/pages/orders/orders.vue b/pages/orders/orders.vue
index cbab507..b188f73 100644
--- a/pages/orders/orders.vue
+++ b/pages/orders/orders.vue
@@ -39,7 +39,7 @@
订单内容:
{{ item.orderContent }}
- {{ item.toggle ? '收起' : '展开' }}
+ {{ item.toggle ? '收起' : '展开' }}
@@ -92,6 +92,10 @@
title: "已完成",
value: 1
},
+ {
+ title: "已取消",
+ value: 2
+ },
],
}
],
@@ -232,7 +236,7 @@
// 未加载完所有数据,并且不是筛选,则拼接list,否则直接赋值
const list = data.records
list.map(e => {
- e.toggle = e.orderContent.length < 14 // 超过了14个字才需要显示展开按钮
+ if (e.orderContent) e.toggle = e.orderContent.length < 14 // 超过了14个字才需要显示展开按钮
})
this.list = this.reachBottom > 0 ? [...this.list, ...list] : list
this.page++ // 每次获取了数据后page+1