This commit is contained in:
daihh
2022-10-21 15:01:50 +08:00
9 changed files with 94 additions and 63 deletions

View File

@@ -20,8 +20,8 @@ const save=function (data){
* 同兴趣人匹配查询
* 参数:下面那个接口的返回值直接传
* */
const list=function (data){
return ajax.postJson(baseURL,'/xboe/subgroup/m/userhobby/list',data);
const list=function (aid){
return ajax.get(baseURL,'/xboe/subgroup/m/userhobby/list?aid='+aid);
}
/**

View File

@@ -48,6 +48,9 @@ p{
font-size: 20px;
margin-top: 70px;
color: #ccc;
img{
text-align: center;
}
}

View File

@@ -407,7 +407,6 @@
item.orgInfo=author.orgInfo;
item.sex=author.sex;
item.sign=author.sign
console.log(list,'评论信息')
return true;
}else{
return false;

View File

@@ -148,6 +148,29 @@ export function formatDate(date){
return newTime;
}
/**
* 把日期格式化为显示时间yyyy-MM-dd
* @param {Object} date
*/
export function formatDateShort(date){
var year = date.getFullYear(),
month = date.getMonth() + 1,//月份是从0开始的
day = date.getDate(),
hour = date.getHours(),
min = date.getMinutes(),
sec = date.getSeconds();
if(month<10){month='0'+month}
if(day<10){day='0'+day}
if(hour<10){hour='0'+hour}
if(min<10){min='0'+min}
if(sec<10){sec='0'+sec}
var newTime = year + '-' + month + '-' + day;
return newTime;
}
export function numberToLetter(x){ //此方法和移到utils中去
let s = "";
while (x > 0) {

View File

@@ -531,41 +531,38 @@
//检查兴趣爱好是否已填报,
//先检查本地session和 local 15天, 这两个值是在组件中设置的
// let sessionHobby=sessionStorage.getItem('user-hobby-'+this.userInfo.aid);
// let localHobbyTime=localStorage.getItem('notYet'+this.userInfo.aid);
// if(!sessionHobby){ //只有session中不存在才会验证
// //本地15天验证,localHobby,后续完善
// let flag=true;//请求检查
// if(localHobbyTime) {
// let day = (new Date() - new Date(localHobbyTime))/(1000*60*60*24);
// if(day< 15){
// flag = false;
// }
// }
// if(flag){
// apiUserhobby.has().then(res=>{
// if(res.status == 200) {
// if(!res.result){
// //设置需要显示兴趣爱好收集窗口
// this.userHobby.needShow=true;
// }
// }else{
// console.log('兴趣爱好检查失败'+res.message);
// }
// //检查引导页
// this.checkAndShowGuide();
// });
// }else{
// this.checkAndShowGuide();
// }
// }else{
// //不用检查引导页
// //this.checkAndShowGuide();
// }
//测试环境中
this.userHobby.needShow=true;
this.checkAndShowGuide();
let sessionHobby=sessionStorage.getItem('user-hobby-'+this.userInfo.aid);
let localHobbyTime=localStorage.getItem('notYet'+this.userInfo.aid);
console.log("sessionHobby:"+sessionHobby);
if(!sessionHobby){ //只有session中不存在才会验证
//本地15天验证,localHobby,后续完善
let flag=true;//请求检查
if(localHobbyTime) {
let day = (new Date() - new Date(localHobbyTime))/(1000*60*60*24);
if(day< 15){
flag = false;
}
}
if(flag){
apiUserhobby.has().then(res=>{
if(res.status == 200) {
if(!res.result){
//设置需要显示兴趣爱好收集窗口
this.userHobby.needShow=true;
}
}else{
console.log('兴趣爱好检查失败'+res.message);
}
//检查引导页
this.checkAndShowGuide();
});
}else{
this.checkAndShowGuide();
}
}else{
//检查引导页
this.checkAndShowGuide();
}
},
computed: {
@@ -579,28 +576,29 @@
checkAndShowGuide(){
//引导页弹框是否显示
//检查本地,减少服务器请求的次数
// let localGuide=localStorage.getItem('user-guide-'+this.userInfo.aid);
// if(!localGuide){
// apiGuide.hasUser().then(res=>{
// if(res.status==200){
// if(!res.result){
// this.$refs.guide.show();
// }else{
// if(this.userHobby.needShow){ this.$refs.userCollection.show();}
// }
// localStorage.setItem('user-guide-'+this.userInfo.aid,1);
// }else{
// console.log('获取引导页检查失败'+res.message);
// //this.$message.error('')
// if(this.userHobby.needShow){this.$refs.userCollection.show();}
// }
// });
// }else {
// if(this.userHobby.needShow){ this.$refs.userCollection.show();}
// }
let localGuide=localStorage.getItem('user-guide-'+this.userInfo.aid);
console.log("=== "+localGuide);
if(!localGuide){
apiGuide.hasUser().then(res=>{
if(res.status==200){
if(!res.result){
this.$refs.guide.show();
}else{
if(this.userHobby.needShow){ this.$refs.userCollection.show();}
}
localStorage.setItem('user-guide-'+this.userInfo.aid,1);
}else{
console.log('获取引导页检查失败'+res.message);
//this.$message.error('')
if(this.userHobby.needShow){this.$refs.userCollection.show();}
}
});
}else {
if(this.userHobby.needShow){ this.$refs.userCollection.show();}
}
//测试情况下
this.$refs.guide.show();
// this.$refs.guide.show();
},
closeGuide(){ //关闭引导页
if(this.userHobby.needShow){

View File

@@ -109,7 +109,7 @@
userhobbyInfo() {
let $this=this;
$this.interestedList=[];
apiUserhobby.list({aid:this.pageId}).then(res=>{
apiUserhobby.list(this.pageId).then(res=>{
if(res.status == 200) {
let ids = res.result.map(item=>item.aid);
const noReapetIds = [...new Set(ids)];

View File

@@ -48,9 +48,13 @@
<div v-else>
<div v-if="dataList.list.length == 0">
<div v-if="isSearh" class="zan-wu">没有查询到相关内容</div>
<div v-else class="zan-wu">暂无数据</div>
<div v-else class="zan-wu">
<img :src="`${webBaseUrl}/images/nocouresimg.png`" alt="">
<div>暂无数据</div>
</div>
</div>
</div>
<!-- </el-tab-pane> -->

View File

@@ -42,7 +42,10 @@
<div v-else>
<div v-if="dataList.list.length == 0">
<div v-if="isSearh" class="zan-wu">没有查询到相关内容</div>
<div v-else class="zan-wu">暂无数据</div>
<div v-else class="zan-wu">
<img :src="`${webBaseUrl}/images/nocouresimg.png`" alt="">
<div>暂无数据</div>
</div>
</div>
</div>
<!-- </el-tab-pane> -->

View File

@@ -138,7 +138,7 @@
</div>
<div class="export-dialog-right">
<p>累计导出{{exportPreData.length}}</p>
<p style="margin-top:10px">导出时间{{formatDate(new Date())}}</p>
<p style="margin-top:10px">导出时间{{formatDateShort(new Date())}}</p>
</div>
</div>
@@ -176,7 +176,7 @@ import interactBar from '@/components/Portal/interactBar.vue';
import FileUpload from '@/components/NoteUpload/index.vue';
import AuthorImg from '@/components/Portal/authorImg.vue';
import { mapGetters } from 'vuex';
import {formatDate} from '@/utils/tools.js';
import {formatDate,formatDateShort} from '@/utils/tools.js';
import apiUser from "@/api/system/user.js";
import htmlToPdf from '@/utils/htmlToPdf'
export default {
@@ -188,6 +188,7 @@ export default {
return{
userData:{},
formatDate,
formatDateShort,
noteFile:{
contentType:null,
type:2,