list.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <view>
  3. <!-- 第一种样式 人员管理-->
  4. <block v-if="datainfo.length>0">
  5. <!-- 人员管理 -->
  6. <block v-if="type=='people'">
  7. <view class="carlist" v-for="(ite,idx) in datainfo" :key="idx" @click="getDetail">
  8. <view class="ctop flexc">
  9. <image :src="hicoa" class="imgs" v-if="ite.type==1"></image>
  10. <image :src="hicob" class="imgs" v-if="ite.type==2"></image>
  11. <view class="tit">一号楼3单元1101</view>
  12. <view class="flex1"></view>
  13. <view class="txt ca" v-if="ite.type==1">业主</view>
  14. <view class="txt cb" v-if="ite.type==2">租户</view>
  15. </view>
  16. <view class="plists">
  17. <view class="plist">
  18. <image :src="man" class="head" v-if="ite.sex==1"></image>
  19. <image :src="woman" class="head" v-else></image>
  20. <view class="flex1">
  21. <view class="ptit">张伟<view class="btn btnc ml10" v-if="ite.hzflag">户主</view></view>
  22. <view class="ptxt">身份证号 | 41072719880603022X</view>
  23. <view class="flexc">
  24. <view class="ptxt">性别 | {{ite.sex==1?'男':'女'}}</view>
  25. <view class="ptxt">年龄 | 36岁</view>
  26. </view>
  27. <view class="flexc">
  28. <view class="ptxt">身高 | 165cm</view>
  29. <view class="ptxt">体重 | 67kg</view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="plist" v-if="ite.zhanflag">
  34. <image :src="man" class="head" v-if="ite.sex==1"></image>
  35. <image :src="woman" class="head" v-else></image>
  36. <view class="flex1">
  37. <view class="ptit">张伟<view class="btn btnc ml10" v-if="ite.hzflag">户主</view></view>
  38. <view class="ptxt">身份证号 | 41072719880603022X</view>
  39. <view class="flexc">
  40. <view class="ptxt">性别 | {{ite.sex==1?'男':'女'}}</view>
  41. <view class="ptxt">年龄 | 36岁</view>
  42. </view>
  43. <view class="flexc">
  44. <view class="ptxt">身高 | 165cm</view>
  45. <view class="ptxt">体重 | 67kg</view>
  46. </view>
  47. </view>
  48. </view>
  49. <image :src="upimg" :class="ite.zhanflag?'act':''" class="upimg" @click="getZhan(idx)"></image>
  50. </view>
  51. </view>
  52. </block>
  53. <view class="shax">{{wtdt}}</view>
  54. </block>
  55. <!-- 无数据 -->
  56. <view class="nodata" v-else>
  57. <image :src="noiconpimg"></image>
  58. <view>
  59. 暂无数据
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  66. import config from '@/config'
  67. export default{
  68. props:{
  69. datainfo: {
  70. type: Array,
  71. default () {
  72. return []
  73. }
  74. },
  75. wtdt:{
  76. type:String,
  77. default () {
  78. return ''
  79. }
  80. },
  81. type:{
  82. type:String,
  83. default () {
  84. return 0
  85. }
  86. },
  87. },
  88. data(){
  89. return{
  90. noiconpimg:require("@/static/nodata.png"),
  91. hicoa:require("@/health/static/health/hicoa.png"),
  92. hicob:require("@/health/static/health/hicob.png"),
  93. man:require("@/people/static/people/man.png"),
  94. woman:require("@/people/static/people/woman.png"),
  95. upimg:require("@/static/images/home/up.png"),
  96. baseUrl:config.baseUrl,
  97. delBtnWidth:66,//左滑默认宽度
  98. }
  99. },
  100. mounted() {
  101. },
  102. methods:{
  103. checkPermi, checkRole,
  104. getDetail(e){
  105. this.$emit('getDetail',e)
  106. },
  107. getAddFn(e){
  108. this.$emit('getAddFn',e)
  109. },
  110. getReadlist(e){
  111. this.$emit('getReadlist',e)
  112. },
  113. getZhan(idx){
  114. // var obj=JSON.parse(JSON.stringify(this.datainfo))[idx]
  115. // obj.zhanflag=!obj.zhanflag;
  116. // this.datainfo.splice(idx,1,obj);
  117. this.datainfo[idx].zhanflag=!this.datainfo[idx].zhanflag
  118. },
  119. getPreview(idx,arr) {
  120. var newArr=[];
  121. arr.forEach(ite=>{
  122. var ds=this.baseUrl+ite
  123. newArr.push(ds)
  124. })
  125. uni.previewImage({
  126. urls: newArr,
  127. current:idx,
  128. success: function(data) {},
  129. fail: function(err) {}
  130. });
  131. },
  132. //开始触摸滑动
  133. drawStart(e) {
  134. // console.log("开始触发");
  135. var touch = e.touches[0];
  136. this.startX = touch.clientX;
  137. },
  138. //触摸滑动
  139. drawMove(e) {
  140. // console.log("滑动");
  141. for (var index in this.datainfo) {
  142. // this.csListArrl[index].right=0
  143. this.$set(this.datainfo[index],'right',0);
  144. }
  145. var idx=e.currentTarget.dataset.idx
  146. var touch = e.touches[0];
  147. var item = this.datainfo[idx];
  148. var disX = this.startX - touch.clientX;
  149. if (disX >= 20) {
  150. if (disX > this.delBtnWidth) {
  151. disX = this.delBtnWidth;
  152. }
  153. // this.csListArrl[idx].right=disX
  154. this.$set(this.datainfo[idx],'right',disX);
  155. } else {
  156. // this.csListArrl[idx].right=0
  157. this.$set(this.datainfo[idx],'right',0);
  158. }
  159. },
  160. //触摸滑动结束
  161. drawEnd(e) {
  162. // console.log("滑动结束");
  163. var idx=e.currentTarget.dataset.idx
  164. var item = this.datainfo[idx];
  165. if (item.right >= this.delBtnWidth / 2) {
  166. // this.datainfo[idx].right=this.delBtnWidth
  167. this.$set(this.datainfo[idx],'right',this.delBtnWidth);
  168. } else {
  169. this.datainfo[idx].right=0
  170. }
  171. },
  172. }
  173. }
  174. </script>
  175. <style lang="scss" scoped>
  176. .flex{display: flex;}
  177. .flexc{display: flex;align-items: center;}
  178. .mb10{margin-bottom: 20rpx;}
  179. .carlist{background: #FFFFFF;border-radius: 20rpx;margin-bottom: 24rpx;
  180. .ctop{border-bottom: 2rpx solid #E5E5E5;padding: 24rpx 24rpx 22rpx;
  181. .imgs{width: 40rpx;height: 42rpx;margin-right: 32rpx;}
  182. .tit{font-size: 30rpx;color: #272727;font-weight: bold;margin-right: 20rpx;}
  183. .txt{font-weight: 500;font-size: 26rpx;
  184. &.ca{color: #3565ED;}
  185. &.cb{color: #FE5A0E;}
  186. &.cc{color: #28C529;}
  187. }
  188. .txta{font-weight: 500;font-size: 24rpx;color: #AAAAAA;}
  189. .num{font-size: 24rpx;color: #AAAAAA;}
  190. }
  191. .plists{padding: 30rpx 24rpx 6rpx;
  192. .plist{background: linear-gradient(-90deg, #F2F5FF 0%, #FBFDFF 100%);border-radius: 20rpx;border: 2rpx solid #E6E6E6;margin-bottom: 24rpx;padding: 18rpx 26rpx 4rpx;display: flex;
  193. .head{width: 96rpx;height: 98rpx;margin-right: 32rpx;flex: 0 0 auto;margin-top: 36rpx;}
  194. .ptit{font-weight: bold;font-size: 30rpx;color: #272727;display: flex;align-items: center;margin-bottom: 14rpx;}
  195. .ptxt{font-weight: 500;font-size: 26rpx;color: #666666;line-height: 36rpx;margin-bottom: 14rpx;min-width: 176rpx;}
  196. }
  197. }
  198. .upimg{width: 26rpx;height: 22rpx;display: block;transform: rotate(180deg);transition: all 0.3s;margin: 0 auto 18rpx;
  199. &.act{transform: rotate(0deg);}
  200. }
  201. .btn{height: 34rpx;border-radius: 18rpx;display: flex;align-items: center;justify-content: center;padding: 0 10rpx;font-size: 22rpx;margin-right: 24rpx;
  202. &.btna{border: 2rpx solid #06C770;color: #06C770;}
  203. &.btnb{border: 2rpx solid #3565ED;color: #3565ED;}
  204. &.btnc{border: 2rpx solid #FE5A0E;color: #FE5A0E;}
  205. &.btnbga{border: 1px solid #0156FE;color: #3565ED;background: #DFEAFF;height: 36rpx;}
  206. &.btnbgb{border: 1px solid #C1C1C1;color: #666666;background: #F1F1F1;height: 36rpx;}
  207. &.btnbgc{border: 1px solid #FE5A0E;color:#FE5A0E;background:#FFEEE6;height: 36rpx;}
  208. }
  209. }
  210. // 无数据
  211. .nodata{display: flex;flex-direction: column;align-items: center;
  212. image{width: 440rpx;height: 440rpx;}
  213. view{font-size: 30rpx;color: #666666;font-weight: bold;}
  214. }
  215. </style>