|
7 | 7 | placeholder="https://"
|
8 | 8 | />
|
9 | 9 |
|
10 |
| - <editor-input-field-pickable |
11 |
| - v-model="videoSearchWord" |
12 |
| - :title="$t('components.editing_screen.labels.video_keyword')" |
13 |
| - :placeholders="$t('components.editing_screen.placeholder.video_keyword')" |
14 |
| - /> |
15 |
| - |
16 |
| - <button class="Button" @click="handleVideoSearchWord"> |
17 |
| - {{ $t('components.editing_screen.search_videos.search') }} |
18 |
| - </button> |
19 |
| - |
20 |
| - <div v-if="videoSearchResult.length > 0" class="SearchResult"> |
21 |
| - <h3> |
22 |
| - {{ |
23 |
| - $t('components.editing_screen.search_videos.search_result', { |
24 |
| - source: 'NHK For School', |
25 |
| - }) |
26 |
| - }} |
27 |
| - </h3> |
28 |
| - <ul> |
29 |
| - <li v-for="(v, i) in displayLists" :key="i" class="SearchResultItem"> |
30 |
| - <component |
31 |
| - :is="v.videoUrl ? 'a' : 'span'" |
32 |
| - :href="v.videoUrl" |
33 |
| - :target="v.videoUrl ? '_blank' : null" |
34 |
| - class="SearchResultLink" |
35 |
| - > |
36 |
| - {{ v.videoTitle }} {{ v.videoSubTitle }} |
37 |
| - </component> |
38 |
| - <p class="SearchResultDescription">{{ v.videoDescription }}</p> |
39 |
| - <span>{{ v.videoPlayTime }}</span> |
40 |
| - <br v-if="v.videoThumbnailUrl" /> |
41 |
| - <img |
42 |
| - v-if="v.videoThumbnailUrl" |
43 |
| - :src="v.videoThumbnailUrl" |
44 |
| - :alt="v.videoTitle" |
45 |
| - width="240" |
46 |
| - /> |
47 |
| - <br v-if="v.videoUrl" /> |
48 |
| - <button |
49 |
| - v-if="v.videoUrl" |
50 |
| - class="Button" |
51 |
| - @click="registerVideoUrl(v.videoUrl)" |
52 |
| - > |
53 |
| - {{ |
54 |
| - $t('components.editing_screen.search_videos.add_to_video_urls') |
55 |
| - }} |
56 |
| - </button> |
57 |
| - </li> |
58 |
| - </ul> |
59 |
| - <v-pagination |
60 |
| - v-model="page" |
61 |
| - :length="length" |
62 |
| - :total-visible="5" |
63 |
| - @input="pageChange" |
| 10 | + <div class="VideoSearch"> |
| 11 | + <editor-input-field-pickable |
| 12 | + v-model="videoSearchWord" |
| 13 | + :title="$t('components.editing_screen.labels.video_keyword')" |
| 14 | + :placeholder="$t('components.editing_screen.placeholder.video_keyword')" |
| 15 | + icon-name="mdi-magnify" |
| 16 | + :button-text="$t('components.editing_screen.search_videos.search')" |
| 17 | + @clickButton="handleVideoSearchWord" |
64 | 18 | />
|
| 19 | + |
| 20 | + <div v-if="videoSearchResult.length > 0" class="SearchResult"> |
| 21 | + <h3 class="SearchResultTitle"> |
| 22 | + {{ |
| 23 | + $t('components.editing_screen.search_videos.search_result', { |
| 24 | + source: 'NHK For School', |
| 25 | + }) |
| 26 | + }} |
| 27 | + </h3> |
| 28 | + <ul class="SearchResultList"> |
| 29 | + <li v-for="(v, i) in displayLists" :key="i" class="SearchResultItem"> |
| 30 | + <div class="SearchResultLinkOuter"> |
| 31 | + <component |
| 32 | + :is="v.videoUrl ? 'a' : 'span'" |
| 33 | + :href="v.videoUrl" |
| 34 | + :target="v.videoUrl ? '_blank' : null" |
| 35 | + > |
| 36 | + {{ v.videoTitle }} {{ v.videoSubTitle }} |
| 37 | + </component> |
| 38 | + <div> |
| 39 | + <span class="SearchResultPlayTime">{{ v.videoPlayTime }}</span> |
| 40 | + </div> |
| 41 | + </div> |
| 42 | + <p>{{ v.videoDescription }}</p> |
| 43 | + <div class="SearchResultImgOuter"> |
| 44 | + <img |
| 45 | + v-if="v.videoThumbnailUrl" |
| 46 | + :src="v.videoThumbnailUrl" |
| 47 | + :alt="v.videoTitle" |
| 48 | + width="240" |
| 49 | + /> |
| 50 | + <v-btn |
| 51 | + v-if="v.videoUrl" |
| 52 | + class="SearchResultButton" |
| 53 | + color="#338dce" |
| 54 | + @click="registerVideoUrl(v.videoUrl)" |
| 55 | + > |
| 56 | + <v-icon color="white"> mdi-link </v-icon> |
| 57 | + {{ |
| 58 | + $t( |
| 59 | + 'components.editing_screen.search_videos.add_to_video_urls' |
| 60 | + ) |
| 61 | + }} |
| 62 | + </v-btn> |
| 63 | + </div> |
| 64 | + </li> |
| 65 | + </ul> |
| 66 | + <v-pagination |
| 67 | + v-model="page" |
| 68 | + :length="length" |
| 69 | + :total-visible="5" |
| 70 | + color="#0071c2" |
| 71 | + @input="pageChange" |
| 72 | + /> |
| 73 | + </div> |
65 | 74 | </div>
|
66 | 75 | </div>
|
67 | 76 | </template>
|
@@ -126,6 +135,15 @@ export default class EditLessonScreenInner3 extends Vue {
|
126 | 135 | this.input(this.tempFormData)
|
127 | 136 | }
|
128 | 137 |
|
| 138 | + @Watch('value', { deep: true }) |
| 139 | + onChangeValueFormData() { |
| 140 | + if (this.value.videoUrl === '') { |
| 141 | + this.videoSearchWord = '' |
| 142 | + this.videoSearchResult = [] |
| 143 | + } |
| 144 | + this.tempFormData = this.value |
| 145 | + } |
| 146 | +
|
129 | 147 | private handleVideoSearchWord() {
|
130 | 148 | if (this.videoSearchWord) {
|
131 | 149 | this.page = 1
|
@@ -213,21 +231,50 @@ export default class EditLessonScreenInner3 extends Vue {
|
213 | 231 | </script>
|
214 | 232 |
|
215 | 233 | <style lang="scss" scoped>
|
216 |
| -.Button { |
217 |
| - color: $color-white; |
218 |
| - margin-bottom: 20px; |
| 234 | +.VideoSearch { |
| 235 | + background-color: $color-base-color-02; |
| 236 | + border-radius: 8px; |
| 237 | + padding: 16px; |
| 238 | + margin-bottom: 16px; |
219 | 239 | }
|
220 | 240 | .SearchResult {
|
| 241 | + border-top: 1px solid $color-base-color-03; |
| 242 | +} |
| 243 | +.SearchResultTitle { |
221 | 244 | color: $color-white;
|
222 |
| - margin-bottom: 20px; |
| 245 | + text-align: center; |
| 246 | + margin: 16px 0; |
| 247 | +} |
| 248 | +.SearchResultList { |
| 249 | + padding: 0; |
| 250 | + list-style: none; |
223 | 251 | }
|
224 | 252 | .SearchResultItem {
|
| 253 | + background-color: $color-white; |
| 254 | + padding: 18px; |
225 | 255 | margin-bottom: 12px;
|
226 | 256 | }
|
227 |
| -.SearchResultLink { |
228 |
| - color: $color-white; |
| 257 | +.SearchResultLinkOuter { |
| 258 | + display: flex; |
| 259 | + justify-content: space-between; |
| 260 | + margin-bottom: 12px; |
229 | 261 | }
|
230 |
| -.SearchResultDescription { |
231 |
| - margin: 0; |
| 262 | +.SearchResultPlayTime { |
| 263 | + display: inline-block; |
| 264 | + font-size: 12px; |
| 265 | + border: 2px solid $color-gray; |
| 266 | + border-radius: 3em; |
| 267 | + padding: 2px 10px; |
| 268 | +} |
| 269 | +.SearchResultImgOuter { |
| 270 | + position: relative; |
| 271 | + margin-bottom: 16px; |
| 272 | +} |
| 273 | +.SearchResultButton { |
| 274 | + position: absolute; |
| 275 | + right: -6px; |
| 276 | + bottom: -12px; |
| 277 | + color: $color-white; |
| 278 | + border-radius: 8px; |
232 | 279 | }
|
233 | 280 | </style>
|
0 commit comments