growList.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <!-- 成长值 -->
  3. <view class="">
  4. <view style="background-color: $color-white !important;">
  5. <u-navbar :back-text="i18n('Back')" :back-text-style="backStyle" back-icon-color="#fff" title-color="#fff"
  6. :background="background" title-width="300" :title="i18n('getGrowList')"></u-navbar>
  7. </view>
  8. <uni-list v-for="(listDetail,index) in growDetails" :key="index">
  9. <uni-list-item :title="$i18n.locale=='zh'?listDetail.title:listDetail.titleEn"
  10. :note="listDetail.createDate|time('YYYY-MM-DD HH:mm:ss')" :rightText="`+${listDetail.growth}`" />
  11. </uni-list>
  12. <view v-show="growDetails==null">
  13. <view class="text-title">{{$i18n.locale=='zh'?'暂无记录':'No record'}}......</view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import moment from 'moment'
  19. export default {
  20. components: {
  21. moment
  22. },
  23. data() {
  24. return {
  25. background: {
  26. backgroundImage: 'linear-gradient(270deg, #4BC0E2 0%, #538BE7 100%)',
  27. },
  28. backStyle: {
  29. color: '#FFFFFF',
  30. },
  31. growDetails: [],
  32. // page: 1,
  33. // flag: false,
  34. };
  35. },
  36. onShow() {
  37. this.getGrowDetail();
  38. },
  39. filters: {
  40. twoDecimal(value) {
  41. return parseFloat(string(value)).toFixed(2);
  42. },
  43. time(data, type) {
  44. return moment(data).format(type);
  45. }
  46. },
  47. methods: {
  48. i18n(data) {
  49. return this.$t('common.' + data);
  50. },
  51. async getGrowDetail() {
  52. const res = await this.$myRequest({
  53. url: '/uc/umsUserGrowthDetailss/getGrowthDetailsPage',
  54. data: {
  55. }
  56. });
  57. // console.log(res, '--------------------------');
  58. if (res.data) {
  59. this.growDetails = res.data.umsUserGrowthDetailss
  60. } else {
  61. this.growDetails = {}
  62. }
  63. },
  64. },
  65. }
  66. </script>
  67. <style lang="scss" scoped>
  68. .text-title {
  69. width: 92%;
  70. margin-left: 4%;
  71. text-align: center;
  72. margin-top: 20rpx;
  73. font-size: 32rpx;
  74. color: #b0b0b0;
  75. }
  76. </style>