我的勋章

This commit is contained in:
zhaofang
2022-09-19 18:01:16 +08:00
parent ccba5e05aa
commit c79bf06fe0
5 changed files with 221 additions and 32 deletions

View File

@@ -38,13 +38,17 @@
// this.userAvatar=require("@/assets/images/user/default.png");
apiUserhobby.has().then(res=>{
if(res.status == 200) {
this.interestCollection = true;
} else {
let time = localStorage.getItem('notYet');
let day = (new Date() - new Date(time))/(1000*60*60*24);
if(day > 15){
this.interestCollection = true;
}
let time = localStorage.getItem('notYet');
if(time == '') {
this.interestCollection = true;
} else {
let time = localStorage.getItem('notYet');
let day = (new Date() - new Date(time))/(1000*60*60*24);
if(day > 15){
this.interestCollection = true;
}
}
}
})
},

View File

@@ -0,0 +1,66 @@
<template>
<div class="medal-icon">
<img :src="baseUrl+item.medalIcon" alt="" srcset="">
<span class="medal-text medal-level">LV.{{item.medalLevel}}</span>
<span class="medal-text medal-name">{{item.medalName}}</span>
</div>
</template>
<script>
export default {
props:{
item:{
type:Object,
default:()=>{}
}
},
data(){
return {
baseUrl:process.env.VUE_APP_FILE_BASE_URL,
}
},
created() {
// this.userAvatar=require("@/assets/images/user/default.png");
},
mounted() {
},
methods:{
},
watch:{
},
computed:{
}
}
</script>
<style scoped lang="scss">
.medal-icon{
position: relative;
width: 143px;
height: 161px;
img{
width: 100%;
height: 100%;
}
.medal-text{
position: absolute;
font-size: 14px;
color: #e7d9cc;
font-weight: 600;
left:50%;
transform: translateX(-50%);
}
.medal-level{
top:22%;
font-style: italic;
}
.medal-name{
bottom: 10%;
}
}
</style>