alipayImg.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="content">
  3. <view class="images">
  4. <image class="slide-image" :src="url" mode="widthFix" show-menu-by-longpress />
  5. </view>
  6. <view class="btn-box">
  7. <view class="btn" @click="shareQr()">分享</view>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import {getUserInfo,getQrImg} from '@/api/companyUser'
  13. export default {
  14. name: 'Poster',
  15. components: {
  16. },
  17. props: {},
  18. data: function() {
  19. return {
  20. url:null,
  21. }
  22. },
  23. mounted: function() {
  24. this.getQrImg()
  25. },
  26. methods: {
  27. getQrImg(){
  28. var data={token:uni.getStorageSync('CompanyUserToken')}
  29. getQrImg(data).then(
  30. res => {
  31. var path=uni.getStorageSync('requestPath')
  32. this.url =path+ "/"+res.url
  33. },
  34. rej => {}
  35. );
  36. },
  37. shareQr(){
  38. wx.downloadFile({
  39. url: this.url,
  40. success: (res) => {
  41. wx.showShareImageMenu({
  42. path: res.tempFilePath
  43. })
  44. }
  45. })
  46. },
  47. },
  48. }
  49. </script>
  50. <style lang="less">
  51. page {
  52. height: 100%;
  53. }
  54. .content {
  55. width: 100%;
  56. height: 100%;
  57. }
  58. .images {
  59. display: flex;
  60. align-items: center;
  61. justify-content: center;
  62. padding-bottom:140upx ;
  63. height: 100%;
  64. }
  65. .images .slide-image {
  66. width: 80%;
  67. height: auto;
  68. }
  69. .btn-box{
  70. height: 140upx;
  71. z-index: 9999;
  72. width: 100%;
  73. padding: 0rpx 30upx;
  74. position: fixed;
  75. bottom: 0;
  76. left: 0;
  77. box-sizing: border-box;
  78. background-color: #ffffff;
  79. display: flex;
  80. align-items: center;
  81. justify-content: center;
  82. .btn{
  83. width: 100%;
  84. height: 88upx;
  85. line-height: 88upx;
  86. text-align: center;
  87. font-size: 34upx;
  88. font-family: PingFang SC;
  89. font-weight: 400;
  90. color: #FFFFFF;
  91. background:#018C39 !important;
  92. border-radius: 44upx;
  93. }
  94. }
  95. </style>