chore(会员中心): 增加账号操作。注销及退出登录
This commit is contained in:
@@ -39,10 +39,18 @@ export const lang = {
|
|||||||
myRebate: 'Group Rebate',
|
myRebate: 'Group Rebate',
|
||||||
myHongbao: 'My Red Envelopes',
|
myHongbao: 'My Red Envelopes',
|
||||||
myBlindBox: 'My Blind Boxes',
|
myBlindBox: 'My Blind Boxes',
|
||||||
|
|
||||||
waitpay:'Waitpay',
|
waitpay: 'Waitpay',
|
||||||
waitsend:'Waitsend',
|
waitsend: 'Waitsend',
|
||||||
waitconfirm:'Waitconfirm',
|
waitconfirm: 'Waitconfirm',
|
||||||
activist:'Activist',
|
activist: 'Activist',
|
||||||
completed:'Completed',
|
completed: 'Completed',
|
||||||
|
|
||||||
|
// 账户操作
|
||||||
|
logout: 'Logout',
|
||||||
|
cancellation: 'Account Cancellation',
|
||||||
|
|
||||||
|
// 协议
|
||||||
|
privacyPolicy: 'Privacy Policy',
|
||||||
|
registrationAgreement: 'Registration Agreement',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,13 +31,13 @@ export const lang = {
|
|||||||
verification: '核销台',
|
verification: '核销台',
|
||||||
message: '我的消息',
|
message: '我的消息',
|
||||||
exchangeOrder: '积分兑换',
|
exchangeOrder: '积分兑换',
|
||||||
|
|
||||||
waitpay:'待付款',
|
waitpay: '待付款',
|
||||||
waitsend:'待发货',
|
waitsend: '待发货',
|
||||||
waitconfirm:'待收货',
|
waitconfirm: '待收货',
|
||||||
activist:'售后',
|
activist: '售后',
|
||||||
completed:'已完成',
|
completed: '已完成',
|
||||||
|
|
||||||
// 推广中心
|
// 推广中心
|
||||||
balance: '余额',
|
balance: '余额',
|
||||||
point: '积分',
|
point: '积分',
|
||||||
@@ -46,9 +46,15 @@ export const lang = {
|
|||||||
myPresale: '我的预售',
|
myPresale: '我的预售',
|
||||||
myGiftcard: '我的礼品卡',
|
myGiftcard: '我的礼品卡',
|
||||||
myDivideticket: '我的瓜分券',
|
myDivideticket: '我的瓜分券',
|
||||||
myRebate:'拼团返利',
|
myRebate: '拼团返利',
|
||||||
myHongbao:'我的红包列表',
|
myHongbao: '我的红包列表',
|
||||||
myBlindBox:'我的盲盒',
|
myBlindBox: '我的盲盒',
|
||||||
|
|
||||||
|
// 账户操作
|
||||||
|
logout: '退出登录',
|
||||||
|
cancellation: '账号注销',
|
||||||
|
|
||||||
|
// 协议
|
||||||
|
privacyPolicy: '隐私协议',
|
||||||
|
registrationAgreement: '注册协议',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,9 +19,15 @@
|
|||||||
<ns-copyright v-show="isShowCopyRight" />
|
<ns-copyright v-show="isShowCopyRight" />
|
||||||
|
|
||||||
<view class="foot">
|
<view class="foot">
|
||||||
<view class="item" @click="tourl('/pages_tool/agreement/contenr?type=0')">{{ isEnEnv ? 'Privacy Policy' : '隐私协议'}}</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')">{{ isEnEnv ? 'Registration Agreement' : '注册协议'}}</view>
|
<view class="item" @click="tourl('/pages_tool/agreement/contenr?type=1')">{{ $lang('registrationAgreement')}}</view>
|
||||||
</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>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<template
|
<template
|
||||||
@@ -80,6 +86,52 @@ export default {
|
|||||||
|
|
||||||
tourl(url) {
|
tourl(url) {
|
||||||
this.$util.redirectTo(url);
|
this.$util.redirectTo(url);
|
||||||
|
},
|
||||||
|
|
||||||
|
// 退出登录
|
||||||
|
logout() {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要退出登录吗',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
this.$store.commit('setToken', '');
|
||||||
|
this.$store.commit('setMemberInfo', '');
|
||||||
|
this.$store.dispatch('emptyCart');
|
||||||
|
uni.removeStorageSync('authInfo');
|
||||||
|
this.$util.redirectTo('/pages/member/index');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 账号注销
|
||||||
|
cancellation() {
|
||||||
|
uni.showModal({
|
||||||
|
title: '风险提示',
|
||||||
|
content: '确定要注销当前账号吗?',
|
||||||
|
confirmColor: '#000000',
|
||||||
|
success: res => {
|
||||||
|
if (res.confirm) {
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/membercancel/api/membercancel/apply',
|
||||||
|
success: rres => {
|
||||||
|
if (rres.code >= 0) {
|
||||||
|
this.$store.commit('setToken', '');
|
||||||
|
this.$store.commit('setMemberInfo', '');
|
||||||
|
this.$store.dispatch('emptyCart');
|
||||||
|
uni.removeStorageSync('authInfo');
|
||||||
|
this.$util.redirectTo('/pages/member/index');
|
||||||
|
} else {
|
||||||
|
this.$util.showToast({
|
||||||
|
title: rres.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -101,6 +153,35 @@ export default {
|
|||||||
color: #F4391c
|
color: #F4391c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.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>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user