MyWinning.vue 7.0KB

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