mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 16:23:26 +08:00
Merge branch 'dev' into 'master'
uniapp【新增】(个人中心):添加清除缓存和退出登录按钮 See merge request jianweie/coreshoppro!45
This commit is contained in:
@@ -141,6 +141,20 @@
|
||||
<view class="tit">{{ item.title }}</view>
|
||||
</view>
|
||||
</template>
|
||||
<!-- #ifdef MP -->
|
||||
<view class="item" @click="handleClearCache">
|
||||
<image class="img" :src="handleStaticResources('/static/images/member/icon-clear.png')">
|
||||
</image>
|
||||
<view class="tit">清理缓存</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-PLUS || APP-PLUS-NVUE -->
|
||||
<view class="item" @click="handleLogOut">
|
||||
<image class="img" :src="handleStaticResources('/static/images/member/icon-logout.png')">
|
||||
</image>
|
||||
<view class="tit">注销登录</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -151,11 +165,11 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive } from 'vue';
|
||||
import { onPageScroll, onShow } from '@dcloudio/uni-app';
|
||||
import { handleStaticResources, handleRouteNavigateTo, handleShowToast } from '@/core/utils';
|
||||
import { queryUserInfo, queryOrderStatusNum, queryUserIsClerk, queryDistributionInfo, queryAgentInfo } from '@/core/api';
|
||||
import type { Response, MemberOrderType, UserInfoType, UserIsClerkType, MemberServiceType } from '@/core/models';
|
||||
import { handleStaticResources, handleRouteNavigateTo, handleShowToast, handleRouteSwitchTab, hanldeShowModal } from '@/core/utils';
|
||||
import { queryUserInfo, queryOrderStatusNum, queryUserIsClerk, queryDistributionInfo, queryAgentInfo, queryShopConfigV2 } from '@/core/api';
|
||||
import type { Response, MemberOrderType, UserInfoType, UserIsClerkType, MemberServiceType, ShopConfigType } from '@/core/models';
|
||||
import { useShopConfigStore, useUserInfoStore, useLoginStore } from '@/core/store';
|
||||
import { ShowVasEnum, ShowInviterEnum, OrderTabStatusEnum, MemberPageNameEnum, DistributionApplyStatus, AgentApplyStatus } from '@/core/enum';
|
||||
import { ShowVasEnum, ShowInviterEnum, OrderTabStatusEnum, MemberPageNameEnum, RouteSwitchTabEnum, DistributionApplyStatus, AgentApplyStatus } from '@/core/enum';
|
||||
import { useNavHook } from './use-nav-hook';
|
||||
import { UserToken } from '@/core/consts'
|
||||
|
||||
@@ -279,7 +293,7 @@
|
||||
}
|
||||
} else {
|
||||
handleShowToast(info.msg)
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
handleRouteNavigateTo(item.url);
|
||||
@@ -297,6 +311,33 @@
|
||||
handleRouteNavigateTo(item.url);
|
||||
}
|
||||
}
|
||||
|
||||
/** 清理缓存 */
|
||||
const handleClearCache = async () => {
|
||||
const shopConfig : Response<ShopConfigType> = await queryShopConfigV2();
|
||||
if (shopConfig.status) {
|
||||
shopConfigStore.setConfig(shopConfig.data);
|
||||
handleShowToast('清理成功', 'success', () => {
|
||||
setTimeout(() => {
|
||||
handleRouteSwitchTab(RouteSwitchTabEnum.home)
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/** 注销登录 */
|
||||
const handleLogOut = () => {
|
||||
hanldeShowModal({
|
||||
title: "退出",
|
||||
content: '确认退出登录吗?',
|
||||
async confirmFn() {
|
||||
uni.removeStorageSync(UserToken);
|
||||
userInfoStore.setUserInfo({});
|
||||
handleRouteSwitchTab(RouteSwitchTabEnum.home)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
BIN
CoreCms.Net.Uni-App/CoreShop/static/images/member/icon-clear.png
Normal file
BIN
CoreCms.Net.Uni-App/CoreShop/static/images/member/icon-clear.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
Reference in New Issue
Block a user