repairDetail2.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <u-navbar :title="title" @leftClick="leftClick" bgColor="rgba(0,0,0,0)" :placeholder="true"></u-navbar>
  5. <view class="state" v-if="pageData.repair.status == 1">暂未填写报价,请及时报价</view>
  6. <view class="state" v-if="pageData.repair.status == 2 && pageData.price == 0">暂未填写报价,请及时报价</view>
  7. <view class="state" v-if="pageData.repair.status == 2 && pageData.price != 0">已报价,等待匹配</view>
  8. <view class="state" v-if="pageData.repair.status == 3">已匹配成功</view>
  9. <view class="top_box">
  10. <view class="hflex jbetween">
  11. <view class="hflex acenter">
  12. <image :src="pageData.user.headimg" class="headimg"></image>
  13. <view class="img_right">
  14. <view class="hflex acenter ">
  15. <view class="name text_hide">{{pageData.user.nickname}}</view>
  16. <view class="blue_bg">维修工</view>
  17. </view>
  18. <view class="hflex acenter ">
  19. <view class="text_style1">已认证</view>
  20. <!-- <view class="text_style1">| {{worker.wxc}}</view> -->
  21. </view>
  22. </view>
  23. </view>
  24. <!-- <view class="text_red">报价:<span style="font-size: 36rpx;">¥{{pageData.price?pageData.price:'暂无'}}</span></view> -->
  25. </view>
  26. <view class="hflex acenter jbetween" style="padding-top: 32rpx;">
  27. <view class="hflex acenter">
  28. <view class="text_style1">联系电话:</view>
  29. <view class="text_style1">{{pageData.user.phone}}</view>
  30. <view class="phone hflex acenter jcenter" @click.stop="makeCell(pageData.user.phone)">
  31. <u-icon name="phone-fill" color="#506DFF" size="9"></u-icon>
  32. </view>
  33. </view>
  34. <view class="btn hflex acenter jcenter" @click.stop="toOffer">查看详情</view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="box">
  39. <view class="hflex acenter" style="padding-top: 28rpx;">
  40. <image :src="pageData.repair.user.headimg" class="headimg"></image>
  41. <view class="img_right">
  42. <view class="hflex acenter ">
  43. <view class="name text_hide">{{pageData.repair.user.nickname}}</view>
  44. </view>
  45. <view class="hflex acenter ">
  46. <view class="text_style1">{{pageData.repair.province}}{{pageData.repair.city}}</view>
  47. <view class="text_style1">| {{pageData.repair.create_at}}发布</view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="box_contetn">{{pageData.repair.describe}}</view>
  52. <view class="imgs hflex acenter fwrap">
  53. <block v-for="(item,index) in pageData.repair.imgs" :key="index">
  54. <image :src="item" class="img" mode="aspectFill"></image>
  55. </block>
  56. </view>
  57. <view class="hflex acenter jbetween cell">
  58. <view class="left_text">联系方式</view>
  59. <view class="right_text">{{pageData.repair.user.phone}}</view>
  60. </view>
  61. <view class="hflex acenter jbetween cell">
  62. <view class="left_text">维修时间</view>
  63. <view class="right_text">{{pageData.repair.start_time}}至{{pageData.repair.end_time}}</view>
  64. </view>
  65. <view class="hflex acenter jbetween cell" style="padding-bottom: 28rpx;">
  66. <view class="left_text">维修地点</view>
  67. <view class="right_text">{{pageData.repair.address}}</view>
  68. </view>
  69. <view class="hflex acenter jbetween type">
  70. <view class="right_text">订单类型</view>
  71. <view class="text_blue">{{pageData.repair.quick==2?'快修':'普修'}}</view>
  72. </view>
  73. <view class="offer hflex acenter jbetween">
  74. <view class="hflex acenter">
  75. <view class="offer_label">订单报价:</view>
  76. <view class="offer_label" style="color: #FF3636;" v-if="pageData.price && pageData.price==0">
  77. 暂未填写报价
  78. </view>
  79. <view class="offer_text" v-else>¥{{pageData.price}}</view>
  80. </view>
  81. <view class="btn hflex acenter jcenter" @click="toOffer" v-if="pageData.price && pageData.price==0">立即报价</view>
  82. <view class="btn hflex acenter jcenter" @click="toOffer" v-else>查看详情</view>
  83. </view>
  84. </view>
  85. <view class="box" v-if="pageData.repair.status == 3">
  86. <view class="hflex acenter jbetween cell">
  87. <view class="left_text">订单编号</view>
  88. <view class="right_text">{{pageData.repair.order_no}}</view>
  89. </view>
  90. <view class="hflex acenter jbetween cell">
  91. <view class="left_text">创建时间</view>
  92. <view class="right_text">{{pageData.repair.success_at}}</view>
  93. </view>
  94. </view>
  95. <view style="margin-bottom: 186rpx;"></view>
  96. <view class="bottom">
  97. <view class="hflex acenter jcenter" v-if="pageData.repair.status == 3">
  98. <view class="left_btn hflex acenter jcenter" @click="openDown">
  99. <image src="https://ship.shipcc.cn/common/down-blue.png" style="width: 33rpx; height: 33rpx;"></image>
  100. <view>下载维修单</view>
  101. </view>
  102. <view class="right_btn hflex acenter jcenter" @click="toChat(pageData.repair.id)">查看回复</view>
  103. </view>
  104. <view class="btn hflex acenter jcenter" v-else>
  105. <view @click="toChat(pageData.repair.id)">查看回复</view>
  106. </view>
  107. </view>
  108. <u-popup :show="down_show" @close="close" :round="10" mode="center" :closeable="true">
  109. <view class="popu">
  110. <view class="popu_top hflex acenter jbetween">
  111. <view></view>
  112. <view class="popu_title">下载维修单</view>
  113. <view></view>
  114. </view>
  115. <view class="file_bg hflex acenter">
  116. <!-- <image :src="pageData.items[index1].enclosure[index2].icon" class="file_icon"></image> -->
  117. <view class="file_name text_hide">{{pageData.repair.down_word}}</view>
  118. </view>
  119. <view class="btn_group hflex acenter jbetween">
  120. <view class="left_btn hflex acenter jcenter" @click="copy(pageData.repair.down_word)">复制链接</view>
  121. <view class="right_btn hflex acenter jcenter" @click="see(pageData.repair.down_word)">预览文件</view>
  122. </view>
  123. <!-- <view class="hflex acenter jcenter text_blue" @click="see(pageData.items[index1].enclosure[index2].fileurl)">预览文件></view> -->
  124. </view>
  125. </u-popup>
  126. </view>
  127. </template>
  128. <script>
  129. import $api from '@/static/js/api.js'
  130. var that = ''
  131. export default {
  132. data() {
  133. return {
  134. title: '',
  135. active: -1,
  136. type: '',
  137. id: '',
  138. pageData: {},
  139. offer_id: '',
  140. down_show: false
  141. }
  142. },
  143. onLoad(options) {
  144. that = this
  145. that.id = options.id
  146. that.type = options.type
  147. that.getData()
  148. },
  149. onReady() {
  150. if(true) {
  151. uni.setNavigationBarTitle({
  152. title: '订单详情'
  153. })
  154. }
  155. },
  156. methods: {
  157. leftClick() {
  158. $api.jump(-1)
  159. },
  160. getData() {
  161. $api.req({
  162. url: '/data/api.auth.Center/repairdetail',
  163. method: 'POST',
  164. data: {
  165. type: that.type,
  166. id: that.id
  167. }
  168. }, function(res) {
  169. if(res.code == 1) {
  170. that.pageData = res.data
  171. }
  172. })
  173. },
  174. selectItem(index,id) {
  175. that.active = index
  176. that.offer_id = id
  177. },
  178. match() {
  179. if(that.active == -1) {
  180. $api.info('请选择维修工')
  181. return
  182. } else {
  183. that.show = true
  184. }
  185. },
  186. close() {
  187. that.show = false
  188. that.down_show = false
  189. },
  190. sure() {
  191. $api.req({
  192. url: '/data/api.auth.Center/repairoffer',
  193. method: 'POST',
  194. data: {
  195. id: that.pageData.id,
  196. offer_id: that.offer_id
  197. }
  198. }, function(res) {
  199. if(res.code == 1) {
  200. $api.info(res.info)
  201. }
  202. })
  203. that.close()
  204. that.getData()
  205. },
  206. makeCell(mobile) {
  207. $api.makeCall(mobile)
  208. },
  209. toChat(id) {
  210. $api.jump('/page_shop/pages/order/chat2?id=' + id)
  211. },
  212. toOffer() {
  213. $api.jump('/page_shop/pages/order/offer2?id=' + that.pageData.repair_id + '&status=' + that.pageData.repair.status)
  214. },
  215. openDown() {
  216. /* var url = that.pageData.repair.down_word
  217. wx.downloadFile({
  218. url: url, //仅为示例,并非真实的资源
  219. success (res) {
  220. // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
  221. if (res.statusCode === 200) {
  222. const filePath = res.tempFilePath
  223. uni.saveFile({
  224. tempFilePath: filePath,
  225. success: function(res) {
  226. console.log(res);
  227. that.close()
  228. that.see(res.savedFilePath)
  229. }
  230. })
  231. }
  232. }
  233. }) */
  234. that.down_show = true
  235. },
  236. down(url) {
  237. wx.downloadFile({
  238. url: url, //仅为示例,并非真实的资源
  239. success (res) {
  240. // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
  241. if (res.statusCode === 200) {
  242. const filePath = res.tempFilePath
  243. uni.saveFile({
  244. tempFilePath: filePath,
  245. success: function(res) {
  246. console.log(res);
  247. that.close()
  248. that.see(res.savedFilePath)
  249. }
  250. })
  251. }
  252. }
  253. })
  254. },
  255. copy(url) {
  256. uni.setClipboardData({
  257. data: url,
  258. success: function () {
  259. $api.info('复制成功')
  260. that.close()
  261. }
  262. });
  263. },
  264. see(url) {
  265. wx.downloadFile({
  266. // 示例 url,并非真实存在
  267. url: url,
  268. showMenu: true,
  269. success: function (res) {
  270. const filePath = res.tempFilePath
  271. wx.openDocument({
  272. filePath: filePath,
  273. success: function (res) {
  274. console.log('打开文档成功')
  275. }
  276. })
  277. }
  278. })
  279. }
  280. },
  281. }
  282. </script>
  283. <style lang="scss" scoped>
  284. .content {
  285. background: #F4F4F4;
  286. .top {
  287. box-sizing: border-box;
  288. width: 100%;
  289. padding: 0 30rpx;
  290. background: linear-gradient(180deg, #506DFF 0%, #F3F3F3 100%);
  291. .state {
  292. font-size: 44rpx;
  293. font-weight: 500;
  294. color: #FFFFFF;
  295. line-height: 60rpx;
  296. padding: 28rpx 0;
  297. }
  298. .top_box {
  299. width: 100%;
  300. box-sizing: border-box;
  301. padding: 28rpx 20rpx 20rpx;
  302. background: #FFFFFF;
  303. border-radius: 10px;
  304. .headimg {
  305. width: 72rpx;
  306. height: 72rpx;
  307. border-radius: 50%;
  308. }
  309. .img_right {
  310. margin-left: 12rpx;
  311. .name {
  312. max-width: 500rpx;
  313. font-size: 30rpx;
  314. font-weight: 400;
  315. color: #222222;
  316. line-height: 42rpx;
  317. }
  318. .blue_bg {
  319. margin-left: 8rpx;
  320. width: 72rpx;
  321. height: 28rpx;
  322. background: #506DFF;
  323. border-radius: 4rpx;
  324. font-size: 20rpx;
  325. font-weight: 400;
  326. color: #FFFFFF;
  327. line-height: 28rpx;
  328. text-align: center;
  329. }
  330. }
  331. .text_red {
  332. font-size: 24rpx;
  333. font-weight: 400;
  334. color: #FF4646;
  335. line-height: 34rpx;
  336. }
  337. .text_style1 {
  338. font-size: 24rpx;
  339. font-weight: 400;
  340. color: #666666;
  341. line-height: 34rpx;
  342. padding-right: 12rpx;
  343. }
  344. .phone {
  345. width: 32rpx;
  346. height: 32rpx;
  347. background: #E1E6FF;
  348. border-radius: 8rpx;
  349. }
  350. .btn {
  351. width: 132rpx;
  352. height: 48rpx;
  353. border-radius: 24rpx;
  354. border: 2rpx solid #506DFF;
  355. font-size: 24rpx;
  356. font-weight: 400;
  357. color: #506DFF;
  358. line-height: 48rpx;
  359. }
  360. }
  361. }
  362. .box {
  363. width: 690rpx;
  364. margin: 20rpx auto 0;
  365. box-sizing: border-box;
  366. padding: 0 20rpx 20rpx;
  367. background: #FFFFFF;
  368. border-radius: 10px;
  369. .box_contetn {
  370. font-size: 28rpx;
  371. font-weight: 400;
  372. color: #444444;
  373. line-height: 44rpx;
  374. padding: 24rpx 0 0;
  375. }
  376. .imgs{
  377. width: 100%;
  378. .img {
  379. width: 200rpx;
  380. height: 200rpx;
  381. border-radius: 6px;
  382. margin: 20rpx 14rpx 0 0;
  383. }
  384. .img:nth-child(3n+3) {
  385. margin: 20rpx 0 0;
  386. }
  387. }
  388. .cell {
  389. padding: 24rpx 0 0;
  390. .left_text {
  391. font-size: 26rpx;
  392. font-weight: 400;
  393. color: #777777;
  394. line-height: 36rpx;
  395. }
  396. .right_text {
  397. font-size: 26rpx;
  398. font-weight: 500;
  399. color: #222222;
  400. line-height: 32rpx;
  401. }
  402. }
  403. .type {
  404. padding: 24rpx 0;
  405. border-top: 1rpx solid #F4F4F4;
  406. .text_blue {
  407. font-size: 28rpx;
  408. font-weight: 500;
  409. color: #506DFF;
  410. line-height: 40rpx;
  411. }
  412. }
  413. .offer {
  414. width: 100%;
  415. height: 76rpx;
  416. background: #EAF4FF;
  417. border-radius: 12rpx;
  418. box-sizing: border-box;
  419. padding: 16rpx 20rpx;
  420. .offer_label {
  421. font-size: 24rpx;
  422. font-weight: 400;
  423. color: #506DFF;
  424. line-height: 34rpx;
  425. }
  426. .offer_text {
  427. font-size: 32rpx;
  428. font-weight: 400;
  429. color: #222222;
  430. line-height: 40rpx;
  431. }
  432. .btn {
  433. width: 132rpx;
  434. height: 48rpx;
  435. border-radius: 24rpx;
  436. border: 2rpx solid #506DFF;
  437. font-size: 24rpx;
  438. font-weight: 400;
  439. color: #506DFF;
  440. line-height: 48rpx;
  441. }
  442. }
  443. .headimg {
  444. width: 72rpx;
  445. height: 72rpx;
  446. border-radius: 50%;
  447. }
  448. .img_right {
  449. margin-left: 12rpx;
  450. .name {
  451. max-width: 500rpx;
  452. font-size: 30rpx;
  453. font-weight: 400;
  454. color: #222222;
  455. line-height: 42rpx;
  456. }
  457. .blue_bg {
  458. margin-left: 8rpx;
  459. width: 72rpx;
  460. height: 28rpx;
  461. background: #506DFF;
  462. border-radius: 4rpx;
  463. font-size: 20rpx;
  464. font-weight: 400;
  465. color: #FFFFFF;
  466. line-height: 28rpx;
  467. text-align: center;
  468. }
  469. }
  470. .text_style1 {
  471. font-size: 24rpx;
  472. font-weight: 400;
  473. color: #666666;
  474. line-height: 34rpx;
  475. padding-right: 12rpx;
  476. }
  477. .phone {
  478. width: 32rpx;
  479. height: 32rpx;
  480. background: #E1E6FF;
  481. border-radius: 8rpx;
  482. }
  483. .active {
  484. background: #F0F3FF !important;
  485. border-radius: 8px;
  486. border: 1px solid #506DFF;
  487. }
  488. .item_bg {
  489. background: #F4F4F4;
  490. border-radius: 8px;
  491. margin-top: 20rpx;
  492. box-sizing: border-box;
  493. padding: 20rpx;
  494. .text_red {
  495. font-size: 24rpx;
  496. font-weight: 400;
  497. color: #FF4646;
  498. line-height: 34rpx;
  499. }
  500. .btn {
  501. width: 132rpx;
  502. height: 48rpx;
  503. border-radius: 24rpx;
  504. border: 2rpx solid #506DFF;
  505. font-size: 24rpx;
  506. font-weight: 400;
  507. color: #506DFF;
  508. line-height: 48rpx;
  509. }
  510. }
  511. }
  512. .bottom {
  513. width: 100%;
  514. height: 166rpx;
  515. background: #FFFFFF;
  516. position: fixed;
  517. bottom: 0;
  518. z-index: 99;
  519. box-sizing: border-box;
  520. padding: 10rpx 30rpx 0;
  521. .btn {
  522. width: 100%;
  523. height: 88rpx;
  524. background: #506DFF;
  525. border-radius: 44rpx;
  526. font-size: 36rpx;
  527. font-weight: 500;
  528. color: #FFFFFF;
  529. line-height: 50rpx;
  530. }
  531. .btn1 {
  532. background: rgba(80,109,255,0.3) !important;
  533. }
  534. .left_btn {
  535. width: 300rpx;
  536. height: 88rpx;
  537. background: #ECEFFE;
  538. border-radius: 44rpx;
  539. font-size: 36rpx;
  540. font-weight: 500;
  541. color: #506DFF;
  542. margin-right: 20rpx;
  543. }
  544. .right_btn {
  545. width: 370rpx;
  546. height: 88rpx;
  547. background: #506DFF;
  548. border-radius: 44rpx;
  549. font-size: 36rpx;
  550. font-weight: 500;
  551. color: #fff;
  552. }
  553. }
  554. .modeal_content {
  555. font-size: 36rpx;
  556. font-weight: 500;
  557. color: #222222;
  558. line-height: 50rpx;
  559. }
  560. .left {
  561. width: 230rpx;
  562. height: 84rpx;
  563. background: #ECEFFF;
  564. border-radius: 42rpx;
  565. font-size: 32rpx;
  566. font-weight: 400;
  567. color: #506DFF;
  568. margin-right: 50rpx;
  569. }
  570. .right {
  571. width: 230rpx;
  572. height: 84rpx;
  573. background: #506DFF;
  574. border-radius: 42rpx;
  575. font-size: 32rpx;
  576. font-weight: 400;
  577. color: #FFFFFF;
  578. }
  579. .popu {
  580. width: 630rpx;
  581. background: #FFFFFF;
  582. border-radius: 24rpx;
  583. margin: 0 auto;
  584. box-sizing: border-box;
  585. padding: 0 40rpx;
  586. .popu_top {
  587. padding: 32rpx 0 40rpx;
  588. .popu_title {
  589. font-size: 36rpx;
  590. font-weight: 500;
  591. color: #333333;
  592. line-height: 50rpx;
  593. }
  594. }
  595. .file_bg {
  596. width: 550rpx;
  597. height: 100rpx;
  598. background: #F4F4F4;
  599. border-radius: 16rpx;
  600. margin: 0 0 42rpx;
  601. }
  602. .file_icon {
  603. width: 48rpx;
  604. height: 60rpx;
  605. }
  606. .file_name {
  607. max-width: 530rpx;
  608. padding-left: 14rpx;
  609. font-size: 28rpx;
  610. font-weight: 400;
  611. color: #333333;
  612. line-height: 40rpx;
  613. }
  614. .btn_group {
  615. width: 100%;
  616. padding: 30rpx 0;
  617. .left_btn {
  618. width: 260rpx;
  619. height: 76rpx;
  620. background: #ECEFFE;
  621. border-radius: 40rpx;
  622. font-size: 30rpx;
  623. font-weight: 500;
  624. color: #506DFF;
  625. line-height: 42rpx;
  626. }
  627. .right_btn {
  628. width: 260rpx;
  629. height: 76rpx;
  630. background: #506DFF;
  631. border-radius: 40rpx;
  632. font-size: 30rpx;
  633. font-weight: 500;
  634. color: #FFFFFF;
  635. line-height: 42rpx;
  636. }
  637. }
  638. .text_blue {
  639. font-size: 30rpx;
  640. font-weight: 400;
  641. color: #506DFF;
  642. line-height: 42rpx;
  643. padding: 28rpx 0 46rpx;
  644. }
  645. }
  646. }
  647. </style>