guide.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. })
  67. },
  68. async authorization() {
  69. let agenterId=uni.getStorageSync("agenterId")
  70. let params = getUrlParams(window.location.search);
  71. if (!this.$u.test.isEmpty(params.code)) {
  72. let res = await this.$u.api.wxInfo.getUserInfo({userCode: params.code});
  73. uni.setStorageSync("openid", res.openid);
  74. let datas = {
  75. nickName: res.nickname,
  76. avatar: res.headimgurl,
  77. gender: res.sex,
  78. openid: res.openid,
  79. unionid: res.unionid,
  80. province:res.province,
  81. city:res.city
  82. }
  83. if (!this.$u.test.isEmpty(agenterId)) {
  84. datas.agenterId=agenterId
  85. }
  86. let result = await this.$u.api.user.login(datas);
  87. if (result) {
  88. this.userId = result.id;
  89. uni.setStorageSync("userId", result.id);
  90. let url = window.location.href;
  91. url = url + "&userId=" + this.userId;
  92. console.log(url);
  93. window.location.href = url;
  94. // window.location.href = 'https://music.nanyue6688.comm/vote-h5/index.html#/pages/index/guide?userId=' + this.userId + '&openId=' + res.openid;
  95. }
  96. }
  97. },
  98. }
  99. }
  100. </script>
  101. <style>
  102. .poster{
  103. margin-top: -6rpx;
  104. }
  105. .modal {
  106. position: fixed;
  107. top: 0;
  108. right: 0;
  109. bottom: 0;
  110. left: 0;
  111. z-index: 1110;
  112. opacity: 0;
  113. outline: 0;
  114. -ms-transform: scale(1.185);
  115. transform: scale(1.185);
  116. backface-visibility: hidden;
  117. perspective: 2000upx;
  118. background: rgba(0, 0, 0, 0.6);
  119. transition: all 0.3s ease-in-out 0s;
  120. pointer-events: none;
  121. }
  122. .modal::before {
  123. content: "\200B";
  124. display: inline-block;
  125. height: 100%;
  126. }
  127. .modal.show {
  128. opacity: 1;
  129. transition-duration: 0.3s;
  130. -ms-transform: scale(1);
  131. transform: scale(1);
  132. overflow-x: hidden;
  133. overflow-y: auto;
  134. pointer-events: auto;
  135. }
  136. .img {
  137. position: fixed;
  138. top: 20px;
  139. right: 10px;
  140. width: 127px;
  141. height: 184px;
  142. }
  143. .view {
  144. position: fixed;
  145. top: 230px;
  146. right: 50upx;
  147. text-align: center;
  148. width: 550upx;
  149. height: 480upx;
  150. }
  151. </style>