From 9f376b78dc05818fbe4af7fc3aed3b3c3a88bd6e Mon Sep 17 00:00:00 2001 From: woody Date: Fri, 22 Aug 2025 15:51:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(specialArea):=20=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E4=B8=93=E5=8C=BA=E5=88=97=E8=A1=A8=E6=A0=B9=E6=8D=AE=E4=BC=9A?= =?UTF-8?q?=E5=91=98=E8=BA=AB=E4=BB=BD=E8=AF=B7=E6=B1=82=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../special-area-wrapper.vue | 11 +++--- pages/index/index.vue | 34 +++---------------- pages/specialArea/index.vue | 16 ++++++--- store/modules/user.js | 6 +++- 4 files changed, 28 insertions(+), 39 deletions(-) diff --git a/components/area-product-list/special-area-wrapper.vue b/components/area-product-list/special-area-wrapper.vue index 5dfbb55..0862cad 100644 --- a/components/area-product-list/special-area-wrapper.vue +++ b/components/area-product-list/special-area-wrapper.vue @@ -103,14 +103,17 @@ export default { ...mapGetters(['isZeroLevel']), }, created() { - const userInfo = uni.getStorageSync('userInfo') || this.userInfo + const userInfo = Object.keys(this.userInfo).length + ? this.userInfo + : uni.getStorageSync('userInfo') if (userInfo.memberSign == MEMBER_SIGN.ZERO_LEVEL) { this.upgrade.name = '会员专区' + } else { + this.getAreaListById(REISSUE_AREA.id, this.rescissionList) + this.getAreaListById(REGIEST_AREA.id, this.registList) + this.getAreaListById(REPURCHASE_AREA.id, this.repurchaseList) } this.getAreaListById(UPGRADE_AREA.id, this.upgradeList) - this.getAreaListById(REISSUE_AREA.id, this.rescissionList) - this.getAreaListById(REGIEST_AREA.id, this.registList) - this.getAreaListById(REPURCHASE_AREA.id, this.repurchaseList) }, methods: { getAreaListById(areaId, list) { diff --git a/pages/index/index.vue b/pages/index/index.vue index 3250018..6d7026d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -28,7 +28,7 @@ - + @@ -77,7 +77,6 @@ import * as api from '@/config/login.js' import * as apis from '@/config/index.js' import * as ban from '@/config/balance.js' -import { getAreaGoods } from '@/config/special-area' import clTabbar from '@/components/cl-tabbar.vue' import noticePopup from '@/components/noticePopup.vue' import znNewsPopup from '@/components/znNewsPopup.vue' @@ -128,6 +127,9 @@ export default { }, computed: { ...mapGetters(['priceSymbol', 'priceSymbolVisible', 'isZeroLevel']), + specialAreaVisble() { + return this.userInfo && Object.keys(this.userInfo).length + }, }, onLoad() { // this.getLanguage(); @@ -136,24 +138,7 @@ export default { onShow() { this.$store.dispatch('getCarLength') this.getBanners() - if ( - uni.getStorageSync('showInfo') == undefined || - uni.getStorageSync('showInfo') == 0 - ) { - } - this.getAreaGoods( - this.userInfo.memberSign == MEMBER_SIGN.ZERO_LEVEL - ? REPURCHASE_AREA.id - : REGIEST_AREA.id - ) }, - // onPullDownRefresh() { - // let that = this - // setTimeout(() => { - // that.getGoodsInfo() - // uni.stopPullDownRefresh() //停止刷新 - // }, 1000) - // }, methods: { formatCurrency, formatSales(value) { @@ -194,17 +179,6 @@ export default { } }) }, - getAreaGoods(areaId) { - getAreaGoods({ - pageNum: 1, - pageSize: 3, - specialArea: areaId, - }).then(res => { - if (res.code == 200) { - this.goodsList = res.data || [] - } - }) - }, confirmHandle() { this.promptFlag = false if (this.jumpPage == 1) { diff --git a/pages/specialArea/index.vue b/pages/specialArea/index.vue index 3fa8a08..9164c9d 100644 --- a/pages/specialArea/index.vue +++ b/pages/specialArea/index.vue @@ -6,7 +6,7 @@ -->