mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-08 18:36:43 +08:00
兴趣采集弹框
This commit is contained in:
BIN
public/images/homeWu/interest.png
Normal file
BIN
public/images/homeWu/interest.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -45,12 +45,16 @@ const update=function (data){
|
||||
const del=function (id){
|
||||
return ajax.get(baseURL,'/xboe/subgroup/m/userhobby/delete?id='+id);
|
||||
}
|
||||
const has=function(){
|
||||
return ajax.get(baseURL,'/xboe/subgroup/m/userhobby/has');
|
||||
}
|
||||
|
||||
export default {
|
||||
save,
|
||||
list,
|
||||
info,
|
||||
update,
|
||||
del
|
||||
del,
|
||||
has
|
||||
}
|
||||
|
||||
|
||||
@@ -184,3 +184,19 @@
|
||||
font-size: 12px;
|
||||
color: #6E7B84;
|
||||
}
|
||||
.u-message{
|
||||
font-size: 14px;
|
||||
color: rgba(0,0,0,0.65);
|
||||
|
||||
.text{
|
||||
font-size: 14px;
|
||||
color: #2C68FF;
|
||||
margin-right: 20px;
|
||||
margin-left: 100px;
|
||||
}
|
||||
}
|
||||
.el-message{
|
||||
border-color: #fff;
|
||||
background-color: #fff;
|
||||
box-shadow: 0px 8px 20px 0px rgba(0,35,114,0.1);
|
||||
}
|
||||
141
src/components/Portal/interestCollection.vue
Normal file
141
src/components/Portal/interestCollection.vue
Normal file
@@ -0,0 +1,141 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="interestCollection"
|
||||
width="967px">
|
||||
<div style="margin-top:65px">
|
||||
<div class="interest" v-for="(sys,index) in sysTypeListMap" :key="sys.id">
|
||||
<p class="portal-title-tow interest-title">{{sys.name}}</p>
|
||||
<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 slot="footer" class="dialog-footer">
|
||||
<div><el-button type="primary" class="btn-one" @click="saveInterest()">生成我的兴趣偏好</el-button></div>
|
||||
<div><el-button @click="interestCollection = false" class="btn-tow" type="text">暂不选择</el-button></div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters, mapActions } from 'vuex';
|
||||
import apiUserhobby from "@/api/phase2/userhobby.js"
|
||||
export default {
|
||||
props:{
|
||||
show:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
checkboxGroup:[],
|
||||
interestCollection:true,// 兴趣采集
|
||||
sysTypeListMap:[]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.userAvatar=require("@/assets/images/user/default.png");
|
||||
apiUserhobby.has().then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.interestCollection = true;
|
||||
}
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
this.getSysTypeTree().then(rs => {
|
||||
this.sysTypeListMap = rs;
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
...mapActions({
|
||||
getSysTypeTree: 'sysType/getSysTypeTree',
|
||||
}),
|
||||
saveInterest() {
|
||||
let data = []
|
||||
if(this.checkboxGroup.length < 3) {
|
||||
this.$message.error('至少选择三个兴趣偏好!')
|
||||
return
|
||||
}
|
||||
this.checkboxGroup.forEach(item=>{
|
||||
data.push({
|
||||
type:1,
|
||||
refId:item
|
||||
})
|
||||
})
|
||||
apiUserhobby.save(data).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.interestCollection = false;
|
||||
const h = this.$createElement;
|
||||
this.$message({
|
||||
duration:0,
|
||||
type: 'success',
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: `<span class="u-message">
|
||||
选择个人偏好成功,U币+5
|
||||
<span class="text"><router-link class="routerLink" to="/user/ucurrency">查看详情</router-link></span>
|
||||
</span>`
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
|
||||
},
|
||||
computed:{
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .el-dialog{
|
||||
background: #fff url('/images/homeWu/interest.png') no-repeat;
|
||||
border-radius: 8px;
|
||||
// height: 840px;
|
||||
}
|
||||
.el-checkbox.is-bordered.el-checkbox--medium{
|
||||
width: 146px;
|
||||
height: 44px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
margin-left: 0px;
|
||||
margin-right: 23px;
|
||||
}
|
||||
.el-checkbox.is-bordered.is-checked{
|
||||
border-color: #4677F4;
|
||||
}
|
||||
::v-deep .el-checkbox__input.is-checked+.el-checkbox__label{
|
||||
color: #4677F4;
|
||||
}
|
||||
.el-checkbox{
|
||||
font-size: 14px;
|
||||
color: #333333;
|
||||
}
|
||||
.interest{
|
||||
margin-left: 50px;
|
||||
.interest-title{
|
||||
margin-bottom: 18px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
::v-deep .el-checkbox__input{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.dialog-footer{
|
||||
text-align: center;
|
||||
.btn-one{
|
||||
width: 473px;
|
||||
height: 59px;
|
||||
background: linear-gradient(146deg, #4D7BF6 0%, #2F65EC 100%);
|
||||
border-radius: 30px;
|
||||
}
|
||||
.btn-tow{
|
||||
font-size: 14px;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
14
src/icons/svg/collection-success.svg
Normal file
14
src/icons/svg/collection-success.svg
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>切图</title>
|
||||
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="8.选择偏好成功" transform="translate(-651.000000, -579.000000)">
|
||||
<g id="编组-14" transform="translate(635.000000, 567.000000)">
|
||||
<g id="正确" transform="translate(16.000000, 12.000000)">
|
||||
<path d="M8,0.5 C12.1421356,0.5 15.5,3.85786438 15.5,8 C15.5,12.1421356 12.1421356,15.5 8,15.5 C3.85786438,15.5 0.5,12.1421356 0.5,8 C0.5,3.85786438 3.85786438,0.5 8,0.5 Z M11.1625209,5.31677962 C11.0763504,5.23070811 10.9384251,5.22783906 10.8488042,5.30817247 L10.8397095,5.31677962 L6.80892329,9.34293111 L5.03529046,7.5713887 C4.94911997,7.48531719 4.81119464,7.48244814 4.72157382,7.56278155 L4.71247911,7.5713887 L4.06685642,8.21626979 C3.98068592,8.3023413 3.97781357,8.4401082 4.05823937,8.52962607 L4.06685642,8.53871033 L5.96464832,10.4343701 C5.9714921,10.4454266 5.97937011,10.4560256 5.98828235,10.4660288 L5.99753932,10.4758283 L6.64316202,11.1207094 C6.71089215,11.1883617 6.81059633,11.2046117 6.89367876,11.1694979 C6.91818621,11.1599703 6.94137805,11.1460549 6.96204253,11.1277519 L6.97215855,11.1182347 L7.61778124,10.4733536 C7.62329692,10.4678442 7.62847132,10.4621231 7.63330443,10.4562164 L7.64029814,10.4472203 L11.8081436,6.28410125 C11.8943141,6.19802974 11.8971864,6.06026284 11.8167606,5.97074497 L11.8081436,5.96166071 L11.1625209,5.31677962 Z" id="形状" fill="#0BDBA8"></path>
|
||||
<rect id="矩形" fill-opacity="0" fill="#FFFFFF" x="0" y="0" width="16" height="16"></rect>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -99,8 +99,8 @@
|
||||
<area shape="rectangle" name="link2" coords="150,400,300,500" target="_blank" href="https://boehrsurvey.wjx.cn/vm/PmreuFN.aspx" />
|
||||
</map>
|
||||
</div>
|
||||
|
||||
</el-dialog>
|
||||
<interest-Collection></interest-Collection>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -108,9 +108,12 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import desk from '@/api/console.js';
|
||||
import Cookies from 'vue-cookies';
|
||||
import InterestCollection from '@/components/Portal/interestCollection.vue'
|
||||
export default {
|
||||
components:{InterestCollection},
|
||||
data() {
|
||||
return {
|
||||
interestShow:false,
|
||||
checked:true,
|
||||
signInShow: false,
|
||||
signLocalTimesKey:'xboe_sign_dlg_times',
|
||||
@@ -137,6 +140,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.interestShow = true;
|
||||
//控制弹出窗口的代码
|
||||
let now = new Date() //当前时间
|
||||
let end = new Date('2022/08/14 00:00:00') //对比时间
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
:visible.sync="dialogVisible"
|
||||
width="657px"
|
||||
top="200px"
|
||||
:before-close="handleClose">
|
||||
>
|
||||
<div class="medal-box">
|
||||
<div class="medal-top">
|
||||
<div>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<h4>兴趣爱好</h4>
|
||||
<div class="interest" v-for="(sys,index) in sysTypeListMap" :key="sys.id">
|
||||
<span>{{sys.name}}</span>
|
||||
<el-checkbox-group v-model="checkboxGroup" v-if="sys.children.length > 0" @change="handleClick($event)">
|
||||
<el-checkbox-group v-model="checkboxGroup" v-if="sys.children.length > 0">
|
||||
<el-checkbox-button size="medium" v-for="ch in sys.children" :label="ch.id" :key="ch.id">{{ch.name}}</el-checkbox-button>
|
||||
</el-checkbox-group>
|
||||
<!-- <ul class="interest-index">
|
||||
@@ -222,8 +222,6 @@
|
||||
// }
|
||||
// })
|
||||
},
|
||||
handleClick(e){
|
||||
},
|
||||
saveHobby(){
|
||||
let data = []
|
||||
if(this.checkboxGroup.length == 0) {
|
||||
|
||||
Reference in New Issue
Block a user