feat:蓝牙绑定和在线客服
This commit is contained in:
184
src/pages/mine/edit/index.vue
Normal file
184
src/pages/mine/edit/index.vue
Normal file
@@ -0,0 +1,184 @@
|
||||
<template>
|
||||
<view class="edit-profile-page">
|
||||
<view class="edit-profile-page__navbar">
|
||||
<app-navbar title="编辑资料" />
|
||||
</view>
|
||||
|
||||
<scroll-view class="edit-profile-page__scroll" scroll-y>
|
||||
<view class="edit-profile-page__body">
|
||||
<view class="edit-profile-page__avatar-section">
|
||||
<view class="edit-profile-page__avatar-wrap">
|
||||
<image
|
||||
v-if="form.avatarUrl"
|
||||
class="edit-profile-page__avatar"
|
||||
:src="form.avatarUrl"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<view v-else class="edit-profile-page__avatar-placeholder" />
|
||||
</view>
|
||||
<text class="edit-profile-page__change-avatar" @tap="onOpenAvatarSheet">
|
||||
更换头像
|
||||
</text>
|
||||
<text class="edit-profile-page__avatar-tip">
|
||||
支持 JPG / PNG,建议使用 200x200 以上正方形图片
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view class="edit-profile-page__list">
|
||||
<view class="edit-profile-page__item" @tap="onOpenNicknameDialog">
|
||||
<text class="edit-profile-page__label">昵称</text>
|
||||
<view class="edit-profile-page__right">
|
||||
<text
|
||||
class="edit-profile-page__value"
|
||||
:class="{ 'edit-profile-page__value--placeholder': !form.nickName }"
|
||||
>
|
||||
{{ form.nickName || '请输入昵称' }}
|
||||
</text>
|
||||
<image
|
||||
class="edit-profile-page__arrow"
|
||||
:src="staticAssets.iconChevronLeft"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="edit-profile-page__divider" />
|
||||
|
||||
<view class="edit-profile-page__item" @tap="onPickGender">
|
||||
<text class="edit-profile-page__label">性别</text>
|
||||
<view class="edit-profile-page__right">
|
||||
<text class="edit-profile-page__value">{{ genderText }}</text>
|
||||
<image
|
||||
class="edit-profile-page__arrow"
|
||||
:src="staticAssets.iconChevronLeft"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="edit-profile-page__divider" />
|
||||
|
||||
<picker
|
||||
mode="date"
|
||||
:value="form.birthday"
|
||||
:end="today"
|
||||
@change="onBirthdayChange"
|
||||
>
|
||||
<view class="edit-profile-page__item">
|
||||
<text class="edit-profile-page__label">生日</text>
|
||||
<view class="edit-profile-page__right">
|
||||
<text
|
||||
class="edit-profile-page__value"
|
||||
:class="{ 'edit-profile-page__value--placeholder': !form.birthday }"
|
||||
>
|
||||
{{ form.birthday || '请选择生日' }}
|
||||
</text>
|
||||
<image
|
||||
class="edit-profile-page__arrow"
|
||||
:src="staticAssets.iconChevronLeft"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</picker>
|
||||
|
||||
<view class="edit-profile-page__divider" />
|
||||
|
||||
<picker mode="region" :value="regionValue" @change="onRegionChange">
|
||||
<view class="edit-profile-page__item">
|
||||
<text class="edit-profile-page__label">所在地</text>
|
||||
<view class="edit-profile-page__right">
|
||||
<text
|
||||
class="edit-profile-page__value"
|
||||
:class="{
|
||||
'edit-profile-page__value--placeholder': locationText === '未设置',
|
||||
}"
|
||||
>
|
||||
{{ locationText }}
|
||||
</text>
|
||||
<image
|
||||
class="edit-profile-page__arrow"
|
||||
:src="staticAssets.iconChevronLeft"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</picker>
|
||||
|
||||
<view class="edit-profile-page__divider" />
|
||||
|
||||
<view class="edit-profile-page__item">
|
||||
<text class="edit-profile-page__label">手机号</text>
|
||||
<view class="edit-profile-page__right">
|
||||
<text class="edit-profile-page__value">
|
||||
{{ maskedPhone || '未绑定' }}
|
||||
</text>
|
||||
<text class="edit-profile-page__change-phone" @tap.stop="onChangePhone">
|
||||
更换
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view class="edit-profile-page__footer">
|
||||
<view
|
||||
class="edit-profile-page__save-btn"
|
||||
:class="{ 'edit-profile-page__save-btn--disabled': saving || uploadingAvatar }"
|
||||
@tap="onSave"
|
||||
>
|
||||
保存修改
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<avatar-action-sheet
|
||||
v-model:visible="avatarSheetVisible"
|
||||
@take-photo="onTakePhoto"
|
||||
@choose-album="onChooseAlbum"
|
||||
@preview="onPreviewAvatar"
|
||||
/>
|
||||
|
||||
<nickname-dialog
|
||||
v-model:visible="nicknameDialogVisible"
|
||||
:value="form.nickName"
|
||||
@confirm="onConfirmNickname"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { staticAssets } from '@/utils/static-assets'
|
||||
import AvatarActionSheet from './components/avatar-action-sheet/index.vue'
|
||||
import NicknameDialog from './components/nickname-dialog/index.vue'
|
||||
import { useEditProfile } from './use-edit-profile'
|
||||
|
||||
const today = new Date().toISOString().slice(0, 10)
|
||||
|
||||
const {
|
||||
saving,
|
||||
uploadingAvatar,
|
||||
form,
|
||||
maskedPhone,
|
||||
genderText,
|
||||
locationText,
|
||||
regionValue,
|
||||
avatarSheetVisible,
|
||||
nicknameDialogVisible,
|
||||
onOpenAvatarSheet,
|
||||
onPreviewAvatar,
|
||||
onTakePhoto,
|
||||
onChooseAlbum,
|
||||
onOpenNicknameDialog,
|
||||
onConfirmNickname,
|
||||
onPickGender,
|
||||
onBirthdayChange,
|
||||
onRegionChange,
|
||||
onChangePhone,
|
||||
onSave,
|
||||
} = useEditProfile()
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './edit.scss';
|
||||
</style>
|
||||
Reference in New Issue
Block a user