From 634e801eb5b2c783616a00c5c6c9966ce361b4e0 Mon Sep 17 00:00:00 2001 From: Waiting Date: Fri, 19 Apr 2024 13:44:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=A2=9E=E5=8A=A0=E5=88=86?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/common/webview/index.vue | 2 +- src/pages/mall/index.vue | 20 +++++++++++++++++--- src/pages/mine/index.vue | 16 +--------------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/pages/common/webview/index.vue b/src/pages/common/webview/index.vue index 9f4a964..fb9ae6a 100644 --- a/src/pages/common/webview/index.vue +++ b/src/pages/common/webview/index.vue @@ -7,6 +7,6 @@ const url = ref(''); onLoad((params: any) => { if(params.url) - url.value = decodeURIComponent(params.url); + url.value = params.url; }); diff --git a/src/pages/mall/index.vue b/src/pages/mall/index.vue index 7df5631..1fea4c4 100644 --- a/src/pages/mall/index.vue +++ b/src/pages/mall/index.vue @@ -87,8 +87,8 @@ onLoad(() => { const fetchCategoryList = async () => { if(companyConfigInfo.value.mallopen == 1) { const list = await getCategoryList(); - list.unshift({ typeName: '上新精选', typeId: '0' }); - list.unshift({ typeName: '热销商品', typeId: '0' }); + list.unshift({ typeName: '上新精选', typeId: '2' }); + list.unshift({ typeName: '热销商品', typeId: '1' }); list.unshift({ typeName: '全部分类', typeId: '0' }); categoryList.value = list; await changeCategory(0); @@ -102,13 +102,27 @@ const changeCategory = async (index: number) => { const fetchGoodsList = async (refresh: boolean = true) => { currentPageNum.value = refresh ? 1 : currentPageNum.value + 1; + + let typeId = [categoryList.value[categorySelectedIndex.value].typeId]; + let sort = undefined; + if(typeId[0] === '0') { + typeId = []; + sort = undefined; + } else if(typeId[0] === '1') { + typeId = []; + sort = 'good_num DESC'; + } else if(typeId[0] === '2') { + typeId = []; + sort = 'update_time DESC'; + } const { rows } = await getGoodsList({ page: { pageNum: currentPageNum.value, pageSize: 30, bean: { keyword: '', - typeIds: [categoryList.value[categorySelectedIndex.value].typeId] + typeIds: typeId, + sort: sort } } }); diff --git a/src/pages/mine/index.vue b/src/pages/mine/index.vue index c881d38..5c3a4e3 100644 --- a/src/pages/mine/index.vue +++ b/src/pages/mine/index.vue @@ -148,21 +148,7 @@ onShow(async () => { const openCard = () => { // const url = 'https://mp.weixin.qq.com/bizmall/activatemembercard?action=preshow&&encrypt_card_id=LI%2FNyDp0x3z8XXorvvrHzSR4VUPa2vlioBg2xkDT3HqybiAFNsNgjH7pBpyKGrSA&outer_str=1702887425732870145&biz=MzU2MTg5MjgxMg%3D%3D#wechat_redirect'; - goPath(`/pages/common/webview/index?url=${encodeURIComponent(cardLink.value)}`); - // uni.openCard({ - // cardList: [{ - // cardId: 'pzCtO1PD40kHdvcAU8kTfVILoebE', - // code: '261422541418' - // } - // // { - // // cardId: '', - // // code: '' - // // } - // ], - // success(res) { - // - // } - // }); + goPath(`/pages/common/webview/index?url=${cardLink.value}`); }; const gotoPath = (path: string) => {