This commit is contained in:
雷欧(林平凡)
2025-08-24 16:49:43 +08:00
parent eb1c66b3b6
commit 4b4d0cb755

View File

@@ -131,10 +131,10 @@
</el-alert>
<div slot="footer" class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" :loading="loading" @click="submitPublish"> </el-button>
<el-button type="primary" :loading="loading" @click="submitPublish"> </el-button>
<el-button
type="warning"
v-if="createdProduct && createdProduct.productId"
:disabled="!createdProduct || !createdProduct.productId"
:loading="publishLoading"
@click="publishNow"
> </el-button>
@@ -384,7 +384,16 @@ export default {
const extraImages = String(f.extraImagesText || '').split(/\n+/).map(s => s.trim()).filter(Boolean);
const images = [...selectedImages, ...extraImages];
if (!images.length) { this.$modal.msgError('请至少选择或填写一张图片'); return; }
let channelPv = undefined; if (f.channelPvJson && f.channelPvJson.trim()) { try { channelPv = JSON.parse(f.channelPvJson); } catch(e) { this.$modal.msgError('属性JSON格式不正确'); return; } }
let channelPv = undefined;
if (f.channelPvJson && f.channelPvJson.trim()) {
try { channelPv = JSON.parse(f.channelPvJson); }
catch(e) { this.$modal.msgError('属性JSON格式不正确'); return; }
} else if (this.selectedPv && Object.keys(this.selectedPv).length) {
channelPv = Object.keys(this.selectedPv).map(pid => ({
property_id: isNaN(Number(pid)) ? pid : Number(pid),
value_id: this.selectedPv[pid]
}));
}
const payload = {
appid: f.appid || undefined,
title: f.title,
@@ -405,7 +414,8 @@ export default {
spBizType: f.spBizType,
channelCatId: f.channelCatId,
stuffStatus: f.stuffStatus || undefined,
channelPv: channelPv
// 后端字段为下划线命名
channel_pv: channelPv
};
function cents(yuan){ const n = Number(yuan); if (Number.isNaN(n)) return undefined; return Math.round(n*100); }
this.loading = true;