| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <template>
- <div class="pdf-controller">
- <!-- <icon :class="pageMarked ? 'active' : ''" @click="handleMarkButtonClicked"-->
- <!-- :unicode="pageMarked ? iconMap['mark'] : iconMap['mark_border']" title="收藏本页"/>-->
- <!-- <icon></icon>-->
- <a :href="src"><icon-button title="上一页">cloud_download</icon-button></a>
- <div class="spacer"></div>
- <icon-button @click="handlePrevious" title="上一页">navigate_before</icon-button>
- <icon-button @click="handleScreenShot" title="将本页截图">save_alt</icon-button>
- <icon-button @click="handleNext" title="下一页">navigate_next</icon-button>
- <div class="spacer"></div>
- <icon-button :theme="showDiscussion ? 'blue' : null" @click="handleDiscussionShowState" title="讨论区">char_bubble</icon-button>
- </div>
- </template>
- <script>
- import IconButton from '@/components/Basic/IconButton'
- import { NEXT_PAGE, PREVIOUS_PAGE, SET_SCREEN_SHOT, TOGGLE_SHOW_DISCUSSION } from '@/store/types/pdf-types'
- import { mapState } from 'vuex'
- export default {
- components: { IconButton },
- data () {
- return {
- pageMarked: false
- }
- },
- computed: {
- ...mapState({
- showDiscussion: state => state.pdf.showDiscussion,
- src: state => state.pdf.src
- })
- },
- methods: {
- handleMarkButtonClicked () {
- this.pageMarked = !this.pageMarked
- // todo
- },
- handleDiscussionShowState () {
- this.$store.commit(TOGGLE_SHOW_DISCUSSION)
- },
- handlePrevious () {
- this.$store.commit(PREVIOUS_PAGE)
- },
- handleNext () {
- this.$store.commit(NEXT_PAGE)
- },
- handleScreenShot () {
- this.$store.commit(SET_SCREEN_SHOT)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @import '~@/style/theme.scss';
- .pdf-controller {
- padding: 0 8px;
- max-width: 600px;
- margin: 8px auto;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: space-between;
- width: 100%;
- }
- .spacer {
- max-width: 24px;
- flex: 1;
- }
- @media (max-width: 480px) {
- .spacer {
- max-width: 12px;
- }
- }
- </style>
|