|
@@ -5,8 +5,8 @@
|
|
<view class="container_main" slot="links">
|
|
<view class="container_main" slot="links">
|
|
<swiper class="swiper" @change="change" :circular="swiper.circular" :current="index">
|
|
<swiper class="swiper" @change="change" :circular="swiper.circular" :current="index">
|
|
<swiper-item v-for="(v, k) in fetch.items" v-if="v.data" :key="k" >
|
|
<swiper-item v-for="(v, k) in fetch.items" v-if="v.data" :key="k" >
|
|
- <scroll-view scroll-y="true" scroll-x="true" class="scroll-height">
|
|
|
|
- <dream ref="dream" @showDrawer="showDrawer" :index="k" :item="v" :control="control" class="item"></dream>
|
|
|
|
|
|
+ <scroll-view scroll-y="true" scroll-x="true" class="scroll-height" @scrolltolower="bottomCall">
|
|
|
|
+ <dream ref="dream" @showDrawer="showDrawer" :index="k" :item="v" :control="control" :bottom="bottom" class="item"></dream>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</swiper-item>
|
|
</swiper-item>
|
|
</swiper>
|
|
</swiper>
|
|
@@ -16,11 +16,15 @@
|
|
<drawerWindow v-for="(v, k) in drawer.item" :key="k" :show="v.show" :zIndex="v.index" padding="v.padding" :top="v.top" direction="v.direction" :width="v.width" v-on:closeDrawer="closeDrawer(k)">
|
|
<drawerWindow v-for="(v, k) in drawer.item" :key="k" :show="v.show" :zIndex="v.index" padding="v.padding" :top="v.top" direction="v.direction" :width="v.width" v-on:closeDrawer="closeDrawer(k)">
|
|
<view slot="links">
|
|
<view slot="links">
|
|
<block v-if="k == 'cate'">
|
|
<block v-if="k == 'cate'">
|
|
- <cate ref="cate" @goIndex="goIndex" :index="index" :content_id="content_id" :info_id="fetch.info_id" :page_id="fetch.page_id" :parent_page_id="fetch.parent_page_id" :width="v.width" :param="v.param"></cate>
|
|
|
|
|
|
+ <cate ref="cate" @goIndex="goIndex" :index="index" :content_id="content_id" :info_id="fetch.info_id" :page_id="fetch.page_id" :parent_page_id="fetch.parent_page_id" :width="v.width" :param="v.param" @getCate="getCate"></cate>
|
|
</block>
|
|
</block>
|
|
|
|
|
|
<block v-if="k == 'community'">
|
|
<block v-if="k == 'community'">
|
|
<community ref="community" @goIndex="goIndex" :index="index" :content_id="content_id" :info_id="fetch.info_id" :page_id="fetch.page_id" :parent_page_id="fetch.parent_page_id" :width="v.width" :param="v.param"></community>
|
|
<community ref="community" @goIndex="goIndex" :index="index" :content_id="content_id" :info_id="fetch.info_id" :page_id="fetch.page_id" :parent_page_id="fetch.parent_page_id" :width="v.width" :param="v.param"></community>
|
|
|
|
+ </block>
|
|
|
|
+
|
|
|
|
+ <block v-if="k == 'times'">
|
|
|
|
+ <times ref="times" @goIndex="goIndex" :index="index" :content_id="content_id" :info_id="fetch.info_id" :page_id="fetch.page_id" :parent_page_id="fetch.parent_page_id" :width="v.width" :param="v.param" :times="times" @getTimes="getTimes"></times>
|
|
</block>
|
|
</block>
|
|
</view>
|
|
</view>
|
|
</drawerWindow>
|
|
</drawerWindow>
|
|
@@ -30,8 +34,9 @@
|
|
</gracePage>
|
|
</gracePage>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
-import cate from "@/pages/dream/view/cate.vue";
|
|
|
|
-import community from "@/pages/dream/view/community.vue";
|
|
|
|
|
|
+import cate from "@/pages/dream/func/cate.vue";
|
|
|
|
+import community from "@/pages/dream/func/community.vue";
|
|
|
|
+import times from "@/pages/dream/func/times.vue";
|
|
import dream from "@/pages/dream/view/dream.vue";
|
|
import dream from "@/pages/dream/view/dream.vue";
|
|
import drawerPage from "@/lib/dever/components/drawerPage.vue";
|
|
import drawerPage from "@/lib/dever/components/drawerPage.vue";
|
|
import drawerWindow from "@/lib/dever/components/drawerWindow.vue";
|
|
import drawerWindow from "@/lib/dever/components/drawerWindow.vue";
|
|
@@ -42,7 +47,8 @@ export default{
|
|
id : 1,
|
|
id : 1,
|
|
page_id : 1,
|
|
page_id : 1,
|
|
index : 0,
|
|
index : 0,
|
|
- content_id : 0,
|
|
|
|
|
|
+ content_id : 0,
|
|
|
|
+ times : 0,
|
|
swiper : {
|
|
swiper : {
|
|
index : 0,
|
|
index : 0,
|
|
circular : false,
|
|
circular : false,
|
|
@@ -54,7 +60,8 @@ export default{
|
|
page_id : 0,
|
|
page_id : 0,
|
|
parent_page_id : 0,
|
|
parent_page_id : 0,
|
|
},
|
|
},
|
|
- control : {},
|
|
|
|
|
|
+ control : {},
|
|
|
|
+ bottom : {},
|
|
drawer : {
|
|
drawer : {
|
|
// 是否显示
|
|
// 是否显示
|
|
show : '',
|
|
show : '',
|
|
@@ -101,24 +108,34 @@ export default{
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
this.id = option.id;
|
|
this.id = option.id;
|
|
this.page_id = option.page_id;
|
|
this.page_id = option.page_id;
|
|
- this.index = option.index;
|
|
|
|
|
|
+ this.index = option.index;
|
|
|
|
+ this.times = option.times;
|
|
|
|
+ this.Dever.data('page_id', this.page_id);
|
|
|
|
+ this.Dever.data('times', this.times);
|
|
this.getData();
|
|
this.getData();
|
|
},
|
|
},
|
|
// 重新加载
|
|
// 重新加载
|
|
onPullDownRefresh: function() {
|
|
onPullDownRefresh: function() {
|
|
if (this.drawer.show && this.drawer.item[this.drawer.show].show == true) {
|
|
if (this.drawer.show && this.drawer.item[this.drawer.show].show == true) {
|
|
- this.$refs[this.drawer.show].getData();
|
|
|
|
|
|
+ this.$refs[this.drawer.show][0].getData();
|
|
} else {
|
|
} else {
|
|
this.getData();
|
|
this.getData();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 触底刷新
|
|
|
|
- onReachBottom: function() {
|
|
|
|
- console.info(222);
|
|
|
|
- },
|
|
|
|
- methods:{
|
|
|
|
|
|
+ methods:{
|
|
|
|
+ // 触底刷新
|
|
|
|
+ bottomCall: function() {
|
|
|
|
+ if (this.bottom && this.bottom[this.swiper.index]) {
|
|
|
|
+ this.bottom[this.swiper.index].getData(2);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ record : function() {
|
|
|
|
+ this.Dever.post('app/collection/?l=api.record', {noloading:1, id:this.id, page_id:this.page_id, times:this.times, index: this.swiper.index});
|
|
|
|
+ },
|
|
change : function(e) {
|
|
change : function(e) {
|
|
- this.swiper.index = e.detail.current;
|
|
|
|
|
|
+ this.swiper.index = e.detail.current;
|
|
|
|
+ //用户记录
|
|
|
|
+ this.record();
|
|
if (this.control) {
|
|
if (this.control) {
|
|
var i = 0;
|
|
var i = 0;
|
|
for (i in this.control) {
|
|
for (i in this.control) {
|
|
@@ -148,7 +165,8 @@ export default{
|
|
},
|
|
},
|
|
getData : function() {
|
|
getData : function() {
|
|
var self = this;
|
|
var self = this;
|
|
- self.drawer.item = {};
|
|
|
|
|
|
+ self.drawer.item = {};
|
|
|
|
+ //this.record();
|
|
this.Dever.get(this, 'app/collection/?l=api.getContent', {id:this.id, page_id:this.page_id}, function(t) {
|
|
this.Dever.get(this, 'app/collection/?l=api.getContent', {id:this.id, page_id:this.page_id}, function(t) {
|
|
if (t && t['func']) {
|
|
if (t && t['func']) {
|
|
self.drawer.item = t['func'];
|
|
self.drawer.item = t['func'];
|
|
@@ -156,14 +174,23 @@ export default{
|
|
if (t['func']['cate']) {
|
|
if (t['func']['cate']) {
|
|
self.getCate(t);
|
|
self.getCate(t);
|
|
}
|
|
}
|
|
|
|
+ if (t['func']['times']) {
|
|
|
|
+ self.getTimes(t);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
getCate : function(info) {
|
|
getCate : function(info) {
|
|
var self = this;
|
|
var self = this;
|
|
- this.Dever.get(this, 'app/collection/?l=api.category', {id:info.info_id, parent_page_id:info.parent_page_id, page_id:info.page_id, noloading:1}, function(t) {
|
|
|
|
|
|
+ this.Dever.get(this, 'app/collection/?l=api.category', {id:info.info_id, parent_page_id:info.parent_page_id, page_id:info.page_id, times:this.times,noloading:1}, function(t) {
|
|
self.drawer.item['cate'].param = t;
|
|
self.drawer.item['cate'].param = t;
|
|
});
|
|
});
|
|
|
|
+ },
|
|
|
|
+ getTimes : function(info) {
|
|
|
|
+ var self = this;
|
|
|
|
+ this.Dever.get(this, 'app/collection/?l=api.times', {id:info.info_id, parent_page_id:info.parent_page_id, page_id:info.page_id, times:this.times,noloading:1}, function(t) {
|
|
|
|
+ self.drawer.item['times'].param = t;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
goIndex : function(index) {
|
|
goIndex : function(index) {
|
|
this.index = index;
|
|
this.index = index;
|
|
@@ -192,7 +219,7 @@ export default{
|
|
}
|
|
}
|
|
},
|
|
},
|
|
components:{
|
|
components:{
|
|
- dream,cate,community,drawerPage,drawerWindow
|
|
|
|
|
|
+ dream,cate,community,times,drawerPage,drawerWindow
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|