From 7ad48ddf4ca20d0f1f894cbfe4946b2a8d7041ab Mon Sep 17 00:00:00 2001
From: lin <1005713861@163.com>
Date: Fri, 17 Apr 2026 15:05:01 +0800
Subject: [PATCH] feat: 星享购提交

---
 pages/web/index.vue |   46 ++++++++++++++++++++++++++--------------------
 1 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/pages/web/index.vue b/pages/web/index.vue
index 9d3dae4..bebc6f6 100644
--- a/pages/web/index.vue
+++ b/pages/web/index.vue
@@ -1,35 +1,41 @@
-<template>
-  <web-view class="web-view" :webview-styles="webviewStyles" :src="url" :style="{width: windowW + 'px', height: windowH + 'px'}"></web-view>
-</template>
-
 <script>
 export default {
+  name: "index",
   data() {
     return {
-      windowH: 0,
-      windowW: 0,
+      webviewUrl: `${this.$rongbeiUrl}/?appId=${uni.getStorageSync('userAppId')}&phone=${uni.getStorageSync('phone')}&appName=rongyouxuan`, // 默认地址
       webviewStyles: {
         progress: {
           color: 'transparent'
         }
-      },
-      url: ''
+      }
     }
   },
   onLoad(option) {
-    if(option.webUel) this.url = decodeURIComponent(option.webUel);
-    // 蚂蚁智能客服场景参数
-    if(option.scene) this.url += `&scene=${option.scene}`;
-    uni.setNavigationBarTitle({
-      title: option.title
-    })
-    try {
-      const res = uni.getSystemInfoSync();
-      this.windowW = res.windowWidth;
-      this.windowH = res.windowHeight;
-    } catch (e) {
-      // error
+    // 如果页面传了参数,可以拼接到 url
+    if (option && option.path) {
+      this.webviewUrl = `${this.webviewUrl}${option.path}`;
     }
   }
 }
 </script>
+
+<template>
+  <view class="container">
+    <web-view
+        :webview-styles="webviewStyles"
+        :src="webviewUrl"
+    />
+  </view>
+</template>
+
+<style scoped lang="scss">
+.container {
+  width: 100%;
+  height: 100vh;
+  display: flex;
+}
+web-view {
+  flex: 1; // 自适应填满
+}
+</style>

--
Gitblit v1.9.3