123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- <template>
- <app-layout>
- <view class='top'>
- <image :src='stepImg.app_image.daily_info'></image>
- <view class='detail-name'>账户{{setting.currency_name ? setting.currency_name : '活力币'}}</view>
- <view class='detail-number'>{{stepUser.step_currency}}
- <text>个</text>
- </view>
- </view>
- <app-tab-nav :tabList="tabList" setTop="180" :activeItem="activeTab" @click="tabStatus"></app-tab-nav>
- <view class="need-height"></view>
- <view class='list' v-for="item in list" :key="item">
- <view class='list-left'>
- <view class='name'>{{item.remark}}</view>
- <view>{{item.created_at}}</view>
- </view>
- <view class='list-right'>
- <text v-if="activeTab == 1">+</text>
- <text v-if="activeTab == 2">-</text>
- <text>{{item.currency}}</text>
- </view>
- </view>
- </app-layout>
- </template>
- <script>
- import appTabNav from "../../../components/basic-component/app-tab-nav/app-tab-nav.vue";
- import { mapState } from "vuex";
- export default {
- data() {
- return {
- tabList: [
- {id:1, name: '收入'},
- {id:2, name: '支出'}
- ],
- stepUser: {
- step_currency: 0
- },
- activeTab: 1,
- page: 2,
- list: [],
- setting: {
- currency_name: ''
- },
- over: false
- }
- },
- components: {
- "app-tab-nav": appTabNav,
- },
- computed: {
- ...mapState({
- userInfo: state => state.user.info,
- stepImg: state => state.mallConfig.plugin.step,
- })
- },
- methods: {
- tabStatus(e) {
- uni.showLoading({
- mask: true,
- title: '加载中...'
- });
- this.list = [];
- this.activeTab = e.currentTarget.dataset.id;
- this.getList();
- },
- getSetting() {
- let that = this;
- that.$request({
- url: that.$api.step.setting,
- }).then(response=>{
- that.getList();
- if(response.code == 0) {
- that.setting = response.data;
- }else {
- uni.showToast({
- title: response.msg,
- icon: 'none',
- duration: 1000
- });
- }
- }).catch(response => {
- that.$hideLoading();
- });
- },
- getList() {
- let that = this;
- that.$request({
- url: that.$api.step.log,
- data:{
- type: that.activeTab
- },
- }).then(response=>{
- that.$hideLoading();
- uni.hideLoading();
- if(response.code == 0) {
- that.list = response.data.list;
- that.stepUser = response.data.stepUser;
- }else {
- uni.showToast({
- title: response.msg,
- icon: 'none',
- duration: 1000
- });
- }
- }).catch(response => {
- that.$hideLoading();
- uni.hideLoading();
- });
- },
- },
- onLoad() { this.$commonLoad.onload();
- let that = this;
- that.$showLoading({
- type: 'global',
- text: '加载中...'
- });
- that.activeTab = 1;
- that.getSetting();
- }
- }
- </script>
- <style scoped lang="scss">
- .need-height {
- height: #{180rpx};
- }
- .top {
- height: #{180rpx};
- width: 100%;
- position: fixed;
- background-color: #f7f7f7;
- top: 0;
- left: 0;
- z-index: 10;
- }
- .top image {
- width: 100%;
- height: #{160rpx};
- }
- .detail-name {
- position: absolute;
- left: #{24rpx};
- top: #{36rpx};
- font-size: #{26rpx};
- color: #fff;
- }
- .detail-number {
- position: absolute;
- bottom: #{36rpx};
- left: #{24rpx};
- font-size: #{48rpx};
- color: white;
- font-family: 'DIN';
- }
- .detail-number text {
- font-size: #{30rpx};
- }
- .list {
- height: #{139rpx};
- width: 100%;
- padding: #{36rpx} #{24rpx};
- background-color: white;
- border-bottom: #{1rpx} #e2e2e2 solid;
- }
- .list-left {
- color: #666;
- font-size: #{24rpx};
- float: left;
- width: 60%;
- }
- .name {
- font-size: #{30rpx};
- color: #353535;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .list-right {
- color: #353535;
- font-size: #{34rpx};
- float: right;
- line-height: #{68rpx};
- }
- </style>
|