orderDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  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 class="tui-reason"><text class="tui-reason-text">超时未付款,订单自动取消</text>
  10. <tui-countdown :time="1800" color="rgba(254,254,254,0.75)" colonColor="rgba(254,254,254,0.75)"
  11. borderColor="transparent" backgroundColor="transparent" v-if="status===1"></tui-countdown>
  12. </view>-->
  13. </view>
  14. <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>
  15. <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>
  16. <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>
  17. <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>
  18. <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>
  19. </view>
  20. </view>
  21. <tui-list-cell v-if="orderDetail.logistics" arrow backgroundColor="#fefefe" @click="logistics">
  22. <view v-if="orderDetail.logistics.Traces.length>0" class="tui-flex-box">
  23. <image src="/static/images/mall/order/img_order_logistics3x.png" class="tui-icon-img"></image>
  24. <view class="tui-logistics">
  25. <view class="tui-logistics-text">{{orderDetail.logistics.Traces[0].AcceptStation}}</view>
  26. <view class="tui-logistics-time">{{orderDetail.logistics.Traces[0].AcceptTime}}</view>
  27. </view>
  28. </view>
  29. </tui-list-cell>
  30. <tui-list-cell 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.address.name}}<text class="tui-addr-tel">{{orderDetail.orderInfo.address.telephone}}</text></view>
  35. <view class="tui-addr-text">{{orderDetail.orderInfo.address.alladdress}}</view>
  36. </view>
  37. </view>
  38. </tui-list-cell>
  39. <view class="tui-order-item">
  40. <block v-for="(item,index) in orderDetail.goods" :key="index">
  41. <tui-list-cell padding="0">
  42. <view class="tui-goods-item">
  43. <image :src="item.image" class="tui-goods-img"></image>
  44. <view class="tui-goods-center">
  45. <view class="tui-goods-name">{{item.name}}</view>
  46. <view v-if="item.label" class="tui-goods-attr">{{item.label}}</view>
  47. </view>
  48. <view class="tui-price-right">
  49. <view>¥{{item.price}}</view>
  50. <view>x{{item.quantity}}</view>
  51. </view>
  52. </view>
  53. </tui-list-cell>
  54. </block>
  55. <view class="tui-goods-info">
  56. <view class="tui-price-flex tui-size24">
  57. <view>总额</view>
  58. <view>¥{{orderDetail.order_total.sub_total.value}}</view>
  59. </view>
  60. <!--<view class="tui-price-flex tui-size24">
  61. <view>优惠券</view>
  62. <view>¥0.00</view>
  63. </view>-->
  64. <view class="tui-price-flex tui-size24">
  65. <view>配送费</view>
  66. <view>¥{{orderDetail.order_total.shipping.value}}</view>
  67. </view>
  68. <view class="tui-price-flex tui-size32 tui-pbtm20">
  69. <view class="tui-flex-shrink">合计</view>
  70. <view class="tui-goods-price">
  71. <view class="tui-size-24">¥</view>
  72. <view class="tui-price-large"> {{orderDetail.orderInfo.total}}</view>
  73. <!--<view class="tui-size-24">.00</view>-->
  74. </view>
  75. </view>
  76. <!--<view class="tui-price-flex tui-size32">
  77. <view class="tui-flex-shrink">实付款</view>
  78. <view class="tui-goods-price tui-primary-color">
  79. <view class="tui-size-24">¥</view>
  80. <view class="tui-price-large">1192</view>
  81. <view class="tui-size-24">.00</view>
  82. </view>
  83. </view>-->
  84. </view>
  85. </view>
  86. <!--<view class="tui-order-info">
  87. <tui-list-cell :hover="false">
  88. <view class="tui-order-title">
  89. 订单信息
  90. </view>
  91. </tui-list-cell>
  92. <view class="tui-order-content">
  93. <view class="tui-order-flex">
  94. <view class="tui-item-title">订单号:</view>
  95. <view class="tui-item-content">{{orderDetail.orderInfo.order_num_alias}}</view>
  96. </view>
  97. <view class="tui-order-flex">
  98. <view class="tui-item-title">物流单号:</view>
  99. <view class="tui-item-content">33655511251265578556</view>
  100. </view>
  101. <view class="tui-order-flex">
  102. <view class="tui-item-title">创建时间:</view>
  103. <view class="tui-item-content">2019-05-26 10:36</view>
  104. </view>
  105. <view class="tui-order-flex">
  106. <view class="tui-item-title">付款时间:</view>
  107. <view class="tui-item-content">2019-05-26 10:44</view>
  108. </view>
  109. <view class="tui-order-flex">
  110. <view class="tui-item-title">发货时间:</view>
  111. <view class="tui-item-content">2019-05-27 10:20</view>
  112. </view>
  113. <view class="tui-order-flex">
  114. <view class="tui-item-title">配送方式:</view>
  115. <view class="tui-item-content">包邮</view>
  116. </view>
  117. <view class="tui-order-flex">
  118. <view class="tui-item-title">订单备注:</view>
  119. <view class="tui-item-content">麻烦尽快发货,打包包裹时请多拿几个泡沫放在纸箱盒内,防止摔碎</view>
  120. </view>
  121. </view>
  122. <tui-list-view unlined="bottom">
  123. <tui-list-cell unlined>
  124. <view class="tui-contact">
  125. <image src="/static/images/mall/icon_order_contactmerchant.png"></image>
  126. <text>联系商家</text>
  127. </view>
  128. </tui-list-cell>
  129. </tui-list-view>
  130. </view>-->
  131. <tui-list-cell :hover="false" :lineLeft="false">
  132. <view class="tui-goods-title">
  133. 订单备注
  134. </view>
  135. </tui-list-cell>
  136. <view v-if="orderDetail.orderInfo.remark" class="tui-goods-attr">
  137. {{orderDetail.orderInfo.remark}}
  138. </view>
  139. <view class="tui-img__box"
  140. v-if="OrderImage && OrderImage.length>0">
  141. <block v-for="(src,index) in OrderImage" :key="index">
  142. <image @tap.stop="previewImage(index)"
  143. :class="{'tui-image':OrderImage.length===1}" :src="src"
  144. :mode="OrderImage.length===1?'widthFix':'aspectFill'"></image>
  145. </block>
  146. </view>
  147. <view class="tui-safe-area"></view>
  148. <view class="tui-tabbar tui-order-btn">
  149. <!-- <view class="tui-btn-mr">
  150. <tui-button type="black" :plain="true" width="152rpx" height="56rpx" :size="26" shape="circle">删除订单</tui-button>
  151. </view> -->
  152. <view v-if="orderDetail.orderInfo.order_status_id==2" class="tui-btn-mr">
  153. <tui-button type="black" :plain="true" width="152rpx" height="56rpx" :size="26" shape="circle"
  154. @click="refund">申请退款</tui-button>
  155. </view>
  156. <view v-if="orderDetail.orderInfo.order_status_id==3" class="tui-btn-mr">
  157. <tui-button type="black" :plain="true" width="152rpx" height="56rpx" :size="26" shape="circle"
  158. @click="confirmBtnTap">确认收货</tui-button>
  159. </view>
  160. <view v-if="orderDetail.orderInfo.order_status_id==7 && orderDetail.orderInfo.is_comment==0" class="tui-btn-mr">
  161. <tui-button type="black" :plain="true" width="152rpx" height="56rpx" :size="26" shape="circle"
  162. @click="addEvaluate">评价</tui-button>
  163. </view>
  164. <view v-if="orderDetail.orderInfo.order_status_id==5 || orderDetail.orderInfo.order_status_id==7" class="tui-btn-mr">
  165. <tui-button type="black" :plain="true" width="152rpx" height="56rpx" :size="26" shape="circle"
  166. @click="refund">申请售后</tui-button>
  167. </view>
  168. <view v-if="orderDetail.orderInfo.order_status_id==6" class="tui-btn-mr">
  169. <tui-button type="black" :plain="true" width="152rpx" height="56rpx" :size="26" shape="circle"
  170. @click="refundDetail">售后详情</tui-button>
  171. </view>
  172. <view v-if="orderDetail.orderInfo.payment_code=='offline_pay' && orderDetail.orderInfo.is_offline_pay<1 && orderDetail.orderInfo.order_status_id==1" class="tui-btn-mr">
  173. <tui-button type="danger" :plain="true" width="152rpx" height="56rpx" :size="26" shape="circle"
  174. @click="offlinepaymentTap(orderDetail.orderInfo.id)">支付凭证</tui-button>
  175. </view>
  176. <view v-if="orderDetail.orderInfo.payment_code=='wx_pay' && orderDetail.orderInfo.order_status_id==1" class="tui-btn-mr">
  177. <tui-button type="danger" :plain="true" width="152rpx" height="56rpx" :size="26" shape="circle"
  178. @click="toPayTap(orderDetail.orderInfo.total,orderDetail.orderInfo.id)">立即支付</tui-button>
  179. </view>
  180. </view>
  181. </view>
  182. </template>
  183. <script>
  184. import pay from '@/common/pay.js'
  185. export default {
  186. components: {},
  187. data() {
  188. return {
  189. //1-待付款 2-付款成功 3-待收货 4-订单已完成 5-交易关闭
  190. status: 1,
  191. orderid:0,
  192. orderDetail: [],
  193. OrderImage:[]
  194. }
  195. },
  196. onLoad: function(options) {
  197. let _this = this
  198. _this.orderid = options.id;
  199. _this.detail(_this.orderid);
  200. },
  201. methods: {
  202. detail(orderid) {
  203. let _this = this
  204. _this.$request.get('order.detail', {
  205. samkey: (new Date()).valueOf(),
  206. id: orderid
  207. }).then(function(res) {
  208. if (res.errno != 0) {
  209. uni.showModal({
  210. title: '错误',
  211. content: res.msg,
  212. showCancel: false
  213. })
  214. return;
  215. }
  216. _this.orderDetail = res.data;
  217. if(_this.orderDetail){
  218. if(_this.orderDetail.orderInfo){
  219. _this.OrderImage = _this.orderDetail.orderInfo.OrderImage
  220. }
  221. }
  222. });
  223. },
  224. logistics() {
  225. this.tui.href("/pagesA/my/logistics/logistics?id="+this.orderDetail.orderInfo.id)
  226. },
  227. toPayTap: function(total,orderid) {
  228. const redirectUrl = "/pagesA/my/myOrder/myOrder?ptype=" + this.orderDetail.orderInfo.ptype;
  229. pay.wxpay('order', total, orderid, redirectUrl);
  230. },
  231. //线下付款处理
  232. offlinepaymentTap: function(orderid) {
  233. uni.navigateTo({
  234. url: '/pagesA/submitOrder/offlinepayment?id='+orderid
  235. })
  236. },
  237. confirmBtnTap: function (e) {
  238. let _this = this;
  239. let orderid = this.orderid;
  240. uni.showModal({
  241. title: '确认您已收到商品?',
  242. content: '',
  243. success: function (res) {
  244. if (res.confirm) {
  245. _this.$request.post('order.delivery', {
  246. orderid: orderid
  247. }).then(res => {
  248. if (res.errno == 0) {
  249. _this.detail(orderid);
  250. }
  251. });
  252. }
  253. }
  254. });
  255. },
  256. refund() {
  257. this.tui.href("/pagesA/my/myOrder/refund?id="+this.orderDetail.orderInfo.id)
  258. },
  259. refundDetail() {
  260. this.tui.href("/pagesA/my/myOrder/refundDetail?id="+this.orderDetail.orderInfo.id)
  261. },
  262. addEvaluate() {
  263. this.tui.href('/pagesA/my/addEvaluate/addEvaluate?id=' + this.orderDetail.orderInfo.id)
  264. },
  265. previewImage(current) {
  266. let imgs = this.OrderImage
  267. console.log(imgs);
  268. uni.previewImage({
  269. current: current,
  270. urls: imgs
  271. })
  272. }
  273. },
  274. /**
  275. * 页面相关事件处理函数--监听用户下拉动作
  276. */
  277. onPullDownRefresh: function() {
  278. setTimeout(() => {
  279. uni.stopPullDownRefresh()
  280. }, 200);
  281. },
  282. }
  283. </script>
  284. <style>
  285. .container {
  286. padding-bottom: 118rpx;
  287. }
  288. .tui-order-header {
  289. width: 100%;
  290. height: 160rpx;
  291. position: relative;
  292. background-color: #EB0909;
  293. }
  294. .tui-img-bg {
  295. width: 100%;
  296. height: 160rpx;
  297. }
  298. .tui-header-content {
  299. width: 100%;
  300. height: 160rpx;
  301. position: absolute;
  302. z-index: 10;
  303. left: 0;
  304. top: 0;
  305. display: flex;
  306. align-items: center;
  307. justify-content: space-between;
  308. padding: 0 70rpx;
  309. box-sizing: border-box;
  310. }
  311. .tui-status-text {
  312. font-size: 34rpx;
  313. line-height: 34rpx;
  314. color: #FEFEFE;
  315. }
  316. .tui-reason {
  317. font-size: 24rpx;
  318. line-height: 24rpx;
  319. color: rgba(254, 254, 254, 0.75);
  320. padding-top: 15rpx;
  321. display: flex;
  322. align-items: center;
  323. }
  324. .tui-reason-text {
  325. padding-right: 12rpx;
  326. }
  327. .tui-status-img {
  328. width: 80rpx;
  329. height: 80rpx;
  330. display: block;
  331. }
  332. .tui-flex-box {
  333. width: 100%;
  334. display: flex;
  335. align-items: center;
  336. }
  337. .tui-icon-img {
  338. width: 44rpx;
  339. height: 44rpx;
  340. flex-shrink: 0;
  341. }
  342. .tui-logistics {
  343. display: flex;
  344. flex-direction: column;
  345. justify-content: center;
  346. padding: 0 24rpx 0 20rpx;
  347. box-sizing: border-box;
  348. }
  349. .tui-logistics-text {
  350. font-size: 26rpx;
  351. line-height: 32rpx;
  352. }
  353. .tui-logistics-time {
  354. font-size: 24rpx;
  355. line-height: 24rpx;
  356. padding-top: 16rpx;
  357. color: #666
  358. }
  359. .tui-addr {
  360. display: flex;
  361. flex-direction: column;
  362. justify-content: center;
  363. padding-left: 20rpx;
  364. box-sizing: border-box;
  365. }
  366. .tui-addr-userinfo {
  367. font-size: 30rpx;
  368. line-height: 30rpx;
  369. font-weight: bold;
  370. }
  371. .tui-addr-text {
  372. font-size: 24rpx;
  373. line-height: 32rpx;
  374. padding-top: 16rpx;
  375. }
  376. .tui-addr-tel {
  377. padding-left: 40rpx;
  378. }
  379. .tui-order-item {
  380. margin-top: 20rpx;
  381. border-radius: 10rpx;
  382. overflow: hidden;
  383. }
  384. .tui-goods-title {
  385. width: 100%;
  386. font-size: 28rpx;
  387. line-height: 28rpx;
  388. display: flex;
  389. align-items: center;
  390. justify-content: space-between;
  391. }
  392. .tui-goods-item {
  393. width: 100%;
  394. padding: 20rpx 30rpx;
  395. box-sizing: border-box;
  396. display: flex;
  397. justify-content: space-between;
  398. }
  399. .tui-goods-img {
  400. width: 180rpx;
  401. height: 180rpx;
  402. display: block;
  403. flex-shrink: 0;
  404. }
  405. .tui-goods-center {
  406. flex: 1;
  407. padding: 20rpx 8rpx;
  408. box-sizing: border-box;
  409. }
  410. .tui-goods-name {
  411. max-width: 310rpx;
  412. word-break: break-all;
  413. overflow: hidden;
  414. text-overflow: ellipsis;
  415. display: -webkit-box;
  416. -webkit-box-orient: vertical;
  417. -webkit-line-clamp: 2;
  418. font-size: 26rpx;
  419. line-height: 32rpx;
  420. }
  421. .tui-goods-attr {
  422. font-size: 22rpx;
  423. color: #888888;
  424. line-height: 32rpx;
  425. padding-top: 20rpx;
  426. word-break: break-all;
  427. overflow: hidden;
  428. text-overflow: ellipsis;
  429. display: -webkit-box;
  430. -webkit-box-orient: vertical;
  431. -webkit-line-clamp: 2;
  432. }
  433. .tui-price-right {
  434. text-align: right;
  435. font-size: 24rpx;
  436. color: #888888;
  437. line-height: 30rpx;
  438. padding-top: 20rpx;
  439. }
  440. .tui-color-red {
  441. color: #E41F19;
  442. padding-right: 30rpx;
  443. }
  444. .tui-goods-price {
  445. width: 100%;
  446. display: flex;
  447. align-items: flex-end;
  448. justify-content: flex-end;
  449. font-size: 24rpx;
  450. }
  451. .tui-size-24 {
  452. font-size: 24rpx;
  453. line-height: 24rpx;
  454. }
  455. .tui-price-large {
  456. font-size: 32rpx;
  457. line-height: 30rpx;
  458. }
  459. .tui-goods-info {
  460. width: 100%;
  461. padding: 30rpx;
  462. box-sizing: border-box;
  463. background: #fff;
  464. }
  465. .tui-price-flex {
  466. display: flex;
  467. align-items: center;
  468. justify-content: space-between;
  469. }
  470. .tui-size24 {
  471. padding-bottom: 20rpx;
  472. font-size: 24rpx;
  473. line-height: 24rpx;
  474. color: #888;
  475. }
  476. .tui-size32 {
  477. font-size: 32rpx;
  478. line-height: 32rpx;
  479. font-weight: 500;
  480. }
  481. .tui-pbtm20 {
  482. padding-bottom: 20rpx;
  483. }
  484. .tui-flex-shrink {
  485. flex-shrink: 0;
  486. }
  487. .tui-primary-color {
  488. color: #EB0909;
  489. }
  490. .tui-order-info {
  491. margin-top: 20rpx;
  492. }
  493. .tui-order-title {
  494. position: relative;
  495. font-size: 28rpx;
  496. line-height: 28rpx;
  497. padding-left: 12rpx;
  498. box-sizing: border-box;
  499. }
  500. .tui-order-title::before {
  501. content: '';
  502. position: absolute;
  503. left: 0;
  504. top: 0;
  505. border-left: 4rpx solid #EB0909;
  506. height: 100%;
  507. }
  508. .tui-order-content {
  509. width: 100%;
  510. padding: 24rpx 30rpx;
  511. box-sizing: border-box;
  512. background: #fff;
  513. font-size: 24rpx;
  514. line-height: 30rpx;
  515. }
  516. .tui-order-flex {
  517. display: flex;
  518. padding-top: 18rpx;
  519. }
  520. .tui-order-flex:first-child {
  521. padding-top: 0
  522. }
  523. .tui-item-title {
  524. width: 132rpx;
  525. flex-shrink: 0;
  526. }
  527. .tui-item-content {
  528. color: #666;
  529. line-height: 32rpx;
  530. }
  531. .tui-safe-area {
  532. height: 1rpx;
  533. padding-bottom: env(safe-area-inset-bottom);
  534. }
  535. .tui-tabbar {
  536. width: 100%;
  537. height: 98rpx;
  538. background: #fff;
  539. position: fixed;
  540. left: 0;
  541. bottom: 0;
  542. display: flex;
  543. align-items: center;
  544. justify-content: flex-end;
  545. font-size: 26rpx;
  546. box-shadow: 0 0 1px rgba(0, 0, 0, .3);
  547. padding-bottom: env(safe-area-inset-bottom);
  548. z-index: 996;
  549. }
  550. .tui-btn-mr {
  551. margin-right: 30rpx;
  552. }
  553. .tui-contact {
  554. display: flex;
  555. align-items: center;
  556. justify-content: center;
  557. font-size: 28rpx;
  558. }
  559. .tui-contact image {
  560. width: 36rpx;
  561. height: 36rpx;
  562. margin-right: 16rpx;
  563. }
  564. .tui-img__box {
  565. width: 100%;
  566. font-size: 0;
  567. padding-top: 4rpx;
  568. }
  569. .tui-img__box image {
  570. width: 200rpx;
  571. height: 200rpx;
  572. margin-right: 12rpx;
  573. margin-top: 12rpx;
  574. }
  575. .tui-image {
  576. width: 400rpx !important;
  577. height: auto;
  578. }
  579. </style>