lin
2026-04-29 896df1cf0b7faff7fcc9ef6e23262228ff377e48
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<script>
export default {
  name: "alipay",
  data() {
    return {
      // webviewUrl: `${this.$rongbeiUrl}/?appId=${uni.getStorageSync('userAppId')}&phone=${uni.getStorageSync('phone')}&appName=rongyouxuan`, // 默认地址
      webviewUrl: '', // H5地址
      webviewStyles: {
        progress: {
          color: 'transparent'
        }
      }
    }
  },
  onLoad(option) {
    // 如果页面传了参数,可以拼接到 url
    if (option && option.url) {
      this.webviewUrl = option.url;
    }
  }
}
</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>