bug(顶部导航):

This commit is contained in:
zhangjing1
2026-03-13 12:17:54 +08:00
parent 2c145e15e4
commit 59921c0e4a
2 changed files with 26 additions and 18 deletions

View File

@@ -62,6 +62,7 @@ import CompAddTip from './home/comps/comp-addtip'
import CompFloatMenu from './home/comps/comp-floatmenu'
import './home/index.scss'
import SpPoweredBy from '@/components/sp-powered-by'
const MCompAddTip = React.memo(CompAddTip)
const MSpSkuSelect = React.memo(SpSkuSelect)
@@ -280,14 +281,12 @@ function Home() {
className='page-index'
scrollToTopBtn
immersive={pageData?.base?.isImmersive}
// renderNavigation={renderNavigation()}
showpoweredBy={false}
pageConfig={pageData?.base || {}}
nearbyText={nearbyText}
renderFloat={wgts.length > 0 && <CompFloatMenu />}
renderFooter={<SpTabbar />}
onScrollToTop={() => {
console.log('onScrollToTop')
// 先设置为一个很小的非0值确保触发滚动变化
setState((draft) => {
draft.backTopScrollTop = 0.1
@@ -301,7 +300,7 @@ function Home() {
}}
ref={pageRef}
navigateMantle={navigateMantle}
onReady={({ gNavbarH,footerHeight }) => {
onReady={({ gNavbarH, footerHeight }) => {
setState((draft) => {
draft.bodyHeight = `calc(100vh - ${pageData?.base?.isImmersive ? 0 : gNavbarH}px - ${footerHeight})`
draft.navbarHeight = gNavbarH
@@ -315,7 +314,7 @@ function Home() {
pageRef.current.handlePageScroll(e?.detail)
}}
scrollIntoView={scrollIntoView}
style={{ height: state.bodyHeight}}
style={{ height: state.bodyHeight }}
className={classNames('home-body', {
'has-home-header': isShowHomeHeader && isWeixin
})}
@@ -350,14 +349,7 @@ function Home() {
)}
</View>
{/* If you remove or alter Shopex brand identifiers, you must obtain a branding removal license from Shopex. Contact us at: http://www.shopex.cn to purchase a branding removal license. */}
{/* <View className='sp-page__powered-by w-full'>
<Text>Powered by</Text>
<Image
src='/assets/imgs/powered-logo.png'
className='powered-logo'
mode='contain'
/>
</View> */}
<SpPoweredBy />
</View>
{/* 小程序收藏提示 */}

View File

@@ -7,7 +7,7 @@ import { useState, useEffect } from 'react'
import { updateUserInfo, updateCheckChief } from '@/store/slices/user'
import { WgtsContext } from '@/pages/home/wgts/wgts-context'
import { platformTemplateName } from '@/utils/platform'
import { View, Text } from '@tarojs/components'
import { View, Text, ScrollView } from '@tarojs/components'
import { SG_APP_CONFIG } from '@/consts'
import { useSelector, useDispatch } from 'react-redux'
import HomeWgts from '@/pages/home/comps/home-wgts'
@@ -46,6 +46,7 @@ import { updateDeliveryPersonnel } from '@/store/slices/cart'
import CompMenu from './comps/comp-menu'
import './index.scss'
import SpPoweredBy from '@/components/sp-powered-by'
const initialConfigState = {
banner: {
@@ -112,7 +113,8 @@ const initialState = {
shareInfo: {},
footerHeight: 0,
pageData: null,
shareInfo: {}
shareInfo: {},
bodyHeight: 0
}
function MemberIndex(props) {
@@ -176,8 +178,8 @@ function MemberIndex(props) {
})
const url = `/pageparams/setting?${pathparams}`
const { config = [], share } = await req.get(url)
console.log('🚀🚀🚀 ~ fetchWgts ~ config:', config, share)
const pageData = config.find((wgt) => wgt.name == 'page')
console.log('🚀🚀🚀 ~ fetchWgts ~ config:', config, share, pageData)
setState((draft) => {
draft.wgts = config
draft.pageData = pageData
@@ -450,8 +452,20 @@ function MemberIndex(props) {
}
return (
<SpPage className='pages-member-index' immersive renderFooter={<SpTabbar />} title='会员中心'>
<View className='user-info-card-wrapper min-h-full'>
<SpPage className='pages-member-index'
loading={state.loading}
immersive={state.pageData?.base?.isImmersive}
showpoweredBy={false}
pageConfig={state.pageData?.base || {}}
renderFooter={<SpTabbar />}
title='会员中心'
onReady={({ gNavbarH, footerHeight }) => {
setState((draft) => {
draft.bodyHeight = `calc(100vh - ${state.pageData?.base?.isImmersive ? 0 : gNavbarH}px - ${footerHeight})`
})
}}
>
<ScrollView scrollY className='user-info-card-wrapper' style={{ height: state.bodyHeight }}>
<View
className='header-block'
style={userInfo?.gradeInfo?.grade_background ? memberBckStyle : {}}
@@ -563,7 +577,9 @@ function MemberIndex(props) {
isPromoter={userInfo ? userInfo.isPromoter : false}
onLink={handleClickService}
/>
</View>
{/* If you remove or alter Shopex brand identifiers, you must obtain a branding removal license from Shopex. Contact us at: http://www.shopex.cn to purchase a branding removal license. */}
<SpPoweredBy />
</ScrollView>
</SpPage>
)
}