order_detail.vue 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546
  1. <template>
  2. <view class="details">
  3. <view class="content">
  4. <view class="order_status">
  5. <view class="status_center">
  6. <view class="status">
  7. 订单{{details.statusName}}
  8. <text class="money">
  9. ¥<text>{{details.dTotalMoney}}</text>
  10. </text>
  11. </view>
  12. <view class="time" v-if="nStatus == -3">
  13. 拒绝原因: {{details.reasonRefusal}}
  14. </view>
  15. <view class="time" v-else>
  16. 上门时间:{{details.reachTime}}
  17. </view>
  18. <view class="merchant">
  19. 服务商家:{{details.js.cNickName}}<br />
  20. <text>商家电话:{{details.jsPhone}}</text>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="orderinfo">
  25. <view class="order_box">
  26. <view class="title"><text></text> 服务项目</view>
  27. <view class="project" v-for="(item,index) in details.cGoods" :key="index">
  28. <view class="project_left">
  29. <img :src="$globalData.publicUrl + item.cCover" alt="" />
  30. </view>
  31. <view class="project_right">
  32. <text class="name">项目名称:{{item.cTitle}}</text>
  33. <text class="price"> 项目单价:{{item.dPrice}}</text>
  34. <view class="total">
  35. 数量:{{item.number}}
  36. <span class="total_price">¥{{details.totalPrice}}</span>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <!-- <view v-for="(item,index) in details.cGoods" :key="index" class="items">
  42. <view class="img">
  43. <image :src="$globalData.publicUrl + item.cCover" mode=""></image>
  44. </view>
  45. <view class="right">
  46. <view class="">
  47. 项目名称:{{item.cTitle}}
  48. </view>
  49. <view class="">
  50. 项目单价:{{item.dPrice}}
  51. </view>
  52. <view class="">
  53. 数量:{{item.number}}
  54. </view>
  55. </view>
  56. </view>
  57. <view class="conts">合计:{{details.totalPrice}}</view> -->
  58. </view>
  59. <!-- <view class="box1">
  60. <view class="imgs">
  61. <image src="../../static/order/deimg.jpg" mode="widthFix" />
  62. </view>
  63. <view class="box1cont">
  64. <view class="title">订单{{details.statusName}}</view>
  65. <view class="moneytime" v-if="!details.reasonRefusal == ''">
  66. 拒绝原因: {{details.reasonRefusal}}
  67. </view>
  68. <view class="moneytime">
  69. <view class="time">下单日期: {{dtCreateTime}}</view>
  70. <view class="money">¥{{details.dTotalMoney}}</view>
  71. </view>
  72. </view>
  73. </view> -->
  74. <view class="orderinfo">
  75. <view class="order_box order_detail">
  76. <view class="title"><text></text> 订单信息</view>
  77. <view class="cont"><text class="left_title">客户姓名:</text>
  78. <text>{{details.cName}}</text>
  79. </view>
  80. <view class="cont">
  81. <text class="left_title">客户电话:</text>
  82. <text class="right_content" @click="dial(details.cPhone)">{{details.cPhone}}
  83. </text>
  84. </view>
  85. <view class="cont"><text class="left_title">服务商家:</text> <text
  86. class="right_content">{{details.js.cNickName}}</text></view>
  87. <view class="cont" v-if="!dtCreateTime1 == ''"><text class="left_title">下单时间:</text>
  88. <text>{{dtCreateTime1}}</text>
  89. </view>
  90. <view class="cont" v-if="!acceptanceTime == ''"><text class="left_title">接单时间:</text>
  91. <text>{{acceptanceTime}}</text>
  92. </view>
  93. <view class="cont" v-if="!reachTime == ''"><text class="left_title">到达时间:</text> <text>{{reachTime}}</text>
  94. </view>
  95. <view class="cont" v-if="!startTime == ''"><text class="left_title">开始服务时间:</text> <text>{{startTime}}</text>
  96. </view>
  97. <view class="cont" v-if="!endTime == ''"><text class="left_title">完成订单时间:</text> <text>{{endTime}}</text>
  98. </view>
  99. <view class="cont"><text class="left_title">车费详情:</text> <text>{{details.fare || 0}}元</text></view>
  100. <view class="cont"><text class="left_title">服务地址:</text> <text> {{details.address}}</text></view>
  101. </view>
  102. </view>
  103. <view class="sub_box">
  104. <view class="cancel">
  105. 取消订单
  106. </view>
  107. <!-- <view class="edit_time">
  108. 修改上门时间
  109. </view> -->
  110. </view>
  111. <view class="orderinfo" v-if="name == '商户订单'">
  112. <view class="title">客户标签</view>
  113. <view class="comment_box">
  114. <view class="comment" v-for="(item,index) in userCommentList" :key="index">
  115. {{item.text}}
  116. </view>
  117. </view>
  118. </view>
  119. <!-- <view style="height: 300rpx;"></view> -->
  120. </view>
  121. <view v-if="name == '商户订单'">
  122. <view class="btnbox" v-if="details.nStatus === 0">
  123. <!-- <view @click="scheduling((details.cId))">了解客户</view> -->
  124. <view @click="scheduling((details.cId))">接单</view>
  125. <view @click="refuse((details.cId))">拒绝接单</view>
  126. </view>
  127. <view class="btnbox" v-if="details.nStatus === 1">
  128. <view @click="depart(details.cId,details.orderNo)">出发</view>
  129. </view>
  130. <view class="btnbox" v-if="details.nStatus === 6">
  131. <view @click="arriveOderLocation(details.cId,details.orderNo)">到达</view>
  132. </view>
  133. <view class="btnbox" v-if="details.nStatus === 2">
  134. <view @click="enterService(details.cId,details.orderNo)">开始服务</view>
  135. </view>
  136. <view class="btnbox" v-if="details.nStatus === 3">
  137. <view @click="complete(details.cId,details.orderNo)">完成订单</view>
  138. </view>
  139. <view class="btnbox" v-if="details.nStatus === 4">
  140. <view @click="appraise(details,details.cId,details.orderNo)">评价顾客</view>
  141. </view>
  142. </view>
  143. <view v-else>
  144. <view class="btnbox" v-if="details.nStatus === -1">
  145. <!-- <view @click="nowYuyue(details.cId,details.dTotalMoney)">支付订单</view> -->
  146. </view>
  147. <view class="btnbox" v-if="details.nStatus === -2">
  148. <view @click="deleteOrder(details.cId)">删除订单</view>
  149. </view>
  150. <view class="btnbox" v-if="details.nStatus === 4">
  151. <view @click="commentOrder(details.orderNo,details.cJsId,details.cId,details.js.cNickName)">评价订单</view>
  152. </view>
  153. <view class="btnbox" v-if="details.nStatus === 3">
  154. <view @click="bookNow(typelevel,details.cJsId)">升级</view>
  155. <view @click="bookNow(typeTime,details.cJsId)">加钟</view>
  156. </view>
  157. </view>
  158. <!-- 录音弹框 -->
  159. <view class="recording" v-if="recordShow">
  160. <view class="recording_content">
  161. <view class="btn">
  162. <view @click="cancle">取消</view>
  163. <view @click="saveRecord">保存</view>
  164. </view>
  165. <view class="content">
  166. <view class="time">{{recordTime}}</view>
  167. <view class="Playparse" @click="pauseRecord" v-if="isRecording">
  168. <image src="../../static/identify/rec1.png" mode="" />
  169. </view>
  170. <view class="Playparse" @click="startRecord" v-else>
  171. <image src="../../static/identify/rec2.png" mode="" />
  172. </view>
  173. </view>
  174. </view>
  175. </view>
  176. <!-- 加单弹框 -->
  177. <view class="dialog" v-if="dialogShow && projects.length>0">
  178. <view class="closebox" @click="closeDialog"></view>
  179. <view class="dialog_content">
  180. <view class="lists" v-for="(item,index) in projects" :key="index">
  181. <view class="imgs">
  182. <image :src="publicUrl + item.cCover" mode="" />
  183. </view>
  184. <view class="right">
  185. <view class="list_title">
  186. <view class="title">{{item.cTitle}}</view>
  187. <view class="time">{{item.nMinute}}分钟</view>
  188. </view>
  189. <view class="price">
  190. <view class="money">¥{{item.dPrice}}</view>
  191. <view class="counter">
  192. <view @click="decrease(index)">-</view>
  193. <text>{{ item.number }}</text>
  194. <view @click="increase(index)">+</view>
  195. </view>
  196. </view>
  197. </view>
  198. </view>
  199. </view>
  200. <view class="now" @click="nowYuyue(details.orderNo,details.cJsId)" ><text>立即预约</text></view>
  201. </view>
  202. <view class="refuse_popup" v-if="isRefuse">
  203. <view class="histroy">
  204. <view class="title">
  205. 请输入拒绝接单原因
  206. </view>
  207. <view class="center">
  208. <input type="text" maxlength="10" v-model="reasonRefusal" placeholder="请输入拒绝原因,最多10个" />
  209. </view>
  210. <view class="btn_box">
  211. <view class="btn" @click="cancel">
  212. 取消
  213. </view>
  214. <view class="btn success" @click="refuseSubmit">
  215. 提交
  216. </view>
  217. </view>
  218. </view>
  219. </view>
  220. <view class="arrive" v-if="isArrive">
  221. <view class="photo_box">
  222. <view class="title">
  223. 到达地点
  224. </view>
  225. <view class="photo">
  226. <view class="small_title">
  227. 请拍摄到达地点主要建筑物
  228. </view>
  229. <view class="upload_box">
  230. <u-upload class="upload_popup" :action="uploadUrl" capture="camera" :file-list="arrivalPhoto"
  231. @on-success="photograph" @on-remove="remove" :header="header" :max-count="1" accept="image/*"
  232. :show-upload-list="false" />
  233. </view>
  234. </view>
  235. <view class="btn_box">
  236. <view class="cancel" @click="isArrive = false">
  237. 取 消
  238. </view>
  239. <view class="btn" @click="arrive">
  240. 提 交
  241. </view>
  242. </view>
  243. </view>
  244. <!-- <view class="photo_box">
  245. <view class="photo">
  246. <u-upload class="upload_popup" :action="uploadUrl" :file-list="arrivalPhoto" @on-success="photograph"
  247. @on-remove="remove" :header="header" :max-count="1" />
  248. </view>
  249. <view class="btn_box">
  250. <view class="btn" @click="isArrive = false">
  251. 取 消
  252. </view>
  253. <view class="btn" @click="arrive">
  254. 提 交
  255. </view>
  256. </view>
  257. </view> -->
  258. </view>
  259. <view class="arrive" v-if="isSchedule">
  260. <view class="photo_box">
  261. <view class="title">
  262. 结束原因
  263. </view>
  264. <view class="photo">
  265. <view class="small_title">
  266. 提前结束,请填写原因
  267. </view>
  268. <!-- <input type="text" placeholder="请输入提前结束原因" v-model="timeoutCause" /> -->
  269. <view class="textarea">
  270. <textarea placeholder="请输入提前结束原因" type="textarea" v-model="timeoutCause"
  271. style="width: 100%;height: 100%;font-size: 26rpx;" id="" cols="30" rows="10"></textarea>
  272. </view>
  273. </view>
  274. <view class="btn_box">
  275. <view class=" cancel" @click="isSchedule = false">
  276. 取 消
  277. </view>
  278. <view class="btn" @click="reasonSubmit">
  279. 提 交
  280. </view>
  281. </view>
  282. </view>
  283. </view>
  284. </view>
  285. </template>
  286. <script>
  287. import {
  288. orderDeatails,
  289. getInfo,
  290. payoff,
  291. delOrder,
  292. confirmOrder,
  293. alertOrder,
  294. engineerDetails,
  295. speedOrder,
  296. addOrder,
  297. takeOrder,
  298. arriveOderLocation,
  299. updateOrder,
  300. project,
  301. enterService,
  302. refuse,
  303. depart,
  304. userComment,
  305. reach,
  306. confirm
  307. } from '../../api/index.js'
  308. export default {
  309. data() {
  310. return {
  311. cAddress: '',
  312. id: '',
  313. details: '',
  314. dtCreateTime: '',
  315. dtCreateTime1: '',
  316. acceptanceTime: '',
  317. reachTime: '',
  318. startTime: '',
  319. endTime: '',
  320. dTotalMoney: 0,
  321. money: 0,
  322. name: '',
  323. orderShow: true,
  324. // 录音
  325. hours: 0, // 小时
  326. minute: 0, // 分钟
  327. second: 0, // 秒钟
  328. recorderManager: null,
  329. recordTime: '00:00:00',
  330. isRecording: false,
  331. isPaused: false,
  332. audioFilePath: '',
  333. timer: null,
  334. recordShow: false,
  335. // 加单
  336. dialogShow: false,
  337. projects: [],
  338. soundFile: '',
  339. ifOnceClick: true,
  340. ordertype: null,
  341. typelevel: 2, //升级
  342. typeTime: 1, //加钟
  343. // publicUrl: 'https://test.baoxianzhanggui.com/nightFragrance/', //图片前缀
  344. publicUrl: 'https://city.baoxianzhanggui.com/nightFragrance/', //图片前缀
  345. isRefuse: false,
  346. reasonRefusal: '', //拒单原因
  347. refusecId: '',
  348. userCommentList: [],
  349. form: {},
  350. isArrive: false,
  351. // uploadUrl: 'https://test.baoxianzhanggui.com/nightFragrance/common/upload',
  352. uploadUrl:'https://city.baoxianzhanggui.com/nightFragrance/common/upload',
  353. isSchedule: false,
  354. timeoutCause: ''
  355. }
  356. },
  357. onLoad(options) {
  358. this.id = options.cid
  359. this.name = options.name
  360. this.getDetails()
  361. this.token = uni.getStorageSync('access-token'); // 假设token保存在本地缓存中
  362. },
  363. computed: {
  364. header() {
  365. return {
  366. Authorization: `tf: ${this.token}`, // 携带Token的请求头
  367. };
  368. },
  369. },
  370. methods: {
  371. userComment(cOpenId) {
  372. let data = {}
  373. data.openId = cOpenId
  374. userComment(data).then(res => {
  375. this.userCommentList = res.data.data.records
  376. })
  377. },
  378. dial(cPhone) {
  379. uni.makePhoneCall({
  380. phoneNumber: cPhone //仅为示例
  381. })
  382. },
  383. deleteOrder(cId) {
  384. var that = this
  385. var id = {
  386. cId: e
  387. }
  388. uni.showModal({
  389. title: '提示',
  390. content: '确定删除订单吗?',
  391. showCancel: true, // 是否显示取消按钮
  392. success(res) {
  393. if (res.confirm) {
  394. delOrder(id).then(res => {
  395. if (res.data.code == 200) {
  396. // that.getList()
  397. that.$router.go(0)
  398. uni.showToast({
  399. title: '删除订单成功!',
  400. icon: 'none'
  401. })
  402. // setTimeout(() => {
  403. // this.list = []
  404. // this.getList()
  405. // }, 100)
  406. } else {
  407. uni.showToast({
  408. title: res.data.msg,
  409. icon: 'none'
  410. })
  411. }
  412. })
  413. }
  414. }
  415. })
  416. },
  417. arriveOderLocation(cId, orderNo) {
  418. console.log('+++++')
  419. this.isArrive = true
  420. this.form.cId = cId
  421. this.form.orderNo = orderNo
  422. let that = this
  423. uni.getLocation({
  424. type: 'wgs84',
  425. isHighAccuracy: true,
  426. accuracy: 'best',
  427. success: (res) => {
  428. that.form.arrivalLatitude = res.latitude
  429. that.form.arrivalLongitude = res.longitude
  430. },
  431. fail: (res) => {}
  432. });
  433. },
  434. //上传到达图片
  435. photograph(response) {
  436. this.form.arrivalPhoto = response.fileName
  437. },
  438. remove(index) {
  439. this.arrivalPhoto.splice(index, 1);
  440. },
  441. //提交到达拍照
  442. arrive() {
  443. if (!this.form.arrivalPhoto) {
  444. uni.showToast({
  445. title: '请上传到达照片',
  446. icon: 'none'
  447. })
  448. return
  449. } else {
  450. reach(this.form).then(res => {
  451. this.isArrive = false
  452. if (res.data.code == 200) {
  453. uni.showToast({
  454. title: '已到达',
  455. icon: 'none'
  456. })
  457. // this.getList()
  458. this.$router.go(0)
  459. } else {
  460. uni.showToast({
  461. title: res.data.msg,
  462. icon: 'none'
  463. })
  464. }
  465. })
  466. }
  467. },
  468. scheduling(cId) {
  469. var data = {
  470. cId: cId
  471. }
  472. takeOrder(data).then(res => {
  473. if (res.data.code == 200) {
  474. uni.showToast({
  475. title: '已接单',
  476. })
  477. this.$router.go()
  478. } else {
  479. uni.showToast({
  480. title: res.data.msg,
  481. icon: 'none'
  482. })
  483. }
  484. })
  485. },
  486. //拒单
  487. refuse(cId) {
  488. this.isRefuse = true
  489. this.refusecId = cId
  490. },
  491. refuseSubmit() {
  492. var data = {
  493. cId: this.refusecId,
  494. reasonRefusal: this.reasonRefusal.trim()
  495. }
  496. if (data.reasonRefusal == '') {
  497. uni.showToast({
  498. title: '拒绝原因不能为空',
  499. })
  500. return
  501. }
  502. refuse(data).then(res => {
  503. if (res.data.code == 200) {
  504. this.list = []
  505. uni.showToast({
  506. title: '已拒绝',
  507. })
  508. // this.getList()
  509. this.isRefuse = false,
  510. this.reasonRefusal = ''
  511. } else {
  512. uni.showToast({
  513. title: res.data.msg,
  514. icon: 'none'
  515. })
  516. }
  517. })
  518. },
  519. cancel() {
  520. this.isRefuse = false
  521. this.reasonRefusal = ''
  522. },
  523. //出发
  524. depart(cId, orderNo) {
  525. let that = this
  526. uni.getLocation({
  527. type: 'wgs84',
  528. isHighAccuracy: true,
  529. accuracy: 'best',
  530. success: (res) => {
  531. let data = {
  532. cId: cId,
  533. departLatitude: res.latitude,
  534. departLongitude: res.longitude
  535. }
  536. depart(data).then(res => {
  537. if (res.data.code == 200) {
  538. uni.showToast({
  539. title: '已出发',
  540. })
  541. that.getList()
  542. } else {
  543. uni.showToast({
  544. title: res.data.msg,
  545. })
  546. that.getList()
  547. }
  548. })
  549. },
  550. fail: (res) => {}
  551. });
  552. },
  553. // complete(cId, orderNo) {
  554. // var id = {
  555. // cId: cId,
  556. // orderNo: orderNo
  557. // }
  558. // let that = this
  559. // uni.showModal({
  560. // title: '提示',
  561. // content: '确认服务完成?',
  562. // success: function(res) {
  563. // if (res.confirm) {
  564. // confirmOrder(id).then(res => {
  565. // if (res.data.code == 200) {
  566. // this.$router.go(0)
  567. // // that.list =[]
  568. // uni.showToast({
  569. // title: '已完成',
  570. // })
  571. // uni.navigateTo({
  572. // url: '/pages/my/js_order'
  573. // })
  574. // that.getList()
  575. // } else {
  576. // uni.showToast({
  577. // title: res.data.msg,
  578. // })
  579. // }
  580. // })
  581. // // this.list = []
  582. // // this.getList();
  583. // }
  584. // }
  585. // });
  586. // },
  587. //完成订单
  588. complete(cId, orderNo) {
  589. console.log(this.details)
  590. this.cId = cId
  591. this.orderNo = orderNo
  592. const now = new Date(+new Date() + 8 * 3600 * 1000);
  593. const isoDateTime = now.toISOString(); // ISO 8601 格式
  594. let nowtime = new Date(isoDateTime.slice(0, 19))
  595. let starttime = new Date(this.details.startTime) //开始时间
  596. let differenceInMs = nowtime - starttime //剩余时间
  597. let differenceInMinutes = differenceInMs / (1000 * 60);
  598. if (differenceInMinutes > this.details.cGoods[0].nMinute) {
  599. var id = {
  600. cId: cId,
  601. orderNo: orderNo
  602. }
  603. let that = this
  604. uni.showModal({
  605. title: '提示',
  606. content: '确认服务完成?',
  607. success: function(res) {
  608. if (res.confirm) {
  609. confirmOrder(id).then(res => {
  610. if (res.data.code == 200) {
  611. // this.list =[]
  612. uni.showToast({
  613. title: '已完成',
  614. })
  615. // location.reload(true);
  616. that.$router.go(0)
  617. // this.getList()
  618. } else {
  619. uni.showToast({
  620. title: res.data.msg,
  621. })
  622. // location.reload(true);
  623. // that.$router.go(0)
  624. }
  625. })
  626. }
  627. }
  628. });
  629. } else {
  630. this.isSchedule = true
  631. }
  632. },
  633. //填写提前结束原因
  634. reasonSubmit() {
  635. let data = {}
  636. data.cId = this.cId
  637. data.orderNo = this.orderNo
  638. data.timeoutCause = this.timeoutCause
  639. if (data.timeoutCause == '') {
  640. uni.showToast({
  641. icon: 'none',
  642. title: '请填写提前完成原因',
  643. })
  644. return
  645. } else {
  646. confirm(data).then(res => {
  647. if (res.data.code == 200) {
  648. uni.showToast({
  649. title: '已完成',
  650. })
  651. location.reload(true);
  652. } else {
  653. uni.showToast({
  654. title: res.data.msg,
  655. })
  656. }
  657. })
  658. }
  659. },
  660. enterService(cId, orderNo) {
  661. var data = {
  662. cId: cId
  663. }
  664. enterService(data).then(res => {
  665. if (res.data.code == 200) {
  666. // this.list = []
  667. // this.getList()
  668. this.getDetails()
  669. uni.showToast({
  670. title: '服务已开始',
  671. })
  672. this.$router.go(0)
  673. } else {
  674. uni.showToast({
  675. title: res.data.msg,
  676. icon: 'none'
  677. })
  678. }
  679. })
  680. },
  681. //报警
  682. alert(orderNo) {
  683. var data = {
  684. orderNo: orderNo
  685. }
  686. alertOrder(data).then(res => {
  687. if (res.data.code == 200) {
  688. uni.showToast({
  689. title: '已报警!',
  690. })
  691. this.getDetails()
  692. } else {
  693. uni.showToast({
  694. title: res.data.msg,
  695. icon: 'none'
  696. })
  697. }
  698. })
  699. },
  700. commentOrder(orderNo, cJsId, cId, cName) {
  701. uni.navigateTo({
  702. url: './comment?orderNo=' + orderNo + '&cJsId=' + cJsId + '&cId=' + cId + '&cName=' + cName
  703. })
  704. },
  705. //获取订单详情
  706. getDetails() {
  707. var id = {
  708. cId: this.id
  709. }
  710. orderDeatails(id).then(res => {
  711. var charToRemove = "T";
  712. if (res.data.code == 200) {
  713. this.details = res.data.data.records[0],
  714. this.userComment(this.details.cOpenId)
  715. this.dtCreateTime = res.data.data.records[0].dtCreateTime.slice(0, 10),
  716. this.dtCreateTime1 = res.data.data.records[0].dtCreateTime.replace(charToRemove, ' '),
  717. // let acceptancetime = res.data.data.records[0].dtCreateTime.slice(0, 10)
  718. this.acceptanceTime = res.data.data.records[0].acceptanceTime.replace(charToRemove, ' '),
  719. this.reachTime = res.data.data.records[0].reachTime.replace(charToRemove, ' '),
  720. this.startTime = res.data.data.records[0].startTime.replace(charToRemove, ' '),
  721. this.endTime = res.data.data.records[0].endTime.replace(charToRemove, ' '),
  722. this.cAddress = JSON.parse(res.data.data.records[0].cAddress).address + '(' + JSON.parse(res.data.data
  723. .records[0].cAddress).address + ')' + res.data.data.records[0].atlasAdd
  724. var status = res.data.data.records[0].nStatus
  725. if (status == 2 || status == 3) {
  726. // this.setData({
  727. this.orderShow = true
  728. // })
  729. } else {
  730. // this.setData({
  731. this.orderShow = false
  732. // })
  733. }
  734. }
  735. })
  736. },
  737. bookNow(type, id) {
  738. this.ordertype = type
  739. this.projects = []
  740. var id = {
  741. id: id
  742. }
  743. engineerDetails(id).then(res => {
  744. res.data.data.projects.forEach(element => {
  745. if ((this.details.dTotalMoney < element.dPrice) && type == 2) {
  746. element.number = 0
  747. this.projects.push(element)
  748. }else if(type == 1){
  749. element.number = 0
  750. this.projects.push(element)
  751. }
  752. });
  753. if(this.projects.length == 0){
  754. uni.showToast({
  755. icon:'none',
  756. title:'暂无可升级订单'
  757. })
  758. }
  759. // details:res.data.data,
  760. // this.projects = res.data.data.projects,
  761. console.log(this.projects)
  762. this.dialogShow = true,
  763. this.orderId = res.data.data.cId
  764. })
  765. },
  766. //升级订单+1
  767. increase(idx) {
  768. this.projects[idx].number++;
  769. },
  770. decrease(idx) {
  771. this.projects[idx].number--;
  772. },
  773. nowYuyue(orderNo, cJsId) {
  774. var that = this
  775. // if()
  776. const allCountsZero = this.projects.every(item => item.number === 0);
  777. if (allCountsZero) {
  778. wx.showToast({
  779. title: '请先选择项目!',
  780. duration: 1000,
  781. icon: 'none',
  782. })
  783. return
  784. } else {
  785. // console.log(this.data.projects,"project")
  786. var list = []
  787. this.projects.forEach(element => {
  788. if (element.number > 0) {
  789. element.sum = element.number * element.dPrice
  790. list.push(element)
  791. }
  792. });
  793. var total = 0
  794. for (let i = 0; i < list.length; i++) {
  795. total += list[i].sum;
  796. }
  797. var data = {
  798. orderType: this.ordertype,
  799. cJsId: cJsId,
  800. cGoods: list,
  801. cOpenId: uni.getStorageSync('wx_copenid'),
  802. dTotalMoney: total,
  803. parentNo: orderNo
  804. }
  805. speedOrder(data).then(res => {
  806. if (res.data.code == 200) {
  807. uni.navigateTo({
  808. url: '../identify/pay_order?orderNo=' + res.data.data.orderNo,
  809. })
  810. } else {}
  811. })
  812. }
  813. },
  814. closeDialog() {
  815. this.dialogShow = false
  816. },
  817. appraise(details, cId, orderNo) {
  818. uni.navigateTo({
  819. url: './comment?orderNo=' + orderNo + '&cJsId=' + details.cJsId + '&name=' + details.js.cName + '&cId=' +
  820. details.cId + '&title=' + '商户' + '&cOpenId=' + details.cOpenId
  821. })
  822. }
  823. }
  824. }
  825. </script>
  826. <style lang="scss" scoped>
  827. .details {
  828. position: relative;
  829. height: 100vh;
  830. overflow: hidden;
  831. background: #F7FFFF;
  832. .content {
  833. height: 100vh;
  834. overflow-y: scroll;
  835. .order_status {
  836. width: 100%;
  837. height: 364rpx;
  838. background: linear-gradient(90deg, #91F5F0 0%, #13E4DA 100%);
  839. padding: 28rpx 32rpx 24rpx;
  840. box-sizing: border-box;
  841. .status_center {
  842. width: 100%;
  843. background: #E5FDFB;
  844. box-shadow: 0px 4rpx 12rpx 0px rgba(88, 209, 187, 0.1);
  845. border-radius: 16rpx;
  846. border: 2rpx solid #BCE7E5;
  847. padding: 24rpx;
  848. box-sizing: border-box;
  849. .status {
  850. font-weight: 700;
  851. font-size: 38rpx;
  852. color: #2F3437;
  853. line-height: 45rpx;
  854. display: flex;
  855. align-items: center;
  856. justify-content: space-between;
  857. .money {
  858. font-weight: 400;
  859. font-size: 28rpx;
  860. color: #F53E54;
  861. // line-height: 24rpx;
  862. display: flex;
  863. align-items: center;
  864. text {
  865. font-weight: 700;
  866. font-size: 44rpx;
  867. color: #F53E54;
  868. // line-height: 24rpx;
  869. }
  870. }
  871. }
  872. .time {
  873. width: 100%;
  874. margin-top: 12rpx;
  875. font-size: 30rpx;
  876. color: #069E96;
  877. line-height: 35rpx;
  878. margin-bottom: 20rpx;
  879. }
  880. .merchant {
  881. width: 100%;
  882. height: 136rpx;
  883. background: #FFFFFF;
  884. box-shadow: 0px 4rpx 12rpx 0px rgba(88, 209, 187, 0.1);
  885. border-radius: 16rpx;
  886. padding: 20rpx;
  887. box-sizing: border-box;
  888. font-size: 28rpx;
  889. color: #333333;
  890. text {
  891. display: inline-block;
  892. margin-top: 16rpx;
  893. }
  894. }
  895. }
  896. }
  897. .box1 {
  898. display: flex;
  899. align-items: center;
  900. justify-content: space-between;
  901. padding: 30rpx;
  902. border-bottom: 20rpx solid #fcfcfc;
  903. .imgs {
  904. border-radius: 10rpx;
  905. height: 180rpx;
  906. overflow: hidden;
  907. image {
  908. width: 280rpx;
  909. height: 180rpx;
  910. }
  911. }
  912. .box1cont {
  913. flex: 1;
  914. padding-left: 30rpx;
  915. .title {
  916. font-size: 36rpx;
  917. font-weight: bold;
  918. display: flex;
  919. align-items: center;
  920. }
  921. .moneytime {
  922. display: flex;
  923. justify-content: space-between;
  924. padding-top: 40rpx;
  925. color: #808080;
  926. .money {
  927. font-size: 32rpx;
  928. color: #ff0000;
  929. font-weight: bold;
  930. }
  931. .time {
  932. // color: #333;
  933. font-size: 26rpx;
  934. }
  935. }
  936. }
  937. }
  938. .orderinfo {
  939. width: 100%;
  940. margin-top: 28rpx;
  941. padding: 0px 32rpx;
  942. box-sizing: border-box;
  943. .order_box {
  944. width: 100%;
  945. background: linear-gradient(35deg, #FFFFFF 0%, #E4FFFD 100%);
  946. box-shadow: 0px 4rpx 12rpx 0px rgba(88, 209, 187, 0.1);
  947. border-radius: 16rpx;
  948. padding: 24rpx;
  949. box-sizing: border-box;
  950. .title {
  951. font-size: 32rpx;
  952. font-weight: bold;
  953. color: #2F3437;
  954. display: flex;
  955. align-items: center;
  956. text {
  957. display: inline-block;
  958. width: 6rpx;
  959. height: 34rpx;
  960. background-color: #20CBC2;
  961. margin-right: 12rpx;
  962. }
  963. }
  964. .project {
  965. height: 160rpx;
  966. margin-top: 24rpx;
  967. display: flex;
  968. align-items: center;
  969. .project_left {
  970. margin-right: 40rpx;
  971. img {
  972. width: 160rpx;
  973. height: 160rpx;
  974. }
  975. }
  976. .project_right {
  977. flex: 1;
  978. height: 100%;
  979. display: flex;
  980. flex-direction: column;
  981. justify-content: space-between;
  982. text {
  983. display: block;
  984. }
  985. .name {
  986. font-weight: 700;
  987. font-size: 28rpx;
  988. color: #333333;
  989. line-height: 33rpx;
  990. }
  991. .price {
  992. font-size: 28rpx;
  993. color: #666666;
  994. line-height: 33rpx;
  995. margin: 16rpx 0px;
  996. }
  997. .total {
  998. width: 100%;
  999. font-size: 28rpx;
  1000. color: #666666;
  1001. line-height: 33rpx;
  1002. display: flex;
  1003. justify-content: space-between;
  1004. .total_price {
  1005. display: inline-block;
  1006. font-weight: 700;
  1007. font-size: 32rpx;
  1008. color: #333333;
  1009. line-height: 38rpx;
  1010. }
  1011. }
  1012. }
  1013. }
  1014. }
  1015. .order_detail {
  1016. background: #fff;
  1017. }
  1018. .orderA {
  1019. display: flex;
  1020. justify-content: space-around;
  1021. align-items: center;
  1022. padding-top: 30rpx;
  1023. view {
  1024. font-size: 32rpx;
  1025. image {
  1026. width: 80rpx;
  1027. height: 80rpx;
  1028. margin-right: 30rpx;
  1029. }
  1030. }
  1031. }
  1032. .conts_price {
  1033. display: flex;
  1034. justify-content: space-between;
  1035. }
  1036. .cont {
  1037. font-size: 28rpx;
  1038. line-height: 40rpx;
  1039. display: flex;
  1040. justify-content: space-between;
  1041. margin-top: 20rpx;
  1042. .left_title {
  1043. width: 170rpx;
  1044. font-size: 28rpx;
  1045. }
  1046. text {
  1047. // width: 498rpx;
  1048. // color: #dddbdb;
  1049. padding-left: 20rpx;
  1050. // font-size: 32rpx;
  1051. }
  1052. }
  1053. .items {
  1054. border-bottom: 1px solid #f9f9f9;
  1055. padding: 20rpx 0;
  1056. display: flex;
  1057. justify-content: space-between;
  1058. .img {
  1059. width: 250rpx;
  1060. height: 200rpx;
  1061. border-radius: 20rpx;
  1062. overflow: hidden;
  1063. image {
  1064. width: 100%;
  1065. height: 100%;
  1066. }
  1067. }
  1068. .right {
  1069. height: 200rpx;
  1070. flex: 1;
  1071. padding-left: 50rpx;
  1072. display: flex;
  1073. flex-direction: column;
  1074. justify-content: space-between;
  1075. }
  1076. }
  1077. .conts {
  1078. font-size: 36rpx;
  1079. color: #ff0000;
  1080. font-weight: bold;
  1081. padding: 30rpx 0;
  1082. text-align: right;
  1083. }
  1084. .comment_box {
  1085. display: flex;
  1086. padding: 10rpx;
  1087. box-sizing: border-box;
  1088. .comment {
  1089. background-color: #ccc;
  1090. margin-right: 10px;
  1091. padding: 10rpx;
  1092. border-radius: 10rpx;
  1093. font-size: 30rpx;
  1094. }
  1095. }
  1096. }
  1097. }
  1098. .btnbox {
  1099. position: absolute;
  1100. bottom: 0;
  1101. left: 0;
  1102. width: 100%;
  1103. height: 120rpx;
  1104. background-color: #fff;
  1105. border-top: 1px solid #fdfdfd;
  1106. // padding-top: 20rpx;
  1107. display: flex;
  1108. justify-content: space-around;
  1109. align-items: center;
  1110. view {
  1111. display: flex;
  1112. justify-content: center;
  1113. align-items: center;
  1114. font-size: 30rpx;
  1115. background-color: #2ebdd9;
  1116. color: #fff;
  1117. // width: 47%;
  1118. height: 50%;
  1119. // margin:0 auto;
  1120. padding: 15rpx 30px;
  1121. border-radius: 50px;
  1122. }
  1123. }
  1124. .recording {
  1125. background-color: rgba(0, 0, 0, .5);
  1126. width: 100%;
  1127. height: 100%;
  1128. position: fixed;
  1129. top: 0;
  1130. left: 0;
  1131. .recording_content {
  1132. width: 100%;
  1133. height: 60%;
  1134. position: absolute;
  1135. bottom: 0;
  1136. background-color: #fff;
  1137. .btn {
  1138. display: flex;
  1139. justify-content: space-between;
  1140. padding: 20rpx 30rpx;
  1141. }
  1142. .time {
  1143. font-size: 70rpx;
  1144. font-weight: bold;
  1145. text-align: center;
  1146. padding: 200rpx 0;
  1147. }
  1148. .Playparse {
  1149. text-align: center;
  1150. image {
  1151. width: 80rpx;
  1152. height: 80rpx;
  1153. }
  1154. }
  1155. }
  1156. }
  1157. .dialog {
  1158. position: fixed;
  1159. top: 0;
  1160. left: 0;
  1161. width: 100%;
  1162. height: 100%;
  1163. background: rgba(0, 0, 0, .5);
  1164. z-index: 10;
  1165. transition: transform 0.3s ease-out;
  1166. .closebox {
  1167. height: calc(50vh - 60rpx);
  1168. width: 100%;
  1169. }
  1170. .now {
  1171. position: absolute;
  1172. bottom: 0;
  1173. left: 0;
  1174. width: 100%;
  1175. text-align: center;
  1176. height: 100rpx;
  1177. background-color: #f7f8fa;
  1178. padding-top: 10rpx;
  1179. text {
  1180. display: inline-block;
  1181. height: 80rpx;
  1182. line-height: 80rpx;
  1183. width: 90%;
  1184. background-color: #2cb8d4;
  1185. color: #fff;
  1186. border-radius: 50rpx;
  1187. }
  1188. }
  1189. .dialog_content {
  1190. background-color: #fff;
  1191. position: absolute;
  1192. bottom: 0;
  1193. width: calc(100% - 60rpx);
  1194. height: 50vh;
  1195. overflow-y: scroll;
  1196. border-top-left-radius: 20rpx;
  1197. border-top-right-radius: 20rpx;
  1198. padding: 30rpx;
  1199. background-color: #f3f3f3;
  1200. padding-bottom: 100rpx;
  1201. .lists {
  1202. background-color: #fff;
  1203. margin-bottom: 20rpx;
  1204. display: flex;
  1205. justify-content: space-between;
  1206. padding: 20rpx 10rpx;
  1207. border-radius: 10rpx;
  1208. .imgs {
  1209. width: 240rpx;
  1210. height: 160rpx;
  1211. border-radius: 20rpx;
  1212. overflow: hidden;
  1213. image {
  1214. width: 100%;
  1215. height: 100%;
  1216. }
  1217. }
  1218. .right {
  1219. flex: 1;
  1220. padding-left: 30rpx;
  1221. .list_title {
  1222. display: flex;
  1223. justify-content: space-between;
  1224. align-items: center;
  1225. .title {
  1226. font-size: 34rpx;
  1227. font-weight: bold;
  1228. }
  1229. .time {
  1230. font-size: 24rpx;
  1231. }
  1232. }
  1233. .price {
  1234. padding-top: 50rpx;
  1235. display: flex;
  1236. justify-content: space-between;
  1237. .money {
  1238. font-size: 42rpx;
  1239. color: #e61b1b;
  1240. font-weight: bold;
  1241. }
  1242. .counter {
  1243. display: flex;
  1244. view {
  1245. width: 60rpx;
  1246. height: 60rpx;
  1247. line-height: 60rpx;
  1248. background-color: #f7f8fa;
  1249. text-align: center;
  1250. border-radius: 60rpx;
  1251. font-size: 50rpx;
  1252. }
  1253. text {
  1254. width: 100rpx;
  1255. text-align: center;
  1256. line-height: 60rpx;
  1257. }
  1258. }
  1259. }
  1260. }
  1261. }
  1262. }
  1263. }
  1264. .refuse_popup {
  1265. width: 100%;
  1266. height: 100%;
  1267. position: fixed;
  1268. top: 0;
  1269. left: 0;
  1270. background-color: rgba(0, 0, 0, 0.5);
  1271. display: flex;
  1272. justify-content: center;
  1273. .histroy {
  1274. width: 70%;
  1275. height: 160px;
  1276. margin-top: 500rpx;
  1277. background-color: #fff;
  1278. border-radius: 10px;
  1279. padding: 20px;
  1280. box-sizing: border-box;
  1281. .title {
  1282. width: 100%;
  1283. // padding: 10px ;
  1284. text-align: center;
  1285. box-sizing: border-box;
  1286. margin-bottom: 50rpx;
  1287. }
  1288. .center {
  1289. margin-bottom: 20px;
  1290. input {
  1291. display: block;
  1292. border-bottom: 1px solid #ccc;
  1293. }
  1294. }
  1295. .btn_box {
  1296. width: 100%;
  1297. display: flex;
  1298. justify-content: space-around;
  1299. .btn {
  1300. width: 30%;
  1301. height: 30px;
  1302. background-color: #c8c9cc;
  1303. text-align: center;
  1304. line-height: 30px;
  1305. border-radius: 5px;
  1306. }
  1307. .success {
  1308. background: linear-gradient(to right, #35c99d, #27aea7);
  1309. color: #fff;
  1310. }
  1311. }
  1312. }
  1313. }
  1314. .arrive {
  1315. width: 100%;
  1316. height: 100%;
  1317. background-color: rgba(0, 0, 0, 0.5);
  1318. position: fixed;
  1319. top: 0;
  1320. display: flex;
  1321. justify-content: center;
  1322. align-items: center;
  1323. .photo_box {
  1324. width: 630rpx;
  1325. // height: 652rpx;
  1326. background-color: #fff;
  1327. // padding: 50rpx;
  1328. box-sizing: border-box;
  1329. display: flex;
  1330. flex-direction: column;
  1331. border-radius: 24rpx;
  1332. overflow: hidden;
  1333. .title {
  1334. width: 100%;
  1335. height: 92rpx;
  1336. background: #E6F8F7;
  1337. display: flex;
  1338. justify-content: center;
  1339. align-items: center;
  1340. }
  1341. .photo {
  1342. width: 100%;
  1343. flex: 1;
  1344. overflow: hidden;
  1345. padding: 40rpx 32rpx;
  1346. box-sizing: border-box;
  1347. .small_title {
  1348. width: 100%;
  1349. font-size: 28rpx;
  1350. text-align: center;
  1351. }
  1352. .textarea {
  1353. width: 566rpx;
  1354. height: 292rpx;
  1355. background: #F8F8F8;
  1356. border-radius: 16rpx;
  1357. padding: 20rpx 24rpx;
  1358. box-sizing: border-box;
  1359. margin-top: 32rpx;
  1360. font-size: 26rpx;
  1361. }
  1362. .upload_box {
  1363. width: 100%;
  1364. display: flex;
  1365. justify-content: center;
  1366. align-items: center;
  1367. margin-top: 32rpx;
  1368. // margin-bottom: 40rpx;
  1369. }
  1370. }
  1371. .btn_box {
  1372. width: 100%;
  1373. height: 116rpx;
  1374. background: #FFFFFF;
  1375. display: flex;
  1376. align-items: center;
  1377. justify-content: space-around;
  1378. border-top: 2rpx solid #EEEEEE;
  1379. .btn {
  1380. width: 225rpx;
  1381. height: 68rpx;
  1382. // height: 100%;
  1383. display: flex;
  1384. justify-content: center;
  1385. align-items: center;
  1386. background: linear-gradient(90deg, #1AD7CE 0%, #21C9C1 100%);
  1387. border-radius: 44rpx;
  1388. color: #fff;
  1389. }
  1390. .cancel {
  1391. width: 225rpx;
  1392. height: 68rpx;
  1393. border-radius: 106rpx;
  1394. border: 2rpx solid #BBBBBB;
  1395. display: flex;
  1396. justify-content: center;
  1397. align-items: center;
  1398. }
  1399. }
  1400. }
  1401. }
  1402. .sub_box {
  1403. width: 100%;
  1404. height: 116rpx;
  1405. padding: 20rpx 40rpx;
  1406. box-sizing: border-box;
  1407. display: flex;
  1408. align-items: center;
  1409. justify-content: center;
  1410. position: fixed;
  1411. bottom: 0;
  1412. .cancel {
  1413. width: 315rpx;
  1414. height: 76rpx;
  1415. border-radius: 106rpx;
  1416. border: 2rpx solid #BBBBBB;
  1417. font-size: 32rpx;
  1418. color: #999999;
  1419. display: flex;
  1420. align-items: center;
  1421. justify-content: center;
  1422. }
  1423. .edit_time {
  1424. width: 315rpx;
  1425. height: 76rpx;
  1426. border-radius: 106rpx;
  1427. border: 2rpx solid #00B8B0;
  1428. display: flex;
  1429. align-items: center;
  1430. justify-content: center;
  1431. color: #00B8B0;
  1432. }
  1433. }
  1434. }
  1435. </style>