detail.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <app-layout>
  3. <view class='balance-detail-head cross-center'>
  4. <view class='dir-left-nowrap cross-center'>
  5. <view class='box-grow-0 key'>交易金额</view>
  6. <view v-if="detail.type == 1" class='box-grow-1 value red'>+{{detail.money}}</view>
  7. <view v-if="detail.type == 2" class='box-grow-1 value blue'>-{{detail.money}}</view>
  8. </view>
  9. </view>
  10. <view class='balance-detail'>
  11. <view class='dir-left-nowrap info'>
  12. <view class='box-grow-0 key'>交易时间</view>
  13. <view class='box-grow-1 value'>{{detail.created_at}}</view>
  14. </view>
  15. <view class='dir-left-nowrap info'>
  16. <view class='box-grow-0 key'>交易详情</view>
  17. <view class='box-grow-1 value'>{{formatstr(detail.desc)}}</view>
  18. </view>
  19. <view v-if="detail.order_no" class='dir-left-nowrap info'>
  20. <view class='box-grow-0 key'>交易单号</view>
  21. <view class='box-grow-1 value'>{{detail.order_no}}</view>
  22. </view>
  23. <view v-if="detail.order_refund_no" class='dir-left-nowrap info'>
  24. <view class='box-grow-0 key'>退款单号</view>
  25. <view class='box-grow-1 value'>{{detail.order_refund_no}}</view>
  26. </view>
  27. </view>
  28. </app-layout>
  29. </template>
  30. <script>
  31. export default {
  32. name: "detail",
  33. data() {
  34. return {
  35. detail: null,
  36. }
  37. },
  38. onLoad: function(options) {
  39. const self = this;
  40. this.$showLoading({
  41. title: `加载中`
  42. });
  43. self.$request({
  44. url: self.$api.balance.log_detail,
  45. data: {
  46. id: options.id,
  47. }
  48. }).then((info) => {
  49. if (info.code === 0) {
  50. this.detail = info.data.detail;
  51. }
  52. this.$hideLoading();
  53. }).catch((info) => {
  54. this.$hideLoading();
  55. })
  56. },
  57. methods: {
  58. formatstr(str) {
  59. let index = str.lastIndexOf(' ')
  60. return str = str.substring(index + 1)
  61. },
  62. },
  63. }
  64. </script>
  65. <style scoped lang="scss">
  66. $fontColor: #999999;
  67. .balance-detail-head {
  68. background: #FFFFFF;
  69. height: #{140rpx};
  70. font-size: #{28rpx};
  71. padding: 0 #{24rpx};
  72. .key {
  73. color: $fontColor;
  74. margin-right: #{40}rpx;
  75. }
  76. .value {
  77. font-size: #{38rpx};
  78. font-weight: bold;
  79. }
  80. .value.red {
  81. color: #ff4544;
  82. }
  83. .value.blue {
  84. color: #3fc24c;
  85. }
  86. }
  87. $line: #{1px} solid #ededed;
  88. .balance-detail {
  89. background: #FFFFFF;
  90. font-size: #{28rpx};
  91. border-top: $line;
  92. border-bottom: $line;
  93. padding: #{40rpx} #{24rpx} #{8rpx};
  94. .info {
  95. margin-bottom: #{32}rpx;
  96. .key {
  97. color: $fontColor;
  98. margin-right: #{40}rpx;
  99. }
  100. .value {
  101. color: #666666;
  102. }
  103. }
  104. }
  105. </style>