Эх сурвалжийг харах

feat(home): 新增Banner详情页并更新首页交互逻辑

- 在 pages.json 中新增 bannerDetaile 页面配置
- 新增 bannerDetaile 页面组件,展示详情图片
- 首页index.vue中加油图标添加路由名称 refueling-webview
- 修改首页点击事件逻辑,跳转至 bannerDetaile 页面
- 优化首页Banner区域点击事件绑定位置,避免事件冒泡问题
- 更新类型声明 uni-pages.d.ts,增加 bannerDetaile 路由声明
zhangtao 5 өдөр өмнө
parent
commit
156c52164d

+ 8 - 0
src/pages.json

@@ -278,6 +278,14 @@
     {
       "root": "subPack-smqjh",
       "pages": [
+        {
+          "path": "bannerDetaile/index",
+          "name": "bannerDetaile",
+          "islogin": false,
+          "style": {
+            "navigationBarTitleText": "详情"
+          }
+        },
         {
           "path": "order/index",
           "name": "smqjh-order",

+ 6 - 6
src/pages/index/index.vue

@@ -61,7 +61,7 @@ const navList = computed(() => {
     { icon: `${StaticUrl}/smqjh-vip.png`, title: '视频权益', name: 'video-rights-tabbar', show: !isOnlineAudit.value },
     { icon: `${StaticUrl}/smqjh-djk.png`, title: '大健康', name: 'djk-homeTabbar', show: true },
     { icon: `${StaticUrl}/smqjh-diancan.png`, title: '大牌点餐', name: '', show: !isOnlineAudit.value },
-    { icon: `${StaticUrl}/smqjh-jiayou.png`, title: '加油', name: '', show: !isOnlineAudit.value }, // refueling-tabbar
+    { icon: `${StaticUrl}/smqjh-jiayou.png`, title: '加油', name: 'refueling-webview', show: !isOnlineAudit.value }, // refueling-tabbar
     { icon: `${StaticUrl}/smqjh-jiudian.png`, title: '酒店民宿', name: '', show: !isOnlineAudit.value },
     { icon: `${StaticUrl}/smqjh-daijia.png`, title: '代驾', name: '', show: !isOnlineAudit.value },
   ]
@@ -109,7 +109,7 @@ async function getZhUserReceived() {
 }
 
 function handleGo() {
-  show({ msg: '敬请期待 !' })
+  router.push({ name: 'bannerDetaile' })
 }
 function handleChangeSwiper(e: UniHelper.SwiperOnChangeEvent) {
   console.log(e.detail.current, 'e.detail.current')
@@ -213,11 +213,11 @@ function handleChangeSwiper(e: UniHelper.SwiperOnChangeEvent) {
         </wd-skeleton>
       </view>
 
-      <view class="mt-20rpx w-full flex items-center justify-between" @click="handleGo">
+      <view class="mt-20rpx w-full flex items-center justify-between">
         <image :src="`${StaticUrl}/smqjh-fl.png`" class="h-346rpx w-344rpx flex-shrink-0" />
-        <view class="flex flex-1 flex-col items-end justify-center">
-          <image :src="`${StaticUrl}/smqjh-hot-vip.png`" class="h-180rpx w-344rpx" />
-          <image :src="`${StaticUrl}/smqjh-cd.png`" class="mt-14rpx h-152rpx w-344rpx" />
+        <view class="flex flex-1 flex-col items-end justify-center" @click="handleGo">
+          <image :src="`${StaticUrl}/smqjh-home-banner1.jpg`" class="h-180rpx w-344rpx rounded-12rpx" />
+          <image :src="`${StaticUrl}/smqjh-home-banner2.jpg`" class="mt-14rpx h-152rpx w-344rpx rounded-12rpx" />
         </view>
       </view>
       <view class="mt-20rpx">

+ 17 - 0
src/subPack-smqjh/bannerDetaile/index.vue

@@ -0,0 +1,17 @@
+<script setup lang="ts">
+import { StaticUrl } from '@/config'
+
+definePage({ name: 'bannerDetaile', islogin: false, style: { navigationBarTitleText: '详情' } })
+</script>
+
+<template>
+  <view class="box-border w-full p24rpx">
+    <image
+      :src="`${StaticUrl}/smqjh-dt.jpg`"
+      class="w-full"
+      mode="widthFix"
+    />
+  </view>
+</template>
+
+<style lang="scss" scoped></style>

+ 1 - 0
src/uni-pages.d.ts

@@ -24,6 +24,7 @@ interface NavigateToOptions {
        "/subPack-common/revalue/index" |
        "/subPack-common/revalueSuccess/index" |
        "/subPack-common/user-center/index" |
+       "/subPack-smqjh/bannerDetaile/index" |
        "/subPack-smqjh/order/index" |
        "/subPack-film/choose-film/index" |
        "/subPack-film/choose-seat/index" |