SaveShare.vue 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <div style=" height:100vh; width:100%;">
  3. <!-- 弹窗 -->
  4. <ShaerPopup :show="shaerShow" @closeMyself="cancelFrom" />
  5. <!-- 弹窗 -->
  6. <router-link :to="{path:'/'}">
  7. <div class="backhome" :style="`background:url('${backimg}');background-size: 100% auto;`"></div>
  8. </router-link>
  9. <div>
  10. <div v-if="item==0">
  11. <!-- 领取屏保 -->
  12. <div class="outer3 flex-col">
  13. <div class="haibao">
  14. <img class="haibao" src="~@/assets/saverShaerImg/haibao.jpg" alt />
  15. </div>
  16. <div class="mod2 flex-col">
  17. <div class="block1 flex-col">
  18. <div
  19. class="section1 flex-col"
  20. @click="()=>{this.shaerShow=true}"
  21. :style="`background-image: url(${shaerBut});`"
  22. ></div>
  23. <span :style="`background-image: url(${pressImage});`" class="info2"></span>
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. <div v-else>
  29. <!-- 挂历 -->
  30. <div class="page flex-col">
  31. <div class="group1 flex-col">
  32. <div class="wrap3 flex-col">
  33. <img src="../assets/saverShaerImg/calendar.jpg" class="subhaibao" />
  34. </div>
  35. <div class="wrap5 flex-col">
  36. <span class="txt1" :style="`background-image: url(${pressLucky});`"></span>
  37. <div
  38. class="main5 flex-col"
  39. :style="`background-image: url(${shaerButRed});`"
  40. @click="()=>{this.shaerShow=true}"
  41. ></div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. export default {
  51. name: 'SaveShare',
  52. components: {
  53. ShaerPopup: () => import('@/components/ShaerPopup.vue')
  54. },
  55. props: {
  56. show: {
  57. type: Boolean,
  58. default: false,
  59. required: true
  60. },
  61. cancelText: {
  62. type: String,
  63. default: '取消',
  64. required: false
  65. }
  66. },
  67. data() {
  68. return {
  69. item: null,
  70. shaerShow: false,
  71. backimg: require('../assets/saverShaerImg/back.png'),
  72. shaerBut: require('../assets/saverShaerImg/shaerLucky.png'),
  73. pressImage: require('../assets/saverShaerImg/PressImage.png'),
  74. shaerButRed: require('../assets/saverShaerImg/shaerLuckyRed.png'),
  75. pressLucky: require('../assets/saverShaerImg/PressLucky.png')
  76. }
  77. },
  78. watch: {
  79. '$route.query.states': {
  80. handler(val) {
  81. console.log('🚀 ~ file: SaveShare.vue ~ line 24 ~ val', val)
  82. if (val) {
  83. this.item = val
  84. } else {
  85. this.$router.go(-1)
  86. }
  87. },
  88. immediate: true // 页面加载时就启动
  89. }
  90. },
  91. methods: {
  92. cancelFrom() {
  93. this.shaerShow = false
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="less" scoper>
  99. .flex-col {
  100. display: flex;
  101. flex-direction: column;
  102. }
  103. .backhome {
  104. width: 75px;
  105. height: 42px;
  106. position: fixed;
  107. left: 1rem;
  108. top: 1rem;
  109. z-index: 19;
  110. background-repeat: no-repeat;
  111. }
  112. .outer3 {
  113. width: 100vw;
  114. height: 100vh;
  115. justify-content: flex-end;
  116. .haibao {
  117. width: 100vw;
  118. position: absolute;
  119. left: 0;
  120. top: 0;
  121. }
  122. .mod2 {
  123. z-index: 35;
  124. height: 210px;
  125. background-image: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.6));
  126. width: 100vw;
  127. justify-content: flex-end;
  128. padding-bottom: 33px;
  129. align-items: center;
  130. .block1 {
  131. width: 180px;
  132. height: 113px;
  133. .section1 {
  134. height: 48px;
  135. border-radius: 8px;
  136. background-size: 100% auto;
  137. background-color: #fff;
  138. width: 180px;
  139. justify-content: center;
  140. align-items: center;
  141. border: 0;
  142. }
  143. .info2 {
  144. width: 152px;
  145. height: 54px;
  146. display: block;
  147. color: #fff;
  148. text-align: center;
  149. align-self: center;
  150. margin-top: 12px;
  151. background-size: 100% auto;
  152. background-repeat: no-repeat;
  153. }
  154. }
  155. }
  156. }
  157. // 第二个页面
  158. .page {
  159. // z-index: 1;
  160. // position: relative;
  161. // overflow-y: auto;
  162. // width: 100vw;
  163. // height: 100vh;
  164. .group1 {
  165. .wrap3 {
  166. z-index: 13;
  167. width: 98vw;
  168. overflow: hidden;
  169. align-self: center;
  170. margin-top: 1vw;
  171. margin-left: 0;
  172. .subhaibao {
  173. // position: absolute;
  174. width: 100%;
  175. left: 0;
  176. top: 0;
  177. }
  178. }
  179. .wrap5 {
  180. height: 137px;
  181. background-color: #efe9e0;
  182. margin-top: 19px;
  183. width: 100vw;
  184. justify-content: center;
  185. align-items: center;
  186. display: flex;
  187. .txt1 {
  188. background-size: 100% auto;
  189. background-repeat: no-repeat;
  190. width: 112px;
  191. height: 18px;
  192. margin-bottom: 80px;
  193. }
  194. }
  195. .main5 {
  196. background-size: 100% auto;
  197. background-repeat: no-repeat;
  198. height: 48px;
  199. border-radius: 8px;
  200. margin-top: 11px;
  201. width: 343px;
  202. background-color: #c1172d;
  203. border: 0;
  204. position: fixed;
  205. z-index: 15;
  206. bottom: 5vh;
  207. }
  208. }
  209. }
  210. </style>