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