followUs.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <block>
  3. <view class="container container-follow-us">
  4. <view class="content">
  5. <video v-if="isPlay" autoplay id="myVideo" src="https://hzstatic.hzinsights.com/static/yb/video/8617330c2a76e0c35999f6466b4470c4.mp4" @ended="handleVideoEnd"></video>
  6. <image class="video-img" @click="playHandler" v-else src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/my_video.png"></image>
  7. <view class="text-introduce">三分钟了解弘则研究体系和方法论</view>
  8. </view>
  9. <view class="my-log">
  10. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/my_log.png"></image>
  11. </view>
  12. </view>
  13. </block>
  14. </template>
  15. <script>
  16. import { Mine } from "@/config/api";
  17. import notHaveLogin from "@/components/notHaveLogin.vue";
  18. export default {
  19. components: { notHaveLogin },
  20. data() {
  21. return {
  22. videoContext: null,
  23. isPlay: false,
  24. };
  25. },
  26. methods: {
  27. // 播放结束退出全屏
  28. handleVideoEnd() {
  29. this.videoContext.exitFullScreen();
  30. },
  31. // 点击了播放
  32. async playHandler() {
  33. this.isPlay = true;
  34. const res = await Mine.addHistory();
  35. },
  36. },
  37. onReady() {
  38. this.videoContext = wx.createVideoContext("myVideo");
  39. },
  40. onShareAppMessage() {
  41. return {
  42. title: "关于我们",
  43. path: "/pageMy/followUs/followUs",
  44. };
  45. },
  46. };
  47. </script>
  48. <style lang="scss" scoped>
  49. .container-follow-us {
  50. padding: 20rpx 10rpx;
  51. background-color: $uni-bg-color;
  52. .content {
  53. background-color: #fff;
  54. }
  55. .video-img {
  56. width: 100%;
  57. height: 340rpx;
  58. }
  59. video {
  60. width: 100%;
  61. height: 340rpx;
  62. }
  63. .text-introduce {
  64. color: #333333;
  65. font-weight: 500;
  66. font-size: 28rpx;
  67. line-height: 39rpx;
  68. text-align: center;
  69. }
  70. .my-log {
  71. width: 100%;
  72. height: 311rpx;
  73. margin-top: 230rpx;
  74. display: flex;
  75. justify-content: center;
  76. image {
  77. width: 303rpx;
  78. height: 311rpx;
  79. }
  80. }
  81. }
  82. </style>