share.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  6. <meta name="description" content="分享文章">
  7. <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
  8. <link rel="stylesheet" href="../static/css/index.css?v=1.0.0.1">
  9. <link rel="stylesheet" href="../static/css/vant.css" />
  10. <script src="../static/js/vender/vue/vue.min.js"></script>
  11. <script src="../static/js/vender/vue/vant.min.js"></script>
  12. <script src="../static/js/vender/config.js"></script>
  13. <title>分享文章</title>
  14. <style>
  15. .container {
  16. display: flex;
  17. height: 100vh;
  18. /* align-items: center;
  19. justify-content: center; */
  20. }
  21. .footer {
  22. position: fixed;
  23. bottom: 0rem;
  24. height: 1.36rem;
  25. padding: 0 1.14rem;
  26. width: 100%;
  27. display: flex;
  28. justify-content: center;
  29. left: 0;
  30. }
  31. .footer img {
  32. width: 5.22rem;
  33. height: 100%;
  34. }
  35. .hideContainer {
  36. width: 7.5rem;
  37. display: flex;
  38. justify-content: center;
  39. align-items: center;
  40. height: calc(100vh - 1.36rem);
  41. text-align: center;
  42. margin: 0 auto;
  43. }
  44. .hideContainer img {
  45. width: 2.8rem;
  46. height: 2.8rem;
  47. }
  48. .hideContainer p {
  49. font-size: 0.28rem;
  50. margin-top: 0.3rem;
  51. font-family: PingFangSC-Regular, PingFang SC;
  52. color: #999999;
  53. }
  54. .top-content {
  55. width: 7.5rem;
  56. margin: 0 auto;
  57. padding: 0.2rem 0.3rem;
  58. }
  59. .top-content .title {
  60. font-size: 0.44rem;
  61. font-family: PingFangSC-Medium, PingFang SC;
  62. color: #000000;
  63. letter-spacing: 0.01rem;
  64. margin-bottom: 0.2rem;
  65. }
  66. .topic-info {
  67. padding-bottom: 1.6rem;
  68. display: none;
  69. }
  70. .line {
  71. width: 100%;
  72. height: 0.02rem;
  73. background: #D8D8D8;
  74. margin-bottom: 0.2rem;
  75. }
  76. .createTime {
  77. font-size: 0.28rem;
  78. font-family: PingFangSC-Regular, PingFang SC;
  79. font-weight: 400;
  80. color: #999999;
  81. margin-bottom: 0.2rem;
  82. }
  83. .topic-info img {
  84. max-width: 100%;
  85. width: auto;
  86. height: auto;
  87. border-radius: 0.2rem;
  88. margin-bottom: 0.2rem;
  89. margin-top: 0.2rem;
  90. }
  91. .topic-info {
  92. font-size: 0.32rem;
  93. letter-spacing: 0.02rem;
  94. font-family: PingFangSC-Regular, PingFang SC;
  95. color: #333333;
  96. }
  97. .topic-info p {
  98. font-size: 0.36rem;
  99. font-family: PingFangSC-Regular, PingFang SC;
  100. font-weight: 400;
  101. color: #333333;
  102. letter-spacing: 0.02rem;
  103. }
  104. h1,
  105. h2,
  106. h3,
  107. h4,
  108. h5 {
  109. font-size: 0.32rem;
  110. font-family: PingFangSC-Semibold, PingFang SC;
  111. font-weight: 600;
  112. color: #333333;
  113. /* margin-bottom: 0.12rem;
  114. margin-top: 0.12rem; */
  115. }
  116. .hide {
  117. display: none !important;
  118. }
  119. .prompt {
  120. position: fixed;
  121. top: 0;
  122. left: 0;
  123. bottom: 0;
  124. right: 0;
  125. width: 100%;
  126. height: 100%;
  127. background: rgba(0, 0, 0, 0.5);
  128. /* display: none; */
  129. }
  130. .prompt img {
  131. width: 200px;
  132. position: absolute;
  133. right: 15px;
  134. top: 6px;
  135. }
  136. </style>
  137. </head>
  138. <body>
  139. <div id="app" v-cloak class="container">
  140. <div v-if='isshow' class="hideContainer">
  141. <div>
  142. <img src="../static/offImg/404.png" alt="" />
  143. <p>该资讯已被删除</p>
  144. </div>
  145. </div>
  146. <div class="top-content" v-if='!isshow&&topic.content'>
  147. <p class="hide">分享文章</p>
  148. <p class="title">{{topic.title}}</p>
  149. <p class="createTime"> 发布日期:{{topic.createTime}}</p>
  150. <p class="line"></p>
  151. <div v-html="topic.content" class="topic-info" id="topic-info"></div>
  152. </div>
  153. <div class="footer">
  154. <img src="../static/offImg/downLoad.png" alt="" @click="download" />
  155. </div>
  156. <div class="prompt" v-show='showD'>
  157.         <img src="../static/offImg/zhiyin_pic.png" alt="">
  158. </div>
  159. </div>
  160. <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  161. <script src="../static/js/vender/vue/axios.min.js"></script>
  162. <script src="../static/js/vender/vue/config.js"></script>
  163. <script src="../static/js/vender/vue/api.js"></script>
  164. <script type="text/javascript">
  165. new Vue({
  166. el: '#app',
  167. data: {
  168. isshow: false,
  169. id: GetRequest().id ? GetRequest().id : 404,
  170. topic: {},
  171. showD: false,
  172. },
  173. created() {
  174. // window.location.href = 'investigate.html'
  175. },
  176. mounted() {
  177. this.getList()
  178. },
  179. methods: {
  180. download() {
  181. var u = navigator.userAgent,
  182. app = navigator.appVersion;
  183. var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
  184. var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  185. if (isAndroid) {
  186. this.getBrowser()
  187. } else if (isIOS) {
  188. window.location.href = 'https://www.pgyer.com/gemini6';
  189. } else {}
  190. },
  191. getBrowser() {
  192. var ua = navigator.userAgent.toLowerCase();
  193. if (ua.match(/MicroMessenger/i) == "micromessenger" || ua.match(/QQ\/[0-9]/i)) {
  194. this.showD = true;
  195. return;
  196. } else {
  197. if(window.location.href.includes('prese.phone.androidscloud.com')){
  198. window.location.href = 'http://14.18.190.144:18888/admin/attachment/download/2117e9b7f3734b16b81b9d7bb1c5a601'
  199. } else {
  200. window.location.href ='http://www.androidscloud.com/admin/attachment/download/2117e9b7f3734b16b81b9d7bb1c5a601';
  201. }
  202. }
  203. },
  204. getList() {
  205. this.$toast.loading({
  206. duration: 0,
  207. message: '加载中...',
  208. forbidClick: true,
  209. loadingType: 'spinner',
  210. });
  211. getEvantDetails(this.id).then(res => {
  212. this.$toast.clear();
  213. console.log(res);
  214. if (res.status == 0) {
  215. if (res.data) {
  216. this.isshow = false;
  217. this.topic = res.data;
  218. var u = navigator.userAgent,
  219. app = navigator.appVersion;
  220. var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
  221. var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  222. // if (isAndroid && !window.native) {
  223. setTimeout(() => {
  224. let node = document.getElementById('topic-info');
  225. let span = document.getElementsByTagName('span');
  226. node.firstChild.style.backgroundColor = '#FFFFFF';
  227. node.style.display = 'block';
  228. for(var o in span){
  229. if(span[o].style){
  230. span[o].style.color = '#333333';
  231. }
  232. }
  233. },100)
  234. // }
  235. if (isAndroid && !window.native) {
  236. setTimeout(() => {
  237. let node = document.getElementById('topic-info');
  238. node.firstChild.style.backgroundColor = '#FFFFFF';
  239. node.style.display = 'block';
  240. },100)
  241. }
  242. if(isIOS) {
  243. try {
  244. window.webkit.messageHandlers.share.postMessage();
  245. } catch(error) {
  246. setTimeout(() => {
  247. let node = document.getElementById('topic-info');
  248. let span = document.getElementsByTagName('span');
  249. node.firstChild.style.backgroundColor = '#FFFFFF';
  250. node.style.display = 'block';
  251. for(var o in span){
  252. if(span[o].style){
  253. span[o].style.color = '#333333';
  254. }
  255. }
  256. },100)
  257. }
  258. }
  259. } else {
  260. this.isshow = true;
  261. }
  262. } else {
  263. }
  264. }).catch((error) => {
  265. console.log(error)
  266. this.$toast('网络异常');
  267. });
  268. }
  269. }
  270. })
  271. </script>
  272. </body>
  273. </html>