hookehuyr

🦄 refactor: 视频显示tag判断条件优化

1 <template> 1 <template>
2 <div class="video-wrapper" style="position: relative;"> 2 <div class="video-wrapper" style="position: relative;">
3 <div v-if="mp && detail.showStatus" class="status"> 3 <div v-if="mp && detail.showStatus" class="status">
4 - <van-image v-if="item.status === 'ENABLE'" round width="6rem" height="6rem" style="vertical-align: bottom;" 4 + <van-image round width="6rem" height="6rem" style="vertical-align: bottom;" :src="status_icon" />
5 - :src="icon_enable" />
6 - <van-image v-if="item.status === 'DISABLE'" round width="6rem" height="6rem" style="vertical-align: bottom;"
7 - :src="icon_refuse" />
8 - <van-image v-if="item.status === 'APPLY'" round width="6rem" height="6rem" style="vertical-align: bottom;"
9 - :src="icon_apply" />
10 </div> 5 </div>
11 <div :id="'mui-player-' + item.id" class="video-div" /> 6 <div :id="'mui-player-' + item.id" class="video-div" />
12 <div v-if="mp"> 7 <div v-if="mp">
...@@ -15,8 +10,7 @@ ...@@ -15,8 +10,7 @@
15 <van-row> 10 <van-row>
16 <van-col span="12" @click="goTo"> 11 <van-col span="12" @click="goTo">
17 <van-image round width="2rem" height="2rem" style="vertical-align: middle;" 12 <van-image round width="2rem" height="2rem" style="vertical-align: middle;"
18 - :src="item.avatar ? item.avatar : icon_avatar" />&nbsp; 13 + :src="item.avatar ? item.avatar : icon_avatar" />&nbsp;&nbsp;
19 - &nbsp;
20 <span style="font-size: 1.05rem;vertical-align: middle;">{{ item.name }}</span> 14 <span style="font-size: 1.05rem;vertical-align: middle;">{{ item.name }}</span>
21 </van-col> 15 </van-col>
22 <van-col span="12"> 16 <van-col span="12">
...@@ -42,8 +36,7 @@ ...@@ -42,8 +36,7 @@
42 </div> 36 </div>
43 <div v-else class="audit-module" style="margin-top: 1rem;"> 37 <div v-else class="audit-module" style="margin-top: 1rem;">
44 <div style="color: #222222; padding: 0px 1rem 0.5rem;">{{ item.book_name }} | {{ item.localism_type }}</div> 38 <div style="color: #222222; padding: 0px 1rem 0.5rem;">{{ item.book_name }} | {{ item.localism_type }}</div>
45 - <div v-if="item.status === 'DISABLE'" class="van-hairline--top" 39 + <div v-if="item.status === 'DISABLE'" class="van-hairline--top" style="padding: 1rem; font-size: 0.85rem;">
46 - style="padding: 1rem; font-size: 0.85rem;">
47 <p style="color: #999999; margin-bottom: 0.25rem;">老师留言:</p> 40 <p style="color: #999999; margin-bottom: 0.25rem;">老师留言:</p>
48 <p>{{ item.check_note }}</p> 41 <p>{{ item.check_note }}</p>
49 </div> 42 </div>
...@@ -82,6 +75,19 @@ export default { ...@@ -82,6 +75,19 @@ export default {
82 mp: '' 75 mp: ''
83 } 76 }
84 }, 77 },
78 + computed: {
79 + // eslint-disable-next-line vue/return-in-computed-property
80 + status_icon () {
81 + switch (this.item.status) {
82 + case 'ENABLE':
83 + return icon_enable
84 + case 'DISABLE':
85 + return icon_refuse
86 + case 'APPLY':
87 + return icon_apply
88 + }
89 + }
90 + },
85 created() { 91 created() {
86 }, 92 },
87 mounted() { 93 mounted() {
......