orderDetail.vue 13 KB

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