fix(custom): bug修复

This commit is contained in:
lukaijie
2025-09-01 16:48:42 +08:00
parent 22c90f1d3c
commit f91f69e39c
12 changed files with 193 additions and 271 deletions

10
.env
View File

@@ -1,16 +1,16 @@
APP_BASE_URL=https://demo-ecshopx.ishopex.cn/api/h5app/wxapp
APP_WEBSOCKET=wss://demo-ecshopx.ishopex.cn/ws
APP_COMPANY_ID=38
APP_PLATFORM=standard
APP_COMPANY_ID=5
APP_PLATFORM=platform
APP_CUSTOM_SERVER=https://ecshopx-h5.ex-sandbox.com/
APP_HOME_PAGE=/pages/index
APP_TRACK=youshu
APP_YOUSHU_TOKEN=bi281e87ab2424481a
APP_ID=wx1e25e45145b70faa
APP_MAP_KEY=PSPBZ-KQ5CW-CSGRF-ON2S4-K2HQJ-XEBQG
APP_ID=wxf7abee400d50e0d0
APP_MAP_KEY=1ccc1ebc947719886f0cd766d70241fe
APP_MAP_NAME=oneX新零售门店定位
APP_IMAGE_CDN=https://b-img-cdn.yuanyuanke.cn/ecshopx-vshop
APP_DIANWU_URL=https://demo-ecshopx-dianwu.shopex123.com
APP_DIANWU_URL=
APP_MERCHANT_URL=
APP_ADAPAY=

View File

@@ -16,10 +16,7 @@ const initialState = {
function SpCategorySearch(props) {
const [state, setState] = useImmer(initialState)
const { showBar, showSearchDailog, isShowAction, historyList, keyword } = state
const {
placeholder = '搜索',
onConfirm = () => {}
} = props
const { placeholder = '搜索', onConfirm = () => {} } = props
useEffect(() => {
console.log(showBar, '----')
setState((draft) => {
@@ -61,12 +58,12 @@ function SpCategorySearch(props) {
})
}
const handleClear = async () => {
setState(draft => {
setState((draft) => {
draft.keyword = ''
})
}
const handleChangeSearch = async (value) => {
setState(draft => {
setState((draft) => {
draft.keyword = value
})
}

View File

@@ -1,6 +1,5 @@
import React, { Component } from 'react'
import { View, Text } from '@tarojs/components'
import { connect } from 'react-redux'
import { classNames, isArray } from '@/utils'
import './index.scss'
@@ -48,7 +47,6 @@ export default class SpFilterBar extends Component {
render() {
const { list, className, custom, color } = this.props
const { sortOrder, curIdx } = this.state
return (
<View className={classNames('sp-filter-bar', className)}>
<View className='filter-bar-body'>
@@ -57,13 +55,11 @@ export default class SpFilterBar extends Component {
<View
className={classNames('sp-filter-bar__item', {
active: curIdx === idx
// 'sort-asc': item.sort && sortOrder > 0,
// 'sort-desc': item.sort && sortOrder < 0
})}
onClick={this.handleClickItem.bind(this, idx, item.type)}
key={`sp-filter-bar-item__${idx}`}
>
<Text className='sp-filter-bar__item-text' style={curIdx === idx && { color }}>
<Text className={`sp-filter-bar__item-text ${curIdx === idx ? 'active' : ''}`}>
{item.title}
</Text>
{item.icon && (

View File

@@ -79,10 +79,6 @@ const SpPage = memo(
const dispatch = useDispatch()
const { login } = useLogin()
useReady(() => {
// 导购货架数据上报
})
useEffect(() => {
if (state.lock) {
// 保存当前滚动位置
@@ -122,32 +118,27 @@ const SpPage = memo(
let _navigationRSpace = 0 // 导航栏右间距
const { screenHeight, windowWidth, windowHeight } = Taro.getWindowInfo()
const [absolutePath] = router.path.split('?')
const custom_navigation = isWeixin ? navigationStyle === 'custom' : false
const _btnReturn = pages.length > 1 && !TAB_PAGES.includes(absolutePath)
const _btnHome = pages.length == 1 && !TAB_PAGES.includes(absolutePath)
if (isWeixin || isAlipay) {
const menuButton = Taro.getMenuButtonBoundingClientRect()
// const { statusBarHeight } = Taro.getSystemInfoSync()
_gNavbarH = Math.floor(menuButton.bottom + (props.navigateHeight - menuButton.height) / 2)
_gNavbarH = Math.floor(menuButton.bottom + (props.navigateHeight - menuButton.height) / 2) // 导航栏高度
_gStatusBarHeight = Math.floor(
menuButton.top - (props.navigateHeight - menuButton.height) / 2
)
) // 状态栏高度
_menuWidth = menuButton.width
_navigationLSpace = windowWidth - menuButton.right
_navigationRSpace = menuButton.width + (windowWidth - menuButton.right)
} else if (hasNavbar) {
_gNavbarH = props.navigateHeight
_gStatusBarHeight = 0
}
const custom_navigation = isWeixin ? navigationStyle === 'custom' : false
setState((draft) => {
draft.bodyHeight = windowHeight
draft.btnReturn = _btnReturn
draft.btnHome = _btnHome && props.btnHomeEnable
draft.customNavigation = custom_navigation
draft.cusCurrentPage = pages.length
draft.ipx = isIphoneX()
draft.windowHeight = windowHeight
draft.pageTitle = instanceRef.current?.page?.config?.navigationBarTitleText || props.title
draft.gNavbarH = _gNavbarH
draft.gStatusBarHeight = _gStatusBarHeight
@@ -274,14 +265,12 @@ const SpPage = memo(
})
}
}))
const computedNavigationStyle = () => {
const { navigateBackgroundColor, navigateBackgroundImage } = props.pageConfig || {}
let style = {
'height': `${state.gNavbarH}px`,
'padding-top': `${state.gStatusBarHeight}px`,
// 'padding-right': `${state.navigationRSpace}px`,
// 'padding-left': `${state.navigationLSpace}px`
// 'background-image': `url(${navigateBackgroundImage})`,
'background-size': '100% 100%',
'background-repeat': 'no-repeat',
'background-position': 'center'
@@ -330,6 +319,7 @@ const SpPage = memo(
} else {
navigationBarTitleText = getCurrentInstance().page?.config?.navigationBarTitleText
}
return (
<View className='custom-navigation' style={styleNames(computedNavigationStyle())}>
<View className='custom-navigation__content h-full'>
@@ -339,14 +329,9 @@ const SpPage = memo(
padding: `0 ${state.navigationLSpace}px 0 ${state.navigationLSpace}px`
}}
>
{/* {(state.btnReturn || state.btnHome) && ( */}
<View
className='custom-navigation__left-block flex items-center'
style={{
// padding: `0 ${state.navigationLSpace}px 0 ${state.navigationLSpace}px`,
// maxWidth: `${state.menuWidth}px`,
// width: props.navigationLeftBlockWidthFull ? `${state.menuWidth}px` : 'auto'
// margin: `${state.navigationLSpace}px 0px`
gap: `${state.navigationLSpace}px`,
width: `${state.menuWidth}px`,
height: '100%'
@@ -378,12 +363,8 @@ const SpPage = memo(
)}
{props.pageConfig?.pTitleHotSetting?.imgUrl && (
<View className='p-title-hot-img'>
<SpImage
src={props.pageConfig?.pTitleHotSetting?.imgUrl}
mode='aspectFit'
></SpImage>
<SpImage src={props.pageConfig?.pTitleHotSetting?.imgUrl} mode='aspectFit' />
{props.pageConfig?.pTitleHotSetting?.data?.map((citem) => {
console.log(citem)
if (citem.id == 'customerService') {
return (
<Button
@@ -417,7 +398,7 @@ const SpPage = memo(
</View>
)}
</View>
{/* )} */}
<View
className='custom-navigation__center-block flex-1 flex items-center justify-items-center'
style={styleNames(pageCenterStyle)}
@@ -427,7 +408,6 @@ const SpPage = memo(
) : (
<View className='title-container' style={styleNames(pageTitleStyle)}>
{renderTitle || props.title || navigationBarTitleText}
{/* 吸顶区域 */}
{props.fixedTopContainer}
</View>
)}
@@ -442,8 +422,6 @@ const SpPage = memo(
)
}
console.log('customNavigation:', state.customNavigation)
return (
<View
className={classNames('sp-page', props.className)}
@@ -454,21 +432,21 @@ const SpPage = memo(
{hasNavbar && !state.isTabBarPage && props.navbar && (
<SpNavBar title={state.pageTitle} onClickLeftIcon={props.onClickLeftIcon} />
)}
{props.isDefault &&
(props.renderDefault || <SpNote img={props.defaultImg} title={props.defaultMsg} isUrl />)}
{/* 没有页面自动义头部配置样式,自动生成自定义导航 */}
{state.customNavigation && RenderCustomNavigation()}
{state.customNavigation && <RenderCustomNavigation />}
{props.loading && <SpLoading />}
{!props.isDefault && !props.loading && (
<View
className='sp-page__body'
style={styleNames({
'height':
props.immersive || hasNavbar
? `${state.height + state.gNavbarH}px`
: `${state.height}px`,
'padding-top': `${hasNavbar ? state.gNavbarH : 0}px`,
'margin-top': `${state.customNavigation && !props.immersive ? state.gNavbarH : 0}px`,
'height': `${state.bodyHeight}px`,
'padding-top': `${state.customNavigation && !props.immerse ? state.gNavbarH : 0}px`,
'padding-bottom': props.renderFooter
? Taro.pxTransform(
props.footerHeight + (isIphoneX() ? DEFAULT_SAFE_AREA_HEIGHT : 0)
@@ -476,9 +454,10 @@ const SpPage = memo(
: 0
})}
>
<context.Provider>{props.children}</context.Provider>
<context.Provider value={{}}>{props.children}</context.Provider>
</View>
)}
{props.renderFooter && (
<View
key={lang}
@@ -488,9 +467,10 @@ const SpPage = memo(
'padding-bottom': `${isIphoneX() ? Taro.pxTransform(DEFAULT_SAFE_AREA_HEIGHT) : 0}`
})}
>
<context.Provider>{props.renderFooter}</context.Provider>
<context.Provider value={{}}>{props.renderFooter}</context.Provider>
</View>
)}
{/* 浮动 */}
{!props.isDefault && (
<View className='float-container'>
@@ -533,7 +513,7 @@ SpPage.defaultProps = {
showNavitionLeft: true,
title: '', // 页面导航标题
renderFooter: null,
renderFloat: () => {}
renderFloat: null
}
export default SpPage

View File

@@ -1,9 +1,9 @@
{
"extEnable": true,
"extAppid": "wx1e25e45145b70faa",
"extAppid": "wxf7abee400d50e0d0",
"ext": {
"company_id": "38",
"appid": "wx1e25e45145b70faa",
"company_id": "5",
"appid": "wxf7abee400d50e0d0",
"wxa_name": "通用小程序",
"ali_isvid":""
},

View File

@@ -1,10 +1,10 @@
import React, { useEffect } from 'react'
import Taro from '@tarojs/taro'
import { View } from '@tarojs/components'
import { SpPage } from '@/components'
import { useImmer } from 'use-immer'
import api from '@/api'
import { platformTemplateName } from '@/utils/platform'
import { SpPage } from '@/components'
import CompsAddPurchase from './comps/comps-category-addCart'
import CompsCategoryNew from './comps/comps-category-tile'
@@ -43,9 +43,7 @@ function StoreItemList(props) {
return (
<SpPage>
{state.layout === 1 && <CompsAddPurchase />}
{state.layout === 2 && <CompsCategoryNew />}
{/* <CompsCategoryNew /> */}
</SpPage>
)
}

View File

@@ -133,6 +133,7 @@ function WgtOrderNavigation(props) {
onChange={() => {
handleClickLink(item.link)
}}
key={`wgt-order-item__${idx}`}
>
<View className='wgt-order-item'>
<View className='wgt-order-wrapper'>

View File

@@ -131,41 +131,6 @@ function ItemList() {
}
}, [shopInfo])
useDidShow(() => {
// setTimeout(() => {
// if (isWeixin) {
// Taro.createSelectorQuery()
// .select('#item-list-head')
// .boundingClientRect((res) => {
// console.log('boundingClientRect:', res) //
// if (res) {
// setState((draft) => {
// draft.fixTop = res.bottom
// console.log('fixTop1:', res.bottom) //
// })
// }
// })
// .exec()
// } else {
// Taro.createSelectorQuery()
// .select('#item-list-head')
// .boundingClientRect((res) => {
// console.log('boundingClientRect:', res) //
// if (res) {
// setState((draft) => {
// draft.fixTop = res.bottom
// console.log('fixTop2:', res.bottom) //
// })
// }
// })
// .exec()
// // draft.fixTop = document.getElementById('item-list-head').clientHeight
// // console.log('fixTop2:', document.getElementById('item-list-head').clientHeight) //
// // })
// }
// }, 1000)
})
const fetch = async ({ pageIndex, pageSize }) => {
// card_id: 兑换券id
const { mcid, cid } = $instance.router.params
@@ -369,7 +334,6 @@ function ItemList() {
ref={pageRef}
>
<View className='search-wrap'>
{/* 兑换券选择店铺 */}
{VERSION_STANDARD && card_id && (
<View
className='store-picker'
@@ -395,18 +359,7 @@ function ItemList() {
</View>
<View className='item-list-head'>
{tagList.length > 0 && (
<SpTagBar className='tag-list' list={tagList} value={curTagIdx} onChange={onChangeTag}>
{/* <View
className="filter-btn"
onClick={() => {
setState(v => {
v.show = true;
});
}}
>
筛选<Text className="iconfont icon-filter"></Text>
</View> */}
</SpTagBar>
<SpTagBar className='tag-list' list={tagList} value={curTagIdx} onChange={onChangeTag} />
)}
<SpFilterBar

View File

@@ -298,113 +298,115 @@ export default class Login extends Component {
})}
onClickLeftIcon={this.handleNavLeftItemClick}
>
<View className='auth-hd'>
<View className='title'>欢迎登录</View>
{/* <View className='desc'>使用已注册的手机号登录</View> */}
</View>
<View className='auth-bd'>
<AtForm className='form'>
<View className='form-field noborder'>
<CompInputPhone
onChange={this.handleInputChange.bind(this, 'mobile')}
value={info.mobile}
needValidate={passwordLogin}
/>
</View>
{/* 密码登录 */}
{passwordLogin && (
<View className='form-field'>
<View className='input-field'>
<CompPasswordInput
onChange={this.handleInputChange.bind(this, 'password')}
{...inputProp}
value={info.password}
// onFocus={this.handleRemarkFocus.bind(this)}
// onBlur={this.handleRemarkBlur.bind(this)}
/>
</View>
<View style={{ padding: '0 32px' }}>
<View className='auth-hd'>
<View className='title'>欢迎登录</View>
{/* <View className='desc'>使用已注册的手机号登录</View> */}
</View>
<View className='auth-bd'>
<AtForm className='form'>
<View className='form-field noborder'>
<CompInputPhone
onChange={this.handleInputChange.bind(this, 'mobile')}
value={info.mobile}
needValidate={passwordLogin}
/>
</View>
)}
{/* 验证码登录验证码超过1次显示图形验证码 */}
{codeLogin && (
<View className='form-field'>
<View className='input-field'>
<AtInput
clear
name='yzm'
value={info.yzm}
placeholder='请输入图形验证码'
onChange={this.handleInputChange.bind(this, 'yzm')}
placeholderClass='input-placeholder'
{...inputProp}
/>
</View>
<View className='btn-field'>
{imgInfo && (
<Image
className='image-vcode'
src={imgInfo.imageData}
onClick={this.getImageVcode.bind(this)}
/>
)}
</View>
</View>
)}
{codeLogin && (
<View className='form-field'>
<View className='input-field'>
<AtInput
clear
name='vcode'
value={info.vcode}
placeholder='请输入验证码'
onChange={this.handleInputChange.bind(this, 'vcode')}
placeholderClass='input-placeholder'
{...inputProp}
/>
</View>
<View className='btn-field'>
<SpTimer
onStart={this.handleTimerStart.bind(this)}
onStop={this.handleTimerStop}
/>
</View>
</View>
)}
{/* {passwordLogin && <View className='form-tip'>{PASSWORD_TIP}</View>} */}
<View className='btn-text-group'>
<Text className='btn-text' onClick={this.handleToggleLogin.bind(this)}>
{passwordLogin ? '验证码登录' : '密码登录'}
</Text>
{/* 密码登录 */}
{passwordLogin && (
<Text className='btn-text forgot-password' onClick={this.handleForgotPsd}>
忘记密码
</Text>
<View className='form-field'>
<View className='input-field'>
<CompPasswordInput
onChange={this.handleInputChange.bind(this, 'password')}
{...inputProp}
value={info.password}
// onFocus={this.handleRemarkFocus.bind(this)}
// onBlur={this.handleRemarkBlur.bind(this)}
/>
</View>
</View>
)}
</View>
<View className='form-submit'>
<AtButton
disabled={!isFull}
circle
type='primary'
className='login-button'
onClick={this.handleSubmit.bind(this)}
>
</AtButton>
<AtButton
circle
type='primary'
className='reg-button'
onClick={this.handleNavigateReg}
>
</AtButton>
</View>
</AtForm>
</View>
<View className='other-login'>
<CompOtherLogin />
{/* 验证码登录验证码超过1次显示图形验证码 */}
{codeLogin && (
<View className='form-field'>
<View className='input-field'>
<AtInput
clear
name='yzm'
value={info.yzm}
placeholder='请输入图形验证码'
onChange={this.handleInputChange.bind(this, 'yzm')}
placeholderClass='input-placeholder'
{...inputProp}
/>
</View>
<View className='btn-field'>
{imgInfo && (
<Image
className='image-vcode'
src={imgInfo.imageData}
onClick={this.getImageVcode.bind(this)}
/>
)}
</View>
</View>
)}
{codeLogin && (
<View className='form-field'>
<View className='input-field'>
<AtInput
clear
name='vcode'
value={info.vcode}
placeholder='请输入验证码'
onChange={this.handleInputChange.bind(this, 'vcode')}
placeholderClass='input-placeholder'
{...inputProp}
/>
</View>
<View className='btn-field'>
<SpTimer
onStart={this.handleTimerStart.bind(this)}
onStop={this.handleTimerStop}
/>
</View>
</View>
)}
{/* {passwordLogin && <View className='form-tip'>{PASSWORD_TIP}</View>} */}
<View className='btn-text-group'>
<Text className='btn-text' onClick={this.handleToggleLogin.bind(this)}>
{passwordLogin ? '验证码登录' : '密码登录'}
</Text>
{passwordLogin && (
<Text className='btn-text forgot-password' onClick={this.handleForgotPsd}>
忘记密码
</Text>
)}
</View>
<View className='form-submit'>
<AtButton
disabled={!isFull}
circle
type='primary'
className='login-button'
onClick={this.handleSubmit.bind(this)}
>
</AtButton>
<AtButton
circle
type='primary'
className='reg-button'
onClick={this.handleNavigateReg}
>
</AtButton>
</View>
</AtForm>
</View>
<View className='other-login'>
<CompOtherLogin />
</View>
</View>
</SpPage>
)

View File

@@ -1,4 +1,4 @@
$border-color:#E2E4EA;
$border-color: #e2e4ea;
.page-auth-login {
background-color: #fff;
@@ -7,54 +7,51 @@ $border-color:#E2E4EA;
right: 0;
bottom: 0;
left: 0;
padding: 0 32px;
display: flex;
flex-direction: column;
@include placeholder(rgba(197, 202, 213, 1),32px);
@include placeholder(rgba(197, 202, 213, 1), 32px);
.at-input{
.weui-input{
color:rgba(17, 26, 52, 1);
}
.input-placeholder{
color:rgba(197, 202, 213, 1);
}
.at-input {
.weui-input {
color: rgba(17, 26, 52, 1);
}
.input-placeholder {
color: rgba(197, 202, 213, 1);
}
}
&.is-code-login{
.auth-bd{
.form-submit{
&.is-code-login {
.auth-bd {
.form-submit {
margin-top: 50px;
}
}
}
&.is-full{
.auth-bd{
.form-submit{
.login-button{
background-color:var(--color-primary);
&.is-full {
.auth-bd {
.form-submit {
.login-button {
background-color: var(--color-primary);
border-color: var(--color-primary);
}
}
}
}
.auth-hd {
margin-top:80px;
margin-top: 80px;
.title {
color: #111A34;
color: #111a34;
font-size: 52px;
line-height: 1;
margin-bottom:24px;
margin-bottom: 24px;
}
.desc {
font-size: 28px;
color: #858B9C;
color: #858b9c;
line-height: 1;
}
}
@@ -62,21 +59,21 @@ $border-color:#E2E4EA;
margin-top: 100px;
.form-title {
font-size: 32px;
color: #111A34;
color: #111a34;
padding-bottom: 20px;
border-bottom: 1PX solid $border-color;
border-bottom: 1px solid $border-color;
}
.form-tip{
.form-tip {
font-size: 28px;
color: #858b9c;
color: #858b9c;
margin-top: 16px;
}
.form-field {
display: flex;
align-items: center;
border-bottom: 1PX solid $border-color;
border-bottom: 1px solid $border-color;
&.noborder{
&.noborder {
border-bottom: none;
}
@@ -86,7 +83,7 @@ $border-color:#E2E4EA;
flex: 1;
&:after {
border:none;
border: none;
}
}
.input-field {
@@ -96,15 +93,15 @@ $border-color:#E2E4EA;
width: 180px;
text-align: center;
.image-vcode {
width:180px;
height:60px;
width: 180px;
height: 60px;
display: block;
}
}
}
.btn-text-group {
display: flex;
justify-content:space-between;
justify-content: space-between;
}
.btn-text {
margin-top: 30px;
@@ -113,36 +110,35 @@ $border-color:#E2E4EA;
}
.form-submit {
margin-top: 100px;
.at-button__text{
.at-button__text {
@include flex-center();
font-size: 36px;
font-weight: 600;
}
.at-button--disabled{
opacity: .5;
.at-button--disabled {
opacity: 0.5;
}
.login-button,.reg-button{
.login-button,
.reg-button {
height: 100px;
border-radius: 50px;
}
.reg-button{
.reg-button {
margin-top: 32px;
background-color: white;
/* prettier-ignore */
border: 1PX solid var(--color-primary);
color:var(--color-primary);
color: var(--color-primary);
}
}
.forgot-password{
color:rgba(133, 139, 156, 1);
.forgot-password {
color: rgba(133, 139, 156, 1);
}
.btn-submit {
height: 100px;
border-radius: 50px;
line-height: 100px;
font-size: 36px;
}
}
.auth-ft {
@@ -157,11 +153,11 @@ $border-color:#E2E4EA;
height: 45px;
}
}
.other-login{
.other-login {
margin-top: 100px;
left: 0;
right: 0;
bottom:0;
bottom: 0;
text-align: center;
}
}

View File

@@ -33,16 +33,16 @@ function CompMenu(props) {
})
}
if (accessMenu.salesPersonList?.total_count > 0) {
menus = menus.concat([
{
key: 'salesman',
name: '业务员',
icon: 'salesman.png',
link: '/subpages/salesman/index'
}
])
}
// if (accessMenu.salesPersonList?.total_count > 0) {
// menus = menus.concat([
// {
// key: 'salesman',
// name: '业务员',
// icon: 'salesman.png',
// link: '/subpages/salesman/index'
// }
// ])
// }
if (accessMenu.deliveryStaffList?.total_count > 0) {
menus = menus.concat([

View File

@@ -100,7 +100,6 @@ class EntryLaunch {
return new Promise((resolve, reject) => {
MapLoader()
.then((qq) => {
debugger
// 初始化地图对象
this.geolocation = new qq.maps.Geolocation({
key: process.env.APP_MAP_KEY,