pending.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. <template>
  2. <view class="container">
  3. <view class="top_bg"></view>
  4. <view class="body">
  5. <!-- 每一个订单区域 -->
  6. <view class="body_item" v-for="item in dataList" :key="item.id">
  7. <!-- 工单编号 -->
  8. <view class="item_title">
  9. <img src="../../static/images/repairsImg/order.png" />
  10. <view class="title_info">工单编号:{{ item.order }}</view>
  11. </view>
  12. <!-- 报修时间 -->
  13. <view class="item_time">
  14. <view class="time_msg">
  15. 报修时间:
  16. <text>{{ item.time }}</text>
  17. </view>
  18. <view class="time_type">待接单</view>
  19. </view>
  20. <!-- 报修姓名 -->
  21. <view class="item_box">
  22. <view class="box_key">报修姓名:</view>
  23. <view class="box_value">{{ item.name }}</view>
  24. </view>
  25. <!-- 报修电话 -->
  26. <view class="item_box">
  27. <view class="box_key">报修电话:</view>
  28. <view class="box_value phone" @click="handleCallPhone(item.phone)">
  29. {{ item.phone }}
  30. <img src="../../static/images/repairsImg/phone.png" />
  31. </view>
  32. </view>
  33. <!-- 报修区域 -->
  34. <view class="item_box">
  35. <view class="box_key">报修区域:</view>
  36. <view class="box_value">{{ item.area }}</view>
  37. </view>
  38. <!-- 详细地址 -->
  39. <view class="item_box">
  40. <view class="box_key">详细地址:</view>
  41. <view class="box_value">{{ item.address }}</view>
  42. </view>
  43. <!-- 报修物品 -->
  44. <view class="item_box">
  45. <view class="box_key">报修物品:</view>
  46. <view class="box_value">{{ item.goods }}</view>
  47. </view>
  48. <!-- 故障描述 -->
  49. <view class="item_box">
  50. <view class="box_key">故障描述:</view>
  51. <view class="box_value">{{ item.description }}</view>
  52. </view>
  53. <!-- 上传图片 -->
  54. <view class="item_img">
  55. <view class="img_key">上传图片:</view>
  56. <img class="img_value" mode="aspectFill" :src="item.img[0]" @click="handleLookImgs(item.img)" />
  57. </view>
  58. <!-- 按钮区域 -->
  59. <view class="item_btn">
  60. <img src="../../static/images/repairsImg/close.png" @click="handleClose" />
  61. <view class="btn_box type" v-if="btns.includes('延时')" @click="handleDelay">延时</view>
  62. <view class="btn_box type" v-if="btns.includes('接单')" @click="handleOrderReceiving">接单</view>
  63. <view class="btn_box type2" v-if="btns.includes('派单')" @click="handleSendOrder">派单</view>
  64. </view>
  65. <!-- 关闭按钮弹窗 -->
  66. <uni-popup ref="popup_close" :is-mask-click="false">
  67. <view class="popup_close">
  68. <view
  69. :class="[{ active: activeIndex === index }, { radius: index === 0 }]"
  70. class="close_box"
  71. v-for="(ele, index) in closeList"
  72. :key="index"
  73. @click="handleChangeItem(index)"
  74. >
  75. {{ ele }}
  76. </view>
  77. <view class="close_btn">
  78. <view class="btn_box cancel" @click="$refs.popup_close[0].close()">取消</view>
  79. <view class="btn_box confirm" @click="handleCloseConfirm">确定</view>
  80. </view>
  81. </view>
  82. </uni-popup>
  83. </view>
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. export default {
  89. data() {
  90. return {
  91. // 按钮权限
  92. btns: [],
  93. // 关闭按钮弹窗当前索引
  94. activeIndex: 0,
  95. // 关闭按钮弹窗选项数组
  96. closeList: ['重复报单', '不属于维修范围', '已维修完成'],
  97. // 工单数据数组
  98. dataList: [
  99. {
  100. id: 1,
  101. order: '656262219626262',
  102. overtime: true,
  103. time: '2023.07.05 09:25:26',
  104. type: 1,
  105. name: '张三',
  106. phone: '13659585689',
  107. area: '行政楼',
  108. address: '3楼309',
  109. goods: '电脑',
  110. description: '水龙头坏了',
  111. img: [
  112. 'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  113. 'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
  114. 'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
  115. ]
  116. },
  117. {
  118. id: 2,
  119. order: '956262219626262',
  120. overtime: false,
  121. time: '2023.07.05 09:25:26',
  122. type: 2,
  123. name: '李四',
  124. phone: '13659585689',
  125. area: '行政楼',
  126. address: '3楼309',
  127. goods: '电脑',
  128. description: '电脑坏了',
  129. img: [
  130. 'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  131. 'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
  132. 'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
  133. ],
  134. workerName: '老张',
  135. workerPhone: '13659585689'
  136. },
  137. {
  138. id: 3,
  139. order: '956262219626262',
  140. overtime: false,
  141. time: '2023.07.05 09:25:26',
  142. type: 3,
  143. name: '李四',
  144. phone: '13659585689',
  145. area: '行政楼',
  146. address: '3楼309',
  147. goods: '电脑',
  148. description: '电脑坏了',
  149. img: [
  150. 'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  151. 'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
  152. 'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
  153. ],
  154. workerName: '老张',
  155. workerPhone: '13659585689',
  156. money: 50
  157. }
  158. ]
  159. }
  160. },
  161. mounted() {
  162. console.log('待处理池页面加载')
  163. const repairsUserInfo = uni.getStorageSync('repairsUserInfo')
  164. this.btns = repairsUserInfo.btns
  165. console.log(this.btns)
  166. },
  167. methods: {
  168. // 接单按钮回调
  169. handleOrderReceiving() {
  170. uni.showModal({
  171. content: '确定接单吗?',
  172. title: '提示',
  173. success: (res) => {
  174. if (res.confirm) {
  175. uni.showToast({
  176. title: '接单成功',
  177. icon: 'success'
  178. })
  179. }
  180. }
  181. })
  182. },
  183. // 关闭图标点击回调
  184. handleClose() {
  185. this.activeIndex = 0
  186. this.$refs.popup_close[0].open('center')
  187. },
  188. // 关闭弹窗确定按钮回调
  189. handleCloseConfirm() {
  190. uni.showModal({
  191. title: '提示',
  192. content: '确定关闭订单吗?',
  193. success: (res) => {
  194. if (res.confirm) {
  195. uni.showToast({
  196. title: '关单成功',
  197. icon: 'success'
  198. })
  199. console.log(this.closeList[this.activeIndex])
  200. this.$refs.popup_close[0].close()
  201. }
  202. }
  203. })
  204. },
  205. // 关闭按钮弹窗选中按钮时回调
  206. handleChangeItem(val) {
  207. this.activeIndex = val
  208. },
  209. // 延时按钮回调
  210. handleDelay() {
  211. uni.navigateTo({
  212. url: '/pagesRepairs/delay/delay'
  213. })
  214. },
  215. // 派单按钮回调
  216. handleSendOrder() {
  217. uni.navigateTo({
  218. url: '/pagesRepairs/helpPeople/helpPeople?type=2'
  219. })
  220. },
  221. // 点击电话号码回调
  222. handleCallPhone(phone) {
  223. console.log(phone)
  224. uni.makePhoneCall({
  225. phoneNumber: phone
  226. })
  227. },
  228. // 点击图片回调
  229. handleLookImgs(img) {
  230. // console.log(img)
  231. uni.previewImage({
  232. urls: img
  233. })
  234. }
  235. }
  236. }
  237. </script>
  238. <style lang="scss" scoped>
  239. .container {
  240. width: 100vw;
  241. height: calc(100vh - 152rpx);
  242. font-size: 32rpx;
  243. overflow-y: auto;
  244. .top_bg {
  245. height: 165rpx;
  246. background-color: #6fb6b8;
  247. }
  248. .body {
  249. box-sizing: border-box;
  250. margin: auto;
  251. margin-top: -100rpx;
  252. padding: 2rpx;
  253. width: 690rpx;
  254. border-radius: 11rpx 11rpx 0 0;
  255. background-color: #fff;
  256. overflow-y: auto;
  257. .body_item {
  258. margin-bottom: 20rpx;
  259. border-radius: 11rpx;
  260. box-shadow: 0 0 8rpx #d9d9d9;
  261. .item_title {
  262. display: flex;
  263. align-items: center;
  264. padding: 0 30rpx;
  265. height: 87rpx;
  266. border-bottom: 1rpx solid #e6e6e6;
  267. img {
  268. width: 30rpx;
  269. height: 30rpx;
  270. }
  271. .title_info {
  272. margin: 0 21rpx 0 13rpx;
  273. // font-size: 28rpx;
  274. }
  275. }
  276. .item_time {
  277. display: flex;
  278. justify-content: space-between;
  279. align-items: center;
  280. padding: 0 30rpx;
  281. height: 79rpx;
  282. .time_msg {
  283. // font-size: 28rpx;
  284. color: #808080;
  285. text {
  286. color: #000000;
  287. }
  288. }
  289. .time_type {
  290. font-size: 32rpx;
  291. color: #ff5733;
  292. }
  293. }
  294. .item_box {
  295. display: flex;
  296. padding: 0 30rpx;
  297. height: 60rpx;
  298. // font-size: 28rpx;
  299. .box_key {
  300. color: #808080;
  301. }
  302. .box_value {
  303. display: flex;
  304. img {
  305. margin-left: 10rpx;
  306. width: 45rpx;
  307. height: 45rpx;
  308. }
  309. }
  310. .phone {
  311. color: #6fb6b8;
  312. }
  313. }
  314. .item_img {
  315. display: flex;
  316. align-items: center;
  317. padding: 0 30rpx;
  318. height: 120rpx;
  319. color: #808080;
  320. // font-size: 28rpx;
  321. .img_key {
  322. }
  323. .img_value {
  324. width: 120rpx;
  325. height: 120rpx;
  326. border-radius: 14rpx;
  327. }
  328. }
  329. .item_btn {
  330. display: flex;
  331. align-items: center;
  332. justify-content: flex-end;
  333. padding: 0 30rpx;
  334. height: 153rpx;
  335. img {
  336. margin-right: auto;
  337. width: 56rpx;
  338. height: 56rpx;
  339. }
  340. .btn_box {
  341. display: flex;
  342. justify-content: center;
  343. align-items: center;
  344. margin-left: 16rpx;
  345. width: 174rpx;
  346. height: 68rpx;
  347. // font-size: 28rpx;
  348. border-radius: 11rpx;
  349. }
  350. .type {
  351. color: #fff;
  352. background-color: #6fb6b8;
  353. }
  354. .type2 {
  355. color: #6fb6b8;
  356. background-color: #fff;
  357. border: 1rpx solid #6fb6b8;
  358. }
  359. }
  360. .popup_close {
  361. width: 690rpx;
  362. border-radius: 19rpx;
  363. background-color: #fff;
  364. .close_box {
  365. height: 100rpx;
  366. line-height: 100rpx;
  367. text-align: center;
  368. font-size: 32rpx;
  369. border: 1rpx solid #e6e6e6;
  370. }
  371. .radius {
  372. border-radius: 19rpx 19rpx 0 0;
  373. }
  374. .active {
  375. color: #fff;
  376. background-color: #6fb6b8;
  377. }
  378. .close_btn {
  379. display: flex;
  380. align-items: center;
  381. justify-content: space-evenly;
  382. margin-top: 100rpx;
  383. height: 121rpx;
  384. .btn_box {
  385. display: flex;
  386. justify-content: center;
  387. align-items: center;
  388. width: 203rpx;
  389. height: 72rpx;
  390. border-radius: 9rpx;
  391. font-size: 32rpx;
  392. }
  393. .cancel {
  394. background-color: #e5e5e5;
  395. color: #6fb6b8;
  396. }
  397. .confirm {
  398. background-color: #6fb6b8;
  399. color: #fff;
  400. }
  401. }
  402. }
  403. }
  404. }
  405. }
  406. </style>