|
|
|
@ -1,32 +1,15 @@
|
|
|
|
|
<!-- 用户信息 -->
|
|
|
|
|
<template>
|
|
|
|
|
<s-layout title="用户信息" class="set-userinfo-wrap">
|
|
|
|
|
<uni-forms
|
|
|
|
|
:model="state.model"
|
|
|
|
|
:rules="state.rules"
|
|
|
|
|
labelPosition="left"
|
|
|
|
|
border
|
|
|
|
|
class="form-box"
|
|
|
|
|
>
|
|
|
|
|
<uni-forms :model="state.model" :rules="state.rules" labelPosition="left" border 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="header-box-content">
|
|
|
|
|
<su-image
|
|
|
|
|
class="content-img"
|
|
|
|
|
isPreview
|
|
|
|
|
:current="0"
|
|
|
|
|
:src="state.model?.avatar"
|
|
|
|
|
:height="160"
|
|
|
|
|
:width="160"
|
|
|
|
|
:radius="80"
|
|
|
|
|
mode="scaleToFill"
|
|
|
|
|
/>
|
|
|
|
|
<su-image class="content-img" isPreview :current="0" :src="state.model?.avatar" :height="160" :width="160"
|
|
|
|
|
:radius="80" mode="scaleToFill" />
|
|
|
|
|
<view class="avatar-action">
|
|
|
|
|
<!-- #ifdef MP -->
|
|
|
|
|
<button
|
|
|
|
|
class="ss-reset-button avatar-action-btn"
|
|
|
|
|
open-type="chooseAvatar"
|
|
|
|
|
@chooseavatar="onChooseAvatar">
|
|
|
|
|
<button class="ss-reset-button avatar-action-btn" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
|
|
|
|
|
修改
|
|
|
|
|
</button>
|
|
|
|
|
<!-- #endif -->
|
|
|
|
@ -40,25 +23,16 @@
|
|
|
|
|
<view class="bg-white ss-p-x-30">
|
|
|
|
|
<!-- 昵称 + 性别 -->
|
|
|
|
|
<uni-forms-item name="nickname" label="昵称">
|
|
|
|
|
<uni-easyinput
|
|
|
|
|
v-model="state.model.nickname"
|
|
|
|
|
type="nickname"
|
|
|
|
|
placeholder="设置昵称"
|
|
|
|
|
:inputBorder="false"
|
|
|
|
|
:placeholderStyle="placeholderStyle"
|
|
|
|
|
/>
|
|
|
|
|
<uni-easyinput v-model="state.model.nickname" type="nickname" placeholder="设置昵称" :inputBorder="false"
|
|
|
|
|
:placeholderStyle="placeholderStyle" />
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
<uni-forms-item name="sex" label="性别">
|
|
|
|
|
<view class="ss-flex ss-col-center ss-h-100">
|
|
|
|
|
<radio-group @change="onChangeGender" class="ss-flex ss-col-center">
|
|
|
|
|
<label class="radio" v-for="item in sexRadioMap" :key="item.value">
|
|
|
|
|
<view class="ss-flex ss-col-center ss-m-r-32">
|
|
|
|
|
<radio
|
|
|
|
|
:value="item.value"
|
|
|
|
|
color="var(--ui-BG-Main)"
|
|
|
|
|
style="transform: scale(0.8)"
|
|
|
|
|
:checked="parseInt(item.value) === state.model?.sex"
|
|
|
|
|
/>
|
|
|
|
|
<radio :value="item.value" color="var(--ui-BG-Main)" style="transform: scale(0.8)"
|
|
|
|
|
:checked="parseInt(item.value) === state.model?.sex" />
|
|
|
|
|
<view class="gender-name">{{ item.name }}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</label>
|
|
|
|
@ -67,15 +41,8 @@
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
|
|
|
|
|
<uni-forms-item name="mobile" label="手机号" @tap="onChangeMobile">
|
|
|
|
|
<uni-easyinput
|
|
|
|
|
v-model="userInfo.mobile"
|
|
|
|
|
placeholder="请绑定手机号"
|
|
|
|
|
:inputBorder="false"
|
|
|
|
|
disabled
|
|
|
|
|
:styles="{ disableColor: '#fff' }"
|
|
|
|
|
:placeholderStyle="placeholderStyle"
|
|
|
|
|
:clearable="false"
|
|
|
|
|
>
|
|
|
|
|
<uni-easyinput v-model="userInfo.mobile" placeholder="请绑定手机号" :inputBorder="false" disabled
|
|
|
|
|
:styles="{ disableColor: '#fff' }" :placeholderStyle="placeholderStyle" :clearable="false">
|
|
|
|
|
<template v-slot:right>
|
|
|
|
|
<view class="ss-flex ss-col-center">
|
|
|
|
|
<su-radio v-if="userInfo.verification?.mobile" :modelValue="true" />
|
|
|
|
@ -87,23 +54,19 @@
|
|
|
|
|
</uni-easyinput>
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
|
|
|
|
|
<uni-forms-item name="level" label="会员等级">
|
|
|
|
|
<uni-easyinput v-model="state.laevelname" :inputBorder="false" disabled :styles="{ disableColor: '#fff' }"
|
|
|
|
|
:placeholderStyle="placeholderStyle" :clearable="false">
|
|
|
|
|
</uni-easyinput>
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
|
|
|
|
|
<uni-forms-item name="password" label="登录密码" @tap="onSetPassword">
|
|
|
|
|
<uni-easyinput
|
|
|
|
|
v-model="userInfo.password"
|
|
|
|
|
placeholder="点击修改登录密码"
|
|
|
|
|
:inputBorder="false"
|
|
|
|
|
:styles="{ disableColor: '#fff' }"
|
|
|
|
|
disabled
|
|
|
|
|
placeholderStyle="color:#BBBBBB;font-size:28rpx;line-height:normal"
|
|
|
|
|
:clearable="false"
|
|
|
|
|
>
|
|
|
|
|
<uni-easyinput v-model="userInfo.password" placeholder="点击修改登录密码" :inputBorder="false"
|
|
|
|
|
:styles="{ disableColor: '#fff' }" disabled
|
|
|
|
|
placeholderStyle="color:#BBBBBB;font-size:28rpx;line-height:normal" :clearable="false">
|
|
|
|
|
<template v-slot:right>
|
|
|
|
|
<view class="ss-flex ss-col-center">
|
|
|
|
|
<su-radio
|
|
|
|
|
class="ss-flex"
|
|
|
|
|
v-if="userInfo.verification?.password"
|
|
|
|
|
:modelValue="true"
|
|
|
|
|
/>
|
|
|
|
|
<su-radio class="ss-flex" v-if="userInfo.verification?.password" :modelValue="true" />
|
|
|
|
|
<button v-else class="ss-reset-button ss-flex ss-col-center ss-row-center">
|
|
|
|
|
<text class="_icon-forward" style="color: #bbbbbb; font-size: 26rpx" />
|
|
|
|
|
</button>
|
|
|
|
@ -115,14 +78,8 @@
|
|
|
|
|
|
|
|
|
|
<view class="bg-white ss-m-t-14">
|
|
|
|
|
<uni-list>
|
|
|
|
|
<uni-list-item
|
|
|
|
|
clickable
|
|
|
|
|
@tap="sheep.$router.go('/pages/user/address/list')"
|
|
|
|
|
title="地址管理"
|
|
|
|
|
showArrow
|
|
|
|
|
:border="false"
|
|
|
|
|
class="list-border"
|
|
|
|
|
/>
|
|
|
|
|
<uni-list-item clickable @tap="sheep.$router.go('/pages/user/address/list')" title="地址管理" showArrow
|
|
|
|
|
:border="false" class="list-border" />
|
|
|
|
|
</uni-list>
|
|
|
|
|
</view>
|
|
|
|
|
</uni-forms>
|
|
|
|
@ -132,40 +89,24 @@
|
|
|
|
|
<view class="title-box ss-p-l-30">第三方账号绑定</view>
|
|
|
|
|
<view class="account-list ss-flex ss-row-between">
|
|
|
|
|
<view v-if="'WechatOfficialAccount' === sheep.$platform.name" class="ss-flex ss-col-center">
|
|
|
|
|
<image
|
|
|
|
|
class="list-img"
|
|
|
|
|
:src="sheep.$url.static('/static/img/shop/platform/WechatOfficialAccount.png')"
|
|
|
|
|
/>
|
|
|
|
|
<image class="list-img" :src="sheep.$url.static('/static/img/shop/platform/WechatOfficialAccount.png')" />
|
|
|
|
|
<text class="list-name">微信公众号</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="'WechatMiniProgram' === sheep.$platform.name" class="ss-flex ss-col-center">
|
|
|
|
|
<image
|
|
|
|
|
class="list-img"
|
|
|
|
|
:src="sheep.$url.static('/static/img/shop/platform/WechatMiniProgram.png')"
|
|
|
|
|
/>
|
|
|
|
|
<image class="list-img" :src="sheep.$url.static('/static/img/shop/platform/WechatMiniProgram.png')" />
|
|
|
|
|
<text class="list-name">微信小程序</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="'App' === sheep.$platform.name" class="ss-flex ss-col-center">
|
|
|
|
|
<image
|
|
|
|
|
class="list-img"
|
|
|
|
|
:src="sheep.$url.static('/static/img/shop/platform/wechat.png')"
|
|
|
|
|
/>
|
|
|
|
|
<image class="list-img" :src="sheep.$url.static('/static/img/shop/platform/wechat.png')" />
|
|
|
|
|
<text class="list-name">微信开放平台</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="ss-flex ss-col-center">
|
|
|
|
|
<view class="info ss-flex ss-col-center" v-if="state.thirdInfo">
|
|
|
|
|
<image
|
|
|
|
|
class="avatar ss-m-r-20"
|
|
|
|
|
:src="sheep.$url.cdn(state.thirdInfo.avatar)"
|
|
|
|
|
/>
|
|
|
|
|
<image class="avatar ss-m-r-20" :src="sheep.$url.cdn(state.thirdInfo.avatar)" />
|
|
|
|
|
<text class="name">{{ state.thirdInfo.nickname }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="bind-box ss-m-l-20">
|
|
|
|
|
<button
|
|
|
|
|
v-if="state.thirdInfo.openid"
|
|
|
|
|
class="ss-reset-button relieve-btn"
|
|
|
|
|
@tap="unBindThirdOauth"
|
|
|
|
|
>
|
|
|
|
|
<button v-if="state.thirdInfo.openid" class="ss-reset-button relieve-btn" @tap="unBindThirdOauth">
|
|
|
|
|
解绑
|
|
|
|
|
</button>
|
|
|
|
|
<button v-else class="ss-reset-button bind-btn" @tap="bindThirdOauth">绑定</button>
|
|
|
|
@ -189,11 +130,12 @@
|
|
|
|
|
import { showAuthModal } from '@/sheep/hooks/useModal';
|
|
|
|
|
import FileApi from '@/sheep/api/infra/file';
|
|
|
|
|
import UserApi from '@/sheep/api/member/user';
|
|
|
|
|
|
|
|
|
|
// const laevelname = '不是会员'
|
|
|
|
|
const state = reactive({
|
|
|
|
|
model: {}, // 个人信息
|
|
|
|
|
rules: {},
|
|
|
|
|
thirdInfo: {}, // 社交用户的信息
|
|
|
|
|
laevelname:'不是会员'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const placeholderStyle = 'color:#BBBBBB;font-size:28rpx;line-height:normal';
|
|
|
|
@ -293,6 +235,10 @@
|
|
|
|
|
const getUserInfo = async () => {
|
|
|
|
|
// 个人信息
|
|
|
|
|
const userInfo = await sheep.$store('user').getInfo();
|
|
|
|
|
if (userInfo.level!==null){
|
|
|
|
|
state.laevelname = userInfo.level.name
|
|
|
|
|
console.log(state.laevelname,'78789');
|
|
|
|
|
}
|
|
|
|
|
state.model = clone(userInfo);
|
|
|
|
|
|
|
|
|
|
// 获得社交用户的信息
|
|
|
|
|