storeOrderDetail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  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">请等待客服审核,您的退款将在2-5个工作日内原路退回</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 cancel">
  177. 联系客服
  178. <button class='contact-btn' open-type="contact">
  179. </button>
  180. </view>
  181. <view class="btn cancel" v-if="order.status==1" @click="cancel()">取消订单</view>
  182. <view class="btn pay" v-if="order.status==1" @click="pay()">支付</view>
  183. <!-- <view class="btn pay" v-if="order.status>1&&order.prescribeId!=null&&order.prescribeId>0" @click="showPrescribe()">查看处方单</view> -->
  184. <view class="btn cancel" v-if="order.status>1&&order.isAfterSales==1&&order.orderType==1" @click="refund()">申请售后</view>
  185. <view class="btn pay" v-if="order.deliverySn!=null" @click="showDelivery()">查看物流</view>
  186. <view class="btn pay" v-if="order.status==3" @click="finish()">确认收货</view>
  187. </view>
  188. </view>
  189. </template>
  190. <script>
  191. import {getPrescribeById} from '@/api/prescribe.js'
  192. import {getMyStoreOrderById,cancelOrder,finishOrder} from '@/api/storeOrder'
  193. export default {
  194. data() {
  195. return {
  196. payLimitTime:null,
  197. orderId:null,
  198. order:{},
  199. items:[],
  200. };
  201. },
  202. onLoad(option) {
  203. this.orderId = option.orderId
  204. },
  205. onShow() {
  206. this.getMyStoreOrderById()
  207. },
  208. methods: {
  209. showPrescribe(){
  210. var data={prescribeId:this.order.prescribeId}
  211. getPrescribeById(data).then(
  212. res => {
  213. if(res.code==200){
  214. if(res.data.prescribe.prescribeImgUrl!=null){
  215. var data=[];
  216. data.push(res.data.prescribe.prescribeImgUrl)
  217. uni.previewImage({
  218. current: 0,
  219. urls: data
  220. });
  221. }
  222. else{
  223. uni.showToast({
  224. icon:'none',
  225. title: "电子处方单不存在",
  226. });
  227. }
  228. }
  229. },
  230. err => {
  231. }
  232. );
  233. },
  234. getMyStoreOrderById(){
  235. var data={orderId:this.orderId};
  236. getMyStoreOrderById(data).then(res => {
  237. if(res.code==200){
  238. this.order=res.order;
  239. this.items=res.items;
  240. this.payLimitTime=res.payLimitTime;
  241. this.prescribe=res.prescribe;
  242. }else{
  243. uni.showToast({
  244. icon:'none',
  245. title: "请求失败",
  246. });
  247. }
  248. });
  249. },
  250. showDelivery(){
  251. uni.navigateTo({
  252. url: './storeOrderDelivery?orderId='+this.orderId
  253. })
  254. },
  255. cancel(){
  256. var that=this;
  257. uni.showModal({
  258. title: '提示',
  259. content: '确定取消订单吗',
  260. success: function (res) {
  261. if (res.confirm) {
  262. var data = {
  263. orderId:that.order.orderId
  264. };
  265. cancelOrder(data).then(res => {
  266. if(res.code==200){
  267. that.getMyStoreOrderById()
  268. uni.$emit('refreshStoreOrder');
  269. }else{
  270. uni.showToast({
  271. icon:'none',
  272. title: res.msg,
  273. });
  274. }
  275. });
  276. }
  277. else if (res.cancel) {
  278. }
  279. }
  280. });
  281. },
  282. finish(){
  283. var that=this;
  284. uni.showModal({
  285. title: '提示',
  286. content: '确定已收货吗',
  287. success: function (res) {
  288. if (res.confirm) {
  289. var data = {
  290. orderId:that.orderId
  291. };
  292. finishOrder(data).then(res => {
  293. if(res.code==200){
  294. that.getMyStoreOrderById()
  295. uni.$emit('refreshStoreOrder');
  296. }else{
  297. uni.showToast({
  298. icon:'none',
  299. title: res.msg,
  300. });
  301. }
  302. });
  303. }
  304. else if (res.cancel) {
  305. }
  306. }
  307. });
  308. },
  309. pay() {
  310. uni.navigateTo({
  311. url: '/pages_order/storeOrderPay?orderId='+this.order.orderId
  312. })
  313. },
  314. payRemain() {
  315. uni.navigateTo({
  316. url: '/pages_user/user/paymentOrderRemain?orderId='+this.order.orderId
  317. })
  318. },
  319. // 复制订单编号
  320. copyOrderSn(text) {
  321. // 复制方法
  322. uni.setClipboardData({
  323. data:text,
  324. success:()=>{
  325. uni.showToast({
  326. title:'内容已成功复制到剪切板',
  327. icon:'none'
  328. })
  329. }
  330. });
  331. },
  332. // 退货
  333. refund() {
  334. uni.navigateTo({
  335. url: '/pages_order/storeOrderRefundApply?orderId='+this.orderId
  336. })
  337. }
  338. }
  339. }
  340. </script>
  341. <style lang="scss">
  342. .cont{
  343. width: 100%;
  344. position: relative;
  345. .bg{
  346. width: 100%;
  347. height: 350upx;
  348. position: absolute;
  349. top: 0;
  350. left: 0;
  351. z-index: 1;
  352. background-color: #C39A58;
  353. background: linear-gradient(#C39A58, #E2C99E);
  354. border-radius: 0rpx 0rpx 100rpx 100rpx;
  355. }
  356. .inner{
  357. position: relative;
  358. padding: 30upx 0rpx;
  359. width: 100%;
  360. height: 100%;
  361. z-index: 999;
  362. .order-status{
  363. display: flex;
  364. align-items: center;
  365. justify-content: space-between;
  366. padding: 0 30upx;
  367. .inner{
  368. display: flex;
  369. align-items: center;
  370. .img-box{
  371. width: 96upx;
  372. height: 96upx;
  373. margin-right: 30upx;
  374. image{
  375. width: 100%;
  376. height: 100%;
  377. }
  378. }
  379. .status-box{
  380. height: 96upx;
  381. display: flex;
  382. flex-direction: column;
  383. justify-content: center;
  384. .status{
  385. font-size: 40upx;
  386. font-family: PingFang SC;
  387. font-weight: bold;
  388. color: #FFFFFF;
  389. line-height: 1;
  390. }
  391. .desc{
  392. font-size: 26upx;
  393. font-family: PingFang SC;
  394. font-weight: 500;
  395. color: #FFFFFF;
  396. line-height: 1;
  397. margin-top: 30upx;
  398. }
  399. }
  400. }
  401. }
  402. .order-placer{
  403. margin-top: 30upx;
  404. padding: 0 20upx;
  405. .inner{
  406. box-sizing: border-box;
  407. border-radius: 16upx;
  408. height: 150upx;
  409. padding: 40upx 30upx;
  410. display: flex;
  411. align-items: center;
  412. background: #FFFFFF;
  413. .location{
  414. width: 24upx;
  415. height: 27upx;
  416. margin-right: 18upx;
  417. flex-shrink: 0;
  418. }
  419. .info{
  420. .name-phone{
  421. display: flex;
  422. align-items: center;
  423. .text{
  424. font-size: 28upx;
  425. font-family: PingFang SC;
  426. font-weight: bold;
  427. color: #333333;
  428. line-height: 1;
  429. margin-right: 20upx;
  430. &:last-child{
  431. margin-right: 0;
  432. }
  433. }
  434. }
  435. .address{
  436. font-size: 26upx;
  437. font-family: PingFang SC;
  438. font-weight: 500;
  439. color: #999999;
  440. line-height: 1.3;
  441. margin-top: 10upx;
  442. }
  443. }
  444. }
  445. }
  446. }
  447. }
  448. .content{
  449. margin: 20rpx 0rpx;
  450. padding: 0 20upx 140rpx 20upx;
  451. .goods-list{
  452. padding: 0 30upx;
  453. background-color: #FFFFFF;
  454. border-radius: 16upx;
  455. .item{
  456. padding: 30upx 0;
  457. border-bottom: 1px solid #EDEEEF;
  458. display: flex;
  459. align-items: center;
  460. .img-box{
  461. width: 160upx;
  462. height: 160upx;
  463. margin-right: 30upx;
  464. image{
  465. width: 100%;
  466. height: 100%;
  467. }
  468. }
  469. .info-box{
  470. width: calc(100% - 190upx);
  471. height: 160upx;
  472. display: flex;
  473. flex-direction: column;
  474. justify-content: space-between;
  475. .name-box{
  476. font-size: 28upx;
  477. font-family: PingFang SC;
  478. font-weight: 500;
  479. color: #111111;
  480. line-height: 40upx;
  481. .tag{
  482. display: inline-block;
  483. padding: 0 6upx;
  484. height: 30upx;
  485. background: linear-gradient(90deg, #C39A58 0%, #E2C99E 100%);
  486. border-radius: 4upx;
  487. margin-right: 10upx;
  488. font-size: 22upx;
  489. font-family: PingFang SC;
  490. font-weight: bold;
  491. color: #FFFFFF;
  492. line-height: 30upx;
  493. float: left;
  494. margin-top: 7upx;
  495. }
  496. }
  497. .spec{
  498. margin-top: 18upx;
  499. font-size: 24upx;
  500. font-family: PingFang SC;
  501. font-weight: 500;
  502. color: #999999;
  503. line-height: 1;
  504. }
  505. .price-num{
  506. display: flex;
  507. align-items: center;
  508. justify-content: space-between;
  509. .price{
  510. display: flex;
  511. align-items: flex-end;
  512. .unit{
  513. font-size: 24upx;
  514. font-family: PingFang SC;
  515. font-weight: 500;
  516. color: #111111;
  517. line-height: 1.2;
  518. margin-right: 4upx;
  519. }
  520. .num{
  521. font-size: 32upx;
  522. font-family: PingFang SC;
  523. font-weight: 500;
  524. color: #111111;
  525. line-height: 1;
  526. }
  527. }
  528. .num{
  529. font-size: 24upx;
  530. font-family: PingFang SC;
  531. font-weight: 500;
  532. color: #999999;
  533. line-height: 1;
  534. }
  535. }
  536. }
  537. }
  538. .sub-total{
  539. height: 88upx;
  540. display: flex;
  541. align-items: center;
  542. justify-content: flex-end;
  543. .discount{
  544. font-size: 24upx;
  545. font-family: PingFang SC;
  546. font-weight: 500;
  547. color: #999999;
  548. line-height: 1;
  549. margin-right: 30upx;
  550. }
  551. .label{
  552. font-size: 24upx;
  553. font-family: PingFang SC;
  554. font-weight: 500;
  555. color: #999999;
  556. }
  557. .price{
  558. display: flex;
  559. align-items: flex-end;
  560. .unit{
  561. font-size: 24upx;
  562. font-family: PingFang SC;
  563. font-weight: 500;
  564. color: #FF6633;
  565. line-height: 1.2;
  566. margin-right: 4upx;
  567. }
  568. .num{
  569. font-size: 32upx;
  570. font-family: PingFang SC;
  571. font-weight: bold;
  572. color: #FF6633;
  573. line-height: 1;
  574. }
  575. }
  576. }
  577. }
  578. .order-info{
  579. margin-top: 20upx;
  580. background: #FFFFFF;
  581. border-radius: 16upx;
  582. padding: 40upx 30upx;
  583. .title{
  584. font-size: 30upx;
  585. font-family: PingFang SC;
  586. font-weight: bold;
  587. color: #222222;
  588. line-height: 1;
  589. }
  590. .item{
  591. margin-top: 40upx;
  592. display: flex;
  593. align-items: center;
  594. justify-content: space-between;
  595. .label{
  596. font-size: 26upx;
  597. font-family: PingFang SC;
  598. font-weight: 500;
  599. color: #666666;
  600. line-height: 1;
  601. }
  602. .text{
  603. font-size: 26upx;
  604. font-family: PingFang SC;
  605. font-weight: 500;
  606. color: #222222;
  607. line-height: 32upx;
  608. }
  609. .cont-text{
  610. font-size: 26upx;
  611. font-family: PingFang SC;
  612. font-weight: 500;
  613. color: #666666;
  614. .bold{
  615. color: #111111;
  616. }
  617. }
  618. .sn-box{
  619. display: flex;
  620. align-items: center;
  621. .copy-btn{
  622. width: 58upx;
  623. height: 32upx;
  624. line-height: 32upx;
  625. text-align: center;
  626. font-size: 22upx;
  627. font-family: PingFang SC;
  628. font-weight: 500;
  629. color: #222222;
  630. background: #F5F5F5;
  631. border-radius: 4upx;
  632. margin-left: 24upx;
  633. }
  634. }
  635. .check-box{
  636. display: flex;
  637. align-items: center;
  638. image{
  639. width: 14upx;
  640. height: 24upx;
  641. margin-left: 10upx;
  642. }
  643. }
  644. }
  645. .line{
  646. width: 100%;
  647. height: 1px;
  648. background: #F0F0F0;
  649. margin-top: 30upx;
  650. }
  651. }
  652. }
  653. .btn-box{
  654. z-index: 999;
  655. bottom: 0;
  656. width: 100%;
  657. position: fixed;
  658. height: 120upx;
  659. box-sizing: border-box;
  660. background: #FFFFFF;
  661. padding: 0 30upx;
  662. display: flex;
  663. align-items: center;
  664. justify-content: flex-end;
  665. .btn{
  666. position: relative;
  667. width: 155upx;
  668. height: 64upx;
  669. line-height: 64upx;
  670. font-size: 26upx;
  671. font-family: PingFang SC;
  672. font-weight: 500;
  673. text-align: center;
  674. border-radius: 32upx;
  675. margin-left: 15upx;
  676. &.cancel{
  677. border: 1px solid #DDDDDD;
  678. color: #666666;
  679. }
  680. &.pay{
  681. background: #C39A58;
  682. color: #FFFFFF;
  683. }
  684. .contact-btn {
  685. top: 0;
  686. position: absolute;
  687. width:100%;
  688. height:100%;
  689. opacity: 0;
  690. }
  691. }
  692. }
  693. </style>