Files
dvcp_v2_wxcp_app/src/apps/AppCreditPoints/AppCreditPoints.vue
2022-05-19 17:28:10 +08:00

60 lines
1.4 KiB
Vue

<template>
<section class="AppCreditPoints">
<AiTabPanes :tabs="tabList" v-model="tabIndex" background="#4181FF"/>
<family-rank v-if="tabIndex == 0" :showDetail="showDetail"/>
<user-rank v-if="tabIndex == 1" :showDetail="showDetail"/>
<sys-user-integral v-if="tabIndex==2"/>
</section>
</template>
<script>
import {mapState} from 'vuex'
import userRank from './components/userRank.vue'
import familyRank from './components/familyRank.vue'
import SysUserIntegral from "./components/sysUserIntegral";
export default {
name: "AppCreditPoints",
appName: "我的积分",
computed: {
...mapState(['user', 'token'])
},
components: {SysUserIntegral, userRank, familyRank},
data() {
return {
tabList: ['家庭积分', '个人积分', "员工积分"],
tabIndex: 0,
showDetail: true
}
},
onLoad(options) {
if (options.type == 'detail') {
this.showDetail = true
}
uni.setNavigationBarTitle({
title: options.title
})
},
onReachBottom() {
uni.$emit("reachBottom")
},
onShow(){
let index = JSON.parse(JSON.stringify(this.tabIndex))
this.tabIndex = null
this.$nextTick(()=>this.tabIndex = index)
},
methods: {
tabClick(index) {
this.tabIndex = index
}
},
}
</script>
<style scoped lang="scss">
.AppCreditPoints {
width: 100vw;
overflow-x: hidden;
background-color: #f3f6f9;
min-height: 100vh;
}
</style>