123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- <template>
- <div v-if="show" class="dialog-my">
- <div style=" height:100vh; width:100%;
- ">
- <!-- 弹窗 -->
- <!-- <ShaerPopup :show="shaerShow" @closeMyself="cancelPopup" /> -->
- <!-- 弹窗 -->
-
- <!-- <router-link :to="{path:'/'}"> -->
- <div
- class="backhome"
- :style="`background:url('${backimg}');background-size: 100% auto;`"
- @click="cancelPopupts"
- ></div>
- <!-- </router-link> -->
-
- <div>
- <div v-if="stater!==0">
- <!-- 领取屏保 -->
- <div class="outer3 flex-col">
- <div class="haibao">
- <img class="haibao" :src="currentMonth.calendarImg" alt />
- </div>
- <div class="mod2 flex-col">
- <!-- <div class="block1 flex-col">
- <div
- class="section1 flex-col"
- @click="()=>{this.shaerShow=true}"
- :style="`background-image: url(${shaerBut});`"
- ></div>
- <span :style="`background-image: url(${pressImage});`" class="info2"></span>
- </div>-->
- </div>
- </div>
- </div>
- <div v-else style="overflow: auto;height:100vh;">
- <!-- 挂历 -->
- <div class="page flex-col">
- <div class="group1 flex-col">
- <div class="wrap3 flex-col">
- <img :src="currentMonth.calendarImg" class="subhaibao" />
- </div>
- <!-- <div class="wrap5 flex-col">
- <span class="txt1" :style="`background-image: url(${pressLucky});`"></span>
- <div
- class="main5 flex-col"
- :style="`background-image: url(${shaerButRed});`"
- @click="()=>{this.shaerShow=true}"
- ></div>
- </div>-->
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
-
- <script>
- import { hideLoading } from '@/utils'
-
- export default {
- name: 'CalendarPoster',
- components: {
- ShaerPopup: () => import('@/components/ShaerPopup.vue')
- },
- props: {
- show: {
- type: Boolean,
- default: false,
- required: true
- },
- cancelText: {
- type: String,
- default: '取消',
- required: false
- },
- currentMonth: {
- type: Object
- },
- stater: {
- type: Number
- }
- },
-
- data() {
- return {
- shaerShow: false,
- backimg: require('../assets/buttonImg/backImg.png'),
- shaerBut: require('../assets/buttonImg/sayFriend.png'),
- pressImage: require('../assets/buttonImg/pressSave.png'),
- shaerButRed: require('../assets/buttonImg/sayFriend.png'),
- pressLucky: require('../assets/buttonImg/happyAccept.png')
- }
- },
-
- watch: {
- stater(val, res) {
- console.log('🚀 ~ file: CalendarPoster.vue ~ line 98 ~ stater ~ res', res)
- },
- created() {
- // this.showSelf = this.show
- },
- mounted() {
- hideLoading() //loading
-
- this.forbidScroll()
- if (this.show === true) {
- this.transform()
- }
- }
- },
- methods: {
- /** 取消按钮操作 */
- cancelPopupts() {
- // this.shaerShow = false
- // console.log(22222222222222222222222)
- this.$emit('cancelPopus', true)
- },
-
- cancelPopup() {
- this.shaerShow = false
- },
- // shareClick() {
- // this.$router.replace({
- // path: 'SaveShare',
- // query: { states: 0 }
- // })
- // },
- // saveClick() {
- // this.$router.replace({
- // path: 'SaveShare',
- // query: { states: 1 }
- // })
- // },
- transform() {
- setTimeout(() => {
- this.classDivAA = this.show
- }, 0)
- },
- /** 禁止页面滚动 */
- forbidScroll() {
- this.bodyOverflow = document.body.style.overflow
- document.body.style.overflow = 'hidden'
- },
-
- /** 每次获取之后 zindex 自动增加 */
- getZIndex() {
- let zIndexInit = 2022112
- return zIndexInit++
- },
-
- /** 确认按钮操作 */
- confirm() {
- this.$emit('confirm', true)
- },
-
- /** 点击遮罩关闭弹窗 */
- closeMyself(event) {
- // this.sloveBodyOverflow()
- this.$emit('closeMyself', true)
- },
-
- /** 恢复页面的滚动 */
- sloveBodyOverflow() {
- // this.showSelf = false
- document.body.style.overflow = this.bodyOverflow
- }
- }
- }
- </script>
-
- <style lang="less" scoped>
- // 弹窗动画
-
- // 最外层 设置position定位
- // 遮罩 设置背景层,z-index值要足够大确保能覆盖,高度 宽度设置满 做到全屏遮罩
-
- .flex-col {
- display: flex;
- flex-direction: column;
- }
- .dialog-my {
- position: fixed;
- top: 0;
- right: 0;
- width: 100%;
- height: 100%;
- transition: opacity 1s;
-
- // 内容层 z-index要比遮罩大,否则会被遮盖
- .backhome {
- width: 75px;
- height: 42px;
- position: fixed;
- left: 1rem;
- top: 1rem;
- z-index: 19;
- background-repeat: no-repeat;
- }
- .outer3 {
- width: 100vw;
- height: 100vh;
- justify-content: flex-end;
- .haibao {
- width: 100vw;
- position: absolute;
- left: 0;
- top: 0;
- }
- .mod2 {
- z-index: 35;
- height: 210px;
- background-image: linear-gradient(
- 180deg,
- transparent,
- rgba(0, 0, 0, 0.6)
- );
- width: 100vw;
- justify-content: flex-end;
- padding-bottom: 33px;
- align-items: center;
- .block1 {
- width: 180px;
- height: 113px;
- .section1 {
- height: 48px;
- border-radius: 8px;
- background-size: 100% auto;
- background-color: #fff;
- width: 180px;
- justify-content: center;
- align-items: center;
- border: 0;
- }
- .info2 {
- width: 152px;
- height: 54px;
- display: block;
- color: #fff;
- text-align: center;
- align-self: center;
- margin-top: 12px;
- background-size: 100% auto;
- background-repeat: no-repeat;
- }
- }
- }
- }
-
- // 第二个页面
- .page {
- // z-index: 1;
- // position: relative;
- // overflow-y: auto;
- // width: 100vw;
- // height: 100vh;
-
- .group1 {
- .wrap3 {
- z-index: 13;
- width: 100vw;
- overflow: hidden;
- align-self: center;
- margin-top: 1vw;
- margin-left: 0;
- .subhaibao {
- // position: absolute;
- width: 100%;
- left: 0;
- top: 0;
- }
- }
- .wrap5 {
- height: 137px;
- background-color: #efe9e0;
- width: 100vw;
- justify-content: center;
- align-items: center;
- display: flex;
- .txt1 {
- background-size: 100% auto;
- background-repeat: no-repeat;
- width: 112px;
- height: 18px;
- margin-bottom: 80px;
- }
- }
-
- .main5 {
- background-size: 100% auto;
- background-repeat: no-repeat;
- height: 48px;
- border-radius: 8px;
- margin-top: 11px;
- width: 343px;
- background-color: #c1172d;
- border: 0;
- position: fixed;
- z-index: 15;
- bottom: 5vh;
- }
- }
- }
- }
- </style>
|