1
0

detail.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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. title: '加载中...'
  60. });
  61. this.list = [];
  62. this.activeTab = e.currentTarget.dataset.id;
  63. this.getList();
  64. },
  65. getSetting() {
  66. let that = this;
  67. that.$request({
  68. url: that.$api.step.setting,
  69. }).then(response=>{
  70. that.getList();
  71. if(response.code == 0) {
  72. that.setting = response.data;
  73. }else {
  74. uni.showToast({
  75. title: response.msg,
  76. icon: 'none',
  77. duration: 1000
  78. });
  79. }
  80. }).catch(response => {
  81. that.$hideLoading();
  82. });
  83. },
  84. getList() {
  85. let that = this;
  86. that.$request({
  87. url: that.$api.step.log,
  88. data:{
  89. type: that.activeTab
  90. },
  91. }).then(response=>{
  92. that.$hideLoading();
  93. uni.hideLoading();
  94. if(response.code == 0) {
  95. that.list = response.data.list;
  96. that.stepUser = response.data.stepUser;
  97. }else {
  98. uni.showToast({
  99. title: response.msg,
  100. icon: 'none',
  101. duration: 1000
  102. });
  103. }
  104. }).catch(response => {
  105. that.$hideLoading();
  106. uni.hideLoading();
  107. });
  108. },
  109. },
  110. onLoad() {
  111. let that = this;
  112. that.$showLoading({
  113. type: 'global',
  114. text: '加载中...'
  115. });
  116. that.activeTab = 1;
  117. that.getSetting();
  118. }
  119. }
  120. </script>
  121. <style scoped lang="scss">
  122. .need-height {
  123. height: #{180rpx};
  124. }
  125. .top {
  126. height: #{180rpx};
  127. width: 100%;
  128. position: fixed;
  129. background-color: #f7f7f7;
  130. top: 0;
  131. left: 0;
  132. z-index: 10;
  133. }
  134. .top image {
  135. width: 100%;
  136. height: #{160rpx};
  137. }
  138. .detail-name {
  139. position: absolute;
  140. left: #{24rpx};
  141. top: #{36rpx};
  142. font-size: #{26rpx};
  143. color: #fff;
  144. }
  145. .detail-number {
  146. position: absolute;
  147. bottom: #{36rpx};
  148. left: #{24rpx};
  149. font-size: #{48rpx};
  150. color: white;
  151. font-family: 'DIN';
  152. }
  153. .detail-number text {
  154. font-size: #{30rpx};
  155. }
  156. .list {
  157. height: #{139rpx};
  158. width: 100%;
  159. padding: #{36rpx} #{24rpx};
  160. background-color: white;
  161. border-bottom: #{1rpx} #e2e2e2 solid;
  162. }
  163. .list-left {
  164. color: #666;
  165. font-size: #{24rpx};
  166. float: left;
  167. width: 60%;
  168. }
  169. .name {
  170. font-size: #{30rpx};
  171. color: #353535;
  172. overflow: hidden;
  173. text-overflow: ellipsis;
  174. white-space: nowrap;
  175. }
  176. .list-right {
  177. color: #353535;
  178. font-size: #{34rpx};
  179. float: right;
  180. line-height: #{68rpx};
  181. }
  182. </style>