mirror of
https://gitee.com/ShopeX/ECShopX_mobile-frontend
synced 2026-08-06 20:56:24 +08:00
fix: ensure purchase activity price displays across pages
This commit is contained in:
@@ -24,7 +24,7 @@ function SpGoodsCell(props) {
|
||||
const { userInfo = {}, vipInfo = {} } = useSelector((state) => state.user)
|
||||
const { priceDisplayConfig = {} } = useSelector((state) => state.purchase)
|
||||
const { checkout_page = {} } = priceDisplayConfig
|
||||
const { activity_price: enPurActivityPrice, sale_price: enPurSalePrice } = checkout_page
|
||||
const { activity_price: enPurActivityPrice = true, sale_price: enPurSalePrice } = checkout_page
|
||||
if (!info) {
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ function SpGoodsPrice(props) {
|
||||
const { priceDisplayConfig = {} } = useSelector((state) => state.purchase)
|
||||
const { isLogin } = useLogin()
|
||||
const { items_page = {} } = priceDisplayConfig
|
||||
const { activity_price: enPurActivityPrice, sale_price: enPurSalePrice } = items_page
|
||||
const { activity_price: enPurActivityPrice = true, sale_price: enPurSalePrice } = items_page
|
||||
|
||||
if (!info) {
|
||||
return null
|
||||
|
||||
@@ -29,7 +29,7 @@ function SpOrderItem(props) {
|
||||
const { market_price: enMarketPrice } = order_page
|
||||
const { priceDisplayConfig = {} } = useSelector((state) => state.purchase)
|
||||
const { order_detail_page = {} } = priceDisplayConfig
|
||||
const { activity_price: enPurActivityPrice, sale_price: enPurSalePrice } = order_detail_page
|
||||
const { activity_price: enPurActivityPrice = true, sale_price: enPurSalePrice } = order_detail_page
|
||||
|
||||
if (!info) return null
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ function SpGoodsCard(props) {
|
||||
} = item_page
|
||||
const { priceDisplayConfig = {} } = useSelector((state) => state.purchase)
|
||||
const { items_page = {} } = priceDisplayConfig
|
||||
const { activity_price: enPurActivityPrice, sale_price: enPurSalePrice } = items_page
|
||||
const { activity_price: enPurActivityPrice = true, sale_price: enPurSalePrice } = items_page
|
||||
|
||||
const {
|
||||
onClick,
|
||||
|
||||
@@ -52,7 +52,7 @@ function CompGoodsItem(props) {
|
||||
const { market_price: enMarketPrice } = cart_page
|
||||
const { priceDisplayConfig = {} } = useSelector((state) => state.purchase)
|
||||
const { cart_page: pcart_page = {} } = priceDisplayConfig
|
||||
const { activity_price: enPurActivityPrice, sale_price: enPurSalePrice } = pcart_page
|
||||
const { activity_price: enPurActivityPrice = true, sale_price: enPurSalePrice } = pcart_page
|
||||
const [state, setState] = useImmer(initialState)
|
||||
const { localNum } = state
|
||||
|
||||
|
||||
@@ -197,11 +197,12 @@ function PurchaseActivityList() {
|
||||
const handlePriceConfig = (val) => {
|
||||
if (!val) return {}
|
||||
const priceConfig = JSON.parse(JSON.stringify(val))
|
||||
const isEnabled = (value) => ![false, 'false', 0, '0'].includes(value)
|
||||
Object.keys(priceConfig).forEach((key) => {
|
||||
const c_config = priceConfig[key]
|
||||
if (c_config) {
|
||||
for (let ckey in c_config) {
|
||||
c_config[ckey] = c_config[ckey] == 'true'
|
||||
c_config[ckey] = isEnabled(c_config[ckey])
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -25,11 +25,12 @@ import './select-identity.scss'
|
||||
function handlePriceConfig(val) {
|
||||
if (!val) return {}
|
||||
const priceConfig = JSON.parse(JSON.stringify(val))
|
||||
const isEnabled = (value) => ![false, 'false', 0, '0'].includes(value)
|
||||
Object.keys(priceConfig).forEach((key) => {
|
||||
const c_config = priceConfig[key]
|
||||
if (c_config) {
|
||||
for (const ckey in c_config) {
|
||||
c_config[ckey] = c_config[ckey] == 'true'
|
||||
c_config[ckey] = isEnabled(c_config[ckey])
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user