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

tabs切换速度调整

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