...
|
...
|
@@ -49,6 +49,7 @@ |
|
|
.detail_item_right {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
position: relative;
|
|
|
}
|
|
|
|
|
|
.detail_item_right .iconfont {
|
...
|
...
|
@@ -90,6 +91,14 @@ |
|
|
position: fixed;
|
|
|
/*margin: 0.3rem 0 0 0;*/
|
|
|
}
|
|
|
.img_input{
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
opacity: 0;
|
|
|
}
|
|
|
|
|
|
</style>
|
|
|
</head>
|
...
|
...
|
@@ -99,11 +108,12 @@ |
|
|
<div class="detail_top">
|
|
|
<div class="detail_item">
|
|
|
<div>头像</div>
|
|
|
<div class="detail_item_right" @click="popupVisible_head_img=true">
|
|
|
<div class="detail_item_right" >
|
|
|
<span class="detail_item_img padding0">
|
|
|
<img :src="head_img?head_img:'../../assets/image/default_img.png'" alt="">
|
|
|
</span>
|
|
|
<span class="iconfont icon-xiangyou"></span>
|
|
|
<input type="file" @change="takePhotos" accept="image/jpeg,image/x-png,image/gif" id="" value="" class="img_input">
|
|
|
</div>
|
|
|
<mt-popup v-model="popupVisible_head_img" position="bottom">
|
|
|
<ul class="moreoul">
|
...
|
...
|
@@ -276,37 +286,37 @@ |
|
|
user_type_name: ''
|
|
|
},
|
|
|
created: function () {
|
|
|
apiready = function () {
|
|
|
for (var i = 0; i < 300; i++) {
|
|
|
app.weight_list.push({
|
|
|
"label": i + 'kg',
|
|
|
"value": i,
|
|
|
})
|
|
|
}
|
|
|
for (var j = 50; j < 300; j++) {
|
|
|
app.height_list.push(
|
|
|
{
|
|
|
"label": j + 'cm',
|
|
|
"value": j,
|
|
|
}
|
|
|
)
|
|
|
}
|
|
|
app.user_type_name = api.pageParam.name;
|
|
|
app.rid = api.pageParam.rid;
|
|
|
// alert(app.rid)
|
|
|
app.type = api.pageParam.type;
|
|
|
if (app.type == 0) {
|
|
|
app.getUserinfo();
|
|
|
}
|
|
|
app.getJob();
|
|
|
app.getCulture();
|
|
|
app.getMedical();
|
|
|
app.getRelationship();
|
|
|
var app = this;
|
|
|
for (var i = 0; i < 300; i++) {
|
|
|
app.weight_list.push({
|
|
|
"label": i + 'kg',
|
|
|
"value": i,
|
|
|
})
|
|
|
}
|
|
|
for (var j = 50; j < 300; j++) {
|
|
|
app.height_list.push(
|
|
|
{
|
|
|
"label": j + 'cm',
|
|
|
"value": j,
|
|
|
}
|
|
|
)
|
|
|
}
|
|
|
app.user_type_name = localStorage.getItem('name');
|
|
|
app.rid = localStorage.getItem('rid');
|
|
|
// alert(app.rid)
|
|
|
app.type = localStorage.getItem('type');
|
|
|
if (app.type == 0) {
|
|
|
app.getUserinfo();
|
|
|
}
|
|
|
app.getJob();
|
|
|
app.getCulture();
|
|
|
app.getMedical();
|
|
|
app.getRelationship();
|
|
|
},
|
|
|
methods: {
|
|
|
// 获取个人信息
|
|
|
getUserinfo: function () {
|
|
|
var app = this;
|
|
|
var post = {
|
|
|
rid: app.rid
|
|
|
};
|
...
|
...
|
@@ -318,7 +328,7 @@ |
|
|
if (res.data.code == 1) {
|
|
|
// alert(JSON.stringify(res));
|
|
|
app.user_info = res.data.data;
|
|
|
app.head_img = app.user_info.avatar;
|
|
|
app.head_img = 'http://wx.cijievip.com/'+app.user_info.avatar;
|
|
|
app.name = app.user_info.name ? app.user_info.name : '';
|
|
|
app.user_info.sex == 1 ? app.checked_male = true : app.checked_male = false;
|
|
|
app.phone = app.user_info.mobile;
|
...
|
...
|
@@ -342,48 +352,72 @@ |
|
|
})
|
|
|
},
|
|
|
// 选择头像
|
|
|
takePhotos: function (type) {
|
|
|
api.getPicture({
|
|
|
sourceType: type,
|
|
|
encodingType: 'jpg',
|
|
|
mediaValue: 'pic',
|
|
|
destinationType: 'url',
|
|
|
allowEdit: true,
|
|
|
quality: 50,
|
|
|
targetWidth: 100,
|
|
|
targetHeight: 100,
|
|
|
saveToPhotoAlbum: false
|
|
|
}, function (ret, err) {
|
|
|
if (ret) {
|
|
|
api.ajax({
|
|
|
url: baseurl + "user/index/upAvatar",
|
|
|
method: 'post',
|
|
|
data: {
|
|
|
files: {
|
|
|
file: ret.data
|
|
|
}
|
|
|
},
|
|
|
takePhotos: function () {
|
|
|
var app = this;
|
|
|
var file = e.target.files[0];e
|
|
|
var imgSize=file.size/1024;
|
|
|
if(imgSize>200){
|
|
|
alert('请上传大小不要超过200KB的图片')
|
|
|
}else{
|
|
|
var reader = new FileReader();
|
|
|
reader.readAsDataURL(file); // 读出 base64
|
|
|
reader.onloadend = function () {
|
|
|
// 图片的 base64 格式, 可以直接当成 img 的 src 属性值
|
|
|
var dataURL = reader.result;
|
|
|
// 下面逻辑处理
|
|
|
$.ajax({
|
|
|
type:"post",
|
|
|
url:baseurl + "user/index/upAvatar",
|
|
|
headers: {
|
|
|
"XX-Device-Type": getDevice(),
|
|
|
"XX-Token": getToken()
|
|
|
},
|
|
|
async:true,
|
|
|
data:{
|
|
|
avatar:dataURL,
|
|
|
avatar_wx:1,
|
|
|
token:token,
|
|
|
uid:uid
|
|
|
},
|
|
|
success:function(e){
|
|
|
that.avatar=dataURL;
|
|
|
alert('修改成功');
|
|
|
$(".tsk").show().delay(1500).hide(0);
|
|
|
}
|
|
|
}, function (res, err) {
|
|
|
// alert(JSON.stringify(res));
|
|
|
if (res) {
|
|
|
app.head_img = res.data.url
|
|
|
} else {
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
|
|
|
}
|
|
|
if (ret) {
|
|
|
api.ajax({
|
|
|
url: baseurl + "user/index/upAvatar",
|
|
|
method: 'post',
|
|
|
data: {
|
|
|
files: {
|
|
|
file: ret.data
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
// alert(JSON.stringify(err));
|
|
|
toastMsg('取消')
|
|
|
}
|
|
|
});
|
|
|
app.popupVisible_head_img = false;
|
|
|
},
|
|
|
headers: {
|
|
|
"XX-Device-Type": getDevice(),
|
|
|
"XX-Token": getToken()
|
|
|
}
|
|
|
}, function (res, err) {
|
|
|
// alert(JSON.stringify(res));
|
|
|
if (res) {
|
|
|
app.head_img = res.data.url
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
// alert(JSON.stringify(err));
|
|
|
toastMsg('取消')
|
|
|
}
|
|
|
},
|
|
|
// 选择生日
|
|
|
broSelect: function () {
|
|
|
var app = this;
|
|
|
api.openPicker({
|
|
|
type: 'date',
|
|
|
title: '选择出生日期'
|
...
|
...
|
@@ -406,6 +440,7 @@ |
|
|
},
|
|
|
// 选择身高
|
|
|
heightSelect: function () {
|
|
|
var app = this;
|
|
|
weui.picker(app.height_list, {
|
|
|
defaultValue: [170],
|
|
|
onChange: function (result) {
|
...
|
...
|
@@ -417,6 +452,7 @@ |
|
|
},
|
|
|
// 选择体重
|
|
|
weightSelect: function () {
|
|
|
var app = this;
|
|
|
weui.picker(app.weight_list,
|
|
|
{
|
|
|
defaultValue: [50],
|
...
|
...
|
@@ -430,6 +466,7 @@ |
|
|
},
|
|
|
// 选择婚姻状况
|
|
|
getMarry: function () {
|
|
|
var app = this;
|
|
|
weui.picker(app.merry_list, {
|
|
|
onChange: function (result) {
|
|
|
},
|
...
|
...
|
@@ -441,6 +478,7 @@ |
|
|
|
|
|
// 获取文化程度
|
|
|
getCulture: function () {
|
|
|
var app = this;
|
|
|
var header = {
|
|
|
'XX-Device-Type': getDevice(),
|
|
|
'XX-Token': getToken()
|
...
|
...
|
@@ -462,6 +500,7 @@ |
|
|
},
|
|
|
// 选择文化程度
|
|
|
educations: function () {
|
|
|
var app = this;
|
|
|
weui.picker(app.getCulture_data, {
|
|
|
onChange: function (result) {
|
|
|
},
|
...
|
...
|
@@ -473,6 +512,7 @@ |
|
|
},
|
|
|
// 获取职业
|
|
|
getJob: function () {
|
|
|
var app = this;
|
|
|
var header = {
|
|
|
'XX-Device-Type': getDevice(),
|
|
|
'XX-Token': getToken()
|
...
|
...
|
@@ -495,6 +535,7 @@ |
|
|
},
|
|
|
// 选择职业
|
|
|
getPosition: function () {
|
|
|
var app = this;
|
|
|
weui.picker(app.position_list, {
|
|
|
onChange: function (result) {
|
|
|
},
|
...
|
...
|
@@ -506,6 +547,7 @@ |
|
|
},
|
|
|
// 获取医保类型数据
|
|
|
getMedical: function () {
|
|
|
var app = this;
|
|
|
var header = {
|
|
|
'XX-Device-Type': getDevice(),
|
|
|
'XX-Token': getToken()
|
...
|
...
|
@@ -527,6 +569,7 @@ |
|
|
},
|
|
|
// 选择医保类型
|
|
|
doctors: function () {
|
|
|
var app = this;
|
|
|
weui.picker(app.getMedical_data,
|
|
|
{
|
|
|
onChange: function (result) {
|
...
|
...
|
@@ -540,6 +583,7 @@ |
|
|
|
|
|
// 获取亲友关系
|
|
|
getRelationship: function () {
|
|
|
var app = this;
|
|
|
var header = {
|
|
|
'XX-Device-Type': getDevice(),
|
|
|
'XX-Token': getToken()
|
...
|
...
|
@@ -560,6 +604,7 @@ |
|
|
},
|
|
|
// 选择亲友关系
|
|
|
relation_fun: function () {
|
|
|
var app = this;
|
|
|
weui.picker(app.relationShip,
|
|
|
{
|
|
|
onChange: function (result) {
|
...
|
...
|
@@ -572,6 +617,7 @@ |
|
|
},
|
|
|
// 添加亲友
|
|
|
newRecord: function () {
|
|
|
var app = this;
|
|
|
var post = {
|
|
|
rid: app.rid,
|
|
|
relation: app.relation_value,
|
...
|
...
|
|