This commit is contained in:
parent
0d795b622c
commit
f4e89542a7
|
|
@ -13,7 +13,7 @@ export default defineAppConfig({
|
||||||
},
|
},
|
||||||
permission: {
|
permission: {
|
||||||
'scope.userLocation': {
|
'scope.userLocation': {
|
||||||
desc: '用于选择门店地图位置'
|
desc: '用于选择门店位置'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
requiredPrivateInfos: [
|
requiredPrivateInfos: [
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@ export const RECEIPT_STAMP_DONE = `${STATIC_CDN}/images/oderDetailCallBackSucces
|
||||||
export const RECEIPT_STAMP_PENDING = `${STATIC_CDN}/images/oderDetailCallBack.png`
|
export const RECEIPT_STAMP_PENDING = `${STATIC_CDN}/images/oderDetailCallBack.png`
|
||||||
|
|
||||||
export const ENTITY_LABELS = {
|
export const ENTITY_LABELS = {
|
||||||
entityName: '标注名称',
|
entityName: '商户名称',
|
||||||
entityAddress: '标注地址',
|
entityAddress: '经营地址',
|
||||||
entityMapLocation: '地图位置',
|
entityMapLocation: '门店位置',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const COPY_ICON = `${CORP_ASSET_BASE}/images-mobile/icon-copy.png`
|
export const COPY_ICON = `${CORP_ASSET_BASE}/images-mobile/icon-copy.png`
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import {
|
||||||
formatMapCoordinate,
|
formatMapCoordinate,
|
||||||
formatMapCoordinateDisplay,
|
formatMapCoordinateDisplay,
|
||||||
getOrderAddressName,
|
getOrderAddressName,
|
||||||
|
getOrderDisplayName,
|
||||||
getOrderExtraImages,
|
getOrderExtraImages,
|
||||||
getOrderMapAddress,
|
getOrderMapAddress,
|
||||||
joinStorefrontSlots,
|
joinStorefrontSlots,
|
||||||
|
|
@ -17,6 +18,7 @@ import {
|
||||||
const mapOrder = {
|
const mapOrder = {
|
||||||
order_id: '4',
|
order_id: '4',
|
||||||
goods_type: 'map_label',
|
goods_type: 'map_label',
|
||||||
|
goods_name: '地图标注代办服务',
|
||||||
entity_name: '老店',
|
entity_name: '老店',
|
||||||
entity_phone: '13800138000',
|
entity_phone: '13800138000',
|
||||||
entity_extra: { keep: 1 },
|
entity_extra: { keep: 1 },
|
||||||
|
|
@ -30,6 +32,17 @@ const mapOrder = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
describe('order display name', () => {
|
||||||
|
it('uses neutral copy for map_label and keeps other product names', () => {
|
||||||
|
expect(getOrderDisplayName(mapOrder)).toBe('商户资料服务')
|
||||||
|
expect(getOrderDisplayName({
|
||||||
|
goods_type: 'license_year',
|
||||||
|
goods_name: '企业年报服务',
|
||||||
|
})).toBe('企业年报服务')
|
||||||
|
expect(getOrderDisplayName(null)).toBe('-')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('filterMapLabelOrders', () => {
|
describe('filterMapLabelOrders', () => {
|
||||||
it('keeps only map_label orders and parses goods_param', () => {
|
it('keeps only map_label orders and parses goods_param', () => {
|
||||||
const orders = filterMapLabelOrders([
|
const orders = filterMapLabelOrders([
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ export type UploadedImage = {
|
||||||
export type OrderLike = {
|
export type OrderLike = {
|
||||||
order_id?: string
|
order_id?: string
|
||||||
goods_type?: string
|
goods_type?: string
|
||||||
|
goods_name?: string
|
||||||
entity_name?: string
|
entity_name?: string
|
||||||
entity_phone?: string
|
entity_phone?: string
|
||||||
entity_extra?: Record<string, unknown>
|
entity_extra?: Record<string, unknown>
|
||||||
|
|
@ -141,6 +142,13 @@ export function normalizeOrders<T extends OrderLike> (orders: T[] = []) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const MAP_LABEL_DISPLAY_NAME = '商户资料服务'
|
||||||
|
|
||||||
|
export function getOrderDisplayName (order?: OrderLike | null) {
|
||||||
|
if (order?.goods_type === 'map_label') return MAP_LABEL_DISPLAY_NAME
|
||||||
|
return String(order?.goods_name || '').trim() || '-'
|
||||||
|
}
|
||||||
|
|
||||||
export function filterOrdersForProduct<T extends OrderLike> (goodsType: string, orders: T[] = []) {
|
export function filterOrdersForProduct<T extends OrderLike> (goodsType: string, orders: T[] = []) {
|
||||||
const normalized = normalizeOrders(orders)
|
const normalized = normalizeOrders(orders)
|
||||||
if (isCorpGoodsType(goodsType)) return normalized
|
if (isCorpGoodsType(goodsType)) return normalized
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { report, uploadImage } from '@/api/user'
|
||||||
import { LOCAL_IMAGES } from '@/lib/assets'
|
import { LOCAL_IMAGES } from '@/lib/assets'
|
||||||
import { buildFeedbackPayload, COMPLAINT_TYPES, type ComplaintType } from '@/lib/feedback'
|
import { buildFeedbackPayload, COMPLAINT_TYPES, type ComplaintType } from '@/lib/feedback'
|
||||||
import { getOrderDraft } from '@/lib/orderDraft'
|
import { getOrderDraft } from '@/lib/orderDraft'
|
||||||
import type { OrderLike, UploadedImage } from '@/lib/order'
|
import { getOrderDisplayName, type OrderLike, type UploadedImage } from '@/lib/order'
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|
||||||
const TYPE_ICONS: Record<ComplaintType, { idle: string, active: string }> = {
|
const TYPE_ICONS: Record<ComplaintType, { idle: string, active: string }> = {
|
||||||
|
|
@ -116,7 +116,7 @@ export default function ComplaintPage () {
|
||||||
<View className='complaint'>
|
<View className='complaint'>
|
||||||
<View className='complaint-hero'>
|
<View className='complaint-hero'>
|
||||||
<View className='complaint-hero__row'>
|
<View className='complaint-hero__row'>
|
||||||
<Text className='complaint-hero__name'>{order?.goods_name || '-'}</Text>
|
<Text className='complaint-hero__name'>{getOrderDisplayName(order)}</Text>
|
||||||
<Text className='complaint-hero__paid'>已支付 ¥{order?.total_fee || '-'}</Text>
|
<Text className='complaint-hero__paid'>已支付 ¥{order?.total_fee || '-'}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View className='complaint-hero__meta'>
|
<View className='complaint-hero__meta'>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import { isCorpGoodsType } from '@/lib/detail'
|
||||||
import { getNavMetrics } from '@/lib/nav'
|
import { getNavMetrics } from '@/lib/nav'
|
||||||
import { pickServiceContact, type ServiceContact } from '@/lib/contact'
|
import { pickServiceContact, type ServiceContact } from '@/lib/contact'
|
||||||
import { setOrderDraft } from '@/lib/orderDraft'
|
import { setOrderDraft } from '@/lib/orderDraft'
|
||||||
import { filterOrdersForProduct, type OrderLike } from '@/lib/order'
|
import { filterOrdersForProduct, getOrderDisplayName, type OrderLike } from '@/lib/order'
|
||||||
import { isValidPhone } from '@/lib/phone'
|
import { isValidPhone } from '@/lib/phone'
|
||||||
import { getSession } from '@/lib/session'
|
import { getSession } from '@/lib/session'
|
||||||
import {
|
import {
|
||||||
|
|
@ -201,7 +201,7 @@ function OrderCard ({
|
||||||
return (
|
return (
|
||||||
<View className='order-card'>
|
<View className='order-card'>
|
||||||
<View className='order-card__head'>
|
<View className='order-card__head'>
|
||||||
<Text className='order-card__goods-name'>{order.goods_name || '-'}</Text>
|
<Text className='order-card__goods-name'>{getOrderDisplayName(order)}</Text>
|
||||||
<View className='order-card__status' style={{ backgroundColor: status.bg }}>
|
<View className='order-card__status' style={{ backgroundColor: status.bg }}>
|
||||||
<Text className='order-card__status-text' style={{ color: status.color }}>{status.result}</Text>
|
<Text className='order-card__status-text' style={{ color: status.color }}>{status.result}</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ export default function MapPage () {
|
||||||
Taro.navigateBack()
|
Taro.navigateBack()
|
||||||
}
|
}
|
||||||
|
|
||||||
const placeText = selected.name || selected.address || (resolving ? '正在识别位置…' : '滑动地图选择位置')
|
const placeText = selected.name || selected.address || (resolving ? '正在识别位置…' : '滑动选择位置')
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className='map-page'>
|
<View className='map-page'>
|
||||||
|
|
@ -176,7 +176,7 @@ export default function MapPage () {
|
||||||
<View className='map-page__pin' />
|
<View className='map-page__pin' />
|
||||||
|
|
||||||
<View className='map-page__search' onClick={handleSearch}>
|
<View className='map-page__search' onClick={handleSearch}>
|
||||||
<Text className='map-page__search-text'>{placeText === '滑动地图选择位置' ? '搜索地点' : placeText}</Text>
|
<Text className='map-page__search-text'>{placeText === '滑动选择位置' ? '搜索地点' : placeText}</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View className='map-page__locate' onClick={() => void locateCurrent()}>
|
<View className='map-page__locate' onClick={() => void locateCurrent()}>
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ const STOREFRONT_EXAMPLES = [
|
||||||
]
|
]
|
||||||
|
|
||||||
const DISCLAIMER_BODY =
|
const DISCLAIMER_BODY =
|
||||||
'我们只是代客户提交商户、企业位置资料,不是地图标注平台方,所提供服务为商业有偿帮助咨询服务,全程都是人工提交资料,自身并不能对第三方网站的原始内容进行编辑,请知悉。'
|
'我们仅代客户提交商户、企业位置资料,所提供服务为商业有偿咨询及资料提交服务,全程由工作人员处理,不代表任何第三方机构,也不能编辑第三方网站的原始内容,请知悉。'
|
||||||
|
|
||||||
function FieldLabel ({ icon, text, required }: { icon: string, text: string, required?: boolean }) {
|
function FieldLabel ({ icon, text, required }: { icon: string, text: string, required?: boolean }) {
|
||||||
return (
|
return (
|
||||||
|
|
@ -275,17 +275,17 @@ export default function ResubmitPage () {
|
||||||
<FieldLabel icon={`${HOME_ICON_BASE}/icon_form_marker@2x.png`} text={ENTITY_LABELS.entityName} required />
|
<FieldLabel icon={`${HOME_ICON_BASE}/icon_form_marker@2x.png`} text={ENTITY_LABELS.entityName} required />
|
||||||
<ClearInput
|
<ClearInput
|
||||||
value={values.entity_name}
|
value={values.entity_name}
|
||||||
placeholder='请输入标注名称'
|
placeholder='请输入商户名称'
|
||||||
onChange={(value) => updateField('entity_name', value)}
|
onChange={(value) => updateField('entity_name', value)}
|
||||||
/>
|
/>
|
||||||
<Text className='resubmit__hint'>请确保您的标注名称与门头照片店名一致</Text>
|
<Text className='resubmit__hint'>请确保商户名称与门头照片店名一致</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View className='resubmit__field'>
|
<View className='resubmit__field'>
|
||||||
<FieldLabel icon={`${HOME_ICON_BASE}/icon_form_location@2x.png`} text={ENTITY_LABELS.entityAddress} />
|
<FieldLabel icon={`${HOME_ICON_BASE}/icon_form_location@2x.png`} text={ENTITY_LABELS.entityAddress} />
|
||||||
<View className='resubmit__control resubmit__control--nav' onClick={handleChooseMap}>
|
<View className='resubmit__control resubmit__control--nav' onClick={handleChooseMap}>
|
||||||
<Text className={values.entity_address_name ? 'resubmit__control-value' : 'resubmit__placeholder'}>
|
<Text className={values.entity_address_name ? 'resubmit__control-value' : 'resubmit__placeholder'}>
|
||||||
{values.entity_address_name || '请选择标注地址'}
|
{values.entity_address_name || '请选择经营地址'}
|
||||||
</Text>
|
</Text>
|
||||||
<Image className='resubmit__arrow' src={INPUT_ARROW_ICON} />
|
<Image className='resubmit__arrow' src={INPUT_ARROW_ICON} />
|
||||||
</View>
|
</View>
|
||||||
|
|
@ -295,7 +295,7 @@ export default function ResubmitPage () {
|
||||||
<FieldLabel icon={`${HOME_ICON_BASE}/icon_form_location_lnglat@2x.png`} text={ENTITY_LABELS.entityMapLocation} />
|
<FieldLabel icon={`${HOME_ICON_BASE}/icon_form_location_lnglat@2x.png`} text={ENTITY_LABELS.entityMapLocation} />
|
||||||
<View className='resubmit__control resubmit__control--nav' onClick={handleChooseMap}>
|
<View className='resubmit__control resubmit__control--nav' onClick={handleChooseMap}>
|
||||||
<Text className={mapDisplay ? 'resubmit__control-value' : 'resubmit__placeholder'}>
|
<Text className={mapDisplay ? 'resubmit__control-value' : 'resubmit__placeholder'}>
|
||||||
{mapDisplay || '请选择地图位置'}
|
{mapDisplay || '请选择门店位置'}
|
||||||
</Text>
|
</Text>
|
||||||
<Image className='resubmit__arrow' src={INPUT_ARROW_ICON} />
|
<Image className='resubmit__arrow' src={INPUT_ARROW_ICON} />
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue