followUs.vue 2.0 KB

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