reduce-qrcode.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <custom-popup v-model="showPopup" mode="center" border-radius="24" width="650rpx" :bg-color="'transparent'">
  3. <view class="popup-container">
  4. <!-- 顶部标题 -->
  5. <view class="header">
  6. <view class="title-text">
  7. 让好友打开
  8. <!-- #ifdef MP-WEIXIN -->
  9. <text class="green">微信</text>
  10. <!-- #endif -->
  11. <!-- #ifdef MP-ALIPAY -->
  12. <text class="green">支付宝</text>
  13. <!-- #endif -->
  14. 扫一扫
  15. </view>
  16. <view class="subtitle-text">加油!你就要成功了</view>
  17. </view>
  18. <!-- 二维码区域 -->
  19. <view class="qrcode-section">
  20. <image class="qrcode-img" :src="qrcode" mode="aspectFit"></image>
  21. </view>
  22. <!-- 关闭按钮 -->
  23. <view class="close-button" @click="closePopup">
  24. <image src="/static/img/activity/close2.png" mode="widthFix"></image>
  25. </view>
  26. </view>
  27. </custom-popup>
  28. </template>
  29. <script>
  30. import customPopup from '@/components/custom-popup.vue';
  31. export default {
  32. components: {
  33. customPopup,
  34. },
  35. data() {
  36. return {
  37. showPopup: false,
  38. qrcode: '',
  39. // 可扩展为自定义图标
  40. wechatIcon: false,
  41. scanIcon: false,
  42. successIcon: false,
  43. };
  44. },
  45. methods: {
  46. open(data) {
  47. this.showPopup = true;
  48. this.getQrcode(data.reduceCode);
  49. },
  50. //获取二维码
  51. getQrcode(reduceCode) {
  52. this.$u.api.getReduceQrcodeAjax({ reduceCode: reduceCode }).then(res => {
  53. if (res.code == 200) {
  54. this.qrcode = res.data;
  55. }
  56. })
  57. },
  58. closePopup() {
  59. this.showPopup = false;
  60. },
  61. },
  62. };
  63. </script>
  64. <style lang="scss" scoped>
  65. .popup-container {
  66. position: relative;
  67. padding: 30rpx 30rpx 80rpx 30rpx;
  68. box-sizing: border-box;
  69. background: url("https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/upsellbg.png") no-repeat center center;
  70. background-size: 100% 100%;
  71. height: 1020rpx;
  72. }
  73. .header {
  74. display: flex;
  75. flex-direction: column;
  76. align-items: center;
  77. padding-top: 20rpx;
  78. .title-text {
  79. font-size: 38rpx;
  80. font-weight: bold;
  81. color: #222;
  82. margin-bottom: 10rpx;
  83. .green {
  84. color: #39c248;
  85. }
  86. }
  87. .subtitle-text {
  88. font-size: 28rpx;
  89. color: #666;
  90. margin-bottom: 30rpx;
  91. }
  92. }
  93. .qrcode-section {
  94. display: flex;
  95. justify-content: center;
  96. align-items: center;
  97. height: 400rpx;
  98. width: 400rpx;
  99. background: #38c249;
  100. margin: 30rpx auto;
  101. border-radius: 24rpx;
  102. .qrcode-img {
  103. width: 300rpx;
  104. height: 300rpx;
  105. border-radius: 24rpx;
  106. background: #fff;
  107. border: 8rpx solid #fff;
  108. }
  109. }
  110. .close-button {
  111. position: absolute;
  112. bottom: -100rpx;
  113. left: 50%;
  114. transform: translateX(-50%);
  115. image {
  116. width: 70rpx;
  117. height: 70rpx;
  118. }
  119. }
  120. </style>