绿满眶商城微信小程序-uniapp
zxl
4 天以前 c9928dd4f6d25e2339ea1400f59ec58674a927a7
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
43
44
45
46
47
48
49
50
51
52
53
<template>
  <view class="web-view">
    <web-view :webview-styles="webviewStyles" :src="src"></web-view>
  </view>
</template>
 
<script>
import configs from "@/config/config";
import storage from "@/utils/storage";
export default {
  data() {
    return {
      configs,
      storage,
      webviewStyles: {
        progress: {
          color: this.$lightColor,
        },
      },
      src: "",
    };
  },
  onLoad(params) {
    // params.IM ? (this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}&id=${params.IM}`): (this.src = decodeURIComponent(params.src));
    if(params.IM)
    {
        if(params.IM==0)
        {
            this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}`;
        }
        else
        {
            this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}&id=${params.IM}`;
        }
    }
    else
    {
        this.src = decodeURIComponent(params.src);
        console.log(this.src);
    }
    
  },
};
</script>
 
<style lang="scss" scoped>
.web-view {
  /deep/ .web-view {
    padding: 0;
    margin: 0;
  }
}
</style>