recommendCode.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view :style="getHeight">
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <service-widget @btnClick="btn_click"></service-widget>
  6. <view class="content d-flex flex-column a-center j-center">
  7. <image src="/static/image/addStaff/face_sao.png" mode="widthFix" lazy-load style="width: 500upx;"></image>
  8. <image :src="recommendImg" mode="widthFix" lazy-load style="width: 450upx;"></image>
  9. <view>新成员只需要扫描您的二维码,即可马上注册加入啦!</view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import {
  15. mapState
  16. } from "vuex"
  17. import QR from "@/common/wxqrcode.js"
  18. export default {
  19. data() {
  20. return {
  21. recommendImg: ""
  22. }
  23. },
  24. computed: {
  25. ...mapState(['userInfo']),
  26. getHeight() {
  27. let height = uni.getSystemInfoSync().windowHeight;
  28. return `height: ${height}px;`;
  29. }
  30. },
  31. onLoad() {
  32. var id = this.userInfo.sysUser.id;
  33. this.recommendImg = QR.createQrCodeImg(this.$base.h5BaseUrl + "/#/pages/register/register?id=" + id, {
  34. size: parseInt(200) //二维码大小
  35. })
  36. },
  37. methods: {
  38. btn_click() {
  39. uni.navigateTo({
  40. url: '/pages/chat/chat'
  41. })
  42. },
  43. }
  44. }
  45. </script>
  46. <style>
  47. .content {
  48. position: absolute;
  49. top: 50%;
  50. left: 50%;
  51. transform: translate(-50%, -60%);
  52. }
  53. .content>image {
  54. margin-top: 30upx;
  55. margin-bottom: 30upx;
  56. }
  57. .content>view {
  58. width: 400upx;
  59. color: red;
  60. text-align: center;
  61. }
  62. </style>