This commit is contained in:
zhangjianjun 2026-08-26 17:50:23 +08:00
parent b61382401f
commit a2c8205dfe
7 changed files with 63 additions and 30 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ node_modules/
*.local
.env
design/
TODO.md

View File

@ -10,8 +10,8 @@ export const RECEIPT_STAMP_DONE = `${STATIC_CDN}/images/oderDetailCallBackSucces
export const RECEIPT_STAMP_PENDING = `${STATIC_CDN}/images/oderDetailCallBack.png`
export const ENTITY_LABELS = {
entityName: '商户名称',
entityAddress: '经营地址',
entityName: '门店名称',
entityAddress: '门店地址',
entityMapLocation: '门店位置',
}

View File

@ -227,12 +227,6 @@
margin-left: 12px;
}
.order-card__pay-icon {
width: 36px;
height: 36px;
margin-right: 8px;
}
.order-card__fee {
color: #f53f3f;
font-size: 28px;

View File

@ -17,7 +17,6 @@ import {
getOrderCardActions,
getStatusMeta,
ORDER_TABS,
PAY_ICON,
type OrderTabKey,
} from '@/lib/status'
import ContactModal, { ContactFab } from './contact'
@ -150,11 +149,11 @@ export default function Index () {
<View className='home-list'>
{visibleOrders.map((order, index) => (
<OrderCard
key={order.order_id || order.out_trade_no || index}
key={order.order_id || order.transaction_id || index}
order={order}
onCopy={() => {
if (!order.out_trade_no) return
Taro.setClipboardData({ data: String(order.out_trade_no) })
if (!order.transaction_id) return
Taro.setClipboardData({ data: String(order.transaction_id) })
}}
onViewDetail={() => setDetailOrder(order)}
onResubmit={() => openOrderPage('/pages/resubmit/index', order)}
@ -199,7 +198,6 @@ function OrderCard ({
}) {
const status = getStatusMeta(order.process_status, order.process_status_name)
const actions = getOrderCardActions(order)
const payIcon = PAY_ICON[order.pay_type]
return (
<View className='order-card'>
@ -210,20 +208,19 @@ function OrderCard ({
</View>
</View>
<InfoLine label='联系电话:' value={order.entity_phone || '-'} />
<InfoLine label='门店电话:' value={order.entity_phone || '-'} />
<InfoLine label='订单时间:' value={order.create_time || order.pay_time || '-'} />
<View className='order-card__row'>
<Text className='order-card__label'>ID</Text>
<Text className='order-card__value order-card__value--id'>{order.out_trade_no || '-'}</Text>
{order.out_trade_no ? (
<Text className='order-card__label'></Text>
<Text className='order-card__value order-card__value--id'>{order.transaction_id || '-'}</Text>
{order.transaction_id ? (
<Image className='order-card__copy' src={COPY_ICON} onClick={onCopy} />
) : null}
</View>
<View className='order-card__row'>
<Text className='order-card__label'></Text>
{payIcon ? <Image className='order-card__pay-icon' src={payIcon} /> : null}
<Text className='order-card__label'></Text>
<Text className='order-card__fee'>{order.total_fee || '-'}</Text>
</View>

View File

@ -56,8 +56,10 @@
right: 24px;
bottom: 360px;
z-index: 2;
box-sizing: border-box;
width: 96px;
height: 96px;
padding: 0 12px;
border-radius: 48px;
background: #fff;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
@ -68,6 +70,23 @@
font-size: 24px;
}
.map-page__locate--active {
width: 620px;
max-width: calc(100% - 48px);
height: 80px;
padding: 0 24px;
border-radius: 8px;
color: #ff2020;
font-size: 24px;
}
.map-page__locate-text {
overflow: hidden;
max-width: 100%;
white-space: nowrap;
text-overflow: ellipsis;
}
.map-page__panel {
position: absolute;
right: 0;

View File

@ -13,6 +13,7 @@ import './index.scss'
const DEFAULT_CENTER = { lng: 116.397428, lat: 39.90923 }
const MAP_ID = 'picker-map'
const LOCATION_ACCURACY_RADIUS_METERS = 100
function asNumber (value?: string) {
const next = Number(value)
@ -36,6 +37,7 @@ export default function MapPage () {
const [center, setCenter] = useState(DEFAULT_CENTER)
const [selected, setSelected] = useState<MapPickerResult>(DEFAULT_CENTER)
const [locating, setLocating] = useState(false)
const [locatedCenter, setLocatedCenter] = useState<{ lng: number, lat: number } | null>(null)
const [resolving, setResolving] = useState(false)
const geocodeSeq = useRef(0)
@ -85,6 +87,9 @@ export default function MapPage () {
try {
const location = await Taro.getLocation({ type: 'gcj02' })
applyCenter(location.longitude, location.latitude, true)
if (!silent) {
setLocatedCenter({ lng: location.longitude, lat: location.latitude })
}
} catch {
if (!silent) {
Taro.showToast({ title: '定位失败,请检查定位权限', icon: 'none' })
@ -158,6 +163,14 @@ export default function MapPage () {
scale={16}
showLocation
enablePoi
circles={locatedCenter ? [{
longitude: locatedCenter.lng,
latitude: locatedCenter.lat,
radius: LOCATION_ACCURACY_RADIUS_METERS,
color: '#0261FCE6',
fillColor: '#7AB5FF33',
strokeWidth: 1,
}] : []}
onError={() => undefined}
onRegionChange={handleRegionChange}
onPoiTap={(event) => {
@ -179,8 +192,17 @@ export default function MapPage () {
<Text className='map-page__search-text'>{placeText === '滑动选择位置' ? '搜索地点' : placeText}</Text>
</View>
<View className='map-page__locate' onClick={() => void locateCurrent()}>
<Text>{locating ? '定位中' : '定位'}</Text>
<View
className={`map-page__locate${locatedCenter ? ' map-page__locate--active' : ''}`}
onClick={() => void locateCurrent()}
>
<Text className='map-page__locate-text'>
{locating
? '定位中'
: locatedCenter
? '已定位到您当前位置范围,请点击地图精确标点'
: '定位'}
</Text>
</View>
<View className='map-page__panel'>

View File

@ -35,7 +35,7 @@ const STOREFRONT_EXAMPLES = [
]
const DISCLAIMER_BODY =
'我们仅代客户提交商户、企业位置资料,所提供服务为商业有偿咨询及资料提交服务,全程由工作人员处理,不代表任何第三方机构,也不能编辑第三方网站的原始内容,请知悉。'
'提交信息后,平台将进行审核。审核通过后,您的商户信息将在地图上展示,并同步生成专属详情页面。海量用户可通过地图搜索并快速找到您的位置,进一步提升品牌曝光与到店流量。'
function FieldLabel ({ icon, text, required }: { icon: string, text: string, required?: boolean }) {
return (
@ -230,11 +230,11 @@ export default function ResubmitPage () {
return
}
if (!isValidPhone(values.entity_phone || '')) {
Taro.showToast({ title: '请填写正确的联系电话1', icon: 'none' })
Taro.showToast({ title: '请填写正确的门店电话', icon: 'none' })
return
}
if (!isValidPhone(values.entity_phone2 || '')) {
Taro.showToast({ title: '请填写正确的联系电话2', icon: 'none' })
Taro.showToast({ title: '请填写正确的办理人电话', icon: 'none' })
return
}
@ -275,17 +275,17 @@ export default function ResubmitPage () {
<FieldLabel icon={`${HOME_ICON_BASE}/icon_form_marker@2x.png`} text={ENTITY_LABELS.entityName} required />
<ClearInput
value={values.entity_name}
placeholder='请输入商户名称'
placeholder='请输入门店名称'
onChange={(value) => updateField('entity_name', value)}
/>
<Text className='resubmit__hint'></Text>
<Text className='resubmit__hint'></Text>
</View>
<View className='resubmit__field'>
<FieldLabel icon={`${HOME_ICON_BASE}/icon_form_location@2x.png`} text={ENTITY_LABELS.entityAddress} />
<View className='resubmit__control resubmit__control--nav' onClick={handleChooseMap}>
<Text className={values.entity_address_name ? 'resubmit__control-value' : 'resubmit__placeholder'}>
{values.entity_address_name || '请选择经营地址'}
{values.entity_address_name || '请选择门店地址'}
</Text>
<Image className='resubmit__arrow' src={INPUT_ARROW_ICON} />
</View>
@ -302,7 +302,7 @@ export default function ResubmitPage () {
</View>
<View className='resubmit__field'>
<FieldLabel icon={`${HOME_ICON_BASE}/icon_form_phone@2x.png`} text='联系电话1' required />
<FieldLabel icon={`${HOME_ICON_BASE}/icon_form_phone@2x.png`} text='门店电话' required />
<ClearInput
type='number'
maxlength={12}
@ -313,7 +313,7 @@ export default function ResubmitPage () {
</View>
<View className='resubmit__field'>
<FieldLabel icon={`${HOME_ICON_BASE}/icon_form_phone@2x.png`} text='联系电话2' required />
<FieldLabel icon={`${HOME_ICON_BASE}/icon_form_phone@2x.png`} text='办理人电话' required />
<ClearInput
type='number'
maxlength={12}