freeTrial.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <!-- 这个页面应该是不用了 免费送月卡页面 这里应该就不重要了 -->
  3. <view class="container container-free">
  4. <view class="nav-bar-wrap" :style="{ height: navBarStyle.height, paddingTop: navBarStyle.paddingTop, paddingBottom: navBarStyle.paddingBottom }">
  5. <view class="content">
  6. <van-icon custom-class="search-icon" name="arrow-left" size="24px" @click="goSearch" />
  7. <view class="text">免费送月卡</view>
  8. </view>
  9. </view>
  10. <view class="img-code">
  11. <image :src="wechatCode"></image>
  12. </view>
  13. <view class="btn-box">
  14. <button class="bottom_in" open-type="share" plain="true">分享</button>
  15. <view @click="goSearch" class="btn-back">返回</view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import { FreeButton } from "@/config/api.js";
  21. export default {
  22. data() {
  23. return {
  24. wechatCode:'',//二维码
  25. scene:"",//用户的id
  26. };
  27. },
  28. methods: {
  29. /**这个页面应该是不用了 免费送月卡页面 这里应该就不重要了 就不备注了 */
  30. initNavBar() {
  31. let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
  32. this.navBarStyle = {
  33. height: menuButtonInfo.height + menuButtonInfo.top + 8 + "px",
  34. paddingTop: menuButtonInfo.top - 4 + "px",
  35. paddingBottom: "4px",
  36. };
  37. },
  38. goSearch() {
  39. uni.navigateBack();
  40. },
  41. async wechatShareImage() {
  42. const res = await FreeButton.wechatShareImage();
  43. if(res.Ret === 200) {
  44. this.wechatCode = res.Data.FileLink
  45. this.scene = res.Data.Scene
  46. }
  47. },
  48. },
  49. onLoad() {
  50. this.initNavBar();
  51. this.wechatShareImage()
  52. },
  53. /**
  54. * 用户点击分享
  55. */
  56. onShareAppMessage: function (res) {
  57. return {
  58. title: "送您一张免费月卡",
  59. path: "/pageMy/excessivePages/excessivePages?scene="+this.scene,
  60. imageUrl: "https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/share_month.png",
  61. };
  62. },
  63. };
  64. </script>
  65. <style lang="scss">
  66. .nav-bar-wrap {
  67. color: #fff;
  68. position: fixed;
  69. top: 0;
  70. left: 0;
  71. width: 100%;
  72. z-index: 999;
  73. .content {
  74. position: relative;
  75. height: 100%;
  76. .search-icon {
  77. position: absolute;
  78. left: 34rpx;
  79. top: 50%;
  80. transform: translateY(-50%);
  81. }
  82. }
  83. }
  84. </style>
  85. <style lang="scss" scoped>
  86. .container-free {
  87. position: relative;
  88. width: 100%;
  89. height: 100%;
  90. background: url("https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/background_image.jpg") no-repeat;
  91. background-size: 100% 100%;
  92. .btn-box {
  93. position: absolute;
  94. bottom: 115rpx;
  95. left: 50%;
  96. transform: translateX(-50%);
  97. text-align: center;
  98. font-size: 34rpx;
  99. color: #fff;
  100. padding-bottom: constant(safe-area-inset-bottom);
  101. padding-bottom: env(safe-area-inset-bottom);
  102. }
  103. .bottom_in {
  104. width: 379rpx;
  105. height: 80rpx;
  106. line-height: 80rpx;
  107. background: linear-gradient(180deg, #f8d083 0%, #f0b157 100%);
  108. border: none;
  109. font-weight: 600;
  110. margin-bottom: 20rpx;
  111. color: #fff;
  112. }
  113. .btn-back {
  114. width: 379rpx;
  115. height: 80rpx;
  116. border: 1px solid #f1e2ce;
  117. line-height: 78rpx;
  118. }
  119. .img-code {
  120. width: 200rpx;
  121. height: 200rpx;
  122. position: absolute;
  123. top: 46%;
  124. left: 50%;
  125. transform: translate(-50%, -50%);
  126. image {
  127. width: 100%;
  128. height: 100%;
  129. }
  130. }
  131. }
  132. .nav-bar-wrap {
  133. .content {
  134. .text {
  135. text-align: center;
  136. width: 50vw;
  137. position: absolute;
  138. left: 50%;
  139. top: 50%;
  140. transform: translate(-50%, -50%);
  141. font-weight: bold;
  142. font-size: 16px;
  143. }
  144. }
  145. }
  146. </style>