123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- <template>
- <view class="container">
- <view class="listBox">
- <view class="row flex" @click="navTo('/pages/set/userinfo')">
- <text class="tit">头像</text>
- <view>
- <image class="background-img" v-model="userInfo.avatar" :src="userInfo.avatar" mode="aspectFill">
- </image>
- </view>
- </view>
- <view class="list">
- <view class="flex listItem" @click="navTo('/pages/set/userinfo')">
- <view class="flex titleBox">
- <text class="title">昵称</text>
- </view>
- <view class="right flex">
- <text>{{userInfo.nickname}}</text>
- <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
- </view>
- </view>
- <view class="flex listItem" @click="navTo('/pages/set/phone')">
- <view class="flex titleBox">
- <text class="title">手机号</text>
- </view>
- <view class="right flex">
- <text>{{userInfo.phone}}</text>
- <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
- </view>
- </view>
- <!-- <view class="flex listItem" @click="navTo('/pages/user/realName/realNameAuthentication')">
- <view class="flex titleBox">
- <text class="title">实名认证</text>
- </view>
- <view class="right flex">
- <text></text>
- <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
- </view>
- </view> -->
- <view class="flex listItem" @click="navTo('/pages/set/password')">
- <view class="flex titleBox">
- <text class="title">修改密码</text>
- </view>
- <view class="right flex">
- <text></text>
- <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
- </view>
- </view>
- <!-- #ifdef APP -->
- <view class="flex listItem" @click="$refs.inputDialog.open()">
- <view class="flex titleBox">
- <text class="title">注销账号</text>
- </view>
- <view class="right flex">
- <text></text>
- <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
- </view>
- </view>
- <!-- #endif -->
- </view>
- </view>
- <view class="base-buttom" @click="toLogout">
- 退出账号
- </view>
- <!-- #ifdef APP -->
- <uni-popup ref="inputDialog" type="dialog">
- <uni-popup-dialog ref="inputClose" mode="input" title="注销账号" value="" placeholder="请输入账号密码"
- @confirm="outAccount"></uni-popup-dialog>
- </uni-popup>
- <!-- #endif -->
- </view>
- </template>
- <script>
- import {
- uploads
- } from '@/api/user.js';
- import {
- logout
- } from '@/api/set.js';
- import {
- mapMutations,
- mapState
- } from 'vuex';
- export default {
- data() {
- return {
- };
- },
- computed: {
- ...mapState('user', ['userInfo'])
- },
- methods: {
- ...mapMutations('user', ['logout']),
- // #ifdef APP
- outAccount() {
- uni.showModal({
- title: '警告',
- content: '注销后账号不可恢复是否注销?',
- cancelText: '取消',
- confirmText: '立即注销',
- success: res => {
- if (res.confirm) {
- uni.showModal({
- title: '提示',
- content: '已提交注销申请!请等待处理结果',
- showCancel: false,
- });
- }
- },
- });
- },
- // #endif
- navTo(url) {
- uni.navigateTo({
- url: url
- })
- },
- //退出登录
- toLogout() {
- let obj = this;
- uni.showModal({
- content: '确定要退出登录么',
- success: (e) => {
- if (e.confirm) {
- logout({}).then((e) => {
- uni.navigateBack();
- }).catch((e) => {
- console.log(e);
- })
- obj.logout();
- }
- }
- });
- }
- }
- }
- </script>
- <style lang='scss'>
- .container {
- padding-top: 30rpx;
- }
- .listBox {
- margin: 0 $page-row-spacing;
- background-color: #FFFFFF;
- border-radius: 20rpx;
- overflow: hidden;
- }
- .list {
- .listItem {
- padding: 35rpx 40rpx;
- border-bottom: 1px solid $page-color-light;
- }
- .listIconImg {
- width: 36rpx;
- }
- .right {
- color: $font-color-light;
- font-size: $font-base;
- flex-grow: 1;
- justify-content: flex-end;
- .img {
- width: 26rpx;
- }
- }
- .titleBox {
- .title {
- color: $font-color-base;
- font-size: $font-base;
- }
- }
- }
- .row {
- display: flex;
- align-items: center;
- padding: 35rpx 40rpx;
- background: #fff;
- border-bottom: 1px solid $page-color-light;
- .background-img {
- width: 80rpx;
- height: 80rpx;
- border-radius: 50%;
- background: #f2f2f2;
- }
- .tit {
- flex-shrink: 0;
- width: 120upx;
- font-size: $font-base;
- color: $font-color-base;
- }
- .input {
- flex: 1;
- text-align: right;
- font-size: $font-base;
- color: $color-gray;
- }
- }
- </style>
|