my_bill.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view class="bill">
  3. <view class="bill_list flexB" v-for="item in list" :key="item.id">
  4. <view class="list_left flexS">
  5. <image src="../../static/imgs/billIcon.png" mode=""></image>
  6. <view>
  7. <view :style="{ color: item.is_refund == 1 ? '#4CD964' : '' }">{{ item.is_refund == 0 ? '付款成功' : '退款成功' }}</view>
  8. <text>第{{ item.season}}届大卫博士创业{{ item.type == 1 ? '密训' : '实战' }}营</text>
  9. </view>
  10. </view>
  11. <view class="list_right">
  12. <text v-if="item.is_refund == 0">-{{ item.money }}</text>
  13. <text v-else style="color:#4CD964">+{{ item.money }}</text>
  14. </view>
  15. </view>
  16. <view class="noBill" v-if="list.length == 0">--暂无账单--</view>
  17. </view>
  18. </template>
  19. <script>
  20. import { signList } from '../../api/sign.js';
  21. export default {
  22. data() {
  23. return {
  24. list: [] //账单列表
  25. };
  26. },
  27. onLoad() {
  28. this.getBill();
  29. },
  30. methods: {
  31. //获取账单列表
  32. getBill() {
  33. signList().then(res => {
  34. if (res.code == 200) {
  35. this.list = res.data.list;
  36. } else {
  37. uni.showModal({
  38. content: res.message || '请求失败',
  39. showCancel: false
  40. });
  41. }
  42. });
  43. }
  44. }
  45. };
  46. </script>
  47. <style lang="scss" scoped>
  48. .noBill {
  49. width: 100%;
  50. text-align: center;
  51. margin-top: 20rpx;
  52. font-size: 28rpx;
  53. color: #666;
  54. }
  55. .bill_list {
  56. height: 128rpx;
  57. width: 100%;
  58. background-color: #fff;
  59. border-bottom: 1rpx solid #f9f9f9;
  60. padding: 0 30rpx;
  61. box-sizing: border-box;
  62. .list_left {
  63. image {
  64. height: 88rpx;
  65. width: 88rpx;
  66. margin-right: 16rpx;
  67. }
  68. > view {
  69. color: #656565;
  70. view {
  71. font-size: 32rpx;
  72. }
  73. text {
  74. font-size: 24rpx;
  75. }
  76. }
  77. }
  78. .list_right {
  79. color: #ea4a41;
  80. text {
  81. font-size: 40rpx;
  82. }
  83. }
  84. }
  85. </style>