库存默认1+品相quality参数传孔夫子+货区数据源已使用getWarehouseList
This commit is contained in:
parent
273803fa92
commit
eb6fc6f38f
@ -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]) => {
|
||||
|
||||
@ -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',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user