storeOrderDetail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  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: './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. refund() {
  324. uni.navigateTo({
  325. url: '/pages_order/storeOrderRefundApply?orderId='+this.orderId
  326. })
  327. }
  328. }
  329. }
  330. </script>
  331. <style lang="scss">
  332. .cont{
  333. width: 100%;
  334. position: relative;
  335. .bg{
  336. width: 100%;
  337. height: 350upx;
  338. position: absolute;
  339. top: 0;
  340. left: 0;
  341. z-index: 1;
  342. background-color: #C39A58;
  343. background: linear-gradient(#C39A58, #E2C99E);
  344. border-radius: 0rpx 0rpx 100rpx 100rpx;
  345. }
  346. .inner{
  347. position: relative;
  348. padding: 30upx 0rpx;
  349. width: 100%;
  350. height: 100%;
  351. z-index: 999;
  352. .order-status{
  353. display: flex;
  354. align-items: center;
  355. justify-content: space-between;
  356. padding: 0 30upx;
  357. .inner{
  358. display: flex;
  359. align-items: center;
  360. .img-box{
  361. width: 96upx;
  362. height: 96upx;
  363. margin-right: 30upx;
  364. image{
  365. width: 100%;
  366. height: 100%;
  367. }
  368. }
  369. .status-box{
  370. height: 96upx;
  371. display: flex;
  372. flex-direction: column;
  373. justify-content: center;
  374. .status{
  375. font-size: 40upx;
  376. font-family: PingFang SC;
  377. font-weight: bold;
  378. color: #FFFFFF;
  379. line-height: 1;
  380. }
  381. .desc{
  382. font-size: 26upx;
  383. font-family: PingFang SC;
  384. font-weight: 500;
  385. color: #FFFFFF;
  386. line-height: 1;
  387. margin-top: 30upx;
  388. }
  389. }
  390. }
  391. }
  392. .order-placer{
  393. margin-top: 30upx;
  394. padding: 0 20upx;
  395. .inner{
  396. box-sizing: border-box;
  397. border-radius: 16upx;
  398. height: 150upx;
  399. padding: 40upx 30upx;
  400. display: flex;
  401. align-items: center;
  402. background: #FFFFFF;
  403. .location{
  404. width: 24upx;
  405. height: 27upx;
  406. margin-right: 18upx;
  407. flex-shrink: 0;
  408. }
  409. .info{
  410. .name-phone{
  411. display: flex;
  412. align-items: center;
  413. .text{
  414. font-size: 28upx;
  415. font-family: PingFang SC;
  416. font-weight: bold;
  417. color: #333333;
  418. line-height: 1;
  419. margin-right: 20upx;
  420. &:last-child{
  421. margin-right: 0;
  422. }
  423. }
  424. }
  425. .address{
  426. font-size: 26upx;
  427. font-family: PingFang SC;
  428. font-weight: 500;
  429. color: #999999;
  430. line-height: 1.3;
  431. margin-top: 10upx;
  432. }
  433. }
  434. }
  435. }
  436. }
  437. }
  438. .content{
  439. margin: 20rpx 0rpx;
  440. padding: 0 20upx 140rpx 20upx;
  441. .goods-list{
  442. padding: 0 30upx;
  443. background-color: #FFFFFF;
  444. border-radius: 16upx;
  445. .item{
  446. padding: 30upx 0;
  447. border-bottom: 1px solid #EDEEEF;
  448. display: flex;
  449. align-items: center;
  450. .img-box{
  451. width: 160upx;
  452. height: 160upx;
  453. margin-right: 30upx;
  454. image{
  455. width: 100%;
  456. height: 100%;
  457. }
  458. }
  459. .info-box{
  460. width: calc(100% - 190upx);
  461. height: 160upx;
  462. display: flex;
  463. flex-direction: column;
  464. justify-content: space-between;
  465. .name-box{
  466. font-size: 28upx;
  467. font-family: PingFang SC;
  468. font-weight: 500;
  469. color: #111111;
  470. line-height: 40upx;
  471. .tag{
  472. display: inline-block;
  473. padding: 0 6upx;
  474. height: 30upx;
  475. background: linear-gradient(90deg, #C39A58 0%, #E2C99E 100%);
  476. border-radius: 4upx;
  477. margin-right: 10upx;
  478. font-size: 22upx;
  479. font-family: PingFang SC;
  480. font-weight: bold;
  481. color: #FFFFFF;
  482. line-height: 30upx;
  483. float: left;
  484. margin-top: 7upx;
  485. }
  486. }
  487. .spec{
  488. margin-top: 18upx;
  489. font-size: 24upx;
  490. font-family: PingFang SC;
  491. font-weight: 500;
  492. color: #999999;
  493. line-height: 1;
  494. }
  495. .price-num{
  496. display: flex;
  497. align-items: center;
  498. justify-content: space-between;
  499. .price{
  500. display: flex;
  501. align-items: flex-end;
  502. .unit{
  503. font-size: 24upx;
  504. font-family: PingFang SC;
  505. font-weight: 500;
  506. color: #111111;
  507. line-height: 1.2;
  508. margin-right: 4upx;
  509. }
  510. .num{
  511. font-size: 32upx;
  512. font-family: PingFang SC;
  513. font-weight: 500;
  514. color: #111111;
  515. line-height: 1;
  516. }
  517. }
  518. .num{
  519. font-size: 24upx;
  520. font-family: PingFang SC;
  521. font-weight: 500;
  522. color: #999999;
  523. line-height: 1;
  524. }
  525. }
  526. }
  527. }
  528. .sub-total{
  529. height: 88upx;
  530. display: flex;
  531. align-items: center;
  532. justify-content: flex-end;
  533. .discount{
  534. font-size: 24upx;
  535. font-family: PingFang SC;
  536. font-weight: 500;
  537. color: #999999;
  538. line-height: 1;
  539. margin-right: 30upx;
  540. }
  541. .label{
  542. font-size: 24upx;
  543. font-family: PingFang SC;
  544. font-weight: 500;
  545. color: #999999;
  546. }
  547. .price{
  548. display: flex;
  549. align-items: flex-end;
  550. .unit{
  551. font-size: 24upx;
  552. font-family: PingFang SC;
  553. font-weight: 500;
  554. color: #FF6633;
  555. line-height: 1.2;
  556. margin-right: 4upx;
  557. }
  558. .num{
  559. font-size: 32upx;
  560. font-family: PingFang SC;
  561. font-weight: bold;
  562. color: #FF6633;
  563. line-height: 1;
  564. }
  565. }
  566. }
  567. }
  568. .order-info{
  569. margin-top: 20upx;
  570. background: #FFFFFF;
  571. border-radius: 16upx;
  572. padding: 40upx 30upx;
  573. .title{
  574. font-size: 30upx;
  575. font-family: PingFang SC;
  576. font-weight: bold;
  577. color: #222222;
  578. line-height: 1;
  579. }
  580. .item{
  581. margin-top: 40upx;
  582. display: flex;
  583. align-items: center;
  584. justify-content: space-between;
  585. .label{
  586. font-size: 26upx;
  587. font-family: PingFang SC;
  588. font-weight: 500;
  589. color: #666666;
  590. line-height: 1;
  591. }
  592. .text{
  593. font-size: 26upx;
  594. font-family: PingFang SC;
  595. font-weight: 500;
  596. color: #222222;
  597. line-height: 32upx;
  598. }
  599. .cont-text{
  600. font-size: 26upx;
  601. font-family: PingFang SC;
  602. font-weight: 500;
  603. color: #666666;
  604. .bold{
  605. color: #111111;
  606. }
  607. }
  608. .sn-box{
  609. display: flex;
  610. align-items: center;
  611. .copy-btn{
  612. width: 58upx;
  613. height: 32upx;
  614. line-height: 32upx;
  615. text-align: center;
  616. font-size: 22upx;
  617. font-family: PingFang SC;
  618. font-weight: 500;
  619. color: #222222;
  620. background: #F5F5F5;
  621. border-radius: 4upx;
  622. margin-left: 24upx;
  623. }
  624. }
  625. .check-box{
  626. display: flex;
  627. align-items: center;
  628. image{
  629. width: 14upx;
  630. height: 24upx;
  631. margin-left: 10upx;
  632. }
  633. }
  634. }
  635. .line{
  636. width: 100%;
  637. height: 1px;
  638. background: #F0F0F0;
  639. margin-top: 30upx;
  640. }
  641. }
  642. }
  643. .btn-box{
  644. z-index: 999;
  645. bottom: 0;
  646. width: 100%;
  647. position: fixed;
  648. height: 120upx;
  649. box-sizing: border-box;
  650. background: #FFFFFF;
  651. padding: 0 30upx;
  652. display: flex;
  653. align-items: center;
  654. justify-content: flex-end;
  655. .btn{
  656. position: relative;
  657. width: 155upx;
  658. height: 64upx;
  659. line-height: 64upx;
  660. font-size: 26upx;
  661. font-family: PingFang SC;
  662. font-weight: 500;
  663. text-align: center;
  664. border-radius: 32upx;
  665. margin-left: 15upx;
  666. &.cancel{
  667. border: 1px solid #DDDDDD;
  668. color: #666666;
  669. }
  670. &.pay{
  671. background: #C39A58;
  672. color: #FFFFFF;
  673. }
  674. .contact-btn {
  675. top: 0;
  676. position: absolute;
  677. width:100%;
  678. height:100%;
  679. opacity: 0;
  680. }
  681. }
  682. }
  683. </style>