orderDetails.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. <template>
  2. <view>
  3. <ujp-navbar title="订单详情"></ujp-navbar>
  4. <!-- 付款状态 -->
  5. <view class="payment-state">
  6. <!-- 待付款 -->
  7. <view class="state1" v-if="info.mallProductOrder.payStatus==0">
  8. <view class="icon">
  9. <img src="../../assets/img/riFill-time-fill@3x.png" alt="">
  10. </view>
  11. 待付款
  12. </view>
  13. <!-- 待付款 -->
  14. <view class="state1" v-if="info.mallProductOrder.payStatus==2">
  15. <view class="icon">
  16. <img src="../../assets/img/riFill-time-fill@3x.png" alt="">
  17. </view>
  18. 已退款
  19. </view>
  20. <!-- 交易完成 -->
  21. <view class="state2" v-if="info.mallProductOrder.payStatus==1">
  22. <view class="icon">
  23. <img src="../../assets/img/riFill-checkbox-circle-fill@3x.png" alt="">
  24. </view>
  25. 交易完成
  26. </view>
  27. </view>
  28. <!-- 运输信息 -->
  29. <view class="shipping-information">
  30. <view class="shipping-state" v-if="false">
  31. <view class="icon">
  32. <img src="../../assets/img/riLine-truck-line Copy@3x.png" alt="">
  33. </view>
  34. <view class="state-time">
  35. <view class="state">
  36. 已下单,请在 <text class="countdown"> 09:59 </text> 内完成付款
  37. </view>
  38. <view class="time">
  39. 2023-12-15 17:00:00
  40. </view>
  41. </view>
  42. <view class="icon2">
  43. <u-icon name="arrow-right" size="24" color="#999999"></u-icon>
  44. </view>
  45. </view>
  46. <!-- 收货人信息 -->
  47. <view class="consignee-information">
  48. <view class="icon">
  49. <u-icon name="map" size="40"></u-icon>
  50. </view>
  51. <view class="infos">
  52. <view class="name-tel">
  53. {{info.mallProductOrder.receiver}} {{info.mallProductOrder.contactPhone}}
  54. </view>
  55. <view class="address">
  56. 收货地址:{{info.mallProductOrder.deliveryAddress}}
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <!-- 商品信息 -->
  62. <view class="commodity-main">
  63. <view class="commodity-infos">
  64. <!-- 图片 -->
  65. <view class="picture">
  66. <img :src="info.mallProductOrder.productPic" alt="">
  67. </view>
  68. <!-- 信息 -->
  69. <view class="infos">
  70. <view class="title">
  71. {{info.mallProductOrder.productName}}
  72. </view>
  73. <view class="name">
  74. </view>
  75. <view class="price">
  76. {{info.mallProductOrder.price}}元
  77. </view>
  78. </view>
  79. <!-- 数量 -->
  80. <view class="amount">
  81. x{{info.mallProductOrder.buyNum}}
  82. </view>
  83. </view>
  84. <!-- 订单金额 -->
  85. <view class="order-amount">
  86. <view class="title">
  87. 订单金额
  88. </view>
  89. <view class="value">
  90. {{info.mallProductOrder.totalFee}}元
  91. </view>
  92. </view>
  93. <view class="else-infos">
  94. <template v-for="(item,i) in info.priceAttrList" >
  95. <view class="infos-item" :key="i">
  96. <view class="item-title">
  97. {{item.attribute.name}}
  98. </view>
  99. <view class="item-value item-value-end">
  100. <view v-for="(option , oindex) in item.options" :key="i+'__'+oindex">
  101. {{option.label}} <span style="margin-left: 8px;" v-if="option.price">{{option.price}}元</span>
  102. </view>
  103. </view>
  104. </view>
  105. </template>
  106. </view>
  107. <!-- 其他信息 -->
  108. <view class="else-infos">
  109. <view class="infos-item" v-if="false">
  110. <view class="item-title">
  111. 商品总金额
  112. </view>
  113. <view class="item-value">
  114. 12.90元
  115. </view>
  116. </view>
  117. <view class="infos-item" v-if="false">
  118. <view class="item-title">
  119. 交易手机号
  120. </view>
  121. <view class="item-value">
  122. 155****0001
  123. </view>
  124. </view>
  125. <view class="infos-item">
  126. <view class="item-title">
  127. 订单号
  128. </view>
  129. <view class="item-value" @click="copyUrl(info.mallProductOrder.outOrderNo)">
  130. {{info.mallProductOrder.outOrderNo}}
  131. <text><img src="../../assets/img/riLine-file-copy-2-line@3x.png" alt=""></text>
  132. </view>
  133. </view>
  134. <view class="infos-item" v-if="false">
  135. <view class="item-title">
  136. 创建时间
  137. </view>
  138. <view class="item-value">
  139. </view>
  140. </view>
  141. <view class="infos-item">
  142. <view class="item-title">
  143. 下单时间
  144. </view>
  145. <view class="item-value">
  146. {{info.mallProductOrder.createTime}}
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. <!-- 底部 -->
  152. <view class="bottom">
  153. <!-- 取消订单 -->
  154. <!-- <view class="cancel btn">
  155. 取消订单
  156. </view> -->
  157. <!-- 联系客服 -->
  158. <view class="service btn" @click="gotoUrl('pages/service/service')">
  159. 联系客服
  160. </view>
  161. <!-- 立即支付 -->
  162. <!-- <view class="pay btn">
  163. 立即支付
  164. </view> -->
  165. </view>
  166. </view>
  167. </template>
  168. <script>
  169. import * as API from '@/apis/mall.js'
  170. export default {
  171. data() {
  172. return {
  173. info:{
  174. mallProductOrder:{},
  175. priceAttrList:{},
  176. },
  177. id:"",
  178. }
  179. },
  180. onLoad(op) {
  181. if (op.id) {
  182. this.id = op.id;
  183. this.getDetail();
  184. }
  185. },
  186. methods: {
  187. copyUrl(text){
  188. var textToCopy = 'http://www.jsrailway.com.cn/railroad-portal/';
  189. uni.setClipboardData({
  190. data: text,
  191. success: function () {
  192. uni.showToast({
  193. title: "复制成功!",
  194. icon: "none"
  195. })
  196. }
  197. });
  198. },
  199. getDetail(){
  200. uni.showLoading({
  201. title: "加载中",
  202. mask: true,
  203. })
  204. API.myOrderDetails({
  205. id:this.id
  206. }).then((res) => {
  207. uni.hideLoading();
  208. this.info=res.data
  209. }).catch(error => {
  210. uni.showToast({
  211. title: error,
  212. icon: "none"
  213. })
  214. })
  215. }
  216. }
  217. }
  218. </script>
  219. <style lang="scss" scoped>
  220. .item-value-end{
  221. text-align: end;
  222. }
  223. // 付款状态
  224. .payment-state {
  225. padding: 48rpx 32rpx;
  226. .state1,
  227. .state2 {
  228. display: flex;
  229. font-size: 36rpx;
  230. line-height: 48rpx;
  231. font-weight: bold;
  232. .icon {
  233. margin-right: 8rpx;
  234. img {
  235. width: 48rpx;
  236. height: 48rpx;
  237. }
  238. }
  239. }
  240. }
  241. // 运输信息
  242. .shipping-information {
  243. background-color: #fff;
  244. padding: 40rpx 32rpx;
  245. .shipping-state {
  246. display: flex;
  247. padding-bottom: 40rpx;
  248. border-bottom: 1px solid rgba(242, 242, 242, 1);
  249. img {
  250. width: 40rpx;
  251. height: 40rpx;
  252. }
  253. .state-time {
  254. margin-left: 8rpx;
  255. .state {
  256. color: rgba(51, 51, 51, 1);
  257. font-weight: bold;
  258. .countdown {
  259. color: #00B962;
  260. }
  261. }
  262. .time {
  263. color: rgba(119, 119, 119, 1);
  264. font-size: 24rpx;
  265. margin-top: 8rpx;
  266. }
  267. }
  268. .icon2 {
  269. margin-left: auto;
  270. }
  271. }
  272. // 收货人信息
  273. .consignee-information {
  274. padding-top: 40rpx;
  275. display: flex;
  276. .infos {
  277. margin-left: 8rpx;
  278. .name-tel {
  279. color: rgba(51, 51, 51, 1);
  280. font-weight: bold;
  281. }
  282. .address {
  283. color: rgba(119, 119, 119, 1);
  284. font-size: 24rpx;
  285. margin-top: 8rpx;
  286. line-height: 34rpx;
  287. }
  288. }
  289. }
  290. }
  291. // 商品信息
  292. .commodity-main {
  293. background-color: #fff;
  294. margin: 24rpx 0;
  295. padding: 32rpx;
  296. padding-bottom: 80px;
  297. .commodity-infos {
  298. display: flex;
  299. align-items: center;
  300. // 图片
  301. .picture {
  302. width: 152rpx;
  303. height: 152rpx;
  304. border-radius: 4px;
  305. img {
  306. width: 100%;
  307. height: 100%;
  308. }
  309. }
  310. // 信息
  311. .infos {
  312. margin-left: 16rpx;
  313. .title {
  314. color: rgba(51, 51, 51, 1);
  315. font-size: 32rpx;
  316. font-weight: bold;
  317. }
  318. .name {
  319. color: rgba(119, 119, 119, 1);
  320. font-size: 24rpx;
  321. margin-top: 8rpx;
  322. }
  323. .price {
  324. color: rgba(16, 16, 16, 1);
  325. font-size: 32rpx;
  326. margin-top: 24rpx;
  327. }
  328. }
  329. // 数量
  330. .amount {
  331. color: rgba(51, 51, 51, 1);
  332. font-size: 32rpx;
  333. margin-left: auto;
  334. }
  335. }
  336. // 订单金额
  337. .order-amount {
  338. display: flex;
  339. align-items: center;
  340. justify-content: space-between;
  341. margin: 40rpx 0;
  342. .title {
  343. color: rgba(51, 51, 51, 1);
  344. }
  345. .value {
  346. color: rgba(51, 51, 51, 1);
  347. font-size: 32rpx;
  348. font-weight: bold;
  349. }
  350. }
  351. // 其他信息
  352. .else-infos {
  353. padding-top: 16rpx;
  354. border-top: 1px solid rgba(242, 242, 242, 1);
  355. .infos-item {
  356. display: flex;
  357. align-items: center;
  358. justify-content: space-between;
  359. margin-top: 24rpx;
  360. line-height: 48rpx;
  361. .item-title {
  362. color: rgba(119, 119, 119, 1);
  363. }
  364. .item-value {
  365. color: rgba(119, 119, 119, 1);
  366. img{
  367. width: 32rpx;
  368. height: 32rpx;
  369. }
  370. }
  371. }
  372. }
  373. }
  374. // 底部
  375. .bottom{
  376. position: fixed;
  377. left: 0;
  378. right: 0;
  379. bottom: 0;
  380. background-color: #fff;
  381. padding: 20rpx 32rpx;
  382. display: flex;
  383. justify-content: flex-end;
  384. .btn{
  385. width: 200rpx;
  386. height: 72rpx;
  387. line-height: 72rpx;
  388. border-radius: 50px;
  389. font-size: 32rpx;
  390. text-align: center;
  391. border: 1px solid rgba(204, 204, 204, 1);
  392. margin-left: 16rpx;
  393. }
  394. .cancel,.service{
  395. background-color: rgba(255, 255, 255, 1);
  396. color: rgba(119, 119, 119, 1);
  397. }
  398. .pay{
  399. background-color: rgba(0, 185, 98, 1);
  400. color: rgba(255, 255, 255, 1);
  401. }
  402. }
  403. </style>