From 6ad3ba0fd6daf7fd64f8e419783d6496c890ec08 Mon Sep 17 00:00:00 2001 From: linxi Date: Tue, 27 Aug 2024 09:52:41 +0800 Subject: [PATCH] =?UTF-8?q?Fix(=E5=8D=83=E5=8E=BF=E5=90=8D=E5=93=81):?= =?UTF-8?q?=E5=8D=83=E5=8E=BF=E5=90=8D=E5=93=81=E5=BA=97=E9=93=BA=E2=80=94?= =?UTF-8?q?=E8=B5=84=E8=AE=AF=E7=BD=AE=E9=A1=B6=E6=9C=AA=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg_product/views/famousQianxianShop.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg_product/views/famousQianxianShop.vue b/pkg_product/views/famousQianxianShop.vue index b26881d..f843c3f 100644 --- a/pkg_product/views/famousQianxianShop.vue +++ b/pkg_product/views/famousQianxianShop.vue @@ -705,7 +705,7 @@ export default { }).then(res => { const { data } = res _this.loading = false - _this.infoArray.push.apply(_this.infoArray, data.records.map((info) => { + _this.infoArray.push.apply(_this.infoArray, _this.toTop(data.records).map((info) => { var pt = info.createTime.replace(/-/g, "/") info.year = formatDateTime(pt, 'yyyy') info.monthDay = formatDateTime(pt, 'MM/dd') @@ -713,12 +713,18 @@ export default { info.showMore = false return info })) + // console.log(this.toTop(_this.infoArray)); }).finally(() => { _this.loading = false _this.isLoadInfoListSuccess = true uni.stopPullDownRefresh() }) }, + toTop(arr) { + return arr.sort((a, b) => { + return b.isTop - a.isTop + }) + }, // 攻略 getGuideReq() { const _this = this