Commit d7866bf6b327018b67bcd6c01726c08c25a733a7
1 parent
622ad908
remove pixabay library from video gallery
Showing
2 changed files
with
0 additions
and
86 deletions
front-end/h5/src/components/core/support/video-gallery/gallery.js
| 1 | import './gallery.scss' | 1 | import './gallery.scss' |
| 2 | import PersonalTab from './tabs/personal.js' | 2 | import PersonalTab from './tabs/personal.js' |
| 3 | -import PixabayTab from './tabs/pixabay.js' | ||
| 4 | 3 | ||
| 5 | export default { | 4 | export default { |
| 6 | name: 'lbs-video-gallery', | 5 | name: 'lbs-video-gallery', |
| @@ -22,10 +21,6 @@ export default { | @@ -22,10 +21,6 @@ export default { | ||
| 22 | value: 'personal', | 21 | value: 'personal', |
| 23 | label: '我的视频' | 22 | label: '我的视频' |
| 24 | } | 23 | } |
| 25 | - // { | ||
| 26 | - // value: 'pixabay', | ||
| 27 | - // label: 'Pixabay图库' | ||
| 28 | - // } | ||
| 29 | ], | 24 | ], |
| 30 | activeTab: 'personal', | 25 | activeTab: 'personal', |
| 31 | innerVisible: false, | 26 | innerVisible: false, |
| @@ -58,10 +53,6 @@ export default { | @@ -58,10 +53,6 @@ export default { | ||
| 58 | return <PersonalTab onChangeItem={item => { | 53 | return <PersonalTab onChangeItem={item => { |
| 59 | this.handleSelectImage(item) | 54 | this.handleSelectImage(item) |
| 60 | }}/> | 55 | }}/> |
| 61 | - case 'pixabay': | ||
| 62 | - return <PixabayTab onChangeItem={item => { | ||
| 63 | - this.handleSelectImage(item) | ||
| 64 | - }}/> | ||
| 65 | } | 56 | } |
| 66 | }, | 57 | }, |
| 67 | renderDefaultActivator () { | 58 | renderDefaultActivator () { |
front-end/h5/src/components/core/support/video-gallery/tabs/pixabay.js deleted
100644 → 0
| 1 | -import axios from 'axios' | ||
| 2 | -import ImageItem from '../components/image-item.js' | ||
| 3 | - | ||
| 4 | -export default { | ||
| 5 | - data: () => ({ | ||
| 6 | - items: [], | ||
| 7 | - loading: false, | ||
| 8 | - options: { | ||
| 9 | - key: '12120348-2ad26e4cc05d9bc068097ab3b', // pixabay demo key from https://pixabay.com/zh/service/about/api/ | ||
| 10 | - image_type: 'photo', | ||
| 11 | - pretty: true, | ||
| 12 | - q: 'yellow+flowers', | ||
| 13 | - orientation: 'all' // "all", "horizontal", "vertical" | ||
| 14 | - } | ||
| 15 | - }), | ||
| 16 | - computed: { | ||
| 17 | - isVertial () { | ||
| 18 | - return this.options.orientation === 'vertical' | ||
| 19 | - } | ||
| 20 | - }, | ||
| 21 | - methods: { | ||
| 22 | - queryAPI () { | ||
| 23 | - axios | ||
| 24 | - .get('https://pixabay.com/api/', { params: this.options }) | ||
| 25 | - .then(res => { | ||
| 26 | - this.items = res.data.hits | ||
| 27 | - }) | ||
| 28 | - } | ||
| 29 | - }, | ||
| 30 | - render (h) { | ||
| 31 | - return ( | ||
| 32 | - <div> | ||
| 33 | - <a-spin tip="Loading..." spinning={this.loading}> | ||
| 34 | - <a-card > | ||
| 35 | - <div slot="extra" style={{ display: 'flex' }}> | ||
| 36 | - <a-dropdown> | ||
| 37 | - <a-menu slot="overlay" onClick={({ key }) => { | ||
| 38 | - this.options.orientation = key | ||
| 39 | - this.queryAPI() | ||
| 40 | - }}> | ||
| 41 | - <a-menu-item key="all"><a-icon type="user" />任意方位</a-menu-item> | ||
| 42 | - <a-menu-item key="horizontal"><a-icon type="user" />水平</a-menu-item> | ||
| 43 | - <a-menu-item key="vertical"><a-icon type="user" />竖直</a-menu-item> | ||
| 44 | - </a-menu> | ||
| 45 | - <a-button style="margin-left: 8px" type="link"> | ||
| 46 | - 图片方向 <a-icon type="down" /> | ||
| 47 | - </a-button> | ||
| 48 | - </a-dropdown> | ||
| 49 | - <a-input-search | ||
| 50 | - placeholder="input search text" | ||
| 51 | - onSearch={value => { | ||
| 52 | - this.options.q = value | ||
| 53 | - this.queryAPI() | ||
| 54 | - }} | ||
| 55 | - /> | ||
| 56 | - </div> | ||
| 57 | - <a-list | ||
| 58 | - grid={{ gutter: 12, column: this.isVertial ? 4 : 3 }} | ||
| 59 | - dataSource={this.items} | ||
| 60 | - renderItem={(item, index) => ( | ||
| 61 | - <a-list-item onClick={(event /** mouseEvent */) => { | ||
| 62 | - this.$emit('changeItem', item) | ||
| 63 | - }}> | ||
| 64 | - <ImageItem item={item} height={this.isVertial ? 240 : 142 } /> | ||
| 65 | - </a-list-item> | ||
| 66 | - )} | ||
| 67 | - > | ||
| 68 | - </a-list> | ||
| 69 | - </a-card> | ||
| 70 | - </a-spin> | ||
| 71 | - </div> | ||
| 72 | - ) | ||
| 73 | - }, | ||
| 74 | - mounted () { | ||
| 75 | - this.queryAPI() | ||
| 76 | - } | ||
| 77 | -} |