|
|
|
@ -28,7 +28,7 @@
|
|
|
|
|
<div class="colRightTbox">
|
|
|
|
|
<div class="titleLogo">头像信息</div>
|
|
|
|
|
<div class="mypicture">
|
|
|
|
|
<img v-if="txfull" src="" alt=""
|
|
|
|
|
<img v-if="txfull" :src="imgSrc" alt=""
|
|
|
|
|
style="display:inline-block;width: 100%;height: 100%;"
|
|
|
|
|
ref="imgChange">
|
|
|
|
|
<img v-if="!txfull" src="./images/emptyPic.png"
|
|
|
|
@ -44,7 +44,7 @@
|
|
|
|
|
v-model:file-list="fileListPic" :before-upload="beforeUpload"
|
|
|
|
|
class="fixBtnChange" @change="picFileChange">更换图片
|
|
|
|
|
</a-upload>
|
|
|
|
|
<a-button class="fixBtnSave" type="primary">保存头像</a-button>
|
|
|
|
|
<a-button class="fixBtnSave" type="primary" @click="saveTx">保存头像</a-button>
|
|
|
|
|
<span>仅支持.jpg.jpeg.png.bmp图片格式</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="colRightBbox">
|
|
|
|
@ -67,11 +67,12 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {Modal, Row, Col, Button, Icon, Upload} from 'ant-design-vue';
|
|
|
|
|
import {Modal, Row, Col, Button, Icon, Upload, message} from 'ant-design-vue';
|
|
|
|
|
import InterConfig from './interConfig'
|
|
|
|
|
import GUID_UUID from '../../../../../global-llibs/guid-uuid'
|
|
|
|
|
import BaseConfig from '../../../../../global-llibs/base-config'
|
|
|
|
|
import Uploader from '../../../../../components/common/uploader/Upload.vue'
|
|
|
|
|
import StaticParams from '../../../../../global-llibs/staticParams';
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "PersonMsgModal",
|
|
|
|
@ -90,6 +91,7 @@
|
|
|
|
|
fileListPic: [],
|
|
|
|
|
personIdPic: '',
|
|
|
|
|
txfull: true,
|
|
|
|
|
imgSrc: '',
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
components: {
|
|
|
|
@ -99,6 +101,7 @@
|
|
|
|
|
AButton: Button,
|
|
|
|
|
AIcon: Icon,
|
|
|
|
|
AUpload: Upload,
|
|
|
|
|
// AMessage: message,
|
|
|
|
|
Uploader,
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
@ -144,7 +147,7 @@
|
|
|
|
|
},
|
|
|
|
|
uploadComplete: function (file) {
|
|
|
|
|
this.fileList = file
|
|
|
|
|
console.log('uploadComplete参数', file)
|
|
|
|
|
//console.log('uploadComplete参数', file)
|
|
|
|
|
},
|
|
|
|
|
//修改证件照
|
|
|
|
|
changeModifyPhoto() {
|
|
|
|
@ -171,14 +174,15 @@
|
|
|
|
|
identity_id: BaseConfig.userInfo.identity_id_cookie
|
|
|
|
|
}
|
|
|
|
|
this.InterfaceConfig.callInterface([{
|
|
|
|
|
url: InterConfig.personTx.url,
|
|
|
|
|
url: InterConfig.getPersonTxByYw.url,
|
|
|
|
|
params: param,
|
|
|
|
|
method: InterConfig.personTx.method,
|
|
|
|
|
isTestLogin: InterConfig.personTx.isTestLogin,
|
|
|
|
|
method: InterConfig.getPersonTxByYw.method,
|
|
|
|
|
isTestLogin: InterConfig.getPersonTxByYw.isTestLogin,
|
|
|
|
|
}], (result) => {
|
|
|
|
|
//console.log('获取头像', result)
|
|
|
|
|
console.log('获取头像', result)
|
|
|
|
|
if (result[0].data.file_id !== "") {
|
|
|
|
|
this.$refs.imgChange.src = result[0].data.file_id
|
|
|
|
|
this.imgSrc = result[0].data.file_id + ',' + result[0].data.extension
|
|
|
|
|
// console.log('fileId', this.$refs.imgChange.src)
|
|
|
|
|
} else {
|
|
|
|
|
this.txfull = false
|
|
|
|
|
}
|
|
|
|
@ -190,6 +194,27 @@
|
|
|
|
|
let targetUrl = val.fileList[val.fileList.length - 1]
|
|
|
|
|
this.$refs.imgChange.src = targetUrl.thumbUrl
|
|
|
|
|
},
|
|
|
|
|
//保存头像
|
|
|
|
|
saveTx() {
|
|
|
|
|
let param = {
|
|
|
|
|
person_id: BaseConfig.userInfo.person_id_cookie,
|
|
|
|
|
identity_id: BaseConfig.userInfo.identity_id_cookie,
|
|
|
|
|
file_id: this.$refs.imgChange.src,
|
|
|
|
|
extension: 'png',
|
|
|
|
|
}
|
|
|
|
|
this.InterfaceConfig.callInterface([{
|
|
|
|
|
url: InterConfig.setPersonTxByYw.url,
|
|
|
|
|
params: param,
|
|
|
|
|
method: InterConfig.setPersonTxByYw.method,
|
|
|
|
|
isTestLogin: InterConfig.setPersonTxByYw.isTestLogin,
|
|
|
|
|
}], (result) => {
|
|
|
|
|
if (!result[0].data.success) {
|
|
|
|
|
message.error('保存失败')
|
|
|
|
|
} else {
|
|
|
|
|
message.success('保存成功')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|