detail.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <div class="xf_detail">
  3. <!-- <div class="card">
  4. <image src="../../static/images/xitong.png" mode="" class="item_icon"></image>
  5. <div class="middle">
  6. <div class="name">系统奖励(翻倍)</div>
  7. <div class="time">{{formatTime(detail.order_time)}}</div>
  8. </div>
  9. <div class="total_nums">+{{detail.xuefen}}</div>
  10. </div> -->
  11. <div class="table">
  12. <div class="t_header">
  13. <div class="item">商品名称</div>
  14. <div class="item">数量</div>
  15. <div class="item">学分</div>
  16. </div>
  17. <div class="list" v-for="item in detail.goods" :key="item.id">
  18. <div class="item">{{item.good ? item.good.name :''}}</div>
  19. <div class="item">{{item.nums}}</div>
  20. <div class="item">{{item.xuefen}}</div>
  21. </div>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. detail: {}
  30. }
  31. },
  32. onLoad(options) {
  33. this.getDetail(options.id)
  34. },
  35. methods: {
  36. getDetail(id) {
  37. this.$u.get('/dwbs/order', {
  38. id: id
  39. }).then(res => {
  40. console.log(res)
  41. this.detail = res.data
  42. })
  43. },
  44. //格式化时间
  45. formatTime(time) {
  46. return time.replace(/-/g, '/');
  47. },
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .xf_detail {
  53. padding: 14px;
  54. }
  55. .card {
  56. display: flex;
  57. align-items: center;
  58. padding: 16px 0;
  59. .item_icon {
  60. width: 40px;
  61. height: 40px;
  62. margin-right: 10px;
  63. }
  64. .middle {
  65. flex: 1;
  66. .name {
  67. font-size: 15px;
  68. color: #333333;
  69. }
  70. .time {
  71. margin-top: 8px;
  72. font-size: 14px;
  73. color: #999999;
  74. }
  75. }
  76. .total_nums {
  77. font-size: 18px;
  78. font-weight: 500;
  79. color: #FB231F;
  80. }
  81. }
  82. .table {
  83. margin-top: 20px;
  84. .t_header,
  85. .list {
  86. display: flex;
  87. height: 44px;
  88. line-height: 44px;
  89. border-radius: 5px;
  90. font-size: 17px;
  91. .item {
  92. flex: 1;
  93. text-align: center;
  94. }
  95. }
  96. .t_header {
  97. background: linear-gradient(90deg, #FFA267 0%, #FF7B3A 100%);
  98. color: #FFF5F5;
  99. }
  100. .list {
  101. color: #3D3D3D;
  102. background: #F9F9FB;
  103. margin-top: 8px;
  104. }
  105. }
  106. </style>