业务更名为撞车并切换crash路由
用户可见文案与页面/API路径改为撞车与crash,保留mohong表与权限码兼容;移动端入口去掉租/撞图标。
This commit is contained in:
@@ -96,7 +96,7 @@ async function handleDelete(item: MohongCategory) {
|
||||
<div class="admin-page">
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h2>摸大红分类</h2>
|
||||
<h2>撞车分类</h2>
|
||||
<p>大红 / 四格大红 / 炫彩等分类,前台左侧筛选使用</p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
|
||||
@@ -49,7 +49,7 @@ async function handleSave() {
|
||||
|
||||
async function uploadQrcode(file: File) {
|
||||
try {
|
||||
const uploaded = await uploadAdminFile(file, 'mohong')
|
||||
const uploaded = await uploadAdminFile(file, 'crash')
|
||||
form.default_qrcode_url = uploaded.url
|
||||
ElMessage.success('上传成功')
|
||||
} catch (error) {
|
||||
@@ -63,7 +63,7 @@ async function uploadQrcode(file: File) {
|
||||
<div v-loading="loading" class="admin-page">
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h2>摸大红配置</h2>
|
||||
<h2>撞车配置</h2>
|
||||
<p>全局默认固定二维码与订单复制模板。商品可覆盖默认二维码;支付后用户在订单详情扫码并复制信息联系客服。</p>
|
||||
</div>
|
||||
<el-button type="primary" :loading="saving" @click="handleSave">保存配置</el-button>
|
||||
|
||||
@@ -85,7 +85,7 @@ async function copyText(text: string) {
|
||||
<div class="admin-page">
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h2>摸大红订单</h2>
|
||||
<h2>撞车订单</h2>
|
||||
<p>查看订单、完成履约、复制用户订单信息</p>
|
||||
</div>
|
||||
<el-button :icon="Refresh" @click="load">刷新</el-button>
|
||||
|
||||
@@ -177,7 +177,7 @@ async function handleDelete(item: MohongProduct) {
|
||||
|
||||
async function uploadImage(file: File, target: 'cover' | 'gallery' | 'qrcode') {
|
||||
try {
|
||||
const uploaded = await uploadAdminFile(file, 'mohong')
|
||||
const uploaded = await uploadAdminFile(file, 'crash')
|
||||
if (target === 'cover') form.cover_url = uploaded.url
|
||||
else if (target === 'qrcode') form.qrcode_image_url = uploaded.url
|
||||
else form.image_urls.push(uploaded.url)
|
||||
@@ -197,7 +197,7 @@ function removeGallery(url: string) {
|
||||
<div class="admin-page">
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h2>摸大红商品</h2>
|
||||
<h2>撞车商品</h2>
|
||||
<p>管理商品图片、价格、库存与专属二维码</p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
|
||||
@@ -14,7 +14,7 @@ export interface ChatParticipant {
|
||||
joined_at: string
|
||||
}
|
||||
|
||||
export type SupportScene = 'general' | 'mohong'
|
||||
export type SupportScene = 'general' | 'crash'
|
||||
|
||||
export interface ChatConversation {
|
||||
id: number
|
||||
@@ -42,15 +42,19 @@ export interface ChatConversation {
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
/** 根据当前路由推断客服场景:摸大红页 → mohong,其它 → general */
|
||||
/** 根据当前路由推断客服场景:撞车页 → crash,其它 → general */
|
||||
export function resolveSupportScene(path: string): SupportScene {
|
||||
if (
|
||||
path === '/crash' ||
|
||||
path.startsWith('/crash/') ||
|
||||
path === '/m/crash' ||
|
||||
path.startsWith('/m/crash/') ||
|
||||
path === '/mohong' ||
|
||||
path.startsWith('/mohong/') ||
|
||||
path === '/m/mohong' ||
|
||||
path.startsWith('/m/mohong/')
|
||||
) {
|
||||
return 'mohong'
|
||||
return 'crash'
|
||||
}
|
||||
return 'general'
|
||||
}
|
||||
|
||||
@@ -260,8 +260,8 @@ loadHome()
|
||||
<strong>租号大厅</strong>
|
||||
<small>高哈夫币 · 安全交接 · 随租随玩</small>
|
||||
</RouterLink>
|
||||
<RouterLink class="biz-entry mohong" to="/mohong">
|
||||
<strong>摸大红 <em>NEW</em></strong>
|
||||
<RouterLink class="biz-entry crash" to="/crash">
|
||||
<strong>撞车 <em>NEW</em></strong>
|
||||
<small>选购商品 · 支付后进群联系客服</small>
|
||||
</RouterLink>
|
||||
</div>
|
||||
@@ -372,7 +372,7 @@ loadHome()
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.biz-entry.mohong strong em {
|
||||
.biz-entry.crash strong em {
|
||||
margin-left: 6px;
|
||||
padding: 1px 6px;
|
||||
border-radius: 999px;
|
||||
|
||||
@@ -364,28 +364,6 @@
|
||||
box-shadow: 0 4px 14px rgba(23, 35, 61, 0.04);
|
||||
}
|
||||
|
||||
.biz-entry-icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 9px;
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.biz-entry-icon.rental {
|
||||
background: #fff1e6;
|
||||
color: #ff6a00;
|
||||
}
|
||||
|
||||
.biz-entry-icon.mohong {
|
||||
background: #fee2e2;
|
||||
color: #dc2626;
|
||||
}
|
||||
|
||||
.biz-entry strong {
|
||||
color: #17233d;
|
||||
font-size: 15px;
|
||||
|
||||
@@ -818,13 +818,11 @@ syncMobileHomeQuery()
|
||||
|
||||
<div class="biz-entry-grid" aria-label="业务入口">
|
||||
<RouterLink class="biz-entry" to="/">
|
||||
<span class="biz-entry-icon rental">租</span>
|
||||
<strong>租号大厅</strong>
|
||||
<small>高哈夫币 · 随租随玩</small>
|
||||
</RouterLink>
|
||||
<RouterLink class="biz-entry" to="/mohong">
|
||||
<span class="biz-entry-icon mohong">红</span>
|
||||
<strong>摸大红</strong>
|
||||
<RouterLink class="biz-entry" to="/crash">
|
||||
<strong>撞车</strong>
|
||||
<small>选购商品 · 一键找客服</small>
|
||||
<em class="biz-entry-badge">NEW</em>
|
||||
</RouterLink>
|
||||
|
||||
@@ -92,7 +92,7 @@ export interface Paginated<T> {
|
||||
}
|
||||
|
||||
export async function fetchMohongCategories() {
|
||||
const { data } = await apiClient.get<ApiResponse<MohongCategory[]>>('/mohong/categories')
|
||||
const { data } = await apiClient.get<ApiResponse<MohongCategory[]>>('/crash/categories')
|
||||
return data.data || []
|
||||
}
|
||||
|
||||
@@ -102,14 +102,14 @@ export async function fetchMohongProducts(params?: {
|
||||
page?: number
|
||||
page_size?: number
|
||||
}) {
|
||||
const { data } = await apiClient.get<ApiResponse<Paginated<MohongProduct>>>('/mohong/products', {
|
||||
const { data } = await apiClient.get<ApiResponse<Paginated<MohongProduct>>>('/crash/products', {
|
||||
params,
|
||||
})
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function fetchMohongProduct(id: number | string) {
|
||||
const { data } = await apiClient.get<ApiResponse<MohongProduct>>(`/mohong/products/${id}`)
|
||||
const { data } = await apiClient.get<ApiResponse<MohongProduct>>(`/crash/products/${id}`)
|
||||
return data.data
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ export async function createMohongOrder(
|
||||
const payload = Array.isArray(productIdOrItems)
|
||||
? { items: productIdOrItems }
|
||||
: { product_id: productIdOrItems, quantity }
|
||||
const { data } = await apiClient.post<ApiResponse<MohongOrder>>('/mohong/orders', payload)
|
||||
const { data } = await apiClient.post<ApiResponse<MohongOrder>>('/crash/orders', payload)
|
||||
return data.data
|
||||
}
|
||||
|
||||
@@ -130,19 +130,19 @@ export async function fetchMyMohongOrders(params?: {
|
||||
page?: number
|
||||
page_size?: number
|
||||
}) {
|
||||
const { data } = await apiClient.get<ApiResponse<Paginated<MohongOrder>>>('/mohong/orders', {
|
||||
const { data } = await apiClient.get<ApiResponse<Paginated<MohongOrder>>>('/crash/orders', {
|
||||
params,
|
||||
})
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function fetchMyMohongOrder(id: number | string) {
|
||||
const { data } = await apiClient.get<ApiResponse<MohongOrder>>(`/mohong/orders/${id}`)
|
||||
const { data } = await apiClient.get<ApiResponse<MohongOrder>>(`/crash/orders/${id}`)
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function cancelMyMohongOrder(id: number | string, reason?: string) {
|
||||
const { data } = await apiClient.post<ApiResponse<MohongOrder>>(`/mohong/orders/${id}/cancel`, {
|
||||
const { data } = await apiClient.post<ApiResponse<MohongOrder>>(`/crash/orders/${id}/cancel`, {
|
||||
reason: reason || '',
|
||||
})
|
||||
return data.data
|
||||
@@ -154,7 +154,7 @@ export async function startMohongPayment(
|
||||
jsPayFlag?: string
|
||||
) {
|
||||
const { data } = await apiClient.post<ApiResponse<PaymentOrder>>(
|
||||
`/mohong/orders/${orderId}/start-payment`,
|
||||
`/crash/orders/${orderId}/start-payment`,
|
||||
{
|
||||
pay_way: payWay || 'ZFBZF',
|
||||
jspay_flag: jsPayFlag || '',
|
||||
@@ -165,14 +165,14 @@ export async function startMohongPayment(
|
||||
|
||||
export async function queryMohongPayment(orderId: number) {
|
||||
const { data } = await apiClient.get<ApiResponse<PaymentOrder>>(
|
||||
`/mohong/orders/${orderId}/query-payment`
|
||||
`/crash/orders/${orderId}/query-payment`
|
||||
)
|
||||
return data.data
|
||||
}
|
||||
|
||||
// Admin APIs
|
||||
export async function fetchAdminMohongCategories() {
|
||||
const { data } = await apiClient.get<ApiResponse<MohongCategory[]>>('/admin/mohong/categories')
|
||||
const { data } = await apiClient.get<ApiResponse<MohongCategory[]>>('/admin/crash/categories')
|
||||
return data.data || []
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ export async function createAdminMohongCategory(payload: {
|
||||
status?: string
|
||||
}) {
|
||||
const { data } = await apiClient.post<ApiResponse<MohongCategory>>(
|
||||
'/admin/mohong/categories',
|
||||
'/admin/crash/categories',
|
||||
payload
|
||||
)
|
||||
return data.data
|
||||
@@ -194,7 +194,7 @@ export async function updateAdminMohongCategory(
|
||||
payload: Partial<{ name: string; code: string; sort_order: number; status: string }>
|
||||
) {
|
||||
const { data } = await apiClient.put<ApiResponse<MohongCategory>>(
|
||||
`/admin/mohong/categories/${id}`,
|
||||
`/admin/crash/categories/${id}`,
|
||||
payload
|
||||
)
|
||||
return data.data
|
||||
@@ -202,7 +202,7 @@ export async function updateAdminMohongCategory(
|
||||
|
||||
export async function deleteAdminMohongCategory(id: number) {
|
||||
const { data } = await apiClient.delete<ApiResponse<{ message: string }>>(
|
||||
`/admin/mohong/categories/${id}`
|
||||
`/admin/crash/categories/${id}`
|
||||
)
|
||||
return data.data
|
||||
}
|
||||
@@ -215,25 +215,25 @@ export async function fetchAdminMohongProducts(params?: {
|
||||
page_size?: number
|
||||
}) {
|
||||
const { data } = await apiClient.get<ApiResponse<Paginated<MohongProduct>>>(
|
||||
'/admin/mohong/products',
|
||||
'/admin/crash/products',
|
||||
{ params }
|
||||
)
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function fetchAdminMohongProduct(id: number | string) {
|
||||
const { data } = await apiClient.get<ApiResponse<MohongProduct>>(`/admin/mohong/products/${id}`)
|
||||
const { data } = await apiClient.get<ApiResponse<MohongProduct>>(`/admin/crash/products/${id}`)
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function createAdminMohongProduct(payload: Partial<MohongProduct> & { title: string; price_cent: number }) {
|
||||
const { data } = await apiClient.post<ApiResponse<MohongProduct>>('/admin/mohong/products', payload)
|
||||
const { data } = await apiClient.post<ApiResponse<MohongProduct>>('/admin/crash/products', payload)
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function updateAdminMohongProduct(id: number, payload: Record<string, unknown>) {
|
||||
const { data } = await apiClient.put<ApiResponse<MohongProduct>>(
|
||||
`/admin/mohong/products/${id}`,
|
||||
`/admin/crash/products/${id}`,
|
||||
payload
|
||||
)
|
||||
return data.data
|
||||
@@ -241,7 +241,7 @@ export async function updateAdminMohongProduct(id: number, payload: Record<strin
|
||||
|
||||
export async function deleteAdminMohongProduct(id: number) {
|
||||
const { data } = await apiClient.delete<ApiResponse<{ message: string }>>(
|
||||
`/admin/mohong/products/${id}`
|
||||
`/admin/crash/products/${id}`
|
||||
)
|
||||
return data.data
|
||||
}
|
||||
@@ -252,20 +252,20 @@ export async function fetchAdminMohongOrders(params?: {
|
||||
page?: number
|
||||
page_size?: number
|
||||
}) {
|
||||
const { data } = await apiClient.get<ApiResponse<Paginated<MohongOrder>>>('/admin/mohong/orders', {
|
||||
const { data } = await apiClient.get<ApiResponse<Paginated<MohongOrder>>>('/admin/crash/orders', {
|
||||
params,
|
||||
})
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function fetchAdminMohongOrder(id: number | string) {
|
||||
const { data } = await apiClient.get<ApiResponse<MohongOrder>>(`/admin/mohong/orders/${id}`)
|
||||
const { data } = await apiClient.get<ApiResponse<MohongOrder>>(`/admin/crash/orders/${id}`)
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function completeAdminMohongOrder(id: number, remark?: string) {
|
||||
const { data } = await apiClient.post<ApiResponse<MohongOrder>>(
|
||||
`/admin/mohong/orders/${id}/complete`,
|
||||
`/admin/crash/orders/${id}/complete`,
|
||||
{ remark: remark || '' }
|
||||
)
|
||||
return data.data
|
||||
@@ -273,19 +273,19 @@ export async function completeAdminMohongOrder(id: number, remark?: string) {
|
||||
|
||||
export async function cancelAdminMohongOrder(id: number, reason?: string) {
|
||||
const { data } = await apiClient.post<ApiResponse<MohongOrder>>(
|
||||
`/admin/mohong/orders/${id}/cancel`,
|
||||
`/admin/crash/orders/${id}/cancel`,
|
||||
{ reason: reason || '' }
|
||||
)
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function fetchAdminMohongConfig() {
|
||||
const { data } = await apiClient.get<ApiResponse<MohongConfig>>('/admin/mohong/config')
|
||||
const { data } = await apiClient.get<ApiResponse<MohongConfig>>('/admin/crash/config')
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function updateAdminMohongConfig(payload: Partial<MohongConfig>) {
|
||||
const { data } = await apiClient.put<ApiResponse<MohongConfig>>('/admin/mohong/config', payload)
|
||||
const { data } = await apiClient.put<ApiResponse<MohongConfig>>('/admin/crash/config', payload)
|
||||
return data.data
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ async function handleCheckout() {
|
||||
clearCart()
|
||||
closeCart()
|
||||
const payment = await startMohongPayment(order.id, payWay)
|
||||
const orderPath = props.mobile ? `/m/mohong/orders/${order.id}` : `/mohong/orders/${order.id}`
|
||||
const orderPath = props.mobile ? `/m/crash/orders/${order.id}` : `/crash/orders/${order.id}`
|
||||
if (payment.paid || payment.status === 'paid') {
|
||||
ElMessage.success('支付成功')
|
||||
await router.push(orderPath)
|
||||
|
||||
@@ -18,7 +18,7 @@ const stockLabel = computed(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<RouterLink class="mohong-card" :to="`/mohong/${product.id}`">
|
||||
<RouterLink class="mohong-card" :to="`/crash/${product.id}`">
|
||||
<div class="card-cover">
|
||||
<img
|
||||
v-if="showImage"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import type { MohongProduct } from '@/features/mohong/api/mohong'
|
||||
|
||||
const STORAGE_KEY = 'mohong_cart_v1'
|
||||
const STORAGE_KEY = 'crash_cart_v1'
|
||||
|
||||
export interface MohongCartLine {
|
||||
product_id: number
|
||||
|
||||
@@ -123,11 +123,11 @@ async function handleBuy() {
|
||||
const payment = await startMohongPayment(order.id, payWay)
|
||||
if (payment.paid || payment.status === 'paid') {
|
||||
showToast({ message: '支付成功', icon: 'passed' })
|
||||
await router.push(`/m/mohong/orders/${order.id}`)
|
||||
await router.push(`/m/crash/orders/${order.id}`)
|
||||
return
|
||||
}
|
||||
await openMobilePaymentCashier(payment, async () => {
|
||||
await router.push(`/m/mohong/orders/${order.id}`)
|
||||
await router.push(`/m/crash/orders/${order.id}`)
|
||||
})
|
||||
} catch (error) {
|
||||
showToast({ message: readError(error, '下单失败'), icon: 'cross' })
|
||||
|
||||
@@ -165,11 +165,11 @@ function syncQuery() {
|
||||
const query: Record<string, string> = {}
|
||||
if (keyword.value.trim()) query.keyword = keyword.value.trim()
|
||||
if (activeCategoryId.value) query.category_id = String(activeCategoryId.value)
|
||||
router.replace({ path: '/mohong', query })
|
||||
router.replace({ path: '/crash', query })
|
||||
}
|
||||
|
||||
function goDetail(id: number) {
|
||||
router.push(`/mohong/${id}`)
|
||||
router.push(`/crash/${id}`)
|
||||
}
|
||||
|
||||
function markCoverFailed(id: number) {
|
||||
@@ -188,7 +188,7 @@ async function handleSupportClick() {
|
||||
if (supportLoading.value) return
|
||||
supportLoading.value = true
|
||||
try {
|
||||
const chat = await ensureSupportChat('mohong')
|
||||
const chat = await ensureSupportChat('crash')
|
||||
router.push(`/m/chats/${chat.id}`)
|
||||
} catch {
|
||||
showToast({ message: '联系客服失败,请稍后重试', icon: 'cross' })
|
||||
@@ -224,7 +224,7 @@ async function handleSupportClick() {
|
||||
>
|
||||
{{ supportLoading ? '...' : '客服' }}
|
||||
</button>
|
||||
<button type="button" class="orders-btn" @click="router.push('/mohong/orders')">订单</button>
|
||||
<button type="button" class="orders-btn" @click="router.push('/crash/orders')">订单</button>
|
||||
</header>
|
||||
|
||||
<div class="shop-body">
|
||||
|
||||
@@ -35,7 +35,7 @@ async function loadOrders() {
|
||||
<button type="button" class="back-btn" @click="router.back()">
|
||||
<van-icon name="arrow-left" :size="20" />
|
||||
</button>
|
||||
<h1>摸大红订单</h1>
|
||||
<h1>撞车订单</h1>
|
||||
</header>
|
||||
|
||||
<van-loading v-if="loading" class="state-loading" size="24px" vertical>加载中...</van-loading>
|
||||
@@ -46,7 +46,7 @@ async function loadOrders() {
|
||||
:key="item.id"
|
||||
type="button"
|
||||
class="card"
|
||||
@click="router.push(`/mohong/orders/${item.id}`)"
|
||||
@click="router.push(`/crash/orders/${item.id}`)"
|
||||
>
|
||||
<div class="top">
|
||||
<span>{{ item.order_no }}</span>
|
||||
|
||||
@@ -146,11 +146,11 @@ async function handleBuy() {
|
||||
const payment = await startMohongPayment(order.id, payWay)
|
||||
if (payment.paid || payment.status === 'paid') {
|
||||
ElMessage.success('支付成功')
|
||||
await router.push(`/mohong/orders/${order.id}`)
|
||||
await router.push(`/crash/orders/${order.id}`)
|
||||
return
|
||||
}
|
||||
await cashier.openPaymentCashier(payment, async () => {
|
||||
await router.push(`/mohong/orders/${order.id}`)
|
||||
await router.push(`/crash/orders/${order.id}`)
|
||||
})
|
||||
} catch (error) {
|
||||
ElMessage.error(readError(error, '下单失败'))
|
||||
@@ -184,7 +184,7 @@ async function handleBuy() {
|
||||
</div>
|
||||
|
||||
<div class="info-panel">
|
||||
<p class="eyebrow">摸大红商品</p>
|
||||
<p class="eyebrow">撞车商品</p>
|
||||
<h1>{{ product.title }}</h1>
|
||||
<p class="desc">{{ product.description || '暂无说明' }}</p>
|
||||
|
||||
@@ -238,7 +238,7 @@ async function handleBuy() {
|
||||
<el-button size="large" class="btn-outline" @click="openCart">
|
||||
购物车{{ cartCount > 0 ? `(${cartCount})` : '' }}
|
||||
</el-button>
|
||||
<el-button size="large" class="btn-outline" @click="router.push('/mohong')">
|
||||
<el-button size="large" class="btn-outline" @click="router.push('/crash')">
|
||||
返回列表
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
@@ -180,7 +180,7 @@ function syncQuery() {
|
||||
const query: Record<string, string> = {}
|
||||
if (keyword.value.trim()) query.keyword = keyword.value.trim()
|
||||
if (activeCategoryId.value) query.category_id = String(activeCategoryId.value)
|
||||
router.replace({ path: '/mohong', query })
|
||||
router.replace({ path: '/crash', query })
|
||||
}
|
||||
|
||||
const activeCategoryName = () => {
|
||||
@@ -196,7 +196,7 @@ async function handleSupportClick() {
|
||||
if (supportLoading.value) return
|
||||
supportLoading.value = true
|
||||
try {
|
||||
const chat = await ensureSupportChat('mohong')
|
||||
const chat = await ensureSupportChat('crash')
|
||||
router.push(`/messages/${chat.id}`)
|
||||
} catch {
|
||||
ElMessage.error('联系客服失败,请稍后重试')
|
||||
@@ -210,7 +210,7 @@ async function handleSupportClick() {
|
||||
<section class="mohong-pc-page">
|
||||
<header class="toolbar">
|
||||
<div class="title-block">
|
||||
<h1>摸大红</h1>
|
||||
<h1>撞车</h1>
|
||||
<span class="count">{{ total }} 件</span>
|
||||
<span class="tip">{{ activeCategoryName() }} · 支付后扫码联系客服</span>
|
||||
</div>
|
||||
@@ -228,7 +228,7 @@ async function handleSupportClick() {
|
||||
<el-icon><ShoppingCart /></el-icon>
|
||||
<span>购物车{{ cartCount > 0 ? `(${cartCount})` : '' }}</span>
|
||||
</button>
|
||||
<button type="button" class="toolbar-btn outline" @click="router.push('/mohong/orders')">
|
||||
<button type="button" class="toolbar-btn outline" @click="router.push('/crash/orders')">
|
||||
<el-icon><Tickets /></el-icon>
|
||||
<span>我的订单</span>
|
||||
</button>
|
||||
|
||||
@@ -135,7 +135,7 @@ async function copyText() {
|
||||
<h1>{{ statusText }}</h1>
|
||||
<p class="sub">订单号 {{ order.order_no }} · {{ formatDateTime(order.created_at) }}</p>
|
||||
</div>
|
||||
<button type="button" class="toolbar-btn outline" @click="router.push('/mohong/orders')">
|
||||
<button type="button" class="toolbar-btn outline" @click="router.push('/crash/orders')">
|
||||
返回列表
|
||||
</button>
|
||||
</header>
|
||||
@@ -207,7 +207,7 @@ async function copyText() {
|
||||
<button v-if="order.copy_text" type="button" class="btn outline" @click="copyText">
|
||||
复制订单信息
|
||||
</button>
|
||||
<button type="button" class="btn outline" @click="router.push('/mohong')">
|
||||
<button type="button" class="btn outline" @click="router.push('/crash')">
|
||||
继续选购
|
||||
</button>
|
||||
</aside>
|
||||
|
||||
@@ -34,10 +34,10 @@ async function loadOrders() {
|
||||
<section class="mohong-orders-page">
|
||||
<header class="page-header">
|
||||
<div>
|
||||
<h1>摸大红订单</h1>
|
||||
<h1>撞车订单</h1>
|
||||
<p class="sub">查看支付状态、复制订单信息、扫码联系客服</p>
|
||||
</div>
|
||||
<button type="button" class="toolbar-btn outline" @click="router.push('/mohong')">
|
||||
<button type="button" class="toolbar-btn outline" @click="router.push('/crash')">
|
||||
返回商品列表
|
||||
</button>
|
||||
</header>
|
||||
@@ -69,7 +69,7 @@ async function loadOrders() {
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100" fixed="right" align="center">
|
||||
<template #default="{ row }">
|
||||
<button type="button" class="link-btn" @click="router.push(`/mohong/orders/${row.id}`)">
|
||||
<button type="button" class="link-btn" @click="router.push(`/crash/orders/${row.id}`)">
|
||||
详情
|
||||
</button>
|
||||
</template>
|
||||
|
||||
@@ -43,7 +43,7 @@ export interface UseOrderPaymentCashierOptions {
|
||||
/** 弹窗显隐控制方式。PC 用 el-dialog(v-model 一个 ref),Mobile 用 van-popup。返回 true 表示用 ref,false 表示 composable 内部 ref。 */
|
||||
/**
|
||||
* 自定义支付状态查询。默认走租号订单 `/orders/:id/query-payment`。
|
||||
* 摸大红等独立业务可注入自己的查询函数。
|
||||
* 撞车等独立业务可注入自己的查询函数。
|
||||
*/
|
||||
queryPayment?: (orderId: number) => Promise<PaymentOrder>
|
||||
}
|
||||
|
||||
@@ -105,26 +105,26 @@ const allNavGroups: NavGroup[] = [
|
||||
permission: 'listing:approve',
|
||||
},
|
||||
{
|
||||
label: '摸大红分类',
|
||||
to: adminPath('mohong/categories'),
|
||||
label: '撞车分类',
|
||||
to: adminPath('crash/categories'),
|
||||
icon: Present,
|
||||
permission: 'mohong:category',
|
||||
},
|
||||
{
|
||||
label: '摸大红商品',
|
||||
to: adminPath('mohong/products'),
|
||||
label: '撞车商品',
|
||||
to: adminPath('crash/products'),
|
||||
icon: Present,
|
||||
permission: 'mohong:product_view',
|
||||
},
|
||||
{
|
||||
label: '摸大红订单',
|
||||
to: adminPath('mohong/orders'),
|
||||
label: '撞车订单',
|
||||
to: adminPath('crash/orders'),
|
||||
icon: Tickets,
|
||||
permission: 'mohong:order_view',
|
||||
},
|
||||
{
|
||||
label: '摸大红配置',
|
||||
to: adminPath('mohong/config'),
|
||||
label: '撞车配置',
|
||||
to: adminPath('crash/config'),
|
||||
icon: Setting,
|
||||
permission: 'mohong:config',
|
||||
},
|
||||
|
||||
@@ -73,26 +73,26 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
meta: adminMeta,
|
||||
},
|
||||
{
|
||||
path: adminPath('mohong/categories'),
|
||||
name: 'admin-mohong-categories',
|
||||
path: adminPath('crash/categories'),
|
||||
name: 'admin-crash-categories',
|
||||
component: () => import('@/features/admin/views/AdminMohongCategoriesView.vue'),
|
||||
meta: adminMeta,
|
||||
},
|
||||
{
|
||||
path: adminPath('mohong/products'),
|
||||
name: 'admin-mohong-products',
|
||||
path: adminPath('crash/products'),
|
||||
name: 'admin-crash-products',
|
||||
component: () => import('@/features/admin/views/AdminMohongProductsView.vue'),
|
||||
meta: adminMeta,
|
||||
},
|
||||
{
|
||||
path: adminPath('mohong/orders'),
|
||||
name: 'admin-mohong-orders',
|
||||
path: adminPath('crash/orders'),
|
||||
name: 'admin-crash-orders',
|
||||
component: () => import('@/features/admin/views/AdminMohongOrdersView.vue'),
|
||||
meta: adminMeta,
|
||||
},
|
||||
{
|
||||
path: adminPath('mohong/config'),
|
||||
name: 'admin-mohong-config',
|
||||
path: adminPath('crash/config'),
|
||||
name: 'admin-crash-config',
|
||||
component: () => import('@/features/admin/views/AdminMohongConfigView.vue'),
|
||||
meta: adminMeta,
|
||||
},
|
||||
|
||||
@@ -23,9 +23,13 @@ export function getMobilePath(path: string): string {
|
||||
if (path === '/listings' || path.startsWith('/listings/')) {
|
||||
return `/m${path}`
|
||||
}
|
||||
if (path === '/mohong' || path.startsWith('/mohong/')) {
|
||||
if (path === '/crash' || path.startsWith('/crash/')) {
|
||||
return `/m${path}`
|
||||
}
|
||||
// 旧摸大红路径 → 移动撞车
|
||||
if (path === '/mohong' || path.startsWith('/mohong/')) {
|
||||
return `/m${path.replace(/^\/mohong/, '/crash')}`
|
||||
}
|
||||
if (path === '/orders' || path.startsWith('/orders/')) {
|
||||
return `/m${path}`
|
||||
}
|
||||
@@ -71,9 +75,12 @@ export function getPcPath(path: string): string {
|
||||
if (subPath === '/listings' || subPath.startsWith('/listings/')) {
|
||||
return subPath
|
||||
}
|
||||
if (subPath === '/mohong' || subPath.startsWith('/mohong/')) {
|
||||
if (subPath === '/crash' || subPath.startsWith('/crash/')) {
|
||||
return subPath
|
||||
}
|
||||
if (subPath === '/mohong' || subPath.startsWith('/mohong/')) {
|
||||
return subPath.replace(/^\/mohong/, '/crash')
|
||||
}
|
||||
if (subPath === '/orders' || subPath.startsWith('/orders/')) {
|
||||
return subPath
|
||||
}
|
||||
|
||||
@@ -92,29 +92,34 @@ export const mobileRoutes: RouteRecordRaw[] = [
|
||||
meta: { layout: 'blank', requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: '/m/mohong',
|
||||
name: 'mobile-mohong-list',
|
||||
path: '/m/crash',
|
||||
name: 'mobile-crash-list',
|
||||
component: () => import('@/features/mohong/views/MobileMohongListView.vue'),
|
||||
meta: { layout: 'blank' },
|
||||
},
|
||||
{
|
||||
path: '/m/mohong/orders',
|
||||
name: 'mobile-mohong-orders',
|
||||
path: '/m/crash/orders',
|
||||
name: 'mobile-crash-orders',
|
||||
component: () => import('@/features/mohong/views/MobileMohongOrdersView.vue'),
|
||||
meta: { layout: 'blank', requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: '/m/mohong/orders/:id',
|
||||
name: 'mobile-mohong-order-detail',
|
||||
path: '/m/crash/orders/:id',
|
||||
name: 'mobile-crash-order-detail',
|
||||
component: () => import('@/features/mohong/views/MobileMohongOrderDetailView.vue'),
|
||||
meta: { layout: 'blank', requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: '/m/mohong/:id',
|
||||
name: 'mobile-mohong-detail',
|
||||
path: '/m/crash/:id',
|
||||
name: 'mobile-crash-detail',
|
||||
component: () => import('@/features/mohong/views/MobileMohongDetailView.vue'),
|
||||
meta: { layout: 'blank' },
|
||||
},
|
||||
// 旧路径兼容
|
||||
{ path: '/m/mohong', redirect: '/m/crash' },
|
||||
{ path: '/m/mohong/orders', redirect: '/m/crash/orders' },
|
||||
{ path: '/m/mohong/orders/:id', redirect: to => `/m/crash/orders/${to.params.id}` },
|
||||
{ path: '/m/mohong/:id', redirect: to => `/m/crash/${to.params.id}` },
|
||||
{
|
||||
path: '/m/orders',
|
||||
name: 'mobile-orders',
|
||||
|
||||
@@ -16,27 +16,32 @@ export const publicRoutes: RouteRecordRaw[] = [
|
||||
name: 'listing-detail',
|
||||
component: () => import('@/features/listings/views/ListingDetailView.vue'),
|
||||
},
|
||||
// 摸大红 PC 端;移动端访问会被守卫重写到 /m/mohong*
|
||||
// 撞车 PC 端;移动端访问会被守卫重写到 /m/crash*
|
||||
{
|
||||
path: '/mohong',
|
||||
name: 'mohong-list',
|
||||
path: '/crash',
|
||||
name: 'crash-list',
|
||||
component: () => import('@/features/mohong/views/MohongListView.vue'),
|
||||
},
|
||||
{
|
||||
path: '/mohong/orders',
|
||||
name: 'mohong-orders',
|
||||
path: '/crash/orders',
|
||||
name: 'crash-orders',
|
||||
component: () => import('@/features/mohong/views/MohongOrdersView.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: '/mohong/orders/:id',
|
||||
name: 'mohong-order-detail',
|
||||
path: '/crash/orders/:id',
|
||||
name: 'crash-order-detail',
|
||||
component: () => import('@/features/mohong/views/MohongOrderDetailView.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: '/mohong/:id',
|
||||
name: 'mohong-detail',
|
||||
path: '/crash/:id',
|
||||
name: 'crash-detail',
|
||||
component: () => import('@/features/mohong/views/MohongDetailView.vue'),
|
||||
},
|
||||
// 旧路径兼容
|
||||
{ path: '/mohong', redirect: '/crash' },
|
||||
{ path: '/mohong/orders', redirect: '/crash/orders' },
|
||||
{ path: '/mohong/orders/:id', redirect: to => `/crash/orders/${to.params.id}` },
|
||||
{ path: '/mohong/:id', redirect: to => `/crash/${to.params.id}` },
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user