fix: 修复手机号码被截断的问题,优化一键添加微信昵称,优化一键添加微信头像
This commit is contained in:
parent
d663124cf4
commit
f1fd270762
@ -2,25 +2,22 @@
|
||||
<view class="page member-user-info-container">
|
||||
<view class="m-cells m-cells-form">
|
||||
<view class="m-cell" style="padding: 2rpx 30rpx">
|
||||
<view class="m-cell-hd"
|
||||
><label class="u-label">{{ __("头像") }}</label></view
|
||||
>
|
||||
<view class="m-cell-hd"><label class="u-label">{{ __("头像") }}</label></view>
|
||||
<view class="m-cell-bd" style="padding: 0; margin: 0; line-height: 1">
|
||||
<view class="uni-uploader-body">
|
||||
<view class="uni-uploader__files">
|
||||
<button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
|
||||
<block v-if="user_avatar">
|
||||
<view class="uni-uploader__file">
|
||||
<image
|
||||
class="uni-uploader__img"
|
||||
:src="user_avatar"
|
||||
:data-src="user_avatar"
|
||||
@click.stop="upImgs"
|
||||
></image>
|
||||
<image class="uni-uploader__img" :src="user_avatar" :data-src="user_avatar"
|
||||
@click.stop="chooseAvatar">
|
||||
</image>
|
||||
</view>
|
||||
</block>
|
||||
<view class="uni-uploader__input-box" v-else>
|
||||
<view class="uni-uploader__input" @click.stop="upImgs"></view>
|
||||
<view class="uni-uploader__input" @click.stop="chooseAvatar"></view>
|
||||
</view>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -29,93 +26,48 @@
|
||||
<view class="m-cell">
|
||||
<view class="m-cell-hd"><label class="u-label">会员等级</label></view>
|
||||
<view class="m-cell-bd">
|
||||
<input
|
||||
class="u-input"
|
||||
type="text"
|
||||
:value="user_level_name"
|
||||
disabled="true"
|
||||
/>
|
||||
<input class="u-input" type="text" :value="user_level_name" disabled="true" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-cell">
|
||||
<view class="m-cell-hd"
|
||||
><label class="u-label">{{ __("用户编号") }}</label></view
|
||||
>
|
||||
<view class="m-cell-hd"><label class="u-label">{{ __("用户编号") }}</label></view>
|
||||
<view class="m-cell-bd">
|
||||
<input
|
||||
class="u-input"
|
||||
type="number"
|
||||
:value="user_id"
|
||||
disabled="true"
|
||||
/>
|
||||
<input class="u-input" type="number" :value="user_id" disabled="true" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-cell" v-if="false">
|
||||
<view class="m-cell-hd"
|
||||
><label class="u-label">{{ __("账号") }}</label></view
|
||||
>
|
||||
<view class="m-cell-hd"><label class="u-label">{{ __("账号") }}</label></view>
|
||||
<view class="m-cell-bd">
|
||||
<input
|
||||
class="u-input"
|
||||
type="text"
|
||||
:value="user_account"
|
||||
disabled="true"
|
||||
/>
|
||||
<input class="u-input" type="text" :value="user_account" disabled="true" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-cell">
|
||||
<view class="m-cell-hd"
|
||||
><label class="u-label">{{ __("昵称") }}</label></view
|
||||
>
|
||||
<view class="m-cell-hd"><label class="u-label">{{ __("昵称") }}</label></view>
|
||||
<view class="m-cell-bd">
|
||||
<input
|
||||
class="u-input"
|
||||
type="text"
|
||||
:value="user_nickname"
|
||||
@input="inputuser_user_nickname"
|
||||
/>
|
||||
<input class="u-input" type="nickname" :value="user_nickname" placeholder="请输入昵称"
|
||||
@input="inputuser_user_nickname" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-cell">
|
||||
<view class="m-cell-hd"><label class="u-label">姓名</label></view>
|
||||
<view class="m-cell-bd">
|
||||
<input
|
||||
class="u-input"
|
||||
type="text"
|
||||
:value="user_realname"
|
||||
:placeholder="__('请输入姓名')"
|
||||
@input="inputReName"
|
||||
maxlength="30"
|
||||
/>
|
||||
<input class="u-input" type="text" :value="user_realname" :placeholder="__('请输入姓名')" @input="inputReName"
|
||||
maxlength="30" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-celli hide">
|
||||
<view class="m-cell-hd"
|
||||
><label class="u-label">{{ __("身份证") }}</label></view
|
||||
>
|
||||
<view class="m-cell-hd"><label class="u-label">{{ __("身份证") }}</label></view>
|
||||
<view class="m-cell-bd">
|
||||
<input
|
||||
class="u-input"
|
||||
type="idcard"
|
||||
:value="user_idcard"
|
||||
:placeholder="__('请输入身份证号码')"
|
||||
@input="inputICard"
|
||||
maxlength="18"
|
||||
/>
|
||||
<input class="u-input" type="idcard" :value="user_idcard" :placeholder="__('请输入身份证号码')" @input="inputICard"
|
||||
maxlength="18" />
|
||||
</view>
|
||||
<div v-if="!isCardNo" class="m-cell-ft">
|
||||
<view class="m-icon-warn uni-icon uni-icon-info" type="warn"></view>
|
||||
</div>
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="m-cell"
|
||||
@click="showbox"
|
||||
v-if="Config.PLANTFORM_FX_AGENT_ENABLE && false"
|
||||
>
|
||||
<view class="m-cell-hd"
|
||||
><label class="u-label">{{ __("地区") }}</label></view
|
||||
>
|
||||
<view class="m-cell" @click="showbox" v-if="Config.PLANTFORM_FX_AGENT_ENABLE && false">
|
||||
<view class="m-cell-hd"><label class="u-label">{{ __("地区") }}</label></view>
|
||||
<view class="m-cell-bd">
|
||||
<label>{{ seladstr }}</label>
|
||||
</view>
|
||||
@ -124,17 +76,9 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-cell" v-if="false">
|
||||
<view class="m-cell-hd"
|
||||
><label class="u-label">{{ __("地址") }}</label></view
|
||||
>
|
||||
<view class="m-cell-hd"><label class="u-label">{{ __("地址") }}</label></view>
|
||||
<view class="m-cell-bd">
|
||||
<input
|
||||
class="u-input"
|
||||
type="text"
|
||||
:value="user_address"
|
||||
:placeholder="__('请输入联系地址')"
|
||||
@input="onInputAddress"
|
||||
/>
|
||||
<input class="u-input" type="text" :value="user_address" :placeholder="__('请输入联系地址')" @input="onInputAddress" />
|
||||
</view>
|
||||
<view v-if="!isUserAddress" class="m-cell-ft">
|
||||
<view class="m-icon-warn uni-icon uni-icon-info" type="warn"></view>
|
||||
@ -143,9 +87,7 @@
|
||||
</view>
|
||||
<view class="m-cells m-cells-form">
|
||||
<view class="m-cell">
|
||||
<view class="m-cell-hd"
|
||||
><label class="u-label">{{ __("生日") }}</label></view
|
||||
>
|
||||
<view class="m-cell-hd"><label class="u-label">{{ __("生日") }}</label></view>
|
||||
<view class="m-cell-bd">
|
||||
<picker mode="date" @change="bindDateChange">
|
||||
<label>{{ user_birthday }}</label>
|
||||
@ -154,18 +96,10 @@
|
||||
<text class="m-cell-ft-right birthday-right-icon"></text>
|
||||
</view>
|
||||
<view class="m-cell">
|
||||
<view class="m-cell-hd"
|
||||
><label class="u-label">{{ __("邮箱") }}</label></view
|
||||
>
|
||||
<view class="m-cell-hd"><label class="u-label">{{ __("邮箱") }}</label></view>
|
||||
<view class="m-cell-bd">
|
||||
<input
|
||||
class="u-input"
|
||||
type="text"
|
||||
:value="user_email"
|
||||
:placeholder="__('请输入邮箱地址')"
|
||||
@input="inputuser_email"
|
||||
maxlength="30"
|
||||
/>
|
||||
<input class="u-input" type="text" :value="user_email" :placeholder="__('请输入邮箱地址')" @input="inputuser_email"
|
||||
maxlength="30" />
|
||||
</view>
|
||||
<view v-if="!isUserEmail" class="m-cell-ft">
|
||||
<view class="m-icon-warn uni-icon uni-icon-info" type="warn"></view>
|
||||
@ -174,18 +108,10 @@
|
||||
</view>
|
||||
<view class="m-cells m-cells-form">
|
||||
<view class="m-cell">
|
||||
<view class="m-cell-hd"
|
||||
><label class="u-label">{{ __("手机号码") }}</label></view
|
||||
>
|
||||
<view class="m-cell-hd"><label class="u-label">{{ __("手机号码") }}</label></view>
|
||||
<view :class="['m-cell-bd', { 'phone-right-30': !isUserMobile }]">
|
||||
<input
|
||||
class="u-input"
|
||||
type="number"
|
||||
:placeholder="__('请输入手机号码')"
|
||||
maxlength="11"
|
||||
@input="inputphone"
|
||||
:value="user_mobile"
|
||||
/>
|
||||
<input class="u-input" type="number" :placeholder="__('请输入手机号码')" @input="inputphone"
|
||||
:value="user_mobile" />
|
||||
</view>
|
||||
<view v-if="!isUserMobile" class="m-cell-ft">
|
||||
<view class="m-icon-warn uni-icon uni-icon-info" type="warn"></view>
|
||||
@ -196,13 +122,7 @@
|
||||
<label class="u-label">{{ __("验证码") }}</label>
|
||||
</view>
|
||||
<view class="m-cell-bd">
|
||||
<input
|
||||
class="u-input"
|
||||
type="number"
|
||||
:placeholder="__('请输入验证码')"
|
||||
maxlength="6"
|
||||
@input="inputcode"
|
||||
/>
|
||||
<input class="u-input" type="number" :placeholder="__('请输入验证码')" maxlength="6" @input="inputcode" />
|
||||
</view>
|
||||
<view v-if="!isCode" class="m-cell-ft">
|
||||
<view class="m-icon-warn uni-icon uni-icon-info" type="warn"></view>
|
||||
@ -213,19 +133,10 @@
|
||||
<view v-else class="m-vcode-btn">{{ btntext }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<mpvue-city-picker
|
||||
:themeColor="themeColor"
|
||||
ref="mpvueCityPicker"
|
||||
:pickerValueDefault="cityPickerValueDefault"
|
||||
@onCancel="onCancel"
|
||||
@onConfirm="onConfirm"
|
||||
></mpvue-city-picker>
|
||||
<mpvue-city-picker :themeColor="themeColor" ref="mpvueCityPicker" :pickerValueDefault="cityPickerValueDefault"
|
||||
@onCancel="onCancel" @onConfirm="onConfirm"></mpvue-city-picker>
|
||||
|
||||
<button
|
||||
class="u-btn u-btn-default"
|
||||
@click="submitInfo"
|
||||
style="margin-top: 50rpx"
|
||||
>
|
||||
<button class="u-btn u-btn-default" @click="submitInfo" style="margin-top: 50rpx">
|
||||
{{ __("保存") }}
|
||||
</button>
|
||||
</view>
|
||||
@ -622,7 +533,47 @@ export default {
|
||||
isCode: true,
|
||||
});
|
||||
},
|
||||
upImgs: function (e) {
|
||||
|
||||
onChooseAvatar(event) {
|
||||
const { avatarUrl } = event.detail
|
||||
this.user_avatar = avatarUrl;
|
||||
this.onUploadAvatar(avatarUrl)
|
||||
},
|
||||
|
||||
onUploadAvatar(filePath) {
|
||||
var that = this;
|
||||
let ukey = uni.getStorageSync("ukey");
|
||||
|
||||
that.$.showLoading();
|
||||
|
||||
that.$.uploadFile({
|
||||
url: that.Config.URL.upload,
|
||||
method: "POST",
|
||||
filePath,
|
||||
name: "upfile",
|
||||
formData: {
|
||||
perm_key: ukey,
|
||||
},
|
||||
success: function (n) {
|
||||
that.$.hideLoading();
|
||||
|
||||
var up_res = that.$.parseJSON(n.data);
|
||||
var s = up_res.data.url;
|
||||
that.setData({
|
||||
user_avatar: s,
|
||||
});
|
||||
that.user_avatar = s;
|
||||
},
|
||||
fail: function (e) {
|
||||
that.$.hideLoading();
|
||||
},
|
||||
complete: function (e) {
|
||||
that.$.hideLoading();
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
chooseAvatar: function (e) {
|
||||
var that = this;
|
||||
let ukey = uni.getStorageSync("ukey");
|
||||
that.$.chooseImage({
|
||||
@ -650,6 +601,7 @@ export default {
|
||||
that.setData({
|
||||
user_avatar: s,
|
||||
});
|
||||
that.user_avatar = s;
|
||||
},
|
||||
fail: function (e) {
|
||||
that.$.hideLoading();
|
||||
@ -796,6 +748,13 @@ export default {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.avatar-wrapper {
|
||||
background: none;
|
||||
height: auto;
|
||||
line-height: auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.uni-uploader__file {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user