diff --git a/pages/upload/upload.vue b/pages/upload/upload.vue index ed0cc41..b3c49bd 100644 --- a/pages/upload/upload.vue +++ b/pages/upload/upload.vue @@ -1927,16 +1927,16 @@ export default { this.noIsbnCategoryIndex = 0 this.noIsbnSelectedCategoryValue = '' } - // 更新出版社 + // 更新出版社(最多20条) if (pressList.length > 0) { - this.noIsbnPublisherOptions = pressList.map(function(item) { return item.showName }) + this.noIsbnPublisherOptions = pressList.map(function(item) { return item.showName }).slice(0, 20) this.noIsbnPublisherDropdownVisible = true } else { this.noIsbnPublisherOptions = [] } - // 更新作者 + // 更新作者(最多20条) if (authorList.length > 0) { - this.noIsbnAuthorOptions = authorList.map(function(item) { return item.showName }) + this.noIsbnAuthorOptions = authorList.map(function(item) { return item.showName }).slice(0, 20) this.noIsbnAuthorDropdownVisible = true } else { this.noIsbnAuthorOptions = [] @@ -3230,9 +3230,13 @@ export default { new: onSaleFacet ? onSaleFacet.newCount : 0, sold: soldFacet ? (soldFacet.oldCount + soldFacet.newCount) : 0 } - // 填充下拉选项 - that.noIsbnAuthorOptions = Array.from(authorSet).filter(Boolean).slice(0, 10) - that.noIsbnPublisherOptions = Array.from(publisherSet).filter(Boolean).slice(0, 10) + // 填充下拉选项(仅当孔网API未拉取时使用历史数据兜底) + if (that.noIsbnAuthorOptions.length === 0) { + that.noIsbnAuthorOptions = Array.from(authorSet).filter(Boolean).slice(0, 10) + } + if (that.noIsbnPublisherOptions.length === 0) { + that.noIsbnPublisherOptions = Array.from(publisherSet).filter(Boolean).slice(0, 10) + } // 自动计算并填入售价 that.$nextTick(() => { if (that.calculatedNoIsbnPrice > 0) {