diff --git a/pkg_product/views/famousQianxianShop.vue b/pkg_product/views/famousQianxianShop.vue index 048f8f1..2d13207 100644 --- a/pkg_product/views/famousQianxianShop.vue +++ b/pkg_product/views/famousQianxianShop.vue @@ -505,8 +505,8 @@ v-if="activeIndex === 4" class="good-list-wrap" > - - + + - + + + + + {{ item.productName }} + + + + {{ item.productPrice }} + + + + + + + + + + + + {{ item.name }} + + + + + {{ item.ownerName }}/{{ inn.name }} + + { - item.isOldBrand = 0 - item.isLandmarkGoods = 0 - if (index % 2 === 0) { - this.leftList.push(item) - } - if (index % 2 === 1) { - item.isFarmer = 1 - this.rightList.push(item) - } - }) + this.leftList = this.sortProductsAndStores(products, farmerShops) + console.log(this.leftList); + // products.map((item, index) => { + // item.isOldBrand = 0 + // item.isLandmarkGoods = 0 + // if (index % 2 === 0) { + // this.leftList.push(item) + // } + // if (index % 2 === 1) { + // item.isFarmer = 1 + // this.rightList.push(item) + // } + // }) } }) }, shuffleArray(array) { for (let i = array.length - 1; i > 0; i--) { - let j = Math.floor(Math.random() * (i + 1)); - [array[i], array[j]] = [array[j], array[i]]; - } - return array; + let j = Math.floor(Math.random() * (i + 1)); + [array[i], array[j]] = [array[j], array[i]]; + } + return array; }, sortProductsAndStores(products, stores) { const randomMap = [] @@ -1091,7 +1132,35 @@ export default {