no message

This commit is contained in:
A1300399510 2024-08-30 10:50:05 +08:00
parent 5ed4969e55
commit dd5efc126b

View File

@ -40,7 +40,7 @@
</div> </div>
<div class="content offer-details"> <div class="content offer-details">
<div class="details-header flexacenter"> <div class="details-header flexacenter">
<img class="icon" crossorigin="anonymous" :src="offerinfo?.school?.image" /> <img class="icon" crossorigin="anonymous" :src="offerinfo?.school?.base64" />
<div class="school flex1 flexcolumn"> <div class="school flex1 flexcolumn">
<div class="name">{{ offerinfo?.school?.name }}</div> <div class="name">{{ offerinfo?.school?.name }}</div>
@ -216,7 +216,7 @@
<img class="semicircle-bj" crossorigin="anonymous" :src="semicircleicon" /> <img class="semicircle-bj" crossorigin="anonymous" :src="semicircleicon" />
</div> </div>
<div class="header flexacenter"> <div class="header flexacenter">
<img class="schoolimg" crossorigin="anonymous" :src="item.schoolimage" /> <img class="schoolimg" crossorigin="anonymous" :src="item.base64" />
<div class="schoolname">{{ item.schoolname }}</div> <div class="schoolname">{{ item.schoolname }}</div>
</div> </div>
<div class="summaryInclude-content flex1 flexcolumn"> <div class="summaryInclude-content flex1 flexcolumn">
@ -423,6 +423,23 @@
this.arrowsgray = arrowsgray this.arrowsgray = arrowsgray
}, },
methods: { methods: {
getBase64ImageFromURL(url, type, index) {
fetch(url)
.then(response => response.blob())
.then(blob => {
const reader = new FileReader()
reader.onloadend = () => {
if (type == "offer") {
this.offerinfo.school["base64"] = reader.result
} else {
this.offercollege[index]["base64"] = reader.result
this.$forceUpdate()
}
}
reader.readAsDataURL(blob)
})
},
// 获取 offer 详情 // 获取 offer 详情
getOfferDetails() { getOfferDetails() {
axios axios
@ -437,10 +454,11 @@
} }
const data = res.data const data = res.data
const offerinfo = data.offerinfo || {}
this.offerinfo = data.offerinfo this.offerinfo = offerinfo
this.moodmessage = data.moodmessage this.moodmessage = data.moodmessage
this.getPersonalBackground(data.backgroundid) this.getPersonalBackground(data.backgroundid)
this.getBase64ImageFromURL(offerinfo.school.image, "offer")
}) })
}, },
@ -458,7 +476,12 @@
} }
const data = res.data const data = res.data
this.offercollege = data.offercollege const offercollege = data.offercollege || []
offercollege.forEach((element, index) => {
this.getBase64ImageFromURL(element.schoolimage, "summary", index)
})
this.offercollege = offercollege
this.info = data.info this.info = data.info
}) })