shareQrCode.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="content">
  3. <u-swiper img-mode='scaleToFill' effect3d-previous-margin='80' :list="imgArr" height='800' :autoplay='false' :effect3d="true" :circular="true" name='wap_poster'></u-swiper>
  4. <view class="share-bottom flex" :class="{ 'action-share-bottom': !loading }">
  5. <text>长按图片下载</text>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import { spreadBanner } from '@/api/user.js';
  11. export default {
  12. // components: { tkiQrcode },
  13. data() {
  14. return {
  15. loading: true,//是否载入图片中
  16. imgArr:[]
  17. };
  18. },
  19. onLoad() {
  20. this.loadCodeList()
  21. },
  22. methods: {
  23. loadCodeList() {
  24. uni.showLoading({
  25. title: '载入中',
  26. mask: true
  27. });
  28. // 加载二维码信息
  29. spreadBanner({
  30. // #ifdef H5
  31. type: 2,
  32. // #endif
  33. // #ifdef MP
  34. type: 1
  35. // #endif
  36. }).then(e => {
  37. uni.hideLoading()
  38. this.imgArr = e.data;
  39. }).catch((e) => {
  40. uni.showModal({
  41. title: '生成失败请刷新页面',
  42. showCancel: false
  43. });
  44. uni.hideLoading();
  45. });;
  46. },
  47. }
  48. };
  49. </script>
  50. <style lang="scss">
  51. .content {
  52. padding-top: 30rpx;
  53. }
  54. // #qrShareBox {
  55. // position: absolute;
  56. // left: -9999rpx;
  57. // top: -9999rpx;
  58. // }
  59. .qrimg {
  60. position: absolute;
  61. left: -9999rpx;
  62. top: -9999rpx;
  63. }
  64. .tki-qrcode-canvas {
  65. // width: 700rpx;
  66. // height: 1245rpx;
  67. width: 532rpx;
  68. height: 945rpx;
  69. margin: 0 auto;
  70. }
  71. .share-bottom {
  72. width: 560rpx;
  73. height: 80rpx;
  74. color: #ffffff;
  75. background-color: $base-color;
  76. margin: 0 auto;
  77. font-size: $font-lg - 2rpx;
  78. margin-top: 30rpx;
  79. border-radius: 99rpx;
  80. justify-content: center;
  81. &.action-share-bottom {
  82. background-color: $color-gray;
  83. }
  84. }
  85. </style>