detail.nvue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view>
  3. <wanl-find-play ref="find1Play" :find_id="find_id" :width="windowWidth" :height="windowHeight"
  4. :bottom="windowBottom" :safeBottom="safeBottom" />
  5. <view class="position-top-center padding-lr-bj flex-direction justify-between align-center"
  6. :style="{ height: `${headHeight}px`, paddingTop: `${headTop}px` }" @tap="handleBack">
  7. <text class="icon text-white text-xl">&#xe645;</text>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import wanlFindPlay from './play';
  13. export default {
  14. components: {
  15. wanlFindPlay
  16. },
  17. beforeCreate() {
  18. // #ifdef APP-NVUE
  19. var domModule = weex.requireModule('dom');
  20. domModule.addRule('fontFace', {
  21. fontFamily: 'iconfont',
  22. src: "url('/static/css/font/iconfont.ttf')"
  23. });
  24. // #endif
  25. },
  26. data() {
  27. return {
  28. find_id: 0,
  29. headTop: 0,
  30. headHeight: 0,
  31. windowWidth: 0,
  32. windowHeight: 0,
  33. safeBottom: 0,
  34. windowBottom: 0
  35. };
  36. },
  37. onHide() {
  38. setTimeout(() => {
  39. this.$refs.find1Play.handleVideoPause();
  40. }, 50);
  41. },
  42. onLoad(option) {
  43. this.find_id = option.id;
  44. console.log("option.id", option.id);
  45. const sys = uni.getSystemInfoSync();
  46. this.headTop = sys.statusBarHeight;
  47. this.headHeight = sys.statusBarHeight + uni.upx2px(90);
  48. this.windowWidth = sys.windowWidth;
  49. this.windowHeight = sys.windowHeight;
  50. this.windowBottom = 0;
  51. // #ifdef APP-NVUE
  52. this.windowBottom = sys.windowBottom;
  53. // #endif
  54. this.safeBottom = sys.safeAreaInsets.bottom;
  55. },
  56. methods: {
  57. handleBack() {
  58. uni.navigateBack();
  59. }
  60. }
  61. };
  62. </script>
  63. <style>
  64. @import '@/static/css/common.css';
  65. </style>