list.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view>
  3. <!-- 第一种样式 人员管理-->
  4. <block v-if="datainfo.length>0">
  5. <!-- 社区资讯 -->
  6. <block v-if="type=='newssq'">
  7. <view class="walists" v-for="(ite,idx) in datainfo" :key="idx" @click="getDetail">
  8. <view class="watop">
  9. <view class="watit">
  10. <view class="tit">物业服务费缴费公告<text class="cir"></text></view>
  11. </view>
  12. <view class="wacoma overtwo">尊敬的各位业主:为更好地提供优质小区环境,保障小区 公共区域设施设备正常的运行,现收取2024年度物业…</view>
  13. <view class="wacomb">2024-11-18 08:16:54</view>
  14. </view>
  15. <view class="wabtn">
  16. <view>查看详情</view>
  17. <image :src="rimg"></image>
  18. </view>
  19. </view>
  20. </block>
  21. <!-- 投诉建议 -->
  22. <block v-if="type=='complaint'">
  23. <view class="walists" v-for="(ite,idx) in datainfo" :key="idx" @click="getDetail"
  24. :data-idx="idx"
  25. @touchstart="drawStart" @touchmove="drawMove" @touchend="drawEnd" :style="'right:'+ite.right+'px'"
  26. >
  27. <view class="watop watopcom">
  28. <view class="watit">
  29. <view class="tit">小区电梯老化</view>
  30. <view class="txt co01" v-if="ite.type==1">待回复</view>
  31. <view class="txt coa" v-if="ite.type==2">已回复</view>
  32. </view>
  33. <view class="wacoma overtwo">小区电梯时常发生问题,请物业派维修人员进行安全检 查,若无法排除问题,建议更换小区的电梯设备,避…</view>
  34. <view class="wacomb">2024-11-18 08:16:54</view>
  35. </view>
  36. <!-- -->
  37. <view class="spdel" v-if="ite.right>0" @click.stop="getDelFn()">删除</view>
  38. </view>
  39. <!-- checkPermi(['system:menuFood:remove'])&& -->
  40. </block>
  41. <!-- 党建资讯 -->
  42. <block v-if="type=='newsdj'">
  43. <view class="newlists" v-for="(ite,idx) in datainfo" :key="idx" @click="getDetail"
  44. >
  45. <view class="tit">潜山:多举措建优非公党建工作指导员队伍</view>
  46. <view class="txt overtwo">如何不断激发非公企业和社会组织党建工作新活力?潜山市委社 会工作部发挥考核的指挥棒作用,“三点发力”推动党建工作部…</view>
  47. <view class="stabox flexc">
  48. <view class="time flex1">2024-11-18 08:16:54</view>
  49. <view class="btns flexc">
  50. <image :src="star" class="imga"></image>42
  51. <!-- <image :src="stara" class="imga"></image>42 -->
  52. </view>
  53. <view class="btns flexc">
  54. <image :src="eye" class="imgb"></image>1361
  55. </view>
  56. </view>
  57. </view>
  58. <!-- checkPermi(['system:menuFood:remove'])&& -->
  59. </block>
  60. <view class="shax" v-if="wtdt">{{wtdt}}</view>
  61. </block>
  62. <!-- 无数据 -->
  63. <view class="nodata" v-else>
  64. <image :src="noiconpimg"></image>
  65. <view>
  66. 暂无数据
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. import config from '@/config'
  73. export default{
  74. props:{
  75. datainfo: {
  76. type: Array,
  77. default () {
  78. return []
  79. }
  80. },
  81. wtdt:{
  82. type:String,
  83. default () {
  84. return ''
  85. }
  86. },
  87. type:{
  88. type:String,
  89. default () {
  90. return 0
  91. }
  92. },
  93. topval:{
  94. type:String,
  95. default () {
  96. return ''
  97. }
  98. }
  99. },
  100. data(){
  101. return{
  102. noiconpimg:require("@/static/images/nodata.png"),
  103. rimg:require('@/static/images/rimg.png'),
  104. stara:require('@/news/static/news/stara.png'),
  105. star:require('@/news/static/news/starb.png'),
  106. eye:require('@/news/static/news/eye.png'),
  107. baseUrl:config.baseUrl,
  108. delBtnWidth:66,//左滑默认宽度
  109. }
  110. },
  111. mounted() {
  112. },
  113. methods:{
  114. getDetail(e){
  115. this.$emit('getDetail',e)
  116. },
  117. getPreview(idx,arr) {
  118. var newArr=[];
  119. arr.forEach(ite=>{
  120. var ds=this.baseUrl+ite
  121. newArr.push(ds)
  122. })
  123. uni.previewImage({
  124. urls: newArr,
  125. current:idx,
  126. success: function(data) {},
  127. fail: function(err) {}
  128. });
  129. },
  130. //开始触摸滑动
  131. drawStart(e) {
  132. // console.log("开始触发");
  133. var touch = e.touches[0];
  134. this.startX = touch.clientX;
  135. },
  136. //触摸滑动
  137. drawMove(e) {
  138. // console.log("滑动");
  139. for (var index in this.datainfo) {
  140. // this.csListArrl[index].right=0
  141. this.$set(this.datainfo[index],'right',0);
  142. }
  143. var idx=e.currentTarget.dataset.idx
  144. var touch = e.touches[0];
  145. var item = this.datainfo[idx];
  146. var disX = this.startX - touch.clientX;
  147. if (disX >= 20) {
  148. if (disX > this.delBtnWidth) {
  149. disX = this.delBtnWidth;
  150. }
  151. // this.csListArrl[idx].right=disX
  152. this.$set(this.datainfo[idx],'right',disX);
  153. } else {
  154. // this.csListArrl[idx].right=0
  155. this.$set(this.datainfo[idx],'right',0);
  156. }
  157. },
  158. //触摸滑动结束
  159. drawEnd(e) {
  160. // console.log("滑动结束");
  161. var idx=e.currentTarget.dataset.idx
  162. var item = this.datainfo[idx];
  163. if (item.right >= this.delBtnWidth / 2) {
  164. // this.datainfo[idx].right=this.delBtnWidth
  165. this.$set(this.datainfo[idx],'right',this.delBtnWidth);
  166. } else {
  167. this.datainfo[idx].right=0
  168. }
  169. },
  170. }
  171. }
  172. </script>
  173. <style lang="scss" scoped>
  174. .flex{display: flex;}
  175. .flexc{display: flex;align-items: center;}
  176. .mb10{margin-bottom: 20rpx;}
  177. // 社区
  178. .walists{background: #FFFFFF;border-radius: 20rpx;margin-bottom: 24rpx; position: relative;
  179. .watop{
  180. padding: 0 36rpx 30rpx 38rpx;
  181. .watit{padding: 24rpx 0;margin-bottom: 4rpx;display: flex;
  182. .tit{font-weight: bold;font-size: 28rpx;color: #272727;flex: 1;
  183. .cir{width: 14rpx;margin-left: 8rpx;margin-bottom: 10rpx;height: 14rpx;display: inline-block;background: #FF6969;border-radius: 8rpx;}
  184. }
  185. .txt{font-weight: bold;font-size: 26rpx;flex: 0 0 auto;
  186. }
  187. }
  188. .wacoma{font-weight: 500;font-size: 26rpx;color: #666666;line-height: 36rpx;margin-bottom: 24rpx;}
  189. .wacomb{font-weight: 500;font-size: 24rpx;color: #AAAAAA;}
  190. }
  191. .watopcom{background-color: #ffffff;border-radius: 20rpx;position: relative;z-index: 1;}
  192. .wabtn{display: flex;align-items: center;justify-content: space-between;border-top: 2rpx solid #E5E5E5;height: 80rpx;padding: 0 38rpx;
  193. view{font-weight: 500;font-size: 24rpx;color: #666666;}
  194. image{width: 16rpx;height: 28rpx;}
  195. }
  196. }
  197. .spdel{width: 164rpx;background: #EA2D2D;font-weight: bold;font-size: 26rpx;color: #FFFFFF;display: flex;align-items: center;justify-content: center;position: absolute;right: -146rpx;top: 0;bottom: 0;padding-left: 14rpx;}
  198. //资讯
  199. .newlists{
  200. background: #FFFFFF;padding: 22rpx 24rpx;margin-bottom: 24rpx;
  201. border-radius: 20rpx;
  202. .tit{font-size: 32rpx;font-weight: bold;color: #272727;line-height: 48rpx;margin-bottom:16rpx;}
  203. .txt{font-size: 24rpx;color: #666666;line-height: 36rpx;margin-bottom: 32rpx;}
  204. .stabox{
  205. .time{font-weight: 500;font-size: 24rpx;color: #AAAAAA;line-height: 36rpx;}
  206. .btns{font-weight: 500;font-size: 22rpx;color: #666666;line-height: 36rpx;min-width: 100rpx;box-sizing: border-box;margin-left: 20rpx;
  207. .imga{width: 24rpx;height: 22rpx;margin-right: 8rpx;}
  208. .imgb{width: 24rpx;height: 18rpx;margin-right: 10rpx;}
  209. }
  210. }
  211. }
  212. // 无数据
  213. .nodata{display: flex;flex-direction: column;align-items: center;
  214. image{width: 440rpx;height: 440rpx;}
  215. view{font-size: 30rpx;color: #666666;font-weight: bold;}
  216. }
  217. </style>