MyWinning.vue 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <div v-if="show" class="dialog-my">
  3. <div style=" height:100vh; width:100%;
  4. ">
  5. <!-- 弹窗 -->
  6. <!-- <ShaerPopup :show="shaerShow" @closeMyself="cancelPopup" /> -->
  7. <!-- 弹窗 -->
  8. <!-- <router-link :to="{path:'/'}"> -->
  9. <div
  10. class="backhome"
  11. :style="`background:url('${backimg}');background-size: 100% auto;`"
  12. @click="cancelPopupts"
  13. ></div>
  14. <!-- </router-link> -->
  15. <div>
  16. <div v-if="stater!==0">
  17. <!-- 领取屏保 -->
  18. <div class="outer3 flex-col">
  19. <div class="haibao">
  20. <img class="haibao" :src="currentMonth.calendarImg" alt />
  21. </div>
  22. <div class="mod2 flex-col">
  23. <!-- <div class="block1 flex-col">
  24. <div
  25. class="section1 flex-col"
  26. @click="()=>{this.shaerShow=true}"
  27. :style="`background-image: url(${shaerBut});`"
  28. ></div>
  29. <span :style="`background-image: url(${pressImage});`" class="info2"></span>
  30. </div>-->
  31. </div>
  32. </div>
  33. </div>
  34. <div v-else style="overflow: auto;height:100vh;">
  35. <!-- 挂历 -->
  36. <div class="page flex-col">
  37. <div class="group1 flex-col">
  38. <div class="wrap3 flex-col">
  39. <img :src="currentMonth.calendarImg" class="subhaibao" />
  40. </div>
  41. <!-- <div class="wrap5 flex-col">
  42. <span class="txt1" :style="`background-image: url(${pressLucky});`"></span>
  43. <div
  44. class="main5 flex-col"
  45. :style="`background-image: url(${shaerButRed});`"
  46. @click="()=>{this.shaerShow=true}"
  47. ></div>
  48. </div>-->
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </template>
  56. <script>
  57. import { hideLoading } from '@/utils'
  58. export default {
  59. name: 'CalendarPoster',
  60. components: {
  61. ShaerPopup: () => import('@/components/ShaerPopup.vue')
  62. },
  63. props: {
  64. show: {
  65. type: Boolean,
  66. default: false,
  67. required: true
  68. },
  69. cancelText: {
  70. type: String,
  71. default: '取消',
  72. required: false
  73. },
  74. currentMonth: {
  75. type: Object
  76. },
  77. stater: {
  78. type: Number
  79. }
  80. },
  81. data() {
  82. return {
  83. shaerShow: false,
  84. backimg: require('../assets/buttonImg/backImg.png'),
  85. shaerBut: require('../assets/buttonImg/sayFriend.png'),
  86. pressImage: require('../assets/buttonImg/pressSave.png'),
  87. shaerButRed: require('../assets/buttonImg/sayFriend.png'),
  88. pressLucky: require('../assets/buttonImg/happyAccept.png')
  89. }
  90. },
  91. watch: {
  92. stater(val, res) {
  93. console.log('🚀 ~ file: CalendarPoster.vue ~ line 98 ~ stater ~ res', res)
  94. },
  95. created() {
  96. // this.showSelf = this.show
  97. },
  98. mounted() {
  99. hideLoading() //loading
  100. this.forbidScroll()
  101. if (this.show === true) {
  102. this.transform()
  103. }
  104. }
  105. },
  106. methods: {
  107. /** 取消按钮操作 */
  108. cancelPopupts() {
  109. // this.shaerShow = false
  110. // console.log(22222222222222222222222)
  111. this.$emit('cancelPopus', true)
  112. },
  113. cancelPopup() {
  114. this.shaerShow = false
  115. },
  116. // shareClick() {
  117. // this.$router.replace({
  118. // path: 'SaveShare',
  119. // query: { states: 0 }
  120. // })
  121. // },
  122. // saveClick() {
  123. // this.$router.replace({
  124. // path: 'SaveShare',
  125. // query: { states: 1 }
  126. // })
  127. // },
  128. transform() {
  129. setTimeout(() => {
  130. this.classDivAA = this.show
  131. }, 0)
  132. },
  133. /** 禁止页面滚动 */
  134. forbidScroll() {
  135. this.bodyOverflow = document.body.style.overflow
  136. document.body.style.overflow = 'hidden'
  137. },
  138. /** 每次获取之后 zindex 自动增加 */
  139. getZIndex() {
  140. let zIndexInit = 2022112
  141. return zIndexInit++
  142. },
  143. /** 确认按钮操作 */
  144. confirm() {
  145. this.$emit('confirm', true)
  146. },
  147. /** 点击遮罩关闭弹窗 */
  148. closeMyself(event) {
  149. // this.sloveBodyOverflow()
  150. this.$emit('closeMyself', true)
  151. },
  152. /** 恢复页面的滚动 */
  153. sloveBodyOverflow() {
  154. // this.showSelf = false
  155. document.body.style.overflow = this.bodyOverflow
  156. }
  157. }
  158. }
  159. </script>
  160. <style lang="less" scoped>
  161. // 弹窗动画
  162. // 最外层 设置position定位
  163. // 遮罩 设置背景层,z-index值要足够大确保能覆盖,高度 宽度设置满 做到全屏遮罩
  164. .flex-col {
  165. display: flex;
  166. flex-direction: column;
  167. }
  168. .dialog-my {
  169. position: fixed;
  170. top: 0;
  171. right: 0;
  172. width: 100%;
  173. height: 100%;
  174. transition: opacity 1s;
  175. // 内容层 z-index要比遮罩大,否则会被遮盖
  176. .backhome {
  177. width: 75px;
  178. height: 42px;
  179. position: fixed;
  180. left: 1rem;
  181. top: 1rem;
  182. z-index: 19;
  183. background-repeat: no-repeat;
  184. }
  185. .outer3 {
  186. width: 100vw;
  187. height: 100vh;
  188. justify-content: flex-end;
  189. .haibao {
  190. width: 100vw;
  191. position: absolute;
  192. left: 0;
  193. top: 0;
  194. }
  195. .mod2 {
  196. z-index: 35;
  197. height: 210px;
  198. background-image: linear-gradient(
  199. 180deg,
  200. transparent,
  201. rgba(0, 0, 0, 0.6)
  202. );
  203. width: 100vw;
  204. justify-content: flex-end;
  205. padding-bottom: 33px;
  206. align-items: center;
  207. .block1 {
  208. width: 180px;
  209. height: 113px;
  210. .section1 {
  211. height: 48px;
  212. border-radius: 8px;
  213. background-size: 100% auto;
  214. background-color: #fff;
  215. width: 180px;
  216. justify-content: center;
  217. align-items: center;
  218. border: 0;
  219. }
  220. .info2 {
  221. width: 152px;
  222. height: 54px;
  223. display: block;
  224. color: #fff;
  225. text-align: center;
  226. align-self: center;
  227. margin-top: 12px;
  228. background-size: 100% auto;
  229. background-repeat: no-repeat;
  230. }
  231. }
  232. }
  233. }
  234. // 第二个页面
  235. .page {
  236. // z-index: 1;
  237. // position: relative;
  238. // overflow-y: auto;
  239. // width: 100vw;
  240. // height: 100vh;
  241. .group1 {
  242. .wrap3 {
  243. z-index: 13;
  244. width: 100vw;
  245. overflow: hidden;
  246. align-self: center;
  247. margin-top: 1vw;
  248. margin-left: 0;
  249. .subhaibao {
  250. // position: absolute;
  251. width: 100%;
  252. left: 0;
  253. top: 0;
  254. }
  255. }
  256. .wrap5 {
  257. height: 137px;
  258. background-color: #efe9e0;
  259. width: 100vw;
  260. justify-content: center;
  261. align-items: center;
  262. display: flex;
  263. .txt1 {
  264. background-size: 100% auto;
  265. background-repeat: no-repeat;
  266. width: 112px;
  267. height: 18px;
  268. margin-bottom: 80px;
  269. }
  270. }
  271. .main5 {
  272. background-size: 100% auto;
  273. background-repeat: no-repeat;
  274. height: 48px;
  275. border-radius: 8px;
  276. margin-top: 11px;
  277. width: 343px;
  278. background-color: #c1172d;
  279. border: 0;
  280. position: fixed;
  281. z-index: 15;
  282. bottom: 5vh;
  283. }
  284. }
  285. }
  286. }
  287. </style>