Goodslist.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <home-base :show="true" >
  3. <view style="position: absolute;top:0;right:0;left:0;bottom:0" class="scroll-view-wrapper div container" v-if="navHeight == 0">
  4. <home-common-search :value="params.keyword"></home-common-search>
  5. <view class="scroll-view div" style="position:relative;"><goodslist-body></goodslist-body></view>
  6. </view>
  7. <view :style="'position: absolute;top:0;right:0;left:0;bottom:0;padding-top:'+navHeight+'px'" class="scroll-view-wrapper div container" v-else>
  8. <home-common-search :value="params.keyword"></home-common-search>
  9. <view class="scroll-view div" style="position:relative;"><goodslist-body></goodslist-body></view>
  10. </view>
  11. </home-base>
  12. </template>
  13. <script>
  14. import {getFontSize} from '@/util/common'
  15. import HomeBase from '../HomeBase'
  16. import HomeCommonSearch from '../common/HomeCommonSearch'
  17. import GoodslistBody from './GoodslistBody'
  18. export default {
  19. name:'HomeGoodslist',
  20. components:{
  21. HomeBase,
  22. HomeCommonSearch,
  23. GoodslistBody
  24. },
  25. computed:{
  26. fontSize(){
  27. return getFontSize()
  28. },
  29. },
  30. data(){
  31. return {
  32. params: {
  33. keyword: ''
  34. },
  35. navHeight:0
  36. }
  37. },
  38. onLoad: function (option) {
  39. this.keyword=option.keywords ? option.keywords : ''
  40. },
  41. mounted: function() {
  42. // #ifdef MP-WEIXIN
  43. this.navHeight = uni.getMenuButtonBoundingClientRect().top
  44. // #endif
  45. // #ifdef APP-PLUS
  46. this.navHeight = uni.getMenuButtonBoundingClientRect().top
  47. if(uni.getSystemInfoSync().platform === 'android'){
  48. this.navHeight = 50
  49. }
  50. // #endif
  51. },
  52. }
  53. </script>
  54. <style scoped lang="scss">
  55. .scroll-view-wrapper{display: flex;flex-direction: column;}
  56. .scroll-view{flex:1}
  57. </style>