|
@@ -1,6 +1,10 @@
|
|
|
function PageInit(url,session_id,bridge) {
|
|
|
this.url = url;
|
|
|
this.goodsItems = $('.goods-list .goods-item');
|
|
|
+ this.refreshBtn = $('.refresh-btn');
|
|
|
+ this.detailPopup = $('.detail-popup');
|
|
|
+ this.eggsBtn = $('.eggs-btn');
|
|
|
+ this.close = $('.close');
|
|
|
this.goodsList = [];
|
|
|
this.session_id = session_id;
|
|
|
this.bridge = bridge;
|
|
@@ -10,7 +14,23 @@ function PageInit(url,session_id,bridge) {
|
|
|
this.goodsItems.on('click', function () {
|
|
|
self.result($(this));
|
|
|
});
|
|
|
- this.init();
|
|
|
+ this.refreshBtn.on('click', function () {
|
|
|
+ self.hidePopup();
|
|
|
+ self.refresh();
|
|
|
+ });
|
|
|
+ this.detailPopup.on('touchmove', function (e) {
|
|
|
+ e.preventDefault();
|
|
|
+ });
|
|
|
+ this.eggsBtn.on('click', function () {
|
|
|
+ $('.mysterious-popup, .mysterious').fadeIn();
|
|
|
+ });
|
|
|
+ this.close.on('click', function () {
|
|
|
+ $('.mysterious-popup, .mysterious').fadeOut();
|
|
|
+ });
|
|
|
+ $('.mysterious-popup, .mysterious').on('touchmove', function (e) {
|
|
|
+ e.preventDefault();
|
|
|
+ });
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -26,7 +46,6 @@ PageInit.prototype = {
|
|
|
data: {
|
|
|
act: "festval",
|
|
|
op: "ajax_freeCollection",
|
|
|
- // HPHPSESSID: self.session_id,
|
|
|
client_type: "ajax"
|
|
|
},
|
|
|
success: function (res) {
|
|
@@ -49,7 +68,6 @@ PageInit.prototype = {
|
|
|
data: {
|
|
|
act: "member_bonus",
|
|
|
op: "mine_bonus",
|
|
|
- // HPHPSESSID: self.session_id,
|
|
|
client_type: "ajax"
|
|
|
},
|
|
|
success: function (res) {
|
|
@@ -86,18 +104,29 @@ PageInit.prototype = {
|
|
|
},
|
|
|
result: function (target) {
|
|
|
if (!this.goodsList.length)return;
|
|
|
+ var self = this;
|
|
|
var state = target.attr('data-state');
|
|
|
if (state == 2) {
|
|
|
var id = target.attr('data-id');
|
|
|
- window.location.replace('xmmz://p.lrlz.com/goods/goods?goodsId=' + id);
|
|
|
- this.bridge.call_native_handler('on_native_click', '{"action":"back"}', function (data) {});
|
|
|
+ window.location.href = 'xmmz://p.lrlz.com/goods/goods?goodsId=' + id;
|
|
|
+ setTimeout(function() {
|
|
|
+ self.showPopup();
|
|
|
+ }, 10);
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
else if (state == 3) {
|
|
|
- window.location.replace('xmmz://p.lrlz.com/invite/invite');
|
|
|
- this.bridge.call_native_handler('on_native_click', '{"action":"back"}', function (data) {});
|
|
|
+ window.location.href = 'xmmz://p.lrlz.com/invite/invite';
|
|
|
return;
|
|
|
}
|
|
|
+ },
|
|
|
+ showPopup: function () {
|
|
|
+ $('.detail-popup, .refresh-btn').fadeIn();
|
|
|
+ },
|
|
|
+ hidePopup: function () {
|
|
|
+ $('.detail-popup, .refresh-btn').fadeOut('fast');
|
|
|
+ },
|
|
|
+ refresh: function() {
|
|
|
+ this.init();
|
|
|
}
|
|
|
}
|