商家工位、工时订单因接口新加字段导致的页面不能正常显示bug修复
This commit is contained in:
parent
64dea3ff2b
commit
7a5181a638
|
|
@ -377,15 +377,14 @@
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (this.identity == 0) {
|
if (this.identity == 0) {
|
||||||
// 商家视角:优先使用手艺人信息,若没有则使用商家自己的信息
|
const userSyr = res.data.user_syr || {}; // 避免 null 展开报错
|
||||||
const provider = res.data.user_syr || res.data.user_sj || {};
|
|
||||||
this.orderInfo = res.data ? {
|
this.orderInfo = res.data ? {
|
||||||
...res.data.order,
|
...res.data.order,
|
||||||
...res.data.work_seat,
|
...res.data.work_seat,
|
||||||
...provider,
|
...userSyr,
|
||||||
work_hour_id: res.data.work_seat.id,
|
work_hour_id: res.data.work_seat.id,
|
||||||
order_id: res.data.order.id,
|
order_id: res.data.order.id,
|
||||||
user_sj_id: provider.id,
|
syr_id: userSyr.id, // 用于判断是否有手艺人/顾客信息
|
||||||
} : {};
|
} : {};
|
||||||
} else if (this.identity == 1) {
|
} else if (this.identity == 1) {
|
||||||
// 手艺人视角
|
// 手艺人视角
|
||||||
|
|
|
||||||
|
|
@ -411,13 +411,14 @@
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (this.identity == 0) {
|
if (this.identity == 0) {
|
||||||
|
const userSyr = res.data.user_syr || {}; // 避免 null 展开报错
|
||||||
this.orderInfo = res.data ? {
|
this.orderInfo = res.data ? {
|
||||||
...res.data.order,
|
...res.data.order,
|
||||||
...res.data.work_hour,
|
...res.data.work_hour,
|
||||||
...res.data.user_syr,
|
...userSyr, // 有手艺人就展开,没有就是空对象
|
||||||
work_hour_id: res.data.work_hour.id,
|
work_hour_id: res.data.work_hour.id,
|
||||||
order_id: res.data.order.id,
|
order_id: res.data.order.id,
|
||||||
user_sj_id: res.data.user_syr.id,
|
syr_id: userSyr.id, // 手艺人ID(无手艺人时为 undefined)
|
||||||
} : {};
|
} : {};
|
||||||
console.log(this.orderInfo, '----------------------------------')
|
console.log(this.orderInfo, '----------------------------------')
|
||||||
} else if (this.identity == 1) {
|
} else if (this.identity == 1) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue