list.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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(ite.suggestionId)"
  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">{{ite.title}}</view>
  30. <view class="txt" :class="ite.status==1?'co01':'coa'">{{kaType(ite.status,tsjyList)}}</view>
  31. </view>
  32. <view class="wacoma overtwo">{{ite.content}}</view>
  33. <view class="wacomb">{{ite.createTime}}</view>
  34. </view>
  35. <!-- -->
  36. <view class="spdel" v-if="ite.right>0&&checkPermi(['wuYe:suggestion:remove'])" @click.stop="getDelFn(ite.suggestionId)">删除</view>
  37. </view>
  38. <!-- checkPermi(['system:menuFood:remove'])&& -->
  39. </block>
  40. <!-- 党建资讯 -->
  41. <block v-if="type=='newsdj'">
  42. <view class="newlists" v-for="(ite,idx) in datainfo" :key="idx" @click="getDetail"
  43. >
  44. <view class="tit">潜山:多举措建优非公党建工作指导员队伍</view>
  45. <view class="txt overtwo">如何不断激发非公企业和社会组织党建工作新活力?潜山市委社 会工作部发挥考核的指挥棒作用,“三点发力”推动党建工作部…</view>
  46. <view class="stabox flexc">
  47. <view class="time flex1">2024-11-18 08:16:54</view>
  48. <view class="btns flexc">
  49. <image :src="star" class="imga"></image>42
  50. <!-- <image :src="stara" class="imga"></image>42 -->
  51. </view>
  52. <view class="btns flexc">
  53. <image :src="eye" class="imgb"></image>1361
  54. </view>
  55. </view>
  56. </view>
  57. <!-- checkPermi(['system:menuFood:remove'])&& -->
  58. </block>
  59. <view class="shax" v-if="wtdt">{{wtdt}}</view>
  60. </block>
  61. <!-- 无数据 -->
  62. <view class="nodata" v-else>
  63. <image :src="noiconpimg"></image>
  64. <view>
  65. 暂无数据
  66. </view>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. import {selectDictValue} from "@/utils/common.js"
  72. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  73. import config from '@/config'
  74. export default{
  75. props:{
  76. datainfo: {
  77. type: Array,
  78. default () {
  79. return []
  80. }
  81. },
  82. wtdt:{
  83. type:String,
  84. default () {
  85. return ''
  86. }
  87. },
  88. type:{
  89. type:String,
  90. default () {
  91. return 0
  92. }
  93. },
  94. tsjyList:{
  95. type:Array,
  96. default () {
  97. return []
  98. }
  99. }
  100. },
  101. data(){
  102. return{
  103. noiconpimg:require("@/static/images/nodata.png"),
  104. rimg:require('@/static/images/rimg.png'),
  105. stara:require('@/news/static/news/stara.png'),
  106. star:require('@/news/static/news/starb.png'),
  107. eye:require('@/news/static/news/eye.png'),
  108. baseUrl:config.baseUrl,
  109. delBtnWidth:66,//左滑默认宽度
  110. }
  111. },
  112. mounted() {
  113. },
  114. methods:{
  115. checkPermi, checkRole,
  116. kaType(data, list) {
  117. return selectDictValue(list, data);
  118. },
  119. getDetail(e){
  120. this.$emit('getDetail',e)
  121. },
  122. getPreview(idx,arr) {
  123. var newArr=[];
  124. arr.forEach(ite=>{
  125. var ds=this.baseUrl+ite
  126. newArr.push(ds)
  127. })
  128. uni.previewImage({
  129. urls: newArr,
  130. current:idx,
  131. success: function(data) {},
  132. fail: function(err) {}
  133. });
  134. },
  135. getDelFn(id){
  136. var that=this;
  137. uni.showModal({
  138. title: '确认删除',
  139. content: "是否确认删除",
  140. cancelText: '取消',
  141. confirmText: '确认',
  142. success: function(res) {
  143. if (res.confirm) {
  144. that.$emit('getDelFn',id)
  145. } else if (res.cancel) {
  146. }
  147. }
  148. });
  149. },
  150. //开始触摸滑动
  151. drawStart(e) {
  152. // console.log("开始触发");
  153. var touch = e.touches[0];
  154. this.startX = touch.clientX;
  155. },
  156. //触摸滑动
  157. drawMove(e) {
  158. // console.log("滑动");
  159. for (var index in this.datainfo) {
  160. // this.csListArrl[index].right=0
  161. this.$set(this.datainfo[index],'right',0);
  162. }
  163. var idx=e.currentTarget.dataset.idx
  164. var touch = e.touches[0];
  165. var item = this.datainfo[idx];
  166. var disX = this.startX - touch.clientX;
  167. if (disX >= 20) {
  168. if (disX > this.delBtnWidth) {
  169. disX = this.delBtnWidth;
  170. }
  171. // this.csListArrl[idx].right=disX
  172. this.$set(this.datainfo[idx],'right',disX);
  173. } else {
  174. // this.csListArrl[idx].right=0
  175. this.$set(this.datainfo[idx],'right',0);
  176. }
  177. },
  178. //触摸滑动结束
  179. drawEnd(e) {
  180. // console.log("滑动结束");
  181. var idx=e.currentTarget.dataset.idx
  182. var item = this.datainfo[idx];
  183. if (item.right >= this.delBtnWidth / 2) {
  184. // this.datainfo[idx].right=this.delBtnWidth
  185. this.$set(this.datainfo[idx],'right',this.delBtnWidth);
  186. } else {
  187. this.datainfo[idx].right=0
  188. }
  189. },
  190. }
  191. }
  192. </script>
  193. <style lang="scss" scoped>
  194. .flex{display: flex;}
  195. .flexc{display: flex;align-items: center;}
  196. .mb10{margin-bottom: 20rpx;}
  197. // 社区
  198. .walists{background: #FFFFFF;border-radius: 20rpx;margin-bottom: 24rpx; position: relative;
  199. .watop{
  200. padding: 0 36rpx 30rpx 38rpx;
  201. .watit{padding: 24rpx 0;margin-bottom: 4rpx;display: flex;
  202. .tit{font-weight: bold;font-size: 28rpx;color: #272727;flex: 1;
  203. .cir{width: 14rpx;margin-left: 8rpx;margin-bottom: 10rpx;height: 14rpx;display: inline-block;background: #FF6969;border-radius: 8rpx;}
  204. }
  205. .txt{font-weight: bold;font-size: 26rpx;flex: 0 0 auto;
  206. }
  207. }
  208. .wacoma{font-weight: 500;font-size: 26rpx;color: #666666;line-height: 36rpx;margin-bottom: 24rpx;}
  209. .wacomb{font-weight: 500;font-size: 24rpx;color: #AAAAAA;}
  210. }
  211. .watopcom{background-color: #ffffff;border-radius: 20rpx;position: relative;z-index: 1;}
  212. .wabtn{display: flex;align-items: center;justify-content: space-between;border-top: 2rpx solid #E5E5E5;height: 80rpx;padding: 0 38rpx;
  213. view{font-weight: 500;font-size: 24rpx;color: #666666;}
  214. image{width: 16rpx;height: 28rpx;}
  215. }
  216. }
  217. .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;}
  218. //资讯
  219. .newlists{
  220. background: #FFFFFF;padding: 22rpx 24rpx;margin-bottom: 24rpx;
  221. border-radius: 20rpx;
  222. .tit{font-size: 32rpx;font-weight: bold;color: #272727;line-height: 48rpx;margin-bottom:16rpx;}
  223. .txt{font-size: 24rpx;color: #666666;line-height: 36rpx;margin-bottom: 32rpx;}
  224. .stabox{
  225. .time{font-weight: 500;font-size: 24rpx;color: #AAAAAA;line-height: 36rpx;}
  226. .btns{font-weight: 500;font-size: 22rpx;color: #666666;line-height: 36rpx;min-width: 100rpx;box-sizing: border-box;margin-left: 20rpx;
  227. .imga{width: 24rpx;height: 22rpx;margin-right: 8rpx;}
  228. .imgb{width: 24rpx;height: 18rpx;margin-right: 10rpx;}
  229. }
  230. }
  231. }
  232. // 无数据
  233. .nodata{display: flex;flex-direction: column;align-items: center;
  234. image{width: 440rpx;height: 440rpx;}
  235. view{font-size: 30rpx;color: #666666;font-weight: bold;}
  236. }
  237. </style>