packageOrderDetails.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  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/b71efb4b5ca54564b553569d578738b4.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/0712ba14f3a648afa69c9912fcbf9b61.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 == -1" class="inner">
  40. <view class="img-box">
  41. <image src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/02f95bd03e854a9c8076aef1e6c05e74.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. <view v-if="order.status == -2" class="inner">
  49. <view class="img-box">
  50. <image src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/6020712aa10f4bb08db92957cb7eb8ed.png" mode=""></image>
  51. </view>
  52. <view class="status-box">
  53. <text class="status">退款成功</text>
  54. <text class="desc">已成功退款</text>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="content">
  59. <view class="package-box">
  60. <view class="left">
  61. <image :src="package.imgUrl"></image>
  62. </view>
  63. <view class="right">
  64. <view class="title">{{package.packageName}}</view>
  65. <view class="desc">
  66. <view class="cycle">用药周期{{package.cycle}}天</view>
  67. <view class="duration">签约时长{{package.duration}}天</view>
  68. </view>
  69. <!-- <view class="price-box">
  70. <view class="price">¥30元/日</view>
  71. <view class="count">6.2w人已购</view>
  72. </view> -->
  73. </view>
  74. </view>
  75. <!-- 订单信息 -->
  76. <view class="order-info">
  77. <view class="title">订单信息</view>
  78. <view class="item">
  79. <text class="label">订单编号</text>
  80. <view class="sn-box">
  81. <text class="text">{{order.orderSn}}</text>
  82. <view class="copy-btn" @click="copyOrderSn(order.orderSn)">复制</view>
  83. </view>
  84. </view>
  85. <view class="item">
  86. <text class="label">下单时间</text>
  87. <text class="text">{{order.createTime}}</text>
  88. </view>
  89. <view class="item">
  90. <text class="label">支付方式</text>
  91. <text class="text" v-if="order.payType==1">微信支付</text>
  92. <text class="text" v-if="order.payType==2">物流代收</text>
  93. <text class="text" v-if="order.payType==3">货到付款</text>
  94. </view>
  95. <view class="item">
  96. <text class="label">订单金额</text>
  97. <text class="text" v-if="order.payPrice!=null">¥{{order.payPrice.toFixed(2)}}</text>
  98. </view>
  99. <view class="item">
  100. <text class="label">支付金额</text>
  101. <text class="text" v-if="order.payMoney!=null">¥{{order.payMoney.toFixed(2)}}</text>
  102. </view>
  103. <view class="item">
  104. <text class="label">抵扣金额</text>
  105. <text class="text" v-if="order.discountMoney!=null">¥{{order.discountMoney.toFixed(2)}}</text>
  106. </view>
  107. <view class="item">
  108. <text class="label">代收金额</text>
  109. <text class="text" v-if="order.payRemain!=null">¥{{order.payRemain.toFixed(2)}}</text>
  110. </view>
  111. <view class="item">
  112. <text class="label">运费金额</text>
  113. <text class="text" v-if="order.payDelivery!=null">¥{{order.payDelivery.toFixed(2)}}</text>
  114. </view>
  115. <view class="item">
  116. <text class="label">支付时间</text>
  117. <text class="text">{{order.payTime}}</text>
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. <!-- 按钮 -->
  124. <view class="btn-box">
  125. <!-- <view class="btn cancel" v-if="order.status==1" @click="cancel()">取消订单</view> -->
  126. <!-- <view class="btn pay" v-if="order.status==1" @click="pay()">支付</view> -->
  127. </view>
  128. </view>
  129. </template>
  130. <script>
  131. import {getCompanyUserPackageOrderById,pay} from '@/api/packageOrder'
  132. export default {
  133. data() {
  134. return {
  135. orderId:null,
  136. order:{},
  137. package:null,
  138. items:[],
  139. };
  140. },
  141. onLoad(option) {
  142. this.orderId = option.orderId
  143. this.getPackageOrderById();
  144. },
  145. onShow() {
  146. },
  147. methods: {
  148. getPackageOrderById(){
  149. var data={orderId:this.orderId};
  150. getCompanyUserPackageOrderById(data).then(res => {
  151. if(res.code==200){
  152. this.order=res.order;
  153. this.package=JSON.parse(this.order.packageJson)
  154. }else{
  155. uni.showToast({
  156. icon:'none',
  157. title: "请求失败",
  158. });
  159. }
  160. });
  161. },
  162. pay() {
  163. uni.navigateTo({
  164. url: '/pages_order/packageOrderPay?orderId='+this.order.orderId
  165. })
  166. },
  167. // 返回上一页
  168. back() {
  169. let pages = getCurrentPages();
  170. console.log(pages.length);
  171. if(pages.length>1){
  172. uni.navigateBack()
  173. }
  174. else{
  175. uni.reLaunch({
  176. url:"/pages/common/launch"
  177. })
  178. }
  179. },
  180. // 复制订单编号
  181. copyOrderSn(text) {
  182. // 复制方法
  183. uni.setClipboardData({
  184. data:text,
  185. success:()=>{
  186. uni.showToast({
  187. title:'内容已成功复制到剪切板',
  188. icon:'none'
  189. })
  190. }
  191. });
  192. },
  193. }
  194. }
  195. </script>
  196. <style lang="scss">
  197. .cont{
  198. width: 100%;
  199. position: relative;
  200. .bg{
  201. width: 100%;
  202. height: 350upx;
  203. position: absolute;
  204. top: 0;
  205. left: 0;
  206. z-index: 1;
  207. background-color: #C39A58;
  208. background: linear-gradient(#C39A58, #E2C99E);
  209. border-radius: 0rpx 0rpx 100rpx 100rpx;
  210. }
  211. .inner{
  212. position: relative;
  213. padding: 30upx 0rpx;
  214. width: 100%;
  215. height: 100%;
  216. z-index: 999;
  217. .order-status{
  218. display: flex;
  219. align-items: center;
  220. justify-content: space-between;
  221. padding: 0 30upx;
  222. .inner{
  223. display: flex;
  224. align-items: center;
  225. .img-box{
  226. width: 96upx;
  227. height: 96upx;
  228. margin-right: 30upx;
  229. image{
  230. width: 100%;
  231. height: 100%;
  232. }
  233. }
  234. .status-box{
  235. height: 96upx;
  236. display: flex;
  237. flex-direction: column;
  238. justify-content: center;
  239. .status{
  240. font-size: 40upx;
  241. font-family: PingFang SC;
  242. font-weight: bold;
  243. color: #FFFFFF;
  244. line-height: 1;
  245. }
  246. .desc{
  247. font-size: 26upx;
  248. font-family: PingFang SC;
  249. font-weight: 500;
  250. color: #FFFFFF;
  251. line-height: 1;
  252. margin-top: 30upx;
  253. }
  254. }
  255. }
  256. }
  257. }
  258. }
  259. .content{
  260. margin: 20rpx 0rpx;
  261. padding: 0 20upx 140rpx 20upx;
  262. .package-box{
  263. width: 100%;
  264. display: flex;
  265. padding: 20rpx;
  266. background-color: #fff;
  267. align-items: flex-start;
  268. justify-content: flex-start;
  269. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  270. border-radius: 15rpx;
  271. .left{
  272. width:200rpx;
  273. height:200rpx;
  274. image{
  275. border-radius: 15rpx;
  276. width:100%;
  277. height:100%;
  278. }
  279. }
  280. .right{
  281. height: 200rpx;
  282. display: flex;
  283. flex-direction: column;
  284. align-items: flex-start;
  285. justify-content: flex-start;
  286. padding-left: 15rpx;
  287. width:calc(100% - 200rpx);
  288. .title{
  289. font-weight: bold;
  290. font-size: 34upx;
  291. font-family: PingFang SC;
  292. color: #111;
  293. }
  294. .desc{
  295. margin-top: 15rpx;
  296. display: flex;
  297. align-items: flex-start;
  298. justify-content: flex-start;
  299. .cycle{
  300. background-color: #eee;
  301. border-radius: 30rpx;
  302. padding: 5rpx 15rpx;
  303. font-size: 26upx;
  304. font-family: PingFang SC;
  305. color: #C39A58;
  306. }
  307. .duration{
  308. margin-left: 10rpx;
  309. background-color: #eee;
  310. border-radius: 30rpx;
  311. padding: 5rpx 15rpx;
  312. font-size: 26upx;
  313. font-family: PingFang SC;
  314. color: #C39A58;
  315. }
  316. }
  317. .price-box{
  318. flex: 1;
  319. display: flex;
  320. align-items: flex-end;
  321. justify-content: space-between;
  322. width: 100%;
  323. .price{
  324. padding: 5rpx 10rpx;
  325. background-color: #C39A58;
  326. border-radius: 30rpx;
  327. font-size: 20upx;
  328. font-family: PingFang SC;
  329. color: #ffffff;
  330. }
  331. .count{
  332. font-size: 24upx;
  333. font-family: PingFang SC;
  334. color: #333333;
  335. }
  336. }
  337. }
  338. }
  339. .order-info{
  340. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  341. margin-top: 20upx;
  342. background: #FFFFFF;
  343. border-radius: 16upx;
  344. padding: 40upx 30upx;
  345. .title{
  346. font-size: 30upx;
  347. font-family: PingFang SC;
  348. font-weight: bold;
  349. color: #222222;
  350. line-height: 1;
  351. }
  352. .item{
  353. margin-top: 40upx;
  354. display: flex;
  355. align-items: center;
  356. justify-content: space-between;
  357. .label{
  358. font-size: 26upx;
  359. font-family: PingFang SC;
  360. font-weight: 500;
  361. color: #666666;
  362. line-height: 1;
  363. }
  364. .text{
  365. font-size: 26upx;
  366. font-family: PingFang SC;
  367. font-weight: 500;
  368. color: #222222;
  369. line-height: 32upx;
  370. }
  371. .cont-text{
  372. font-size: 26upx;
  373. font-family: PingFang SC;
  374. font-weight: 500;
  375. color: #666666;
  376. .bold{
  377. color: #111111;
  378. }
  379. }
  380. .sn-box{
  381. display: flex;
  382. align-items: center;
  383. .copy-btn{
  384. width: 58upx;
  385. height: 32upx;
  386. line-height: 32upx;
  387. text-align: center;
  388. font-size: 22upx;
  389. font-family: PingFang SC;
  390. font-weight: 500;
  391. color: #222222;
  392. background: #F5F5F5;
  393. border-radius: 4upx;
  394. margin-left: 24upx;
  395. }
  396. }
  397. .check-box{
  398. display: flex;
  399. align-items: center;
  400. image{
  401. width: 14upx;
  402. height: 24upx;
  403. margin-left: 10upx;
  404. }
  405. }
  406. }
  407. .line{
  408. width: 100%;
  409. height: 1px;
  410. background: #F0F0F0;
  411. margin-top: 30upx;
  412. }
  413. }
  414. }
  415. .btn-box{
  416. z-index: 999;
  417. bottom: 0;
  418. width: 100%;
  419. position: fixed;
  420. height: 120upx;
  421. box-sizing: border-box;
  422. background: #FFFFFF;
  423. padding: 0 30upx;
  424. display: flex;
  425. align-items: center;
  426. justify-content: flex-end;
  427. .btn{
  428. width: 155upx;
  429. height: 64upx;
  430. line-height: 64upx;
  431. font-size: 26upx;
  432. font-family: PingFang SC;
  433. font-weight: 500;
  434. text-align: center;
  435. border-radius: 32upx;
  436. margin-left: 15upx;
  437. &.cancel{
  438. border: 1px solid #DDDDDD;
  439. color: #666666;
  440. }
  441. &.pay{
  442. background: #C39A58;
  443. color: #FFFFFF;
  444. }
  445. }
  446. }
  447. </style>