chore(会员中心): 注销及登出需要多语言提示

This commit is contained in:
2025-12-31 14:28:02 +08:00
parent 781bb8845e
commit 6894950b7e
3 changed files with 57 additions and 44 deletions

View File

@@ -49,6 +49,10 @@ export const lang = {
// 账户操作
logout: 'Logout',
cancellation: 'Account Cancellation',
logoutTitle: 'Tips',
logoutContent: 'Are you sure you want to log out',
cancellationTitle: 'Risk Warning',
cancellationContent: 'Are you sure you want to cancel your current account?',
// 协议
privacyPolicy: 'Privacy Policy',

View File

@@ -53,6 +53,10 @@ export const lang = {
// 账户操作
logout: '退出登录',
cancellation: '账号注销',
logoutTitle: '提示',
logoutContent: '确定要退出登录吗',
cancellationTitle: '风险提示',
cancellationContent: '确定要注销当前账号吗?',
// 协议
privacyPolicy: '隐私协议',

View File

@@ -1,6 +1,7 @@
<template>
<view :style="themeColor">
<view :style="{ backgroundColor: bgColor, minHeight: openBottomNav ? 'calc(100vh - 55px)' : '' }" class="page-img">
<view :style="{ backgroundColor: bgColor, minHeight: openBottomNav ? 'calc(100vh - 55px)' : '' }"
class="page-img">
<view class="page-header" v-if="diyData.global && diyData.global.navBarSwitch"
:style="{ backgroundImage: bgImg }">
<ns-navbar :title-color="textNavColor" :data="diyData.global" :scrollTop="scrollTop" :isBack="true" />
@@ -19,14 +20,16 @@
<ns-copyright v-show="isShowCopyRight" />
<view class="foot">
<view class="item" @click="tourl('/pages_tool/agreement/contenr?type=0')">{{ $lang('privacyPolicy')}}</view>
<view class="item" @click="tourl('/pages_tool/agreement/contenr?type=1')">{{ $lang('registrationAgreement')}}</view>
<view class="item" @click="tourl('/pages_tool/agreement/contenr?type=0')">{{
$lang('privacyPolicy') }}</view>
<view class="item" @click="tourl('/pages_tool/agreement/contenr?type=1')">{{
$lang('registrationAgreement') }}</view>
</view>
<!-- 退出登录和账号注销按钮 -->
<view class="action-buttons">
<view class="action-btn logout-btn" @click="logout">{{ $lang('logout')}}</view>
<view class="action-btn cancel-btn" @click="cancellation">{{ $lang('cancellation')}}</view>
<view class="action-buttons" v-if="storeToken || 1">
<view class="action-btn logout-btn" @click="logout">{{ $lang('logout') }}</view>
<view class="action-btn cancel-btn" @click="cancellation">{{ $lang('cancellation') }}</view>
</view>
</view>
@@ -91,8 +94,8 @@ export default {
// 退出登录
logout() {
uni.showModal({
title: '提示',
content: '确定要退出登录吗',
title: this.$lang('logoutTitle'),
content: this.$lang('logoutContent'),
success: (res) => {
if (res.confirm) {
this.$store.commit('setToken', '');
@@ -108,8 +111,8 @@ export default {
// 账号注销
cancellation() {
uni.showModal({
title: '风险提示',
content: '确定要注销当前账号吗?',
title: this.$lang('cancellationTitle'),
content: this.$lang('cancellationContent'),
confirmColor: '#000000',
success: res => {
if (res.confirm) {
@@ -154,34 +157,6 @@ export default {
}
}
.action-buttons {
display: flex;
flex-direction: column;
align-items: center;
margin: 20rpx 30rpx 40rpx;
gap: 20rpx;
}
.action-btn {
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
border-radius: 40rpx;
font-size: 32rpx;
font-weight: 500;
}
.logout-btn {
background-color: #fff;
color: #333;
border: 1rpx solid #ddd;
}
.cancel-btn {
background-color: #F4391c;
color: #fff;
}
</style>
<style scoped>
@@ -215,4 +190,34 @@ export default {
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
max-height: unset !important;
}
.action-buttons {
display: flex;
flex-direction: column;
align-items: center;
margin: 20rpx 30rpx 40rpx;
gap: 20rpx;
}
.action-btn {
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
border-radius: 40rpx;
font-size: 28rpx;
font-weight: 500;
}
.logout-btn {
background-color: #F4391c;
background-color: var(--main-color);
color: #fff;
border: 1rpx solid #ddd;
}
.cancel-btn {
background-color: var(--aux-color);
color: #fff;
}
</style>