增加登录勋章的代码

This commit is contained in:
daihh
2022-10-29 13:04:55 +08:00
parent 23e74db951
commit 5a86ee9651

View File

@@ -425,6 +425,12 @@
<portalFloatTools></portalFloatTools> <portalFloatTools></portalFloatTools>
<interest-Collection ref="userCollection"></interest-Collection> <!-- 兴趣偏好 --> <interest-Collection ref="userCollection"></interest-Collection> <!-- 兴趣偏好 -->
<guide-box ref="guide" @close="closeGuide"></guide-box> <!-- 引导页 --> <guide-box ref="guide" @close="closeGuide"></guide-box> <!-- 引导页 -->
<!--登录勋章-->
<el-dialog :close-on-click-modal="false" :visible.sync="showLoginMedal" :append-to-body="true" >
<div>
登录勋章显示根据UI显示修改
</div>
</el-dialog>
</div> </div>
</template> </template>
@@ -448,19 +454,11 @@
import articleImage from '@/components/Article/articleImage.vue'; import articleImage from '@/components/Article/articleImage.vue';
import InterestCollection from '@/components/Portal/interestCollection.vue' import InterestCollection from '@/components/Portal/interestCollection.vue'
import GuideBox from '@/components/Portal/guideBox.vue' import GuideBox from '@/components/Portal/guideBox.vue'
import { import { toScore,formatUserNumber,cutOrgNamePath} from '@/utils/tools.js';
toScore, import {swiper,swiperSlide} from 'vue-awesome-swiper';
cutFullName,
formatUserNumber,
cutOrgNamePath
} from '@/utils/tools.js';
import {
swiper,
swiperSlide,
} from 'vue-awesome-swiper';
import apiPlace from "@/api/phase2/place.js" import apiPlace from "@/api/phase2/place.js"
import authorImg from '@/components/Portal/authorImg.vue'; import authorImg from '@/components/Portal/authorImg.vue';
import apiStart from '@/api/phase2/stat.js' import apiStat from '@/api/phase2/stat.js'
import apiIndex from '@/api/phase2/index.js' import apiIndex from '@/api/phase2/index.js'
import apiUserhobby from "@/api/phase2/userhobby.js" import apiUserhobby from "@/api/phase2/userhobby.js"
export default { export default {
@@ -480,9 +478,25 @@
}, },
created() { created() {
this.$store.dispatch('refrashStudyTaskCount'); this.$store.dispatch('refrashStudyTaskCount');
//判断是否弹出登录勋章,设置截止日期
var nowDate = new Date();
var endDate = new Date('2022-11-18');//先设置时间是11月18日
if(nowDate<endDate){
let $this=this;
apiStat.getUserLoginMedal().then(rs=>{
if(rs.status==200){
if(rs.result.show){
//弹出勋章
$this.showLoginMedal=true;
}
}
})
}
}, },
data() { data() {
return { return {
showLoginMedal:false,//是否显示登录勋章
lastStudy:{}, lastStudy:{},
overlayShow:false, overlayShow:false,
userData: { uvalue:0, totalStudyHour:0 }, userData: { uvalue:0, totalStudyHour:0 },
@@ -667,7 +681,7 @@
return this.webBaseUrl+'/images/listblue0'+(index+1)+'.png'; return this.webBaseUrl+'/images/listblue0'+(index+1)+'.png';
}, },
getLevel() { //获取经验值和等级 getLevel() { //获取经验值和等级
apiStart.getUserStatTotalInfo(this.userInfo.aid).then(res => { apiStat.getUserStatTotalInfo(this.userInfo.aid).then(res => {
if (res.status == 200) { if (res.status == 200) {
this.userData = res.result; this.userData = res.result;
//console.log(this.userData,'this.userData') //console.log(this.userData,'this.userData')
@@ -855,7 +869,7 @@
list.forEach((item, index) => { list.forEach((item, index) => {
res.result.some(author => { res.result.some(author => {
if (author.aid == item.authorId) { if (author.aid == item.authorId) {
author.orgInfo = cutFullName(author.orgInfo, 1); author.orgInfo = cutOrgNamePath(author.orgInfo, 1);
item.authorInfo = author; item.authorInfo = author;
return true; return true;