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