This commit is contained in:
parent
b61382401f
commit
a2c8205dfe
|
|
@ -7,4 +7,5 @@ node_modules/
|
||||||
.swc
|
.swc
|
||||||
*.local
|
*.local
|
||||||
.env
|
.env
|
||||||
design/
|
design/
|
||||||
|
TODO.md
|
||||||
|
|
|
||||||
|
|
@ -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 RECEIPT_STAMP_PENDING = `${STATIC_CDN}/images/oderDetailCallBack.png`
|
||||||
|
|
||||||
export const ENTITY_LABELS = {
|
export const ENTITY_LABELS = {
|
||||||
entityName: '商户名称',
|
entityName: '门店名称',
|
||||||
entityAddress: '经营地址',
|
entityAddress: '门店地址',
|
||||||
entityMapLocation: '门店位置',
|
entityMapLocation: '门店位置',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -227,12 +227,6 @@
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-card__pay-icon {
|
|
||||||
width: 36px;
|
|
||||||
height: 36px;
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.order-card__fee {
|
.order-card__fee {
|
||||||
color: #f53f3f;
|
color: #f53f3f;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ import {
|
||||||
getOrderCardActions,
|
getOrderCardActions,
|
||||||
getStatusMeta,
|
getStatusMeta,
|
||||||
ORDER_TABS,
|
ORDER_TABS,
|
||||||
PAY_ICON,
|
|
||||||
type OrderTabKey,
|
type OrderTabKey,
|
||||||
} from '@/lib/status'
|
} from '@/lib/status'
|
||||||
import ContactModal, { ContactFab } from './contact'
|
import ContactModal, { ContactFab } from './contact'
|
||||||
|
|
@ -150,11 +149,11 @@ export default function Index () {
|
||||||
<View className='home-list'>
|
<View className='home-list'>
|
||||||
{visibleOrders.map((order, index) => (
|
{visibleOrders.map((order, index) => (
|
||||||
<OrderCard
|
<OrderCard
|
||||||
key={order.order_id || order.out_trade_no || index}
|
key={order.order_id || order.transaction_id || index}
|
||||||
order={order}
|
order={order}
|
||||||
onCopy={() => {
|
onCopy={() => {
|
||||||
if (!order.out_trade_no) return
|
if (!order.transaction_id) return
|
||||||
Taro.setClipboardData({ data: String(order.out_trade_no) })
|
Taro.setClipboardData({ data: String(order.transaction_id) })
|
||||||
}}
|
}}
|
||||||
onViewDetail={() => setDetailOrder(order)}
|
onViewDetail={() => setDetailOrder(order)}
|
||||||
onResubmit={() => openOrderPage('/pages/resubmit/index', order)}
|
onResubmit={() => openOrderPage('/pages/resubmit/index', order)}
|
||||||
|
|
@ -199,7 +198,6 @@ function OrderCard ({
|
||||||
}) {
|
}) {
|
||||||
const status = getStatusMeta(order.process_status, order.process_status_name)
|
const status = getStatusMeta(order.process_status, order.process_status_name)
|
||||||
const actions = getOrderCardActions(order)
|
const actions = getOrderCardActions(order)
|
||||||
const payIcon = PAY_ICON[order.pay_type]
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className='order-card'>
|
<View className='order-card'>
|
||||||
|
|
@ -210,20 +208,19 @@ function OrderCard ({
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<InfoLine label='联系电话:' value={order.entity_phone || '-'} />
|
<InfoLine label='门店电话:' value={order.entity_phone || '-'} />
|
||||||
<InfoLine label='订单时间:' value={order.create_time || order.pay_time || '-'} />
|
<InfoLine label='订单时间:' value={order.create_time || order.pay_time || '-'} />
|
||||||
|
|
||||||
<View className='order-card__row'>
|
<View className='order-card__row'>
|
||||||
<Text className='order-card__label'>订单ID:</Text>
|
<Text className='order-card__label'>交易单号:</Text>
|
||||||
<Text className='order-card__value order-card__value--id'>{order.out_trade_no || '-'}</Text>
|
<Text className='order-card__value order-card__value--id'>{order.transaction_id || '-'}</Text>
|
||||||
{order.out_trade_no ? (
|
{order.transaction_id ? (
|
||||||
<Image className='order-card__copy' src={COPY_ICON} onClick={onCopy} />
|
<Image className='order-card__copy' src={COPY_ICON} onClick={onCopy} />
|
||||||
) : null}
|
) : null}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View className='order-card__row'>
|
<View className='order-card__row'>
|
||||||
<Text className='order-card__label'>支付方式:</Text>
|
<Text className='order-card__label'>订单金额:</Text>
|
||||||
{payIcon ? <Image className='order-card__pay-icon' src={payIcon} /> : null}
|
|
||||||
<Text className='order-card__fee'>¥{order.total_fee || '-'}</Text>
|
<Text className='order-card__fee'>¥{order.total_fee || '-'}</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,10 @@
|
||||||
right: 24px;
|
right: 24px;
|
||||||
bottom: 360px;
|
bottom: 360px;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
box-sizing: border-box;
|
||||||
width: 96px;
|
width: 96px;
|
||||||
height: 96px;
|
height: 96px;
|
||||||
|
padding: 0 12px;
|
||||||
border-radius: 48px;
|
border-radius: 48px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
||||||
|
|
@ -68,6 +70,23 @@
|
||||||
font-size: 24px;
|
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 {
|
.map-page__panel {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import './index.scss'
|
||||||
|
|
||||||
const DEFAULT_CENTER = { lng: 116.397428, lat: 39.90923 }
|
const DEFAULT_CENTER = { lng: 116.397428, lat: 39.90923 }
|
||||||
const MAP_ID = 'picker-map'
|
const MAP_ID = 'picker-map'
|
||||||
|
const LOCATION_ACCURACY_RADIUS_METERS = 100
|
||||||
|
|
||||||
function asNumber (value?: string) {
|
function asNumber (value?: string) {
|
||||||
const next = Number(value)
|
const next = Number(value)
|
||||||
|
|
@ -36,6 +37,7 @@ export default function MapPage () {
|
||||||
const [center, setCenter] = useState(DEFAULT_CENTER)
|
const [center, setCenter] = useState(DEFAULT_CENTER)
|
||||||
const [selected, setSelected] = useState<MapPickerResult>(DEFAULT_CENTER)
|
const [selected, setSelected] = useState<MapPickerResult>(DEFAULT_CENTER)
|
||||||
const [locating, setLocating] = useState(false)
|
const [locating, setLocating] = useState(false)
|
||||||
|
const [locatedCenter, setLocatedCenter] = useState<{ lng: number, lat: number } | null>(null)
|
||||||
const [resolving, setResolving] = useState(false)
|
const [resolving, setResolving] = useState(false)
|
||||||
const geocodeSeq = useRef(0)
|
const geocodeSeq = useRef(0)
|
||||||
|
|
||||||
|
|
@ -85,6 +87,9 @@ export default function MapPage () {
|
||||||
try {
|
try {
|
||||||
const location = await Taro.getLocation({ type: 'gcj02' })
|
const location = await Taro.getLocation({ type: 'gcj02' })
|
||||||
applyCenter(location.longitude, location.latitude, true)
|
applyCenter(location.longitude, location.latitude, true)
|
||||||
|
if (!silent) {
|
||||||
|
setLocatedCenter({ lng: location.longitude, lat: location.latitude })
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
if (!silent) {
|
if (!silent) {
|
||||||
Taro.showToast({ title: '定位失败,请检查定位权限', icon: 'none' })
|
Taro.showToast({ title: '定位失败,请检查定位权限', icon: 'none' })
|
||||||
|
|
@ -158,6 +163,14 @@ export default function MapPage () {
|
||||||
scale={16}
|
scale={16}
|
||||||
showLocation
|
showLocation
|
||||||
enablePoi
|
enablePoi
|
||||||
|
circles={locatedCenter ? [{
|
||||||
|
longitude: locatedCenter.lng,
|
||||||
|
latitude: locatedCenter.lat,
|
||||||
|
radius: LOCATION_ACCURACY_RADIUS_METERS,
|
||||||
|
color: '#0261FCE6',
|
||||||
|
fillColor: '#7AB5FF33',
|
||||||
|
strokeWidth: 1,
|
||||||
|
}] : []}
|
||||||
onError={() => undefined}
|
onError={() => undefined}
|
||||||
onRegionChange={handleRegionChange}
|
onRegionChange={handleRegionChange}
|
||||||
onPoiTap={(event) => {
|
onPoiTap={(event) => {
|
||||||
|
|
@ -179,8 +192,17 @@ export default function MapPage () {
|
||||||
<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
|
||||||
<Text>{locating ? '定位中' : '定位'}</Text>
|
className={`map-page__locate${locatedCenter ? ' map-page__locate--active' : ''}`}
|
||||||
|
onClick={() => void locateCurrent()}
|
||||||
|
>
|
||||||
|
<Text className='map-page__locate-text'>
|
||||||
|
{locating
|
||||||
|
? '定位中'
|
||||||
|
: locatedCenter
|
||||||
|
? '已定位到您当前位置范围,请点击地图精确标点'
|
||||||
|
: '定位'}
|
||||||
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View className='map-page__panel'>
|
<View className='map-page__panel'>
|
||||||
|
|
|
||||||
|
|
@ -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 (
|
||||||
|
|
@ -230,11 +230,11 @@ export default function ResubmitPage () {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!isValidPhone(values.entity_phone || '')) {
|
if (!isValidPhone(values.entity_phone || '')) {
|
||||||
Taro.showToast({ title: '请填写正确的联系电话1', icon: 'none' })
|
Taro.showToast({ title: '请填写正确的门店电话', icon: 'none' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!isValidPhone(values.entity_phone2 || '')) {
|
if (!isValidPhone(values.entity_phone2 || '')) {
|
||||||
Taro.showToast({ title: '请填写正确的联系电话2', icon: 'none' })
|
Taro.showToast({ title: '请填写正确的办理人电话', icon: 'none' })
|
||||||
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>
|
||||||
|
|
@ -302,7 +302,7 @@ export default function ResubmitPage () {
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View className='resubmit__field'>
|
<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
|
<ClearInput
|
||||||
type='number'
|
type='number'
|
||||||
maxlength={12}
|
maxlength={12}
|
||||||
|
|
@ -313,7 +313,7 @@ export default function ResubmitPage () {
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View className='resubmit__field'>
|
<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
|
<ClearInput
|
||||||
type='number'
|
type='number'
|
||||||
maxlength={12}
|
maxlength={12}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue