From d6895456ff44e5c21cae74125accb6f2094c7052 Mon Sep 17 00:00:00 2001 From: zpc Date: Mon, 6 Oct 2025 23:24:50 +0800 Subject: [PATCH] 321 --- App.vue | 3 + common/server/config.js | 44 +++++++++++- components.d.ts | 2 + components/com/page/float-ball.vue | 71 +++++++++++++++++++ components/com/page/home-ad-popup.vue | 54 ++++++++++++++ components/index/MahjongCard.vue | 8 +-- pages/appointment/appointment-page.vue | 53 +++++++++++--- pages/index/index.vue | 30 ++++++-- .../uview-plus/components/u-popup/u-popup.vue | 4 +- 9 files changed, 246 insertions(+), 23 deletions(-) create mode 100644 components/com/page/float-ball.vue create mode 100644 components/com/page/home-ad-popup.vue diff --git a/App.vue b/App.vue index 46d3196..0ec08cd 100644 --- a/App.vue +++ b/App.vue @@ -2,6 +2,9 @@ export default { onLaunch: function() { console.log('App Launch') + // 本次小程序启动期间是否已展示过首页广告弹窗 + this.globalData = this.globalData || {}; + this.globalData.hasShownHomeAd = false; }, onShow: function() { console.log('App Show') diff --git a/common/server/config.js b/common/server/config.js index 56ea5d0..3894387 100644 --- a/common/server/config.js +++ b/common/server/config.js @@ -72,4 +72,46 @@ export const getShareConfig = async (path) => { path: path, imageUrl: config.shareImage }; -} \ No newline at end of file +} + +/** + * 获取悬浮球配置 + * @returns {Object|null} 返回浮动配置,失败时返回null { + "enabled": true, + "image": "https://admin-1308826010.cos.ap-shanghai.myqcloud.com/upload/20251006/20251006174940_1752.jpg", + "popupImage": "https://admin-1308826010.cos.ap-shanghai.myqcloud.com/upload/20251006/20251006175053_9954.jpg" + } + */ +export const getFloatConfig = async () => { + if (configData.value == null) { + return null; + } + var config = configData.value.config; + var floatConfig = config.floatConfig; + if (!floatConfig || !floatConfig.enabled) { + return null; + } + return floatConfig; +} +export const getPopupShow = ref(true); +/** + * 获取首页弹窗配置 + * @returns {Object|null} 返回弹窗配置,失败时返回null { + "enabled": true, + "image": "https://admin-1308826010.cos.ap-shanghai.myqcloud.com/upload/20251006/20251006151324_4800.jpg" + } + */ +export const getPopupConfig = async () => { + if (configData.value == null) { + return null; + } + var config = configData.value.config; + var popupConfig = config.popupConfig; + if (!popupConfig || !popupConfig.enabled) { + return null; + } + return popupConfig; +} + + + diff --git a/components.d.ts b/components.d.ts index a3f35d6..b50cf9d 100644 --- a/components.d.ts +++ b/components.d.ts @@ -11,6 +11,8 @@ declare module 'vue' { CardContainer: typeof import('./components/com/appointment/card-container.vue')['default'] Container: typeof import('./components/com/page/container.vue')['default'] ContainerBase: typeof import('./components/com/page/container-base.vue')['default'] + FloatBall: typeof import('./components/com/page/float-ball.vue')['default'] + HomeAdPopup: typeof import('./components/com/page/home-ad-popup.vue')['default'] LabelField: typeof import('./components/com/appointment/label-field.vue')['default'] LabelSlectField: typeof import('./components/com/appointment/label-slect-field.vue')['default'] MahjongCard: typeof import('./components/index/MahjongCard.vue')['default'] diff --git a/components/com/page/float-ball.vue b/components/com/page/float-ball.vue new file mode 100644 index 0000000..1b593ab --- /dev/null +++ b/components/com/page/float-ball.vue @@ -0,0 +1,71 @@ + + + + + + diff --git a/components/com/page/home-ad-popup.vue b/components/com/page/home-ad-popup.vue new file mode 100644 index 0000000..ef1cd23 --- /dev/null +++ b/components/com/page/home-ad-popup.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/components/index/MahjongCard.vue b/components/index/MahjongCard.vue index 5a4e68f..607a903 100644 --- a/components/index/MahjongCard.vue +++ b/components/index/MahjongCard.vue @@ -238,8 +238,8 @@ const handleJoin = () => { } .grid-item { - width: 320rpx; - height: 460rpx; + width: 300rpx; + height: 405rpx; background: #FFFFFF; box-shadow: -4rpx 12rpx 7rpx 0rpx rgba(0, 0, 0, 0.25); border-radius: 27rpx; @@ -248,7 +248,7 @@ const handleJoin = () => { // ==================== 麻将桌区域样式 ==================== .mahjong-table-section { - height: 251rpx; + height: 230rpx; position: relative; } @@ -320,7 +320,7 @@ const handleJoin = () => { .info-text { font-family: PingFang SC, PingFang SC; font-weight: 400; - font-size: 20rpx; + font-size:18rpx; color: #575757; text-align: left; display: block; diff --git a/pages/appointment/appointment-page.vue b/pages/appointment/appointment-page.vue index b8c4718..2f73956 100644 --- a/pages/appointment/appointment-page.vue +++ b/pages/appointment/appointment-page.vue @@ -57,22 +57,28 @@ - + + + - + + + - + {{ getAgeRangeText() }} - - 大于等于 + + 大于等于 @@ -97,13 +103,18 @@ 鸽子费(保证金),参与人需缴纳鸽子费。若有参与者在预约后没有赴约,其鸽子费由在场的所有人平分。组局成功或失败后鸽子费将全额返还。 - - 发起预约 + + + 重置 + + + 发起预约 + - 组局成功后,发起者可通过店员领取线下红包 + @@ -126,7 +137,7 @@ class="center evaluate-btn" :data-item="reservation"> 分享给好友 - + @@ -705,7 +716,7 @@ onLoad(async () => { } }) onShow(async () => { - resetForm(); + // resetForm(); }) // 年龄列构建与显示/文案 const buildAgeColumns = () => { @@ -806,6 +817,28 @@ const onAgePickerConfirm = (e) => { background-color: #00AC4E; } +/* 操作区一行布局:重置 + 发起 */ +.action-row { + width: 90%; + margin: 30rpx auto 0; + display: flex; + gap: 20rpx; +} + +.reset-button { + flex: 0 0 30%; + height: 88rpx; + border-radius: 10rpx; + background-color: #FFFFFF; + color: #333; +} + +.action-submit { + flex: 1 1 auto; + height: 88rpx; + margin: 0; /* 覆盖原有 submit-button 的外边距,使其与 reset 同行 */ +} + /* 备注容器及文本 */ .note-container { width: 90%; diff --git a/pages/index/index.vue b/pages/index/index.vue index c75927f..8659476 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -5,20 +5,23 @@ :loading-more-enabled="true" :auto="true" :empty-view-text="'暂无麻将局数据'" :empty-view-img="'/static/empty.png'" :refresher-threshold="80" :loading-more-threshold="50" style="flex: 1; width: 95%; margin-top: 10rpx;"> - + - + - + + + @@ -40,6 +47,12 @@ + + + + + + @@ -101,6 +114,8 @@ import { onShareAppMessage } from '@dcloudio/uni-app'; import zPaging from '@/uni_modules/z-paging/components/z-paging/z-paging.vue' import MahjongCard from '@/components/index/MahjongCard.vue' import ReservationPopup from '@/components/com/index/ReservationPopup.vue' +import ComPageFloatBall from '@/components/com/page/float-ball.vue' +import ComPageHomeAdPopup from '@/components/com/page/home-ad-popup.vue' import { homeData, preloadHomeData, @@ -244,6 +259,9 @@ const handleJoin = (item) => { reservationPopup.value.close() } +// 注册组件 +defineExpose({}) + // 生命周期 onMounted(() => { // 初始化模拟数据 @@ -286,7 +304,7 @@ onLoad(async (option) => { .img-swiper { width: 100%; - height: 386rpx; + height: 320rpx; } .slide-img { @@ -300,9 +318,9 @@ onLoad(async (option) => { display: grid; grid-template-columns: repeat(2, 1fr); /* 2列,每列宽度相等 */ - gap: 20rpx; + gap: 25rpx; /* 网格间距(行列间距相同) */ - padding: 0 15rpx; + padding: 0 25rpx; } /* 网格项内容 */ diff --git a/uni_modules/uview-plus/components/u-popup/u-popup.vue b/uni_modules/uview-plus/components/u-popup/u-popup.vue index 2c2c653..143d5f9 100644 --- a/uni_modules/uview-plus/components/u-popup/u-popup.vue +++ b/uni_modules/uview-plus/components/u-popup/u-popup.vue @@ -344,8 +344,8 @@