|
@@ -217,7 +217,7 @@ const getSku = () => {
|
|
})
|
|
})
|
|
.then((response: any) => {
|
|
.then((response: any) => {
|
|
const res = response.hits
|
|
const res = response.hits
|
|
- skuList.value = res.map((item: any) => {
|
|
|
|
|
|
+ let temp = res.map((item: any) => {
|
|
const t =
|
|
const t =
|
|
typeof item.images === 'string'
|
|
typeof item.images === 'string'
|
|
? `${item.images}`.split(',').filter((i: string) => i.length > 0)
|
|
? `${item.images}`.split(',').filter((i: string) => i.length > 0)
|
|
@@ -231,6 +231,12 @@ const getSku = () => {
|
|
}),
|
|
}),
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ // product_type属性有几种类型 indent Express Stock Other. 把他们按这个顺序排雷, 所有indent要出现在嘴在前面, Other在最后面
|
|
|
|
+ temp.sort((a: any, b: any) => {
|
|
|
|
+ const order = ['indent', 'Express', 'Stock', 'Other']
|
|
|
|
+ return order.indexOf(a.product_type) - order.indexOf(b.product_type)
|
|
|
|
+ })
|
|
|
|
+ skuList.value = temp
|
|
total.value = response.nbHits > 1000 ? 1000 : response.nbHits
|
|
total.value = response.nbHits > 1000 ? 1000 : response.nbHits
|
|
})
|
|
})
|
|
.finally(() => {
|
|
.finally(() => {
|