upsell-share.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <custom-popup
  3. v-model="showPopup"
  4. mode="center"
  5. border-radius="24"
  6. width="540rpx"
  7. :bg-color="'transparent'"
  8. >
  9. <view class="share-container">
  10. <!-- 标题 -->
  11. <view class="title-text">
  12. <view>好友邀您助力</view>
  13. <view>提升卖书收入</view>
  14. </view>
  15. <!-- 活动规则按钮 -->
  16. <view class="rules-button-container">
  17. <u-button
  18. class="rules-button"
  19. :custom-style="rulesButtonStyle"
  20. @click="viewRules"
  21. >查看活动规则</u-button
  22. >
  23. </view>
  24. <!-- 用户信息区域 -->
  25. <view class="user-info">
  26. <view class="avatar-container">
  27. <u-avatar :src="avatarUrl" size="140"></u-avatar>
  28. </view>
  29. <view class="username">{{ username }}</view>
  30. </view>
  31. <!-- 助力按钮 -->
  32. <button class="help-button" @click="handleHelp">点击助力</button>
  33. <!-- 关闭按钮 -->
  34. <view class="close-button" @click="close">
  35. <image src="/static/img/activity/close2.png" mode="widthFix"></image>
  36. </view>
  37. </view>
  38. </custom-popup>
  39. </template>
  40. <script>
  41. import customPopup from "../../../components/custom-popup.vue";
  42. export default {
  43. components: {
  44. customPopup,
  45. },
  46. data() {
  47. return {
  48. showPopup: false,
  49. avatarUrl: "", // 用户头像URL
  50. username: "孙***", // 用户名,带星号
  51. // 自定义按钮样式
  52. rulesButtonStyle: {
  53. backgroundColor: "#39c248",
  54. color: "#FFFFFF",
  55. fontSize: "28rpx",
  56. width: "280rpx",
  57. height: "80rpx",
  58. borderRadius: "40rpx",
  59. },
  60. };
  61. },
  62. methods: {
  63. open(avatarUrl = "", username = "孙***") {
  64. this.avatarUrl = avatarUrl;
  65. this.username = username;
  66. this.showPopup = true;
  67. },
  68. close() {
  69. this.showPopup = false;
  70. },
  71. viewRules() {
  72. // 打开活动规则弹窗
  73. this.$emit("view-rules");
  74. this.close();
  75. },
  76. handleHelp() {
  77. // 处理助力逻辑
  78. this.$emit("help");
  79. this.close();
  80. },
  81. },
  82. };
  83. </script>
  84. <style lang="scss" scoped>
  85. .share-container {
  86. position: relative;
  87. padding: 40rpx;
  88. border-radius: 24rpx;
  89. text-align: center;
  90. background: url("https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/bg.png")
  91. no-repeat center center;
  92. background-size: 100% 100%;
  93. }
  94. .title-text view {
  95. font-size: 50rpx;
  96. font-weight: bold;
  97. color: #000;
  98. }
  99. .rules-button-container {
  100. display: flex;
  101. justify-content: center;
  102. margin: 20rpx 0 40rpx;
  103. .rules-button {
  104. position: relative;
  105. &::before,
  106. &::after {
  107. content: "";
  108. position: absolute;
  109. top: 50%;
  110. width: 80rpx;
  111. height: 2rpx;
  112. background-color: #39c248;
  113. }
  114. &::before {
  115. left: -90rpx;
  116. }
  117. &::after {
  118. right: -90rpx;
  119. }
  120. }
  121. }
  122. .user-info {
  123. .avatar-container {
  124. margin: 0 auto 20rpx;
  125. width: 140rpx;
  126. height: 140rpx;
  127. border-radius: 50%;
  128. overflow: hidden;
  129. }
  130. .username {
  131. font-size: 28rpx;
  132. color: #333;
  133. background: #39c248;
  134. padding: 6rpx 20rpx;
  135. border-radius: 30rpx;
  136. color: #fff;
  137. display: inline-block;
  138. position: relative;
  139. top: -50rpx;
  140. }
  141. }
  142. .help-button {
  143. height: 90rpx;
  144. background: linear-gradient(to bottom, #47d46c, #24ad3c);
  145. font-size: 32rpx;
  146. color: #ffffff;
  147. border-radius: 10rpx;
  148. line-height: 90rpx;
  149. width: 100%;
  150. margin-top: 20rpx;
  151. border: none;
  152. }
  153. .close-button {
  154. position: absolute;
  155. bottom: -120rpx;
  156. left: 50%;
  157. transform: translateX(-50%);
  158. image {
  159. width: 70rpx;
  160. height: 70rpx;
  161. }
  162. }
  163. </style>