qrcode.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="page">
  3. <view style="text-align: center;height: 320px;width: 260px;margin: 0px auto;padding-top:30px;vertical-align: top;">
  4. <div class="info">
  5. <li>
  6. <image :src="group.avatar" style="height: 50px;width: 50px;border-radius: 5px;vertical-align: middle;"></image>
  7. </li>
  8. <li style='padding-left: 5px;line-height: 25px;;'>
  9. {{group.name}}<br>
  10. ID:{{group.id}}
  11. </li>
  12. </div>
  13. <view class="qrbg">
  14. <image class="qrcode" :src="img" style="width: 150px;height:150px;" />
  15. </view>
  16. <view class="nodata" style="color: #666;;">用浏览器扫描二维码</view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import api from "../../library/index.js"
  22. import config from "../../config.js"
  23. export default {
  24. data() {
  25. return {
  26. img: '',
  27. group:''
  28. }
  29. },
  30. methods: {
  31. },
  32. onLoad(opts) {
  33. this.group = uni.getStorageSync('group_'+opts.id)
  34. api.getMyQrcodeCard({id:opts.id,'type':'qr_group'}).then(res=>{
  35. var img=res.data;
  36. if(img.indexOf('http')<=-1){
  37. img=config.apiUri+img;
  38. }
  39. this.img = img
  40. })
  41. }
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. @import "@/static/css/group.css";
  46. .page{
  47. background-color: #fff;
  48. }
  49. .info{
  50. width: 100%;
  51. display: table;
  52. table-layout: fixed;
  53. height: 50px;
  54. line-height: 50px;
  55. text-align: left;
  56. }
  57. .info > li{
  58. display: table-cell;
  59. vertical-align: middle;
  60. overflow: hidden;
  61. text-overflow:ellipsis;
  62. white-space: nowrap;
  63. }
  64. .info > li:first-child{
  65. width: 60px;
  66. }
  67. .info > li:first-child img{
  68. width: 50px;
  69. height: 50px;
  70. vertical-align: middle;
  71. border-radius: 5px;
  72. }
  73. .info > li:nth-child(2){
  74. line-height: 25px;
  75. }
  76. .qrbg{
  77. display: block;
  78. margin: 15px auto;
  79. width: 200px;
  80. height: 150px;
  81. padding: 25px 0px;
  82. background-image:url(../../static/img/qrbg.png);
  83. background-size: 100% 100%;
  84. margin-top: 30px;
  85. }
  86. </style>