detail.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <My_listbox ref="List" @getlist="getDetail">
  3. <view class="content">
  4. <view class="title" v-if="detail.title">
  5. {{ detail.title }}
  6. </view>
  7. <view v-if="detail.content" class="box">
  8. <u-parse :content="detail.content" />
  9. </view>
  10. <view v-if="showAttinfos" class="box">
  11. <view class="top">
  12. <view class="text">
  13. 附件
  14. </view>
  15. <view class="but" hover-class="navigator-hover" @click="showUModal = true">
  16. 发邮箱
  17. </view>
  18. </view>
  19. <view class="list" v-for="item in detail.attinfos" :key="item.attachmentid" @click="previewAttinof(item)"
  20. hover-class="navigator-hover">
  21. {{ item.document }}
  22. </view>
  23. <u-modal :show="showUModal" confirmColor='#C30D23' ref="uModal" showCancelButton :asyncClose="true"
  24. @confirm="onSend" @cancel="showUModal = false">
  25. <view class="slot-content">
  26. <view class="slot-title">
  27. 发送邮件
  28. </view>
  29. <view class="slot-tips">
  30. 文件将以邮件的形式发送到指定邮箱
  31. </view>
  32. <u--input :focus="showUModal" placeholder="请输入邮箱" v-model="eMail" border="bottom" clearable />
  33. </view>
  34. </u-modal>
  35. </view>
  36. </view>
  37. <view class="bottom" v-if="detail.readstatus != '已知'">
  38. <view class="but" hover-class="navigator-hover" @click="know">
  39. 确认已知晓公告
  40. </view>
  41. </view>
  42. </My_listbox>
  43. </template>
  44. <script>
  45. import { viewMedias, viewFlies, formattedFiles } from "../../utils/settleFiles"
  46. export default {
  47. data() {
  48. return {
  49. sat_noticeid: "",
  50. detail: { readstatus: '已知' },
  51. showAttinfos: false,
  52. showUModal: false,
  53. eMail: ""
  54. }
  55. },
  56. onLoad(options) {
  57. wx.setNavigationBarTitle({
  58. title: this.getApps('资料库', '/packageA/affiche/detail').remark || '企业公告',
  59. });
  60. this.sat_noticeid = options.id;
  61. this.getDetail();
  62. },
  63. methods: {
  64. getDetail() {
  65. this.$Http.basic({
  66. "id": "20221101095003",
  67. "content": {
  68. "sat_noticeid": this.sat_noticeid
  69. }
  70. }).then(res => {
  71. this.$refs.List.RefreshToComplete()
  72. console.log("获取通告详情", res)
  73. if (this.cutoff(res.msg)) return;
  74. res.data.attinfos = formattedFiles(res.data.attinfos)
  75. this.detail = res.data;
  76. this.showAttinfos = res.data.attinfos.length != 0
  77. })
  78. },
  79. onSend() {
  80. let { CheckEmail } = require("../../utils/basicInspection");
  81. if (!CheckEmail(this.eMail || '')) return this.$refs.uModal.loading = false;
  82. this.$Http.basic({
  83. "id": "20240320153302",
  84. "content": {
  85. "sat_noticeid": this.detail.sat_noticeid,
  86. "email": this.eMail
  87. }
  88. }).then(res => {
  89. console.log("发送邮件", res)
  90. if (this.cutoff(res.msg, '发送成功')) return this.$refs.uModal.loading = false;
  91. this.showUModal = false;
  92. })
  93. },
  94. know() {
  95. let that = this;
  96. uni.showModal({
  97. title: '提示',
  98. content: '是否确定已经知晓该公告',
  99. success: ({ confirm }) => {
  100. if (confirm) that.$Http.basic({
  101. "id": "20240320152902",
  102. "content": {
  103. "sat_noticeid": that.sat_noticeid
  104. }
  105. }).then(res => {
  106. if (that.cutoff(res.msg, '确定成功')) return;
  107. that.getDetail();
  108. })
  109. },
  110. })
  111. },
  112. previewAttinof(item) {
  113. if (['image', 'video'].includes(item.fileType)) {
  114. const list = this.detail.attinfos.filter(v => v.fileType == item.fileType),
  115. index = list.findIndex(v => v.attachmentid == item.attachmentid);
  116. viewMedias(list, index, item.fileType)
  117. } else {
  118. viewFlies(item)
  119. }
  120. }
  121. },
  122. }
  123. </script>
  124. <style lang="scss">
  125. .content {
  126. padding: 10px;
  127. box-sizing: border-box;
  128. .title {
  129. width: 100%;
  130. font-family: Source Han Sans SC, Source Han Sans SC;
  131. font-weight: bold;
  132. font-size: 18px;
  133. color: #333333;
  134. text-align: center;
  135. }
  136. .box {
  137. width: 100%;
  138. background: #FFFFFF;
  139. border-radius: 8px;
  140. padding: 10px;
  141. box-sizing: border-box;
  142. margin-top: 10px;
  143. .top {
  144. display: flex;
  145. justify-content: space-between;
  146. .text {
  147. font-family: PingFang SC, PingFang SC;
  148. font-weight: bold;
  149. font-size: 16px;
  150. color: #333333;
  151. }
  152. .but {
  153. width: 66px;
  154. height: 32px;
  155. background: #C30D23;
  156. border-radius: 5px;
  157. margin-top: -3px;
  158. font-family: Source Han Sans SC, Source Han Sans SC;
  159. font-size: 14px;
  160. color: #FFFFFF;
  161. line-height: 32px;
  162. text-align: center;
  163. }
  164. }
  165. }
  166. }
  167. .slot-content {
  168. width: 100%;
  169. text-align: center;
  170. .slot-title {
  171. height: 26px;
  172. font-family: Source Han Sans SC, Source Han Sans SC;
  173. font-weight: bold;
  174. font-size: 18px;
  175. color: #000000;
  176. }
  177. .slot-tips {
  178. line-height: 20px;
  179. font-family: Source Han Sans SC, Source Han Sans SC;
  180. font-size: 14px;
  181. color: #666666;
  182. margin-bottom: 30px;
  183. margin-top: 10px;
  184. }
  185. }
  186. .list {
  187. font-family: Source Han Sans SC, Source Han Sans SC;
  188. font-size: 14px;
  189. color: #095DE0;
  190. line-height: 20px;
  191. margin-top: 10px;
  192. border-radius: 4px;
  193. }
  194. .bottom {
  195. position: fixed;
  196. bottom: 0;
  197. width: 100vw;
  198. height: 65px;
  199. background: #FFFFFF;
  200. box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
  201. .but {
  202. width: 355px;
  203. height: 45px;
  204. line-height: 45px;
  205. background: #C30D23;
  206. border-radius: 5px;
  207. font-family: PingFang SC, PingFang SC;
  208. font-weight: bold;
  209. font-size: 14px;
  210. color: #FFFFFF;
  211. text-align: center;
  212. margin: 6px auto;
  213. }
  214. }
  215. </style>