123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <template>
- <div class="commenting" @click.stop>
- <p class="qtitle">请选择虚拟解说形象</p>
- <div class="qline">
- <img :src="require(`@/assets/images/icon/star.png`)" alt="" />
- </div>
- <div class="comment">
- <ul>
- <li :class="{active:item.id==active.id}" v-for="(item, i) in commentalist" :key="i" >
- <img @click="handleItem(item)" :src="require(`@/assets/images/project/commentator/${item.id}${item.id == active.id?'_active':''}.png`)" alt="" />
- </li>
- </ul>
- </div>
- <div class="comment_btn">
- <span>当前虚拟解说形象:{{active.name}}</span>
- </div>
-
- <img
- @click="$emit('close')"
- class="close"
- :src="require('@/assets/images/project/close1.png')"
- alt=""
- />
- </div>
- </template>
- <script>
- let list = [
- {
- id:'female_2',
- name:'军绿英姿'
- },
- {
- id:'female_1',
- name:'迷彩飒爽'
- },
- {
- id:'male',
- name:'圣洁白衣'
- },
- {
- id:'none',
- name:'无'
- },
- ]
- export default {
- data() {
- return {
- active: list[2],
- commentalist:list
- };
- },
-
- methods: {
- handleItem(item){
- localStorage.setItem('xunirole',item.id)
- this.active=item
- this.$bus.$emit('xunirole',item)
- }
- },
- mounted() {
- let id = localStorage.getItem('xunirole')
- let active = list.find(item=>item.id==id)
- this.active = active || list[2]
- },
- };
- </script>
- <style lang="less" scoped>
- .commenting {
- margin: 0 auto;
- position: fixed;
- height: 530px;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- z-index: 99;
- background: rgba(3, 51, 48, 0.5);
- color: #fff;
- padding: 34px 0;
- border-top: 8px solid #ccaf8f;
- border-bottom: 8px solid #ccaf8f;
- .qtitle {
- margin-top: 6px;
- text-align: center;
- font-size: 28px;
- font-weight: bold;
- line-height: 38px;
- color: #ffe0a6;
- }
- .qline {
- width: 100%;
- height: 1px;
- margin: 26px 0 0;
- position: relative;
- background: linear-gradient(
- 90deg,
- rgba(255, 255, 255, 0) 0%,
- #ffffff 48%,
- rgba(255, 255, 255, 0) 100%
- );
- > img {
- position: absolute;
- left: 50%;
- transform: translateX(-50%);
- width: 32px;
- top: -12px;
- }
- }
- .comment {
- width: 100%;
- overflow-y: auto;
- margin: 0 auto;
- padding: 33px 38px;
- background-color: rgba(255, 255, 255, 0.7);
- >ul{
- display: flex;
- justify-content: space-between;
- align-items: center;
- >li{
- width: 200px;
- cursor: pointer;
- margin: 0 12px;
- >img{
- width: 100%;
- }
- &.active{
- background: #fff;
- box-shadow: 0px 0px 30px rgba(138,106,72,1);
- border: 1px solid rgba(0, 0, 0, 0.2);
- }
- }
- }
- }
- .comment_btn {
- > span {
- display: inline-block;
- color: #fcf5d3;
- font-size: 18px;
- cursor: pointer;
- width: 100%;
- margin: 20px auto 0;
- }
- }
- .close {
- position: absolute;
- top: 40px;
- right: 50px;
- width: 24px;
- height: 24px;
- cursor: pointer;
- z-index: 9999999;
- }
- }
- </style>
|