代码更新

This commit is contained in:
GaoHao
2025-03-03 09:44:11 +08:00
parent b4a0393d2d
commit fd0c452a76
55 changed files with 2263 additions and 2658 deletions

View File

@@ -466,7 +466,8 @@
getProductDetail,
addProduct,
updateProduct,
delProduct
delProduct,
productBindCons
} from '@/api/product.js'
import {
uploadFile
@@ -575,6 +576,7 @@
watch(() => FormData.type, (newval) => {
if (option.type == 'edit') {
FormData.specId = newval != 'sku' ? '' : ($goodsData.specId || '')
console.log($goodsData)
if (newval == $goodsData.type) {
skuList.list = $goodsData.skuList
if ($goodsData.groupSnap) {
@@ -665,17 +667,17 @@
url: v
}
})
for (let i in res.conInfos) {
const con = res.conInfos[i]
const item = res.skuList.find(v => v.id == con.productSkuId)
res.consList.map(v=>{
const item = res.skuList.find(v => v.productId == v.productId)
if (item) {
if (item.hasOwnProperty('haoCaiList')) {
item.haoCaiList.push(con)
item.haoCaiList.push(v)
} else {
item.haoCaiList = [con]
item.haoCaiList = [v]
}
}
}
})
res.skuList = (res.skuList.length ? res.skuList : [])
$goodsData = res
@@ -758,6 +760,7 @@
}else{
FormData.groupType = null
}
console.log(FormData)
}
/**
@@ -1074,7 +1077,7 @@
}
}
if (type == 'single') {
if (type != 'sku') {
let lowPrice = skuList.list[0] ? skuList.list[0].salePrice : FormData.salePrice
let suitNum = skuList.list[0] ? skuList.list[0].suitNum : 0
if (lowPrice === '') {
@@ -1088,7 +1091,9 @@
}
}
if (type == 'sku') {
if ( selectSpecInfo.length ==0 || JSON.stringify(selectSpecInfo) == '{}') {
return infoBox.showToast('请选择规格!')
}
}
if (type == 'package') {
if (groupType == 0 && FormData.proGroupVo[0].goods.length <= 0) {
@@ -1218,6 +1223,9 @@
*/
function toTimerPage() {
go.to('PAGES_PRODUCT_TIMER', {
days: FormData.days,
startTime: FormData.startTime,
endTime: FormData.endTime
})
}