From 23ae6ff2794a11da76ccd7b9fb0fc5f2dbf3b6ae Mon Sep 17 00:00:00 2001 From: zhangjing1 Date: Fri, 24 Jul 2026 14:46:36 +0800 Subject: [PATCH] [TBID:ECX-9414] chore: merge master changes for release --- src/__tests__/storeShopItem.test.js | 14 ++++++ src/doc/activity.js | 14 ++++-- src/hocs/withPageWrapper.js | 3 +- src/marketing/pages/member/activity-detail.js | 22 ++++++---- .../pages/member/activity-detail.scss | 43 ++++++++++++++++--- .../pages/member/comps/comp-activity-item.js | 24 ++++++++--- src/subpages/store/comps/comp-shopitem.js | 10 +++-- 7 files changed, 100 insertions(+), 30 deletions(-) create mode 100644 src/__tests__/storeShopItem.test.js diff --git a/src/__tests__/storeShopItem.test.js b/src/__tests__/storeShopItem.test.js new file mode 100644 index 000000000..39cb5d311 --- /dev/null +++ b/src/__tests__/storeShopItem.test.js @@ -0,0 +1,14 @@ +const fs = require('fs') +const path = require('path') + +const source = fs.readFileSync( + path.resolve(process.cwd(), 'src/subpages/store/comps/comp-shopitem.js'), + 'utf8' +) + +test('store list contact phone only renders when show_mobile is 1', () => { + expect(source).toMatch(/String\(info\.show_mobile\) === '1'/) + expect(source).toMatch( + /\{String\(info\.show_mobile\) === '1' && \(\s*[\s\S]*?\$t\('17a2cf99\.7d33dc'\)[\s\S]*?info\.mobile[\s\S]*?<\/View>\s*\)\}/ + ) +}) diff --git a/src/doc/activity.js b/src/doc/activity.js index 1bbab1c49..669e73287 100644 --- a/src/doc/activity.js +++ b/src/doc/activity.js @@ -21,6 +21,10 @@ export const RECORD_LIST = { }, hasTemp: ({ form_id }) => form_id != 0, areaName: ({ activity_info }) => activity_info?.area_name, + showPlace: ({ activity_info }) => JSON.parse(activity_info?.show_fields || '{}')?.place == 1, + showAddress: ({ activity_info }) => JSON.parse(activity_info?.show_fields || '{}')?.address == 1, + showCity: ({ activity_info }) => JSON.parse(activity_info?.show_fields || '{}')?.city == 1, + showTime: ({ activity_info }) => JSON.parse(activity_info?.show_fields || '{}')?.time == 1, actionCancel: ({ action }) => action?.cancel == 1, actionEdit: ({ action }) => action?.edit == 1, actionApply: ({ action }) => action?.apply == 1, @@ -43,6 +47,9 @@ export const RECORD_DETAIL = { intro: ({ start_date, end_date }) => start_date + ' - ' + end_date, activityPlace: ({ activity_info }) => activity_info?.place, activityAddress: ({ activity_info }) => activity_info?.address, + showPlace: ({ activity_info }) => JSON.parse(activity_info?.show_fields || '{}')?.place == 1, + showAddress: ({ activity_info }) => JSON.parse(activity_info?.show_fields || '{}')?.address == 1, + showTime: ({ activity_info }) => JSON.parse(activity_info?.show_fields || '{}')?.time == 1, formData: ({ content }) => content?.[0]?.formdata, recordNo: 'record_no', mobile: 'mobile', @@ -70,9 +77,10 @@ export const ACTIVITY_LIST = { pics: ({ pics }) => pics?.split(','), hasTemp: ({ temp_id }) => temp_id != '0', area: 'area', - showPlace: ({ show_fields }) => JSON.parse(show_fields)?.place == 1, - showAddress: ({ show_fields }) => JSON.parse(show_fields)?.address == 1, - showCity: ({ show_fields }) => JSON.parse(show_fields)?.city == 1, + showPlace: ({ show_fields }) => JSON.parse(show_fields || '{}')?.place == 1, + showAddress: ({ show_fields }) => JSON.parse(show_fields || '{}')?.address == 1, + showCity: ({ show_fields }) => JSON.parse(show_fields || '{}')?.city == 1, + showTime: ({ show_fields }) => JSON.parse(show_fields || '{}')?.time == 1, joinLimit: 'join_limit', totalJoinNum: 'total_join_num', isAllowDuplicate: ({ is_allow_duplicate }) => is_allow_duplicate == 1, diff --git a/src/hocs/withPageWrapper.js b/src/hocs/withPageWrapper.js index 02a4d2a51..f9b72032f 100644 --- a/src/hocs/withPageWrapper.js +++ b/src/hocs/withPageWrapper.js @@ -197,7 +197,6 @@ function withPageWrapper(Component) { // 如果请求的店铺ID和接口返回的店铺ID不一致(店铺可能关闭或禁用),此时需要根据兜底策略来决定跳转到引导页和默认店铺页 if ( dtid > 0 && - currentShopInfo.distributor_self != 0 && currentShopInfo.distributor_id !== dtid && entryDefalutStore == 2 // 兜底策略指定页面 ) { @@ -206,7 +205,7 @@ function withPageWrapper(Component) { }) } - if (currentShopInfo.distributor_self != 0 && currentShopInfo.open_divided == '1') { + if (currentShopInfo.open_divided == '1') { // 开启了店铺白名单 if (!S.getAuthToken()) { // 微信不允许首页直接弹出登录授权,不再主动弹窗,先允许进入并设置店铺信息,需登录时再引导 diff --git a/src/marketing/pages/member/activity-detail.js b/src/marketing/pages/member/activity-detail.js index 151ed8ee3..96675f464 100644 --- a/src/marketing/pages/member/activity-detail.js +++ b/src/marketing/pages/member/activity-detail.js @@ -260,15 +260,19 @@ function ActivityDetail(props) { {info.activityName} - {info?.intro} - - {$t('c012603a.adb1b6')} - {info?.activityPlace} - - - {$t('c012603a.75c1f8')} - {info?.activityAddress} - + {info.showTime && {info?.intro}} + {info.showPlace && ( + + {$t('c012603a.adb1b6')} + {info?.activityPlace} + + )} + {info.showAddress && ( + + {$t('c012603a.75c1f8')} + {info?.activityAddress} + + )} {qrcode && info?.status == 'passed' && ( diff --git a/src/marketing/pages/member/activity-detail.scss b/src/marketing/pages/member/activity-detail.scss index 4596059ce..4566421de 100644 --- a/src/marketing/pages/member/activity-detail.scss +++ b/src/marketing/pages/member/activity-detail.scss @@ -5,15 +5,17 @@ @import '@/style/imports'; .page-activity-detail { + overflow-x: hidden; + .activity-detail { position: relative; padding: 36px 24px; box-sizing: border-box; + overflow-x: hidden; + width: 100%; &__hd { - width: 100%; height: 276px; - background: var(--color-primary); border-radius: 0 0 150px 150px; position: absolute; left: 0; @@ -28,8 +30,12 @@ justify-content: space-between; align-items: center; margin-bottom: 42px; + min-width: 0; &-left { + flex: 1; + min-width: 0; + &-status { font-weight: 600; font-size: 32px; @@ -40,6 +46,7 @@ .iconfont { font-size: 62px; margin-right: 10px; + flex-shrink: 0; } } @@ -48,16 +55,22 @@ font-weight: 400; font-size: 28px; color: #ffffff; + word-break: break-all; } } &-right { + flex-shrink: 0; + max-width: 45%; padding: 8px 24px; background: #ffffff; border-radius: 33px; font-weight: 600; font-size: 28px; color: #31973f; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } } @@ -78,6 +91,7 @@ font-size: 32px; color: #333333; margin-bottom: 16px; + word-break: break-all; } &-time { @@ -88,23 +102,28 @@ box-sizing: border-box; border-bottom: #979797 1px dashed; margin-bottom: 36px; + word-break: break-all; } &-area { display: flex; font-size: 26px; margin-bottom: 24px; + min-width: 0; &-label { + flex-shrink: 0; font-weight: 500; color: #333333; white-space: nowrap; } &-content { + flex: 1; + min-width: 0; font-weight: 400; - color: #999999; + word-break: break-all; } } @@ -163,14 +182,21 @@ font-size: 28px; font-weight: 400; margin-bottom: 48px; + min-width: 0; + gap: 24px; - &-lable { + &-label { + flex-shrink: 0; color: #333333; } &-value { + flex: 1; + min-width: 0; font-weight: 400; color: #999999; + text-align: right; + word-break: break-all; } } } @@ -179,6 +205,7 @@ display: flex; flex-wrap: wrap; justify-content: flex-end; + max-width: 100%; .sp-image { margin: 0 0 16px 25px; @@ -188,11 +215,16 @@ &__footer { display: flex; justify-content: flex-end; + flex-wrap: wrap; padding: 20px 24px 0; box-sizing: border-box; + max-width: 100%; + overflow: hidden; &-btn { - width: 240px; + flex: 0 1 240px; + max-width: 240px; + min-width: 0; height: 64px; text-align: center; line-height: 64px; @@ -202,6 +234,7 @@ font-size: 28px; color: #333333; margin-left: 24px; + box-sizing: border-box; } .refill-btn { diff --git a/src/marketing/pages/member/comps/comp-activity-item.js b/src/marketing/pages/member/comps/comp-activity-item.js index 5a5210763..e9dc9a8b2 100644 --- a/src/marketing/pages/member/comps/comp-activity-item.js +++ b/src/marketing/pages/member/comps/comp-activity-item.js @@ -32,6 +32,7 @@ function CompActivityItem(props) { pics, actionCancel, showCity, + showTime, actionEdit, actionApply, activityStartTime, @@ -43,9 +44,12 @@ function CompActivityItem(props) { } = info const activityAreaShow = useMemo(() => { - if (!isActivity) return true - return showCity - }, [info, isActivity]) + return !!showCity + }, [showCity]) + + const activityTimeShow = useMemo(() => { + return !!showTime + }, [showTime]) const signDisabled = useMemo(() => { // 活动结束 @@ -74,10 +78,16 @@ function CompActivityItem(props) { {activityName} {!isActivity && {statusName}} - - {activityStartTime} - {activityAreaShow && {areaName}} - + {(activityTimeShow || activityAreaShow) && ( + + {activityTimeShow && ( + {activityStartTime} + )} + {activityAreaShow && ( + {areaName} + )} + + )} {reason && !isActivity && ( {$t('925d1b2b.2624eb')} diff --git a/src/subpages/store/comps/comp-shopitem.js b/src/subpages/store/comps/comp-shopitem.js index 8fdff93ae..cef333b32 100644 --- a/src/subpages/store/comps/comp-shopitem.js +++ b/src/subpages/store/comps/comp-shopitem.js @@ -39,10 +39,12 @@ function CompShopItem(props) { {$t('17a2cf99.6cd6e3')} {info.hour} - - {$t('17a2cf99.7d33dc')} - {info.mobile} - + {String(info.show_mobile) === '1' && ( + + {$t('17a2cf99.7d33dc')} + {info.mobile} + + )} )