qr-code.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <view class="qr_code flexCC">
  3. <image src="../../static/code_bg.png" mode="" class="code_bg"></image>
  4. <view class="code_box flexCC">
  5. <view class="img flexC">
  6. <image :src="info.headimg" class="store_img"></image>
  7. </view>
  8. <view class="qr_con">
  9. <view class="store_name">{{ info.name | getName(10) }}的店铺</view>
  10. <image :src="info.qrcode" class="code_img" @click="preview"></image>
  11. <view class="hint">点击图片-长按-加客服微信好友</view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import {
  18. getServiceInfo
  19. } from '../../../apis/shop.js'
  20. export default {
  21. data() {
  22. return {
  23. info: '' //店铺信息
  24. };
  25. },
  26. methods: {},
  27. onShow() {
  28. this.getInfo()
  29. },
  30. methods: {
  31. //点击放大
  32. preview() {
  33. uni.previewImage({
  34. current: this.info.qrcode,
  35. urls: [this.info.qrcode]
  36. })
  37. },
  38. //获取政委信息
  39. getInfo() {
  40. getServiceInfo().then(res => {
  41. if (res.code == 200) {
  42. this.info = res.data;
  43. } else {
  44. uni.showModal({
  45. content: res.msg || '获取信息失败',
  46. showCancel: false,
  47. success: model => {
  48. if (model.confirm) {
  49. uni.navigateBack()
  50. }
  51. }
  52. })
  53. }
  54. })
  55. }
  56. }
  57. };
  58. </script>
  59. <style lang="scss" scoped>
  60. .qr_code {
  61. width: 100vw;
  62. height: 100vh;
  63. position: relative;
  64. .code_bg {
  65. width: 100vw;
  66. height: 100vh;
  67. position: fixed;
  68. top: 0;
  69. left: 0;
  70. }
  71. // background: url('../../static/code_bg.png') no-repeat;
  72. // background-size: 100% 100%;
  73. .code_box {
  74. width: 100%;
  75. height: 100vh;
  76. z-index: 999;
  77. .img {
  78. .store_img {
  79. width: 200rpx;
  80. height: 200rpx;
  81. border: 6rpx solid #fff;
  82. border-radius: 50%;
  83. z-index: 99999;
  84. }
  85. }
  86. .qr_con {
  87. width: 690rpx;
  88. height: 70vh;
  89. background: rgba(255, 255, 255, 0.79);
  90. margin: -100rpx auto 0;
  91. border-radius: 24rpx;
  92. display: flex;
  93. flex-direction: column;
  94. align-items: center;
  95. .store_name {
  96. font-size: 44rpx;
  97. font-weight: bold;
  98. padding: 130rpx 0 30rpx;
  99. }
  100. .code_img {
  101. width: 450rpx;
  102. height: 450rpx;
  103. margin: 40rpx 0 40rpx;
  104. border-radius: 24rpx;
  105. }
  106. .hint {
  107. font-size: 36rpx;
  108. font-weight: bold;
  109. }
  110. }
  111. }
  112. }
  113. </style>