🔥 个人信息:移除 username 修改的弹窗,因为现在 app 一般不用这块了,都是基于手机
parent
e1d2a54d2c
commit
236b90ae3f
|
|
@ -8,13 +8,14 @@
|
||||||
border
|
border
|
||||||
class="form-box"
|
class="form-box"
|
||||||
>
|
>
|
||||||
|
<!-- 头像 -->
|
||||||
<view class="ss-flex ss-row-center ss-col-center ss-p-t-60 ss-p-b-0 bg-white">
|
<view class="ss-flex ss-row-center ss-col-center ss-p-t-60 ss-p-b-0 bg-white">
|
||||||
<view class="header-box-content">
|
<view class="header-box-content">
|
||||||
<su-image
|
<su-image
|
||||||
class="content-img"
|
class="content-img"
|
||||||
isPreview
|
isPreview
|
||||||
:current="0"
|
:current="0"
|
||||||
:src="sheep.$url.cdn(state.model.avatar)"
|
:src="state.model.avatar"
|
||||||
:height="160"
|
:height="160"
|
||||||
:width="160"
|
:width="160"
|
||||||
:radius="80"
|
:radius="80"
|
||||||
|
|
@ -25,9 +26,9 @@
|
||||||
<button
|
<button
|
||||||
class="ss-reset-button avatar-action-btn"
|
class="ss-reset-button avatar-action-btn"
|
||||||
open-type="chooseAvatar"
|
open-type="chooseAvatar"
|
||||||
@chooseavatar="onChooseAvatar"
|
@chooseavatar="onChooseAvatar">
|
||||||
>修改</button
|
修改
|
||||||
>
|
</button>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifndef MP -->
|
<!-- #ifndef MP -->
|
||||||
<button class="ss-reset-button avatar-action-btn" @tap="onChangeAvatar">修改</button>
|
<button class="ss-reset-button avatar-action-btn" @tap="onChangeAvatar">修改</button>
|
||||||
|
|
@ -37,24 +38,6 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="bg-white ss-p-x-30">
|
<view class="bg-white ss-p-x-30">
|
||||||
<!-- <uni-forms-item name="username" label="用户名" @tap="onChangeUsername" class="label-box">
|
|
||||||
<uni-easyinput
|
|
||||||
v-model="userInfo.username"
|
|
||||||
disabled
|
|
||||||
:inputBorder="false"
|
|
||||||
:styles="{ disableColor: '#fff' }"
|
|
||||||
placeholder="设置用户名"
|
|
||||||
:clearable="false"
|
|
||||||
:placeholderStyle="placeholderStyle"
|
|
||||||
>
|
|
||||||
<template v-slot:right>
|
|
||||||
<su-radio class="ss-flex" v-if="userInfo.verification?.username" :modelValue="true" />
|
|
||||||
<button v-else class="ss-reset-button">
|
|
||||||
<text class="_icon-forward" style="color: #bbbbbb; font-size: 26rpx"></text>
|
|
||||||
</button>
|
|
||||||
</template>
|
|
||||||
</uni-easyinput>
|
|
||||||
</uni-forms-item> -->
|
|
||||||
|
|
||||||
<uni-forms-item name="nickname" label="昵称">
|
<uni-forms-item name="nickname" label="昵称">
|
||||||
<uni-easyinput
|
<uni-easyinput
|
||||||
|
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
<!-- 修改用户名 changeUsername -->
|
|
||||||
<template>
|
|
||||||
<view>
|
|
||||||
<!-- 标题栏 -->
|
|
||||||
<view class="head-box ss-m-b-60">
|
|
||||||
<view class="head-title ss-m-b-20">修改用户名</view>
|
|
||||||
<view class="head-subtitle">用户名仅限修改一次</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 表单项 -->
|
|
||||||
<uni-forms
|
|
||||||
ref="formRef"
|
|
||||||
v-model="state.model"
|
|
||||||
:rules="state.rules"
|
|
||||||
validateTrigger="bind"
|
|
||||||
labelWidth="140"
|
|
||||||
labelAlign="center"
|
|
||||||
>
|
|
||||||
<uni-forms-item name="username" label="用户名">
|
|
||||||
<uni-easyinput
|
|
||||||
placeholder="请输入用户名"
|
|
||||||
v-model="state.model.username"
|
|
||||||
:inputBorder="false"
|
|
||||||
></uni-easyinput>
|
|
||||||
</uni-forms-item>
|
|
||||||
|
|
||||||
<view class="editPwd-btn-box ss-m-t-80">
|
|
||||||
<button class="ss-reset-button save-btn ui-Shadow-Main" @tap="changeUsernameSubmit">
|
|
||||||
保存
|
|
||||||
</button>
|
|
||||||
</view>
|
|
||||||
</uni-forms>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { computed, watch, ref, reactive, unref } from 'vue';
|
|
||||||
import sheep from '@/sheep';
|
|
||||||
import { username } from '@/sheep/validate/form';
|
|
||||||
import { showAuthModal, closeAuthModal } from '@/sheep/hooks/useModal';
|
|
||||||
const formRef = ref(null);
|
|
||||||
|
|
||||||
// 数据
|
|
||||||
const state = reactive({
|
|
||||||
model: {
|
|
||||||
username: '',
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
username,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// 7.修改用户名
|
|
||||||
async function changeUsernameSubmit() {
|
|
||||||
const validate = await unref(formRef)
|
|
||||||
.validate()
|
|
||||||
.catch((error) => {
|
|
||||||
console.log('error: ', error);
|
|
||||||
});
|
|
||||||
if (!validate) return;
|
|
||||||
sheep.$api.user.changeUsername(state.model).then((res) => {
|
|
||||||
if (res.error === 0) {
|
|
||||||
sheep.$store('user').getInfo();
|
|
||||||
closeAuthModal();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
@import '../index.scss';
|
|
||||||
</style>
|
|
||||||
|
|
@ -28,9 +28,6 @@
|
||||||
<!-- 6.修改密码 changePassword-->
|
<!-- 6.修改密码 changePassword-->
|
||||||
<change-passwrod v-if="authType === 'changePassword'" />
|
<change-passwrod v-if="authType === 'changePassword'" />
|
||||||
|
|
||||||
<!-- 7.修改用户名 changeUsername-->
|
|
||||||
<change-username v-if="authType === 'changeUsername'" />
|
|
||||||
|
|
||||||
<!-- 8.微信小程序授权 changeUsername-->
|
<!-- 8.微信小程序授权 changeUsername-->
|
||||||
<mp-authorization v-if="authType === 'mpAuthorization'" />
|
<mp-authorization v-if="authType === 'mpAuthorization'" />
|
||||||
|
|
||||||
|
|
@ -130,7 +127,6 @@
|
||||||
import resetPassword from './components/reset-password.vue';
|
import resetPassword from './components/reset-password.vue';
|
||||||
import changeMobile from './components/change-mobile.vue';
|
import changeMobile from './components/change-mobile.vue';
|
||||||
import changePasswrod from './components/change-password.vue';
|
import changePasswrod from './components/change-password.vue';
|
||||||
import changeUsername from './components/change-username.vue';
|
|
||||||
import mpAuthorization from './components/mp-authorization.vue';
|
import mpAuthorization from './components/mp-authorization.vue';
|
||||||
import { closeAuthModal, showAuthModal } from '@/sheep/hooks/useModal';
|
import { closeAuthModal, showAuthModal } from '@/sheep/hooks/useModal';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue