yuyueDetail.vue 13 KB

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