mirror of
https://gitee.com/ShopeX/ECShopX_mobile-frontend
synced 2026-08-06 20:56:24 +08:00
Merge branch 'main'
This commit is contained in:
@@ -2,6 +2,12 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
### [4.3.6](https://git.ishopex.cn/ecshopx/ecshopx-vshop/compare/v4.3.5...v4.3.6) (2026-03-20)
|
||||
|
||||
### [4.3.5](https://git.ishopex.cn/ecshopx/ecshopx-vshop/compare/v4.3.3...v4.3.5) (2026-03-20)
|
||||
|
||||
### [4.3.3](https://git.ishopex.cn/ecshopx/ecshopx-vshop/compare/v4.3.2...v4.3.3) (2026-03-20)
|
||||
|
||||
### [4.3.2](https://git.ishopex.cn/ecshopx/ecshopx-vshop/compare/v4.3.1...v4.3.2) (2026-03-19)
|
||||
|
||||
### [4.3.1](https://git.ishopex.cn/ecshopx/ecshopx-vshop/compare/v4.3.0...v4.3.1) (2026-03-19)
|
||||
|
||||
5
package-lock.json
generated
5
package-lock.json
generated
@@ -1,13 +1,12 @@
|
||||
{
|
||||
"name": "ecshopx-vshop",
|
||||
"version": "4.2.0",
|
||||
"version": "4.3.6",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ecshopx-vshop",
|
||||
"version": "4.2.0",
|
||||
"license": "MIT",
|
||||
"version": "4.3.6",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.5",
|
||||
"@lucky-canvas/taro": "^0.0.15",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ecshopx-vshop",
|
||||
"app_name": "ecshopx",
|
||||
"version": "4.3.2",
|
||||
"version": "4.3.6",
|
||||
"private": true,
|
||||
"description": "taro app for bbc",
|
||||
"scripts": {
|
||||
|
||||
@@ -181,7 +181,7 @@ const SpPage = memo(
|
||||
|
||||
const _height = props.renderFooter
|
||||
? Taro.pxTransform(props.footerHeight + (isIphoneX() ? DEFAULT_SAFE_AREA_HEIGHT : 0))
|
||||
: 0
|
||||
: Taro.pxTransform(0)
|
||||
|
||||
props.onReady({
|
||||
gNavbarH: _gNavbarH,
|
||||
|
||||
@@ -9,8 +9,9 @@ import Taro, {
|
||||
useRouter,
|
||||
getCurrentInstance,
|
||||
useShareAppMessage,
|
||||
useShareTimeline
|
||||
useShareTimeline,
|
||||
} from '@tarojs/taro'
|
||||
import { ScrollView } from '@tarojs/components'
|
||||
import api from '@/api'
|
||||
import doc from '@/doc'
|
||||
import qs from 'qs'
|
||||
@@ -18,7 +19,6 @@ import { SpPage, SpSearch, SpSkuSelect, SpTabbar, SpLogin } from '@/components'
|
||||
import { WgtsContext } from '@/pages/home/wgts/wgts-context'
|
||||
import { getDistributorId, log, entryLaunch, pickBy, showToast, buildSharePath } from '@/utils'
|
||||
import { platformTemplateName } from '@/utils/platform'
|
||||
import { useNavigation } from '@/hooks'
|
||||
import req from '@/api/req'
|
||||
import HomeWgts from '@/pages/home/comps/home-wgts'
|
||||
import './custom-page.scss'
|
||||
@@ -31,16 +31,21 @@ const initialState = {
|
||||
skuPanelOpen: false,
|
||||
selectType: 'picker',
|
||||
isShowTabBar: false,
|
||||
footerHeight: 0
|
||||
footerHeight: 0,
|
||||
bodyHeight: 0,
|
||||
scrollIntoView: null,
|
||||
navbarHeight: 0
|
||||
}
|
||||
function CustomPage(props) {
|
||||
const $instance = getCurrentInstance() || {}
|
||||
const [state, setState] = useImmer(initialState)
|
||||
const { wgts, loading, shareInfo, skuPanelOpen, selectType, info, isShowTabBar } = state
|
||||
const { wgts, loading, shareInfo, skuPanelOpen, selectType, info, isShowTabBar, scrollIntoView, navbarHeight } = state
|
||||
const MSpSkuSelect = React.memo(SpSkuSelect)
|
||||
const pageRef = useRef()
|
||||
const loginRef = useRef()
|
||||
const router = useRouter()
|
||||
const { location, address } = useSelector((state) => state.user)
|
||||
const nearbyText = address?.city || location?.city || ''
|
||||
|
||||
useEffect(() => {
|
||||
fetch()
|
||||
@@ -83,28 +88,6 @@ function CustomPage(props) {
|
||||
return getAppShareInfo()
|
||||
})
|
||||
|
||||
const onAddToCart = async ({ itemId, distributorId }) => {
|
||||
Taro.showLoading()
|
||||
try {
|
||||
const itemDetail = await api.item.detail(itemId, {
|
||||
showError: false,
|
||||
distributor_id: distributorId
|
||||
})
|
||||
Taro.hideLoading()
|
||||
setState((draft) => {
|
||||
draft.info = pickBy(itemDetail, doc.goods.GOODS_INFO)
|
||||
draft.skuPanelOpen = true
|
||||
draft.selectType = 'addcart'
|
||||
})
|
||||
} catch (e) {
|
||||
Taro.hideLoading({
|
||||
success: () => {
|
||||
showToast(e.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const getAppShareInfo = async () => {
|
||||
const { id } = await entryLaunch.getRouteParams($instance?.router?.params)
|
||||
const { userId } = Taro.getStorageSync('userinfo')
|
||||
@@ -123,39 +106,58 @@ function CustomPage(props) {
|
||||
}
|
||||
|
||||
const searchComp = wgts.find((wgt) => wgt.name == 'search')
|
||||
let filterWgts = []
|
||||
if (searchComp && searchComp.config.fixTop) {
|
||||
filterWgts = wgts.filter((wgt) => wgt.name !== 'search')
|
||||
} else {
|
||||
filterWgts = wgts
|
||||
}
|
||||
const fixedTop = searchComp && searchComp.config.fixTop
|
||||
const pageData = wgts.find((wgt) => wgt.name == 'page')
|
||||
let filterWgts = []
|
||||
if (searchComp && searchComp.config && searchComp.config.fixTop) {
|
||||
filterWgts = wgts.filter((wgt) => wgt.name !== 'search' && wgt.name != 'page')
|
||||
} else {
|
||||
filterWgts = wgts.filter((wgt) => wgt.name != 'page')
|
||||
}
|
||||
return (
|
||||
<SpPage
|
||||
btnHomeEnable={router?.params.fromConnect !== 'davild'}
|
||||
scrollToTopBtn
|
||||
className='page-custom-page'
|
||||
showpoweredBy={false}
|
||||
loading={loading}
|
||||
title={shareInfo?.page_name}
|
||||
immersive={pageData?.base?.isImmersive}
|
||||
pageConfig={pageData?.base || {}}
|
||||
nearbyText={nearbyText}
|
||||
ref={pageRef}
|
||||
renderFooter={isShowTabBar && <SpTabbar height={state.footerHeight} />}
|
||||
fixedTopContainer={fixedTop && <SpSearch info={searchComp} />}
|
||||
onReady={({ footerHeight }) => {
|
||||
onReady={({ footerHeight, height, gNavbarH }) => {
|
||||
setState((draft) => {
|
||||
draft.footerHeight = footerHeight
|
||||
draft.bodyHeight = height
|
||||
draft.navbarHeight = gNavbarH
|
||||
})
|
||||
}}
|
||||
>
|
||||
<WgtsContext.Provider
|
||||
value={{
|
||||
onAddToCart,
|
||||
immersive: pageData?.base?.isImmersive,
|
||||
isTab: isShowTabBar
|
||||
<ScrollView
|
||||
scrollY
|
||||
onScroll={(e) => {
|
||||
pageRef.current.handlePageScroll(e?.detail)
|
||||
}}
|
||||
scrollIntoView={scrollIntoView}
|
||||
style={{ height: state.bodyHeight }}
|
||||
>
|
||||
<HomeWgts wgts={filterWgts} />
|
||||
</WgtsContext.Provider>
|
||||
<WgtsContext.Provider
|
||||
value={{
|
||||
immersive: pageData?.base?.isImmersive,
|
||||
isTab: isShowTabBar,
|
||||
navBarHeight: navbarHeight,
|
||||
footerHeight: state.footerHeight,
|
||||
setScrollIntoView: (view) => {
|
||||
setState((draft) => {
|
||||
draft.scrollIntoView = view
|
||||
})
|
||||
}
|
||||
}}
|
||||
>
|
||||
<HomeWgts wgts={filterWgts} />
|
||||
</WgtsContext.Provider>
|
||||
</ScrollView>
|
||||
|
||||
{/* Sku选择器 */}
|
||||
<MSpSkuSelect
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
||||
.slider-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.slider-item {
|
||||
position: relative;
|
||||
|
||||
@@ -30,7 +32,8 @@
|
||||
height: 100%;
|
||||
display: block;
|
||||
background-color: transparent;
|
||||
video{
|
||||
|
||||
video {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
@@ -71,14 +74,17 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.slider-pagination {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: 20px;
|
||||
z-index: 200;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
|
||||
&.cover {
|
||||
position: initial;
|
||||
}
|
||||
@@ -86,9 +92,11 @@
|
||||
&.left {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
&.center {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
&.right {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
@@ -97,15 +105,18 @@
|
||||
.dot-item {
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.pagination-count {
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
&.light {
|
||||
.dot-item {
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
.pagination-count {
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
color: #555;
|
||||
@@ -118,10 +129,12 @@
|
||||
height: 4px;
|
||||
margin: 0 4px;
|
||||
border-radius: 2px;
|
||||
|
||||
&.active {
|
||||
background: #d42f29;
|
||||
background: var(--color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.pagination-count {
|
||||
height: 40px;
|
||||
font-size: 24px;
|
||||
@@ -137,10 +150,12 @@
|
||||
border-radius: 8px;
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
margin: 0 6px;
|
||||
|
||||
&.active {
|
||||
background: #d42f29;
|
||||
background: var(--color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.pagination-count {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
|
||||
@@ -352,11 +352,6 @@ function Home() {
|
||||
})}
|
||||
>
|
||||
<>
|
||||
<View
|
||||
className='home-body-content'
|
||||
style={{ minHeight: '100%', display: 'flex', flexDirection: 'column' }}
|
||||
>
|
||||
<View style={{ flex: 1 }}>
|
||||
{filterWgts.length > 0 && (
|
||||
<WgtsContext.Provider
|
||||
value={{
|
||||
@@ -379,10 +374,15 @@ function Home() {
|
||||
</HomeWgts>
|
||||
</WgtsContext.Provider>
|
||||
)}
|
||||
</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 />
|
||||
</View>
|
||||
{/* <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> */}
|
||||
|
||||
{/* 小程序收藏提示 */}
|
||||
{isWeixin && <MCompAddTip />}
|
||||
|
||||
Reference in New Issue
Block a user