guide.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. }
  89. }
  90. },
  91. }
  92. }
  93. </script>
  94. <style>
  95. .modal {
  96. position: fixed;
  97. top: 0;
  98. right: 0;
  99. bottom: 0;
  100. left: 0;
  101. z-index: 1110;
  102. opacity: 0;
  103. outline: 0;
  104. -ms-transform: scale(1.185);
  105. transform: scale(1.185);
  106. backface-visibility: hidden;
  107. perspective: 2000upx;
  108. background: rgba(0, 0, 0, 0.6);
  109. transition: all 0.3s ease-in-out 0s;
  110. pointer-events: none;
  111. }
  112. .modal::before {
  113. content: "\200B";
  114. display: inline-block;
  115. height: 100%;
  116. }
  117. .modal.show {
  118. opacity: 1;
  119. transition-duration: 0.3s;
  120. -ms-transform: scale(1);
  121. transform: scale(1);
  122. overflow-x: hidden;
  123. overflow-y: auto;
  124. pointer-events: auto;
  125. }
  126. .img {
  127. position: fixed;
  128. top: 20px;
  129. right: 10px;
  130. width: 127px;
  131. height: 184px;
  132. }
  133. .view {
  134. position: fixed;
  135. top: 230px;
  136. right: 50upx;
  137. text-align: center;
  138. width: 550upx;
  139. height: 480upx;
  140. }
  141. </style>