From eb6fc6f38f61928eb6448fb46fae970153efdc15 Mon Sep 17 00:00:00 2001 From: "97694732@qq.com" Date: Wed, 3 Jun 2026 17:28:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=E9=BB=98=E8=AE=A41+=E5=93=81?= =?UTF-8?q?=E7=9B=B8quality=E5=8F=82=E6=95=B0=E4=BC=A0=E5=AD=94=E5=A4=AB?= =?UTF-8?q?=E5=AD=90+=E8=B4=A7=E5=8C=BA=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E5=B7=B2=E4=BD=BF=E7=94=A8getWarehouseList?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/upload/upload.vue | 16 ++++++++++++++-- utils/kongfz.js | 13 +++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/pages/upload/upload.vue b/pages/upload/upload.vue index 6a1bc97..38dfa79 100644 --- a/pages/upload/upload.vue +++ b/pages/upload/upload.vue @@ -721,7 +721,7 @@ export default { fixPrice: '', printTime: '', price: '', - stock: '', + stock: 1, selectedCondition: '', conditionList: ['六品', '七品', '八品', '八五品', '九品', '九五品', '全新'], photoList: [], @@ -828,6 +828,18 @@ export default { }, computed: { + conditionValue() { + const map = { + '全新': '100~', + '九五品': '95~', + '九品': '90~', + '八五品': '85~', + '八品': '80~', + '七品': '70~', + '六品': '60~' + } + return this.selectedCondition ? (map[this.selectedCondition] || '') : '' + }, sortedProductList() { let list = [...this.productList] // 筛选(精确匹配,同zhizhu) @@ -974,7 +986,7 @@ export default { const sortType = this.sortBy === 'book' ? '5' : '7' // 并行请求:商品列表 + 品相统计(在售)+ 品相统计(已售) Promise.all([ - searchProducts(keyword, { phpsessid, sortType }), + searchProducts(keyword, { phpsessid, sortType, quality: this.conditionValue }), searchFacet(keyword, { phpsessid, dataType: 0 }), searchFacet(keyword, { phpsessid, dataType: 1 }) ]).then(([productsData, onSaleFacet, soldFacet]) => { diff --git a/utils/kongfz.js b/utils/kongfz.js index 519f991..4d75f2b 100644 --- a/utils/kongfz.js +++ b/utils/kongfz.js @@ -190,7 +190,7 @@ export function fetchItems(token, params = {}, onProgress) { * list中每项: {id, title, author, press, priceText, imgBigUrl, shopName, qualityText, pubDateText, postage} */ export function searchProducts(keyword, options = {}) { - const { phpsessid = '', page = 1, sortType = '' } = options + const { phpsessid = '', page = 1, sortType = '', quality = '' } = options return new Promise((resolve, reject) => { const reqData = { dataType: 0, @@ -198,9 +198,18 @@ export function searchProducts(keyword, options = {}) { page: page, userArea: '1006000000' } + const actionPaths = [] if (sortType) { reqData.sortType = sortType - reqData.actionPath = 'sortType' + actionPaths.push('sortType') + } + if (quality) { + reqData.quality = quality + reqData.quaSelect = '2' + actionPaths.push('quality') + } + if (actionPaths.length > 0) { + reqData.actionPath = actionPaths.join(',') } uni.request({ url: 'https://search.kongfz.com/pc-gw/search-web/client/pc/product/keyword/list',