|
@@ -9,17 +9,16 @@
|
|
|
<view class="navbar">
|
|
<view class="navbar">
|
|
|
<view class="nav-item" v-for="(item, index) in navList" :key="index"
|
|
<view class="nav-item" v-for="(item, index) in navList" :key="index"
|
|
|
:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
|
|
:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
- <swiper class="swiper-box" :current="tabCurrentIndex" duration="300" @change="changeTab"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <swiper class="swiper-box" :current="tabCurrentIndex" duration="300" @change="changeTab">
|
|
|
<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
|
|
<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
|
|
|
<!-- 空白页 -->
|
|
<!-- 空白页 -->
|
|
|
- <!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
|
|
|
|
|
|
|
+ <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
|
|
|
<!-- 推广奖励 -->
|
|
<!-- 推广奖励 -->
|
|
|
- <scroll-view class="scorll" scroll-y="true" >
|
|
|
|
|
|
|
+ <scroll-view class="scorll" scroll-y="true">
|
|
|
<view class="cost">
|
|
<view class="cost">
|
|
|
- <view class="award" v-for="item in 10">
|
|
|
|
|
|
|
+ <view class="award" v-for="item in tabItem ">
|
|
|
<view class="award-left">
|
|
<view class="award-left">
|
|
|
<view class="text">消费赠送</view>
|
|
<view class="text">消费赠送</view>
|
|
|
<view class="time">2021-8-26 09:30</view>
|
|
<view class="time">2021-8-26 09:30</view>
|
|
@@ -28,20 +27,30 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
</swiper-item>
|
|
</swiper-item>
|
|
|
</swiper>
|
|
</swiper>
|
|
|
- </view>
|
|
|
|
|
-</template>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ </view>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
<script>
|
|
<script>
|
|
|
-export default {
|
|
|
|
|
- data () {
|
|
|
|
|
- return {
|
|
|
|
|
- height: '',
|
|
|
|
|
|
|
+ // 组件
|
|
|
|
|
+ import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
|
|
|
|
|
+ import empty from '@/components/empty';
|
|
|
|
|
+ //接口
|
|
|
|
|
+ import { integral } from '@/api/wallet.js';
|
|
|
|
|
+ export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ empty,
|
|
|
|
|
+ uniLoadMore
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ height: '',
|
|
|
tabCurrentIndex: 0,
|
|
tabCurrentIndex: 0,
|
|
|
- navList: [{
|
|
|
|
|
- state: 1,
|
|
|
|
|
|
|
+ navList: [
|
|
|
|
|
+ {
|
|
|
|
|
+ state: 0,
|
|
|
text: '收入',
|
|
text: '收入',
|
|
|
loadingType: 'more',
|
|
loadingType: 'more',
|
|
|
orderList: [],
|
|
orderList: [],
|
|
@@ -49,7 +58,7 @@ export default {
|
|
|
limit: 10 //每次信息条数
|
|
limit: 10 //每次信息条数
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- state: 2,
|
|
|
|
|
|
|
+ state: 1,
|
|
|
text: '支出',
|
|
text: '支出',
|
|
|
loadingType: 'more',
|
|
loadingType: 'more',
|
|
|
orderList: [],
|
|
orderList: [],
|
|
@@ -59,50 +68,75 @@ export default {
|
|
|
],
|
|
],
|
|
|
list: [],
|
|
list: [],
|
|
|
money: ''
|
|
money: ''
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- methods: {
|
|
|
|
|
- //swiper 切换
|
|
|
|
|
- changeTab (e) {
|
|
|
|
|
- this.tabCurrentIndex = e.target.current;
|
|
|
|
|
- this.loadData('tabChange')
|
|
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
- //顶部tab点击
|
|
|
|
|
- tabClick(index) {
|
|
|
|
|
- this.tabCurrentIndex = index;
|
|
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ //swiper 切换
|
|
|
|
|
+ changeTab(e) {
|
|
|
|
|
+ this.tabCurrentIndex = e.target.current;
|
|
|
|
|
+ this.loadData('tabChange')
|
|
|
|
|
+ },
|
|
|
|
|
+ //顶部tab点击
|
|
|
|
|
+ tabClick(index) {
|
|
|
|
|
+ this.tabCurrentIndex = index;
|
|
|
|
|
+ },
|
|
|
|
|
+ loadData(type) {
|
|
|
|
|
+ let obj = this
|
|
|
|
|
+ let index = obj.tabCurrentIndex
|
|
|
|
|
+ let navItem = obj.navList[index]
|
|
|
|
|
+ if(navItem.loadingType == 'loading' || navItem.loadingType == 'noMore') {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if(type == 'tabChange' && navItem.loaded == 'loaded') {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ navItem.loadingType == 'loading';
|
|
|
|
|
+ integral({
|
|
|
|
|
+ page: navItem.page,
|
|
|
|
|
+ limit: navItem.limit
|
|
|
|
|
+ },navItem.state).then( res => {
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
-</script>
|
|
|
|
|
-
|
|
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
|
.container {
|
|
.container {
|
|
|
width: 750rpx;
|
|
width: 750rpx;
|
|
|
height: 1334rpx;
|
|
height: 1334rpx;
|
|
|
background-color: #f1f1f1;
|
|
background-color: #f1f1f1;
|
|
|
|
|
+
|
|
|
.header {
|
|
.header {
|
|
|
|
|
+ position: relative;
|
|
|
image {
|
|
image {
|
|
|
width: 750rpx;
|
|
width: 750rpx;
|
|
|
height: 400rpx;
|
|
height: 400rpx;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.money {
|
|
.money {
|
|
|
font-size: 72rpx;
|
|
font-size: 72rpx;
|
|
|
font-family: PingFang SC;
|
|
font-family: PingFang SC;
|
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
|
color: #3F7C1F;
|
|
color: #3F7C1F;
|
|
|
- top: 15%;
|
|
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
|
|
+ top: 50%;
|
|
|
left: 50%;
|
|
left: 50%;
|
|
|
- transform: translate(-50%);
|
|
|
|
|
|
|
+ transform: translate(-50% ,-50%);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.swiper-box {
|
|
.swiper-box {
|
|
|
height: calc(100% - 500rpx);
|
|
height: calc(100% - 500rpx);
|
|
|
background-color: #FFFFFF;
|
|
background-color: #FFFFFF;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.scorll {
|
|
.scorll {
|
|
|
height: 90%;
|
|
height: 90%;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.navbar {
|
|
.navbar {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
height: 100rpx;
|
|
height: 100rpx;
|
|
@@ -112,7 +146,7 @@ export default {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
z-index: 10;
|
|
z-index: 10;
|
|
|
margin-top: 25rpx;
|
|
margin-top: 25rpx;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.nav-item {
|
|
.nav-item {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
display: flex;
|
|
display: flex;
|
|
@@ -122,10 +156,10 @@ export default {
|
|
|
font-size: 15px;
|
|
font-size: 15px;
|
|
|
color: #999999;
|
|
color: #999999;
|
|
|
position: relative;
|
|
position: relative;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
&.current {
|
|
&.current {
|
|
|
color: #333333;
|
|
color: #333333;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
&:after {
|
|
&:after {
|
|
|
content: '';
|
|
content: '';
|
|
|
position: absolute;
|
|
position: absolute;
|
|
@@ -139,11 +173,12 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.cost {
|
|
.cost {
|
|
|
width: 750rpx;
|
|
width: 750rpx;
|
|
|
height: auto;
|
|
height: auto;
|
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.award {
|
|
.award {
|
|
|
width: 701rpx;
|
|
width: 701rpx;
|
|
|
height: 132rpx;
|
|
height: 132rpx;
|
|
@@ -152,13 +187,13 @@ export default {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.award-left {
|
|
.award-left {
|
|
|
width: 221rpx;
|
|
width: 221rpx;
|
|
|
height: 40rpx;
|
|
height: 40rpx;
|
|
|
margin-left: 30rpx;
|
|
margin-left: 30rpx;
|
|
|
margin-bottom: 35rpx;
|
|
margin-bottom: 35rpx;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.text {
|
|
.text {
|
|
|
width: 182rpx;
|
|
width: 182rpx;
|
|
|
height: 30rpx;
|
|
height: 30rpx;
|
|
@@ -168,7 +203,7 @@ export default {
|
|
|
color: #666666;
|
|
color: #666666;
|
|
|
margin-bottom: 16rpx;
|
|
margin-bottom: 16rpx;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.time {
|
|
.time {
|
|
|
width: 221rpx;
|
|
width: 221rpx;
|
|
|
height: 20rpx;
|
|
height: 20rpx;
|
|
@@ -178,7 +213,7 @@ export default {
|
|
|
color: #AEAEAE;
|
|
color: #AEAEAE;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.award-right {
|
|
.award-right {
|
|
|
font-size: 36rpx;
|
|
font-size: 36rpx;
|
|
|
font-family: PingFang SC;
|
|
font-family: PingFang SC;
|
|
@@ -188,5 +223,5 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|