From 6c4216cd3112bae686afacf800763a6aec1f54ff Mon Sep 17 00:00:00 2001 From: taiyuan Date: Sat, 17 Apr 2021 11:06:13 +0800 Subject: [PATCH] 我的小店除价格外默认降序排列 --- packageA/pages/distribution/shop/shop.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packageA/pages/distribution/shop/shop.js b/packageA/pages/distribution/shop/shop.js index 2adb702..3817098 100644 --- a/packageA/pages/distribution/shop/shop.js +++ b/packageA/pages/distribution/shop/shop.js @@ -123,7 +123,7 @@ Page({ }); // 请求数据 - app.request.promiseGet('/api/weshop/users/distribut/pagemyshop', { + app.request.promiseGet('/api/weshop/users/distribut/pagemyshop?orderType=desc', { data: this.data.currentQuery, }).then(res => { self.setData({ @@ -133,7 +133,7 @@ Page({ }); // 新品 - app.request.promiseGet('/api/weshop/users/distribut/pagemyshop?type=2', { + app.request.promiseGet('/api/weshop/users/distribut/pagemyshop?type=2&orderType=desc', { data: self.data.currentQuery, }).then(res => { self.setData({ @@ -466,6 +466,7 @@ Page({ }; this.setData({ list: null, + isAll: true, currentTabIndex: currentIndex, isSort, pageNum: 1, @@ -491,9 +492,12 @@ Page({ if(currentIndex == 3) { // console.log('点击价格'); + if(data.orderType) {// 清除orderType + delete data.orderType; + }; return; }; - + data.orderType = 'desc'; this.data.currentQuery = data; this.getData(true, '/api/weshop/users/distribut/pagemyshop', data); }, @@ -687,7 +691,7 @@ Page({ isAll: false, }); - this.getData(true, '/api/weshop/users/distribut/pagemyshop?type=2', data); + this.getData(true, '/api/weshop/users/distribut/pagemyshop?type=2&orderType=desc', data); // app.request.promiseGet('/api/weshop/users/distribut/pagemyshop?type=2', { // data: data, // }).then(res => { -- libgit2 0.21.4