refactor: move pages to subpackages to reduce main package size
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import AnnouncementModal from '../../components/AnnouncementModal.vue'
|
||||
import AnnouncementModal from '../../../components/AnnouncementModal.vue'
|
||||
|
||||
interface NoticeItem {
|
||||
id: number
|
||||
+1
-1
@@ -207,7 +207,7 @@ function onCopyAddress() {
|
||||
})
|
||||
}
|
||||
function onBookClick(cardType: string) {
|
||||
uni.navigateTo({ url: '/pages/reserve/reserve-index' })
|
||||
uni.navigateTo({ url: '/packages/user/pages/reserve/index' })
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -401,7 +401,7 @@ function goBack() {
|
||||
|
||||
function onCardClick(scenic: ScenicItem) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/scenic-detail/scenic-detail?id=${scenic.id}`,
|
||||
url: `/packages/content/pages/scenic-detail?id=${scenic.id}`,
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@@ -194,7 +194,7 @@ function copyCode() {
|
||||
|
||||
function goActivate() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/card-bind/card-bind?redeemCode=${order.value.redeemCode}`
|
||||
url: `/packages/user/pages/bind?redeemCode=${order.value.redeemCode}`
|
||||
})
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ function handleRefund() {
|
||||
}
|
||||
|
||||
function goFaq() {
|
||||
uni.navigateTo({ url: '/pages/faq/faq' })
|
||||
uni.navigateTo({ url: '/packages/content/pages/faq' })
|
||||
}
|
||||
|
||||
function goHome() {
|
||||
@@ -176,12 +176,12 @@ function onLoadMore() {
|
||||
}
|
||||
|
||||
function goDetail(orderId: string) {
|
||||
uni.navigateTo({ url: `/pages/order/order-detail?orderId=${orderId}` })
|
||||
uni.navigateTo({ url: `/packages/user/pages/order/detail?orderId=${orderId}` })
|
||||
}
|
||||
|
||||
function goActivate(order: OrderItem) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/card-bind/card-bind?redeemCode=${order.redeemCode}`
|
||||
url: `/packages/user/pages/bind?redeemCode=${order.redeemCode}`
|
||||
})
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ function submitRefund() {
|
||||
}
|
||||
|
||||
function goBuy() {
|
||||
uni.navigateTo({ url: '/pages/card-buy/card-buy' })
|
||||
uni.navigateTo({ url: '/packages/user/pages/buy' })
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -220,12 +220,12 @@ function handleSubmit() {
|
||||
const sessionTime = session ? session.time : ''
|
||||
const sessionParam = sessionTime ? `&session=${encodeURIComponent(sessionTime)}` : ''
|
||||
uni.navigateTo({
|
||||
url: `/pages/reserve/reserve-success?reserveId=${reserveId}&date=${selectedDate.value}&scenic=${encodeURIComponent(scenic.value.name)}${sessionParam}`
|
||||
url: `/packages/user/pages/reserve/success?reserveId=${reserveId}&date=${selectedDate.value}&scenic=${encodeURIComponent(scenic.value.name)}${sessionParam}`
|
||||
})
|
||||
}
|
||||
|
||||
function goFaq() {
|
||||
uni.navigateTo({ url: '/pages/faq/faq' })
|
||||
uni.navigateTo({ url: '/packages/content/pages/faq' })
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -298,7 +298,7 @@ function onLoadMore() {
|
||||
}
|
||||
|
||||
function goReserve() {
|
||||
uni.navigateTo({ url: '/pages/reserve/reserve-index' })
|
||||
uni.navigateTo({ url: '/packages/user/pages/reserve/index' })
|
||||
}
|
||||
|
||||
function previewPhoto(url: string) {
|
||||
@@ -107,7 +107,7 @@ onLoad((query: any) => {
|
||||
|
||||
// 拦截返回,跳转预约记录页
|
||||
onBackPress(() => {
|
||||
uni.redirectTo({ url: '/pages/reserve/reserve-list' })
|
||||
uni.redirectTo({ url: '/packages/user/pages/reserve/list' })
|
||||
return true
|
||||
})
|
||||
|
||||
@@ -116,7 +116,7 @@ function showCode() {
|
||||
}
|
||||
|
||||
function goRecord() {
|
||||
uni.redirectTo({ url: '/pages/reserve/reserve-list' })
|
||||
uni.redirectTo({ url: '/packages/user/pages/reserve/list' })
|
||||
}
|
||||
|
||||
function goHome() {
|
||||
+84
-79
@@ -41,85 +41,6 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人中心"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/scenic-list/scenic-list",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/scenic-detail/scenic-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "景区详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/notice-list/notice-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "通知公告"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/card-bind/card-bind",
|
||||
"style": {
|
||||
"navigationBarTitleText": "绑卡激活"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/card-buy/card-buy",
|
||||
"style": {
|
||||
"navigationBarTitleText": "超级玩家卡"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/usage-guide/usage-guide",
|
||||
"style": {
|
||||
"navigationBarTitleText": "使用说明"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/faq/faq",
|
||||
"style": {
|
||||
"navigationBarTitleText": "常见问题"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/union-buy/union-buy",
|
||||
"style": {
|
||||
"navigationBarTitleText": "工会购买"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order/order-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的订单"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order/order-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/reserve/reserve-index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "景区预约"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/reserve/reserve-success",
|
||||
"style": {
|
||||
"navigationBarTitleText": "预约成功"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/reserve/reserve-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "预约/使用记录"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
@@ -161,6 +82,90 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "绑定年卡"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/bind",
|
||||
"style": {
|
||||
"navigationBarTitleText": "绑卡激活"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/buy",
|
||||
"style": {
|
||||
"navigationBarTitleText": "超级玩家卡"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/union-buy",
|
||||
"style": {
|
||||
"navigationBarTitleText": "工会购买"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的订单"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/reserve/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "景区预约"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/reserve/success",
|
||||
"style": {
|
||||
"navigationBarTitleText": "预约成功"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/reserve/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "预约/使用记录"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "packages/content",
|
||||
"pages": [
|
||||
{
|
||||
"path": "pages/scenic-list",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/scenic-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "景区详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/notice-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "通知公告"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/usage-guide",
|
||||
"style": {
|
||||
"navigationBarTitleText": "使用说明"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/faq",
|
||||
"style": {
|
||||
"navigationBarTitleText": "常见问题"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -155,11 +155,11 @@ const quickActions = [
|
||||
|
||||
function onQuickAction(item: { label: string }) {
|
||||
if (item.label === '我要绑卡') {
|
||||
uni.navigateTo({ url: '/pages/card-bind/card-bind' })
|
||||
uni.navigateTo({ url: '/packages/user/pages/bind' })
|
||||
return
|
||||
}
|
||||
if (item.label === '我要预约') {
|
||||
uni.navigateTo({ url: '/pages/scenic-list/scenic-list' })
|
||||
uni.navigateTo({ url: '/packages/content/pages/scenic-list' })
|
||||
return
|
||||
}
|
||||
if (item.label === '我要入园') {
|
||||
@@ -167,7 +167,7 @@ function onQuickAction(item: { label: string }) {
|
||||
return
|
||||
}
|
||||
if (item.label === '常见问题') {
|
||||
uni.navigateTo({ url: '/pages/faq/faq' })
|
||||
uni.navigateTo({ url: '/packages/content/pages/faq' })
|
||||
return
|
||||
}
|
||||
uni.showToast({ title: `${item.label}功能开发中`, icon: 'none' })
|
||||
@@ -207,7 +207,7 @@ function openNotice(item: { typeLabel: string; content: string; body?: string })
|
||||
}
|
||||
|
||||
function goMoreNotice() {
|
||||
uni.navigateTo({ url: '/pages/notice-list/notice-list' })
|
||||
uni.navigateTo({ url: '/packages/content/pages/notice-list' })
|
||||
}
|
||||
|
||||
/** 热门景点数据 */
|
||||
@@ -221,19 +221,19 @@ const hotSpots = mockScenicList.slice(0, 6).map(s => ({
|
||||
}))
|
||||
|
||||
function goCardDetail() {
|
||||
uni.navigateTo({ url: '/pages/card-buy/card-buy' })
|
||||
uni.navigateTo({ url: '/packages/user/pages/buy' })
|
||||
}
|
||||
|
||||
function goUnionBuy() {
|
||||
uni.navigateTo({ url: '/pages/union-buy/union-buy' })
|
||||
uni.navigateTo({ url: '/packages/user/pages/union-buy' })
|
||||
}
|
||||
|
||||
function goSpot(spot: { id: number }) {
|
||||
uni.navigateTo({ url: `/pages/scenic-detail/scenic-detail?id=${spot.id}` })
|
||||
uni.navigateTo({ url: `/packages/content/pages/scenic-detail?id=${spot.id}` })
|
||||
}
|
||||
|
||||
function goMore() {
|
||||
uni.navigateTo({ url: '/pages/scenic-list/scenic-list' })
|
||||
uni.navigateTo({ url: '/packages/content/pages/scenic-list' })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -90,11 +90,11 @@ function handleLogout() {
|
||||
|
||||
function showComingSoon() { uni.showToast({ title: '即将上线,敬请期待', icon: 'none' }) }
|
||||
|
||||
function goFaq() { uni.navigateTo({ url: '/pages/faq/faq' }) }
|
||||
function goFaq() { uni.navigateTo({ url: '/packages/content/pages/faq' }) }
|
||||
|
||||
function goUsageGuide() { uni.navigateTo({ url: '/pages/usage-guide/usage-guide' }) }
|
||||
function goUsageGuide() { uni.navigateTo({ url: '/packages/content/pages/usage-guide' }) }
|
||||
|
||||
function goOrders() { uni.navigateTo({ url: '/pages/order/order-list' }) }
|
||||
function goOrders() { uni.navigateTo({ url: '/packages/user/pages/order/list' }) }
|
||||
|
||||
function callService() { uni.makePhoneCall({ phoneNumber: '400-123-0101' }) }
|
||||
</script>
|
||||
|
||||
@@ -211,7 +211,7 @@ function copyCardNo() {
|
||||
}
|
||||
|
||||
function goBindCard() {
|
||||
uni.navigateTo({ url: '/pages/card-bind/card-bind' })
|
||||
uni.navigateTo({ url: '/packages/user/pages/bind' })
|
||||
}
|
||||
|
||||
const featureActions = [
|
||||
@@ -223,19 +223,19 @@ const featureActions = [
|
||||
|
||||
function onFeatureClick(item: { label: string }) {
|
||||
if (item.label === '我要绑定') {
|
||||
uni.navigateTo({ url: '/pages/card-bind/card-bind' })
|
||||
uni.navigateTo({ url: '/packages/user/pages/bind' })
|
||||
return
|
||||
}
|
||||
if (item.label === '我要预约') {
|
||||
uni.navigateTo({ url: '/pages/scenic-list/scenic-list' })
|
||||
uni.navigateTo({ url: '/packages/content/pages/scenic-list' })
|
||||
return
|
||||
}
|
||||
if (item.label === '使用说明') {
|
||||
uni.navigateTo({ url: '/pages/usage-guide/usage-guide' })
|
||||
uni.navigateTo({ url: '/packages/content/pages/usage-guide' })
|
||||
return
|
||||
}
|
||||
if (item.label === '使用记录') {
|
||||
uni.navigateTo({ url: '/pages/reserve/reserve-list' })
|
||||
uni.navigateTo({ url: '/packages/user/pages/reserve/list' })
|
||||
return
|
||||
}
|
||||
uni.showToast({ title: `${item.label}功能开发中`, icon: 'none' })
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 485 KiB After Width: | Height: | Size: 16 KiB |
Reference in New Issue
Block a user