|
@@ -24,27 +24,27 @@
|
|
|
<drawerWindow v-for="(v, k) in drawer.item" :key="k" :type="k" :show="v.show" :zIndex="v.index" padding="v.padding" :top="v.top" :direction="v.direction" :width="v.width" v-on:closeDrawer="closeDrawer(k)" v-on:bottomFunc="bottomFunc">
|
|
|
<view slot="links">
|
|
|
<block v-if="k == '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>
|
|
|
+ <cate ref="cate" @goIndex="goIndex" :index="fetch.index" :content_id="content_id" :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="fetch.index" :content_id="content_id" :code="code" :width="v.width" :param="v.param"></community>
|
|
|
+ <community ref="community" @goIndex="goIndex" :index="fetch.index" :content_id="content_id" :width="v.width" :param="v.param"></community>
|
|
|
</block>
|
|
|
|
|
|
<block v-if="k == '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>
|
|
|
+ <times ref="times" @goIndex="goIndex" :index="fetch.index" :content_id="content_id" :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>
|
|
|
+ <shop ref="shop" @goIndex="goIndex" :index="fetch.index" :content_id="content_id" :width="v.width" :param="v.param"></shop>
|
|
|
</block>
|
|
|
|
|
|
<block v-if="k == 'my'">
|
|
|
- <my ref="my" @goIndex="goIndex" :index="fetch.index" :content_id="content_id" :code="code" :width="v.width" :param="v.param"></my>
|
|
|
+ <my ref="my" @goIndex="goIndex" :index="fetch.index" :content_id="content_id" :width="v.width" :param="v.param"></my>
|
|
|
</block>
|
|
|
|
|
|
<block v-if="k == 'share'">
|
|
|
- <share ref="share" @goIndex="goIndex" :index="fetch.index" :content_id="content_id" :code="code" :width="v.width" :param="v.param" :type="type"></share>
|
|
|
+ <share ref="share" @goIndex="goIndex" :index="fetch.index" :content_id="content_id" :width="v.width" :param="v.param" :type="type"></share>
|
|
|
</block>
|
|
|
</view>
|
|
|
</drawerWindow>
|
|
@@ -70,8 +70,7 @@ export default{
|
|
|
return {
|
|
|
content_id : 0,
|
|
|
type : -1,
|
|
|
- login : false,
|
|
|
- code : '',
|
|
|
+ login : false,
|
|
|
swiper : {
|
|
|
index : 0,
|
|
|
circular : false,
|
|
@@ -132,7 +131,7 @@ export default{
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
this.login = true;
|
|
|
- this.code = option.code;
|
|
|
+ this.Dever.config.code = option.code;
|
|
|
this.getData();
|
|
|
},
|
|
|
// 重新加载
|
|
@@ -142,6 +141,9 @@ export default{
|
|
|
} else {
|
|
|
this.getData();
|
|
|
}
|
|
|
+ },
|
|
|
+ onShow : function() {
|
|
|
+ this.controlHandle();
|
|
|
},
|
|
|
methods:{
|
|
|
// 触底刷新
|
|
@@ -158,26 +160,30 @@ export default{
|
|
|
},
|
|
|
record : function() {
|
|
|
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});
|
|
|
+ this.Dever.post('app/collection/?l=api.record', {noloading:1, code:this.Dever.config.code, index: this.swiper.index, content_id: content_id});
|
|
|
+ },
|
|
|
+
|
|
|
+ controlHandle : function() {
|
|
|
+ if (this.control) {
|
|
|
+ var i = 0;
|
|
|
+ for (i in this.control) {
|
|
|
+ if (this.control[i].load) {
|
|
|
+ console.info(i);
|
|
|
+ if (this.swiper.index == i) {
|
|
|
+ console.info('start');
|
|
|
+ this.control[i].start();
|
|
|
+ } else {
|
|
|
+ this.control[i].stop();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
change : function(e) {
|
|
|
this.swiper.index = e.detail.current;
|
|
|
//用户记录
|
|
|
this.record();
|
|
|
- if (this.control) {
|
|
|
- var i = 0;
|
|
|
- for (i in this.control) {
|
|
|
- if (this.control[i].load) {
|
|
|
- console.info(i);
|
|
|
- if (this.swiper.index == i) {
|
|
|
- console.info('start');
|
|
|
- this.control[i].start();
|
|
|
- } else {
|
|
|
- this.control[i].stop();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ this.controlHandle();
|
|
|
if (this.swiper.index >= this.fetch.total) {
|
|
|
|
|
|
}
|
|
@@ -198,7 +204,7 @@ export default{
|
|
|
getData : function() {
|
|
|
var self = this;
|
|
|
self.drawer.item = {};
|
|
|
- this.Dever.get(this, 'app/collection/?l=api.getContent', {code:this.code}, function(t) {
|
|
|
+ this.Dever.get(this, 'app/collection/?l=api.getContent', {code:this.Dever.config.code}, function(t) {
|
|
|
self.record();
|
|
|
if (t && t['func']) {
|
|
|
self.drawer.item = t['func'];
|
|
@@ -214,13 +220,13 @@ export default{
|
|
|
},
|
|
|
getCate : function() {
|
|
|
var self = this;
|
|
|
- this.Dever.get(this, 'app/collection/?l=api.getCategory', {code:this.code,noloading:1}, function(t) {
|
|
|
+ this.Dever.get(this, 'app/collection/?l=api.getCategory', {code:this.Dever.config.code,noloading:1}, function(t) {
|
|
|
self.drawer.item['cate'].param = t;
|
|
|
});
|
|
|
},
|
|
|
getTimes : function() {
|
|
|
var self = this;
|
|
|
- this.Dever.get(this, 'app/collection/?l=api.getTimes', {code:this.code,noloading:1}, function(t) {
|
|
|
+ this.Dever.get(this, 'app/collection/?l=api.getTimes', {code:this.Dever.config.code,noloading:1}, function(t) {
|
|
|
if (t && t.times && t.times.length > 0) {
|
|
|
self.drawer.item['times'].param = t;
|
|
|
} else {
|