Commit db44a5b5 authored by 刘文虎's avatar 刘文虎

tabs切换速度调整

parent ffa80c58
Pipeline #3867 canceled with stages
......@@ -2,8 +2,8 @@
"name" : "扳手记账",
"appid" : "__UNI__EDB8C7C",
"description" : "",
"versionName" : "1.1.2",
"versionCode" : 112,
"versionName" : "1.1.3",
"versionCode" : 113,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
......
......@@ -23,7 +23,7 @@
></u-tabs-swiper>
</view>
<view class="swiper-box">
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" style="height:100%">
<swiper duration="200" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" style="height:100%">
<swiper-item class="swiper-item" v-for="(listData, index) in list" :key="index">
<scroll-view
scroll-y
......
......@@ -45,7 +45,7 @@ export default {
props: {
detail: {
type: Object,
default: () => {}
// default: () => {}
},
current: {
type: Number,
......
......@@ -23,7 +23,7 @@
></u-tabs-swiper>
</view>
<view class="swiper-box">
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" style="height:100%">
<swiper duration="200" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" style="height:100%">
<swiper-item class="swiper-item" v-for="(listData, index) in list" :key="index">
<scroll-view
scroll-y
......@@ -40,7 +40,7 @@
<NoData v-if="noData(index)" text="当前暂无邀请记录" customStyle="margin-top: 0rpx;" imageName="bill/wuqiankuanxinxi@3x.png" />
<template v-else>
<view class="container" v-if="listData&&listData.length">
<bill-detail v-for="item in listData" :key="item.id" :detail="item" :current="current" @cellClick="cellClick"></bill-detail>
<bill-detail v-for="(item, itemIndex) in listData" :key="itemIndex" :detail="item" :current="current" @cellClick="cellClick"></bill-detail>
</view>
<view class="loading-view" v-if="!getCurrentPage(index).loaded && !getCurrentPage(index).freshing"><u-loading mode="flower"></u-loading></view>
......
......@@ -27,17 +27,10 @@ export default {
props: {
detail: {
type: Object,
default: () => {}
// default: () => {}
}
},
computed: {
redAmount() {
let amount = this.detail.amount;
if (!amount) {
return false;
}
return parseFloat(amount) < 0;
}
},
data() {
return {
......
......@@ -21,7 +21,7 @@
></u-tabs-swiper>
</view>
<view class="swiper-box">
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" style="height:100%">
<swiper duration="200" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" style="height:100%">
<swiper-item class="swiper-item" v-for="(listData, index) in list" :key="index">
<scroll-view
scroll-y
......@@ -38,14 +38,7 @@
<NoData v-if="noData(index)" text="当前暂无邀请记录" customStyle="margin-top: 0rpx;" imageName="bill/wuqiankuanxinxi@3x.png" />
<template v-else>
<view class="container" v-if="listData && listData.length">
<bill-detail
v-for="item in listData"
:key="item.id"
:detail="item"
:current="current"
@cellClick="cellClick"
@invalidClick="invalidClick"
></bill-detail>
<bill-detail v-for="(item, itemIndex) in listData" :key="itemIndex" :detail="item" :current="current" @cellClick="cellClick" @invalidClick="invalidClick"></bill-detail>
</view>
<view class="loading-view" v-if="!getCurrentPage(index).loaded && !getCurrentPage(index).freshing"><u-loading mode="flower"></u-loading></view>
......@@ -93,32 +86,7 @@ export default {
invalidCount: 0
},
list: {
'0': [
{
memberName: '昵称',
happenTime: '2022-07-08 00:58:57',
status: {
code: 'WAIT',
desc: '未付费'
}
},
{
memberName: '昵称',
happenTime: '2022-07-08 00:58:57',
status: {
code: 'INVALID',
desc: '无效推广'
}
},
{
memberName: '我的昵称',
happenTime: '2022-06-25 00:58:57',
status: {
code: 'DONE',
desc: '已付费'
}
}
],
'0': [],
'1': [],
'2': [],
'3': []
......
<template>
<!-- 账单 -->
<view class="bill footer">
<u-navbar :is-back="false" :background="{background: 'transparent'}" :border-bottom="false">
<u-navbar :is-back="false" :background="{ background: 'transparent' }" :border-bottom="false">
<view class="navbar-view">
<view class="title-view">账单</view>
<view class="search-view" hover-class="u-hover-class" @click="$u.throttle(handleClickSearch, 500)">
<view class="search-view" hover-class="u-hover-class" @click="$u.throttle(handleClickSearch, 500)">
<view class="image-view"><image :src="searchImage"></image></view>
<view>搜索账单备注、地址</view>
</view>
</view>
</u-navbar>
<view class="tabs-view">
<u-tabs
<u-tabs
height="62"
activeColor="#02A074"
inactive-color="#333333"
......@@ -27,19 +27,14 @@
></u-tabs>
</view>
<view class="bill-view">
<view class="content-view" v-show="current == 1"><ChartView ref="chart-view"/></view>
<view class="content-view" v-show="current == 1"><ChartView ref="chart-view" /></view>
<view class="content-view" v-show="current == 0"><scroll-box ref="scroll-box"></scroll-box></view>
</view>
<u-toast ref="uToast" />
<PopExport ref="pop-export-bill" :visible.sync="visible" @confirm="handleClickConfirm" />
<mid-popup ref="midPopup" @afterSave="afterSave"></mid-popup>
<u-tabbar :list="tabbar" :mid-button="true" :mid-button-size="80" :before-switch="beforeSwitch"></u-tabbar>
<PopNormal
:visible.sync="visible1"
type="renew"
confirmText="续费会员"
cancelText="取消"
/>
<PopNormal :visible.sync="visible1" type="renew" confirmText="续费会员" cancelText="取消" />
</view>
</template>
......@@ -54,8 +49,8 @@ import { keepTwoDecimalFull, checkLoginAndVip, checkToken } from '@/utils/common
import { downLoad } from '@/utils/download.js';
import { getList, getStatistics } from '@/api/bill/index.js';
import { exportBill } from '@/api/bill/index.js';
import PopNormal from '@/components/pop-normal'
import PopNormal from '@/components/pop-normal';
import { mapGetters } from 'vuex';
export default {
components: {
MidPopup,
......@@ -84,50 +79,58 @@ export default {
};
},
computed: {
baseUrl () {
return process.uniEnv.qn_base_url;
},
...mapGetters(['userInfo']),
baseUrl() {
return process.uniEnv.qn_base_url;
},
tabs() {
return [{
name: '账单流水'
},{
name: '数据分析'
}]
return [
{
name: '账单流水'
},
{
name: '数据分析'
}
];
},
searchImage () {
return this.baseUrl + 'sousuo@3x.png';
},
searchImage() {
return this.baseUrl + 'sousuo@3x.png';
}
},
onLoad() {
// this.initDate();
uni.$on('bill-list-reload', res => {
setTimeout(() => {
this.reloadData();
if(this.userInfo&&this.userInfo.id){
this.reloadData();
}
}, 1500);
});
},
onReady() {
this.firstEnter = false
this.firstEnter = false;
},
onUnload() {
uni.$off('bill-list-reload');
},
onShow() {
if (!this.firstEnter) {
this.reloadData()
if(this.userInfo&&this.userInfo.id){
this.reloadData();
}
// this.getMouthStatistics();
}
},
methods: {
reloadData() {
if (this.current == 0) {
this.$nextTick(()=> {
this.$nextTick(() => {
this.$refs['scroll-box'].reloadList();
})
});
} else if (this.current == 1) {
this.$nextTick(()=> {
this.$nextTick(() => {
this.$refs['chart-view'].reloadData();
})
});
}
},
customBack() {
......@@ -188,28 +191,28 @@ export default {
// };
// },
change(index) {
console.log('-----------------', index)
this.current = index
this.reloadData()
console.log('-----------------', index);
this.current = index;
this.reloadData();
},
handlClickOut() {
checkLoginAndVip((res) => {
checkLoginAndVip(res => {
if (res) {
this.visible1 = true
this.visible1 = true;
} else {
this.visible = true;
this.visible = true;
}
});
},
handleClickSearch() {
this.$u.route({
url: 'pages/bill/search/index',
url: 'pages/bill/search/index'
});
},
handleClickConfirm(range) {
console.log(range);
let startTime = "";
let endTime = "";
let startTime = '';
let endTime = '';
if (range) {
startTime = range[0] + ' 00:00:00';
endTime = range[1] + ' 23:59:59';
......@@ -280,7 +283,7 @@ export default {
align-items: center;
justify-content: space-between;
width: 100%;
padding: 0 32rpx;
padding: 0 32rpx;
.title-view {
font-size: 32rpx;
color: #333333;
......@@ -307,7 +310,6 @@ export default {
}
}
.tabs-view {
margin: 12rpx 0 24rpx 0;
// display: flex;
......
......@@ -49,19 +49,23 @@ export default {
};
},
computed: {
...mapGetters(['platform'])
...mapGetters(['platform','userInfo'])
},
onReady() {
this.ready=true
this.date = this.parseTime(new Date(), '{y}-{m}-{d}');
this.month = this.parseTime(new Date(), '{y}-{m}') + '-01';
this.getList();
this.getSignList();
if(this.userInfo&&this.userInfo.id){
this.getList();
this.getSignList()
}
},
onShow() {
if (!this.firstEnter) {
this.getList();
this.getSignList()
if(this.userInfo&&this.userInfo.id){
this.getList();
this.getSignList()
}
}
if(this.platform==='4'){
plus.runtime.setBadgeNumber(0)
......
......@@ -37,7 +37,7 @@
></u-tabs-swiper>
</view>
<view class="swiper-box">
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" style="height:100%">
<swiper duration="200" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" style="height:100%">
<swiper-item class="swiper-item" v-for="(listData, index) in list" :key="index">
<scroll-view
scroll-y
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment