库存默认1+品相quality参数传孔夫子+货区数据源已使用getWarehouseList
This commit is contained in:
parent
273803fa92
commit
eb6fc6f38f
@ -721,7 +721,7 @@ export default {
|
|||||||
fixPrice: '',
|
fixPrice: '',
|
||||||
printTime: '',
|
printTime: '',
|
||||||
price: '',
|
price: '',
|
||||||
stock: '',
|
stock: 1,
|
||||||
selectedCondition: '',
|
selectedCondition: '',
|
||||||
conditionList: ['六品', '七品', '八品', '八五品', '九品', '九五品', '全新'],
|
conditionList: ['六品', '七品', '八品', '八五品', '九品', '九五品', '全新'],
|
||||||
photoList: [],
|
photoList: [],
|
||||||
@ -828,6 +828,18 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
conditionValue() {
|
||||||
|
const map = {
|
||||||
|
'全新': '100~',
|
||||||
|
'九五品': '95~',
|
||||||
|
'九品': '90~',
|
||||||
|
'八五品': '85~',
|
||||||
|
'八品': '80~',
|
||||||
|
'七品': '70~',
|
||||||
|
'六品': '60~'
|
||||||
|
}
|
||||||
|
return this.selectedCondition ? (map[this.selectedCondition] || '') : ''
|
||||||
|
},
|
||||||
sortedProductList() {
|
sortedProductList() {
|
||||||
let list = [...this.productList]
|
let list = [...this.productList]
|
||||||
// 筛选(精确匹配,同zhizhu)
|
// 筛选(精确匹配,同zhizhu)
|
||||||
@ -974,7 +986,7 @@ export default {
|
|||||||
const sortType = this.sortBy === 'book' ? '5' : '7'
|
const sortType = this.sortBy === 'book' ? '5' : '7'
|
||||||
// 并行请求:商品列表 + 品相统计(在售)+ 品相统计(已售)
|
// 并行请求:商品列表 + 品相统计(在售)+ 品相统计(已售)
|
||||||
Promise.all([
|
Promise.all([
|
||||||
searchProducts(keyword, { phpsessid, sortType }),
|
searchProducts(keyword, { phpsessid, sortType, quality: this.conditionValue }),
|
||||||
searchFacet(keyword, { phpsessid, dataType: 0 }),
|
searchFacet(keyword, { phpsessid, dataType: 0 }),
|
||||||
searchFacet(keyword, { phpsessid, dataType: 1 })
|
searchFacet(keyword, { phpsessid, dataType: 1 })
|
||||||
]).then(([productsData, onSaleFacet, soldFacet]) => {
|
]).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}
|
* list中每项: {id, title, author, press, priceText, imgBigUrl, shopName, qualityText, pubDateText, postage}
|
||||||
*/
|
*/
|
||||||
export function searchProducts(keyword, options = {}) {
|
export function searchProducts(keyword, options = {}) {
|
||||||
const { phpsessid = '', page = 1, sortType = '' } = options
|
const { phpsessid = '', page = 1, sortType = '', quality = '' } = options
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const reqData = {
|
const reqData = {
|
||||||
dataType: 0,
|
dataType: 0,
|
||||||
@ -198,9 +198,18 @@ export function searchProducts(keyword, options = {}) {
|
|||||||
page: page,
|
page: page,
|
||||||
userArea: '1006000000'
|
userArea: '1006000000'
|
||||||
}
|
}
|
||||||
|
const actionPaths = []
|
||||||
if (sortType) {
|
if (sortType) {
|
||||||
reqData.sortType = 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({
|
uni.request({
|
||||||
url: 'https://search.kongfz.com/pc-gw/search-web/client/pc/product/keyword/list',
|
url: 'https://search.kongfz.com/pc-gw/search-web/client/pc/product/keyword/list',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user