mirror of
https://gitee.com/ShopeX/ECShopX_mobile-frontend
synced 2026-08-06 04:36:24 +08:00
[TBID:ECX-9414] chore: merge master changes for release
This commit is contained in:
14
src/__tests__/storeShopItem.test.js
Normal file
14
src/__tests__/storeShopItem.test.js
Normal file
@@ -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*<View className='shop-desc'>[\s\S]*?\$t\('17a2cf99\.7d33dc'\)[\s\S]*?info\.mobile[\s\S]*?<\/View>\s*\)\}/
|
||||
)
|
||||
})
|
||||
@@ -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,
|
||||
|
||||
@@ -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()) {
|
||||
// 微信不允许首页直接弹出登录授权,不再主动弹窗,先允许进入并设置店铺信息,需登录时再引导
|
||||
|
||||
@@ -260,15 +260,19 @@ function ActivityDetail(props) {
|
||||
|
||||
<View className='activity-detail__info'>
|
||||
<View className='activity-detail__info-title'>{info.activityName}</View>
|
||||
<View className='activity-detail__info-time'>{info?.intro}</View>
|
||||
<View className='activity-detail__info-area'>
|
||||
<View className='activity-detail__info-area-label'>{$t('c012603a.adb1b6')}</View>
|
||||
<View className='activity-detail__info-area-content'>{info?.activityPlace}</View>
|
||||
</View>
|
||||
<View className='activity-detail__info-area no-margin'>
|
||||
<View className='activity-detail__info-area-label'>{$t('c012603a.75c1f8')}</View>
|
||||
<View className='activity-detail__info-area-content'>{info?.activityAddress}</View>
|
||||
</View>
|
||||
{info.showTime && <View className='activity-detail__info-time'>{info?.intro}</View>}
|
||||
{info.showPlace && (
|
||||
<View className={`activity-detail__info-area${!info.showAddress ? ' no-margin' : ''}`}>
|
||||
<View className='activity-detail__info-area-label'>{$t('c012603a.adb1b6')}</View>
|
||||
<View className='activity-detail__info-area-content'>{info?.activityPlace}</View>
|
||||
</View>
|
||||
)}
|
||||
{info.showAddress && (
|
||||
<View className='activity-detail__info-area no-margin'>
|
||||
<View className='activity-detail__info-area-label'>{$t('c012603a.75c1f8')}</View>
|
||||
<View className='activity-detail__info-area-content'>{info?.activityAddress}</View>
|
||||
</View>
|
||||
)}
|
||||
|
||||
{qrcode && info?.status == 'passed' && (
|
||||
<View className='activity-detail__info-code'>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
<View className='activity-item__content-title'>{activityName}</View>
|
||||
{!isActivity && <View className='activity-item__content-status'>{statusName}</View>}
|
||||
</View>
|
||||
<View className='flex-between-center'>
|
||||
<View className='activity-item__content-time'>{activityStartTime}</View>
|
||||
{activityAreaShow && <View className='activity-item__content-address'>{areaName}</View>}
|
||||
</View>
|
||||
{(activityTimeShow || activityAreaShow) && (
|
||||
<View className='flex-between-center'>
|
||||
{activityTimeShow && (
|
||||
<View className='activity-item__content-time'>{activityStartTime}</View>
|
||||
)}
|
||||
{activityAreaShow && (
|
||||
<View className='activity-item__content-address'>{areaName}</View>
|
||||
)}
|
||||
</View>
|
||||
)}
|
||||
{reason && !isActivity && (
|
||||
<View className='activity-item__content-reject'>
|
||||
{$t('925d1b2b.2624eb')}
|
||||
|
||||
@@ -39,10 +39,12 @@ function CompShopItem(props) {
|
||||
<Text>{$t('17a2cf99.6cd6e3')}</Text>
|
||||
<Text>{info.hour}</Text>
|
||||
</View>
|
||||
<View className='shop-desc'>
|
||||
<Text>{$t('17a2cf99.7d33dc')}</Text>
|
||||
<Text>{info.mobile}</Text>
|
||||
</View>
|
||||
{String(info.show_mobile) === '1' && (
|
||||
<View className='shop-desc'>
|
||||
<Text>{$t('17a2cf99.7d33dc')}</Text>
|
||||
<Text>{info.mobile}</Text>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user