| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <template>
- <view class="setting_wrap">
- <u-navbar title="我的设置" :autoBack="true" :placeholder="true" v-hideNav></u-navbar>
- <view class="option_list">
- <view class="option_item" @click="toPersonal">
- <view class="item_left">
- <image src="@/static/parson/icon-gezl.png" mode=""></image>
- <text class="label">个人资料</text>
- </view>
- <view class="item-right">
- <u-icon name="arrow-right" color="#aaa"></u-icon>
- </view>
- </view>
- <view class="option_item" @click="handleEditPassword">
- <view class="item_left">
- <image src="@/static/parson/updatePass.png" mode=""></image>
- <text class="label">修改密码</text>
- </view>
- <view class="item-right">
- <u-icon name="arrow-right" color="#aaa"></u-icon>
- </view>
- </view>
- </view>
- <view class="logout_btn">
- <u-button type="warning" :plain="true" text="退出账号" size="large" @click="handleShowModal"></u-button>
- </view>
- <u-modal :show="showModal"
- @confirm="confirm"
- ref="uModal"
- :asyncClose="true"
- showCancelButton
- @cancel="showModal = false"
- cancelColor="#409eff"
- :confirmText="'退出登录'" confirmColor="#f8836c">
- <view class="modal_box">
- 确定要要出当前账号
- </view>
- </u-modal>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- showModal: false
- }
- },
- onLoad: function(opt) {
- },
- methods: {
- handleEditPassword(){
- uni.navigateTo({
- url : "/pages/changePw/index"
- });
- },
- toPersonal(){
- uni.navigateTo({
- url : "/pages/profile/index"
- })
- },
- handleShowModal() {
- this.showModal = true;
- },
- confirm() {
- // 停止电话监听
- this.$store.dispatch("call/stopPhoneListener").catch(error => {
- console.error('退出登录时停止电话监听失败:', error);
- });
-
- this.$store.dispatch("user/logout").then(()=>{
- uni.$u.toast("退出成功");
- setTimeout(()=>{
- this.showModal = false;
- uni.reLaunch({
- url: "/pages/login/index"
- })
- },1000)
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .modal_box{
- line-height: 100rpx;
- color: #aaa;
- }
- .logout_btn {
- width: 100%;
- position: absolute;
- left: 50%;
- transform: translate(-50%, 0%);
- bottom: 10%;
- ::v-deep .u-button {
- border: none;
- }
- }
- .option_list {
- margin-top: 30rpx;
- .option_item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 100rpx;
- border-bottom: 2rpx solid #dfdfdf;
- background-color: #fff;
- padding: 0 30rpx;
- &:last-child {
- border: none;
- }
- .item_left {
- display: flex;
- align-items: center;
- image {
- width: 32rpx;
- height: 32rpx;
- margin-right: 20rpx;
- }
- .label {
- font-size: 28rpx;
- color: #202020;
- }
- }
- .item-right {
- display: flex;
- justify-content: space-between;
- align-items: center;
- ::v-deep .u-icon__icon {
- font-size: 30rpx !important;
- }
- text {
- font-size: 24rpx;
- color: #999999;
- margin-right: 20rpx;
- }
- .copy_btn {
- display: flex;
- font-size: 24rpx;
- color: #108CFF;
- margin-right: 30rpx;
- }
- }
- }
- }
- </style>
|