zj
2024-06-03 65c203bea3b5cd4052f25ca2150b1152679f69e6
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!--  -->
<template>
  <div>
    <div class="top_icon">
      <div class="left_back" @click="handleBack()">
        <img src="@/assets/img/zuojiantou.png" alt />
      </div>
      <div class="right_icon"></div>
    </div>
    <div class="bottomIfr" v-if="onlineShow">
      <iframe
        id="iframe"
        class="conentIfr"
        scrolling="no"
        :src="onlineService"
      ></iframe>
      <!-- <web-view :src="onlineService"></web-view> -->
    </div>
  </div>
</template>
 
<script>
import * as api from "@/axios/api";
export default {
  data() {
    return {
      onlineShow: false,
      onlineService: "",
    };
  },
  // 生命周期 - 创建完成(访问当前this实例)
  created() {
    this.getInfoSite();
  },
  // 生命周期 - 挂载完成(访问DOM元素)
  mounted() {},
  methods: {
    handleBack() {
      // 点击返回/
      this.$router.go(-1);
    },
    async getInfoSite() {
      let data = await api.getInfoSite();
      if (data.status === 0) {
        this.onlineService = data.data.onlineService;
        console.log(data.data.onlineService);
        this.onlineShow = true;
 
        // var iframe = document.createElement('iframe');
        // console.log(iframe);
        // iframe.src = 'https://t.me/Mc199202';
        // iframe.sandbox = 'allow-scripts allow-same-origin';
        // document.body.appendChild(iframe);
        // console.log(iframe);
        // this.onlineService = iframe.src
        this.$store.commit("elAlertShow", {
          elAlertShow: true,
          elAlertText: data.msg,
        });
      }
    },
  },
};
</script>
<style scoped lang='less'>
/* @import url(); 引入css类 */
.top_icon {
  position: absolute;
  width: 100%;
  height: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 9999999;
 
  .left_back {
    width: 10%;
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
 
    img {
      width: 0.6rem;
      height: 0.6rem;
    }
  }
 
  .right_icon {
    width: 25%;
    height: 50%;
    display: flex;
 
    > div {
      width: 50%;
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
 
      img {
        width: 0.6rem;
        height: 0.6rem;
      }
    }
  }
}
 
.bottomIfr {
  width: 100%;
  height: calc(100vh - 0.04rem);
}
 
.conentIfr {
  width: 100%;
  height: 100%;
  border: none;
  //取消滚动条
  overflow: hidden;
}
</style>