Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bba2571f25 | ||
|
|
6e88f6b09d |
+2
-1
@@ -34,7 +34,8 @@
|
|||||||
"build:quickapp-webview": "uni build -p quickapp-webview",
|
"build:quickapp-webview": "uni build -p quickapp-webview",
|
||||||
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
|
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
|
||||||
"build:quickapp-webview-union": "uni build -p quickapp-webview-union",
|
"build:quickapp-webview-union": "uni build -p quickapp-webview-union",
|
||||||
"type-check": "vue-tsc --noEmit"
|
"type-check": "vue-tsc --noEmit",
|
||||||
|
"check:api-prefix": "bash scripts/check-api-prefix.sh"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dcloudio/uni-app": "3.0.0-alpha-5010320260611001",
|
"@dcloudio/uni-app": "3.0.0-alpha-5010320260611001",
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# xuchao: 防止页面调用写死 /mp-api 前缀(request.ts 的 API_BASE 已含该前缀,重复会形成双前缀,
|
||||||
|
# 依赖 chaos 路由全局剥离才能工作,属错误写法)。命中即失败。
|
||||||
|
set -e
|
||||||
|
if grep -rn --include='*.vue' --include='*.ts' -e "('/mp-api/" -e '("/mp-api/' src; then
|
||||||
|
echo "❌ 发现页面写死 /mp-api 前缀,请去掉(API_BASE 会自动拼接)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "✅ api 前缀检查通过"
|
||||||
@@ -185,6 +185,8 @@ export interface OAuth2LoginResult {
|
|||||||
/** 用户年卡列表项(来自 /zhy-api/cardBag/userCardList) */
|
/** 用户年卡列表项(来自 /zhy-api/cardBag/userCardList) */
|
||||||
export interface UserCardListItem {
|
export interface UserCardListItem {
|
||||||
cardNo: string
|
cardNo: string
|
||||||
|
// xuchao: 卡种ID(后端 CardBagBean.cardModelId),人脸预检与卡种过滤均在用
|
||||||
|
cardModelId: number
|
||||||
cardModelName: string
|
cardModelName: string
|
||||||
validityTime: string
|
validityTime: string
|
||||||
cardModelPic: string
|
cardModelPic: string
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const loading = ref(true)
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const data = await post<BannerItem[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'FAQ' })
|
const data = await post<BannerItem[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'FAQ' })
|
||||||
faqList.value = (data || []).map(n => ({
|
faqList.value = (data || []).map(n => ({
|
||||||
id: n.id,
|
id: n.id,
|
||||||
title: n.title,
|
title: n.title,
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const notices = ref<NoticeItem[]>([])
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const data = await post<BannerItem[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'NOTICE' })
|
const data = await post<BannerItem[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'NOTICE' })
|
||||||
notices.value = (data || []).map(n => ({
|
notices.value = (data || []).map(n => ({
|
||||||
id: n.id,
|
id: n.id,
|
||||||
title: n.title,
|
title: n.title,
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ onLoad((options) => {
|
|||||||
|
|
||||||
async function fetchShopNotice(shopId: string) {
|
async function fetchShopNotice(shopId: string) {
|
||||||
try {
|
try {
|
||||||
const res = await post<any>('/mp-api/mpShopNotice/queryShopNoticePage', {
|
const res = await post<any>('/mpShopNotice/queryShopNoticePage', {
|
||||||
shopId,
|
shopId,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
@@ -265,7 +265,7 @@ async function fetchDetail(shopId: string) {
|
|||||||
const phone = uni.getStorageSync('phone') as string
|
const phone = uni.getStorageSync('phone') as string
|
||||||
if (phone) params.phone = phone
|
if (phone) params.phone = phone
|
||||||
|
|
||||||
const res = await post<any>('/mp-api/mpScenic/getScenicDetail', params)
|
const res = await post<any>('/mpScenic/getScenicDetail', params)
|
||||||
if (res) {
|
if (res) {
|
||||||
scenic.value = {
|
scenic.value = {
|
||||||
id: res.id || res.scenicId || shopId,
|
id: res.id || res.scenicId || shopId,
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ async function fetchScenicList(resetPage = true) {
|
|||||||
phone: uni.getStorageSync('phone') || '',
|
phone: uni.getStorageSync('phone') || '',
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await post<any>('/mp-api/mpScenic/queryScenicList', params)
|
const res = await post<any>('/mpScenic/queryScenicList', params)
|
||||||
const list = res?.list || res?.rows || res?.records || res || []
|
const list = res?.list || res?.rows || res?.records || res || []
|
||||||
const totalCount = res?.total || res?.totalCount || 0
|
const totalCount = res?.total || res?.totalCount || 0
|
||||||
total.value = totalCount
|
total.value = totalCount
|
||||||
@@ -344,7 +344,7 @@ onLoad((query: any) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const filterRes = await post<any>('/mp-api/mpScenic/queryFilterOptions', { channel: 'pingxiang' }).catch(() => null)
|
const filterRes = await post<any>('/mpScenic/queryFilterOptions', { channel: 'pingxiang' }).catch(() => null)
|
||||||
|
|
||||||
if (filterRes) {
|
if (filterRes) {
|
||||||
const levels = filterRes.levels || filterRes.levelList || []
|
const levels = filterRes.levels || filterRes.levelList || []
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const loading = ref(true)
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const data = await post<BannerItem[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'GUIDE' })
|
const data = await post<BannerItem[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'GUIDE' })
|
||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
imageUrl.value = data[0].imageUrl || ''
|
imageUrl.value = data[0].imageUrl || ''
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ export async function queryVoucherList(params: QueryVoucherListParams): Promise<
|
|||||||
await delay(300)
|
await delay(300)
|
||||||
return MOCK_VOUCHERS.map((v) => ({ ...v, mobile: params.mobile }))
|
return MOCK_VOUCHERS.map((v) => ({ ...v, mobile: params.mobile }))
|
||||||
}
|
}
|
||||||
return post<VoucherItem[]>('/mp-api/douyin/voucherList', params)
|
return post<VoucherItem[]>('/douyin/voucherList', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -94,5 +94,5 @@ export async function activateAndBind(params: ActivateAndBindParams): Promise<vo
|
|||||||
await delay(800)
|
await delay(800)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
await post<null>('/mp-api/douyin/activateAndBind', params)
|
await post<null>('/douyin/activateAndBind', params)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ const noticeHtml = computed(() => fixRichHtml(noticeContent.value))
|
|||||||
/** 获取购卡须知富文本(type = CARD_PURCHASE_NOTICE) */
|
/** 获取购卡须知富文本(type = CARD_PURCHASE_NOTICE) */
|
||||||
async function fetchPurchaseNotice() {
|
async function fetchPurchaseNotice() {
|
||||||
try {
|
try {
|
||||||
const res = await post<BannerItem[]>('/mp-api/mpContent/queryList', {
|
const res = await post<BannerItem[]>('/mpContent/queryList', {
|
||||||
channel: 'pingxiang',
|
channel: 'pingxiang',
|
||||||
type: 'CARD_PURCHASE_NOTICE',
|
type: 'CARD_PURCHASE_NOTICE',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const loading = ref(true)
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const list = await post<any[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'CARD_NOTICE' })
|
const list = await post<any[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'CARD_NOTICE' })
|
||||||
content.value = list?.[0]?.content || ''
|
content.value = list?.[0]?.content || ''
|
||||||
} catch {
|
} catch {
|
||||||
showToast('加载失败')
|
showToast('加载失败')
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ const noticeHtml = computed(() => fixRichHtml(noticeContent.value))
|
|||||||
/** 获取购卡须知富文本(type = CARD_PURCHASE_NOTICE) */
|
/** 获取购卡须知富文本(type = CARD_PURCHASE_NOTICE) */
|
||||||
async function fetchPurchaseNotice() {
|
async function fetchPurchaseNotice() {
|
||||||
try {
|
try {
|
||||||
const res = await post<BannerItem[]>('/mp-api/mpContent/queryList', {
|
const res = await post<BannerItem[]>('/mpContent/queryList', {
|
||||||
channel: 'pingxiang',
|
channel: 'pingxiang',
|
||||||
type: 'CARD_PURCHASE_NOTICE',
|
type: 'CARD_PURCHASE_NOTICE',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -192,8 +192,8 @@ onMounted(() => {
|
|||||||
async function fetchBannersAndNotices() {
|
async function fetchBannersAndNotices() {
|
||||||
try {
|
try {
|
||||||
const [bannerData, noticeData] = await Promise.all([
|
const [bannerData, noticeData] = await Promise.all([
|
||||||
post<BannerItem[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'BANNER' }),
|
post<BannerItem[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'BANNER' }),
|
||||||
post<BannerItem[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'NOTICE' }),
|
post<BannerItem[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'NOTICE' }),
|
||||||
])
|
])
|
||||||
banners.value = bannerData || []
|
banners.value = bannerData || []
|
||||||
announcements.value = (noticeData || []).map(n => ({
|
announcements.value = (noticeData || []).map(n => ({
|
||||||
@@ -208,7 +208,7 @@ async function fetchBannersAndNotices() {
|
|||||||
/** 获取热门景点(独立加载,不阻塞 banner/公告渲染) */
|
/** 获取热门景点(独立加载,不阻塞 banner/公告渲染) */
|
||||||
async function fetchSpots() {
|
async function fetchSpots() {
|
||||||
try {
|
try {
|
||||||
const spotsData = await post<any>('/mp-api/mpScenic/queryScenicList', { channel: 'pingxiang', pageNo: 1, pageSize: 8, phone: uni.getStorageSync('phone') || '' })
|
const spotsData = await post<any>('/mpScenic/queryScenicList', { channel: 'pingxiang', pageNo: 1, pageSize: 8, phone: uni.getStorageSync('phone') || '' })
|
||||||
const list = spotsData?.list || spotsData || []
|
const list = spotsData?.list || spotsData || []
|
||||||
hotSpots.value = (Array.isArray(list) ? list : []).slice(0, 8).map((s: any) => ({
|
hotSpots.value = (Array.isArray(list) ? list : []).slice(0, 8).map((s: any) => ({
|
||||||
id: s.id || s.scenicId,
|
id: s.id || s.scenicId,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const loading = ref(true)
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const list = await post<any[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'TERMS' })
|
const list = await post<any[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'TERMS' })
|
||||||
content.value = list?.[0]?.content || ''
|
content.value = list?.[0]?.content || ''
|
||||||
} catch {
|
} catch {
|
||||||
showToast('加载失败')
|
showToast('加载失败')
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const loading = ref(true)
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const list = await post<any[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'PRIVACY' })
|
const list = await post<any[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'PRIVACY' })
|
||||||
content.value = list?.[0]?.content || ''
|
content.value = list?.[0]?.content || ''
|
||||||
} catch {
|
} catch {
|
||||||
showToast('加载失败')
|
showToast('加载失败')
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ async function fetchCards() {
|
|||||||
async function fetchEntryNotice() {
|
async function fetchEntryNotice() {
|
||||||
if (entryNoticeLoaded.value) return
|
if (entryNoticeLoaded.value) return
|
||||||
try {
|
try {
|
||||||
const list = await post<BannerItem[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'ENTRY_NOTICE' })
|
const list = await post<BannerItem[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'ENTRY_NOTICE' })
|
||||||
entryNotice.value = list?.[0]?.content || ''
|
entryNotice.value = list?.[0]?.content || ''
|
||||||
} catch {
|
} catch {
|
||||||
entryNotice.value = ''
|
entryNotice.value = ''
|
||||||
@@ -386,7 +386,7 @@ function onFeatureClick(item: { label: string }) {
|
|||||||
uni.showToast({ title: '请先选择一张旅游卡', icon: 'none' })
|
uni.showToast({ title: '请先选择一张旅游卡', icon: 'none' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
post<any>('/mp-api/mpCard/checkFaceBind', { cardModelId: card.cardModelId, cardNumber: card.cardNo })
|
post<any>('/mpCard/checkFaceBind', { cardModelId: card.cardModelId, cardNumber: card.cardNo })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res?.needBindFace) {
|
if (res?.needBindFace) {
|
||||||
showFaceModal.value = true
|
showFaceModal.value = true
|
||||||
|
|||||||
Reference in New Issue
Block a user