mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-08 04:46:45 +08:00
【银保app】查看和上传头像
This commit is contained in:
@@ -343,12 +343,12 @@ export default {
|
||||
methods:{
|
||||
setMarginTop(){
|
||||
EWebBridge.webCallAppInJs("top_bar_height").then(data => {
|
||||
let result = JSON.parse(data)
|
||||
if(result){
|
||||
// 获取高度成功
|
||||
let height = result.height
|
||||
// 设置高度
|
||||
this.marginTop = height
|
||||
console.log(data,'top_bar_height')
|
||||
if(data){
|
||||
// 获取高度成功
|
||||
let height = data.height
|
||||
// 设置高度
|
||||
this.marginTop = height
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
|
||||
<div style="display:flex;justify-content: flex-start;padding: 65px 15px 15px 20px;align-items: center;">
|
||||
<div style="width:60px;">
|
||||
<img style="width:100%;" src="@/assets/YB_APP/images/25.png">
|
||||
<!-- <img style="width:100%;" src="@/assets/YB_APP/images/25.png" @click="uploadHeadImage(item)"> -->
|
||||
<img style="width:100%;" :src="imagePath" @click="uploadHeadImage()">
|
||||
</div>
|
||||
<div style="margin-left:15px;">
|
||||
<p style="color:#fff;padding: 3px;display: flex;align-items: center;">
|
||||
@@ -59,6 +60,7 @@
|
||||
<script>
|
||||
import { Icon, Cell } from 'vant'
|
||||
import { homeConfigYB } from '@/api/YB_APP/index'
|
||||
import imagePath from '@/assets/YB_APP/images/25.png'
|
||||
export default {
|
||||
name: 'mine',
|
||||
components: {
|
||||
@@ -68,7 +70,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
messages:false,
|
||||
menu1:[]
|
||||
menu1:[],
|
||||
imagePath: imagePath //新头像URL
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
@@ -96,6 +99,23 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
uploadHeadImage(){
|
||||
EWebBridge.webCallAppInJs("head_image").then(data => {
|
||||
console.log(data,'head_image')
|
||||
let uploadResult = JSON.parse(data)
|
||||
if(uploadResult.code==0){
|
||||
// 头像上传成功
|
||||
let uploadData = uploadResult.content
|
||||
// 新头像URL
|
||||
this.imagePath = uploadData.imageUrl
|
||||
} else if(uploadResult.code==1) {
|
||||
//头像选择或上传失败 错误信息
|
||||
let errorMessage = uploadResult.message
|
||||
// 提示异常信息
|
||||
// 用户选择了头像预览
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user