From 1bbce1833e82dcb51a343e4436a0bef92d7ba2aa Mon Sep 17 00:00:00 2001 From: moyayu <1623253835@qq.com> Date: Wed, 20 May 2026 11:03:34 +0800 Subject: [PATCH] fix: product detail scroll nav mantle, price/SKU header tweaks, and delivery UI cleanup --- src/components/sp-deliver/index.js | 28 +--- src/components/sp-deliver/index.scss | 199 ------------------------- src/components/sp-goods-price/index.js | 20 +-- src/components/sp-page/header.js | 7 +- src/components/sp-sku-select/index.js | 1 + src/subpages/auth/login.js | 6 - src/subpages/item/espier-detail.js | 88 ++++------- 7 files changed, 41 insertions(+), 308 deletions(-) diff --git a/src/components/sp-deliver/index.js b/src/components/sp-deliver/index.js index 7df4955af..f5f24bb58 100644 --- a/src/components/sp-deliver/index.js +++ b/src/components/sp-deliver/index.js @@ -2,14 +2,15 @@ * Copyright © ShopeX (http://www.shopex.cn). All rights reserved. * See LICENSE file for license details. */ -import React, { useEffect, useRef, useImperativeHandle, useMemo } from 'react' +import React, { useEffect, useRef, useImperativeHandle } from 'react' import { useSelector, useDispatch } from 'react-redux' import Taro, { getCurrentInstance } from '@tarojs/taro' -import { View, Text } from '@tarojs/components' +import { View, ScrollView, Text } from '@tarojs/components' import { useImmer } from 'use-immer' import { AddressChoose, SpCell, + SpFloatLayout, SpForm, SpFormItem, SpTimePicker, @@ -22,22 +23,6 @@ import api from '@/api' import { $t, ti, useTranslation } from '@/i18n' import './index.scss' -/** 企业购结算页分段条:与设计稿图标对应 */ -const PURCHASE_DELIVERY_ICONS = { - logistics: 'icon-office-box', - dada: 'icon-delivery', - merchant: 'icon-delivery', - ziti: 'icon-zitidian' -} - -/** 企业购 Figma 58:460 文案(与 DELIVERY_LIST 中「同城配」区分),键与 locales 既有配送文案对齐 */ -const PURCHASE_TAB_LABEL_KEYS = { - logistics: '97e6d964.249bfe', - dada: '97e6d964.bdcbc9', - merchant: '97e6d964.bdcbc9', - ziti: '9c730348.93ab28' -} - const initialState = { distributorInfo: null, receiptType: '', @@ -90,6 +75,7 @@ function SpDeliver(props, ref) { receiptType, showTimePicker, form, + rules, weekdays, timeSlots, pickerIndex, @@ -430,11 +416,7 @@ function SpDeliver(props, ref) { return ( {receiptType === item.type && item.type === 'logistics' && ( diff --git a/src/components/sp-deliver/index.scss b/src/components/sp-deliver/index.scss index 0677a825a..8f4830482 100644 --- a/src/components/sp-deliver/index.scss +++ b/src/components/sp-deliver/index.scss @@ -11,10 +11,6 @@ background: #f5f5f5; border-radius: 12px; font-size: 24px; - height: 110px; - width: 100%; - box-sizing: border-box; - background-color: #F5F5F5; .switch-item { // padding: 0px 30px; display: flex; @@ -294,198 +290,3 @@ } } } - -.ziti-info { - margin-top: 24px; - padding: 30px 30px 30px 50px; - border-radius: 20px; - background: #fff; - box-shadow: inset 0 0 0 1px #f2f2f2; - - .sp-order-item__idx { - margin-left: -20px; - } - - .applychief-form { - .sp-form-item { - margin-bottom: 0; - padding: 0; - background: transparent; - - &.sp-form-item-line { - padding: 10px 0; - align-items: center; - border-bottom: 1px solid #ececec; - } - - &:last-child.sp-form-item-line { - border-bottom: 0; - } - - .form-item-label { - .label { - font-size: 28px; - font-weight: 500; - color: #333; - } - } - - .required { - top: 2px; - color: #df2f2f; - } - - .form-item-control { - min-width: 0; - } - - .at-input, - .picker-time { - margin: 0; - padding: 8px 0 10px; - border: 0; - border-radius: 0; - background: transparent; - min-height: 68px; - box-sizing: border-box; - - &:after { - border: 0; - } - } - - .picker-time { - .sp-cell__bd { - justify-content: flex-start; - padding: 0; - - .placeholder { - color: #ccc; - } - } - - .sp-cell__ft { - padding-right: 0; - } - } - - .at-input { - margin-left: 0; - } - - .at-input__input, - .picker-time text { - width: 100%; - font-size: 30px; - color: #222; - } - - .placeholder, - .at-input .input-placeholder { - color: #c7c7c7; - } - - .form-item-message { - left: 96px; - bottom: -30px; - font-size: 22px; - } - } - } -} - -.ziti-info { - margin-top: 24px; - padding: 30px 30px 30px 50px; - border-radius: 20px; - background: #fff; - box-shadow: inset 0 0 0 1px #f2f2f2; - - .sp-order-item__idx { - margin-left: -20px; - } - .applychief-form { - .sp-form-item { - margin-bottom: 0; - padding: 0; - background: transparent; - - &.sp-form-item-line { - padding: 10px 0; - align-items: center; - border-bottom: 1px solid #ececec; - } - - &:last-child.sp-form-item-line { - border-bottom: 0; - } - - .form-item-label { - .label { - font-size: 28px; - font-weight: 500; - color: #333; - } - } - - .required { - top: 2px; - color: #df2f2f; - } - - .form-item-control { - min-width: 0; - } - - .at-input, - .picker-time { - margin: 0; - padding: 8px 0 10px; - border: 0; - border-radius: 0; - background: transparent; - min-height: 68px; - box-sizing: border-box; - - &:after { - border: 0; - } - } - - .picker-time { - .sp-cell__bd { - justify-content: flex-start; - padding: 0; - .placeholder { - color: #ccc; - } - } - .sp-cell__ft { - padding-right: 0; - } - } - - .at-input { - margin-left: 0; - } - - .at-input__input, - .picker-time text { - width: 100%; - font-size: 30px; - color: #222; - } - - .placeholder, - .at-input .input-placeholder { - color: #c7c7c7; - } - - .form-item-message { - left: 96px; - bottom: -30px; - font-size: 22px; - } - } - } -} \ No newline at end of file diff --git a/src/components/sp-goods-price/index.js b/src/components/sp-goods-price/index.js index e9d7caad0..e07b5a323 100644 --- a/src/components/sp-goods-price/index.js +++ b/src/components/sp-goods-price/index.js @@ -41,7 +41,7 @@ function SpGoodsPrice(props) { {/* ¥{activityPrice.toFixed(2)} */} - + {/* */} @@ -53,20 +53,6 @@ function SpGoodsPrice(props) { {isNaN(activityPrice) && ( - {isPoint && price == 0 && } - {isPoint && price > 0 && ( - - - + - - - )} - {!isPoint && } - {marketPrice > 0 && enMarketPrice && ( - - )} - - {info.memberPrice < info.price && enMemberPrice && isLogin && ( @@ -80,8 +66,8 @@ function SpGoodsPrice(props) { (!info.svipPrice || info.vipPrice > info.svipPrice) && enSvipPrice && ( - + )} @@ -91,8 +77,8 @@ function SpGoodsPrice(props) { info.svipPrice < info.memberPrice && enSvipPrice && ( - + )} {isPoint && price == 0 && } diff --git a/src/components/sp-page/header.js b/src/components/sp-page/header.js index 9d26a2ff0..6019a7317 100644 --- a/src/components/sp-page/header.js +++ b/src/components/sp-page/header.js @@ -46,9 +46,12 @@ const CustomNavigationHeader = memo((props) => { 'background-position': 'center', 'padding-top': `${gStatusBarHeight}px` } - // 吸顶挂件 > 沉浸式滚动 50px 后显示的导航背景 > 默认导航背景 + // 吸顶挂件 > 页面显式控制的导航背景 > 沉浸式滚动 50px 后显示的导航背景 > 默认导航背景 const headerBg = - statusBarBgColor ?? immersiveScrollRevealBgColor ?? pageConfig?.navigateBackgroundColor + statusBarBgColor ?? + (navigateMantle ? navigateBackgroundColor : null) ?? + immersiveScrollRevealBgColor ?? + pageConfig?.navigateBackgroundColor if (headerBg) { style['background-color'] = headerBg } diff --git a/src/components/sp-sku-select/index.js b/src/components/sp-sku-select/index.js index 99be14bdf..fc3fe8c90 100644 --- a/src/components/sp-sku-select/index.js +++ b/src/components/sp-sku-select/index.js @@ -572,6 +572,7 @@ function SpSkuSelect(props) { */} + {info.itemName} {curItem ? ti('47ac6066.aa995b', [skuText]) : skuText} diff --git a/src/subpages/auth/login.js b/src/subpages/auth/login.js index c0f92e68e..c344fe270 100644 --- a/src/subpages/auth/login.js +++ b/src/subpages/auth/login.js @@ -126,12 +126,6 @@ export default class Login extends Component { } } - componentWillUnmount() { - if (this._onLanguageChanged) { - i18n.off('languageChanged', this._onLanguageChanged) - } - } - componentDidShow() { Taro.setNavigationBarTitle({ title: $t('3ca883d0.402d19') }) const { redirect } = this.$instance?.router?.params diff --git a/src/subpages/item/espier-detail.js b/src/subpages/item/espier-detail.js index 0420f13a4..bb9e6e583 100644 --- a/src/subpages/item/espier-detail.js +++ b/src/subpages/item/espier-detail.js @@ -120,6 +120,7 @@ function EspierDetail(props) { useTranslation() const $instance = getCurrentInstance() || {} const pageRef = useRef() + const scrollTopRef = useRef(0) const { userInfo } = useSelector((state) => state.user) const { colorPrimary, openRecommend } = useSelector((state) => state.sys) @@ -468,6 +469,26 @@ function EspierDetail(props) { }) } + const syncNavigateMantle = (scrollTop = 0) => { + const bannerHeight = imgHeightList[curImgIdx] || defaultImageHeight + const nextNavigateMantle = scrollTop > bannerHeight + setState((draft) => { + draft.navigateMantle = nextNavigateMantle + }) + } + + const handleGoodsScroll = (e) => { + const detail = e?.detail || {} + console.log('[espier-detail] handleGoodsScroll', detail) + scrollTopRef.current = detail.scrollTop || 0 + pageRef.current?.handlePageScroll(detail) + syncNavigateMantle(detail.scrollTop || 0) + } + + useEffect(() => { + syncNavigateMantle(scrollTopRef.current) + }, [curImgIdx, imgHeightList]) + const setSwiperCss = (item) => { return { height: '100%', @@ -542,7 +563,12 @@ function EspierDetail(props) { } > - + {info && ( @@ -687,28 +713,6 @@ function EspierDetail(props) { {info.itemName} {info.brief} - {(isWeixin || isAPP()) && ( - // {( - - { - if (isAPP()) { - Taro.SAPPShare.open() - } else { - // await getUserInfoAuth() - setState((draft) => { - draft.sharePanelOpen = true - }) - } - }} - > - - - {$t('934ffec2.c31f48')} - - - - )} {info.isMedicine == 1 && info?.medicineData?.is_prescription == 1 && ( @@ -756,44 +760,6 @@ function EspierDetail(props) { )} - - {promotionPackage.length > 0 && ( - { - Taro.navigateTo({ - url: `/subpages/marketing/package-list?id=${info.itemId}&distributor_id=${info.distributorId}` - }) - // setState((draft) => { - // draft.packageOpen = true - // }) - }} - > - - {ti('6578cf7b.0fe3d0', [promotionPackage.length])} - - - )} - {promotionActivity.length > 0 && ( - { - setState((draft) => { - draft.promotionOpen = true - }) - }} - > - {promotionActivity.map((item, index) => ( - - {item.promotionTag} - - ))} - - )} - - {/* {info.itemParams.length > 0 && 商品参数