detail.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <app-layout>
  3. <view class='top'>
  4. <image :src='stepImg.app_image.daily_info'></image>
  5. <view class='detail-name'>账户{{setting.currency_name ? setting.currency_name : '活力币'}}</view>
  6. <view class='detail-number'>{{stepUser.step_currency}}
  7. <text>个</text>
  8. </view>
  9. </view>
  10. <app-tab-nav :tabList="tabList" setTop="180" :activeItem="activeTab" @click="tabStatus"></app-tab-nav>
  11. <view class="need-height"></view>
  12. <view class='list' v-for="item in list" :key="item">
  13. <view class='list-left'>
  14. <view class='name'>{{item.remark}}</view>
  15. <view>{{item.created_at}}</view>
  16. </view>
  17. <view class='list-right'>
  18. <text v-if="activeTab == 1">+</text>
  19. <text v-if="activeTab == 2">-</text>
  20. <text>{{item.currency}}</text>
  21. </view>
  22. </view>
  23. </app-layout>
  24. </template>
  25. <script>
  26. import appTabNav from "../../../components/basic-component/app-tab-nav/app-tab-nav.vue";
  27. import { mapState } from "vuex";
  28. export default {
  29. data() {
  30. return {
  31. tabList: [
  32. {id:1, name: '收入'},
  33. {id:2, name: '支出'}
  34. ],
  35. stepUser: {
  36. step_currency: 0
  37. },
  38. activeTab: 1,
  39. page: 2,
  40. list: [],
  41. setting: {
  42. currency_name: ''
  43. },
  44. over: false
  45. }
  46. },
  47. components: {
  48. "app-tab-nav": appTabNav,
  49. },
  50. computed: {
  51. ...mapState({
  52. userInfo: state => state.user.info,
  53. stepImg: state => state.mallConfig.plugin.step,
  54. })
  55. },
  56. methods: {
  57. tabStatus(e) {
  58. uni.showLoading({
  59. mask: true,
  60. title: '加载中...'
  61. });
  62. this.list = [];
  63. this.activeTab = e.currentTarget.dataset.id;
  64. this.getList();
  65. },
  66. getSetting() {
  67. let that = this;
  68. that.$request({
  69. url: that.$api.step.setting,
  70. }).then(response=>{
  71. that.getList();
  72. if(response.code == 0) {
  73. that.setting = response.data;
  74. }else {
  75. uni.showToast({
  76. title: response.msg,
  77. icon: 'none',
  78. duration: 1000
  79. });
  80. }
  81. }).catch(response => {
  82. that.$hideLoading();
  83. });
  84. },
  85. getList() {
  86. let that = this;
  87. that.$request({
  88. url: that.$api.step.log,
  89. data:{
  90. type: that.activeTab
  91. },
  92. }).then(response=>{
  93. that.$hideLoading();
  94. uni.hideLoading();
  95. if(response.code == 0) {
  96. that.list = response.data.list;
  97. that.stepUser = response.data.stepUser;
  98. }else {
  99. uni.showToast({
  100. title: response.msg,
  101. icon: 'none',
  102. duration: 1000
  103. });
  104. }
  105. }).catch(response => {
  106. that.$hideLoading();
  107. uni.hideLoading();
  108. });
  109. },
  110. },
  111. onLoad() { this.$commonLoad.onload();
  112. let that = this;
  113. that.$showLoading({
  114. type: 'global',
  115. text: '加载中...'
  116. });
  117. that.activeTab = 1;
  118. that.getSetting();
  119. }
  120. }
  121. </script>
  122. <style scoped lang="scss">
  123. .need-height {
  124. height: #{180rpx};
  125. }
  126. .top {
  127. height: #{180rpx};
  128. width: 100%;
  129. position: fixed;
  130. background-color: #f7f7f7;
  131. top: 0;
  132. left: 0;
  133. z-index: 10;
  134. }
  135. .top image {
  136. width: 100%;
  137. height: #{160rpx};
  138. }
  139. .detail-name {
  140. position: absolute;
  141. left: #{24rpx};
  142. top: #{36rpx};
  143. font-size: #{26rpx};
  144. color: #fff;
  145. }
  146. .detail-number {
  147. position: absolute;
  148. bottom: #{36rpx};
  149. left: #{24rpx};
  150. font-size: #{48rpx};
  151. color: white;
  152. font-family: 'DIN';
  153. }
  154. .detail-number text {
  155. font-size: #{30rpx};
  156. }
  157. .list {
  158. height: #{139rpx};
  159. width: 100%;
  160. padding: #{36rpx} #{24rpx};
  161. background-color: white;
  162. border-bottom: #{1rpx} #e2e2e2 solid;
  163. }
  164. .list-left {
  165. color: #666;
  166. font-size: #{24rpx};
  167. float: left;
  168. width: 60%;
  169. }
  170. .name {
  171. font-size: #{30rpx};
  172. color: #353535;
  173. overflow: hidden;
  174. text-overflow: ellipsis;
  175. white-space: nowrap;
  176. }
  177. .list-right {
  178. color: #353535;
  179. font-size: #{34rpx};
  180. float: right;
  181. line-height: #{68rpx};
  182. }
  183. </style>