newssqdetail.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <view class="ndetail ">
  3. <!-- 详情 -->
  4. <view class="ndbox mb12">
  5. <view class="plr15">
  6. <view class="tit">物业服务费缴费公告</view>
  7. <view class="time mb12">2024-12-01 08:21</view>
  8. <view class="rich">
  9. <rich-text :nodes="infoContent" style="word-break: break-all;"></rich-text>
  10. </view>
  11. </view>
  12. <view class="ndbfox flexc">
  13. <view class="flexcc ndbflist">
  14. <image :src="nicona"></image>
  15. <view>32</view>
  16. </view>
  17. <view class="flexcc ndbflist">
  18. <image :src="niconb"></image>
  19. <view>32</view>
  20. </view>
  21. <view class="flexcc ndbflist">
  22. <image :src="niconc"></image>
  23. <view>32</view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="ndbox mb12 plr15">
  28. <view class="pltit">评论<text>(31)</text></view>
  29. <!-- 评论列表 -->
  30. <view class="pllist flex">
  31. <image :src="head" class="head"></image>
  32. <view class="flex1 overh">
  33. <view class="flext mb14 ">
  34. <view class="plname flex1 over">床前明月光</view>
  35. <view class="plrbtn flexc flex0">
  36. <!-- <image :src="niconb" class="imga"></image> -->
  37. <image :src="nicond"></image>
  38. <view>点赞</view>
  39. </view>
  40. <view class="plrbtn flexc flex0">
  41. <image :src="nicone" class="imgb"></image>
  42. <view>回复</view>
  43. </view>
  44. </view>
  45. <view class="infotxt mb15">支持!去看一下优惠政策!<view class="infotime">12-3</view></view>
  46. </view>
  47. </view>
  48. <view class="pllist flex">
  49. <image :src="head" class="head"></image>
  50. <view class="flex1 overh">
  51. <view class="flext mb14 ">
  52. <view class="plname flex1 over">疑是地上霜</view>
  53. <view class="plrbtn flexc flex0">
  54. <image :src="niconb" class="imga"></image>
  55. <!-- <image :src="nicond"></image> -->
  56. <view>点赞</view>
  57. </view>
  58. <view class="plrbtn flexc flex0">
  59. <image :src="nicone" class="imgb"></image>
  60. <view>回复</view>
  61. </view>
  62. </view>
  63. <view class="infotxt mb15">提前缴一年的物业费,可以免一个月吗?<view class="infotime">12-3</view></view>
  64. <!-- 二级回复 -->
  65. <view class="pllist flex">
  66. <image :src="head" class="head"></image>
  67. <view class="flex1 overh">
  68. <view class="flext mb14 ">
  69. <view class="plname flex1 over">幸福小区物业</view>
  70. <view class="plrbtn flexc flex0">
  71. <image :src="niconb" class="imga"></image>
  72. <!-- <image :src="nicond"></image> -->
  73. <view>点赞</view>
  74. </view>
  75. <view class="plrbtn flexc flex0">
  76. <image :src="nicone" class="imgb"></image>
  77. <view>回复</view>
  78. </view>
  79. </view>
  80. <view class="infotxt mb15">尊敬的业主朋友,您的建议我司已收到,将在内 部讨论后于物业公告中告知结果,谢谢您的宝贵 建议!<view class="infotime">12-3</view></view>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <!-- 评论 -->
  87. <view class="pjfbtn">
  88. <view class="flexc pjfbox">
  89. <uni-easyinput type="textarea" autoHeight v-model="text" :inputBorder='false' placeholder="发表我的评论…" />
  90. <view class="btns">发送</view>
  91. </view>
  92. </view>
  93. <loading></loading>
  94. </view>
  95. </template>
  96. <script>
  97. import config from '@/config'
  98. const baseUrl = config.baseUrl
  99. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  100. export default{
  101. components:{},
  102. data(){
  103. return{
  104. nicona:require('@/manage/static/news/nicona.png'),
  105. niconb:require('@/manage/static/news/niconb.png'),
  106. niconc:require('@/manage/static/news/niconc.png'),
  107. nicond:require('@/manage/static/news/nicond.png'),
  108. nicone:require('@/manage/static/news/nicone.png'),
  109. head:require('@/manage/static/news/head.png'),
  110. list:[],
  111. pageSize: 10,
  112. pageNum: 1,
  113. reachflag: true,
  114. wtdt:'',
  115. showAll:true,
  116. infoContent:'<span>hello uni-app x!</span><br/><span>uni-app x,终极跨平台方案</span>',
  117. text:'',
  118. }
  119. },
  120. onLoad: function() {
  121. },
  122. // 上拉触底加载更多触发事件
  123. onReachBottom() {
  124. if (this.reachflag) {
  125. this.pageNum++
  126. this.getDataFn()
  127. }
  128. },
  129. methods:{
  130. checkPermi, checkRole,
  131. // getNextFn(){
  132. // this.$tab.navigateTo("/work/pages/business/add")
  133. // },
  134. //解析富文本方法
  135. formatRichText(html) {
  136. let newContent = html.replace(/<img[^>]*>/gi, function(match, capture) {
  137. match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '').replace(/style=""/gi, '');
  138. match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
  139. match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
  140. return match;
  141. });
  142. newContent = newContent.replace(/style="[^"]+"/gi, function(match, capture) {
  143. match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi, 'max-width:100%;');
  144. return match;
  145. });
  146. newContent = newContent.replace(/<br[^>]*\/>/gi, '');
  147. newContent = newContent.replace(/\<img src="/gi,
  148. '<img style="max-width:100%;height:auto;display:block;margin:10rpx auto;" src="' +baseUrlimg);
  149. return newContent;
  150. },
  151. getDataFn(){
  152. return
  153. var params={
  154. pageSize:this.pageSize,
  155. pageNum: this.pageNum,
  156. }
  157. params.noticeType=this.tabidx
  158. getNoticeList(params).then(res=>{
  159. if(res.code==200){
  160. if(res.data.infoContent){
  161. this.infoContent=this.formatRichText(res.data.infoContent);
  162. }
  163. if (res.rows.length < this.pageSize) {
  164. this.reachflag = false
  165. this.wtdt = '到底了~';
  166. } else {
  167. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  168. if (num < res.total) {
  169. this.reachflag = true
  170. this.wtdt = ''
  171. } else {
  172. this.reachflag = false
  173. this.wtdt = '到底了~';
  174. }
  175. }
  176. if (this.pageNum == 1) {
  177. this.list = res.rows;
  178. } else {
  179. this.list = this.list.concat(res.rows)
  180. }
  181. }else{
  182. this.$toast(res.msg)
  183. }
  184. })
  185. },
  186. }
  187. }
  188. </script>
  189. <style>
  190. page{background: #F3F3F0;}
  191. </style>
  192. <style lang="scss" scoped>
  193. .ndetail{
  194. min-height: 100vh;padding: 20rpx 18rpx 100rpx;
  195. .ndbox{background: #FFFFFF;border-radius: 20rpx;padding-top: 30rpx;
  196. .tit{font-weight: bold;font-size: 32rpx;color: #272727;margin-bottom: 14rpx;text-align: center;padding-top: 4rpx;}
  197. .time{font-weight: 500;font-size: 24rpx;color: #AAAAAA;text-align: center;}
  198. .rich{border-top: 2rpx solid #E5E5E5;padding: 28rpx 0;}
  199. .ndbfox{
  200. border-top: 2rpx solid #E5E5E5;
  201. .ndbflist{width: 33.3%;min-height: 78rpx;padding: 16rpx 0;box-sizing: border-box;
  202. image{width: 26rpx;height: 26rpx;margin-right: 26rpx;}
  203. view{font-weight: 500;font-size: 26rpx;color: #666666;}
  204. }
  205. }
  206. }
  207. }
  208. .pltit{font-weight: bold;font-size: 30rpx;color: #272727;
  209. text{margin-left: 24rpx;font-size: 24rpx;color: #666666;}
  210. }
  211. .pllist{padding-top: 20rpx;margin-bottom: 16rpx;border-bottom: 2rpx solid #DADADA;
  212. .head{width: 40rpx;height: 40rpx;margin-right: 18rpx;flex: 0 0 auto;}
  213. .plname{font-weight: bold;font-size: 30rpx;color: #161616;}
  214. .plrbtn{margin-left: 36rpx;
  215. image{width: 26rpx;height: 24rpx;margin-right: 16rpx;
  216. &.imga{width: 26rpx;height: 26rpx;}
  217. &.imgb{width: 26rpx;height: 22rpx;}
  218. }
  219. view{font-weight: bold;font-size: 24rpx;color: #314081;}
  220. }
  221. .infotxt{font-weight: 500;font-size: 26rpx;color: #161616;line-height: 40rpx;
  222. &:before {content: "";float: right;width: 0;height: calc(100% - 16px);background: red;}
  223. .infotime{font-weight: 500;font-size: 24rpx;color: #666666; float: right;clear: both;}
  224. }
  225. .pllist{
  226. padding-top: 0;border-bottom: none;margin-bottom: 0;
  227. }
  228. }
  229. .pjfbtn{background: #FFFFFF;position: fixed;bottom: 0;left: 0;right: 0;padding:20rpx 48rpx;box-shadow: 0px 0px 18rpx 0px rgba(159,159,159,0.47);
  230. .pjfbox{background: #E6E6E6;border-radius: 10rpx;
  231. .btns{nt-weight: bold;padding: 0 34rpx;height: 60rpx;line-height: 60rpx;flex: 0 0 auto;
  232. font-size: 26rpx;
  233. }
  234. color: #314081;}
  235. }
  236. .pjfbtn /deep/ .uni-easyinput{flex: 1;font-size: 26rpx;color: #222327;}
  237. .pjfbtn /deep/ .uni-easyinput__content-textarea{min-height: 40rpx;font-size: 26rpx;margin: 0;background: #E6E6E6;box-sizing: border-box;padding: 10rpx 0 10rpx 36rpx;border-radius:10rpx 0 0 10rpx;}
  238. </style>