recommendCode.vue 1.3 KB

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