orderDetail.vue 16 KB

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