From 0b2357a173a2bc52f3532bfcf93ff31daf226231 Mon Sep 17 00:00:00 2001 From: zhouwenxuan <1175765986@qq.com> Date: 星期三, 06 九月 2023 14:44:23 +0800 Subject: [PATCH] 导航栏退出登录 --- pages/tabBar/response/response.vue | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/pages/tabBar/response/response.vue b/pages/tabBar/response/response.vue index cd8a87f..64cee7d 100644 --- a/pages/tabBar/response/response.vue +++ b/pages/tabBar/response/response.vue @@ -7,13 +7,16 @@ <!-- 真正的导航栏内容 --> <view class="navBar"> <view class="barText">叫应记录</view> + <view > + <u-button type="text" @click="loginOut" style="color: blue;margin-right: 5px;">退出</u-button> + </view> </view> </view> <div v-if="loading" style='display: flex;justify-content: center;position: absolute;width:100%;top: 40%;left: 0'> <u-loading-icon></u-loading-icon> </div> <!-- 页面内容 --> -<!-- <view class="responseList" v-if="responseList.length > 0">--> + <scroll-view :scroll-top="scrollTop" scroll-y="true" class="responseList" @scrolltoupper="upper" v-if="responseList.length > 0" @scrolltolower="lower" @scroll="scroll" lower-threshold="50"> <view v-for="(item, index) in responseList" :key="index" class="itemContent" @click="toDetail(item)"> @@ -27,8 +30,6 @@ </view> </view> </scroll-view> -<!-- </view>--> - <view v-else> <u-empty mode="data" @@ -72,6 +73,13 @@ uni.hideTabBar(); }, methods: { + loginOut() { + uni.clearStorageSync(); + uni.clearStorage(); + uni.navigateTo({ + url: '/pages/index/index' + }) + }, getResponseList() { this.loading = true getResponse(this.data).then(res => { @@ -122,7 +130,7 @@ }, lower: function(e) { if (this.data.pageIndex * this.data.pageSize >= this.total){ - uni.$u.toast('已加载全部数据') + // uni.$u.toast('已加载全部数据') return } //并且让页码+1,调用获取数据的方法获取第二页数据 @@ -175,6 +183,7 @@ background: #fff; border-radius: 5px; box-shadow: 0 3px 12px rgba(0,0,0,0.05); + } .itemContent{ color: #333; -- Gitblit v1.9.2