From 835f88cf7499b90019470ea494283f9e2f48dcd1 Mon Sep 17 00:00:00 2001 From: 15093570141 <141405260+17521612761@users.noreply.github.com> Date: Sun, 13 Oct 2024 18:14:40 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91(login?= =?UTF-8?q?=E6=A8=A1=E5=9D=97)=EF=BC=9A=E4=BC=98=E5=8C=96=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coreshop-advert/coreshop-advert.vue | 2 +- .../coreshop-empty/coreshop-empty.vue | 37 +++++----- .../coreshop-login-modal.vue | 4 +- .../classify-five/classify-five.vue | 12 +++- .../classify-four/classify-four.vue | 12 +++- .../CoreShop/pages/classify/classify.vue | 44 ++++++++++-- .../components/home-coupon/home-coupon.vue | 17 +++-- .../components/home-nav-bar/home-nav-bar.vue | 2 +- .../components/home-pinTuan/home-pinTuan.scss | 1 + .../pages/components/custom-page/index.vue | 9 ++- .../CoreShop/pages/home/home.scss | 3 + .../CoreShop/pages/home/home.vue | 23 ++++-- .../CoreShop/pages/member/member.vue | 72 ++++++++++++------- .../subpackage/activity/checkIn/checkIn.vue | 18 ++--- .../activity/groupBuying/detail/detail.vue | 36 ++++++++-- .../activity/pinTuan/detail/detail.vue | 40 +++++++++-- .../activity/seckill/detail/detail.vue | 36 ++++++++-- .../activity/solitaire/detail/detail.vue | 36 +++++++++- .../pages/subpackage/category/category.scss | 8 +-- .../pages/subpackage/category/category.vue | 2 +- .../pages/subpackage/coupon/coupon.vue | 34 ++++++++- .../pages/subpackage/form/detail/detail.vue | 38 ++++++++-- .../pages/subpackage/goods/detail.vue | 42 +++++++++-- .../subpackage/serviceGoods/detail/detail.vue | 38 +++++++++- 24 files changed, 455 insertions(+), 111 deletions(-) diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-advert/coreshop-advert.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-advert/coreshop-advert.vue index 27145626..eaa2ee15 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-advert/coreshop-advert.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-advert/coreshop-advert.vue @@ -41,7 +41,7 @@ platform: 3, }); state.bannerList = positionList.data?.childs || []; - state.bannerPosition = positionList.data.position || {}; + state.bannerPosition = positionList.data?.position || {}; } const handleClickImg = (item : any) => { diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-empty/coreshop-empty.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-empty/coreshop-empty.vue index 4c402791..fc5ec4f7 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-empty/coreshop-empty.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-empty/coreshop-empty.vue @@ -2,8 +2,7 @@ - \ No newline at end of file diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-login-modal/coreshop-login-modal.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-login-modal/coreshop-login-modal.vue index 3aab6ee9..8926fbc0 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-login-modal/coreshop-login-modal.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-login-modal/coreshop-login-modal.vue @@ -49,10 +49,10 @@ import { queryLoginPhoneNumber, queryLogin, queryAliPayAppAuthTokenBYCode } from '@/core/api'; import { loginGetCode, handleShowToast, handleRouteNavigateTo } from '@/core/utils'; - // 获取项目配置 + /** 获取项目配置 */ const shopConfigStore = useShopConfigStore(); - // 获取 用户数据 + /** 获取用户数据 */ const userInfoStore = useUserInfoStore(); const props = withDefaults(defineProps<{ diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/classify/classify-page/classify-five/classify-five.vue b/CoreCms.Net.Uni-App/CoreShop/pages/classify/classify-page/classify-five/classify-five.vue index feae6767..10ef68ec 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/classify/classify-page/classify-five/classify-five.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/classify/classify-page/classify-five/classify-five.vue @@ -180,7 +180,9 @@ showSku: false, goodsDetailData: {}, }); - + + const emits = defineEmits(['handleShowLoginPopup']); + watch(() => props.data, (newVal : Array) => { if (newVal) { state.classifyData = newVal.map((item : CategoriesType) => { @@ -259,6 +261,10 @@ /** 添加购物车 */ const handleAddCart = async ({ productId, nums } : any) => { + if (!uni.getStorageSync(UserToken)) { + emits('handleShowLoginPopup'); + return; + } const addCart : Response = await queryAddCart({ productId, nums, @@ -277,6 +283,10 @@ /** 立即购买 */ const handleBuyNow = async ({ productId, nums } : any) => { + if (!uni.getStorageSync(UserToken)) { + emits('handleShowLoginPopup'); + return; + } const addCart : Response = await queryAddCart({ productId, nums, diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/classify/classify-page/classify-four/classify-four.vue b/CoreCms.Net.Uni-App/CoreShop/pages/classify/classify-page/classify-four/classify-four.vue index 8f0ca569..d6210de8 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/classify/classify-page/classify-four/classify-four.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/classify/classify-page/classify-four/classify-four.vue @@ -117,7 +117,9 @@ showSku: false, goodsDetailData: {}, }); - + + const emits = defineEmits(['handleShowLoginPopup']); + watch(() => props.data, (newVal : Array) => { if (newVal) { state.classifyData = newVal.map((item : CategoriesType) => { @@ -182,6 +184,10 @@ /** 添加购物车 */ const handleAddCart = async ({ productId, nums } : any) => { + if (!uni.getStorageSync(UserToken)) { + emits('handleShowLoginPopup'); + return; + } const addCart : Response = await queryAddCart({ productId, nums, @@ -200,6 +206,10 @@ /** 立即购买 */ const handleBuyNow = async ({ productId, nums } : any) => { + if (!uni.getStorageSync(UserToken)) { + emits('handleShowLoginPopup'); + return; + } const addCart : Response = await queryAddCart({ productId, nums, diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/classify/classify.vue b/CoreCms.Net.Uni-App/CoreShop/pages/classify/classify.vue index 3a3f36c6..39d58cc3 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/classify/classify.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/classify/classify.vue @@ -23,22 +23,26 @@ + :data="state.categoriesList" :height="state.height" @handleShowLoginPopup="handleShowLoginPopup"> + + :data="state.categoriesList" :height="state.height" :statusBarHeight="statusBarHeight" + @handleShowLoginPopup="handleShowLoginPopup"> - - + + + \ No newline at end of file diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/home/home.scss b/CoreCms.Net.Uni-App/CoreShop/pages/home/home.scss index c0a0434b..444036ac 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/home/home.scss +++ b/CoreCms.Net.Uni-App/CoreShop/pages/home/home.scss @@ -1,10 +1,13 @@ .layout-home-page { + max-width: 750rpx; + overflow: hidden; .home-bg { position: fixed; width: 100%; height: 600rpx; left: 0; top: 0; + max-width: 750rpx; } .search-box { position: relative; diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/home/home.vue b/CoreCms.Net.Uni-App/CoreShop/pages/home/home.vue index ac4734de..35b52924 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/home/home.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/home/home.vue @@ -10,7 +10,7 @@ - + @@ -20,7 +20,8 @@ - + @@ -48,14 +49,16 @@ const state = reactive<{ coreshopData : Array; isScrollTop : boolean; + showLoginModal:boolean; }>({ coreshopData: [], isScrollTop: false, + showLoginModal:false, }) const getPageConfig = async () => { - const pageConfig : Response = await queryPageConfig({ code: 'mobile_home2024091618525466774' }); - state.coreshopData = pageConfig.data.items; + const pageConfig : Response = await queryPageConfig({ code: 'mobile_home' }); + state.coreshopData = pageConfig.data?.items; } onPageScroll((e : any) => { @@ -72,7 +75,17 @@ getUserInfo(); } }) - + + /** 打开获取关闭login弹框 */ + const handleChangeLoginPopup = (isShow : boolean) => { + state.showLoginModal = isShow; + } + + /** 显示登录弹框*/ + const handleShowLoginPopup = ()=>{ + state.showLoginModal = true; + } + /** 获取用户信息 */ const getUserInfo = async () => { const userInfo : Response = await queryUserInfo(); diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/member/member.vue b/CoreCms.Net.Uni-App/CoreShop/pages/member/member.vue index a4300a78..ee224de3 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/member/member.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/member/member.vue @@ -27,19 +27,19 @@