detail.vue 7.0 KB

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