更新订单列表详情,更新商品管理,更新代客下单
This commit is contained in:
41
pageProduct/util.js
Normal file
41
pageProduct/util.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import {
|
||||
$types
|
||||
} from '@/pageProduct/goodsData.js'
|
||||
export function returnSkuSnap(goods) {
|
||||
const selectSpec = typeof goods.selectSpec === 'string' ? JSON.parse(goods.selectSpec) : goods.selectSpec
|
||||
let result = selectSpec.map(v => {
|
||||
return {
|
||||
name: v.name,
|
||||
value: v.selectSpecResult.join(',')
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
export function returnTypeEnum(typeEnum) {
|
||||
const item = $types.find(v => v.title == typeEnum)
|
||||
let result = item ? item.value : undefined
|
||||
return result
|
||||
}
|
||||
export function returnCategory(cateName, cateList) {
|
||||
console.log(cateName);
|
||||
console.log(cateList);
|
||||
const item = cateList.find(v => v.name == cateName)
|
||||
let result = item ? item : undefined
|
||||
return result
|
||||
}
|
||||
export function returnAllCategory(arr) {
|
||||
const result = arr.reduce((prve, cur) => {
|
||||
prve.push(...[{
|
||||
...cur,
|
||||
name: '' + cur.name,
|
||||
childrenList: undefined
|
||||
}, ...cur.childrenList.map(v => {
|
||||
return {
|
||||
...v,
|
||||
name: '' + v.name
|
||||
}
|
||||
})])
|
||||
return prve
|
||||
}, [])
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user