followUs.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. async onShow() {
  48. await this.$store.dispatch("checkHandle");
  49. },
  50. onShareAppMessage() {
  51. return {
  52. title: "关于我们",
  53. path: "/pageMy/followUs/followUs",
  54. };
  55. },
  56. };
  57. </script>
  58. <style lang="scss" scoped>
  59. .container-follow-us {
  60. padding: 20rpx 10rpx;
  61. background-color: #f7f7f7;
  62. .content {
  63. background-color: #fff;
  64. }
  65. .video-img {
  66. width: 100%;
  67. height: 340rpx;
  68. }
  69. video {
  70. width: 100%;
  71. height: 340rpx;
  72. }
  73. .text-introduce {
  74. color: #333333;
  75. font-weight: 500;
  76. font-size: 28rpx;
  77. line-height: 39rpx;
  78. text-align: center;
  79. }
  80. .my-log {
  81. width: 100%;
  82. height: 311rpx;
  83. margin-top: 230rpx;
  84. display: flex;
  85. justify-content: center;
  86. image {
  87. width: 303rpx;
  88. height: 311rpx;
  89. }
  90. }
  91. }
  92. </style>