1
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user