OrderDetails.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. <template>
  2. <view class="bg">
  3. <view class="head">
  4. <view class="head_text1">
  5. {{ computerStatus(orderDetailData.status) }}
  6. </view>
  7. <view class="head_text2">
  8. <!-- 订单已提交,请在30分钟内完成支付,超时订单将自动取消 -->
  9. 确认订单详情
  10. </view>
  11. </view>
  12. <view class="address" >
  13. <view>
  14. <u--image width="40rpx" height="40rpx" src="/static/market/icomm_dizhi.png" ></u--image>
  15. </view>
  16. <view class="address_text">
  17. <view class="flex_start">
  18. <view class="mr">默认</view>
  19. <!-- <view class="mr1">{{orderDetailData.deliveryAddress}}</view> -->
  20. </view>
  21. <view class="address_conter">
  22. {{orderDetailData.deliveryAddress}}
  23. </view>
  24. <view class="flex_start address_bottom" >
  25. <view>{{orderDetailData.consignee}}</view>
  26. <view style="margin-left:8rpx">{{orderDetailData.contact}}</view>
  27. </view>
  28. </view>
  29. <!-- <view @click="openaddress">
  30. <u--image width="40rpx" height="40rpx" src="/static/myinfo/btn_right.png" ></u--image>
  31. </view> -->
  32. </view>
  33. <view class="commodity">
  34. <view class="commodity_title">厦门海嘉成商城</view>
  35. <view class="mc_item" v-for="(item,index) in orderDetailData.detailVoList" :key="index">
  36. <view class="item_swipe">
  37. <view class="box_img">
  38. <u--image width="180rpx" height="180rpx" :src="item.fileList[0].fileUrl" ></u--image>
  39. </view>
  40. <view class="box_text">
  41. <view class="box_title">
  42. {{ item.productTitle }}
  43. </view>
  44. <view class="box_type">
  45. 已选择 {{item.specsName}}
  46. </view>
  47. <view class="box_num">
  48. <view class="bn_left">
  49. ¥{{item.price}}
  50. </view>
  51. <view class="bn_right">
  52. {{ 'x' + item.num }}
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="PriceInfo2">
  60. <view class="PriceInfo_title">订单信息</view>
  61. <view class="PriceInfo_item">
  62. <view>订单编号</view>
  63. <view>{{orderDetailData.orderNo}}</view>
  64. </view>
  65. <view class="PriceInfo_item">
  66. <view>下单时间</view>
  67. <view>{{orderDetailData.createTime}}</view>
  68. </view>
  69. <!-- <view class="PriceInfo_item">
  70. <view>支付方式</view>
  71. <view>微信支付</view>
  72. </view>
  73. <view class="PriceInfo_item">
  74. <view>发票类型</view>
  75. <view>普通发票</view>
  76. </view>
  77. <view class="PriceInfo_item">
  78. <view>发票内容</view>
  79. <view>商品明细</view>
  80. </view> -->
  81. </view>
  82. <view class="PriceInfo">
  83. <view class="PriceInfo_title">费用明细</view>
  84. <view class="PriceInfo_item">
  85. <view>商品总额</view>
  86. <view>¥ {{orderDetailData.productPrice}}</view>
  87. </view>
  88. <view class="PriceInfo_item">
  89. <view>加工费用</view>
  90. <view>¥ {{orderDetailData.processPrice}}</view>
  91. </view>
  92. <view class="PriceInfo_item">
  93. <view>包装袋费</view>
  94. <view>¥ {{orderDetailData.packagePrice}}</view>
  95. </view>
  96. <!-- <view class="PriceInfo_item">
  97. <view>优惠券</view>
  98. <view>¥ 450.00</view>
  99. </view> -->
  100. <view class="PriceInfo_item">
  101. <view>实付金额</view>
  102. <view style="color: #F6514F;font-weight: bold;font-size: 28rpx;">¥ {{orderDetailData.totalPrice}}</view>
  103. </view>
  104. </view>
  105. <view style="height: 200rpx;">
  106. </view>
  107. <view class="btnBox" >
  108. <view class="bm_btn">
  109. <view v-if="orderDetailData.status=='1'" @click="cancelOrder" class="bm_btn1">取消订单</view>
  110. <view v-else @click="returnPage" class="bm_btn2">返回</view>
  111. </view>
  112. </view>
  113. </view>
  114. </template>
  115. <script>
  116. import {orderDetail,cancelOrder} from '@/http/api/common.js'
  117. export default {
  118. components: {
  119. },
  120. data() {
  121. return {
  122. orderDetailData:{
  123. deliveryAddress:'',
  124. consignee:'',
  125. contact:'',
  126. detailVoList:[]//订单列表
  127. },
  128. }
  129. },
  130. async onLoad(e) {
  131. if (e?.orderId) {
  132. await this.getOrderDetail(e?.orderId)
  133. }
  134. },
  135. methods: {
  136. computerStatus(status){
  137. let a = {
  138. '1':'未确认',
  139. '2':'已确认',
  140. '3':'已取消',
  141. '4':'已完成',
  142. }
  143. return a[status]
  144. },
  145. async getOrderDetail(id){
  146. let res = await orderDetail(id)
  147. if (res.data.code ==200) {
  148. this.orderDetailData = res.data.data
  149. }
  150. },
  151. openaddress(){
  152. //打开地址设置
  153. uni.navigateTo({
  154. url: '/pages/myinfo/address'
  155. });
  156. },
  157. async cancelOrder(){
  158. //取消订单
  159. let res = await cancelOrder(id)
  160. if (res.data.code == 200) {
  161. util.toastFunc('取消成功',()=>{
  162. uni.navigateBack({ delta: 1 })
  163. })
  164. }
  165. },
  166. returnPage(){
  167. uni.navigateBack({ delta: 1 })
  168. }
  169. }
  170. }
  171. </script>
  172. <style>
  173. .bg{
  174. width: 750rpx;
  175. height: auto;
  176. background: #F1F1F1;
  177. border-radius: 0rpx 0rpx 0rpx 0rpx;
  178. display: flex;
  179. flex-direction: column;
  180. align-items: center;
  181. }
  182. .address{
  183. width: 702rpx;
  184. height: 200rpx;
  185. background: #FFFFFF;
  186. border-radius: 16rpx 16rpx 16rpx 16rpx;
  187. opacity: 1;
  188. margin-top: -40px;
  189. }
  190. .commodity{
  191. width: 702rpx;
  192. height: auto;
  193. background: #FFFFFF;
  194. border-radius: 16rpx 16rpx 16rpx 16rpx;
  195. opacity: 1;
  196. margin-top: 24rpx;
  197. }
  198. .PriceInfo2{
  199. width: 702rpx;
  200. height: 230rpx;
  201. background: #FFFFFF;
  202. border-radius: 16rpx 16rpx 16rpx 16rpx;
  203. opacity: 1;
  204. margin-top: 24rpx;
  205. display: flex;
  206. align-items: center;
  207. justify-content: space-evenly;
  208. flex-direction: column;
  209. }
  210. .PriceInfo{
  211. width: 702rpx;
  212. height: 461rpx;
  213. background: #FFFFFF;
  214. border-radius: 16rpx 16rpx 16rpx 16rpx;
  215. opacity: 1;
  216. margin-top: 24rpx;
  217. display: flex;
  218. align-items: center;
  219. justify-content: space-evenly;
  220. flex-direction: column;
  221. }
  222. .PriceInfo_item{
  223. display: flex;
  224. justify-content: space-between;
  225. width: 654rpx;
  226. height: 40rpx;
  227. font-size: 28rpx;
  228. font-weight: 500;
  229. color: #666666;
  230. line-height: 36rpx;
  231. }
  232. .PriceInfo_title{
  233. display: flex;
  234. width: 654rpx;
  235. height: 40rpx;
  236. font-size: 32rpx;
  237. font-weight: bold;
  238. color: #333333;
  239. line-height: 36rpx;
  240. }
  241. .btnBox{
  242. width: 750rpx;
  243. height: 100rpx;
  244. background: #FFFFFF;
  245. border-radius: 0rpx 0rpx 0rpx 0rpx;
  246. opacity: 1;
  247. position: fixed;
  248. z-index: 10088;
  249. bottom: 0;
  250. display: flex;
  251. flex-direction: row;
  252. align-items: center;
  253. justify-content: flex-end;
  254. }
  255. .bm_btn{
  256. display: flex;
  257. flex-direction: row;
  258. align-items: center;
  259. width: 250rpx;
  260. height: 72rpx;
  261. justify-content: space-evenly;
  262. }
  263. .bm_btn1{
  264. width: 200rpx;
  265. height: 72rpx;
  266. background: #EEEEEE;
  267. border-radius: 60rpx 60rpx 60rpx 60rpx;
  268. opacity: 1;
  269. font-size: 28rpx;
  270. font-weight: 500;
  271. color: #666;
  272. line-height: 72rpx;
  273. text-align: center;
  274. }
  275. .bm_btn2{
  276. width: 200rpx;
  277. height: 72rpx;
  278. background: #46A6FF;
  279. border-radius: 60rpx 60rpx 60rpx 60rpx;
  280. opacity: 1;
  281. font-size: 28rpx;
  282. font-weight: 500;
  283. color: #FFFFFF;
  284. line-height: 72rpx;
  285. text-align: center;
  286. }
  287. .address{
  288. display: flex;
  289. flex-direction: row;
  290. align-items: center;
  291. justify-content: space-evenly;
  292. }
  293. .flex_start{
  294. display: flex;
  295. justify-content: flex-start;
  296. align-items: center;
  297. }
  298. .mr{
  299. width: 64rpx;
  300. height: 32rpx;
  301. background: #FF8C33;
  302. border-radius: 8rpx 8rpx 8rpx 8rpx;
  303. opacity: 1;
  304. font-size: 24rpx;
  305. font-weight: 500;
  306. color: #FFFFFF;
  307. text-align: center;
  308. }
  309. .mr1{
  310. width: 440rpx;
  311. margin-left: 8rpx;
  312. font-size: 28rpx;
  313. font-weight: 500;
  314. color: #333333;
  315. }
  316. .commodity_title{
  317. width: 196rpx;
  318. height: 40rpx;
  319. font-size: 28rpx;
  320. font-weight: bold;
  321. color: #333333;
  322. line-height: 40rpx;
  323. padding: 24rpx 0 0 24rpx;
  324. }
  325. .address_text{
  326. width: 550rpx;
  327. height: 200rpx;
  328. display: flex;
  329. flex-direction: column;
  330. justify-content: center;
  331. }
  332. .address_conter{
  333. width: 550rpx;
  334. height: 45rpx;
  335. font-size: 32rpx;
  336. font-weight: bold;
  337. color: #333333;
  338. line-height: 45rpx;
  339. margin-top: 8rpx;
  340. display: -webkit-box;
  341. word-break: break-all;
  342. text-overflow: ellipsis;
  343. overflow: hidden;
  344. -webkit-box-orient: vertical;
  345. -webkit-line-clamp:1;
  346. }
  347. .address_bottom{
  348. width: 550rpx;
  349. height: 40rpx;
  350. font-size: 28rpx;
  351. font-weight: bold;
  352. color: #999999;
  353. margin-top: 8rpx;
  354. }
  355. .mc_item{
  356. width: 702rpx;
  357. height: 244rpx;
  358. background: #FFFFFF;
  359. border-radius: 16rpx 16rpx 16rpx 16rpx;
  360. opacity: 1;
  361. margin-top: 24rpx;
  362. }
  363. .item_swipe{
  364. width: 678rpx;
  365. height: 244rpx;
  366. background: #FFFFFF;
  367. border-radius: 16rpx 16rpx 16rpx 16rpx;
  368. opacity: 1;
  369. display: flex;
  370. align-items: center;
  371. flex-direction: row;
  372. padding-left: 24rpx;
  373. }
  374. .box_img{
  375. width: 180rpx;
  376. height: 180rpx;
  377. background-color: #999999;
  378. }
  379. .box_text{
  380. width: 392rpx;
  381. height: 200rpx;
  382. margin-left: 20rpx;
  383. display: flex;
  384. flex-direction: column;
  385. justify-content: space-between;
  386. }
  387. .box_title{
  388. width: 392rpx;
  389. height: 40rpx;
  390. font-size: 28rpx;
  391. font-weight: bold;
  392. color: #333333;
  393. line-height: 40rpx;
  394. display: -webkit-box;
  395. word-break: break-all;
  396. text-overflow: ellipsis;
  397. overflow: hidden;
  398. -webkit-box-orient: vertical;
  399. -webkit-line-clamp:1;
  400. }
  401. .box_type{
  402. width: 410rpx;
  403. height: 48rpx;
  404. background: #EEEEEE;
  405. border-radius: 8rpx 8rpx 8rpx 8rpx;
  406. opacity: 1;
  407. font-size: 28rpx;
  408. font-weight: 500;
  409. color: #999999;
  410. padding-left: 24rpx;
  411. line-height: 48rpx;
  412. display: -webkit-box;
  413. word-break: break-all;
  414. text-overflow: ellipsis;
  415. overflow: hidden;
  416. -webkit-box-orient: vertical;
  417. -webkit-line-clamp:1;
  418. }
  419. .box_num{
  420. width: 410rpx;
  421. display: flex;
  422. justify-content: space-between;
  423. align-items: center;
  424. }
  425. .bn_left{
  426. width: 106rpx;
  427. height: 38rpx;
  428. font-size: 28rpx;
  429. font-weight: bold;
  430. color: #333333;
  431. line-height: 36rpx;
  432. }
  433. .head{
  434. width: 750rpx;
  435. height: 300rpx;
  436. background: #46A6FF;
  437. border-radius: 0rpx 0rpx 0rpx 0rpx;
  438. opacity: 1;
  439. }
  440. .head_text1{
  441. width: 96rpx;
  442. font-size: 32rpx;
  443. font-weight: bold;
  444. color: #FFFFFF;
  445. margin-left: 24rpx;
  446. margin-top: 40rpx;
  447. }
  448. .head_text2{
  449. width: 678rpx;
  450. font-size: 28rpx;
  451. font-weight: 500;
  452. color: #FFFFFF;
  453. margin-left: 24rpx;
  454. margin-top: 40rpx;
  455. }
  456. </style>