From 440b058d3388a1ffd72c130198d1c87ded65515e Mon Sep 17 00:00:00 2001 From: linxi Date: Mon, 28 Oct 2024 11:15:37 +0800 Subject: [PATCH] =?UTF-8?q?Task(=E5=8D=83=E5=8E=BF=E5=90=8D=E5=93=81)?= =?UTF-8?q?=EF=BC=9A=E4=BA=A7=E5=93=81=E9=9A=8F=E6=9C=BA=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg_product/views/famousQianxianShop.vue | 122 ++++++++++++++++++----- 1 file changed, 98 insertions(+), 24 deletions(-) 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 {