This commit is contained in:
daihh
2022-10-13 14:38:59 +08:00
10 changed files with 63 additions and 68 deletions

View File

@@ -2,10 +2,10 @@
<el-dialog
:close-on-click-modal="false"
:visible.sync="interestCollection"
:append-to-body="true"
:append-to-body="true"
min-width="770px"
max-width="950px"
>
<div style="margin-top:10px">
<div class="interest" v-for="(sys,index) in sysTypeListMap" :key="sys.id">
@@ -13,7 +13,7 @@
<el-checkbox-group v-model="checkboxGroup" v-if="sys.children.length > 0">
<el-checkbox size="medium" border v-for="ch in sys.children" :label="ch.id" :key="ch.id">{{ch.name}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<div><el-button type="primary" class="btn-one" @click="saveInterest()">生成我的兴趣偏好</el-button></div>
@@ -35,27 +35,32 @@
return {
checkboxGroup:[],
interestCollection:false,// 兴趣采集
sysTypeListMap:[]
sysTypeListMap:[],
btn_insterest_status:0,
dialog_session_show:0
}
},
created() {
// this.userAvatar=require("@/assets/images/user/default.png");
apiUserhobby.has().then(res=>{
if(res.status == 200) {
// this.userAvatar=require("@/assets/images/user/default.png");
apiUserhobby.has().then(res=>{
if(res.status != 200) {return;}
// 1. 判断用户是否选择过兴趣偏好
if(res.data == false){
this.interestCollection = true;
}
// 2. 判断用户是否点击过"暂不选择"按钮,如果用户点击过"暂不选择"按钮则判断点击"暂不选择"按钮天数是否大于15天如果大于则弹出兴趣偏好框否则不弹
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;
}
if(day > 15){this.interestCollection = true;}
}
}
})
},
// 3. 判断用户是否点击"关闭"按钮,如果点击"关闭"按钮则在当前session不在弹窗
let dialog_session_show = localStorage.getItem('dialog_session_show');
if(dialog_session_show == 1){this.interestCollection = false;}
})
},
mounted() {
this.getSysTypeTree().then(rs => {
this.sysTypeListMap = rs;
@@ -98,10 +103,10 @@
}
},
watch:{
},
computed:{
},
}
@@ -112,7 +117,7 @@
margin-left: 0 !important;
}
::v-deep .el-dialog{
background: #fff url('/images/homeWu/interest.png') no-repeat;
background: #fff url('/images/homeWu/interest.png') no-repeat;
border-radius: 8px;
// height: 840px;
}
@@ -124,7 +129,7 @@
margin-bottom: 20px;
margin-left: 0px;
margin-right: 23px;
}
}
.el-checkbox.is-bordered.is-checked{
border-color: #4677F4;
}

View File

@@ -155,7 +155,8 @@ export default {
default: 0,
}
},
components:{InterestCollection,GuideBox},
// components:{InterestCollection,GuideBox}, // 注释兴趣爱好弹窗显示
computed: {
...mapGetters(['userInfo', 'userMsg','identity']),