no message
This commit is contained in:
parent
5ed4969e55
commit
dd5efc126b
33
index.html
33
index.html
@ -40,7 +40,7 @@
|
||||
</div>
|
||||
<div class="content offer-details">
|
||||
<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="name">{{ offerinfo?.school?.name }}</div>
|
||||
|
||||
@ -216,7 +216,7 @@
|
||||
<img class="semicircle-bj" crossorigin="anonymous" :src="semicircleicon" />
|
||||
</div>
|
||||
<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>
|
||||
<div class="summaryInclude-content flex1 flexcolumn">
|
||||
@ -423,6 +423,23 @@
|
||||
this.arrowsgray = arrowsgray
|
||||
},
|
||||
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 详情
|
||||
getOfferDetails() {
|
||||
axios
|
||||
@ -437,10 +454,11 @@
|
||||
}
|
||||
|
||||
const data = res.data
|
||||
|
||||
this.offerinfo = data.offerinfo
|
||||
const offerinfo = data.offerinfo || {}
|
||||
this.offerinfo = offerinfo
|
||||
this.moodmessage = data.moodmessage
|
||||
this.getPersonalBackground(data.backgroundid)
|
||||
this.getBase64ImageFromURL(offerinfo.school.image, "offer")
|
||||
})
|
||||
},
|
||||
|
||||
@ -458,7 +476,12 @@
|
||||
}
|
||||
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
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user