reduce-qrcode.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. name: 'ReduceQrcode',
  33. components: {
  34. customPopup,
  35. },
  36. data() {
  37. return {
  38. showPopup: false,
  39. qrcode: '',
  40. // 可扩展为自定义图标
  41. wechatIcon: false,
  42. scanIcon: false,
  43. successIcon: false,
  44. };
  45. },
  46. methods: {
  47. open(data) {
  48. this.showPopup = true;
  49. this.getQrcode(data.reduceCode);
  50. },
  51. //获取二维码
  52. getQrcode(reduceCode) {
  53. this.$u.api.getReduceQrcodeAjax({ reduceCode: reduceCode }).then(res => {
  54. if (res.code == 200) {
  55. this.qrcode = res.data;
  56. }
  57. })
  58. },
  59. closePopup() {
  60. this.showPopup = false;
  61. },
  62. },
  63. };
  64. </script>
  65. <style lang="scss" scoped>
  66. .popup-container {
  67. position: relative;
  68. padding: 30rpx 30rpx 80rpx 30rpx;
  69. box-sizing: border-box;
  70. background: url("https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/upsellbg.png") no-repeat center center;
  71. background-size: 100% 100%;
  72. height: 1020rpx;
  73. }
  74. .header {
  75. display: flex;
  76. flex-direction: column;
  77. align-items: center;
  78. padding-top: 20rpx;
  79. .title-text {
  80. font-size: 38rpx;
  81. font-weight: bold;
  82. color: #222;
  83. margin-bottom: 10rpx;
  84. .green {
  85. color: #39c248;
  86. }
  87. }
  88. .subtitle-text {
  89. font-size: 28rpx;
  90. color: #666;
  91. margin-bottom: 30rpx;
  92. }
  93. }
  94. .qrcode-section {
  95. display: flex;
  96. justify-content: center;
  97. align-items: center;
  98. height: 400rpx;
  99. width: 400rpx;
  100. background: #38c249;
  101. margin: 30rpx auto;
  102. border-radius: 24rpx;
  103. .qrcode-img {
  104. width: 300rpx;
  105. height: 300rpx;
  106. border-radius: 24rpx;
  107. background: #fff;
  108. border: 8rpx solid #fff;
  109. }
  110. }
  111. .close-button {
  112. position: absolute;
  113. bottom: -100rpx;
  114. left: 50%;
  115. transform: translateX(-50%);
  116. image {
  117. width: 70rpx;
  118. height: 70rpx;
  119. }
  120. }
  121. </style>