info.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <view>
  3. <navbar :iSimmersive="false" title-color="#ffffff" background="#1b43c4" :placeholder="true" title="订单信息"></navbar>
  4. <view class="order-info clear">
  5. <view class="title">订单创建成功</view>
  6. <view class="list">
  7. <view class="m">
  8. <text>订单编号</text>
  9. <text>{{order.order_no||""}}</text>
  10. </view>
  11. <view class="m">
  12. <text>下单时间</text>
  13. <text>{{order.create_time||""}}</text>
  14. </view>
  15. <view class="m">
  16. <text>支付方式</text>
  17. <text>{{order.payment_type||""}}</text>
  18. </view>
  19. <view class="m">
  20. <text>支付金额</text>
  21. <text>{{order.order_amount||""}}</text>
  22. </view>
  23. <view class="m">
  24. <text>支付状态</text>
  25. <text class="err">{{order.order_status||""}}</text>
  26. </view>
  27. </view>
  28. <view class="btn">
  29. <text class="success" @click="$utils.redirectTo('order/detail',{ id: order.order_id })">查看订单</text>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import navbar from "@/components/navbar/navbar";
  36. export default {
  37. components: {
  38. navbar
  39. },
  40. data() {
  41. return {
  42. order: {}
  43. };
  44. },
  45. onLoad() {
  46. let order_id = this.$storage.get("order_id");
  47. if(!order_id){
  48. this.$utils.switchTab("index/index");
  49. }
  50. let msg = this.$storage.get("order_msg");
  51. if(!msg){
  52. this.$utils.msg(msg);
  53. }
  54. this.$http.getCartInfo({
  55. order_id: order_id
  56. }).then(res=>{
  57. if(res.status){
  58. this.order = res.data;
  59. }else{
  60. this.$utils.switchTab("index/index");
  61. }
  62. this.$storage.remove("order_id");
  63. this.$storage.remove("order_msg");
  64. }).catch(err=>{
  65. this.$utils.switchTab("index/index");
  66. });
  67. }
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .order-info{
  72. width: 92%;
  73. height: auto !important;
  74. height: 100px;
  75. background-color: #fff;
  76. margin: 0 auto;
  77. border-radius: 10px;
  78. min-height: 100px;
  79. position: relative;
  80. top: 50px;
  81. color: #555;
  82. .title{
  83. width: 95%;
  84. margin: 0 2.5%;
  85. float: left;
  86. height: 25px;
  87. padding: 20px 0;
  88. font-size: 16px;
  89. font-weight: 700;
  90. text-align: center;
  91. color: #333;
  92. border-bottom: 1px solid #eee;
  93. }
  94. .list{
  95. width: 95%;
  96. margin: 0 2.5%;
  97. float: left;
  98. font-size: 14px;
  99. padding: 15px 0;
  100. border-bottom: 1px solid #eee;
  101. .m{
  102. width: 100%;
  103. height: 30px;
  104. line-height: 30px;
  105. text:first-child {
  106. float: left;
  107. }
  108. text:last-child{
  109. float: right;
  110. }
  111. }
  112. }
  113. .err {
  114. color: red;
  115. }
  116. .success {
  117. color: #029902;
  118. }
  119. .btn{
  120. float: left;
  121. width: 100%;
  122. padding: 10px 0 20px 0;
  123. text {
  124. border-radius: 15px;
  125. text-align: center;
  126. width: 95%;
  127. height: 50px;
  128. line-height: 50px;
  129. display: block;
  130. font-size: 16px;
  131. margin: 0 2.5%;
  132. margin-top: 10px;
  133. &.success {
  134. background-color: #1b43c4;
  135. color: #fff;
  136. }
  137. &.err{
  138. background-color: #fff;
  139. color: #e93323;
  140. border: 1px solid #e93323;
  141. }
  142. }
  143. }
  144. }
  145. </style>