index.vue 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. </div>
  6. <div class="app-container">
  7. <el-row :gutter="20">
  8. <el-col :span="12">
  9. <div class="success">
  10. <h1 class="name">欢迎来到微官网主页</h1>
  11. <div class="tips">您可以手机扫码访问或在右侧预览</div>
  12. <div id="qrcode" class="qrcode"></div>
  13. <router-link to="/site/preview">
  14. <el-button type="primary">进入微官网后台</el-button>
  15. </router-link>
  16. </div>
  17. </el-col>
  18. <el-col :span="12">
  19. <div class="phone">
  20. <div class="phonetwo">9:42</div>
  21. <div class="phonethree">
  22. <img src="static/images/u189.png" style="width:100%;height:100%" />
  23. </div>
  24. <div class="phonefour">
  25. <img src="static/images/u187.png" style="width:100%;height:100%" />
  26. </div>
  27. <div class="phonefive">
  28. <img src="static/images/u188.png" style="width:100%;height:100%" />
  29. </div>
  30. <div class="phoneone">
  31. <iframe
  32. class="myIframe"
  33. :src="this.url"
  34. width="100%"
  35. height="100%"
  36. marginwidth="0"
  37. frameborder="no"
  38. scrolling="no"
  39. ></iframe>
  40. </div>
  41. </div>
  42. </el-col>
  43. </el-row>
  44. </div>
  45. </div>
  46. </template>
  47. <script>
  48. import BreadCrumb from "../components/bread-crumb";
  49. import QRCode from "qrcodejs2";
  50. // import {GetDefaultData,GetUserOrgid} from '@/api/site/site';
  51. import Vue from "vue";
  52. export default {
  53. name: "site",
  54. components: {
  55. BreadCrumb
  56. },
  57. data() {
  58. return {
  59. crumbs: [{ path: false, name: "微网站" }],
  60. codeImg: require("../../assets/home/wei.jpg"),
  61. usreOrgID: "",
  62. // url:"http://microweb.kuyicloud.com/#/microHome?orgid="+this.$store.getters.xt_user.org_id,
  63. url: "http://jk.test.sgjyun.com/#/microHome?orgid=" + this.$store.getters.xt_user.org_id
  64. };
  65. },
  66. methods: {
  67. qrcode() {
  68. let qrcode = new QRCode("qrcode", {
  69. width: 100,
  70. height: 100, // 高度
  71. // text: 'http://microweb.kuyicloud.com/#/microHome?orgid='+this.$store.getters.xt_user.org_id // 二维码内容
  72. text:"http://jk.test.sgjyun.com/#/microHome?orgid=" + this.$store.getters.xt_user.org_id // 二维码内容
  73. // render: 'canvas' // 设置渲染方式(有两种方式 table和canvas,默认是canvas)
  74. // background: '#f0f'
  75. // foreground: '#ff0'
  76. });
  77. console.log(qrcode);
  78. },
  79. GetDefaultData() {
  80. GetDefaultData().then(response => {
  81. if (response.data.state == 1) {
  82. var model = response.data.data.model;
  83. }
  84. });
  85. },
  86. GetUserOrgid() {
  87. GetUserOrgid().then(response => {
  88. if (response.data.state == 1) {
  89. var usreOrgID = response.data.data.usreOrgID;
  90. this.usreOrgID = response.data.data.usreOrgID;
  91. console.log("我的世界我做主", usreOrgID);
  92. }
  93. });
  94. }
  95. },
  96. mounted() {
  97. this.qrcode();
  98. },
  99. created() {
  100. // this.GetUserOrgid();
  101. }
  102. };
  103. </script>
  104. <style rel="stylesheet/scss" lang="scss" scoped>
  105. .myIframe {
  106. border-radius: 15px;
  107. }
  108. .success {
  109. text-align: center;
  110. align-items: center;
  111. display: flex;
  112. flex-direction: column;
  113. .name {
  114. font-size: 30px;
  115. font-weight: bold;
  116. color: #333;
  117. margin: 0;
  118. padding-bottom: 10px;
  119. }
  120. .tips {
  121. line-height: 30px;
  122. padding-bottom: 10px;
  123. }
  124. .site-code {
  125. width: 200px;
  126. padding-bottom: 10px;
  127. img {
  128. width: 100%;
  129. }
  130. }
  131. .qrcode {
  132. margin-bottom: 10px;
  133. width: 100px;
  134. height: 100px;
  135. }
  136. }
  137. .phone {
  138. width: 380px;
  139. height: 750px;
  140. background: url(../../assets/img/phone.png) 50% no-repeat;
  141. }
  142. .phoneone {
  143. position: absolute;
  144. width: 320px;
  145. height: 660px;
  146. // border: solid 1px red;
  147. margin-top: 60px;
  148. margin-left: 30px;
  149. text-align: center;
  150. }
  151. .phonetwo {
  152. position: absolute;
  153. width: 50px;
  154. height: 20px;
  155. // border:solid 1px blue;
  156. margin-left: 55px;
  157. margin-top: 40px;
  158. }
  159. .phonethree {
  160. position: absolute;
  161. width: 20px;
  162. height: 20px;
  163. margin-left: 280px;
  164. margin-top: 40px;
  165. }
  166. .phonefour {
  167. position: absolute;
  168. width: 20px;
  169. height: 20px;
  170. margin-left: 300px;
  171. margin-top: 40px;
  172. }
  173. .phonefive {
  174. position: absolute;
  175. width: 20px;
  176. height: 20px;
  177. margin-left: 325px;
  178. margin-top: 40px;
  179. }
  180. </style>