style.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <div class="detail">
  3. <div class="detail-body">
  4. <div class="detail-card top-tit-card">
  5. <div class="left">
  6. <i class="iconfont icon-laba"></i>
  7. </div>
  8. <div class="right">
  9. <div class="top">
  10. {{ activityDetail.activityName }}
  11. </div>
  12. <div class="bottom">
  13. <span>{{ activityDetail.updatedAt }}</span>
  14. <span>园区管委会</span>
  15. </div>
  16. </div>
  17. <div></div>
  18. </div>
  19. <div class="detail-card info">
  20. <div class="card-title">详情</div>
  21. <div
  22. class="text"
  23. style="font-size: 24rpx"
  24. v-html="activityDetail.styleContent"
  25. ></div>
  26. </div>
  27. </div>
  28. <div class="white-bottom"></div>
  29. </div>
  30. </template>
  31. <script>
  32. import TelNum from "../../subPackages/components/tel-number";
  33. import { clickCollect, getUserLocalStorageInfo } from "@/js_sdk/http";
  34. import { getActivityById1 } from "@/js_sdk/api_activity";
  35. export default {
  36. components: {
  37. TelNum,
  38. },
  39. data() {
  40. return {
  41. signInfo: {},
  42. signInCode: "",
  43. active: false,
  44. id: "",
  45. activityDetail: {
  46. referenceId: "",
  47. },
  48. number: 0,
  49. };
  50. },
  51. onLoad(option) {
  52. // this.getScanCode();
  53. console.log("option", option.id);
  54. this.id = option.id;
  55. this.getActivityById1();
  56. },
  57. methods: {
  58. openFile(url) {
  59. uni.downloadFile({
  60. url: url, // 网络文档地址
  61. success: (data) => {
  62. if (data.statusCode === 200) {
  63. uni.saveFile({
  64. tempFilePath: data.tempFilePath, //临时路径
  65. success: function (res) {
  66. // 保存路径
  67. setTimeout(() => {
  68. //打开文档查看
  69. uni.openDocument({
  70. filePath: res.savedFilePath,
  71. success: function (res) {},
  72. });
  73. }, 3000);
  74. },
  75. });
  76. }
  77. },
  78. fail: (err) => {
  79. uni.showToast({
  80. title: "失败请重新下载",
  81. });
  82. },
  83. });
  84. },
  85. getActivityById1() {
  86. const _this = this;
  87. getActivityById1(this.id, getUserLocalStorageInfo().user.id).then(
  88. (res) => {
  89. if (res.data) {
  90. _this.activityDetail = res.data;
  91. this.activityDetail.styleContent = res.data.styleContent.replace(
  92. "<img",
  93. "<img style='max-width:100%'"
  94. );
  95. _this.activityDetail.updatedAt = this.$common.transServDate(
  96. _this.activityDetail.updatedAt
  97. );
  98. }
  99. }
  100. );
  101. },
  102. },
  103. };
  104. </script>
  105. <style lang="scss" type="text/scss" >
  106. .detail {
  107. box-sizing: border-box;
  108. background-color: #f2f2f2;
  109. padding: 20rpx 30rpx 140rpx;
  110. overflow-y: auto;
  111. .card-title {
  112. background: #2a3980;
  113. color: #fff;
  114. font-size: 3.467vw;
  115. line-height: 11.2vw;
  116. padding: 0 2.667vw;
  117. }
  118. .detail-body {
  119. .detail-card {
  120. padding: 20rpx 30rpx;
  121. border-radius: 10rpx;
  122. box-sizing: border-box;
  123. background: #fff;
  124. .left {
  125. width: 70rpx;
  126. i {
  127. font-size: 50rpx;
  128. }
  129. }
  130. .right {
  131. .top {
  132. font-size: 24rpx;
  133. color: #666666;
  134. }
  135. }
  136. &:first-child {
  137. margin-bottom: 20rpx;
  138. }
  139. }
  140. .info {
  141. padding: 0;
  142. .text {
  143. padding: 30rpx;
  144. word-break: break-all;
  145. font-size: 26rpx;
  146. color: #333333;
  147. line-height: 1.4;
  148. img {
  149. max-width: 100%;
  150. }
  151. }
  152. }
  153. }
  154. }
  155. </style>
  156. <style lang="scss">
  157. </style>