Commit 5ddcc077 authored by 华国豪's avatar 华国豪 🙄

投票

parent e576bd2a
......@@ -2,35 +2,14 @@
<div class="Voting">
<div class="Voting-box">
<div class="tit">
<p>占位占位投票(单选)</p>
<p>{{NowVoteData.Title}}</p>
</div>
<div class="list">
<div class="item" :class="{'active': radio === '1'}">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="1">这里是A选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio>
</div>
<div class="item" :class="{'active': radio === '2'}">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="2">这里是B选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio>
</div>
<div class="item" :class="{'active': radio === '3'}">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="3">这里是C选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio>
</div>
<div class="item" :class="{'active': radio === '4'}">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="4">这里是D选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio>
</div>
<div class="item" :class="{'active': radio === '1'}">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="1">这里是A选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio>
</div>
<div class="item" :class="{'active': radio === '2'}">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="2">这里是B选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio>
</div>
<div class="item" :class="{'active': radio === '3'}">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="3">这里是C选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio>
</div>
<div class="item" :class="{'active': radio === '4'}">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="4">这里是D选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio>
<div class="item" :class="{'active': radio === item.ID}" v-for="(item, index) in NowVoteData.VoteOptionsList">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" :label="item.ID">{{item.OptionsName}}</el-radio>
</div>
</div>
<div class="btn">
<div class="btn" @click="TP()">
<div>确认提交</div>
</div>
</div>
......@@ -40,15 +19,38 @@
<script>
export default {
name: 'Voting',
props: {
NowVoteData: {
type: Object,
default: {}
}
},
data () {
return {
radio: 1
radio: 1,
}
},
activated () {},
created () {},
mounted () {},
methods: {}
mounted () {
},
methods: {
TP: function () {
let data = this.NowVoteData
data.VoteOptionsList.map(x=>{
if (x.ID === this.radio) {
x.IsCheck = 1
} else {
x.IsCheck = 0
}
})
this.apipost('user_post_SetEmployeeVote', data, r=>{
if (r.data.resultCode === 1) {
this.MsgBus.$emit('closeVotingBox');
}
}, null)
}
}
}
</script>
......@@ -62,6 +64,8 @@ export default {
background: rgba(0, 0, 0, 0.19);
position: absolute;
z-index: 2019129;
left: 0;
top: 0;
}
.Voting div.Voting-box{
width:800px;
......@@ -114,5 +118,10 @@ export default {
color: white;
background:rgba(233,82,82,1);
border-radius:5px;
cursor: pointer;
}
.Voting .el-radio{
width: 100%;
height: 100%;
}
</style>
......@@ -1126,7 +1126,7 @@
</div>
</div>
<!-- 投票 -->
<Voting v-show="false"></Voting>
<Voting v-show="VotingShow" :NowVoteData="NowVoteData"></Voting>
</div>
</template>
......@@ -1380,6 +1380,8 @@ export default {
}
]
},
VotingShow: false,
NowVoteData: {}
};
},
filters: {
......@@ -1606,6 +1608,16 @@ export default {
},
mounted() {
let that = this;
this.apipost('user_post_GetNowVote', {}, r=>{
if (r.data.resultCode === 1){
this.NowVoteData = r.data.data
this.VotingShow = true
}
}, null)
this.MsgBus.$on('closeVotingBox', function () {
that.VotingShow = false
that.NowVoteData = {}
});
this.MsgBus.$on('doudong',function(){
that.dou()
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment