guide.vue 4.2 KB

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