user-myqrcode.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>我的二维码-创业帮</title>
  6. <meta name="keywords" content="我的二维码-创业帮">
  7. <meta name="description" content="我的二维码-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="我的二维码-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. </head>
  17. <body class="bgc-back">
  18. <div id="app">
  19. <van-nav-bar class="camp_title f16" title="我的二维码" v-if="toptitleisshow" @click-left="goback" left-arrow v-cloak>
  20. <template #left>
  21. <van-icon name="arrow-left" color="#fff" size="20"></van-icon>
  22. </template>
  23. </van-nav-bar>
  24. <div class="myqrcode" v-cloak>
  25. <div class="bgcfff tc shadow03">
  26. <div class="myqrcode-img rel">
  27. <div class="abs" id="qrcode"> <img src="./static/images/qrcode.png" alt="" style="width:100%;"></div>
  28. </div>
  29. <div class="myqrcode-info df pt16 pb16" v-cloak>
  30. <div class="user-info cm flex1">
  31. <div class="tl">
  32. <div class="f14 c333"><span class="vm">{{name}} {{number}} </span></div>
  33. <div class="f12 c333 op7">扫我加入创业帮</div>
  34. </div>
  35. </div>
  36. <div class="user-img">
  37. <van-image width="100%" :src="HeadPhoto" fit="cover" lazy-load round>
  38. <template v-slot:loading><img src="./static/images/user-img@3x.png" alt="" width="100%"></template>
  39. </van-image>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <script src="https://cdn.bootcdn.net/ajax/libs/qrcodejs/1.0.0/qrcode.js"></script>
  46. <script src="./static/js/klm-vv.min.js"></script>
  47. <script src="./static/js/klm-axios-config.js"></script>
  48. <script>
  49. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  50. // 可以通过下面的方式手动注册
  51. Vue.use(vant.Lazyload);
  52. // 在 #app 标签下渲染一个按钮组件
  53. let app = new Vue({
  54. el: '#app',
  55. data() {
  56. return {
  57. toptitleisshow:true,
  58. active: 0,
  59. HeadPhoto: '',
  60. isShow: true,
  61. name:'张三',
  62. number:'H123456',
  63. invitedcode:'',
  64. };
  65. },
  66. created() {
  67. //- 二维码图片连接由后端发送
  68. //- this.badgeisshow = true
  69. //- setTimeout(()=>{
  70. //- new QRCode('qrcode', {
  71. //- text: this.qrcode,
  72. //- width: 200,
  73. //- height: 200,
  74. //- colorDark : '#000',
  75. //- colorLight : '#fff',
  76. //- correctLevel : QRCode.CorrectLevel.H
  77. //- });
  78. //- })
  79. this.getuserinfo();
  80. },
  81. methods: {
  82. async getuserinfo(){
  83. PublicLib.ShowLoading({Message:''});
  84. const Id = PublicLib.getCookieInfo('userId');
  85. const res = await getRequest('/api/v1/users/mycard',JSON.stringify({Id}));
  86. if(res.status !== '1')return tips('获取个人信息失败!请刷新重试')
  87. PublicLib.HideLoading();
  88. //- 个人信息
  89. this.name = res.data.RealName;
  90. this.number = res.data.MakerCode;
  91. this.invitedcode = res.data.ReferenceQrCode;
  92. this.HeadPhoto = res.data.HeadPhoto;
  93. },
  94. goback(){
  95. PublicLib.GoBack({Level:1});
  96. }
  97. }
  98. });
  99. </script>
  100. </body>
  101. </html>