orderDetail.vue 14 KB

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