wx-channel-video.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <!-- #ifdef MP-WEIXIN -->
  3. <block v-if="type === 'channelVideoQrCode'">
  4. <view class="channel-video-qrcode">
  5. <view>
  6. <image style="width: 240rpx; height: 240rpx" :src="src"></image>
  7. <view>扫码查看视频内容</view>
  8. </view>
  9. </view>
  10. </block>
  11. <block v-else>
  12. <view class="channel-video">
  13. <channel-video :feed-id="feedId" :finder-user-name="finderUserName"></channel-video>
  14. <view style="color: var(--uni-color-primary)" :data-feed-id="feedId" :data-finder-user-name="finderUserName" @click="toPlayChannelVideo"
  15. >点击观看视频</view
  16. >
  17. </view>
  18. </block>
  19. <!-- #endif -->
  20. <!-- #ifndef MP-WEIXIN -->
  21. <view class="channel-video-qrcode">
  22. <view>
  23. <image style="width: 240rpx; height: 240rpx" :src="src"></image>
  24. <view>扫码查看视频内容</view>
  25. </view>
  26. </view>
  27. <!-- #endif -->
  28. </template>
  29. <script>
  30. import { handle, request } from "@kasite/uni-app-base";
  31. import { REQUEST_CONFIG } from "@kasite/uni-app-base/config";
  32. export default {
  33. props: {
  34. type: {
  35. type: String,
  36. default: "",
  37. },
  38. src: {
  39. type: String,
  40. default: "",
  41. },
  42. feedId: {
  43. type: String,
  44. default: "",
  45. },
  46. finderUserName: {
  47. type: String,
  48. default: "",
  49. },
  50. },
  51. data() {
  52. return {};
  53. },
  54. methods: {
  55. toPlayChannelVideo(e) {
  56. const { feedId, finderUserName } = e.currentTarget.dataset;
  57. uni.openChannelsActivity({ finderUserName, feedId });
  58. },
  59. },
  60. mounted() {},
  61. };
  62. </script>
  63. <style>
  64. .channel-video {
  65. display: flex;
  66. justify-content: center;
  67. }
  68. .channel-video-qrcode {
  69. display: flex;
  70. justify-content: center;
  71. }
  72. .channel-video-qrcode > view {
  73. display: flex;
  74. flex-direction: column;
  75. align-items: center;
  76. }
  77. </style>