integralOrderDetails.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  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/520e24fba47441b3b0f73b5250bb0b57.png" mode=""></image>
  12. </view>
  13. <view class="status-box">
  14. <text class="status">待发货</text>
  15. <text class="desc">等待后台发货</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/1e6ba423ff7e4537bef87a022d530015.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>
  49. <!-- 下单人信息 -->
  50. <view class="order-placer" v-if="order.userName!=null">
  51. <view class="inner">
  52. <image class="location" src="/static/images/location.png" mode=""></image>
  53. <view class="info">
  54. <view class="name-phone">
  55. <text class="text">{{order.userName}}</text>
  56. <text class="text" v-if="order.userPhone!=null">{{order.userPhone}}</text>
  57. </view>
  58. <view class="address ellipsis2">
  59. {{order.userAddress}}
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="content">
  65. <view class="goods-list">
  66. <view class="item" >
  67. <view class="img-box">
  68. <image :src="item.imgUrl==''?'/static/images/drug.svg':item.imgUrl" mode="aspectFill"></image>
  69. </view>
  70. <view class="info-box">
  71. <view>
  72. <view class="name-box ellipsis2">
  73. {{item.goodsName}}
  74. </view>
  75. </view>
  76. <view class="price-num">
  77. <view class="price">
  78. <text class="unit">积分:</text>
  79. <text class="num" >{{item.integral}}</text>
  80. </view>
  81. <view class="num" >x1</view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <!-- 订单信息 -->
  87. <view class="order-info">
  88. <view class="title">订单信息</view>
  89. <view class="item">
  90. <text class="label">订单编号</text>
  91. <view class="sn-box">
  92. <text class="text">{{order.orderCode}}</text>
  93. <view class="copy-btn" @click="copyOrderSn(order.orderCode)">复制</view>
  94. </view>
  95. </view>
  96. <view class="item">
  97. <text class="label">下单时间</text>
  98. <text class="text">{{order.createTime}}</text>
  99. </view>
  100. <view class="item">
  101. <text class="label">使用积分</text>
  102. <text class="text" >¥{{order.integral}}</text>
  103. </view>
  104. <view class="item" v-if="order.deliveryName!=null">
  105. <text class="label">物流公司</text>
  106. <text class="text" >{{order.deliveryName}}</text>
  107. </view>
  108. <view class="item" v-if="order.deliverySn!=null">
  109. <text class="label">物流单号</text>
  110. <text class="text" >{{order.deliverySn}}</text>
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. <!-- 按钮 -->
  117. <view class="btn-box">
  118. <view class="btn cancel">
  119. 联系客服
  120. <button class='contact-btn' open-type="contact">
  121. </button>
  122. </view>
  123. </view>
  124. </view>
  125. </template>
  126. <script>
  127. import {getIntegralOrderById} from '@/api/integral.js'
  128. export default {
  129. data() {
  130. return {
  131. orderId:null,
  132. order:null,
  133. item:null,
  134. };
  135. },
  136. onLoad(option) {
  137. this.orderId = option.orderId
  138. },
  139. onShow() {
  140. this.getIntegralOrderById()
  141. },
  142. methods: {
  143. getIntegralOrderById(){
  144. var data={orderId:this.orderId};
  145. getIntegralOrderById(data).then(res => {
  146. if(res.code==200){
  147. this.order=res.data;
  148. this.item=JSON.parse(this.order.itemJson)
  149. }else{
  150. uni.showToast({
  151. icon:'none',
  152. title: "请求失败",
  153. });
  154. }
  155. });
  156. },
  157. // 复制订单编号
  158. copyOrderSn(text) {
  159. // 复制方法
  160. uni.setClipboardData({
  161. data:text,
  162. success:()=>{
  163. uni.showToast({
  164. title:'内容已成功复制到剪切板',
  165. icon:'none'
  166. })
  167. }
  168. });
  169. },
  170. }
  171. }
  172. </script>
  173. <style lang="scss">
  174. .cont{
  175. width: 100%;
  176. position: relative;
  177. .bg{
  178. width: 100%;
  179. height: 350upx;
  180. position: absolute;
  181. top: 0;
  182. left: 0;
  183. z-index: 1;
  184. background-color: #C39A58;
  185. background: linear-gradient(#C39A58, #E2C99E);
  186. border-radius: 0rpx 0rpx 100rpx 100rpx;
  187. }
  188. .inner{
  189. position: relative;
  190. padding: 30upx 0rpx;
  191. width: 100%;
  192. height: 100%;
  193. z-index: 999;
  194. .order-status{
  195. display: flex;
  196. align-items: center;
  197. justify-content: space-between;
  198. padding: 0 30upx;
  199. .inner{
  200. display: flex;
  201. align-items: center;
  202. .img-box{
  203. width: 96upx;
  204. height: 96upx;
  205. margin-right: 30upx;
  206. image{
  207. width: 100%;
  208. height: 100%;
  209. }
  210. }
  211. .status-box{
  212. height: 96upx;
  213. display: flex;
  214. flex-direction: column;
  215. justify-content: center;
  216. .status{
  217. font-size: 40upx;
  218. font-family: PingFang SC;
  219. font-weight: bold;
  220. color: #FFFFFF;
  221. line-height: 1;
  222. }
  223. .desc{
  224. font-size: 26upx;
  225. font-family: PingFang SC;
  226. font-weight: 500;
  227. color: #FFFFFF;
  228. line-height: 1;
  229. margin-top: 30upx;
  230. }
  231. }
  232. }
  233. }
  234. .order-placer{
  235. margin-top: 30upx;
  236. padding: 0 20upx;
  237. .inner{
  238. box-sizing: border-box;
  239. border-radius: 16upx;
  240. height: 150upx;
  241. padding: 40upx 30upx;
  242. display: flex;
  243. align-items: center;
  244. background: #FFFFFF;
  245. .location{
  246. width: 24upx;
  247. height: 27upx;
  248. margin-right: 18upx;
  249. flex-shrink: 0;
  250. }
  251. .info{
  252. .name-phone{
  253. display: flex;
  254. align-items: center;
  255. .text{
  256. font-size: 28upx;
  257. font-family: PingFang SC;
  258. font-weight: bold;
  259. color: #333333;
  260. line-height: 1;
  261. margin-right: 20upx;
  262. &:last-child{
  263. margin-right: 0;
  264. }
  265. }
  266. }
  267. .address{
  268. font-size: 26upx;
  269. font-family: PingFang SC;
  270. font-weight: 500;
  271. color: #999999;
  272. line-height: 1.3;
  273. margin-top: 10upx;
  274. }
  275. }
  276. }
  277. }
  278. }
  279. }
  280. .content{
  281. margin: 20rpx 0rpx;
  282. padding: 0 20upx 140rpx 20upx;
  283. .goods-list{
  284. padding: 0 30upx;
  285. background-color: #FFFFFF;
  286. border-radius: 16upx;
  287. .item{
  288. padding: 30upx 0;
  289. border-bottom: 1px solid #EDEEEF;
  290. display: flex;
  291. align-items: center;
  292. .img-box{
  293. width: 160upx;
  294. height: 160upx;
  295. margin-right: 30upx;
  296. image{
  297. width: 100%;
  298. height: 100%;
  299. }
  300. }
  301. .info-box{
  302. width: calc(100% - 190upx);
  303. height: 160upx;
  304. display: flex;
  305. flex-direction: column;
  306. justify-content: space-between;
  307. .name-box{
  308. font-size: 28upx;
  309. font-family: PingFang SC;
  310. font-weight: 500;
  311. color: #111111;
  312. line-height: 40upx;
  313. .tag{
  314. display: inline-block;
  315. padding: 0 6upx;
  316. height: 30upx;
  317. background: linear-gradient(90deg, #C39A58 0%, #E2C99E 100%);
  318. border-radius: 4upx;
  319. margin-right: 10upx;
  320. font-size: 22upx;
  321. font-family: PingFang SC;
  322. font-weight: bold;
  323. color: #FFFFFF;
  324. line-height: 30upx;
  325. float: left;
  326. margin-top: 7upx;
  327. }
  328. }
  329. .spec{
  330. margin-top: 18upx;
  331. font-size: 24upx;
  332. font-family: PingFang SC;
  333. font-weight: 500;
  334. color: #999999;
  335. line-height: 1;
  336. }
  337. .price-num{
  338. display: flex;
  339. align-items: center;
  340. justify-content: space-between;
  341. .price{
  342. display: flex;
  343. align-items: flex-end;
  344. .unit{
  345. font-size: 24upx;
  346. font-family: PingFang SC;
  347. font-weight: 500;
  348. color: #111111;
  349. line-height: 1.2;
  350. margin-right: 4upx;
  351. }
  352. .num{
  353. font-size: 32upx;
  354. font-family: PingFang SC;
  355. font-weight: 500;
  356. color: #111111;
  357. line-height: 1;
  358. }
  359. }
  360. .num{
  361. font-size: 24upx;
  362. font-family: PingFang SC;
  363. font-weight: 500;
  364. color: #999999;
  365. line-height: 1;
  366. }
  367. }
  368. }
  369. }
  370. .sub-total{
  371. height: 88upx;
  372. display: flex;
  373. align-items: center;
  374. justify-content: flex-end;
  375. .discount{
  376. font-size: 24upx;
  377. font-family: PingFang SC;
  378. font-weight: 500;
  379. color: #999999;
  380. line-height: 1;
  381. margin-right: 30upx;
  382. }
  383. .label{
  384. font-size: 24upx;
  385. font-family: PingFang SC;
  386. font-weight: 500;
  387. color: #999999;
  388. }
  389. .price{
  390. display: flex;
  391. align-items: flex-end;
  392. .unit{
  393. font-size: 24upx;
  394. font-family: PingFang SC;
  395. font-weight: 500;
  396. color: #FF6633;
  397. line-height: 1.2;
  398. margin-right: 4upx;
  399. }
  400. .num{
  401. font-size: 32upx;
  402. font-family: PingFang SC;
  403. font-weight: bold;
  404. color: #FF6633;
  405. line-height: 1;
  406. }
  407. }
  408. }
  409. }
  410. .order-info{
  411. margin-top: 20upx;
  412. background: #FFFFFF;
  413. border-radius: 16upx;
  414. padding: 40upx 30upx;
  415. .title{
  416. font-size: 30upx;
  417. font-family: PingFang SC;
  418. font-weight: bold;
  419. color: #222222;
  420. line-height: 1;
  421. }
  422. .item{
  423. margin-top: 40upx;
  424. display: flex;
  425. align-items: center;
  426. justify-content: space-between;
  427. .label{
  428. font-size: 26upx;
  429. font-family: PingFang SC;
  430. font-weight: 500;
  431. color: #666666;
  432. line-height: 1;
  433. }
  434. .text{
  435. font-size: 26upx;
  436. font-family: PingFang SC;
  437. font-weight: 500;
  438. color: #222222;
  439. line-height: 32upx;
  440. }
  441. .cont-text{
  442. font-size: 26upx;
  443. font-family: PingFang SC;
  444. font-weight: 500;
  445. color: #666666;
  446. .bold{
  447. color: #111111;
  448. }
  449. }
  450. .sn-box{
  451. display: flex;
  452. align-items: center;
  453. .copy-btn{
  454. width: 58upx;
  455. height: 32upx;
  456. line-height: 32upx;
  457. text-align: center;
  458. font-size: 22upx;
  459. font-family: PingFang SC;
  460. font-weight: 500;
  461. color: #222222;
  462. background: #F5F5F5;
  463. border-radius: 4upx;
  464. margin-left: 24upx;
  465. }
  466. }
  467. .check-box{
  468. display: flex;
  469. align-items: center;
  470. image{
  471. width: 14upx;
  472. height: 24upx;
  473. margin-left: 10upx;
  474. }
  475. }
  476. }
  477. .line{
  478. width: 100%;
  479. height: 1px;
  480. background: #F0F0F0;
  481. margin-top: 30upx;
  482. }
  483. }
  484. }
  485. .btn-box{
  486. z-index: 999;
  487. bottom: 0;
  488. width: 100%;
  489. position: fixed;
  490. height: 120upx;
  491. box-sizing: border-box;
  492. background: #FFFFFF;
  493. padding: 0 30upx;
  494. display: flex;
  495. align-items: center;
  496. justify-content: flex-end;
  497. .btn{
  498. position: relative;
  499. width: 155upx;
  500. height: 64upx;
  501. line-height: 64upx;
  502. font-size: 26upx;
  503. font-family: PingFang SC;
  504. font-weight: 500;
  505. text-align: center;
  506. border-radius: 32upx;
  507. margin-left: 15upx;
  508. &.cancel{
  509. border: 1px solid #DDDDDD;
  510. color: #666666;
  511. }
  512. &.pay{
  513. background: #C39A58;
  514. color: #FFFFFF;
  515. }
  516. .contact-btn {
  517. top: 0;
  518. position: absolute;
  519. width:100%;
  520. height:100%;
  521. opacity: 0;
  522. }
  523. }
  524. }
  525. </style>