feat: 景区详情页优化 + 代码质量修复 + 首页适配
- 详情页:地图按钮改为复制地址,电话点击直接拨号 - 详情页:移除免X次/年徽章,增加信息卡片与卡种卡片间距 - 详情页:运营状态实时判断(根据营业时间自动显示营业中/已闭园) - 详情页:轮播圆点仅多图时显示,加大尺寸+投影,z-index置顶 - 详情页:景区电话箭头靠右对齐 - 首页:热门景点两列布局改用padding方案,修复小屏手机单列显示 - 代码质量:card/order API移入分包,消除主包未使用JS文件 - 代码质量:manifest启用minified和lazyCodeLoading - 构建:vite配置静默Sass弃用警告 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { get, post } from '../../../api/request'
|
||||
import type { CardInfo, CardDetail, MyCard, ActivateParams, QrCodeInfo } from '../../../api/types'
|
||||
|
||||
/** 获取年卡列表 */
|
||||
export function getCardList(params?: { keyword?: string; category?: string }): Promise<CardInfo[]> {
|
||||
return get<CardInfo[]>('/card/list', params)
|
||||
}
|
||||
|
||||
/** 获取年卡详情 */
|
||||
export function getCardDetail(id: string): Promise<CardDetail> {
|
||||
return get<CardDetail>('/card/detail', { id })
|
||||
}
|
||||
|
||||
/** 激活年卡 */
|
||||
export function activateCard(cardId: string, data: ActivateParams): Promise<boolean> {
|
||||
return post<boolean>('/card/activate', { cardId, ...data })
|
||||
}
|
||||
|
||||
/** 绑定年卡 */
|
||||
export function bindCard(cardNo: string): Promise<boolean> {
|
||||
return post<boolean>('/card/bind', { cardNo })
|
||||
}
|
||||
|
||||
/** 获取我的年卡列表 */
|
||||
export function getMyCards(): Promise<MyCard[]> {
|
||||
return get<MyCard[]>('/card/my-list')
|
||||
}
|
||||
|
||||
/** 获取入园码 */
|
||||
export function getEntryQrCode(cardId: string): Promise<QrCodeInfo> {
|
||||
return get<QrCodeInfo>('/card/qrcode', { cardId })
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { get, post } from '../../../api/request'
|
||||
import type { OrderInfo, CreateOrderParams, MockPayResult } from '../../../api/types'
|
||||
|
||||
/** 创建订单 */
|
||||
export function createOrder(data: CreateOrderParams): Promise<OrderInfo> {
|
||||
return post<OrderInfo>('/order/create', data)
|
||||
}
|
||||
|
||||
/** 模拟支付(第一版替代微信支付) */
|
||||
export function mockPay(orderId: string): Promise<MockPayResult> {
|
||||
return post<MockPayResult>('/order/mock-pay', { orderId })
|
||||
}
|
||||
|
||||
/** 获取订单列表 */
|
||||
export function getOrderList(params?: { status?: string }): Promise<OrderInfo[]> {
|
||||
return get<OrderInfo[]>('/order/list', params)
|
||||
}
|
||||
|
||||
/** 获取订单详情 */
|
||||
export function getOrderDetail(id: string): Promise<OrderInfo> {
|
||||
return get<OrderInfo>('/order/detail', { id })
|
||||
}
|
||||
@@ -32,7 +32,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { activateCard } from '../../../../api/card'
|
||||
import { activateCard } from '../../api/card'
|
||||
import { showToast } from '../../../../utils'
|
||||
|
||||
const cardId = ref('')
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { bindCard } from '../../../../api/card'
|
||||
import { bindCard } from '../../api/card'
|
||||
import { showToast } from '../../../../utils'
|
||||
|
||||
const cardNo = ref('')
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { createOrder, mockPay } from '../../../../api/order'
|
||||
import { createOrder, mockPay } from '../../api/order'
|
||||
import { showToast } from '../../../../utils'
|
||||
|
||||
const cardId = ref('')
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getCardDetail } from '../../../../api/card'
|
||||
import { getCardDetail } from '../../api/card'
|
||||
import type { CardDetail } from '../../../../api/types'
|
||||
|
||||
const card = ref<CardDetail | null>(null)
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getCardList } from '../../../../api/card'
|
||||
import { getCardList } from '../../api/card'
|
||||
import CardItem from '../../../../components/card-item.vue'
|
||||
import type { CardInfo } from '../../../../api/types'
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onBeforeUnmount } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getEntryQrCode } from '../../../../api/card'
|
||||
import { getEntryQrCode } from '../../api/card'
|
||||
import { showToast } from '../../../../utils'
|
||||
import type { QrCodeInfo } from '../../../../api/types'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user