|
@@ -4,7 +4,7 @@
|
|
|
<drawerPage :show="drawer.show ? 'left' : ''">
|
|
|
<view class="container_main" slot="links">
|
|
|
<block v-if="login">
|
|
|
- <swiper class="swiper" @change="change" :circular="swiper.circular" :current="index">
|
|
|
+ <swiper class="swiper" @change="change" :circular="swiper.circular" :current="fetch.index">
|
|
|
<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" @scrolltolower="bottomCall">
|
|
|
<dream ref="dream" @showDrawer="showDrawer" :index="k" :item="v" :control="control" :bottom="bottom" class="item"></dream>
|
|
@@ -13,37 +13,42 @@
|
|
|
</swiper>
|
|
|
</block>
|
|
|
<block v-if="!login">
|
|
|
- <dream ref="dream" @showDrawer="showDrawer" :index="index" :item="fetch.items[index]" :control="control" :bottom="bottom" class="item"></dream>
|
|
|
+ <dream ref="dream" @showDrawer="showDrawer" :index="fetch.index" :item="fetch.items[fetch.index]" :control="control" :bottom="bottom" class="item"></dream>
|
|
|
</block>
|
|
|
</view>
|
|
|
</drawerPage>
|
|
|
|
|
|
|
|
|
- <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">
|
|
|
<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" @getCate="getCate"></cate>
|
|
|
+ <cate ref="cate" @goIndex="goIndex" :index="fetch.index" :content_id="content_id" :code="code" :width="v.width" :param="v.param" :page_id="fetch.page_id" @getCate="getCate"></cate>
|
|
|
</block>
|
|
|
|
|
|
<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="fetch.index" :content_id="content_id" :code="code" :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>
|
|
|
+ <times ref="times" @goIndex="goIndex" :index="fetch.index" :content_id="content_id" :code="code" :width="v.width" :param="v.param" :times="fetch.times_id" @getTimes="getTimes"></times>
|
|
|
+ </block>
|
|
|
+
|
|
|
+ <block v-if="k == 'shop'">
|
|
|
+ <shop ref="shop" @goIndex="goIndex" :index="fetch.index" :content_id="content_id" :code="code" :width="v.width" :param="v.param"></shop>
|
|
|
</block>
|
|
|
</view>
|
|
|
</drawerWindow>
|
|
|
|
|
|
<y-Fab v-if="!drawer.show && fetch.user.avatar && login" :bottom="20" :right="20" :btnList="drawer.button" @click="clickDrawerButton" :text="`P`+(swiper.index+1)" :icon_o="fetch.user.avatar"></y-Fab>
|
|
|
- <y-Fab v-if="!login" :bottom="20" :right="20" @click="goHome" :text="`P`+(swiper.index+1)"></y-Fab>
|
|
|
+ <y-Fab v-if="!login" :bottom="20" :right="20" @click="goHome" :text="`首页`"></y-Fab>
|
|
|
</view>
|
|
|
</gracePage>
|
|
|
</template>
|
|
|
<script>
|
|
|
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 times from "@/pages/dream/func/times.vue";
|
|
|
+import shop from "@/pages/dream/func/shop.vue";
|
|
|
import dream from "@/pages/dream/view/dream.vue";
|
|
|
import drawerPage from "@/lib/dever/components/drawerPage.vue";
|
|
|
import drawerWindow from "@/lib/dever/components/drawerWindow.vue";
|
|
@@ -51,22 +56,21 @@ var graceRichText = require("@/lib/graceUI/jsTools/richText.js");
|
|
|
export default{
|
|
|
data() {
|
|
|
return {
|
|
|
- id : 1,
|
|
|
- page_id : 1,
|
|
|
- index : 0,
|
|
|
content_id : 0,
|
|
|
- times : 0,
|
|
|
- login : false,
|
|
|
+ login : false,
|
|
|
+ code : '',
|
|
|
swiper : {
|
|
|
index : 0,
|
|
|
circular : false,
|
|
|
},
|
|
|
fetch: {
|
|
|
items : [],
|
|
|
- user : {},
|
|
|
+ user : {},
|
|
|
+ index : 0,
|
|
|
info_id : 0,
|
|
|
page_id : 0,
|
|
|
- parent_page_id : 0,
|
|
|
+ parent_page_id : 0,
|
|
|
+ times_id : 0,
|
|
|
},
|
|
|
control : {},
|
|
|
bottom : {},
|
|
@@ -114,13 +118,8 @@ export default{
|
|
|
}
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
- this.login = true;
|
|
|
- this.id = option.id;
|
|
|
- this.page_id = option.page_id;
|
|
|
- this.index = option.index;
|
|
|
- this.times = option.times;
|
|
|
- this.Dever.data('page_id', this.page_id);
|
|
|
- this.Dever.data('times', this.times);
|
|
|
+ this.login = true;
|
|
|
+ this.code = option.code;
|
|
|
this.getData();
|
|
|
},
|
|
|
// 重新加载
|
|
@@ -139,7 +138,8 @@ export default{
|
|
|
}
|
|
|
},
|
|
|
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});
|
|
|
+ var content_id = this.fetch.items[this.swiper.index].id;
|
|
|
+ this.Dever.post('app/collection/?l=api.record', {noloading:1, code:this.code, index: this.swiper.index, content_id: content_id});
|
|
|
},
|
|
|
change : function(e) {
|
|
|
this.swiper.index = e.detail.current;
|
|
@@ -175,30 +175,30 @@ export default{
|
|
|
},
|
|
|
getData : function() {
|
|
|
var self = this;
|
|
|
- self.drawer.item = {};
|
|
|
- //this.record();
|
|
|
- this.Dever.get(this, 'app/collection/?l=api.getContent', {id:this.id, page_id:this.page_id}, function(t) {
|
|
|
+ self.drawer.item = {};
|
|
|
+ this.Dever.get(this, 'app/collection/?l=api.getContent', {code:this.code}, function(t) {
|
|
|
+ self.record();
|
|
|
if (t && t['func']) {
|
|
|
self.drawer.item = t['func'];
|
|
|
self.initDrawer();
|
|
|
if (t['func']['cate']) {
|
|
|
- self.getCate(t);
|
|
|
+ self.getCate();
|
|
|
}
|
|
|
if (t['func']['times']) {
|
|
|
- self.getTimes(t);
|
|
|
+ self.getTimes();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- getCate : function(info) {
|
|
|
+ getCate : function() {
|
|
|
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, times:this.times,noloading:1}, function(t) {
|
|
|
+ this.Dever.get(this, 'app/collection/?l=api.category', {code:this.code,noloading:1}, function(t) {
|
|
|
self.drawer.item['cate'].param = t;
|
|
|
});
|
|
|
},
|
|
|
- getTimes : function(info) {
|
|
|
+ getTimes : function() {
|
|
|
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) {
|
|
|
+ this.Dever.get(this, 'app/collection/?l=api.times', {code:this.code,noloading:1}, function(t) {
|
|
|
if (t && t.times && t.times.length > 0) {
|
|
|
self.drawer.item['times'].param = t;
|
|
|
} else {
|
|
@@ -208,7 +208,7 @@ export default{
|
|
|
});
|
|
|
},
|
|
|
goIndex : function(index) {
|
|
|
- this.index = index;
|
|
|
+ this.fetch.index = index;
|
|
|
if (this.drawer.show) {
|
|
|
this.closeDrawer(this.drawer.show);
|
|
|
}
|
|
@@ -231,10 +231,13 @@ export default{
|
|
|
},
|
|
|
clickDrawerButton : function(e) {
|
|
|
this.showDrawer(this.drawer.button[e.index].key);
|
|
|
+ },
|
|
|
+ goHome : function() {
|
|
|
+ this.Dever.location('dream/index?id='+this.fetch.info_id);
|
|
|
}
|
|
|
},
|
|
|
components:{
|
|
|
- dream,cate,community,times,drawerPage,drawerWindow
|
|
|
+ dream,cate,community,times,shop,drawerPage,drawerWindow
|
|
|
}
|
|
|
}
|
|
|
</script>
|