yuyueorderDetail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. <template>
  2. <view class="container">
  3. <view class="tui-order-header">
  4. <image src="/static/images/mall/order/img_detail_bg.png" mode="widthFix" class="tui-img-bg"></image>
  5. <view class="tui-header-content">
  6. <view>
  7. <view class="tui-status-text">{{orderDetail.orderInfo.orderStatus.name}}</view>
  8. </view>
  9. <image v-if="orderDetail.orderInfo.order_status_id==1"
  10. src="/static/images/mall/order/img_order_payment3x.png" class="tui-status-img" mode="widthFix">
  11. </image>
  12. <image v-if="orderDetail.orderInfo.order_status_id==2"
  13. src="/static/images/mall/order/img_order_send3x.png" class="tui-status-img" mode="widthFix"></image>
  14. <image v-if="orderDetail.orderInfo.order_status_id==3"
  15. src="/static/images/mall/order/img_order_received3x.png" class="tui-status-img" mode="widthFix">
  16. </image>
  17. <image v-if="orderDetail.orderInfo.order_status_id==5"
  18. src="/static/images/mall/order/img_order_signed3x.png" class="tui-status-img" mode="widthFix">
  19. </image>
  20. <image v-if="orderDetail.orderInfo.order_status_id==4"
  21. src="/static/images/mall/order/img_order_closed3x.png" class="tui-status-img" mode="widthFix">
  22. </image>
  23. </view>
  24. </view>
  25. <tui-list-cell v-if="orderDetail.orderInfo.deliverymode==1 || orderDetail.orderInfo.deliverymode==3" unlined
  26. :hover="false">
  27. <view class="tui-flex-box">
  28. <image src="/static/images/mall/order/img_order_address3x.png" class="tui-icon-img"></image>
  29. <view class="tui-addr">
  30. <view class="tui-addr-userinfo">联系人:{{orderDetail.orderInfo.address.name}}<text
  31. class="tui-addr-tel">{{orderDetail.orderInfo.address.telephone}}</text></view>
  32. <view class="tui-addr-text" @tap="openLocation">上门地址:{{orderDetail.orderInfo.address.alladdress}}
  33. <image src="/static/images/map.png" class="map-img"> </image><text
  34. style="color: #5454f3;">导航到这里</text>
  35. </view>
  36. <view class="tui-addr-text">预约时间:{{orderDetail.orderInfo.ServiceTime}}</view>
  37. <view class="tui-Technical" @tap="toTel(orderDetail.orderInfo.Technical.tel)"
  38. v-if="orderDetail.orderInfo.Technical">接单{{lang.technical}}:{{orderDetail.orderInfo.Technical.title}}<text
  39. class="tui-addr-tel" style="color: #5454f3;">{{orderDetail.orderInfo.Technical.tel}}</text>
  40. </view>
  41. </view>
  42. </view>
  43. </tui-list-cell>
  44. <tui-list-cell v-else-if="orderDetail.orderInfo.deliverymode==2" unlined :hover="false">
  45. <view class="tui-flex-box">
  46. <image src="/static/images/mall/order/img_order_address3x.png" class="tui-icon-img"></image>
  47. <view class="tui-addr">
  48. <view class="tui-addr-userinfo">门店:{{orderDetail.orderInfo.store.title}}<text
  49. class="tui-addr-tel">{{orderDetail.orderInfo.address.telephone}}</text></view>
  50. <view class="tui-addr-text">
  51. 地址:{{orderDetail.orderInfo.store.province_name}}{{orderDetail.orderInfo.store.city_name}}{{orderDetail.orderInfo.store.district_name}}{{orderDetail.orderInfo.store.region_name}}
  52. </view>
  53. <view class="tui-addr-text">电话:{{orderDetail.orderInfo.store.tel}}</view>
  54. </view>
  55. </view>
  56. </tui-list-cell>
  57. <view class="tui-order-item">
  58. <tui-list-cell :hover="false" :lineLeft="false">
  59. <view class="tui-goods-title">
  60. 服务内容
  61. </view>
  62. </tui-list-cell>
  63. <block v-for="(item,index) in orderDetail.goods" :key="index">
  64. <tui-list-cell padding="0">
  65. <view class="tui-goods-item">
  66. <image :src="item.image" mode="widthFix" class="tui-goods-img"></image>
  67. <view class="tui-goods-center">
  68. <view class="tui-goods-name">{{item.name}}</view>
  69. <view v-if="item.label" class="tui-goods-attr">{{item.label}}</view>
  70. </view>
  71. <view class="tui-price-right">
  72. <view>¥{{item.price}}</view>
  73. <view>x{{item.quantity}}</view>
  74. </view>
  75. </view>
  76. </tui-list-cell>
  77. </block>
  78. <tui-list-cell :hover="false" :lineLeft="false">
  79. <view class="tui-goods-title">
  80. 订单备注
  81. </view>
  82. </tui-list-cell>
  83. <view v-if="orderDetail.orderInfo.remark" class="tui-goods-attr">
  84. {{orderDetail.orderInfo.remark}}
  85. </view>
  86. <view class="tui-img__box" v-if="OrderImage && OrderImage.length>0">
  87. <block v-for="(src,index) in OrderImage" :key="index">
  88. <image @tap.stop="previewImage(index)" :class="{'tui-image':OrderImage.length===1}" :src="src"
  89. :mode="OrderImage.length===1?'widthFix':'aspectFill'"></image>
  90. </block>
  91. </view>
  92. <view v-if="orderDetail.orderInfo.is_additional==1" class="tui-goods-info">
  93. <view class="tui-price-flex tui-size32 tui-pbtm20">
  94. <view class="tui-flex-shrink">预付金额</view>
  95. <view class="tui-goods-price">
  96. <view class="tui-size-24">¥</view>
  97. <view class="tui-price-large"> {{orderDetail.orderInfo.total}}</view>
  98. </view>
  99. </view>
  100. <view v-if="orderDetail.orderInfo.additional>0" class="tui-price-flex tui-size32 tui-pbtm20">
  101. <view class="tui-flex-shrink">尾款</view>
  102. <view class="tui-goods-price">
  103. <view class="tui-size-24">
  104. <text v-if="orderDetail.orderInfo.additional_pay_time>0">已支付</text>
  105. <text v-if="orderDetail.orderInfo.additional_pay_time==0">未支付</text>
  106. </view>
  107. <view class="tui-price-large"> {{orderDetail.orderInfo.additional}}</view>
  108. </view>
  109. </view>
  110. </view>
  111. <view v-else class="tui-goods-info">
  112. <view class="tui-price-flex tui-size32 tui-pbtm20">
  113. <view class="tui-flex-shrink">合计</view>
  114. <view class="tui-goods-price">
  115. <view class="tui-size-24">¥</view>
  116. <view class="tui-price-large"> {{orderDetail.orderInfo.total}}</view>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. <view class="tui-order-item">
  122. <tui-list-cell :hover="false" :lineLeft="false">
  123. <view class="tui-goods-title">
  124. 进度
  125. </view>
  126. </tui-list-cell>
  127. <diyfields ptype="complete" :orderid="orderid" gourl="no" submittxt="提交备注" posturl='order.custom'>
  128. </diyfields>
  129. </view>
  130. <view class="tui-safe-area"></view>
  131. <view class="tui-tabbar tui-order-btn">
  132. <!--<view v-if="orderDetail.orderInfo.order_status_id==3" class="tui-btn-mr">
  133. <tui-button type="black" :plain="true" width="152rpx" height="56rpx" :size="26" shape="circle"
  134. @click="complete">完成服务</tui-button>
  135. </view>-->
  136. <view v-if="orderDetail.orderInfo.order_status_id==2 || orderDetail.orderInfo.order_status_id==3"
  137. class="tui-btn-mr">
  138. <tui-button type="black" :plain="true" width="152rpx" height="56rpx" :size="26" shape="circle"
  139. @click="staff">派单</tui-button>
  140. </view>
  141. </view>
  142. </view>
  143. </template>
  144. <script>
  145. import diyfields from "@/components/views/diyfields/diyfields"
  146. export default {
  147. components: {
  148. diyfields
  149. },
  150. data() {
  151. return {
  152. //1-待付款 2-付款成功 3-待收货 4-订单已完成 5-交易关闭
  153. lang: {},
  154. orderid: 0,
  155. status: 1,
  156. orderDetail: [],
  157. OrderImage: []
  158. }
  159. },
  160. onLoad: function(options) {
  161. let _this = this;
  162. _this.orderid = options.id;
  163. _this.$request.get('Lang.getlang').then(res => {
  164. if (res.errno == 0) {
  165. _this.lang = res.data;
  166. }
  167. });
  168. if (options && options.scene) {
  169. _this.orderid = options.scene;
  170. }
  171. },
  172. onShow: function(e) {
  173. this.detail();
  174. },
  175. methods: {
  176. openLocation: function() {
  177. uni.openLocation({
  178. latitude: Number(this.orderDetail.orderInfo.address.latitude), //要去的纬度-地址
  179. longitude: Number(this.orderDetail.orderInfo.address.longitude), //要去的经度-地址
  180. address: this.orderDetail.orderInfo.address.address,
  181. success: function() {
  182. console.log('success');
  183. },
  184. fail: function() {
  185. console.log('fail');
  186. }
  187. })
  188. },
  189. detail() {
  190. let _this = this;
  191. _this.$request.get('order.detail', {
  192. samkey: (new Date()).valueOf(),
  193. id: _this.orderid
  194. }).then(function(res) {
  195. if (res.errno != 0) {
  196. uni.showModal({
  197. title: '错误',
  198. content: res.msg,
  199. showCancel: false
  200. })
  201. return;
  202. }
  203. _this.orderDetail = res.data;
  204. if (_this.orderDetail) {
  205. if (_this.orderDetail.orderInfo) {
  206. _this.OrderImage = _this.orderDetail.orderInfo.OrderImage
  207. }
  208. }
  209. });
  210. },
  211. complete() {
  212. let _this = this
  213. _this.$request.post('order.complete', {
  214. orderid: _this.orderDetail.orderInfo.id
  215. }).then(function(res) {
  216. if (res.errno == 0) {
  217. _this.detail();
  218. }
  219. });
  220. },
  221. staff() {
  222. var url = '/pagesA/my/adminstore/selectTechnical?id=' + this.orderDetail.orderInfo.id + '&sid=' + this
  223. .orderDetail.orderInfo.sid;
  224. uni.navigateTo({
  225. url: url
  226. })
  227. },
  228. previewImage(current) {
  229. let imgs = this.OrderImage
  230. console.log(imgs);
  231. uni.previewImage({
  232. current: current,
  233. urls: imgs
  234. })
  235. }
  236. },
  237. /**
  238. * 页面相关事件处理函数--监听用户下拉动作
  239. */
  240. onPullDownRefresh: function() {
  241. setTimeout(() => {
  242. uni.stopPullDownRefresh()
  243. }, 200);
  244. },
  245. }
  246. </script>
  247. <style>
  248. .container {
  249. padding-bottom: 118rpx;
  250. }
  251. .tui-order-header {
  252. width: 100%;
  253. height: 160rpx;
  254. position: relative;
  255. background-color: #EB0909;
  256. }
  257. .tui-img-bg {
  258. width: 100%;
  259. height: 160rpx;
  260. }
  261. .tui-header-content {
  262. width: 100%;
  263. height: 160rpx;
  264. position: absolute;
  265. z-index: 10;
  266. left: 0;
  267. top: 0;
  268. display: flex;
  269. align-items: center;
  270. justify-content: space-between;
  271. padding: 0 70rpx;
  272. box-sizing: border-box;
  273. }
  274. .tui-status-text {
  275. font-size: 34rpx;
  276. line-height: 34rpx;
  277. color: #FEFEFE;
  278. }
  279. .tui-reason {
  280. font-size: 24rpx;
  281. line-height: 24rpx;
  282. color: rgba(254, 254, 254, 0.75);
  283. padding-top: 15rpx;
  284. display: flex;
  285. align-items: center;
  286. }
  287. .tui-reason-text {
  288. padding-right: 12rpx;
  289. }
  290. .tui-status-img {
  291. width: 80rpx;
  292. height: 80rpx;
  293. display: block;
  294. }
  295. .tui-flex-box {
  296. width: 100%;
  297. display: flex;
  298. align-items: center;
  299. }
  300. .tui-icon-img {
  301. width: 44rpx;
  302. height: 44rpx;
  303. flex-shrink: 0;
  304. }
  305. .map-img {
  306. width: 50rpx;
  307. height: 50rpx;
  308. margin-left: 10rpx;
  309. margin-right: 10rpx;
  310. margin-top: -30rpx;
  311. margin-bottom: -10rpx;
  312. }
  313. .tui-addr {
  314. display: flex;
  315. flex-direction: column;
  316. justify-content: center;
  317. padding-left: 20rpx;
  318. box-sizing: border-box;
  319. }
  320. .tui-addr-userinfo {
  321. font-size: 30rpx;
  322. line-height: 30rpx;
  323. font-weight: bold;
  324. }
  325. .tui-addr-text {
  326. font-size: 24rpx;
  327. line-height: 32rpx;
  328. padding-top: 16rpx;
  329. }
  330. .tui-addr-tel {
  331. padding-left: 40rpx;
  332. }
  333. .tui-order-item {
  334. margin-top: 20rpx;
  335. border-radius: 10rpx;
  336. overflow: hidden;
  337. }
  338. .tui-goods-title {
  339. width: 100%;
  340. font-size: 28rpx;
  341. line-height: 28rpx;
  342. display: flex;
  343. align-items: center;
  344. justify-content: space-between;
  345. }
  346. .tui-goods-item {
  347. width: 100%;
  348. padding: 20rpx 30rpx;
  349. box-sizing: border-box;
  350. display: flex;
  351. justify-content: space-between;
  352. }
  353. .tui-goods-img {
  354. width: 180rpx;
  355. height: 180rpx;
  356. display: block;
  357. flex-shrink: 0;
  358. }
  359. .tui-goods-center {
  360. flex: 1;
  361. padding: 20rpx 8rpx;
  362. box-sizing: border-box;
  363. }
  364. .tui-goods-name {
  365. max-width: 310rpx;
  366. word-break: break-all;
  367. overflow: hidden;
  368. text-overflow: ellipsis;
  369. display: -webkit-box;
  370. -webkit-box-orient: vertical;
  371. -webkit-line-clamp: 2;
  372. font-size: 26rpx;
  373. line-height: 32rpx;
  374. }
  375. .tui-goods-attr {
  376. font-size: 22rpx;
  377. color: #888888;
  378. line-height: 32rpx;
  379. padding-top: 20rpx;
  380. word-break: break-all;
  381. overflow: hidden;
  382. text-overflow: ellipsis;
  383. display: -webkit-box;
  384. -webkit-box-orient: vertical;
  385. -webkit-line-clamp: 2;
  386. }
  387. .tui-price-right {
  388. text-align: right;
  389. font-size: 24rpx;
  390. color: #888888;
  391. line-height: 30rpx;
  392. padding-top: 20rpx;
  393. }
  394. .tui-color-red {
  395. color: #E41F19;
  396. padding-right: 30rpx;
  397. }
  398. .tui-goods-price {
  399. width: 100%;
  400. display: flex;
  401. align-items: flex-end;
  402. justify-content: flex-end;
  403. font-size: 24rpx;
  404. }
  405. .tui-size-24 {
  406. font-size: 24rpx;
  407. line-height: 24rpx;
  408. }
  409. .tui-price-large {
  410. font-size: 32rpx;
  411. line-height: 30rpx;
  412. }
  413. .tui-goods-info {
  414. width: 100%;
  415. padding: 30rpx;
  416. box-sizing: border-box;
  417. background: #fff;
  418. }
  419. .tui-price-flex {
  420. display: flex;
  421. align-items: center;
  422. justify-content: space-between;
  423. }
  424. .tui-size24 {
  425. padding-bottom: 20rpx;
  426. font-size: 24rpx;
  427. line-height: 24rpx;
  428. color: #888;
  429. }
  430. .tui-size32 {
  431. font-size: 32rpx;
  432. line-height: 32rpx;
  433. font-weight: 500;
  434. }
  435. .tui-pbtm20 {
  436. padding-bottom: 20rpx;
  437. }
  438. .tui-flex-shrink {
  439. flex-shrink: 0;
  440. }
  441. .tui-primary-color {
  442. color: #EB0909;
  443. }
  444. .tui-order-info {
  445. margin-top: 20rpx;
  446. }
  447. .tui-order-title {
  448. position: relative;
  449. font-size: 28rpx;
  450. line-height: 28rpx;
  451. padding-left: 12rpx;
  452. box-sizing: border-box;
  453. }
  454. .tui-order-title::before {
  455. content: '';
  456. position: absolute;
  457. left: 0;
  458. top: 0;
  459. border-left: 4rpx solid #EB0909;
  460. height: 100%;
  461. }
  462. .tui-order-content {
  463. width: 100%;
  464. padding: 24rpx 30rpx;
  465. box-sizing: border-box;
  466. background: #fff;
  467. font-size: 24rpx;
  468. line-height: 30rpx;
  469. }
  470. .tui-order-flex {
  471. display: flex;
  472. padding-top: 18rpx;
  473. }
  474. .tui-order-flex:first-child {
  475. padding-top: 0
  476. }
  477. .tui-item-title {
  478. width: 132rpx;
  479. flex-shrink: 0;
  480. }
  481. .tui-item-content {
  482. color: #666;
  483. line-height: 32rpx;
  484. }
  485. .tui-safe-area {
  486. height: 1rpx;
  487. padding-bottom: env(safe-area-inset-bottom);
  488. }
  489. .tui-tabbar {
  490. width: 100%;
  491. height: 98rpx;
  492. background: #fff;
  493. position: fixed;
  494. left: 0;
  495. bottom: 0;
  496. display: flex;
  497. align-items: center;
  498. justify-content: flex-end;
  499. font-size: 26rpx;
  500. box-shadow: 0 0 1px rgba(0, 0, 0, .3);
  501. padding-bottom: env(safe-area-inset-bottom);
  502. z-index: 996;
  503. }
  504. .tui-btn-mr {
  505. margin-right: 30rpx;
  506. }
  507. .tui-contact {
  508. display: flex;
  509. align-items: center;
  510. justify-content: center;
  511. font-size: 28rpx;
  512. }
  513. .tui-contact image {
  514. width: 36rpx;
  515. height: 36rpx;
  516. margin-right: 16rpx;
  517. }
  518. .tui-btn-box {
  519. width: 100%;
  520. padding: 0 30rpx;
  521. box-sizing: border-box;
  522. margin-top: 20rpx;
  523. }
  524. .tui-img__box {
  525. width: 100%;
  526. font-size: 0;
  527. padding-top: 4rpx;
  528. }
  529. .tui-img__box image {
  530. width: 200rpx;
  531. height: 200rpx;
  532. margin-right: 12rpx;
  533. margin-top: 12rpx;
  534. }
  535. .tui-image {
  536. width: 400rpx !important;
  537. height: auto;
  538. }
  539. </style>