list.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <view>
  3. <!-- 第一种样式 人员管理-->
  4. <block v-if="datainfo.length>0">
  5. <!-- 订单 -->
  6. <block v-if="type=='order'">
  7. <view class="odlist" v-for="(ite,idx) in datainfo" :key="idx" @click="getDetail">
  8. <view class="odtop flexcj">
  9. <view class="tit">2024-11-26 10:00</view>
  10. <view class="txt">本单收入<text class="t">¥</text><text class="num">60</text></view>
  11. </view>
  12. <view class="odbox">
  13. <view class="lists flexcj">
  14. <view class="llists flex1">
  15. <view class="flext mb10">
  16. <view class="imgs"><image :src="hlista" class="imga"></image></view>
  17. <view class="oltit">单次深度清洁</view>
  18. </view>
  19. <view class="flext mb10">
  20. <view class="imgs"><image :src="hlistb" class="imgb"></image></view>
  21. <view class="oltit">安徽省合肥市蜀山区高新技术开发区幸福 大街88号幸福小区12#1403室 </view>
  22. <image :src="adrimg" class="adrimg"></image>
  23. </view>
  24. <view class="flext mb10">
  25. <view class="imgs"><image :src="hlistc" class="imga"></image></view>
  26. <view class="oltit">80m²以内</view>
  27. </view>
  28. <view class="flext mb10">
  29. <view class="imgs"><image :src="hlistd" class="imgc"></image></view>
  30. <view class="oltit">刘熙媛</view>
  31. </view>
  32. <block v-if="ite.zhanflag">
  33. <view class="flext mb10">
  34. <view class="imgs"><image :src="hliste" class="imgd"></image></view>
  35. <view class="oltit">18000185568</view>
  36. </view>
  37. <view class="flext mb10">
  38. <view class="imgs"><image :src="hlistf" class="imge"></image></view>
  39. <view class="oltit flexc">412588653126854369
  40. <view class="olbtn">复制</view>
  41. </view>
  42. </view>
  43. <view class="flext mb10">
  44. <view class="imgs"><image :src="hlistg" class="imge"></image></view>
  45. <view class="oltit">2024-11-25 18:23:56 <text class="coa">(接单时间)</text></view>
  46. </view>
  47. <view class="flext mb10">
  48. <view class="imgs"><image :src="hlisth" class="imgf"></image></view>
  49. <view class="oltit">2024-11-25 18:23:56 <text class="coa"> (上门时间)</text></view>
  50. </view>
  51. <view class="flext mb6">
  52. <view class="imgs"><image :src="hlisti" class="imga"></image></view>
  53. <view class="phos">
  54. <image :src="hlista"></image>
  55. </view>
  56. </view>
  57. <view class="flext mb10">
  58. <view class="imgs"><image :src="hlistj" class="imgg"></image></view>
  59. <view class="oltit">2024-11-25 18:23:56 <text class="coa"> (完成时间)</text></view>
  60. </view>
  61. <view class="flext mb6">
  62. <view class="imgs"><image :src="hlisti" class="imga"></image></view>
  63. <view class="phos">
  64. <image :src="hlista"></image>
  65. </view>
  66. </view>
  67. <view class="flext mb10">
  68. <view class="imgs"><image :src="hlistk" class="imgc"></image></view>
  69. <view class="oltit">个人原因:与已接单时间重叠</view>
  70. </view>
  71. </block>
  72. </view>
  73. <view class="rlist">接单</view>
  74. <view class="rlist btna">
  75. <view>我已</view>
  76. <view>完成</view>
  77. </view>
  78. </view>
  79. <view class="upbox flexcc" :class="ite.zhanflag?'':'act'" @click.stop="getZhan(idx)">
  80. {{ite.zhanflag?'折叠':'展开'}}<image :src="upimg"></image>
  81. </view>
  82. <!-- 接单 -->
  83. <view class="ohbtn" @click.stop="getBtnFn('tips')">接单</view>
  84. <!-- 接单后 -->
  85. <view class="flexcj">
  86. <view class="ohbtn btna" @click.stop="getBtnFn('cancel')">取消订单</view>
  87. <view class="ohbtn btnb" @click.stop="getBtnFn('addpho')">我已上门</view>
  88. </view>
  89. </view>
  90. </view>
  91. </block>
  92. <view class="shax">{{wtdt}}</view>
  93. </block>
  94. <!-- 无数据 -->
  95. <view class="nodata" v-else>
  96. <image :src="noiconpimg"></image>
  97. <view>暂无数据</view>
  98. </view>
  99. </view>
  100. </template>
  101. <script>
  102. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  103. import config from '@/config'
  104. export default{
  105. props:{
  106. datainfo: {
  107. type: Array,
  108. default () {
  109. return []
  110. }
  111. },
  112. wtdt:{
  113. type:String,
  114. default () {
  115. return ''
  116. }
  117. },
  118. type:{
  119. type:String,
  120. default () {
  121. return 0
  122. }
  123. },
  124. topval:{
  125. type:String,
  126. default () {
  127. return ''
  128. }
  129. }
  130. },
  131. data(){
  132. return{
  133. noiconpimg:require("@/static/images/nodata.png"),
  134. hlista:require("@/static/images/home/hlista.png"),
  135. hlistb:require("@/static/images/home/hlistb.png"),
  136. hlistc:require("@/static/images/home/hlistc.png"),
  137. hlistd:require("@/static/images/home/hlistd.png"),
  138. hliste:require("@/static/images/home/hliste.png"),
  139. hlistf:require("@/static/images/home/hlistf.png"),
  140. hlistg:require("@/static/images/home/hlistg.png"),
  141. hlisth:require("@/static/images/home/hlisth.png"),
  142. hlisti:require("@/static/images/home/hlisti.png"),
  143. hlistj:require("@/static/images/home/hlistj.png"),
  144. hlistk:require("@/static/images/home/hlistk.png"),
  145. // hicob:require("@/health/static/health/hicob.png"),
  146. // man:require("@/work/static/people/man.png"),
  147. // woman:require("@/work/static/people/woman.png"),
  148. upimg:require("@/static/images/home/ups.png"),
  149. adrimg:require("@/static/images/home/adrimg.png"),
  150. baseUrl:config.baseUrl,
  151. delBtnWidth:66,//左滑默认宽度
  152. }
  153. },
  154. mounted() {
  155. },
  156. methods:{
  157. checkPermi, checkRole,
  158. getDetail(e){
  159. this.$emit('getDetail',e)
  160. },
  161. getAddFn(e){
  162. this.$emit('getAddFn',e)
  163. },
  164. getReadlist(e){
  165. this.$emit('getReadlist',e)
  166. },
  167. getBtnFn(e){
  168. this.$emit('getBtnFn',e)
  169. },
  170. getZhan(idx){
  171. console.log(idx,1)
  172. // var obj=JSON.parse(JSON.stringify(this.datainfo))[idx]
  173. // obj.zhanflag=!obj.zhanflag;
  174. // this.datainfo.splice(idx,1,obj);
  175. this.datainfo[idx].zhanflag=!this.datainfo[idx].zhanflag
  176. },
  177. getPreview(idx,arr) {
  178. var newArr=[];
  179. arr.forEach(ite=>{
  180. var ds=this.baseUrl+ite
  181. newArr.push(ds)
  182. })
  183. uni.previewImage({
  184. urls: newArr,
  185. current:idx,
  186. success: function(data) {},
  187. fail: function(err) {}
  188. });
  189. },
  190. //开始触摸滑动
  191. drawStart(e) {
  192. // console.log("开始触发");
  193. var touch = e.touches[0];
  194. this.startX = touch.clientX;
  195. },
  196. //触摸滑动
  197. drawMove(e) {
  198. // console.log("滑动");
  199. for (var index in this.datainfo) {
  200. // this.csListArrl[index].right=0
  201. this.$set(this.datainfo[index],'right',0);
  202. }
  203. var idx=e.currentTarget.dataset.idx
  204. var touch = e.touches[0];
  205. var item = this.datainfo[idx];
  206. var disX = this.startX - touch.clientX;
  207. if (disX >= 20) {
  208. if (disX > this.delBtnWidth) {
  209. disX = this.delBtnWidth;
  210. }
  211. // this.csListArrl[idx].right=disX
  212. this.$set(this.datainfo[idx],'right',disX);
  213. } else {
  214. // this.csListArrl[idx].right=0
  215. this.$set(this.datainfo[idx],'right',0);
  216. }
  217. },
  218. //触摸滑动结束
  219. drawEnd(e) {
  220. // console.log("滑动结束");
  221. var idx=e.currentTarget.dataset.idx
  222. var item = this.datainfo[idx];
  223. if (item.right >= this.delBtnWidth / 2) {
  224. // this.datainfo[idx].right=this.delBtnWidth
  225. this.$set(this.datainfo[idx],'right',this.delBtnWidth);
  226. } else {
  227. this.datainfo[idx].right=0
  228. }
  229. },
  230. }
  231. }
  232. </script>
  233. <style lang="scss" scoped>
  234. .flex{display: flex;}
  235. .flexc{display: flex;align-items: center;}
  236. .mb10{margin-bottom: 20rpx;}
  237. .odlist{background: #FFFFFF;border-radius: 20rpx;margin-bottom: 24rpx;
  238. .odtop{border-bottom: 2rpx solid #E5E5E5;min-height: 78rpx;box-sizing: border-box;padding:8rpx 24rpx;
  239. .tit{font-weight: bold;font-size: 32rpx;color: #272727;}
  240. .txt{font-weight: 500;font-size: 24rpx;color: #AAAAAA;
  241. .t{font-size:22rpx;color: #FF8213;}
  242. .num{font-size:30rpx;color: #FF8213;}
  243. }
  244. }
  245. .odbox{padding:28rpx 12rpx 28rpx;}
  246. .lists{padding:0rpx 16rpx 0rpx 24rpx;align-items: stretch;
  247. .llists{
  248. .imgs{width: 28rpx;height: 28rpx;display: flex;align-items: center;justify-content: center;margin-right: 12rpx;flex: 0 0 auto;margin-top: 4rpx;
  249. .imga{width: 26rpx;height: 24rpx;}
  250. .imgb{width: 20rpx;height: 24rpx;}
  251. .imgc{width: 24rpx;height: 24rpx;}
  252. .imgd{width: 20rpx;height: 28rpx;}
  253. .imge{width: 26rpx;height: 26rpx;}
  254. .imgf{width: 26rpx;height: 28rpx;}
  255. .imgg{width: 28rpx;height: 30rpx;}
  256. }
  257. .oltit{font-weight: bold;font-size: 26rpx;color: #272727;line-height: 36rpx;}
  258. .olbtn{font-size: 26rpx;color: #0156FE;padding: 0 12rpx;border-left: 2rpx solid #AAAAAA;margin-left: 12rpx;line-height: 1;}
  259. .adrimg{width: 54rpx;height: 54rpx;flex: 0 0 auto;margin-left: 40rpx;}
  260. .phos{
  261. image{width: 80rpx;height: 80rpx;margin: 0 24rpx 8rpx 0;}
  262. }
  263. }
  264. .rlist{border-radius: 20rpx;border: 2rpx solid #E6E6E6;flex: 0 0 auto;margin-left: 40rpx;width: 88rpx;display: flex;align-items: center;justify-content: center;margin-bottom: 20rpx;font-weight: bold;
  265. font-size: 26rpx;color: #272727;
  266. &.btna{background: #1BDD95;color: #FFFFFF;flex-direction: column;}
  267. }
  268. }
  269. .upbox{font-weight: 500;font-size: 22rpx;color: #AAAAAA;padding: 2rpx 0;margin-bottom: 24rpx;
  270. image{width: 26rpx;height: 22rpx;margin-left: 14rpx;transition: all 0.3;}
  271. &.act{
  272. image{
  273. transform: rotate(-180deg);
  274. }
  275. }
  276. }
  277. .ohbtn{height: 88rpx;display: flex;align-items: center;justify-content: center;
  278. background: #1BDD95;font-weight: bold;font-size: 26rpx;color: #FFFFFF;border-radius: 20rpx;
  279. &.btna{border: 2rpx solid #DADADA;background-color: #FFFFFF;width: 340rpx;color: #666666;}
  280. &.btnb{width: 340rpx;}
  281. }
  282. }
  283. // 无数据
  284. .nodata{display: flex;flex-direction: column;align-items: center;
  285. image{width: 440rpx;height: 440rpx;}
  286. view{font-size: 30rpx;color: #666666;font-weight: bold;}
  287. }
  288. </style>