shareInfo.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view class="content">
  3. <u-image width="60vw" height="60vw" :src="shareUrl" class="share-img"></u-image>
  4. <u-top-tips ref="uTips"></u-top-tips>
  5. </view>
  6. </template>
  7. <script>
  8. import {
  9. mapGetters
  10. } from 'vuex'
  11. const NET = require('@/utils/request')
  12. const API = require('@/config/api')
  13. export default {
  14. computed: {
  15. ...mapGetters([
  16. 'mainColor'
  17. ])
  18. },
  19. data() {
  20. return {
  21. shareUrl: ''
  22. }
  23. },
  24. onLoad() {
  25. this.getData()
  26. },
  27. onReady() {},
  28. methods: {
  29. // 获取数据
  30. getData() {
  31. NET.request(API.getShareUrl, {}, 'POST').then(res => {
  32. this.shareUrl = res.data
  33. }).catch(error => {
  34. this.$refs.uTips.show({
  35. title: error.message,
  36. type: 'warning',
  37. })
  38. })
  39. }
  40. },
  41. }
  42. </script>
  43. <style lang="scss" scoped>
  44. @import "@/static/css/themes.scss";
  45. .content {
  46. width: 100%;
  47. height: 100vh;
  48. float: left;
  49. position: relative;
  50. .share-img {
  51. top: 40%;
  52. left: 50%;
  53. transform: translate(-50%, -50%);
  54. position: absolute;
  55. }
  56. }
  57. </style>