ui修改.

This commit is contained in:
18631081161 2025-12-20 20:29:21 +08:00
parent edf68c49c5
commit 1159a6f124
21 changed files with 203 additions and 57 deletions

View File

@ -89,31 +89,42 @@
</template>
</el-table-column>
<el-table-column prop="realName" label="预约人" width="100" show-overflow-tooltip />
<el-table-column label="联系方式" width="140">
<el-table-column label="联系方式" width="180">
<template #default="{ row }">
<div class="contact-info">
<template v-if="row.contactMethod && row.contactValue">
<el-tag :type="getContactMethodType(row.contactMethod)" size="small">
{{ getContactMethodLabel(row.contactMethod) }}
</el-tag>
<span class="contact-value">{{ row.contactValue }}</span>
</template>
<template v-else-if="row.phone || row.whatsapp || row.wechatId">
<template v-if="row.phone">
<el-tag type="" size="small">电话</el-tag>
<span class="contact-value">{{ row.phone }}</span>
</template>
<template v-else-if="row.whatsapp">
<el-tag type="success" size="small">WhatsApp</el-tag>
<span class="contact-value">{{ row.whatsapp }}</span>
</template>
<template v-else-if="row.wechatId">
<el-tag type="primary" size="small">微信</el-tag>
<span class="contact-value">{{ row.wechatId }}</span>
</template>
</template>
<span v-else>-</span>
</div>
</template>
</el-table-column>
<el-table-column label="预约时间" width="140">
<el-table-column label="预约时间" width="160">
<template #default="{ row }">
<div v-if="row.appointmentDate">
<div>{{ row.appointmentDate }}</div>
<div v-if="row.appointmentDate || row.departureDate || row.checkInDate || row.travelDate">
<div>{{ row.appointmentDate || row.departureDate || row.checkInDate || row.travelDate }}</div>
<div class="time-text">{{ row.appointmentTime || '-' }}</div>
</div>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column prop="amount" label="金额" width="100" align="right" sortable="custom">
<template #default="{ row }">
<span v-if="row.amount">¥{{ parseFloat(row.amount).toFixed(2) }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column prop="status" label="状态" width="100" align="center">
<template #default="{ row }">
<el-tag :type="getStatusTagType(row.status)" size="small">
@ -345,7 +356,7 @@ const statusOptions = [
async function fetchCategories() {
try {
const response = await api.get('/api/v1/categories')
if (response.data.code === 0) {
if (response.data.code === 0 || response.data.success) {
categories.value = response.data.data.categories || response.data.data || []
}
} catch (error) {
@ -371,7 +382,8 @@ async function fetchAppointments() {
})
const response = await api.get('/api/v1/admin/appointments', { params })
if (response.data.code === 0) {
console.log('Appointments response:', response.data)
if (response.data.success || response.data.code === 0) {
appointments.value = response.data.data.appointments
pagination.total = response.data.data.pagination.total
pagination.totalPages = response.data.data.pagination.totalPages
@ -389,7 +401,7 @@ async function fetchAppointmentDetails(appointmentId) {
detailsLoading.value = true
try {
const response = await api.get(`/api/v1/admin/appointments/${appointmentId}`)
if (response.data.code === 0) {
if (response.data.success || response.data.code === 0) {
appointmentDetails.value = response.data.data
}
} catch (error) {
@ -492,7 +504,7 @@ async function confirmUpdateStatus() {
status: statusForm.newStatus
})
if (response.data.code === 0) {
if (response.data.success || response.data.code === 0) {
ElMessage.success('订单状态更新成功')
statusDialogVisible.value = false

View File

@ -6,7 +6,7 @@ import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import path from 'path'
export default defineConfig({
base: '/admin/',
// base: '/admin/',
plugins: [
vue(),
AutoImport({

View File

@ -11,7 +11,7 @@ var Config = Config || {}
// API 基础地址
// 注意:微信小程序开发工具无法访问localhost,需要使用本机IP地址
Config.API_BASE_URL = 'http://192.168.1.7:3000' // 本地开发环境(使用本机IP)
Config.API_BASE_URL = 'https://sub.zpc-xy.com' // 本地开发环境(使用本机IP)
// Config.API_BASE_URL = 'http://localhost:3000' // 本地开发环境(浏览器可用)
// Config.API_BASE_URL = 'https://your-production-domain.com' // 生产环境(待配置)

View File

@ -128,6 +128,8 @@
data() {
return {
serviceId: "",
hotServiceId: "",
source: "",
serviceTitle: "",
userName: "",
userWechat: "",
@ -145,8 +147,13 @@
},
onLoad(options) {
if (options.id) {
this.source = options.source || ''
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -219,7 +226,8 @@
try {
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'air_logistics',
realName: this.userName.trim(),
wechatId: this.userWechat.trim() || null,

View File

@ -243,7 +243,9 @@
export default {
data() {
return {
serviceId: "", // ID
serviceId: "", // ID
hotServiceId: "", // ID
source: "", // hot==
serviceTitle: "", //
userName: "",
userWechat: "",
@ -313,8 +315,14 @@
this.initDateRange()
//
if (options.id) {
this.source = options.source || ''
// serviceId hotServiceId
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -466,8 +474,9 @@
try {
//
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceType: 'travel', //
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'flight', //
realName: this.userName.trim(),
//
wechatId: this.userWechat.trim() || null,

View File

@ -153,6 +153,8 @@
data() {
return {
serviceId: "",
hotServiceId: "",
source: "",
serviceTitle: "",
userName: "",
userWechat: "",
@ -175,8 +177,13 @@
onLoad(options) {
this.initDateRange()
if (options.id) {
this.source = options.source || ''
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -278,7 +285,8 @@
try {
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'airport_transfer',
realName: this.userName.trim(),
wechatId: this.userWechat.trim() || null,

View File

@ -69,7 +69,7 @@
import { updateTabBarI18n } from '@/utils/tabbar-i18n.js'
import { AppServer } from '@/modules/api/AppServer.js'
import Config from '@/modules/Config.js'
import { isLoggedIn } from '@/utils/auth.js'
import { isLoggedIn, requireAuth } from '@/utils/auth.js'
export default {
data() {
@ -188,6 +188,11 @@
//
goToServiceDetail(service) {
//
if (!requireAuth()) {
return
}
//
const servicePageMap = {
'flight': 'airfare-info-entry-page',

View File

@ -111,6 +111,8 @@
data() {
return {
serviceId: "",
hotServiceId: "",
source: "",
serviceTitle: "",
userName: "",
userWechat: "",
@ -125,8 +127,13 @@
},
onLoad(options) {
if (options.id) {
this.source = options.source || ''
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -181,7 +188,8 @@
try {
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'exhibition_service',
realName: this.userName.trim(),
wechatId: this.userWechat.trim() || null,

View File

@ -122,6 +122,8 @@
data() {
return {
serviceId: "",
hotServiceId: "",
source: "",
serviceTitle: "",
userName: "",
userWechat: "",
@ -141,8 +143,13 @@
onLoad(options) {
this.initDateRange()
if (options.id) {
this.source = options.source || ''
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -226,7 +233,8 @@
try {
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'guide_translation',
realName: this.userName.trim(),
wechatId: this.userWechat.trim() || null,

View File

@ -215,6 +215,8 @@
data() {
return {
serviceId: "",
hotServiceId: "",
source: "",
serviceTitle: "",
userName: "",
userWechat: "",
@ -308,8 +310,13 @@
onLoad(options) {
this.initDateRange()
if (options.id) {
this.source = options.source || ''
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -471,7 +478,8 @@
try {
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'hotel',
realName: this.userName.trim(),
wechatId: this.userWechat.trim() || null,

View File

@ -111,6 +111,8 @@
data() {
return {
serviceId: "",
hotServiceId: "",
source: "",
serviceTitle: "",
userName: "",
userWechat: "",
@ -125,8 +127,13 @@
},
onLoad(options) {
if (options.id) {
this.source = options.source || ''
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -181,7 +188,8 @@
try {
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'insurance_consultation',
realName: this.userName.trim(),
wechatId: this.userWechat.trim() || null,

View File

@ -145,6 +145,8 @@
data() {
return {
serviceId: "",
hotServiceId: "",
source: "",
serviceTitle: "",
userName: "",
userWechat: "",
@ -166,8 +168,13 @@
onLoad(options) {
this.initDateRange()
if (options.id) {
this.source = options.source || ''
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -263,7 +270,8 @@
try {
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'medical_consultation',
realName: this.userName.trim(),
wechatId: this.userWechat.trim() || null,

View File

@ -171,6 +171,8 @@
data() {
return {
serviceId: "",
hotServiceId: "",
source: "",
serviceTitle: "",
userName: "",
userWechat: "",
@ -214,8 +216,13 @@
onLoad(options) {
this.initDateRange()
if (options.id) {
this.source = options.source || ''
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -329,7 +336,8 @@
try {
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'pet_transportation',
realName: this.userName.trim(),
wechatId: this.userWechat.trim() || null,

View File

@ -166,6 +166,8 @@
data() {
return {
serviceId: "",
hotServiceId: "",
source: "",
serviceTitle: "",
userName: "",
userWechat: "",
@ -211,8 +213,13 @@
onLoad(options) {
this.initDateRange()
if (options.id) {
this.source = options.source || ''
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -314,7 +321,8 @@
try {
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'rail_ticket',
realName: this.userName.trim(),
wechatId: this.userWechat.trim() || null,

View File

@ -128,6 +128,8 @@
data() {
return {
serviceId: "",
hotServiceId: "",
source: "",
serviceTitle: "",
userName: "",
userWechat: "",
@ -145,8 +147,13 @@
},
onLoad(options) {
if (options.id) {
this.source = options.source || ''
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -219,7 +226,8 @@
try {
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'sea_freight',
realName: this.userName.trim(),
wechatId: this.userWechat.trim() || null,

View File

@ -137,6 +137,8 @@
data() {
return {
serviceId: "",
hotServiceId: "",
source: "",
serviceTitle: "",
userName: "",
userWechat: "",
@ -157,8 +159,13 @@
onLoad(options) {
this.initDateRange()
if (options.id) {
this.source = options.source || ''
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -248,7 +255,8 @@
try {
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'special_needs',
realName: this.userName.trim(),
wechatId: this.userWechat.trim() || null,

View File

@ -196,6 +196,8 @@
data() {
return {
serviceId: "",
hotServiceId: "",
source: "",
serviceTitle: "",
userName: "",
userWechat: "",
@ -220,8 +222,13 @@
onLoad(options) {
this.initDateRange()
if (options.id) {
this.source = options.source || ''
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -341,7 +348,8 @@
try {
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'travel_planning',
realName: this.userName.trim(),
wechatId: this.userWechat.trim() || null,

View File

@ -171,6 +171,8 @@
data() {
return {
serviceId: "",
hotServiceId: "",
source: "",
serviceTitle: "",
userName: "",
userWechat: "",
@ -193,8 +195,13 @@
onLoad(options) {
this.initDateRange()
if (options.id) {
this.source = options.source || ''
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -290,7 +297,8 @@
try {
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'unaccompanied_minor',
realName: this.userName.trim(),
wechatId: this.userWechat.trim() || null,

View File

@ -176,6 +176,8 @@
data() {
return {
serviceId: "",
hotServiceId: "",
source: "",
serviceTitle: "",
userName: "",
userWechat: "",
@ -199,8 +201,13 @@
onLoad(options) {
this.initDateRange()
if (options.id) {
this.source = options.source || ''
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -290,7 +297,8 @@
try {
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'vip_lounge',
realName: this.userName.trim(),
wechatId: this.userWechat.trim() || null,

View File

@ -111,6 +111,8 @@
data() {
return {
serviceId: "",
hotServiceId: "",
source: "",
serviceTitle: "",
userName: "",
userWechat: "",
@ -125,8 +127,13 @@
},
onLoad(options) {
if (options.id) {
this.source = options.source || ''
if (this.source === 'hot') {
this.hotServiceId = options.id
} else {
this.serviceId = options.id
}
}
if (options.title) {
this.serviceTitle = decodeURIComponent(options.title)
}
@ -181,7 +188,8 @@
try {
const appointmentData = {
hotServiceId: parseInt(this.serviceId) || null,
serviceId: this.serviceId || null,
hotServiceId: this.hotServiceId ? parseInt(this.hotServiceId) : null,
serviceType: 'visa_consultation',
realName: this.userName.trim(),
wechatId: this.userWechat.trim() || null,

View File

@ -118,9 +118,9 @@
const pageName = servicePageMap[this.serviceType]
if (pageName) {
// source=hot
uni.navigateTo({
url: '/pages/appointment/' + pageName + '?id=' + this.id + '&title=' +
encodeURIComponent(this.title)
url: `/pages/appointment/${pageName}?id=${this.id}&source=hot&title=${encodeURIComponent(this.title)}`
});
} else {
// 使