| xqd
@@ -12,6 +12,7 @@ Page({
|
|
|
hide: "hide",
|
|
|
show: !1,
|
|
|
animationData: {},
|
|
|
+ show_video: null,
|
|
|
tabList: [{
|
|
|
tab: 'video',
|
|
|
title: '视频'
|
| xqd
@@ -21,20 +22,27 @@ Page({
|
|
|
}],
|
|
|
selectedTab: 'video',
|
|
|
},
|
|
|
- onLoad: function (a) {
|
|
|
+ onLoad: function(a) {
|
|
|
// app.pageOnLoad(this);
|
|
|
this.loadMoreGoodsList('both');
|
|
|
},
|
|
|
- swiperTab: function (e) {
|
|
|
+ swiperTab: function(e) {
|
|
|
var that = this;
|
|
|
// console.log(e);
|
|
|
that.setData({
|
|
|
selectedTab: e.detail.currentItemId
|
|
|
});
|
|
|
},
|
|
|
- clickTab: function (e) {
|
|
|
+ clickTab: function(e) {
|
|
|
var that = this;
|
|
|
// console.log(e)
|
|
|
+ if (e.target.dataset.current != 'video') {
|
|
|
+ this.setData({
|
|
|
+ show_video: null,
|
|
|
+ show: !0
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
if (this.data.selectedTab === e.target.dataset.current) {
|
|
|
return false;
|
|
|
} else {
|
| xqd
@@ -43,14 +51,21 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- onReady: function () { },
|
|
|
- onShow: function () {
|
|
|
+ onReady: function() {},
|
|
|
+ onShow: function() {
|
|
|
// app.pageOnShow(this);
|
|
|
},
|
|
|
- onHide: function () { },
|
|
|
- onUnload: function () { },
|
|
|
- onPullDownRefresh: function () { },
|
|
|
- loadMoreGoodsList: function (tab) {
|
|
|
+ onHide: function() {
|
|
|
+ var context = wx.createVideoContext("video_" + this.data.show_video)
|
|
|
+ context.stop()
|
|
|
+ this.setData({
|
|
|
+ show_video: null,
|
|
|
+ show: !0
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onUnload: function() {},
|
|
|
+ onPullDownRefresh: function() {},
|
|
|
+ loadMoreGoodsList: function(tab) {
|
|
|
var tab = tab || this.data.selectedTab;
|
|
|
var o = this;
|
|
|
// if (!is_loading_more) {
|
| xqd
@@ -159,18 +174,18 @@ Page({
|
|
|
// });
|
|
|
// }
|
|
|
},
|
|
|
- play: function (a) {
|
|
|
+ play: function(a) {
|
|
|
var t = a.currentTarget.dataset.index;
|
|
|
wx.createVideoContext("video_" + this.data.show_video).pause(), this.setData({
|
|
|
show_video: t,
|
|
|
show: !0
|
|
|
});
|
|
|
},
|
|
|
- onReachBottom: function () {
|
|
|
+ onReachBottom: function() {
|
|
|
this.loadMoreGoodsList();
|
|
|
// is_no_more || this.loadMoreGoodsList();
|
|
|
},
|
|
|
- more: function (a) {
|
|
|
+ more: function(a) {
|
|
|
var t = this,
|
|
|
o = a.target.dataset.index,
|
|
|
i = t.data.video_list,
|
| xqd
@@ -180,11 +195,11 @@ Page({
|
|
|
});
|
|
|
this.animation = e, -1 != i[o].show ? (e.rotate(0).step(), i[o].show = -1) : (e.rotate(0).step(),
|
|
|
i[o].show = 0), t.setData({
|
|
|
- video_list: i,
|
|
|
- animationData: this.animation.export()
|
|
|
- });
|
|
|
+ video_list: i,
|
|
|
+ animationData: this.animation.export()
|
|
|
+ });
|
|
|
},
|
|
|
- redirectToArticle: function (e) {
|
|
|
+ redirectToArticle: function(e) {
|
|
|
let id = e.currentTarget.dataset.id;
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/article-detail/index?id=' + id
|