detail.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <template>
  2. <view class="border">
  3. <view class="header">
  4. <!-- <image src="../../static/img/header.png" mode=""></image> -->
  5. </view>
  6. <view class="content">
  7. <view class="title">
  8. {{list.title}}
  9. </view>
  10. <view class="title1">
  11. <view class="time">
  12. 更新时间:{{list.release_time}}
  13. </view>
  14. </view>
  15. <view class="text">
  16. <parse :content="list.body"></parse>
  17. <view class="source">
  18. <view class="">
  19. 数据来源
  20. </view>
  21. <view class="">
  22. {{list.source}}
  23. </view>
  24. </view>
  25. </view>
  26. <view class="ad">
  27. <view class="ad-left">
  28. <image src="../../static/img/erwei1.jpg" mode=""></image>
  29. </view>
  30. <view class="ad-right">
  31. <view class="text1" @click="follow">
  32. 关注公众号即可查询更多政策
  33. </view>
  34. <view class="text2">
  35. 亲,微信规定,只有关注公众号才能获取变化提醒。
  36. </view>
  37. </view>
  38. </view>
  39. <view class="tip">
  40. 免责说明:本页面信息仅提供参考,数据来源于官方.如要前往某地,可咨询当地社区办事处或当地政府.
  41. </view>
  42. </view>
  43. <view class="bottom-bt">
  44. <view class="left" @click="shareImage">
  45. 分享
  46. </view>
  47. <view class="right" @click="feedBack">
  48. 信息反馈
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. import {
  55. html2convas
  56. } from "../../static/html2canvas.js"
  57. import parse from '../../uParse-master/src/wxParse.vue'
  58. export default {
  59. data() {
  60. return {
  61. list:uni.getStorageSync('list'),
  62. content: "",
  63. isShow: false,
  64. Height: "",
  65. result: ""
  66. }
  67. },
  68. onLoad(options) {
  69. let list = uni.getStorageSync('list')
  70. console.log(list, 'list')
  71. //自定义分享
  72. const script = document.createElement('script')
  73. script.style = 'text/javascript';
  74. script.src = 'http://res.wx.qq.com/open/js/jweixin-1.6.0.js';
  75. document.getElementsByTagName('head')[0].appendChild(script);
  76. script.onload = () => {
  77. uni.request({
  78. url: 'http://epidemic.site.ximengnaikang.com/api/v1/wechat/share', //仅为示例,并非真实接口地址。
  79. method: 'POST',
  80. data: {
  81. url: location.href,
  82. apis: 'updateAppMessageShareData'
  83. },
  84. success: (res) => {
  85. wx.config({
  86. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  87. appId: res.data.data.appId, // 必填,公众号的唯一标识
  88. timestamp: res.data.data.timestamp, // 必填,生成签名的时间戳
  89. nonceStr: res.data.data.nonceStr, // 必填,生成签名的随机串
  90. signature: res.data.data.signature, // 必填,签名
  91. jsApiList: res.data.data.jsApiList // 必填,需要使用的JS接口列表
  92. })
  93. setTimeout(function() {
  94. wx.ready(function() { //需在用户可能点击分享按钮前就先调用
  95. wx.updateAppMessageShareData({
  96. title: '疫情隔离政策查询', // 分享标题
  97. desc: '足不出户即可查询,隔离政策最新情况信息', // 分享描述
  98. link: location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  99. imgUrl: 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3363295869,2467511306&fm=26&gp=0.jpg', // 分享图标网络图片
  100. success: function() {
  101. // 设置成功
  102. }
  103. })
  104. });
  105. }, 2000)
  106. }
  107. })
  108. }
  109. },
  110. methods: {
  111. //信息反馈
  112. feedBack() {
  113. uni.navigateTo({
  114. url: './feedBack'
  115. })
  116. },
  117. shareImage: function() {
  118. let list = JSON.stringify(this.list)
  119. console.log(this.list, "llll")
  120. uni.navigateTo({
  121. url: './share?list=' + list
  122. })
  123. },
  124. source:function(){
  125. console.log('909090')
  126. let url=this.list.source_link
  127. // let url="https://uniapp.dcloud.io/"
  128. location.href= url
  129. },
  130. //关注公众号
  131. follow:function(){
  132. uni.navigateTo({
  133. url:"./follow"
  134. })
  135. }
  136. },
  137. components: {
  138. parse
  139. }
  140. }
  141. </script>
  142. <style>
  143. page {
  144. height: 100vh;
  145. }
  146. .border {
  147. /* height: 100vh; */
  148. padding-bottom: 100upx;
  149. /* padding-bottom: 70upx; */
  150. /* position: relative; */
  151. }
  152. .header {
  153. width: 100%;
  154. height: 396upx;
  155. background-image: url(../../static/img/header.png);
  156. background-size: 100% auto;
  157. background-repeat: no-repeat;
  158. }
  159. /* .header image{
  160. width: 100%;
  161. height: 396upx;
  162. } */
  163. .content {
  164. padding: 30upx 30upx 130upx 30upx;
  165. /* padding-bottom: 0; */
  166. /* height: 900px; */
  167. }
  168. .title {
  169. font-size: 48upx;
  170. font-weight: 500;
  171. /* line-height: 78upx; */
  172. color: #333333;
  173. opacity: 1;
  174. }
  175. .title1 {
  176. display: flex;
  177. height: 78upx;
  178. }
  179. .time {
  180. flex: 1;
  181. font-size: 24upx;
  182. font-weight: 400;
  183. line-height: 78upx;
  184. color: #999999;
  185. opacity: 1;
  186. }
  187. .history {
  188. flex: 1;
  189. text-align: right;
  190. font-size: 28upx;
  191. font-weight: 500;
  192. line-height: 78upx;
  193. color: #23459D;
  194. opacity: 1;
  195. }
  196. .text {
  197. font-size: 28upx;
  198. font-weight: 400;
  199. line-height: 42upx;
  200. color: #333333;
  201. opacity: 1;
  202. }
  203. .ad {
  204. /* padding: 26upx; */
  205. width: 100%;
  206. /* margin: 0 auto; */
  207. padding: 30upx 0;
  208. margin-top: 60upx;
  209. display: flex;
  210. background-image: url(../../static/img/ad.png);
  211. background-size: 100% 100%;
  212. background-repeat: no-repeat;
  213. }
  214. .ad-left {
  215. flex: 0 0 30%;
  216. }
  217. .ad-left image {
  218. height:184upx;
  219. width: 184upx;
  220. /* line-height: 184upx; */
  221. margin-left: 28upx;
  222. }
  223. .ad-right {
  224. padding: 0 26upx;
  225. flex:1;
  226. }
  227. .text1 {
  228. margin-top: 18upx;
  229. height: 64upx;
  230. line-height: 64upx;
  231. border: 2upx solid #FFFFFF;
  232. border-radius: 340upx;
  233. font-size: 28upx;
  234. text-align: center;
  235. font-weight: 400;
  236. color: #FFFFFF;
  237. }
  238. .source{
  239. text-align: right;
  240. }
  241. .text2 {
  242. /* padding: 0 30upx; */
  243. font-size: 24upx;
  244. text-align: center;
  245. font-weight: 400;
  246. line-height: 40upx;
  247. color: #FFFFFF;
  248. opacity: 1;
  249. margin-top: 10upx;
  250. }
  251. .tip {
  252. margin-top: 42upx;
  253. font-size: 24upx;
  254. font-weight: 400;
  255. line-height: 36upx;
  256. color: #999999;
  257. opacity: 1;
  258. }
  259. .bottom-bt {
  260. padding: 10upx 0;
  261. width: 100%;
  262. position: fixed;
  263. bottom: 0;
  264. height: 80upx;
  265. display: flex;
  266. background-color: #FFFFFF;
  267. z-index: 999;
  268. border-top: solid 4upx #EEEEEE;
  269. }
  270. .left,
  271. .right {
  272. flex: 0 0 30%;
  273. height: 80upx;
  274. line-height: 80upx;
  275. background-color: #23459D;
  276. color: #FFFFFF;
  277. font-size: 32upx;
  278. text-align: center;
  279. border-radius: 40upx;
  280. }
  281. .left {
  282. margin-left: 15%;
  283. margin-right: 5%;
  284. }
  285. .right {
  286. margin-left: 5%;
  287. margin-right: 15%;
  288. }
  289. .body {
  290. position: relative;
  291. /* height:100%; */
  292. padding: 0 30upx;
  293. padding-top: 100upx;
  294. padding-bottom: 80upx;
  295. background: linear-gradient(180deg, #1E37EB 0%, #0FC6A1 100%);
  296. }
  297. .content {
  298. padding: 90upx 34upx;
  299. background-color: #FFFFFF;
  300. border-radius: 24upx;
  301. margin-bottom: 60upx;
  302. }
  303. .btimg {
  304. position: absolute;
  305. left: 0;
  306. bottom: 0;
  307. }
  308. .icon {
  309. position: absolute;
  310. top: 46upx;
  311. right: 30upx;
  312. height: 160upx;
  313. width: 160upx;
  314. }
  315. .title_1 {
  316. text-align: center;
  317. font-size: 52upx;
  318. font-weight: bold;
  319. line-height: 88upx;
  320. color: #23459D;
  321. opacity: 1;
  322. }
  323. /* #shareImage {
  324. position: fixed;
  325. z-index: -999999;
  326. top: 0;
  327. left: 0;
  328. } */
  329. .title_2 {
  330. text-align: center;
  331. font-size: 40upx;
  332. font-weight: bold;
  333. line-height: 68upx;
  334. color: #333333;
  335. opacity: 1;
  336. margin-top: 20upx;
  337. margin-bottom: 40upx;
  338. }
  339. .text_1 {
  340. font-size: 28upx;
  341. font-weight: 400;
  342. line-height: 42upx;
  343. color: #333333;
  344. opacity: 1;
  345. }
  346. .tip_share {
  347. display: flex;
  348. margin-top: 64upx;
  349. }
  350. .left_share {
  351. flex: 1;
  352. }
  353. .left_share image {
  354. height: 120upx;
  355. width: 120upx;
  356. margin-left: 106upx;
  357. right: 34upx;
  358. }
  359. .right_share {
  360. text-align: right;
  361. margin-top: 15upx;
  362. font-size: 28upx;
  363. font-weight: 400;
  364. line-height: 42upx;
  365. color: #333333;
  366. opacity: 1;
  367. }
  368. </style>