inviteImg.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view class="box">
  3. <image class="inviteImg" :src="image" ></image>
  4. <view class="lyy-b-but">长按图片下载</view>
  5. <!-- <view class="lyy-b-but" @click="domImg">点击下载图片</view> -->
  6. </view>
  7. </template>
  8. <script>
  9. import { getCombinationPoster } from '@/api/product.js';
  10. import { mapState } from 'vuex';
  11. export default {
  12. data() {
  13. return {
  14. image:'',//海报
  15. ptId:'',//拼团id
  16. }
  17. },
  18. computed: {
  19. ...mapState(['baseURL','urlFile'])
  20. },
  21. onLoad(option) {
  22. // 保存拼团id
  23. this.ptId = option.id;
  24. // 保存团长id
  25. this.spread = option.spread;
  26. // 加载分享图
  27. this.getCombinationPoster();
  28. },
  29. methods: {
  30. // 加载海报
  31. getCombinationPoster() {
  32. let obj = this;
  33. getCombinationPoster({
  34. id:obj.ptId,
  35. // #ifdef H5|APP-PLUS
  36. url:obj.baseURL+obj.urlFile+'/#/pages/product/groupBooking/detail?id='+obj.ptId+'&spread='+obj.spread,
  37. from:'wechat',//来源wechat公众号
  38. // #endif
  39. // #ifdef MP
  40. from:'routine',//来源routine小程序
  41. url:'/pages/product/groupBooking/detail?id='+obj.ptId
  42. // url: 'pages/index/index'
  43. // #endif
  44. }).then((e) => {
  45. obj.image = e.data.url;
  46. }).catch((e) => {
  47. console.log(e);
  48. })
  49. }
  50. },
  51. }
  52. </script>
  53. <style lang="scss">
  54. page{
  55. background-color: #FFFFFF;
  56. height: 100%;
  57. }
  58. .box{
  59. .inviteImg{
  60. width: 750rpx;
  61. height: 1200rpx;
  62. }
  63. }
  64. .lyy-b-but {
  65. height: 80rpx;
  66. background: #fc5b62;
  67. border-radius: 100rpx;
  68. text-align: center;
  69. color: white;
  70. line-height: 80rpx;
  71. font-size: 32rpx;
  72. margin: 0 100rpx;
  73. }
  74. </style>