四零语境前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
2.1 KiB

  1. <template>
  2. <view class="share-page">
  3. <!-- <uv-status-bar></uv-status-bar> -->
  4. <!-- 主要内容区域 -->
  5. <view class="content">
  6. <!-- 中间图片 -->
  7. <view class="image-container">
  8. <image
  9. class="share-image"
  10. :src="Qrcode"
  11. mode="widthFix"
  12. ></image>
  13. </view>
  14. </view>
  15. <!-- 底部固定按钮 -->
  16. <view class="bottom-button-container">
  17. <uv-button :custom-style="{
  18. height: '82rpx',
  19. borderRadius: '198rpx',
  20. background: '#06DADC',
  21. border: '2rpx solid #06DADC',
  22. lineHeight: '82rpx',
  23. fontSize: '36rpx'
  24. }" type="primary" @click="save">保存到相册</uv-button>
  25. <uv-safe-bottom></uv-safe-bottom>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. Qrcode: '',
  34. }
  35. },
  36. methods: {
  37. handleShare() {
  38. // 分享逻辑
  39. uni.showToast({
  40. title: '分享功能',
  41. icon: 'none'
  42. })
  43. },
  44. async getQrcode() {
  45. // const res = await this.$api.promotion.qrCode()
  46. // if (res.code === 200) {
  47. uni.getImageInfo({
  48. src: `${this.$config.baseURL}/promotion/qrCode?token=${uni.getStorageSync('token')}`,
  49. success: function (image) {
  50. console.log(image.width);
  51. console.log(image.path);
  52. this.Qrcode = image.path;
  53. console.log(image.height);
  54. }
  55. });
  56. // }
  57. }
  58. },
  59. onShow() {
  60. this.getQrcode()
  61. },
  62. }
  63. </script>
  64. <style lang="scss" scoped>
  65. .share-page {
  66. min-height: 100vh;
  67. background-color: #f5f5f5;
  68. display: flex;
  69. flex-direction: column;
  70. }
  71. .content {
  72. flex: 1;
  73. padding-bottom: 200rpx;
  74. display: flex;
  75. align-items: center;
  76. justify-content: center;
  77. .image-container {
  78. display: flex;
  79. justify-content: center;
  80. align-items: center;
  81. .share-image {
  82. width: 670rpx;
  83. border-radius: 16rpx;
  84. }
  85. }
  86. }
  87. // 底部固定按钮
  88. .bottom-button-container {
  89. position: fixed;
  90. bottom: 0;
  91. left: 0;
  92. right: 0;
  93. padding: 30rpx 40rpx;
  94. background: rgba(255, 255, 255, 0.95);
  95. border-top: 1px solid #F1F1F1;
  96. }
  97. </style>