storeOrderDetail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. <template>
  2. <view>
  3. <view class="cont">
  4. <view class="bg"></view>
  5. <view class="inner">
  6. <!-- 订单状态 -->
  7. <view class="order-status">
  8. <!-- 待付款 -->
  9. <view v-if="order.status == 1" class="inner">
  10. <view class="img-box">
  11. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/67eda0644e5847008096525b04cd12ca.png" mode=""></image>
  12. </view>
  13. <view class="status-box">
  14. <text class="status">待付款</text>
  15. <text class="desc">请在{{payLimitTime}}前完成支付</text>
  16. </view>
  17. </view>
  18. <!-- 待发货 -->
  19. <view v-if="order.status == 2" class="inner">
  20. <view class="img-box">
  21. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/520e24fba47441b3b0f73b5250bb0b57.png" mode=""></image>
  22. </view>
  23. <view class="status-box">
  24. <text class="status">待发货</text>
  25. <text class="desc">等待后台发货</text>
  26. </view>
  27. </view>
  28. <!-- 已发货、待收货 -->
  29. <view v-if="order.status == 3" class="inner">
  30. <view class="img-box">
  31. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/1e6ba423ff7e4537bef87a022d530015.png" mode=""></image>
  32. </view>
  33. <view class="status-box">
  34. <text class="status">待收货</text>
  35. <text class="desc">运输中</text>
  36. </view>
  37. </view>
  38. <!-- 已完成 -->
  39. <view v-if="order.status == 4" class="inner">
  40. <view class="img-box">
  41. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/0712ba14f3a648afa69c9912fcbf9b61.png" mode=""></image>
  42. </view>
  43. <view class="status-box">
  44. <text class="status">已完成</text>
  45. <text class="desc">订单已确认收货,交易完成</text>
  46. </view>
  47. </view>
  48. <!--交易取消 -->
  49. <view v-if="order.status == -3" class="inner">
  50. <view class="img-box">
  51. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/02f95bd03e854a9c8076aef1e6c05e74.png" mode=""></image>
  52. </view>
  53. <view class="status-box">
  54. <text class="status">交易关闭</text>
  55. <text class="desc">订单已取消</text>
  56. </view>
  57. </view>
  58. <view v-if="order.status == -1" class="inner">
  59. <view class="img-box">
  60. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/6020712aa10f4bb08db92957cb7eb8ed.png" mode=""></image>
  61. </view>
  62. <view class="status-box">
  63. <text class="status">申请售后</text>
  64. <text class="desc">请等待客服审核</text>
  65. </view>
  66. </view>
  67. <view v-if="order.status == -2" class="inner">
  68. <view class="img-box">
  69. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/6020712aa10f4bb08db92957cb7eb8ed.png" mode=""></image>
  70. </view>
  71. <view class="status-box">
  72. <text class="status">退款成功</text>
  73. <text class="desc">已成功退款</text>
  74. </view>
  75. </view>
  76. </view>
  77. <!-- 下单人信息 -->
  78. <view class="order-placer" v-if="order.userName!=null">
  79. <view class="inner">
  80. <image class="location" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/location.png" mode=""></image>
  81. <view class="info">
  82. <view class="name-phone">
  83. <text class="text">{{order.userName}}</text>
  84. <text class="text" v-if="order.userPhone!=null">{{order.userPhone}}</text>
  85. </view>
  86. <view class="address ellipsis2">
  87. {{order.userAddress}}
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="content">
  93. <!-- 药品列表 -->
  94. <view class="goods-list">
  95. <view v-for="(item,index) in items" :key="index" class="item" >
  96. <view class="img-box">
  97. <image :src="JSON.parse(item.jsonInfo).image==''?'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/drug.svg':JSON.parse(item.jsonInfo).image" mode="aspectFill"></image>
  98. </view>
  99. <view class="info-box">
  100. <view>
  101. <view class="name-box ellipsis2">
  102. {{JSON.parse(item.jsonInfo).productName}}
  103. </view>
  104. <view class="spec ellipsis2">{{JSON.parse(item.jsonInfo).sku}}</view>
  105. </view>
  106. <view class="price-num">
  107. <view class="price">
  108. <!-- <text class="unit">¥</text> -->
  109. <!-- <text class="num" v-if="JSON.parse(item.jsonInfo).price!=null">{{JSON.parse(item.jsonInfo).price.toFixed(2)}}</text> -->
  110. </view>
  111. <view class="num" v-if="order.ordetType==1">x{{JSON.parse(item.jsonInfo).num}}</view>
  112. </view>
  113. </view>
  114. </view>
  115. <!-- 已优惠、小计 -->
  116. <view class="sub-total">
  117. <view class="discount">
  118. 订单金额:¥{{order.payPrice }}
  119. </view>
  120. <!-- <text class="label">实付金额:</text>
  121. <view class="price">
  122. <text class="unit">¥</text>
  123. <text class="num">{{order.payMoney}}</text>
  124. </view> -->
  125. </view>
  126. </view>
  127. <!-- 订单信息 -->
  128. <view class="order-info">
  129. <view class="title">订单信息</view>
  130. <view class="item">
  131. <text class="label">订单编号</text>
  132. <view class="sn-box">
  133. <text class="text">{{order.orderCode}}</text>
  134. <view class="copy-btn" @click="copyOrderSn(order.orderCode)">复制</view>
  135. </view>
  136. </view>
  137. <view class="item">
  138. <text class="label">下单时间</text>
  139. <text class="text">{{order.createTime}}</text>
  140. </view>
  141. <view class="item">
  142. <text class="label">支付方式</text>
  143. <text class="text" v-if="order.payType==1">微信支付</text>
  144. <text class="text" v-if="order.payType==2">物流代收</text>
  145. </view>
  146. <view class="item">
  147. <text class="label">订单金额</text>
  148. <text class="text" v-if="order.totalPrice!=null">¥{{order.totalPrice.toFixed(2)}}</text>
  149. </view>
  150. <view class="item">
  151. <text class="label">优惠金额</text>
  152. <text class="text" v-if="order.discountMoney!=null">¥{{order.discountMoney.toFixed(2)}}</text>
  153. </view>
  154. <view class="item">
  155. <text class="label">应付金额</text>
  156. <text class="text" v-if="order.payPrice!=null">¥{{order.payPrice.toFixed(2)}}</text>
  157. </view>
  158. <view class="item">
  159. <text class="label">支付金额</text>
  160. <text class="text" v-if="order.payMoney!=null">¥{{order.payMoney.toFixed(2)}}</text>
  161. </view>
  162. <view class="item">
  163. <text class="label">支付时间</text>
  164. <text class="text" v-if="order.payTime!=null">{{order.payTime}}</text>
  165. </view>
  166. <!-- <view v-if="order.status >1" class="item">
  167. <text class="label">发货时间</text>
  168. <text class="text"></text>
  169. </view> -->
  170. </view>
  171. </view>
  172. </view>
  173. </view>
  174. <!-- 按钮 -->
  175. <view class="btn-box">
  176. <view class="btn pay" v-if="order.deliverySn!=null" @click="showDelivery()">查看物流</view>
  177. </view>
  178. </view>
  179. </template>
  180. <script>
  181. import {getPrescribeById} from '@/api/prescribe.js'
  182. import {getCompanyUserStoreOrderById,cancelOrder,finishOrder} from '@/api/storeOrder'
  183. export default {
  184. data() {
  185. return {
  186. payLimitTime:null,
  187. orderId:null,
  188. order:{},
  189. items:[],
  190. };
  191. },
  192. onLoad(option) {
  193. this.orderId = option.orderId
  194. },
  195. onShow() {
  196. this.getCompanyUserStoreOrderById()
  197. },
  198. methods: {
  199. showPrescribe(){
  200. var data={prescribeId:this.order.prescribeId}
  201. getPrescribeById(this.order.prescribeId).then(
  202. res => {
  203. if(res.code==200){
  204. if(res.data.prescribe.prescribeImgUrl!=null){
  205. var data=[];
  206. data.push(res.data.prescribe.prescribeImgUrl)
  207. uni.previewImage({
  208. current: 0,
  209. urls: data
  210. });
  211. }
  212. else{
  213. uni.showToast({
  214. icon:'none',
  215. title: "电子处方单不存在",
  216. });
  217. }
  218. }
  219. },
  220. err => {
  221. }
  222. );
  223. },
  224. getCompanyUserStoreOrderById(){
  225. var data={orderId:this.orderId};
  226. getCompanyUserStoreOrderById(data).then(res => {
  227. if(res.code==200){
  228. this.order=res.order;
  229. this.items=res.items;
  230. this.payLimitTime=res.payLimitTime;
  231. this.prescribe=res.prescribe;
  232. }else{
  233. uni.showToast({
  234. icon:'none',
  235. title: "请求失败",
  236. });
  237. }
  238. });
  239. },
  240. showDelivery(){
  241. uni.navigateTo({
  242. url: './storeOrderDelivery?orderId='+this.orderId
  243. })
  244. },
  245. cancel(){
  246. var that=this;
  247. uni.showModal({
  248. title: '提示',
  249. content: '确定取消订单吗',
  250. success: function (res) {
  251. if (res.confirm) {
  252. var data = {
  253. orderId:that.order.orderId
  254. };
  255. cancelOrder(data).then(res => {
  256. if(res.code==200){
  257. uni.$emit('refreshStoreOrder');
  258. }else{
  259. uni.showToast({
  260. icon:'none',
  261. title: res.msg,
  262. });
  263. }
  264. });
  265. }
  266. else if (res.cancel) {
  267. }
  268. }
  269. });
  270. },
  271. finish(){
  272. var that=this;
  273. uni.showModal({
  274. title: '提示',
  275. content: '确定已收货吗',
  276. success: function (res) {
  277. if (res.confirm) {
  278. var data = {
  279. orderId:that.orderId
  280. };
  281. finishOrder(data).then(res => {
  282. if(res.code==200){
  283. uni.$emit('refreshStoreOrder');
  284. }else{
  285. uni.showToast({
  286. icon:'none',
  287. title: res.msg,
  288. });
  289. }
  290. });
  291. }
  292. else if (res.cancel) {
  293. }
  294. }
  295. });
  296. },
  297. pay() {
  298. uni.navigateTo({
  299. url: '/pages_order/storeOrderPay?orderId='+this.order.orderId
  300. })
  301. },
  302. payRemain() {
  303. uni.navigateTo({
  304. url: '/pages_user/user/paymentOrderRemain?orderId='+this.order.orderId
  305. })
  306. },
  307. // 复制订单编号
  308. copyOrderSn(text) {
  309. // 复制方法
  310. uni.setClipboardData({
  311. data:text,
  312. success:()=>{
  313. uni.showToast({
  314. title:'内容已成功复制到剪切板',
  315. icon:'none'
  316. })
  317. }
  318. });
  319. },
  320. // 退货
  321. refund() {
  322. uni.navigateTo({
  323. url: '/pages_order/storeOrderRefundApply?orderId='+this.orderId
  324. })
  325. }
  326. }
  327. }
  328. </script>
  329. <style lang="scss">
  330. .cont{
  331. width: 100%;
  332. position: relative;
  333. .bg{
  334. width: 100%;
  335. height: 350upx;
  336. position: absolute;
  337. top: 0;
  338. left: 0;
  339. z-index: 1;
  340. background-color: #2583EB;
  341. background: linear-gradient(#2583EB, #2EDAD4);
  342. border-radius: 0rpx 0rpx 100rpx 100rpx;
  343. }
  344. .inner{
  345. position: relative;
  346. padding: 30upx 0rpx;
  347. width: 100%;
  348. height: 100%;
  349. z-index: 999;
  350. .order-status{
  351. display: flex;
  352. align-items: center;
  353. justify-content: space-between;
  354. padding: 0 30upx;
  355. .inner{
  356. display: flex;
  357. align-items: center;
  358. .img-box{
  359. width: 96upx;
  360. height: 96upx;
  361. margin-right: 30upx;
  362. image{
  363. width: 100%;
  364. height: 100%;
  365. }
  366. }
  367. .status-box{
  368. height: 96upx;
  369. display: flex;
  370. flex-direction: column;
  371. justify-content: center;
  372. .status{
  373. font-size: 40upx;
  374. font-family: PingFang SC;
  375. font-weight: bold;
  376. color: #FFFFFF;
  377. line-height: 1;
  378. }
  379. .desc{
  380. font-size: 26upx;
  381. font-family: PingFang SC;
  382. font-weight: 500;
  383. color: #FFFFFF;
  384. line-height: 1;
  385. margin-top: 30upx;
  386. }
  387. }
  388. }
  389. }
  390. .order-placer{
  391. margin-top: 30upx;
  392. padding: 0 20upx;
  393. .inner{
  394. box-sizing: border-box;
  395. border-radius: 16upx;
  396. height: 150upx;
  397. padding: 40upx 30upx;
  398. display: flex;
  399. align-items: center;
  400. background: #FFFFFF;
  401. .location{
  402. width: 24upx;
  403. height: 27upx;
  404. margin-right: 18upx;
  405. flex-shrink: 0;
  406. }
  407. .info{
  408. .name-phone{
  409. display: flex;
  410. align-items: center;
  411. .text{
  412. font-size: 28upx;
  413. font-family: PingFang SC;
  414. font-weight: bold;
  415. color: #333333;
  416. line-height: 1;
  417. margin-right: 20upx;
  418. &:last-child{
  419. margin-right: 0;
  420. }
  421. }
  422. }
  423. .address{
  424. font-size: 26upx;
  425. font-family: PingFang SC;
  426. font-weight: 500;
  427. color: #999999;
  428. line-height: 1.3;
  429. margin-top: 10upx;
  430. }
  431. }
  432. }
  433. }
  434. }
  435. }
  436. .content{
  437. margin: 20rpx 0rpx;
  438. padding: 0 20upx 140rpx 20upx;
  439. .goods-list{
  440. padding: 0 30upx;
  441. background-color: #FFFFFF;
  442. border-radius: 16upx;
  443. .item{
  444. padding: 30upx 0;
  445. border-bottom: 1px solid #EDEEEF;
  446. display: flex;
  447. align-items: center;
  448. .img-box{
  449. width: 160upx;
  450. height: 160upx;
  451. margin-right: 30upx;
  452. image{
  453. width: 100%;
  454. height: 100%;
  455. }
  456. }
  457. .info-box{
  458. width: calc(100% - 190upx);
  459. height: 160upx;
  460. display: flex;
  461. flex-direction: column;
  462. justify-content: space-between;
  463. .name-box{
  464. font-size: 28upx;
  465. font-family: PingFang SC;
  466. font-weight: 500;
  467. color: #111111;
  468. line-height: 40upx;
  469. .tag{
  470. display: inline-block;
  471. padding: 0 6upx;
  472. height: 30upx;
  473. background: linear-gradient(90deg, #2583EB 0%, #2EDAD4 100%);
  474. border-radius: 4upx;
  475. margin-right: 10upx;
  476. font-size: 22upx;
  477. font-family: PingFang SC;
  478. font-weight: bold;
  479. color: #FFFFFF;
  480. line-height: 30upx;
  481. float: left;
  482. margin-top: 7upx;
  483. }
  484. }
  485. .spec{
  486. margin-top: 18upx;
  487. font-size: 24upx;
  488. font-family: PingFang SC;
  489. font-weight: 500;
  490. color: #999999;
  491. line-height: 1;
  492. }
  493. .price-num{
  494. display: flex;
  495. align-items: center;
  496. justify-content: space-between;
  497. .price{
  498. display: flex;
  499. align-items: flex-end;
  500. .unit{
  501. font-size: 24upx;
  502. font-family: PingFang SC;
  503. font-weight: 500;
  504. color: #111111;
  505. line-height: 1.2;
  506. margin-right: 4upx;
  507. }
  508. .num{
  509. font-size: 32upx;
  510. font-family: PingFang SC;
  511. font-weight: 500;
  512. color: #111111;
  513. line-height: 1;
  514. }
  515. }
  516. .num{
  517. font-size: 24upx;
  518. font-family: PingFang SC;
  519. font-weight: 500;
  520. color: #999999;
  521. line-height: 1;
  522. }
  523. }
  524. }
  525. }
  526. .sub-total{
  527. height: 88upx;
  528. display: flex;
  529. align-items: center;
  530. justify-content: flex-end;
  531. .discount{
  532. font-size: 24upx;
  533. font-family: PingFang SC;
  534. font-weight: 500;
  535. color: #999999;
  536. line-height: 1;
  537. margin-right: 30upx;
  538. }
  539. .label{
  540. font-size: 24upx;
  541. font-family: PingFang SC;
  542. font-weight: 500;
  543. color: #999999;
  544. }
  545. .price{
  546. display: flex;
  547. align-items: flex-end;
  548. .unit{
  549. font-size: 24upx;
  550. font-family: PingFang SC;
  551. font-weight: 500;
  552. color: #FF6633;
  553. line-height: 1.2;
  554. margin-right: 4upx;
  555. }
  556. .num{
  557. font-size: 32upx;
  558. font-family: PingFang SC;
  559. font-weight: bold;
  560. color: #FF6633;
  561. line-height: 1;
  562. }
  563. }
  564. }
  565. }
  566. .order-info{
  567. margin-top: 20upx;
  568. background: #FFFFFF;
  569. border-radius: 16upx;
  570. padding: 40upx 30upx;
  571. .title{
  572. font-size: 30upx;
  573. font-family: PingFang SC;
  574. font-weight: bold;
  575. color: #222222;
  576. line-height: 1;
  577. }
  578. .item{
  579. margin-top: 40upx;
  580. display: flex;
  581. align-items: center;
  582. justify-content: space-between;
  583. .label{
  584. font-size: 26upx;
  585. font-family: PingFang SC;
  586. font-weight: 500;
  587. color: #666666;
  588. line-height: 1;
  589. }
  590. .text{
  591. font-size: 26upx;
  592. font-family: PingFang SC;
  593. font-weight: 500;
  594. color: #222222;
  595. line-height: 32upx;
  596. }
  597. .cont-text{
  598. font-size: 26upx;
  599. font-family: PingFang SC;
  600. font-weight: 500;
  601. color: #666666;
  602. .bold{
  603. color: #111111;
  604. }
  605. }
  606. .sn-box{
  607. display: flex;
  608. align-items: center;
  609. .copy-btn{
  610. width: 58upx;
  611. height: 32upx;
  612. line-height: 32upx;
  613. text-align: center;
  614. font-size: 22upx;
  615. font-family: PingFang SC;
  616. font-weight: 500;
  617. color: #222222;
  618. background: #F5F5F5;
  619. border-radius: 4upx;
  620. margin-left: 24upx;
  621. }
  622. }
  623. .check-box{
  624. display: flex;
  625. align-items: center;
  626. image{
  627. width: 14upx;
  628. height: 24upx;
  629. margin-left: 10upx;
  630. }
  631. }
  632. }
  633. .line{
  634. width: 100%;
  635. height: 1px;
  636. background: #F0F0F0;
  637. margin-top: 30upx;
  638. }
  639. }
  640. }
  641. .btn-box{
  642. z-index: 999;
  643. bottom: 0;
  644. width: 100%;
  645. position: fixed;
  646. height: 120upx;
  647. box-sizing: border-box;
  648. background: #FFFFFF;
  649. padding: 0 30upx;
  650. display: flex;
  651. align-items: center;
  652. justify-content: flex-end;
  653. .btn{
  654. position: relative;
  655. width: 155upx;
  656. height: 64upx;
  657. line-height: 64upx;
  658. font-size: 26upx;
  659. font-family: PingFang SC;
  660. font-weight: 500;
  661. text-align: center;
  662. border-radius: 32upx;
  663. margin-left: 15upx;
  664. &.cancel{
  665. border: 1px solid #DDDDDD;
  666. color: #666666;
  667. }
  668. &.pay{
  669. background: #2583EB;
  670. color: #FFFFFF;
  671. }
  672. .contact-btn {
  673. top: 0;
  674. position: absolute;
  675. width:100%;
  676. height:100%;
  677. opacity: 0;
  678. }
  679. }
  680. }
  681. </style>