myRepairs.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. <template>
  2. <view class="container">
  3. <!-- 顶部分段器区域 -->
  4. <view class="control">
  5. <view class="control_item" :class="{ active: current === index }" v-for="(item, index) in items" :key="index" @click="onClickItem(index)">{{ item }}</view>
  6. </view>
  7. <!-- 主体内容区域 -->
  8. <view class="body">
  9. <!-- 每一个记录区域 -->
  10. <view class="body_item" v-for="item in list" :key="item.id">
  11. <!-- 工单编号 -->
  12. <view class="item_title" @click="handleLookDetail(item)">
  13. <img src="../../static/images/repairsImg/order.png" />
  14. <view class="title_info">工单编号:{{ item.order }}</view>
  15. <view class="title_type" v-if="item.overtime">超时未接</view>
  16. </view>
  17. <!-- 报修时间 -->
  18. <view class="item_time">
  19. <view class="time_msg">
  20. 报修时间:
  21. <text>{{ item.time }}</text>
  22. </view>
  23. <view class="time_type" v-if="item.type === 1">待接单</view>
  24. <view class="time_type color_type" v-if="item.type === 2">维修中</view>
  25. <view class="time_type" v-if="item.type === 3">待确认</view>
  26. <view class="time_type color_type2" v-if="item.type === 4">已完成</view>
  27. <view class="time_type" v-if="item.type === 5">已取消</view>
  28. </view>
  29. <!-- 报修姓名 -->
  30. <view class="item_box">
  31. <view class="box_key">报修姓名:</view>
  32. <view class="box_value">{{ item.name }}</view>
  33. </view>
  34. <!-- 报修电话 -->
  35. <view class="item_box">
  36. <view class="box_key">报修电话:</view>
  37. <view class="box_value phone" @click="handleCallPhone('13820846714')">
  38. {{ item.phone }}
  39. <img src="../../static/images/repairsImg/phone.png" />
  40. </view>
  41. </view>
  42. <!-- 报修区域 -->
  43. <view class="item_box">
  44. <view class="box_key">报修区域:</view>
  45. <view class="box_value">{{ item.area }}</view>
  46. </view>
  47. <!-- 详细地址 -->
  48. <view class="item_box">
  49. <view class="box_key">详细地址:</view>
  50. <view class="box_value">{{ item.address }}</view>
  51. </view>
  52. <!-- 报修物品 -->
  53. <view class="item_box">
  54. <view class="box_key">报修物品:</view>
  55. <view class="box_value">{{ item.goods }}</view>
  56. </view>
  57. <!-- 故障描述 -->
  58. <view class="item_box">
  59. <view class="box_key">故障描述:</view>
  60. <view class="box_value">{{ item.description }}</view>
  61. </view>
  62. <!-- 上传图片 -->
  63. <view class="item_img">
  64. <view class="img_key">上传图片:</view>
  65. <img class="img_value" mode="aspectFill" :src="item.img[0]" @click="handleLookImgs(item.img)" />
  66. </view>
  67. <!-- 维修师傅 -->
  68. <view class="item_time" v-if="item.type === 3 || item.type === 4">
  69. <view class="time_msg">
  70. 维修师傅:
  71. <text>{{ item.workerName }}</text>
  72. </view>
  73. </view>
  74. <!-- 师傅电话 -->
  75. <view class="item_box" v-if="item.type === 3 || item.type === 4">
  76. <view class="box_key">师傅电话:</view>
  77. <view class="box_value phone" @click="handleCallPhone('13820846714')">
  78. {{ item.workerPhone }}
  79. <img src="../../static/images/repairsImg/phone.png" />
  80. </view>
  81. </view>
  82. <!-- 维修费用 -->
  83. <view class="item_box" v-if="item.type === 3 || item.type === 4">
  84. <view class="box_key">维修费用:</view>
  85. <view class="box_value2 phone" @click="checkFeeDetail">
  86. {{ item.money }}元
  87. <img src="../../static/images/repairsImg/eye.png" />
  88. </view>
  89. </view>
  90. <!-- 维修费用弹窗 -->
  91. <uni-popup :is-mask-click="false" ref="popup_fee">
  92. <view class="pop_fee">
  93. <view class="fee_title">
  94. 维修费用
  95. <text @click="$refs.popup_fee[0].close()">×</text>
  96. </view>
  97. <view class="fee_box">
  98. 耗材:
  99. <text>螺丝刀</text>
  100. </view>
  101. <view class="fee_box">
  102. 耗材单价:
  103. <text>1元</text>
  104. </view>
  105. <view class="fee_box">
  106. 耗材数量:
  107. <text>2</text>
  108. </view>
  109. <view class="fee_box">
  110. 耗材费用:
  111. <text>2元</text>
  112. </view>
  113. </view>
  114. </uni-popup>
  115. <!-- 按钮 -->
  116. <view class="item_btn" v-if="item.type !== 5">
  117. <view class="btn_box type" v-if="item.type === 1 || item.type === 2">催单</view>
  118. <view class="btn_box type" v-if="item.type === 3" @click="handleBackOffice">转后勤</view>
  119. <view class="btn_box type" v-if="item.type === 3">支付</view>
  120. <view class="btn_box type2" v-if="item.type < 4">撤销</view>
  121. <view class="btn_box type" v-if="item.type === 4" @click="handleEvaluate">去评价</view>
  122. </view>
  123. <view class="item_btn2" v-else></view>
  124. <!-- 转后勤弹窗 -->
  125. <uni-popup ref="popup_logistics" :is-mask-click="false">
  126. <view class="pop_logistics">
  127. <view class="logistics_title">转后勤</view>
  128. <view class="logistics_body">
  129. <textarea placeholder-style="color:#CCCCCC" placeholder="请输入您宝贵的留言"></textarea>
  130. </view>
  131. <view class="logistics_btn">
  132. <view class="btn_box cancel" @click="$refs.popup_logistics[0].close()">取消</view>
  133. <view class="btn_box confirm" @click="$refs.popup_logistics[0].close()">确定</view>
  134. </view>
  135. </view>
  136. </uni-popup>
  137. </view>
  138. </view>
  139. </view>
  140. </template>
  141. <script>
  142. export default {
  143. data() {
  144. return {
  145. items: ['未完成(2)', '待确认(4)', '已完成(5)'],
  146. current: 0,
  147. list: [],
  148. // type为 1 是 待接单,type为 2 是维修中,
  149. // type为 3 是 待确认,type为 4 是已完成,
  150. // type为 5 是已取消
  151. dataList: [
  152. {
  153. id: 1,
  154. order: '656262219626262',
  155. overtime: true,
  156. time: '2023.07.05 09:25:26',
  157. type: 1,
  158. name: '张三',
  159. phone: '13659585689',
  160. area: '行政楼',
  161. address: '3楼309',
  162. goods: '电脑',
  163. description: '水龙头坏了',
  164. img: [
  165. 'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  166. 'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
  167. 'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
  168. ]
  169. },
  170. {
  171. id: 2,
  172. order: '956262219626262',
  173. overtime: false,
  174. time: '2023.07.05 09:25:26',
  175. type: 2,
  176. name: '李四',
  177. phone: '13659585689',
  178. area: '行政楼',
  179. address: '3楼309',
  180. goods: '电脑',
  181. description: '电脑坏了',
  182. img: [
  183. 'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  184. 'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
  185. 'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
  186. ]
  187. }
  188. ],
  189. dataList2: [
  190. {
  191. id: 19999,
  192. order: '656262219626262',
  193. overtime: false,
  194. time: '2023.07.05 09:25:26',
  195. type: 3,
  196. name: '张三',
  197. phone: '13659585689',
  198. area: '行政楼',
  199. address: '3楼309',
  200. goods: '电脑',
  201. description: '水龙头坏了',
  202. img: [
  203. 'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  204. 'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
  205. 'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
  206. ],
  207. workerName: '小李',
  208. workerPhone: '13659585689',
  209. money: 50
  210. }
  211. ],
  212. dataList3: [
  213. {
  214. id: 1854,
  215. order: '656262219626262',
  216. overtime: false,
  217. time: '2023.07.05 09:25:26',
  218. type: 4,
  219. name: '张三',
  220. phone: '13659585689',
  221. area: '行政楼',
  222. address: '3楼309',
  223. goods: '电脑',
  224. description: '水龙头坏了',
  225. img: [
  226. 'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  227. 'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
  228. 'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
  229. ],
  230. workerName: '小李',
  231. workerPhone: '13659585689',
  232. money: 50
  233. },
  234. {
  235. id: 2789,
  236. order: '656262219626262',
  237. overtime: false,
  238. time: '2023.07.05 09:25:26',
  239. type: 5,
  240. name: '张三',
  241. phone: '13659585689',
  242. area: '行政楼',
  243. address: '3楼309',
  244. goods: '电脑',
  245. description: '水龙头坏了',
  246. img: [
  247. 'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  248. 'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
  249. 'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
  250. ],
  251. workerName: '小李',
  252. workerPhone: '13659585689',
  253. money: 50
  254. }
  255. ]
  256. }
  257. },
  258. mounted() {
  259. this.list = this.dataList
  260. },
  261. methods: {
  262. // 分段器切换回调
  263. onClickItem(index) {
  264. console.log(index)
  265. if (this.current != index) {
  266. this.current = index
  267. }
  268. if (this.current === 0) {
  269. this.list = this.dataList
  270. } else if (this.current === 1) {
  271. this.list = this.dataList2
  272. } else {
  273. this.list = this.dataList3
  274. }
  275. },
  276. // 查看维修费用回调
  277. checkFeeDetail() {
  278. this.$refs.popup_fee[0].open('center')
  279. },
  280. // 转后勤按钮回调
  281. handleBackOffice() {
  282. this.$refs.popup_logistics[0].open('center')
  283. },
  284. // 去评价按钮回调
  285. handleEvaluate() {
  286. uni.navigateTo({
  287. url: '/pagesRepairs/evaluate/evaluate'
  288. })
  289. },
  290. // 点击工单编号区域回调
  291. handleLookDetail(item) {
  292. const detailInfo = JSON.stringify(item)
  293. uni.navigateTo({
  294. url: `/pagesRepairs/repairDetails/repairDetails?detailInfo=${detailInfo}`
  295. })
  296. },
  297. // 点击电话号码回调
  298. handleCallPhone(phone) {
  299. console.log(phone)
  300. uni.makePhoneCall({
  301. phoneNumber: phone
  302. })
  303. },
  304. // 点击图片回调
  305. handleLookImgs(img) {
  306. // console.log(img)
  307. uni.previewImage({
  308. urls: img
  309. })
  310. }
  311. }
  312. }
  313. </script>
  314. <style lang="scss" scoped>
  315. .container {
  316. display: flex;
  317. flex-direction: column;
  318. box-sizing: border-box;
  319. padding: 0 30rpx;
  320. width: 100vw;
  321. height: calc(100vh - 152rpx);
  322. overflow-y: auto;
  323. .control {
  324. display: flex;
  325. box-sizing: border-box;
  326. margin: 26rpx 0 29rpx;
  327. padding: 6rpx;
  328. width: 100%;
  329. height: 88rpx;
  330. border-radius: 18rpx;
  331. background-color: #f2f2f2;
  332. .control_item {
  333. flex: 1;
  334. display: flex;
  335. justify-content: center;
  336. align-items: center;
  337. height: 76rpx;
  338. font-size: 32rpx;
  339. }
  340. .active {
  341. border-radius: 18rpx;
  342. background-color: #fff;
  343. }
  344. }
  345. .body {
  346. // height: calc(100vh - 190rpx);
  347. // overflow-y: auto;
  348. .body_item {
  349. margin: 10rpx 10rpx 30rpx;
  350. // height: 799rpx;
  351. border-radius: 11rpx;
  352. box-shadow: 0 0 8rpx #d9d9d9;
  353. .item_title {
  354. display: flex;
  355. align-items: center;
  356. padding: 0 30rpx;
  357. height: 87rpx;
  358. border-bottom: 1rpx solid #e6e6e6;
  359. img {
  360. width: 30rpx;
  361. height: 30rpx;
  362. }
  363. .title_info {
  364. margin: 0 21rpx 0 13rpx;
  365. font-size: 28rpx;
  366. }
  367. .title_type {
  368. width: 137rpx;
  369. height: 47rpx;
  370. line-height: 47rpx;
  371. text-align: center;
  372. border-radius: 136rpx;
  373. color: #ff5733;
  374. font-size: 24rpx;
  375. border: 1rpx solid #ff5733;
  376. }
  377. }
  378. .item_time {
  379. display: flex;
  380. justify-content: space-between;
  381. align-items: center;
  382. padding: 0 30rpx;
  383. height: 79rpx;
  384. .time_msg {
  385. font-size: 28rpx;
  386. color: #808080;
  387. text {
  388. color: #000000;
  389. }
  390. }
  391. .time_type {
  392. font-size: 32rpx;
  393. color: #ff5733;
  394. }
  395. .color_type {
  396. color: #1e7dfb;
  397. }
  398. .color_type2 {
  399. color: #6fb6b8;
  400. }
  401. }
  402. .item_box {
  403. display: flex;
  404. padding: 0 30rpx;
  405. height: 60rpx;
  406. font-size: 28rpx;
  407. .box_key {
  408. color: #808080;
  409. }
  410. .box_value {
  411. display: flex;
  412. img {
  413. margin-top: 5rpx;
  414. margin-left: 10rpx;
  415. width: 28rpx;
  416. height: 28rpx;
  417. }
  418. }
  419. .box_value2 {
  420. display: flex;
  421. img {
  422. margin-top: -2rpx;
  423. margin-left: 14rpx;
  424. width: 46rpx;
  425. height: 46rpx;
  426. }
  427. }
  428. .phone {
  429. color: #6fb6b8;
  430. }
  431. }
  432. .item_img {
  433. display: flex;
  434. align-items: center;
  435. padding: 0 30rpx;
  436. height: 120rpx;
  437. color: #808080;
  438. font-size: 28rpx;
  439. .img_key {
  440. }
  441. .img_value {
  442. width: 120rpx;
  443. height: 120rpx;
  444. border-radius: 14rpx;
  445. }
  446. }
  447. .item_btn {
  448. display: flex;
  449. align-items: center;
  450. justify-content: flex-end;
  451. padding: 0 30rpx;
  452. height: 153rpx;
  453. .btn_box {
  454. display: flex;
  455. justify-content: center;
  456. align-items: center;
  457. margin-left: 16rpx;
  458. width: 174rpx;
  459. height: 68rpx;
  460. font-size: 28rpx;
  461. border-radius: 11rpx;
  462. }
  463. .type {
  464. color: #fff;
  465. background-color: #6fb6b8;
  466. }
  467. .type2 {
  468. color: #6fb6b8;
  469. background-color: #fff;
  470. border: 1rpx solid #6fb6b8;
  471. }
  472. }
  473. .item_btn2 {
  474. height: 50rpx;
  475. }
  476. .pop_fee {
  477. padding-bottom: 50rpx;
  478. border-radius: 19rpx;
  479. background-color: #fff;
  480. .fee_title {
  481. display: flex;
  482. justify-content: space-between;
  483. align-items: center;
  484. box-sizing: border-box;
  485. padding: 0 31rpx 0 42rpx;
  486. width: 690rpx;
  487. height: 110rpx;
  488. font-size: 32rpx;
  489. font-weight: bold;
  490. border-radius: 19rpx 19rpx 0 0;
  491. border-bottom: 1rpx solid #e6e6e6;
  492. text {
  493. font-size: 45rpx;
  494. font-weight: 400;
  495. color: #808080;
  496. }
  497. }
  498. .fee_box {
  499. display: flex;
  500. align-items: center;
  501. padding-left: 42rpx;
  502. height: 80rpx;
  503. font-size: 28rpx;
  504. color: #808080;
  505. text {
  506. color: #000000;
  507. }
  508. }
  509. }
  510. .pop_logistics {
  511. border-radius: 19rpx;
  512. background-color: #fff;
  513. .logistics_title {
  514. display: flex;
  515. justify-content: center;
  516. align-items: center;
  517. width: 690rpx;
  518. height: 110rpx;
  519. font-size: 32rpx;
  520. font-weight: bold;
  521. border-radius: 19rpx 19rpx 0 0;
  522. border-bottom: 1rpx solid #e6e6e6;
  523. }
  524. .logistics_body {
  525. height: 440rpx;
  526. border-bottom: 1rpx solid #e6e6e6;
  527. textarea {
  528. box-sizing: border-box;
  529. margin: 35rpx 40rpx;
  530. padding: 20rpx;
  531. width: 610rpx;
  532. height: 370rpx;
  533. font-size: 28rpx;
  534. border-radius: 14rpx;
  535. border: 1rpx solid #e6e6e6;
  536. }
  537. }
  538. .logistics_btn {
  539. display: flex;
  540. align-items: center;
  541. justify-content: space-evenly;
  542. height: 121rpx;
  543. .btn_box {
  544. display: flex;
  545. justify-content: center;
  546. align-items: center;
  547. width: 203rpx;
  548. height: 72rpx;
  549. border-radius: 9rpx;
  550. font-size: 32rpx;
  551. }
  552. .cancel {
  553. background-color: #e5e5e5;
  554. color: #6fb6b8;
  555. }
  556. .confirm {
  557. background-color: #6fb6b8;
  558. color: #fff;
  559. }
  560. }
  561. }
  562. }
  563. }
  564. }
  565. </style>