guide.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <view>
  3. <u-image :src="src" mode="widthFix"></u-image>
  4. <view class="modal" :class="show ? 'show' : ''" @click="show = false">
  5. <image class="img" src="/static/index/arrow.png"></image>
  6. <view class="view text-white">
  7. <view class="flex align-center text-bold margin-bottom" style="font-size: 36upx;">
  8. <view class="theme-bg-color flex justify-center align-center margin-right" style="width: 60upx;height: 60upx;border-radius: 16upx;">1</view>
  9. <view class="flex align-center">
  10. <view>点击右上角</view>
  11. <image class="margin-lr-sm" src="/static/index/point.png" style="width: 60upx;height: 38upx;"></image>
  12. <view>按钮</view>
  13. </view>
  14. </view>
  15. <view class="flex align-center text-bold" style="font-size: 36upx;">
  16. <view class="theme-bg-color flex justify-center align-center margin-right" style="width: 60upx;height: 60upx;border-radius: 16upx;">2</view>
  17. <view class="flex align-center">
  18. <view>选择</view>
  19. <image class="margin-lr-sm" src="/static/index/browser.png" style="width: 48upx;height: 48upx;"></image>
  20. <view>在浏览器打开</view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view style="height: 120upx;"></view>
  26. <view class="footer-fixed" style="background-color: #ffffff;padding: 10upx 60upx;">
  27. <button class="cu-btn round theme-bg-color text-white text-bold" style="width: 100%;height: 100upx;font-size: 36upx;" @click="tips">
  28. <view>能量榜已启动!</view>
  29. <image src="/static/index/left-arrow.png" style="width: 32upx;height: 32upx;"></image>
  30. </button>
  31. <view class="flex align-center justify-center">
  32. <view class="theme-color text-bold margin-tb-xs" style="font-size: 36upx;">快来为爱豆和Ta的作品打Call,冲鸭</view>
  33. <image src="/static/index/duck.png" style="width: 34upx;height: 34upx;"></image>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import {getUrlParams} from '@/common/utils/utils.js';
  40. export default {
  41. data() {
  42. return {
  43. userId: '',
  44. show: false,
  45. src: ''
  46. }
  47. },
  48. onLoad(options) {
  49. this.fetchPoster();
  50. if (!this.$u.test.isEmpty(options.userId)) {
  51. this.userId = options.userId;
  52. } else {
  53. this.authorization();
  54. }
  55. },
  56. methods: {
  57. tips() {
  58. this.show = true;
  59. if (this.$isWxBrowser()) {
  60. this.show = true;
  61. }
  62. },
  63. fetchPoster(){
  64. this.$u.api.activity.getList({enable:1}).then(res=>{
  65. this.src=res.records[0].poster;
  66. let link = window.location.href;
  67. let obj = {
  68. link: link,
  69. title: res.records[0].shareTitle,
  70. desc: res.records[0].shareDesc,
  71. imgUrl: res.records[0].shareImg
  72. }
  73. this.$shareConfig(obj, this)
  74. })
  75. },
  76. async authorization() {
  77. let agenterId=uni.getStorageSync("agenterId")
  78. let params = getUrlParams(window.location.search);
  79. if (!this.$u.test.isEmpty(params.code)) {
  80. let res = await this.$u.api.wxInfo.getUserInfo({userCode: params.code});
  81. uni.setStorageSync("openid", res.openid);
  82. let datas = {
  83. nickName: res.nickname,
  84. avatar: res.headimgurl,
  85. gender: res.sex,
  86. openid: res.openid,
  87. unionid: res.unionid,
  88. province:res.province,
  89. city:res.city
  90. }
  91. if (!this.$u.test.isEmpty(agenterId)) {
  92. datas.agenterId=agenterId
  93. }
  94. let result = await this.$u.api.user.login(datas);
  95. if (result) {
  96. this.userId = result.id;
  97. uni.setStorageSync("userId", result.id);
  98. let url = window.location.href;
  99. url = url + "&userId=" + this.userId;
  100. console.log(url);
  101. window.location.href = url;
  102. // window.location.href = 'https://music.nanyue6688.comm/vote-h5/index.html#/pages/index/guide?userId=' + this.userId + '&openId=' + res.openid;
  103. }
  104. }
  105. },
  106. }
  107. }
  108. </script>
  109. <style>
  110. .poster{
  111. margin-top: -6rpx;
  112. }
  113. .modal {
  114. position: fixed;
  115. top: 0;
  116. right: 0;
  117. bottom: 0;
  118. left: 0;
  119. z-index: 1110;
  120. opacity: 0;
  121. outline: 0;
  122. -ms-transform: scale(1.185);
  123. transform: scale(1.185);
  124. backface-visibility: hidden;
  125. perspective: 2000upx;
  126. background: rgba(0, 0, 0, 0.6);
  127. transition: all 0.3s ease-in-out 0s;
  128. pointer-events: none;
  129. }
  130. .modal::before {
  131. content: "\200B";
  132. display: inline-block;
  133. height: 100%;
  134. }
  135. .modal.show {
  136. opacity: 1;
  137. transition-duration: 0.3s;
  138. -ms-transform: scale(1);
  139. transform: scale(1);
  140. overflow-x: hidden;
  141. overflow-y: auto;
  142. pointer-events: auto;
  143. }
  144. .img {
  145. position: fixed;
  146. top: 20px;
  147. right: 10px;
  148. width: 127px;
  149. height: 184px;
  150. }
  151. .view {
  152. position: fixed;
  153. top: 230px;
  154. right: 50upx;
  155. text-align: center;
  156. width: 550upx;
  157. height: 480upx;
  158. }
  159. </style>