upsell-share.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <u-popup v-model="showPopup" mode="center" border-radius="24" width="540rpx">
  3. <view class="share-container">
  4. <!-- 标题 -->
  5. <view class="title-text">
  6. <view>好友邀您助力</view>
  7. <view>提升卖书收入</view>
  8. </view>
  9. <!-- 活动规则按钮 -->
  10. <view class="rules-button-container">
  11. <u-button class="rules-button" :custom-style="rulesButtonStyle" @click="viewRules">查看活动规则</u-button>
  12. </view>
  13. <!-- 用户信息区域 -->
  14. <view class="user-info">
  15. <view class="avatar-container">
  16. <u-avatar :src="avatarUrl" size="140"></u-avatar>
  17. </view>
  18. <view class="username">{{username}}</view>
  19. </view>
  20. <!-- 助力按钮 -->
  21. <u-button class="help-button" type="primary" :custom-style="helpButtonStyle" @click="handleHelp">点击助力</u-button>
  22. </view>
  23. </u-popup>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. showPopup: false,
  30. avatarUrl: '', // 用户头像URL
  31. username: '孙***', // 用户名,带星号
  32. // 自定义按钮样式
  33. rulesButtonStyle: {
  34. backgroundColor: '#4CD964',
  35. color: '#FFFFFF',
  36. fontSize: '28rpx',
  37. width: '280rpx',
  38. height: '80rpx',
  39. borderRadius: '40rpx'
  40. },
  41. helpButtonStyle: {
  42. backgroundColor: '#4CD964',
  43. color: '#FFFFFF',
  44. fontSize: '32rpx',
  45. width: '100%',
  46. height: '100rpx',
  47. borderRadius: '50rpx',
  48. border: 'none'
  49. }
  50. };
  51. },
  52. methods: {
  53. open(avatarUrl = '', username = '孙***') {
  54. this.avatarUrl = avatarUrl;
  55. this.username = username;
  56. this.showPopup = true;
  57. },
  58. close() {
  59. this.showPopup = false;
  60. },
  61. viewRules() {
  62. // 打开活动规则弹窗
  63. this.$emit('view-rules');
  64. this.close();
  65. },
  66. handleHelp() {
  67. // 处理助力逻辑
  68. this.$emit('help');
  69. this.close();
  70. }
  71. }
  72. };
  73. </script>
  74. <style lang="scss" scoped>
  75. .share-container {
  76. background: linear-gradient(180deg, #e9ffe9 0%, #f7fff7 100%);
  77. padding: 40rpx 30rpx;
  78. border-radius: 24rpx;
  79. text-align: center;
  80. }
  81. .title-text {
  82. font-size: 40rpx;
  83. font-weight: bold;
  84. color: #000;
  85. line-height: 60rpx;
  86. margin-bottom: 20rpx;
  87. }
  88. .rules-button-container {
  89. display: flex;
  90. justify-content: center;
  91. margin: 20rpx 0 40rpx;
  92. .rules-button {
  93. position: relative;
  94. &::before, &::after {
  95. content: '';
  96. position: absolute;
  97. top: 50%;
  98. width: 80rpx;
  99. height: 2rpx;
  100. background-color: #4CD964;
  101. }
  102. &::before {
  103. left: -90rpx;
  104. }
  105. &::after {
  106. right: -90rpx;
  107. }
  108. }
  109. }
  110. .user-info {
  111. margin-bottom: 40rpx;
  112. .avatar-container {
  113. margin: 0 auto 20rpx;
  114. width: 140rpx;
  115. height: 140rpx;
  116. border-radius: 50%;
  117. overflow: hidden;
  118. }
  119. .username {
  120. font-size: 32rpx;
  121. color: #333;
  122. margin-top: 10rpx;
  123. }
  124. }
  125. .help-button {
  126. margin-top: 20rpx;
  127. }
  128. </style>