SharePopup.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <div class="share-popup">
  3. <van-popup
  4. v-model="show"
  5. :close-on-click-overlay="false"
  6. >
  7. <div class="share-wrap">
  8. <div class="share-content bg-whiter pt-4 pb-4">
  9. <!-- 用户信息 -->
  10. <div class="userinfo-wrap pl-4 pr-4">
  11. <!-- <img class="avatar mr-1" src="~assets/image/activity/invite-user/invite-new-user/avatar.png" alt=""> -->
  12. <div class="avatar mr-1"></div>
  13. <div class="userinfo-text ml-1">
  14. <div class="userinfo-name">15312348305</div>
  15. <div class="userinfo-describe">邀请您使用双子星云手机</div>
  16. </div>
  17. </div>
  18. <!-- 分割线 -->
  19. <van-divider dashed />
  20. <!-- 分享文案 -->
  21. <div class="share-bright pl-4 pr-4">
  22. <div class="share-describe mb-4">现在抢购即可享受活动价格</div>
  23. <div class="bright-item">
  24. <div class="bright-context">
  25. <!-- <img class="bright-img mr-1" src="" alt=""> -->
  26. <div class="bright-img mr-1"></div>
  27. <div class="bright-main ml-1">
  28. <div class="bright-title">星曜云手机</div>
  29. <div class="title-text">邀请您使用双子星云手机</div>
  30. </div>
  31. </div>
  32. <div class="badge">
  33. <img src="~assets/image/activity/invite-user/invite-new-user/badge.png" alt="">
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. <!-- 不规则图背景 -->
  39. <div class="share-irregular bg-whiter"></div>
  40. <!-- 二维码区域 -->
  41. <div class="qrcode-wrap bg-whiter mb-6 pl-6 pr-6 pt-6 pb-6">
  42. <div class="qrcode-img mr-4">
  43. <!-- <img class="qrcode" src="~assets/image/activity/invite-user/invite-new-user/qrcode.png" alt=""> -->
  44. </div>
  45. <div class="qrcode-describe">
  46. <div class="qrcode-title">双子星云手机</div>
  47. <div class="qrcode-text">使用微信扫码购买双子星云手机</div>
  48. </div>
  49. </div>
  50. <div class="share-btn-wrap">
  51. <div class="operate-wrap">
  52. <div class="copy-link" @click="copyCode">复制链接</div>
  53. <div class="save-img" @click="saveImg">保存图片</div>
  54. </div>
  55. <div class="close-wrap mt-5">
  56. <span @click="onClose" class="cancel-btn">取消分享</span>
  57. </div>
  58. </div>
  59. </div>
  60. </van-popup>
  61. </div>
  62. </template>
  63. <script>
  64. export default {
  65. name: 'SharePopup',
  66. data() {
  67. return {
  68. show: false,
  69. };
  70. },
  71. methods: {
  72. showPopup() {
  73. this.show = true;
  74. },
  75. onClose() {
  76. this.show = false;
  77. },
  78. async copyCode(text="复制成功") {
  79. await this.$native.clipboard.writeText(text);
  80. this.$toast.success('复制成功');
  81. this.onClose();
  82. },
  83. async saveImg() {
  84. // this.$toast.success('保存成功');
  85. this.onClose();
  86. }
  87. },
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. .bg-whiter{
  92. background-color: #fff;
  93. }
  94. .share-popup ::v-deep .van-popup {
  95. background-color: transparent;
  96. width: 290px;
  97. }
  98. .share-content{
  99. border-top-left-radius: 8px;
  100. border-top-right-radius: 8px;
  101. }
  102. .userinfo-wrap{
  103. display: flex;
  104. .avatar{
  105. flex: 0 0 40px;
  106. width: 40px;
  107. height: 40px;
  108. border-radius: 50%;
  109. background-color: #fff;
  110. }
  111. .userinfo-text{
  112. .userinfo-name{
  113. font-size: 14px;
  114. color: #242424;
  115. }
  116. .userinfo-describe{
  117. color: #979797;
  118. }
  119. }
  120. }
  121. .share-describe{
  122. font-family: DingTalk, DingTalk;
  123. font-size: 18px;
  124. color: #0A132B;
  125. line-height: 21px;
  126. }
  127. .bright-item{
  128. display: flex;
  129. .bright-context{
  130. flex: 1;
  131. display: flex;
  132. .bright-img{
  133. flex: 0 0 40px;
  134. width: 40px;
  135. height: 40px;
  136. background-color: red;
  137. }
  138. .bright-main{
  139. .bright-title{
  140. font-weight: 500;
  141. font-size: 14px;
  142. color: #0A132B;
  143. }
  144. .title-text{
  145. font-weight: 400;
  146. font-size: 12px;
  147. color: #979797;
  148. }
  149. }
  150. }
  151. .badge{
  152. flex: 0 0 36px;
  153. width: 36px;
  154. height: 36px;
  155. img{
  156. width: 100%;
  157. height: 100%;
  158. }
  159. }
  160. }
  161. .qrcode-wrap{
  162. display: flex;
  163. border-bottom-left-radius: 8px;
  164. border-bottom-right-radius: 8px;
  165. .qrcode-img{
  166. flex: 0 0 56px;
  167. width: 56px;
  168. height: 56px;
  169. background-color: red;
  170. }
  171. .qrcode-describe{
  172. display: flex;
  173. flex-direction: column;
  174. justify-content: center;
  175. .qrcode-title{
  176. font-weight: 600;
  177. font-size: 16px;
  178. color: #3370FF;
  179. }
  180. .qrcode-text{
  181. font-weight: 400;
  182. font-size: 12px;
  183. color: #666;
  184. }
  185. }
  186. }
  187. .share-btn-wrap{
  188. .operate-wrap{
  189. display: flex;
  190. justify-content: space-around;
  191. align-items: center;
  192. .copy-link, .save-img{
  193. width: 113px;
  194. flex: 0 0 113px;
  195. font-weight: 400;
  196. font-size: 16px;
  197. line-height: 36px;
  198. text-align: center;
  199. border-radius: 18px;
  200. position: relative;
  201. }
  202. .copy-link{
  203. color: #0A132B;
  204. background-color: #fff;
  205. &::before{
  206. position: absolute;
  207. top: 50%;
  208. left: 50%;
  209. width: 100%;
  210. height: 100%;
  211. background-color: #000;
  212. border: inherit;
  213. border-color: #000;
  214. border-radius: inherit;
  215. -webkit-transform: translate(-50%, -50%);
  216. transform: translate(-50%, -50%);
  217. opacity: 0;
  218. content: ' ';
  219. }
  220. &:active::before{
  221. opacity: .1;
  222. }
  223. }
  224. .save-img{
  225. background-color: #3370FF;
  226. color: #fff;
  227. &::before{
  228. position: absolute;
  229. top: 50%;
  230. left: 50%;
  231. width: 100%;
  232. height: 100%;
  233. background-color: #000;
  234. border: inherit;
  235. border-color: #000;
  236. border-radius: inherit;
  237. -webkit-transform: translate(-50%, -50%);
  238. transform: translate(-50%, -50%);
  239. opacity: 0;
  240. content: ' ';
  241. }
  242. &:active::before{
  243. opacity: .1;
  244. }
  245. }
  246. }
  247. .close-wrap{
  248. display: flex;
  249. justify-content: center;
  250. align-items: center;
  251. .cancel-btn{
  252. display: inline-block;
  253. font-weight: 400;
  254. font-size: 14px;
  255. color: #FFF;
  256. line-height: 26px;
  257. }
  258. }
  259. }
  260. </style>