upsell-qrcode.vue 2.6 KB

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