speakerInvitation.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <view class="container">
  3. <image class="bg" src="/static/image/bg_invite.png" mode="aspectFill"></image>
  4. <!-- 状态栏占位(微信小程序原生适配) -->
  5. <view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
  6. <view class="return">
  7. <image class="return-img" @click="goBack" src="/static/image/back_white.png" mode="aspectFill"></image>
  8. </view>
  9. <!-- 核心内容区:居中布局 -->
  10. <view class="main-content">
  11. <!-- 页面大标题:讲者邀请 -->
  12. <view class="page-title">
  13. <image class="title-img" src="@/static/image/img_title.png" mode="aspectFill"></image>
  14. <text class="title-txt">讲者邀请</text>
  15. <image class="title-img rotate180" src="@/static/image/img_title.png" mode="aspectFill"></image>
  16. </view>
  17. <!-- 邀请卡片:白色背景+圆角+轻微阴影(1:1匹配UI) -->
  18. <view class="invite-card">
  19. <!-- 邀请人信息区 -->
  20. <view class="inviter-section">
  21. <image class="inviter-avatar" src="@/static/image/my_heads_icon.png" mode="aspectFill"></image>
  22. <text class="inviter-name">王小明</text>
  23. <text class="invite-desc">邀请你成为讲者</text>
  24. </view>
  25. <!-- 二维码区域:白色边框+圆角 -->
  26. <view class="qrcode-box">
  27. <image class="qrcode-img" src="@/static/image/bg_invite.png"></image>
  28. </view>
  29. <!-- 扫码提示文字 -->
  30. <view class="scan-tip">扫一扫,注册学苑</view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import { inviteDoctor } from '@/api/speaker.js'
  37. export default {
  38. data() {
  39. return {
  40. // 仅获取微信小程序状态栏高度,无多余逻辑
  41. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  42. userInfo: {},
  43. };
  44. },
  45. onLoad() {
  46. this.userInfo=JSON.parse(uni.getStorageSync('userInfo'));
  47. this.inviteDoctor();
  48. },
  49. methods: {
  50. goBack() {
  51. uni.navigateBack({
  52. delta: 1
  53. });
  54. },
  55. inviteDoctor() {
  56. inviteDoctor(this.userInfo.userId,this.userInfo.companyId).then(res => {
  57. console.log(res);
  58. });
  59. }
  60. }
  61. };
  62. </script>
  63. <style lang="scss" scoped>
  64. /* 小程序页面全局重置:消除默认样式 */
  65. page {
  66. margin: 0;
  67. padding: 0;
  68. background-color: #F8F7F5;
  69. font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  70. }
  71. /* 根容器:全屏+垂直布局 */
  72. .container {
  73. min-height: 100vh;
  74. display: flex;
  75. flex-direction: column;
  76. background-color: #F8F7F5;
  77. position: relative;
  78. .bg {
  79. position: absolute;
  80. top: 0;
  81. width: 100%;
  82. height: 100%;
  83. }
  84. }
  85. /* 状态栏占位:透明背景,仅占高度 */
  86. .status-bar {
  87. width: 100%;
  88. background-color: transparent;
  89. }
  90. .return {
  91. position: relative;
  92. height: 88rpx;
  93. z-index: 2;
  94. line-height: 88rpx;
  95. .return-img {
  96. width: 40rpx;
  97. height: 40rpx;
  98. margin-left: 32rpx;
  99. }
  100. }
  101. /* 核心内容区:水平居中+顶部间距 */
  102. .main-content {
  103. width: 100%;
  104. display: flex;
  105. flex-direction: column;
  106. align-items: center;
  107. padding: 52rpx 74rpx 0;
  108. box-sizing: border-box;
  109. position: relative;
  110. z-index: 2;
  111. /* 页面大标题:讲者邀请(匹配UI字体/大小/颜色) */
  112. .page-title {
  113. font-weight: 600;
  114. font-size: 48rpx;
  115. color: #FFFFFF;
  116. margin-bottom: 124rpx;
  117. display: flex;
  118. align-items: center;
  119. .title-img {
  120. width: 134rpx;
  121. height: 12rpx;
  122. }
  123. .title-txt {
  124. margin: 0 20rpx;
  125. }
  126. .rotate180 {
  127. transform: rotate(180deg);
  128. }
  129. }
  130. /* 邀请卡片:白色背景+圆角+轻微阴影(1:1匹配) */
  131. .invite-card {
  132. width: 100%;
  133. background-color: #FFFFFF;
  134. border-radius: 32rpx;
  135. box-shadow: 0rpx 16rpx 28rpx 0rpx rgba(45, 109, 199, 0.37);
  136. padding: 60rpx 40rpx 80rpx;
  137. position: relative;
  138. box-sizing: border-box;
  139. /* 邀请人信息区:头像+文字横向布局 */
  140. .inviter-section {
  141. position: absolute;
  142. top: -72rpx;
  143. left: 50%;
  144. transform: translateX(-50%);
  145. display: flex;
  146. flex-direction: column;
  147. justify-content: center;
  148. align-items: center;
  149. .inviter-avatar {
  150. width: 144rpx;
  151. height: 144rpx;
  152. border-radius: 50%;
  153. margin-bottom: 18rpx;
  154. }
  155. /* 邀请人姓名 */
  156. .inviter-name {
  157. color: #000000;
  158. font-weight: 600;
  159. font-size: 36rpx;
  160. margin-bottom: 36rpx;
  161. }
  162. /* 邀请文案 */
  163. .invite-desc {
  164. font-size: 32rpx;
  165. color: #666666;
  166. }
  167. }
  168. .qrcode-box {
  169. width: 372rpx;
  170. height: 372rpx;
  171. background-color: #FFFFFF;
  172. display: flex;
  173. align-items: center;
  174. justify-content: center;
  175. margin: 200rpx auto 40rpx;
  176. .qrcode-img {
  177. width: 372rpx;
  178. height: 372rpx;
  179. }
  180. }
  181. /* 扫码提示文字:居中+浅灰色 */
  182. .scan-tip {
  183. text-align: center;
  184. font-size: 32rpx;
  185. color: #333333;
  186. }
  187. }
  188. }
  189. </style>