pending.vue 9.4 KB

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