Commit 544e4096 authored by 罗超's avatar 罗超

完善用户信息

parent 8e007732
...@@ -222,8 +222,8 @@ ...@@ -222,8 +222,8 @@
customerInfoChildrenId: u.directCustomerId, customerInfoChildrenId: u.directCustomerId,
realNameAuthentication: 0, realNameAuthentication: 0,
account: "", account: "",
name: Name, name:u.name,
customerName: u.name, customerName: Name,
photo: u.photo, photo: u.photo,
secretKey: "", secretKey: "",
token: u.token, token: u.token,
...@@ -233,6 +233,7 @@ ...@@ -233,6 +233,7 @@
EmLoginMobile: u.moblie, EmLoginMobile: u.moblie,
contactNumber: u.moblie, contactNumber: u.moblie,
salesBaseInfo: u.salesBaseInfo, salesBaseInfo: u.salesBaseInfo,
pid:u.pid,
count: 0, count: 0,
customerType: 1, //直客,2-同行 customerType: 1, //直客,2-同行
directCustomerId: u.directCustomerId //直客Id directCustomerId: u.directCustomerId //直客Id
......
...@@ -101,6 +101,13 @@ ...@@ -101,6 +101,13 @@
"titlePenetrate": "YES" "titlePenetrate": "YES"
} }
} }
},
{
"path" : "user-profile",
"style" :
{
"navigationBarTitleText" : "用户资料"
}
} }
] ]
}, },
......
...@@ -31,20 +31,23 @@ ...@@ -31,20 +31,23 @@
: 0, : 0,
}" }"
v-if="meueData.user_center.top_style == 1"> v-if="meueData.user_center.top_style == 1">
<u-avatar :src="user_info.avatar" size="140" shape="circle"></u-avatar> <u-avatar :src="b2b_user_info.photo?b2b_user_info.photo:user_info.avatar" size="140" shape="circle"></u-avatar>
<view style=" display: flex;flex-direction: column; justify-content: center; height: 100rpx; margin-left: 20rpx; "> <view style=" display: flex;flex-direction: column; justify-content: center; height: 100rpx; margin-left: 20rpx; ">
<Text class="nickname" style=" color: #fff; font-size: 36rpx;font-weight: 800; max-width: 400rpx; overflow: hidden; display: inline-block; white-space: nowrap;text-overflow: ellipsis; font-family:'microsoft yahei ui light'" <view class="row items-center" @click="navigatorToProfile">
@click="login(user_info)"> <Text class="nickname" style=" color: #fff; font-size: 36rpx;font-weight: 800; max-width: 400rpx; overflow: hidden; display: inline-block; white-space: nowrap;text-overflow: ellipsis; font-family:'microsoft yahei ui light'"
<template v-if="b2b_user_info&&b2b_user_info.name"> @click="login(user_info)">
{{b2b_user_info.name}} <template v-if="b2b_user_info&&b2b_user_info.name">
</template> {{b2b_user_info.name}}
<template v-else-if="mall_UserInfo&&mall_UserInfo.Name"> </template>
{{mall_UserInfo.Name}} <template v-else-if="mall_UserInfo&&mall_UserInfo.Name">
</template> {{mall_UserInfo.Name}}
<template v-else> </template>
立即登录 <template v-else>
</template> 立即登录
</Text> </template>
</Text>
<u-icon name="pen_" size="24" class="q-ml-sm" custom-prefix="tffont" color="#121212"></u-icon>
</view>
<view style="font-size:12px; margin-top:3px;"> <view style="font-size:12px; margin-top:3px;">
<template v-if="b2b_user_info&&b2b_user_info.customerName&&b2b_user_info.customerName!=''"> <template v-if="b2b_user_info&&b2b_user_info.customerName&&b2b_user_info.customerName!=''">
{{b2b_user_info.customerName}} {{b2b_user_info.customerName}}
...@@ -227,6 +230,7 @@ ...@@ -227,6 +230,7 @@
</template> </template>
<script> <script>
import tabbars from "@/components/tabbar/index"; import tabbars from "@/components/tabbar/index";
import auth from "../../components/auth/index.vue"; import auth from "../../components/auth/index.vue";
import blinddate from "./components/blinddate-user.vue"; import blinddate from "./components/blinddate-user.vue";
...@@ -351,6 +355,11 @@ ...@@ -351,6 +355,11 @@
0; 0;
}, },
methods: { methods: {
navigatorToProfile(){
uni.navigateTo({
url:'/pages/user-center/user-profile'
})
},
//退出登录 //退出登录
signOutHandler() { signOutHandler() {
uni.removeStorageSync('b2b_user') uni.removeStorageSync('b2b_user')
...@@ -610,6 +619,7 @@ ...@@ -610,6 +619,7 @@
</script> </script>
<style> <style>
@import url('../../asset/css/flex.css');
.body { .body {
background: #f3f4f6; background: #f3f4f6;
height: 100vh; height: 100vh;
......
<template>
<view class="user-profile column items-center">
<view style="margin-top: 20vh;" class="user-head" :style="{'background-image':`url(${user.photo})`}">
<button class="editor-box" open-type="chooseAvatar" @chooseavatar="avatarChangeHandle">
<u-icon name="pen_" size="20" custom-prefix="tffont" color="#121212"></u-icon>
</button>
</view>
<view class="row items-center" style="width: 100%;border-top: 1px solid #f1f2f4;border-bottom: 1px solid #f1f2f4;margin-top: 60rpx;">
<u-field class="col" :labelWidth="180" :padding="10" type="nickname" :maxlength='12' @input="changeNicknameHandle" v-model="user.name" label="昵称" placeholder="请输入你的昵称信息"></u-field>
<u-button v-if="saveVisible" size="mini" class="q-mr-md" type="success" @click="saveNicknameHandle">保存</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
user:{},
saveVisible:false
}
},
onLoad() {
if(uni.getStorageSync('b2b_user')){
this.user = uni.getStorageSync('b2b_user')
} else {
uni.redirectTo({
url:'/pages/index/index'
})
}
},
methods: {
avatarChangeHandle(e){
const { avatarUrl } = e.detail;
if(!avatarUrl) return
uni.showLoading({
title:'正在上传头像...'
})
const mallBaseId = uni.getStorageSync("mall_UserInfo").MallBaseId ? uni.getStorageSync("mall_UserInfo").MallBaseId : 1;
const url = 'https://mallapi.oytour.com' + '/api/File/UploadTencent?MallBaseId=' + mallBaseId
uni.uploadFile({
url,
filePath: avatarUrl, // 用户选择的头像文件路径
name: 'file',
formData: {
user: 'tesdt'
},
success: (uploadFileRes) => {
const data = JSON.parse(uploadFileRes.data);
this.user.photo = data.data
uni.hideLoading()
this.saveUserProfileHandle()
},
fail: function(res) {
uni.hideLoading()
uni.showToast({
title: '上传失败!',
icon: 'none'
})
}
});
},
changeNicknameHandle(){
const {name} = uni.getStorageSync('b2b_user')
if(this.user.name == '') this.user.name = name
this.saveVisible = this.user.name !=name
},
saveNicknameHandle(){
if(this.user.name!='' && this.saveVisible) this.saveUserProfileHandle()
},
saveUserProfileHandle(){
const {name,photo} = this.user
const parameters = { Name:name, Photo:photo}
uni.showLoading({
title:'正在保存用户资料'
})
this.apipost("HPSLUpdateUserInfo_post", parameters, r =>{
uni.hideLoading()
if(r.resultCode == 1){
uni.setStorageSync('b2b_user',this.user)
return;
}
uni.showToast({
icon:'none',
title:'用户资料更新失败'
})
},e=>{
uni.hideLoading()
uni.showToast({
icon:'none',
title:'用户资料更新失败'
})
})
}
}
}
</script>
<style>
@import url('../../asset/css/flex.css');
.user-profile {
height: 100vh;
}
.user-profile .user-head{
width: 160rpx;
height: 160rpx;
border-radius: 20rpx;
position: relative;
background-image: url('');
background-size: cover;
}
.user-profile .user-head .editor-box{
width: 40rpx;
height: 40rpx;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
right: -20rpx;
top: -20rpx;
background-color: #FFF;
border-radius: 40rpx;
box-shadow: 0 0 20rpx #00000033;
border: none;
outline: none;
padding: 0;
}
</style>
...@@ -23,10 +23,10 @@ export default { ...@@ -23,10 +23,10 @@ export default {
install(Vue, options) { install(Vue, options) {
Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285" Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
Vue.prototype.host2 = "http://192.168.5.56:8033" Vue.prototype.host2 = "http://192.168.5.214:8033"
//Vue.prototype.host3 = "http://192.168.5.46:8501" Vue.prototype.host3 = "http://192.168.5.214"
//Vue.prototype.host2 = "https://erpmallapi.oytour.com" //Vue.prototype.host2 = "https://erpmallapi.oytour.com"
Vue.prototype.host3 = "https://reborn.oytour.com" //Vue.prototype.host3 = "https://reborn.oytour.com"
Vue.prototype.request = function(param, success, failed) { Vue.prototype.request = function(param, success, failed) {
//网络请求 //网络请求
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment