storeOrderDetail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  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://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/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://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/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://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/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://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/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://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/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://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/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://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/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="/static/images/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==''?'/static/images/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(data).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: '/pages/store/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. that.getMyStoreOrderById()
  258. uni.$emit('refreshStoreOrder');
  259. }else{
  260. uni.showToast({
  261. icon:'none',
  262. title: res.msg,
  263. });
  264. }
  265. });
  266. }
  267. else if (res.cancel) {
  268. }
  269. }
  270. });
  271. },
  272. finish(){
  273. var that=this;
  274. uni.showModal({
  275. title: '提示',
  276. content: '确定已收货吗',
  277. success: function (res) {
  278. if (res.confirm) {
  279. var data = {
  280. orderId:that.orderId
  281. };
  282. finishOrder(data).then(res => {
  283. if(res.code==200){
  284. that.getMyStoreOrderById()
  285. uni.$emit('refreshStoreOrder');
  286. }else{
  287. uni.showToast({
  288. icon:'none',
  289. title: res.msg,
  290. });
  291. }
  292. });
  293. }
  294. else if (res.cancel) {
  295. }
  296. }
  297. });
  298. },
  299. pay() {
  300. uni.navigateTo({
  301. url: '/pages_order/storeOrderPay?orderId='+this.order.orderId
  302. })
  303. },
  304. payRemain() {
  305. uni.navigateTo({
  306. url: '/pages_user/user/paymentOrderRemain?orderId='+this.order.orderId
  307. })
  308. },
  309. // 复制订单编号
  310. copyOrderSn(text) {
  311. // 复制方法
  312. uni.setClipboardData({
  313. data:text,
  314. success:()=>{
  315. uni.showToast({
  316. title:'内容已成功复制到剪切板',
  317. icon:'none'
  318. })
  319. }
  320. });
  321. },
  322. }
  323. }
  324. </script>
  325. <style lang="scss">
  326. .cont{
  327. width: 100%;
  328. position: relative;
  329. .bg{
  330. width: 100%;
  331. height: 350upx;
  332. position: absolute;
  333. top: 0;
  334. left: 0;
  335. z-index: 1;
  336. background-color: #FF5C03;
  337. background: linear-gradient(#FF5C03, #E2C99E);
  338. border-radius: 0rpx 0rpx 100rpx 100rpx;
  339. }
  340. .inner{
  341. position: relative;
  342. padding: 30upx 0rpx;
  343. width: 100%;
  344. height: 100%;
  345. z-index: 999;
  346. .order-status{
  347. display: flex;
  348. align-items: center;
  349. justify-content: space-between;
  350. padding: 0 30upx;
  351. .inner{
  352. display: flex;
  353. align-items: center;
  354. .img-box{
  355. width: 96upx;
  356. height: 96upx;
  357. margin-right: 30upx;
  358. image{
  359. width: 100%;
  360. height: 100%;
  361. }
  362. }
  363. .status-box{
  364. height: 96upx;
  365. display: flex;
  366. flex-direction: column;
  367. justify-content: center;
  368. .status{
  369. font-size: 40upx;
  370. font-family: PingFang SC;
  371. font-weight: bold;
  372. color: #FFFFFF;
  373. line-height: 1;
  374. }
  375. .desc{
  376. font-size: 26upx;
  377. font-family: PingFang SC;
  378. font-weight: 500;
  379. color: #FFFFFF;
  380. line-height: 1;
  381. margin-top: 30upx;
  382. }
  383. }
  384. }
  385. }
  386. .order-placer{
  387. margin-top: 30upx;
  388. padding: 0 20upx;
  389. .inner{
  390. box-sizing: border-box;
  391. border-radius: 16upx;
  392. height: 150upx;
  393. padding: 40upx 30upx;
  394. display: flex;
  395. align-items: center;
  396. background: #FFFFFF;
  397. .location{
  398. width: 24upx;
  399. height: 27upx;
  400. margin-right: 18upx;
  401. flex-shrink: 0;
  402. }
  403. .info{
  404. .name-phone{
  405. display: flex;
  406. align-items: center;
  407. .text{
  408. font-size: 28upx;
  409. font-family: PingFang SC;
  410. font-weight: bold;
  411. color: #333333;
  412. line-height: 1;
  413. margin-right: 20upx;
  414. &:last-child{
  415. margin-right: 0;
  416. }
  417. }
  418. }
  419. .address{
  420. font-size: 26upx;
  421. font-family: PingFang SC;
  422. font-weight: 500;
  423. color: #999999;
  424. line-height: 1.3;
  425. margin-top: 10upx;
  426. }
  427. }
  428. }
  429. }
  430. }
  431. }
  432. .content{
  433. margin: 20rpx 0rpx;
  434. padding: 0 20upx 140rpx 20upx;
  435. .goods-list{
  436. padding: 0 30upx;
  437. background-color: #FFFFFF;
  438. border-radius: 16upx;
  439. .item{
  440. padding: 30upx 0;
  441. border-bottom: 1px solid #EDEEEF;
  442. display: flex;
  443. align-items: center;
  444. .img-box{
  445. width: 160upx;
  446. height: 160upx;
  447. margin-right: 30upx;
  448. image{
  449. width: 100%;
  450. height: 100%;
  451. }
  452. }
  453. .info-box{
  454. width: calc(100% - 190upx);
  455. height: 160upx;
  456. display: flex;
  457. flex-direction: column;
  458. justify-content: space-between;
  459. .name-box{
  460. font-size: 28upx;
  461. font-family: PingFang SC;
  462. font-weight: 500;
  463. color: #111111;
  464. line-height: 40upx;
  465. .tag{
  466. display: inline-block;
  467. padding: 0 6upx;
  468. height: 30upx;
  469. background: linear-gradient(90deg, #C39A58 0%, #E2C99E 100%);
  470. border-radius: 4upx;
  471. margin-right: 10upx;
  472. font-size: 22upx;
  473. font-family: PingFang SC;
  474. font-weight: bold;
  475. color: #FFFFFF;
  476. line-height: 30upx;
  477. float: left;
  478. margin-top: 7upx;
  479. }
  480. }
  481. .spec{
  482. margin-top: 18upx;
  483. font-size: 24upx;
  484. font-family: PingFang SC;
  485. font-weight: 500;
  486. color: #999999;
  487. line-height: 1;
  488. }
  489. .price-num{
  490. display: flex;
  491. align-items: center;
  492. justify-content: space-between;
  493. .price{
  494. display: flex;
  495. align-items: flex-end;
  496. .unit{
  497. font-size: 24upx;
  498. font-family: PingFang SC;
  499. font-weight: 500;
  500. color: #111111;
  501. line-height: 1.2;
  502. margin-right: 4upx;
  503. }
  504. .num{
  505. font-size: 32upx;
  506. font-family: PingFang SC;
  507. font-weight: 500;
  508. color: #111111;
  509. line-height: 1;
  510. }
  511. }
  512. .num{
  513. font-size: 24upx;
  514. font-family: PingFang SC;
  515. font-weight: 500;
  516. color: #999999;
  517. line-height: 1;
  518. }
  519. }
  520. }
  521. }
  522. .sub-total{
  523. height: 88upx;
  524. display: flex;
  525. align-items: center;
  526. justify-content: flex-end;
  527. .discount{
  528. font-size: 24upx;
  529. font-family: PingFang SC;
  530. font-weight: 500;
  531. color: #999999;
  532. line-height: 1;
  533. margin-right: 30upx;
  534. }
  535. .label{
  536. font-size: 24upx;
  537. font-family: PingFang SC;
  538. font-weight: 500;
  539. color: #999999;
  540. }
  541. .price{
  542. display: flex;
  543. align-items: flex-end;
  544. .unit{
  545. font-size: 24upx;
  546. font-family: PingFang SC;
  547. font-weight: 500;
  548. color: #FF6633;
  549. line-height: 1.2;
  550. margin-right: 4upx;
  551. }
  552. .num{
  553. font-size: 32upx;
  554. font-family: PingFang SC;
  555. font-weight: bold;
  556. color: #FF6633;
  557. line-height: 1;
  558. }
  559. }
  560. }
  561. }
  562. .order-info{
  563. margin-top: 20upx;
  564. background: #FFFFFF;
  565. border-radius: 16upx;
  566. padding: 40upx 30upx;
  567. .title{
  568. font-size: 30upx;
  569. font-family: PingFang SC;
  570. font-weight: bold;
  571. color: #222222;
  572. line-height: 1;
  573. }
  574. .item{
  575. margin-top: 40upx;
  576. display: flex;
  577. align-items: center;
  578. justify-content: space-between;
  579. .label{
  580. font-size: 26upx;
  581. font-family: PingFang SC;
  582. font-weight: 500;
  583. color: #666666;
  584. line-height: 1;
  585. }
  586. .text{
  587. font-size: 26upx;
  588. font-family: PingFang SC;
  589. font-weight: 500;
  590. color: #222222;
  591. line-height: 32upx;
  592. }
  593. .cont-text{
  594. font-size: 26upx;
  595. font-family: PingFang SC;
  596. font-weight: 500;
  597. color: #666666;
  598. .bold{
  599. color: #111111;
  600. }
  601. }
  602. .sn-box{
  603. display: flex;
  604. align-items: center;
  605. .copy-btn{
  606. width: 58upx;
  607. height: 32upx;
  608. line-height: 32upx;
  609. text-align: center;
  610. font-size: 22upx;
  611. font-family: PingFang SC;
  612. font-weight: 500;
  613. color: #222222;
  614. background: #F5F5F5;
  615. border-radius: 4upx;
  616. margin-left: 24upx;
  617. }
  618. }
  619. .check-box{
  620. display: flex;
  621. align-items: center;
  622. image{
  623. width: 14upx;
  624. height: 24upx;
  625. margin-left: 10upx;
  626. }
  627. }
  628. }
  629. .line{
  630. width: 100%;
  631. height: 1px;
  632. background: #F0F0F0;
  633. margin-top: 30upx;
  634. }
  635. }
  636. }
  637. .btn-box{
  638. z-index: 999;
  639. bottom: 0;
  640. width: 100%;
  641. position: fixed;
  642. height: 120upx;
  643. box-sizing: border-box;
  644. background: #FFFFFF;
  645. padding: 0 30upx;
  646. display: flex;
  647. align-items: center;
  648. justify-content: flex-end;
  649. .btn{
  650. position: relative;
  651. width: 155upx;
  652. height: 64upx;
  653. line-height: 64upx;
  654. font-size: 26upx;
  655. font-family: PingFang SC;
  656. font-weight: 500;
  657. text-align: center;
  658. border-radius: 32upx;
  659. margin-left: 15upx;
  660. &.cancel{
  661. border: 1px solid #DDDDDD;
  662. color: #666666;
  663. }
  664. &.pay{
  665. background: #FF5C03;
  666. color: #FFFFFF;
  667. }
  668. .contact-btn {
  669. top: 0;
  670. position: absolute;
  671. width:100%;
  672. height:100%;
  673. opacity: 0;
  674. }
  675. }
  676. }
  677. </style>