orderdetails.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view class="">
  3. <!-- <u-navbar
  4. :title="title"
  5. :placeholder="true"
  6. @leftClick="leftClick"
  7. :autoBack="true"
  8. :safeAreaInsetTop="true"
  9. >
  10. </u-navbar> -->
  11. <view class="page-wrap">
  12. <view class="block goods u-flex u-col-top">
  13. <img class="img" :src="orderDetails.mainImg" alt="">
  14. <view class="text">
  15. <view class="title ellipsis-2">{{orderDetails.goodsName}}</view>
  16. <view class="bottom u-flex u-row-between">
  17. <view class="price">{{orderDetails.credit}}积分</view>
  18. <view class="quantity">共{{orderDetails.quantity}}件</view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="block info">
  23. <view class="info-item u-flex">
  24. <text class="til">兑换时间</text>
  25. <text>{{orderDetails.startTime}}</text>
  26. </view>
  27. <view class="info-item u-flex" v-if="orderDetails.checkTime">
  28. <text class="til">核销时间</text>
  29. <text>{{orderDetails.checkTime}}</text>
  30. </view>
  31. <view class="info-item u-flex" >
  32. <text class="til">失效时间</text>
  33. <text>{{orderDetails.startEnd}}</text>
  34. </view>
  35. <view class="info-item u-flex" v-if="orderDetails.checkName">
  36. <text class="til">核销人</text>
  37. <text>{{orderDetails.checkName}}</text>
  38. </view>
  39. </view>
  40. <view class="status"
  41. :class="{
  42. status0:orderDetails.status == 0,
  43. status1:orderDetails.status == 1,
  44. status2:orderDetails.status == 2,
  45. }"
  46. >
  47. {{orderDetails.status|filterOrderStatus}}
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. data() {
  55. return {
  56. id:'',
  57. orderDetails:{},
  58. }
  59. },
  60. onLoad(page) {
  61. this.id = page.id;
  62. },
  63. onShow() {
  64. this.getOrderDetails(this.id);
  65. },
  66. computed:{
  67. // payType(){
  68. // return function(value){
  69. // let payTypeList = ['', '微信', '余额', '积分']
  70. // return '-' + payTypeList[value]
  71. // }
  72. // }
  73. },
  74. methods: {
  75. leftClick(){
  76. console.log('orderdetails leftClick');
  77. },
  78. getOrderDetails(id){
  79. this.$u.api.exchangeDetails({id:id}).then(res=>{
  80. this.orderDetails = res.data
  81. // console.log('orderDetails',JSON.parse(JSON.stringify(res.data)));
  82. }).catch(err=>{
  83. console.log('getOrderDetails',err);
  84. })
  85. },
  86. }
  87. }
  88. </script>
  89. <style>
  90. page{
  91. background: #F5F9FC;
  92. }
  93. </style>
  94. <style lang="scss" scoped>
  95. .block{
  96. background: #FFFFFF;
  97. border-radius: 24rpx;
  98. margin-bottom: 10rpx;
  99. padding: 30rpx;
  100. }
  101. .goods{
  102. .img{
  103. width: 180rpx;
  104. height: 180rpx;
  105. }
  106. .text{
  107. flex: 1;
  108. margin-left: 40rpx;
  109. .title{
  110. font-size: 30rpx;
  111. font-family: PingFangSC-Regular, PingFang SC;
  112. font-weight: 400;
  113. color: #333333;
  114. line-height: 42rpx;
  115. margin-bottom: 20rpx;
  116. min-height: 84rpx;
  117. }
  118. .bottom{
  119. font-size: 28rpx;
  120. font-family: PingFangSC-Regular, PingFang SC;
  121. font-weight: 400;
  122. color: #999999;
  123. line-height: 40rpx;
  124. .price{
  125. font-size: 32rpx;
  126. font-weight: 600;
  127. color: #FFB100;
  128. line-height: 44rpx;
  129. }
  130. }
  131. }
  132. }
  133. .info{
  134. .info-item{
  135. font-size: 30rpx;
  136. font-family: PingFangSC-Regular, PingFang SC;
  137. font-weight: 400;
  138. color: #333333;
  139. line-height: 42rpx;
  140. margin-bottom: 20rpx;
  141. .til{
  142. color: #999;
  143. margin-right: 40rpx;
  144. }
  145. }
  146. }
  147. .status{
  148. padding: 26rpx 0;
  149. background: #FFFFFF;
  150. border-radius: 24rpx;
  151. font-size: 34rpx;
  152. font-weight: 600;
  153. color: #009AEF;
  154. line-height: 48rpx;
  155. text-align: center;
  156. &.status1{
  157. color: #333;
  158. }
  159. &.status2{
  160. color: #999;
  161. }
  162. }
  163. </style>