orderDetail.vue 13 KB

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