Преглед изворни кода

feat: 新增加油子包页面并更新页面配置

- 新增 refueling 子包,包含 commonTab 和 webView 页面
- 在 pages.json 中注册新的子包路由
- 更新 uni-pages.d.ts 类型定义,添加新页面路径

fix: 优化店铺导航功能并修复潜在错误

- 在 handleNav 方法中添加 shopInfo 验证,避免空值导致的错误
- 添加定位失败时的错误处理回调
- 修复店铺信息显示样式问题

refactor: 调整试用环境配置

- 注释掉旧的试用服务器地址 http://47.109.84.152:8081
- 启用新的试用服务器地址 https://smqjh.api.zswlgz.com

refactor: 移除 curtain 组件类型声明

- 从 components.d.ts 中移除 WdCurtain 组件的类型声明
zhangtao пре 1 дан
родитељ
комит
fde5820c6e
5 измењених фајлова са 36 додато и 7 уклоњено
  1. 0 1
      src/components.d.ts
  2. 2 2
      src/config/index.ts
  3. 21 0
      src/pages.json
  4. 10 3
      src/subPack-djk/shopinfo/index.vue
  5. 3 1
      src/uni-pages.d.ts

+ 0 - 1
src/components.d.ts

@@ -25,7 +25,6 @@ declare module 'vue' {
     WdCircle: typeof import('wot-design-uni/components/wd-circle/wd-circle.vue')['default']
     WdConfigProvider: typeof import('wot-design-uni/components/wd-config-provider/wd-config-provider.vue')['default']
     WdCountDown: typeof import('wot-design-uni/components/wd-count-down/wd-count-down.vue')['default']
-    WdCurtain: typeof import('wot-design-uni/components/wd-curtain/wd-curtain.vue')['default']
     WdDivider: typeof import('wot-design-uni/components/wd-divider/wd-divider.vue')['default']
     WdIcon: typeof import('wot-design-uni/components/wd-icon/wd-icon.vue')['default']
     WdInput: typeof import('wot-design-uni/components/wd-input/wd-input.vue')['default']

+ 2 - 2
src/config/index.ts

@@ -19,9 +19,9 @@ const mapEnvVersion = {
    */
   // trial: "http://192.168.1.166:8080/jeecg-boot",
   // trial: 'http://192.168.0.157:8080',
-  trial: 'http://47.109.84.152:8081',
+  // trial: 'http://47.109.84.152:8081',
   // trial: 'http://192.168.1.166:8080',
-  // trial: 'https://smqjh.api.zswlgz.com',
+  trial: 'https://smqjh.api.zswlgz.com',
   /**
    * 正式版
    */

+ 21 - 0
src/pages.json

@@ -576,6 +576,27 @@
           }
         }
       ]
+    },
+    {
+      "root": "subPack-refueling",
+      "pages": [
+        {
+          "path": "commonTab/index",
+          "name": "refueling-tabbar",
+          "islogin": false,
+          "style": {
+            "navigationBarTitleText": "加油"
+          }
+        },
+        {
+          "path": "webView/index",
+          "name": "refueling-webview",
+          "islogin": false,
+          "style": {
+            "navigationBarTitleText": "支付"
+          }
+        }
+      ]
     }
   ]
 }

+ 10 - 3
src/subPack-djk/shopinfo/index.vue

@@ -13,9 +13,16 @@ onLoad((options: any) => {
   getShopInfo(Number(options.id))
 })
 function handleNav() {
+  if (!shopInfo.value) {
+    useGlobalToast().show('商家信息获取失败!')
+    return
+  }
   uni.openLocation({
-    latitude: Number(shopInfo.value?.shopLat),
-    longitude: Number(shopInfo.value?.shopLng),
+    latitude: Number(shopInfo.value.shopLat),
+    longitude: Number(shopInfo.value.shopLng),
+    fail: (e) => {
+      console.log(e, '打开失败')
+    },
   })
 }
 function handlePhone() {
@@ -51,7 +58,7 @@ function handlePhone() {
           营业中 {{ shopInfo.businessTime }}
         </view>
         <view class="mt20rpx h160rpx flex items-center justify-between bg-cover bg-center px24rpx" :style="{ backgroundImage: `url(${StaticUrl}/djk-shop-nav-bg.png)` }">
-          <view class="flex items-center">
+          <view class="line-clamp-2 w450rpx flex items-center">
             <image
               :src="`${StaticUrl}/location-black.png`"
               class="mr16rpx h-33.8rpx min-w-28.97rpx w-28.97rpx"

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

@@ -54,7 +54,9 @@ interface NavigateToOptions {
        "/subPack-djk/goodsinfo/index" |
        "/subPack-djk/orderDetaile/index" |
        "/subPack-djk/shopinfo/index" |
-       "/subPack-djk/welfare/index";
+       "/subPack-djk/welfare/index" |
+       "/subPack-refueling/commonTab/index" |
+       "/subPack-refueling/webView/index";
 }
 interface RedirectToOptions extends NavigateToOptions {}