themes1.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view :class="[AppTheme]" class="all_box" v-if="thflag==1">
  3. <!-- 中间预览区域 -->
  4. <view v-for="(vdc, index) in tasks" :key="index">
  5. <load-component ref="ldcomponent" :vdc="vdc" :uikey="vdc.component_key"
  6. :template="vdc.template_name || 'template1'">
  7. </load-component>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import Vue from 'vue'
  13. // 组件加载主体
  14. import loadComponent from '@/components/ui-component-load/index.vue';
  15. export default {
  16. name: "themes1",
  17. props: ['primary2', 'thflag'],
  18. components: {
  19. loadComponent
  20. },
  21. data() {
  22. return {
  23. primary: this.$theme.primary,
  24. ifhavehead: false,
  25. tasks: []
  26. }
  27. },
  28. methods: {
  29. init() {
  30. let that = this;
  31. let config = that.$until.myCache(that.$cache_config_info_key);
  32. if (!config) {
  33. if (res && res.pagecfg) {
  34. that.pagecfg = res.pagecfg;
  35. that.pageinfo = res.pagecfg.page_info;
  36. that.tasks = res.pagecfg.datas
  37. }
  38. } else {
  39. that.pagecfg = config.pagecfg;
  40. that.pageinfo = config.pagecfg.page_info;
  41. that.tasks = config.pagecfg.datas
  42. }
  43. that.onload();
  44. },
  45. onload() {
  46. let that = this
  47. let slideshow = null;
  48. if (that.$refs.ldcomponent) {
  49. that.$refs.ldcomponent.forEach(item => {
  50. if (item.$refs.slideshow) {
  51. slideshow = item;
  52. }
  53. })
  54. if (slideshow) {
  55. slideshow.init();
  56. }
  57. }
  58. },
  59. toBottom(type) {
  60. let that = this
  61. let goodlist = null;
  62. if (that.$refs.ldcomponent) {
  63. that.$refs.ldcomponent.forEach(item => {
  64. if (item.$refs.goodlist) {
  65. goodlist = item;
  66. }
  67. })
  68. if (goodlist) {
  69. goodlist.toBottom(type);
  70. }
  71. }
  72. },
  73. }
  74. }
  75. </script>