list.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <template>
  2. <view>
  3. <!-- 第一种样式 人员管理-->
  4. <block v-if="datainfo.length>0">
  5. <!-- 快递 -->
  6. <block v-if="type=='delivery'">
  7. <view class="kdlists flex" v-for="(ite,idx) in datainfo" :key="idx" @click="getDetail">
  8. <image :src="noiconpimg" class="kdll"></image>
  9. <view class="kdlr over flex1">
  10. <view class="over tit">已发货</view>
  11. <view class="over tits">包裹正在等待揽收</view>
  12. <view class="over txt">淘宝 | 白色晚礼服平时可穿毕业洋装小白裙…</view>
  13. </view>
  14. </view>
  15. </block>
  16. <!-- 步骤条 -->
  17. <block v-if="type=='kdstep'">
  18. <view class="hfstep">
  19. <view class="hfslist flex">
  20. <view class="limg flexccc">
  21. <image :src="cira" class="imga"></image>
  22. </view>
  23. <view class="flex1">
  24. <view class="hfstit co01">运输中 11-25 12:24</view>
  25. <view class="hfstxt co27">【合肥市】快件已到达 合肥蜀山新产业园</view>
  26. </view>
  27. </view>
  28. <view class="hfslist flex">
  29. <view class="limg flexccc">
  30. <image :src="cirb" class="imgb"></image>
  31. </view>
  32. <view class="flex1">
  33. <view class="hfstit">11-25 07:23</view>
  34. <view class="hfstxt">【合肥市】快件已发往 合肥蜀山新产业园</view>
  35. </view>
  36. </view>
  37. <view class="hfslist flex">
  38. <view class="limg flexccc">
  39. <image :src="cirb" class="imgb"></image>
  40. </view>
  41. <view class="flex1">
  42. <view class="hfstit">11-25 07:20</view>
  43. <view class="hfstxt">【合肥市】快件已到达 合肥转运中心</view>
  44. </view>
  45. </view>
  46. </view>
  47. </block>
  48. <!-- 我的互动 -->
  49. <block v-if="type=='myhd'">
  50. <view class="mb12 pr" v-for="(ite,idx) in datainfo" :key="idx">
  51. <view class="hdlist pd12 flex">
  52. <image :src="man" class="mhead flex0"></image>
  53. <view class="flex1 overh">
  54. <view class="flexc mb6">
  55. <view class="name flex1 over">{{ite.nickName}}</view>
  56. <view class="tit flex0 ml10">
  57. <block v-if="ite.targetType==1">评论了你的文章</block>
  58. <block v-if="ite.targetType==2">点赞了你的文章</block>
  59. <block v-if="ite.targetType==3">收藏了你的文章</block>
  60. <block v-if="ite.targetType==4">回复了你的评论</block>
  61. <block v-if="ite.targetType==5">点赞了你的评论</block>
  62. </view>
  63. <view class="time flex0 ml10">{{ite.createTime}}</view>
  64. </view>
  65. <view class="flexc overh mb4">
  66. <view class="line bga"></view>
  67. <view class="txt over flex1">{{ite.targetTitle}}</view>
  68. <image :src="rimg" class="rimg ml10"></image>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </block>
  74. <block v-if="type=='plsh'">
  75. <view class="mb12 pr" v-for="(ite,idx) in datainfo" :key="idx"
  76. :data-idx="idx"
  77. @touchstart="drawStart" @touchmove="drawMove" @touchend="drawEnd" :style="'right:'+ite.right+'px'"
  78. >
  79. <view class="hdlist ">
  80. <view class="pd12 flex">
  81. <image :src="ite.avatar?baseUrl+ite.avatar:man" class="mhead flex0"></image>
  82. <view class="flex1 overh">
  83. <view class="flexc mb6">
  84. <view class="name flex1 over">{{ite.nickName}}</view>
  85. <view class="time flex0 ml10">02-26</view>
  86. </view>
  87. <view class="txt mb8">{{ite.commentContent}}</view>
  88. <view class="flexc overh mb2">
  89. <view class="line bgd"></view>
  90. <view class="txta over flex1">{{ite.communityTitle}}</view>
  91. <image :src="rimg" class="rimg ml10"></image>
  92. </view>
  93. </view>
  94. </view>
  95. <view class="shbtns flexc pd12" >
  96. <view class="btn bga" @click="getSh('4',ite)">不予展示</view>
  97. <view class="flex1"></view>
  98. <view class="btn bgb" @click="getSh('3',ite)">不通过</view>
  99. <view class="btn bgc" @click="getSh('2',ite)">通过</view>
  100. </view>
  101. </view>
  102. <view class="spdel" v-if="ite.right>0&&checkPermi(['wuYe:residentInfo:remove'])" @click.stop="getDelFn(ite.residentId)">删除</view>
  103. </view>
  104. </block>
  105. <!-- 我的点赞,收藏,评论 :data-idx="idx"
  106. @touchstart="drawStart" @touchmove="drawMove" @touchend="drawEnd" :style="'right:'+ite.right+'px'"-->
  107. <block v-if="type=='wdhd'">
  108. <view class="mb12 pr" v-for="(ite,idx) in datainfo" :key="idx" @click="getDetail(ite)">
  109. <view class="hdlist ">
  110. <view class="pd12 flex">
  111. <image :src="ite.avatar?baseUrl+ite.avatar:man" class="mhead flex0"></image>
  112. <view class="flex1 overh">
  113. <view class="flexc mb6">
  114. <view class="name flex1 over">{{ite.nickName}}</view>
  115. <view class="time flex0 ml10">{{ite.createTime}}</view>
  116. </view>
  117. <view class="txt mb8">{{ite.commentContent}}</view>
  118. <view class="flexc overh mb2">
  119. <view class="line bgd"></view>
  120. <view class="txta over flex1" v-if="tabval=='mypl'">{{ite.communityTitle}}</view>
  121. <view class="txta over flex1" v-else>{{ite.targetTitle}}</view>
  122. <image :src="rimg" class="rimg ml10"></image>
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. <!-- <view class="spdel" v-if="ite.right>0&&checkPermi(['wuYe:residentInfo:remove'])" @click.stop="getDelFn(ite.residentId)">删除</view> -->
  128. </view>
  129. </block>
  130. <view class="shax" v-if="wtdt">{{wtdt}}</view>
  131. </block>
  132. <!-- 无数据 -->
  133. <view class="nodata" v-else>
  134. <image :src="noiconpimg"></image>
  135. <view>
  136. 暂无数据
  137. </view>
  138. </view>
  139. </view>
  140. </template>
  141. <script>
  142. import {selectDictValue} from "@/utils/common.js"
  143. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  144. import config from '@/config'
  145. export default{
  146. props:{
  147. datainfo: {
  148. type: Array,
  149. default () {
  150. return []
  151. }
  152. },
  153. wtdt:{
  154. type:String,
  155. default () {
  156. return ''
  157. }
  158. },
  159. type:{
  160. type:String,
  161. default () {
  162. return 0
  163. }
  164. },
  165. tabval:{
  166. type:String,
  167. default () {
  168. return ''
  169. }
  170. }
  171. },
  172. data(){
  173. return{
  174. noiconpimg:require("@/static/images/nodata.png"),
  175. upimg:require("@/my/static/house/up.png"),
  176. cara:require("@/my/static/house/cara.png"),
  177. man:require("@/health/static/man.png"),
  178. woman:require("@/health/static/woman.png"),
  179. rimg:require("@/static/images/rimga.png"),
  180. baseUrl:config.baseUrl,
  181. delBtnWidth:66,//左滑默认宽度
  182. }
  183. },
  184. mounted() {
  185. },
  186. methods:{
  187. checkPermi, checkRole,
  188. getDetail(e){
  189. this.$emit('getDetail',e)
  190. },
  191. getDelFn(e){
  192. var that=this;
  193. uni.showModal({
  194. title: '确认删除',
  195. content: "是否确认删除",
  196. cancelText: '取消',
  197. confirmText: '确认',
  198. success: function(res) {
  199. if (res.confirm) {
  200. that.$emit('getDelFn',e)
  201. } else if (res.cancel) {
  202. }
  203. }
  204. });
  205. },
  206. getSh(type,ite){
  207. var that=this;
  208. var str="";
  209. if(type=='2'){
  210. str="通过"
  211. }else if(type=='3'){
  212. str="不通过"
  213. }else if(type=='4'){
  214. str="下架"
  215. }
  216. uni.showModal({
  217. title: '确认'+str,
  218. content: "是否确认"+str,
  219. cancelText: '取消',
  220. confirmText: '确认',
  221. success: function(res) {
  222. if (res.confirm) {
  223. var obj={
  224. status:type,
  225. contentId:ite.contentId,
  226. commentId:ite.commentId,
  227. }
  228. that.$emit('getSh',obj)
  229. } else if (res.cancel) {
  230. }
  231. }
  232. });
  233. },
  234. getDelFn(id){
  235. var that=this;
  236. uni.showModal({
  237. title: '确认删除',
  238. content: "是否确认删除",
  239. cancelText: '取消',
  240. confirmText: '确认',
  241. success: function(res) {
  242. if (res.confirm) {
  243. that.$emit('getDelFn',id)
  244. } else if (res.cancel) {
  245. }
  246. }
  247. });
  248. },
  249. //开始触摸滑动
  250. drawStart(e) {
  251. // console.log("开始触发");
  252. var touch = e.touches[0];
  253. this.startX = touch.clientX;
  254. },
  255. //触摸滑动
  256. drawMove(e) {
  257. var idx=e.currentTarget.dataset.idx
  258. var aidx=e.currentTarget.dataset.aidx
  259. var type=e.currentTarget.dataset.type;
  260. for (var index in this.datainfo) {
  261. if(type&&type=='peo'){
  262. for(var i in this.datainfo[idx].residentInfoList){
  263. this.$set(this.datainfo[idx].residentInfoList[i],'right',0);
  264. }
  265. }else{
  266. this.$set(this.datainfo[index],'right',0);
  267. }
  268. }
  269. var touch = e.touches[0];
  270. var item = this.datainfo[idx];
  271. var disX = this.startX - touch.clientX;
  272. if (disX >= 20) {
  273. if (disX > this.delBtnWidth) {
  274. disX = this.delBtnWidth;
  275. }
  276. if(type&&type=='peo'){
  277. this.$set(this.datainfo[idx].residentInfoList[aidx],'right',disX);
  278. }else{
  279. this.$set(this.datainfo[idx],'right',disX);
  280. }
  281. // this.csListArrl[idx].right=disX
  282. } else {
  283. // this.csListArrl[idx].right=0
  284. this.$set(this.datainfo[idx],'right',0);
  285. }
  286. },
  287. //触摸滑动结束
  288. drawEnd(e) {
  289. // console.log("滑动结束");
  290. var idx=e.currentTarget.dataset.idx
  291. var item = this.datainfo[idx];
  292. if (item.right >= this.delBtnWidth / 2) {
  293. // this.datainfo[idx].right=this.delBtnWidth
  294. // this.$set(this.datainfo[idx],'right',this.delBtnWidth);
  295. } else {
  296. this.datainfo[idx].right=0
  297. }
  298. },
  299. }
  300. }
  301. </script>
  302. <style lang="scss" scoped>
  303. .flex{display: flex;}
  304. .flexc{display: flex;align-items: center;}
  305. .mb10{margin-bottom: 20rpx;}
  306. // 快递
  307. .kdlists{padding: 24rpx 26rpx;background-color: #FFFFFF;border-radius: 20rpx;margin-bottom: 24rpx;
  308. .kdll{width: 140rpx;height: 140rpx;border-radius: 10rpx;margin-right: 32rpx;flex: 0 0 auto;}
  309. .kdlr{
  310. .tit{font-size: 30rpx;color: #272727;font-weight: bold;margin-bottom: 18rpx;margin-top: 4rpx;}
  311. .tits{font-size: 24rpx;color: #272727;font-weight: 500;margin-bottom: 14rpx;}
  312. .txt{font-weight: 500;font-size: 24rpx;color: #AAAAAA;}
  313. }
  314. }
  315. // 快递步骤条
  316. .hfstep{padding: 0 32rpx 44rpx 32rpx;
  317. .hfslist{padding-bottom: 44rpx;position: relative;
  318. &::before{content: '';position: absolute;left: 14rpx;top:14rpx;height: 100%;width: 2rpx;background: #E6E6E6;}
  319. .limg{width: 30rpx;height: 30rpx;margin-right: 22rpx;flex: 0 0 auto;margin-top:3rpx;
  320. .imga{width: 30rpx;height: 30rpx;}
  321. .imgb{width: 18rpx;height: 18rpx;}
  322. }
  323. .hfstit{font-weight: bold;font-size: 26rpx;color: #666666;line-height: 36rpx;margin-bottom: 24rpx;}
  324. .hfstxt{font-weight: 500;font-size: 26rpx;color: #666666;line-height: 36rpx;padding-left: 8rpx;}
  325. }
  326. }
  327. .carlist{background: #FFFFFF;border-radius: 20rpx;margin-bottom: 24rpx;
  328. .ctop{border-bottom: 2rpx solid #E5E5E5;padding:26rpx 24rpx;
  329. .imgs{width: 40rpx;height: 42rpx;margin-right: 30rpx;}
  330. .tit{font-size: 32rpx;color: #272727;font-weight: bold;margin-right: 14rpx;}
  331. .txt{font-weight: 500;font-size: 26rpx;
  332. &.ca{color: #3565ED;}
  333. &.cb{color: #FE5A0E;}
  334. &.cc{color: #28C529;}
  335. }
  336. .txta{font-weight: 500;font-size: 24rpx;color: #AAAAAA;}
  337. .num{font-size: 24rpx;color: #AAAAAA;}
  338. }
  339. .btn{height: 34rpx;border-radius: 18rpx;display: flex;align-items: center;justify-content: center;padding: 0 10rpx;font-size: 22rpx;margin-right: 24rpx;
  340. &.btna{border: 2rpx solid #06C770;color: #06C770;}
  341. &.btnb{border: 2rpx solid #3565ED;color: #3565ED;}
  342. &.btnc{border: 2rpx solid #FE5A0E;color: #FE5A0E;}
  343. &.btnbga{border: 1px solid #0156FE;color: #3565ED;background: #DFEAFF;height: 36rpx;}
  344. &.btnbgb{border: 1px solid #C1C1C1;color: #666666;background: #F1F1F1;height: 36rpx;}
  345. &.btnbgc{border: 1px solid #FE5A0E;color:#FE5A0E;background:#FFEEE6;height: 36rpx;}
  346. }
  347. }
  348. // 互动
  349. .pd12{padding: 24rpx;}
  350. .hdlist{background: #FFFFFF;border-radius: 20rpx;position: relative;z-index: 1;
  351. .mhead{width: 56rpx;height: 56rpx;margin-right: 20rpx;border-radius: 50%}
  352. .name{font-size: 28rpx;font-weight: bold;color: #272727;height: 56rpx;line-height: 56rpx;}
  353. .tit{font-weight: 500;font-size: 22rpx;color: #666666;}
  354. .time{font-weight: 500;font-size: 22rpx;color: #666666;}
  355. .line{width: 6rpx;height: 28rpx;border-radius: 4rpx;margin-right: 12rpx;
  356. &.bga{background: #FACA7D;}
  357. &.bgb{background: #86AFFF;}
  358. &.bgc{background: #93E9C2;}
  359. &.bgd{background: #DADADA;}
  360. }
  361. .txt{font-weight: 500;font-size: 26rpx;color: #272727;line-height: 36rpx;}
  362. .txta{font-weight: 500;font-size: 26rpx;color: #666666;}
  363. .rimg{width: 12rpx;height: 22rpx;}
  364. .shbtns{border-top: 2rpx solid #DADADA;
  365. .btn{border-radius: 20rpx;min-width: 110rpx;box-sizing: border-box;padding: 0 16rpx;
  366. height: 52rpx;display: flex;align-items: center;justify-content: center;flex:0 0 auto;margin-left: 20rpx;
  367. &.bga{border: 2rpx solid #06C770;background: #DAEFE6;color: #06C770;margin-left: 0;}
  368. &.bgb{border: 2rpx solid #FF6969;;background: #FFE7E7;color: #FF6969;}
  369. &.bgc{background: #0256FD;color: #FFFFFF;}
  370. }
  371. }
  372. }
  373. // 无数据
  374. .nodata{display: flex;flex-direction: column;align-items: center;
  375. image{width: 440rpx;height: 440rpx;}
  376. view{font-size: 30rpx;color: #666666;font-weight: bold;}
  377. }
  378. </style>