You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

197 lines
4.7 KiB

  1. <template>
  2. <view class="invitation-container">
  3. <!-- 填写邀请码区域 -->
  4. <view class="invitation-section">
  5. <view class="section-header">
  6. <text class="iconfont icon-invite"></text>
  7. <text class="section-title">填写邀请码</text>
  8. </view>
  9. <view class="section-subtitle">邀请人有且只有一位添加后不可更改</view>
  10. <view class="input-area">
  11. <input type="text" class="invite-input" placeholder="请输入邀请码,领取优惠券" v-model="inviteCode" />
  12. </view>
  13. <view class="submit-btn" @click="submitInviteCode">立即领取</view>
  14. </view>
  15. <!-- 我的邀请码区域 -->
  16. <!-- <view class="my-invitation-section">
  17. <view class="section-header">
  18. <text class="iconfont icon-myinvite"></text>
  19. <text class="section-title">我的邀请码</text>
  20. </view>
  21. <view class="section-subtitle">有关邀请码的更多功能请前往服务者端了解~</view>
  22. <view class="my-code-area">
  23. <text class="my-code">{{ myInviteCode }}</text>
  24. <view class="copy-btn" @click="copyInviteCode">复制</view>
  25. </view>
  26. </view> -->
  27. <!-- 推广员入口 -->
  28. <!-- <view class="promotion-section">
  29. <text class="promotion-text">了解并加入布了推广员赚取高达80%收益分成!!!</text>
  30. <view class="promotion-btn" @click="goToPromotion">推广员后台</view>
  31. </view> -->
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. name: 'InvitationCode',
  37. data() {
  38. return {
  39. inviteCode: '', // 用户输入的邀请码
  40. myInviteCode: 'b1014pib' // 我的邀请码
  41. }
  42. },
  43. methods: {
  44. // 提交邀请码
  45. submitInviteCode() {
  46. if (!this.inviteCode) {
  47. uni.showToast({
  48. title: '请输入邀请码',
  49. icon: 'none'
  50. })
  51. return
  52. }
  53. // 这里添加提交邀请码的逻辑
  54. uni.showToast({
  55. title: '邀请码提交成功',
  56. icon: 'success'
  57. })
  58. },
  59. // 复制邀请码
  60. copyInviteCode() {
  61. uni.setClipboardData({
  62. data: this.myInviteCode,
  63. success: () => {
  64. uni.showToast({
  65. title: '复制成功',
  66. icon: 'success'
  67. })
  68. }
  69. })
  70. },
  71. // 前往推广员后台
  72. goToPromotion() {
  73. // 这里添加跳转到推广员后台的逻辑
  74. uni.navigateTo({
  75. url: '/pages_order/mine/promotion'
  76. })
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. .invitation-container {
  83. padding: 20rpx;
  84. font-family: PingFang SC, Helvetica Neue, Helvetica, Arial, sans-serif;
  85. }
  86. /* 公共样式 */
  87. .section-header {
  88. display: flex;
  89. align-items: center;
  90. margin-bottom: 10rpx;
  91. }
  92. .iconfont {
  93. margin-right: 10rpx;
  94. font-size: 36rpx;
  95. color: #FFBF60;
  96. }
  97. .section-title {
  98. font-size: 34rpx;
  99. font-weight: bold;
  100. color: #333;
  101. }
  102. .section-subtitle {
  103. font-size: 24rpx;
  104. color: #999;
  105. margin-bottom: 20rpx;
  106. }
  107. /* 填写邀请码区域 */
  108. .invitation-section {
  109. background-color: #fff;
  110. border-radius: 12rpx;
  111. padding: 30rpx;
  112. margin-bottom: 20rpx;
  113. }
  114. .input-area {
  115. background-color: #F5F7FA;
  116. border-radius: 12rpx;
  117. margin-bottom: 20rpx;
  118. }
  119. .invite-input {
  120. height: 80rpx;
  121. padding: 0 20rpx;
  122. font-size: 28rpx;
  123. }
  124. .submit-btn {
  125. background-color: #FFBF60;
  126. color: #fff;
  127. text-align: center;
  128. height: 80rpx;
  129. line-height: 80rpx;
  130. border-radius: 40rpx;
  131. font-size: 30rpx;
  132. }
  133. /* 我的邀请码区域 */
  134. .my-invitation-section {
  135. background-color: #fff;
  136. border-radius: 12rpx;
  137. padding: 30rpx;
  138. margin-bottom: 20rpx;
  139. }
  140. .my-code-area {
  141. display: flex;
  142. align-items: center;
  143. justify-content: space-between;
  144. }
  145. .my-code {
  146. font-size: 36rpx;
  147. font-weight: bold;
  148. color: #333;
  149. }
  150. .copy-btn {
  151. border: 1px solid #FFBF60;
  152. color: #FFBF60;
  153. padding: 8rpx 30rpx;
  154. border-radius: 30rpx;
  155. font-size: 24rpx;
  156. }
  157. /* 推广员入口 */
  158. .promotion-section {
  159. text-align: center;
  160. margin-top: 60rpx;
  161. }
  162. .promotion-text {
  163. font-size: 26rpx;
  164. color: #666;
  165. margin-bottom: 20rpx;
  166. }
  167. .promotion-btn {
  168. background-color: #FFBF60;
  169. color: #fff;
  170. height: 90rpx;
  171. line-height: 90rpx;
  172. border-radius: 45rpx;
  173. font-size: 32rpx;
  174. }
  175. </style>