SaveShare.vue 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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/buttonImg/saveHaibao.png" 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/buttonImg/saveMonth.png" 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. import { hideLoading } from '@/utils'
  51. export default {
  52. name: 'SaveShare',
  53. components: {
  54. ShaerPopup: () => import('@/components/ShaerPopup.vue')
  55. },
  56. props: {
  57. show: {
  58. type: Boolean,
  59. default: false,
  60. required: true
  61. },
  62. type: String,
  63. cancelText: {
  64. default: '取消',
  65. required: false
  66. }
  67. },
  68. data() {
  69. return {
  70. item: null,
  71. shaerShow: false,
  72. backimg: require('../assets/buttonImg/backImg.png'),
  73. shaerBut: require('../assets/buttonImg/sayFriend.png'),
  74. pressImage: require('../assets/buttonImg/pressSave.png'),
  75. shaerButRed: require('../assets/buttonImg/sayFriend.png'),
  76. pressLucky: require('../assets/buttonImg/happyAccept.png')
  77. }
  78. },
  79. mounted() {
  80. hideLoading()
  81. },
  82. watch: {
  83. '$route.query.states': {
  84. handler(val) {
  85. console.log('🚀 ~ file: SaveShare.vue ~ line 24 ~ val', val)
  86. if (val) {
  87. this.item = val
  88. } else {
  89. this.$router.go(-1)
  90. }
  91. },
  92. immediate: true // 页面加载时就启动
  93. }
  94. },
  95. methods: {
  96. cancelFrom() {
  97. this.shaerShow = false
  98. }
  99. }
  100. }
  101. </script>
  102. <style lang="less" scoper>
  103. .flex-col {
  104. display: flex;
  105. flex-direction: column;
  106. }
  107. .backhome {
  108. width: 85px;
  109. height: 42px;
  110. position: fixed;
  111. left: 1rem;
  112. top: 1rem;
  113. z-index: 19;
  114. background-repeat: no-repeat !important;
  115. }
  116. .outer3 {
  117. width: 100vw;
  118. height: 100vh;
  119. justify-content: flex-end;
  120. .haibao {
  121. width: 100vw;
  122. position: absolute;
  123. left: 0;
  124. top: 0;
  125. }
  126. .mod2 {
  127. z-index: 35;
  128. height: 210px;
  129. background-image: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.6));
  130. width: 100vw;
  131. justify-content: flex-end;
  132. padding-bottom: 33px;
  133. align-items: center;
  134. .block1 {
  135. width: 180px;
  136. height: 113px;
  137. .section1 {
  138. height: 48px;
  139. border-radius: 8px;
  140. background-size: 100% auto;
  141. background-color: #fff;
  142. width: 180px;
  143. justify-content: center;
  144. align-items: center;
  145. border: 0;
  146. }
  147. .info2 {
  148. width: 152px;
  149. height: 54px;
  150. display: block;
  151. color: #fff;
  152. text-align: center;
  153. align-self: center;
  154. margin-top: 12px;
  155. background-size: 100% auto;
  156. background-repeat: no-repeat;
  157. }
  158. }
  159. }
  160. }
  161. // 第二个页面
  162. .page {
  163. // z-index: 1;
  164. // position: relative;
  165. // overflow-y: auto;
  166. // width: 100vw;
  167. // height: 100vh;
  168. .group1 {
  169. .wrap3 {
  170. z-index: 13;
  171. width: 98vw;
  172. overflow: hidden;
  173. align-self: center;
  174. margin-left: 0;
  175. .subhaibao {
  176. // position: absolute;
  177. width: 100%;
  178. left: 0;
  179. top: 0;
  180. }
  181. }
  182. .wrap5 {
  183. height: 137px;
  184. background-color: #efe9e0;
  185. // margin-top: 19px;
  186. width: 100vw;
  187. justify-content: center;
  188. align-items: center;
  189. display: flex;
  190. .txt1 {
  191. background-size: 100% auto;
  192. background-repeat: no-repeat;
  193. width: 112px;
  194. height: 18px;
  195. margin-bottom: 80px;
  196. }
  197. }
  198. .main5 {
  199. background-size: 100% auto;
  200. background-repeat: no-repeat;
  201. height: 48px;
  202. border-radius: 8px;
  203. margin-top: 11px;
  204. width: 343px;
  205. background-color: #b12b32;
  206. border: 0;
  207. position: fixed;
  208. z-index: 15;
  209. bottom: 5vh;
  210. }
  211. }
  212. }
  213. </style>