MiniProgramPage.php 795 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * This file is part of the overtrue/wechat.
  4. *
  5. * (c) overtrue <i@overtrue.me>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace EasyWeChat\Message;
  11. class MiniProgramPage extends AbstractMessage
  12. {
  13. protected $type = 'miniprogrampage';
  14. protected $properties = [
  15. 'title',
  16. 'appid',
  17. 'pagepath',
  18. 'thumb_media_id',
  19. ];
  20. /**
  21. * 小程序卡片图片的媒体ID,小程序卡片图片建议大小为520*416
  22. * mediaId需后台通过api上传后获取.
  23. *
  24. * @param string $mediaId
  25. *
  26. * @return $this
  27. */
  28. public function thumb($mediaId)
  29. {
  30. $this->setAttribute('thumb_media_id', $mediaId);
  31. return $this;
  32. }
  33. }