index1.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view id="shareImage">
  3. <view class="border" >
  4. <view class="content">
  5. <view class="title_1" @click="drewImage">
  6. <text>郑州</text>>>><text>安阳</text>
  7. </view>
  8. <view class="title_2">
  9. 郑州回安阳过年需要隔离吗?12123655
  10. </view>
  11. <view class="text_1">
  12. 对于在湖北入境的人员,实施“14+14”的健康管理措施。即14天集中隔离医学观察,期间进行2次核酸检测和1次抗体检测;集中隔离医学观察期满后再实施14天居家医学观察,期间进行两次核酸检测。入境人员隔离点应在隔离对象隔离期满前3天,将隔离人员相关信息通知其地新冠肺炎疫情防控指挥部,以便当地落实居家医学观察。
  13. 天居家医学观察,期间进行两次核酸检测。入境人员隔离点应在隔离对象隔离期满前3天,将隔离人员相关信息通知其地新冠肺炎疫情防控指挥部,以便当地落实居家医学观察。
  14. </view>
  15. <view class="tip_share">
  16. <view class="left_share">
  17. <image src="../../static/img/erwei.jpg" mode=""></image>
  18. </view>
  19. <view class="right_share">
  20. <view class="">
  21. 数据来源(可点击,数据来源列表)
  22. </view>
  23. <view class="">
  24. <text>xxxx</text>城市疫情防控指挥中心
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <image class="btimg" src="../../static/img/btimg.png" mode=""></image>
  30. <image src="../../static/img/icon6.png" mode="" class="icon"></image>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import html2canvas from '@/static/html/js/html2canvas.js';
  36. export default {
  37. data() {
  38. return{}
  39. },
  40. methods:{
  41. drewImage(){
  42. html2canvas(document.querySelector('#shareImage'),{
  43. useCORS: true,
  44. }).then(canvas => {
  45. let previewFile = canvas.toDataURL('image/png');
  46. this.download(previewFile)
  47. });
  48. },
  49. download(url) {
  50. var oA = document.createElement("a");
  51. oA.download = '';// 设置下载的文件名,默认是'下载'
  52. oA.href = url;
  53. document.body.appendChild(oA);
  54. oA.click();
  55. oA.remove(); // 下载之后把创建的元素删除
  56. },
  57. }
  58. }
  59. </script>
  60. <style>
  61. body {
  62. height:100% ;
  63. margin: 0;
  64. padding: 0;
  65. }
  66. #size{
  67. margin: 30px;
  68. background-color: #00BFFF;
  69. }
  70. .border {
  71. /* width: 100%; */
  72. position: relative;
  73. /* height:100%; */
  74. padding: 0 15px;
  75. padding-top: 50px;
  76. padding-bottom: 40px;
  77. /* height: 600px; */
  78. background: linear-gradient(180deg, #1E37EB 0%, #0FC6A1 100%);
  79. }
  80. .content {
  81. padding: 45px 17px;
  82. background-color: #FFFFFF;
  83. border-radius: 12px;
  84. margin-bottom: 170px;
  85. }
  86. .btimg {
  87. position: absolute;
  88. left: 0;
  89. bottom: 0;
  90. }
  91. .icon {
  92. position: absolute;
  93. top: 23px;
  94. right: 15px;
  95. height: 80px;
  96. width: 80px;
  97. }
  98. .title_1 {
  99. text-align: center;
  100. font-size: 26px;
  101. font-weight: bold;
  102. line-height: 88px;
  103. color: #23459D;
  104. opacity: 1;
  105. }
  106. .title_2 {
  107. text-align: center;
  108. font-size: 20px;
  109. font-weight: bold;
  110. line-height: 34px;
  111. color: #333333;
  112. opacity: 1;
  113. margin-top: 10px;
  114. margin-bottom: 20px;
  115. }
  116. .text_1 {
  117. font-size: 14px;
  118. font-weight: 400;
  119. line-height: 21px;
  120. color: #333333;
  121. opacity: 1;
  122. }
  123. .tip_share {
  124. display: flex;
  125. margin-top: 32px;
  126. }
  127. .left_share {
  128. flex: 1;
  129. }
  130. .left_share image {
  131. height: 60px;
  132. width: 60px;
  133. margin-left: 30px;
  134. /* right: 17px; */
  135. }
  136. .right_share {
  137. text-align: right;
  138. margin-top: 8px;
  139. font-size: 14px;
  140. font-weight: 400;
  141. line-height: 21px;
  142. color: #333333;
  143. opacity: 1;
  144. }
  145. </style>