|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
|
|
|
- <uni-nav-bar id="nav-bar" status-bar="true" @clickLeft="onBack()" :title="pageTitle" color="#000000" fixed="true"
|
|
|
- :border="false">
|
|
|
+ <uni-nav-bar id="nav-bar" status-bar="true" @clickLeft="onBack()" :title="pageTitle" color="#000000"
|
|
|
+ fixed="true" :border="false">
|
|
|
<view slot="left">
|
|
|
<view v-if="!bNewUser" class=" flex align-center margin-left">
|
|
|
<image class="p-left-arrow" src="../../../static/p-left-arrow.png"></image>
|
|
@@ -29,11 +29,13 @@
|
|
|
昵称
|
|
|
</view>
|
|
|
|
|
|
- <input maxlength="8" placeholder="输入名字" :value="changeData.userName" @input="onInput('name',$event)"></input>
|
|
|
+ <input maxlength="8" placeholder="输入名字" :value="changeData.userName"
|
|
|
+ @input="onInput('name',$event)"></input>
|
|
|
|
|
|
|
|
|
</view>
|
|
|
- <view class="item-group flex align-center" @tap="showModal" data-target="showPickerModal" data-type="gender">
|
|
|
+ <view class="item-group flex align-center" @tap="showModal" data-target="showPickerModal"
|
|
|
+ data-type="gender">
|
|
|
<view class="text-grey padding-sm margin-name text-width flex">性别
|
|
|
<view v-if="bNewUser" style="position: relative; width: 4px;">
|
|
|
<!-- <view class="cu-tag badge"></view> -->
|
|
@@ -41,7 +43,8 @@
|
|
|
</view>
|
|
|
<view class="text-bold">{{changeData.gender==0?'男':'女'}}</view>
|
|
|
</view>
|
|
|
- <view class="item-group flex align-center" @tap="showModal" data-target="showPickerModal" data-type="birthday">
|
|
|
+ <view class="item-group flex align-center" @tap="showModal" data-target="showPickerModal"
|
|
|
+ data-type="birthday">
|
|
|
<view class="text-grey padding-sm margin-name text-width flex">生日
|
|
|
<view v-if="bNewUser" style="position: relative; width: 4px;">
|
|
|
<!-- <view class="cu-tag badge"></view> -->
|
|
@@ -61,8 +64,9 @@
|
|
|
|
|
|
<view class="flex justify-start ">
|
|
|
<view class="text-grey padding-sm margin-name text-width flex-shrink">个性签名</view>
|
|
|
- <textarea class="sign-text text-bold" maxlength="50" placeholder="在这里留下你的签名吧!" :value="changeData.signature!=='null'?changeData.signature:''"
|
|
|
- @input="onInput('signature',$event)"></textarea>
|
|
|
+ <textarea class="sign-text text-bold" maxlength="50" placeholder="在这里留下你的签名吧!"
|
|
|
+ :value="changeData.signature!=='null'?changeData.signature:''"
|
|
|
+ @input="onInput('signature',$event)"></textarea>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="card-view margin-top ">
|
|
@@ -95,11 +99,11 @@
|
|
|
<view class="item-group">
|
|
|
<view class="text-grey padding-sm margin-name text-width flex">手机
|
|
|
</view>
|
|
|
- <view class="text-bold">{{phoneNumber!==''?phoneNumber:'未绑定' }}</view>
|
|
|
+ <view class="text-bold text-cut" style="width: 220rpx;">{{phoneNumber!==''?phoneNumber:'未绑定' }}</view>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
- <view class="right-container" @tap="onBindPhone">
|
|
|
+ <view class="right-container" @tap="onBindType('phone')">
|
|
|
<image style="width: 48rpx;height: 48rpx;" src="/static/bindPhone.png"></image>
|
|
|
<text class="text-grey text-sm" style="margin: 0 24rpx;">{{phoneNumber!==''?'已绑定':'去绑定'}}</text>
|
|
|
<view class="only-arrow"></view>
|
|
@@ -108,6 +112,25 @@
|
|
|
|
|
|
</view>
|
|
|
|
|
|
+ <view class="card-view margin-top">
|
|
|
+ <view class="cu-item shadow padding-top-sm padding-bottom-sm flex justify-between">
|
|
|
+ <view class="content">
|
|
|
+ <view class="item-group">
|
|
|
+ <view class="text-grey padding-sm margin-name text-width flex">邮箱
|
|
|
+ </view>
|
|
|
+ <view class="text-bold text-cut" style="width: 220rpx;">{{mailboxNumber!==''?mailboxNumber:'未绑定' }}11111111111111111111</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ <view class="right-container" @tap="onBindType('mailbox')">
|
|
|
+ <image style="width: 48rpx;height: 48rpx;" src="/static/bindPhone.png"></image>
|
|
|
+ <text class="text-grey text-sm" style="margin: 0 24rpx;">{{mailboxNumber!==''?'已绑定':'去绑定'}}</text>
|
|
|
+ <view class="only-arrow"></view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+
|
|
|
<view v-if="bInstallWechat&&!bHideWeixin" class="card-view margin-top ">
|
|
|
<view class="cu-item shadow padding-top-sm padding-bottom-sm flex justify-between">
|
|
|
<view class="content">
|
|
@@ -133,10 +156,11 @@
|
|
|
<view class="btn-confirm" @tap="onNavUser">保存</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="cu-modal bottom-modal" :class="modalName=='showPickerModal'?'show':''" @touchmove.stop.prevent="moveHandle">
|
|
|
+ <view class="cu-modal bottom-modal" :class="modalName=='showPickerModal'?'show':''"
|
|
|
+ @touchmove.stop.prevent="moveHandle">
|
|
|
<view class="cu-dialog" style="border-top-right-radius: 20rpx; border-top-left-radius: 20rpx;">
|
|
|
- <myPicker v-if="modalName == 'showPickerModal' ? true:false" :pickerObj="pickerObj" @confirmEvent="onConfirm"
|
|
|
- @cancelEvent="hideModal">
|
|
|
+ <myPicker v-if="modalName == 'showPickerModal' ? true:false" :pickerObj="pickerObj"
|
|
|
+ @confirmEvent="onConfirm" @cancelEvent="hideModal">
|
|
|
</myPicker>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -144,7 +168,8 @@
|
|
|
<view class="cu-modal" :class="modalName=='showBindModal'?'show':''" @touchmove.stop.prevent="moveHandle">
|
|
|
<view class="cu-bind-modal">
|
|
|
<view style="position: absolute; top: 0; left: 0; width: 100%; height:100%;">
|
|
|
- <image style="position: absolute;top: 0;left: 0; width: 100%;height: 100%;" src="../../../static/modelBg.png"></image>
|
|
|
+ <image style="position: absolute;top: 0;left: 0; width: 100%;height: 100%;"
|
|
|
+ src="../../../static/modelBg.png"></image>
|
|
|
</view>
|
|
|
<view class="flex flex-direction justify-between " style="position: relative; height: 100%;">
|
|
|
<view class="flex justify-around justify-center align-center" style="margin: 170rpx 30rpx 0 30rpx;">
|
|
@@ -154,10 +179,13 @@
|
|
|
</view>
|
|
|
<view class="text-16px">{{bindModal.content}}</view>
|
|
|
|
|
|
- <view class="flex justify-around align-center" style=" border-top: 1rpx solid #EEEEEE; margin-bottom: 2px;">
|
|
|
- <view class="flex justify-center align-center text-16px" style="width: 100%;height: 123rpx;" @tap="hideModal">稍后再说</view>
|
|
|
+ <view class="flex justify-around align-center"
|
|
|
+ style=" border-top: 1rpx solid #EEEEEE; margin-bottom: 2px;">
|
|
|
+ <view class="flex justify-center align-center text-16px" style="width: 100%;height: 123rpx;"
|
|
|
+ @tap="hideModal">稍后再说</view>
|
|
|
<view style="height: 123rpx;width: 1px;background-color: #EEEEEE;"></view>
|
|
|
- <view class="flex justify-center align-center text-16px" style="width: 100%;height: 123rpx;" @tap="hideBindModal">确定</view>
|
|
|
+ <view class="flex justify-center align-center text-16px" style="width: 100%;height: 123rpx;"
|
|
|
+ @tap="hideBindModal">确定</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
@@ -180,7 +208,7 @@
|
|
|
} from 'vuex'
|
|
|
export default {
|
|
|
computed: mapState(['bNewUser', 'height', 'weight', 'userName', 'avatarUrl', 'days', 'signature', "gender",
|
|
|
- 'birthday', 'city', 'phoneNumber', 'openid','bInstallWechat','bHideWeixin'
|
|
|
+ 'birthday', 'city', 'phoneNumber', 'mailboxNumber', 'openid', 'bInstallWechat', 'bHideWeixin'
|
|
|
]),
|
|
|
components: {
|
|
|
myPicker
|
|
@@ -201,7 +229,7 @@
|
|
|
pickerObj,
|
|
|
bChoose: false,
|
|
|
// oldData: null,
|
|
|
- changeData:null,
|
|
|
+ changeData: null,
|
|
|
//是否可以更新
|
|
|
bCanUpdate: false,
|
|
|
|
|
@@ -230,7 +258,7 @@
|
|
|
// "city":this.city,
|
|
|
// "sBirthday": date.formatDate(dateTemp)
|
|
|
// };
|
|
|
-
|
|
|
+
|
|
|
this.changeData = {
|
|
|
'height': this.height,
|
|
|
'weight': this.weight,
|
|
@@ -240,7 +268,7 @@
|
|
|
"gender": this.gender,
|
|
|
"cityCode": this.city.cityCode,
|
|
|
'birthday': this.birthday,
|
|
|
- "city":this.city,
|
|
|
+ "city": this.city,
|
|
|
"sBirthday": date.formatDate(dateTemp)
|
|
|
};
|
|
|
|
|
@@ -259,13 +287,13 @@
|
|
|
success: (res) => {
|
|
|
this.bChoose = true;
|
|
|
let size = res.tempFiles[0].size;
|
|
|
- console.log('res:',res);
|
|
|
- if(size<=10000000){
|
|
|
+ console.log('res:', res);
|
|
|
+ if (size <= 10000000) {
|
|
|
this.changeData.avatarUrl = res.tempFiles[0].path;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
uni.showToast({
|
|
|
- title:'上传的图片不能超过10M',
|
|
|
- icon:'none',
|
|
|
+ title: '上传的图片不能超过10M',
|
|
|
+ icon: 'none',
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -304,7 +332,7 @@
|
|
|
//上传用户数据
|
|
|
onNavUser() {
|
|
|
let that = this;
|
|
|
-
|
|
|
+
|
|
|
uni.showToast({
|
|
|
title: "",
|
|
|
icon: "loading",
|
|
@@ -323,7 +351,7 @@
|
|
|
"weight": this.changeData.weight,
|
|
|
"height": this.changeData.height,
|
|
|
}
|
|
|
- console.log("更新时候的 data信息:",data);
|
|
|
+ console.log("更新时候的 data信息:", data);
|
|
|
//如果选择了图片,用图片接口更新数据
|
|
|
if (that.bChoose) {
|
|
|
reqUtil.reqUpload(config.URL.USERINFOADDAVATAR, data, that.changeData.avatarUrl).then(res => {
|
|
@@ -348,7 +376,7 @@
|
|
|
// url: "../../personal-page/personal/personal"
|
|
|
// })
|
|
|
uni.redirectTo({
|
|
|
- url:'../firstPlan/firstPlan'
|
|
|
+ url: '../firstPlan/firstPlan'
|
|
|
})
|
|
|
} else {
|
|
|
uni.navigateBack({
|
|
@@ -405,7 +433,7 @@
|
|
|
// url: "../../personal-page/personal/personal"
|
|
|
// })
|
|
|
uni.redirectTo({
|
|
|
- url:'../firstPlan/firstPlan'
|
|
|
+ url: '../firstPlan/firstPlan'
|
|
|
})
|
|
|
} else {
|
|
|
uni.navigateBack({
|
|
@@ -538,7 +566,7 @@
|
|
|
},
|
|
|
|
|
|
|
|
|
- onBindPhone() {
|
|
|
+ onBindType(type) {
|
|
|
// //TODO 弹出解绑提示
|
|
|
// this.bindModal = {
|
|
|
// title: '解绑',
|
|
@@ -546,16 +574,22 @@
|
|
|
// type: "deletePhoneNumber"
|
|
|
// };
|
|
|
// this.modalName = "showBindModal";
|
|
|
- if (!this.phoneNumber) {
|
|
|
- uni.navigateTo({
|
|
|
- url: "../../login-page/bindPhone/bindPhone"
|
|
|
- })
|
|
|
- } else {
|
|
|
+ if (type == 'phone' && this.phoneNumber) {
|
|
|
uni.showToast({
|
|
|
title: '已绑定手机',
|
|
|
icon: 'none',
|
|
|
})
|
|
|
+ return;
|
|
|
+ } else if (type == 'mailbox' && this.mailboxNumber) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '已绑定邮箱',
|
|
|
+ icon: 'none',
|
|
|
+ })
|
|
|
+ return;
|
|
|
}
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "../../login-page/bindPhone/bindPhone?type=" + type
|
|
|
+ })
|
|
|
|
|
|
},
|
|
|
onBindWeixin() {
|