'));
renderMiniBar("#xxminibarxx");
}
if (!(repeatTimes > 8)) {
context$1$0.next = 10;
break;
}
$("#xxminibarxx").remove();
return context$1$0.abrupt('return');
case 10:
repeatTimes++;
setTimeout(function () {
renderCon();
}, 500);
context$1$0.next = 16;
break;
case 14:
if (renderDom) {
$(container).eq(0).after($("#xxminibarxx").children());
} else {
renderMiniBar(container);
}
addEvent();
case 16:
case 'end':
return context$1$0.stop();
}
}, null, _this);
};
// 获取页面上的插入节点
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1), __webpack_require__(7)))
/***/ }),
/* 71 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(regeneratorRuntime, $, G, Vue) {
var _this = this;
var timeUtil = __webpack_require__(358);
var template = __webpack_require__(5);
var price_remind = __webpack_require__(21);
var request = __webpack_require__(2);
var userData = __webpack_require__(6);
var log = __webpack_require__(9);
var cnzz = __webpack_require__(4);
var globalTime = undefined,
retry = 0;
var hasGetTime = undefined;
Date.prototype.format = function (fmt) {
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
"S": this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(fmt)) {
fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
}
}
return fmt;
};
// 最接近的半小时时间
// 12:31 -> 12:30
// 12:29 -> 12:30
Date.prototype.toHalfHourTime = function () {
var original = this.getTime();
return new Date(Math.round(original / (30 * 60000)) * (30 * 60000));
};
var userInfo = {};
module.exports.init = function callee$0$0() {
return regeneratorRuntime.async(function callee$0$0$(context$1$0) {
while (1) switch (context$1$0.prev = context$1$0.next) {
case 0:
// let res = await $.ajax({
// url: 'https://www.gwdang.com/user/info',
// dataType: 'jsonp',
// jsonp: 'callback',
// xhrFields: {
// withCredentials: true
// }
// })
getSeckill();
case 1:
case 'end':
return context$1$0.stop();
}
}, null, _this);
};
var seckillRule = {
"360buy": [{
"secDom": "#yuyue-banner",
"timeType": "t11",
"secDom2": "#yuyue-banner .activity-type:contains('预约抢购')",
"secTime": "#yuyue-banner .activity-message .J-time"
}, {
"secDom": "#banner-miaosha",
"timeType": "M月D日H时M分",
"secDom2": "#banner-miaosha .activity-type:contains('秒杀预告')",
"secTime": "#banner-miaosha .activity-price strong"
}, {
"secDom": "#banner-miaosha",
"timeType": "t12",
"secDom2": "#banner-miaosha .activity-type:contains('京东秒杀')",
"secTime": "#banner-miaosha .activity-message"
}, {
"secDom": "#pingou-banner",
"timeType": "t13",
"secDom2": "#pingou-banner .activity-type:contains('预售')",
"secTime": "#pingou-banner .activity-message .J-time"
}, {
"secDom": "#banner-shangou .activity-type:contains('京东闪购')",
//"timeType": "t14",
"timeType": "t12",
"secDom2": "#banner-shangou .activity-message:contains('预计')",
"secTime": "#banner-shangou .activity-message"
}, {
// 预售商品,还没开始付定金
"secDom": "#pingou-banner .activity-message:contains('距预售还需')",
"timeType": "timeRangeSplitBy`-`",
"secDom2": "#pingou-process dt:contains('支付定金')",
"secTime": "#pingou-process .J-presale-time"
}, {
// 预售商品,使用尾款时间
"secDom": "#pingou-process .J-balance-time",
"timeType": "timeRangeSplitBy`-`",
"secDom2": "#pingou-process dt:contains('支付尾款')",
"secTime": "#pingou-process .J-balance-time"
}, {
// 预售商品,使用尾款时间
"secDom": "#yuyue-process .J-step4",
"timeType": "timeRangeSplitBy`-`",
"secDom2": "#yuyue-process dt:contains('抢购中')",
"secTime": "#yuyue-process .J-step4"
}],
"taobao-ju": [{
"secDom": ".buyaction.J_JuSMSRemind",
"timeType": "t21",
"secDom2": ".ju-clock.J_juItemTimer>p:contains('开抢')",
"secTime": ".ju-clock.J_juItemTimer>p"
}],
"taobao": [{
"secDom": "#J_TaoQiangGou",
"timeType": "t21",
"secDom2": "#J_TaoQiangGou:contains('开始抢购')",
"secTime": "#J_TaoQiangGou"
}],
"tmall": [{
"secDom": "#tm-yushou-process-banner",
"timeType": "t31",
"secDom2": "#tm-yushou-process-banner .tm-yushou-process-title.tm-ys-title-one-row:contains('天猫预售')",
"secTime": "#tm-yushou-process-banner .J_step2Time"
}, {
"secDom": ".tm-countdown .tb-btn-wait:contains('即将开始')",
"timeType": "t32",
"secDom2": ".tm-countdown .tm-countdown-notice:contains('距开售')",
"secTime": ".tm-countdown .tm-countdown-timer"
}],
"suning": [{
"secDom": "#timePanel",
"timeType": "t41",
"secDom2": "#timePanel .djh-title:contains('预定')",
"secTime": "#timePanel .proinfo-cd"
}, {
"secDom": ".snqg-logo",
"timeType": "M月D日 H时M分",
"secDom2": ".djh-cd",
"secTime": "#bigPolyTime"
}, {
"secDom": "#buyTime",
"timeType": "X月X日X时X分X秒",
"secDom2": ".step-4",
"secTime": "#buyTime dd:contains('开始')"
}],
"xiaomi": [{
"secDom": ".pro-time.J_proBook",
"timeType": "t51",
"secDom2": ".pro-time.J_proBook .pro-time-head:contains('预售')",
"secTime": ".pro-time.J_proBook .time.J_bookTime"
}],
"kaola": [{
"secDom": ".m-promotionbar",
"timeType": "t61",
"secDom2": ".m-promotionbar .prelimit .txt:contains('开抢')",
"secTime": ".m-promotionbar .prelimit .txt"
}],
"dangdang": [{
"secDom": "#count-down",
"timeType": "t71",
"secDom2": "#count-down .J-time-text:contains('尚未开始')",
"secTime": "#count-down .J-time"
}],
"vmall": [{
"secDom": "#buyProcessIDD",
"timeType": "t81",
"secDom2": "#buyProcessIDD ul li:first-child:contains('支付订金')",
"secTime": "#startDateIDD"
}]
};
var getSeckillTime = function getSeckillTime(type, ori_str) {
if (ori_str.length < 3) {
return false;
}
var str = undefined;
if (type !== "t81") {
str = ori_str.replace(/\s/g, "");
} else {
str = ori_str;
}
var arr = undefined,
newtime = undefined;
var nowTime = undefined;
var month = undefined,
d = undefined,
h = undefined,
m = undefined,
ss = undefined,
ms = undefined;
var year = new Date().getFullYear();
switch (type) {
case "X月X日X时X分X秒":
arr = ori_str.match(/开始:(\d+)月(\d+)日(\d+)时(\d+)分(\d+)秒/);
if (!arr) return false;
nowTime = new Date();
newtime = nowTime.getFullYear() + '/' + arr[1] + '/' + arr[2] + '/' + arr[3] + ':' + arr[4];
break;
case 'M月D日 H时M分':
arr = ori_str.match(/(\d+)月(\d+)日 (\d+):(\d+)/);
if (!arr) return false;
nowTime = new Date();
newtime = nowTime.getFullYear() + '/' + arr[1] + '/' + arr[2] + '/' + arr[3] + ':' + arr[4];
break;
case 'M月D日H时M分':
arr = ori_str.match(/(\d+)月(\d+)日(\d+):(\d+)/);
if (!arr) return false;
nowTime = new Date();
newtime = nowTime.getFullYear() + '/' + arr[1] + '/' + arr[2] + '/' + arr[3] + ':' + arr[4];
break;
case "timeRangeSplitBy`-`":
// eg: 2019-07-0300:00-2019-07-0700:00
var date = ori_str.split(' ')[0].replace(/-/g, '/');
newtime = date + '/' + ori_str.split(' ')[1].split('-')[0];
break;
case "t11":
nowTime = new Date().getTime();
arr = str.match(/(?:(\d+)|)(?:天|日|)(\d+)小时(\d+)分(\d+)秒/);
if (!arr) return false;
if ($('#yuyue-banner .activity-message .J-text').text() === '抢购剩余') {
return false;
}
if ($('#pingou-banner .activity-message .J-text').text() === '距预售还需') {
return false;
}
d = arr[1] || 0;
h = arr[2] || 0;
m = arr[3] || 0;
ss = arr[4] || 0;
ms = d * 86400000 + h * 3600 * 1000 + m * 60 * 1000 + ss * 1000;
newtime = timeUtil(nowTime + ms, "6");
break;
case "t12":
nowTime = new Date().getTime();
arr = str.match(/预计([0-9:月日]+)开始/);
if (!arr) return false;
var htime = arr[1];
newtime = timeUtil(nowTime, "5");
if (htime.indexOf('日') > -1) {
var _month = htime.split('月')[0];
var day = htime.split('日')[0].split('月')[1];
newtime = newtime.split('/')[0] + ('/' + _month + '/' + day);
htime = htime.split('日')[1];
}
newtime = newtime + '/' + htime;
break;
case "t13":
nowTime = new Date().getTime();
arr = str.match(/(?:(\d+)|)(?:天|日|)(\d+)小?时(\d+)分(\d+)秒/);
if (!arr) return false;
if ($('.activity-message .J-text').text() === '预售剩余') {
return false;
}
d = arr[1] || 0;
h = arr[2] || 0;
m = arr[3] || 0;
ss = arr[4] || 0;
ms = d * 86400000 + h * 3600 * 1000 + m * 60 * 1000 + ss * 1000;
newtime = timeUtil(nowTime + ms, "6");
break;
case "t14":
arr = str.match(/(\d+)月(\d+)日(\d+)\:(\d+)/);
if (!arr) return false;
month = Number(arr[1]) || 0;
if (month < 10) month = "0" + month.toString();
d = Number(arr[2]) || 0;
if (d < 10) d = "0" + d.toString();
h = arr[3] || 0;
m = arr[4] || 0;
// ms = month + d * 86400000 + h * 3600 * 1000 + m * 60 * 1000;
newtime = year + '/' + month + '/' + d + '/' + h + ':' + m;
break;
case "t21":
arr = str.match(/(\d+)月(\d+)日(\d+)\:(\d+)/);
if (!arr) return false;
month = Number(arr[1]) || 0;
if (month < 10) month = "0" + month.toString();
d = Number(arr[2]) || 0;
if (d < 10) d = "0" + d.toString();
h = arr[3] || 0;
m = arr[4] || 0;
// ms = month + d * 86400000 + h * 3600 * 1000 + m * 60 * 1000;
newtime = year + '/' + month + '/' + d + '/' + h + ':' + m;
break;
case "t31":
arr = ori_str.split("~");
if (!arr) return false;
newtime = arr[0].replace(/(?:\.|\s)/g, "/");
break;
case "t32":
nowTime = new Date().getTime();
arr = str.match(/(?:(\d+)|)(?:天|日|)(\d+)小?时(\d+)分/);
if (arr && arr.length) {
d = Number(arr[1]) || 0;
if (d < 10) d = "0" + d.toString();
h = arr[2] || 0;
m = arr[3] || 0;
} else {
arr = str.match(/(\d+)分(\d+)秒/);
d = 0;
h = 0;
m = arr[1];
}
ms = d * 86400000 + h * 3600 * 1000 + m * 60 * 1000;
newtime = timeUtil(nowTime + ms, "6");
break;
case "t41":
//苏宁
nowTime = new Date().getTime();
arr = str.match(/(?:(\d+)|)(?:天|日|)(\d+)小?时(\d+)分([0-9.]+)秒/);
if (!arr) return false;
d = parseInt(arr[1]) || 0;
h = parseInt(arr[2]) || 0;
m = parseInt(arr[3]) || 0;
ss = parseInt(arr[4]) || 0;
ms = d * 86400000 + h * 3600 * 1000 + m * 60 * 1000 + ss * 1000;
newtime = timeUtil(nowTime + ms, "6");
break;
case "t51":
nowTime = new Date().getTime();
arr = str.match(/\s?(?:(\d+)|)\s?(?:天|日|)\s?(\d+)\s?小?时\s?(\d+)\s?分\s?(\d+)\s?秒/);
if (!arr) return false;
d = arr[1] || 0;
h = arr[2] || 0;
m = arr[3] || 0;
ss = arr[4] || 0;
ms = d * 86400000 + h * 3600 * 1000 + m * 60 * 1000 + ss * 1000;
newtime = timeUtil(nowTime + ms, "6");
break;
case "t61":
//kaola
arr = str.match(/(\d+)月(\d+)日(\d+)\:(\d+)/);
if (!arr) return false;
month = Number(arr[1]) || 0;
if (month < 10) month = "0" + month.toString();
d = Number(arr[2]) || 0;
if (d < 10) d = "0" + d.toString();
h = arr[3] || 0;
m = arr[4] || 0;
// ms = month + d * 86400000 + h * 3600 * 1000 + m * 60 * 1000;
newtime = year + '/' + month + '/' + d + '/' + h + ':' + m;
break;
case "t71":
//dangdang
nowTime = new Date().getTime();
arr = str.match(/(?:(\d+)(?:天|日)|)(\d+)时(\d+)分(\d+)秒/);
if (!arr) return;
d = arr[1] || 0;
h = arr[2] || 0;
m = arr[3] || 0;
ss = arr[4] || 0;
ms = d * 86400000 + h * 3600 * 1000 + m * 60 * 1000 + ss * 1000;
newtime = timeUtil(nowTime + ms, "6");
break;
case "t81":
arr = str.split("~");
if (!arr) return;
newtime = arr[1].trim();
newtime = newtime.replace(/[\s\.]/g, "/");
break;
}
return newtime;
};
var getSeckill = function getSeckill() {
var seckillItem = seckillRule[G.site];
if (!seckillItem) return;
for (var i = 0; i < seckillItem.length; i++) {
var sitem = seckillItem[i];
if ($(sitem["secDom"]).length > 0 && $(sitem["secDom2"]).length > 0) {
var newtime = getSeckillTime(sitem["timeType"], $(sitem["secTime"]).text());
if (newtime) {
globalTime = newtime;
//console.log('newtime:', newtime)
var strTime = newtime.split('/');
var d = new Date(strTime[0] + '/' + strTime[1] + '/' + strTime[2] + ' ' + strTime[3]);
if (d.getTime() - new Date().getTime() < 300000) {
continue;
}
renderSeckill();
break;
}
}
}
if (!globalTime && retry < 5) {
retry++;
setTimeout(getSeckill, 500);
}
};
var needLog = false;
var renderSeckill = function renderSeckill() {
var res, html, CommonLogin, dp_query, currentStatus;
return regeneratorRuntime.async(function renderSeckill$(context$1$0) {
while (1) switch (context$1$0.prev = context$1$0.next) {
case 0:
context$1$0.next = 2;
return regeneratorRuntime.awrap(request.get('https://www.gwdang.com/user/info'));
case 2:
res = context$1$0.sent;
userInfo = res.data;
html = __webpack_require__(359);
$('#gwd_mini_remind').remove();
$('#gwd_mini_compare').after(template.compile(html)({
email: G.email,
extName: 'gwdang',
url: encodeURIComponent(location.href)
}));
CommonLogin = __webpack_require__(35)['default'];
new Vue({
el: '#gwd-bjd-login-box',
render: function render(h) {
return h(CommonLogin, {
props: {
position: 'gwd-mini',
showAlterLogin: true,
alterLoginPosition: 'row'
}
});
}
});
// 获取当前提醒状态
dp_query = userData.get('dp_query');
context$1$0.next = 12;
return regeneratorRuntime.awrap(request.get(G.c_server + '/brwext/remind_intime?opt=get&id=' + dp_query.dp.dp_id));
case 12:
currentStatus = context$1$0.sent;
addEvent();
if (currentStatus.msg === "未收藏" || currentStatus.msg === "用户未登录") {
log('detected:seckillRemind');
cnzz.log('抢购提醒', '监测到页面抢购');
needLog = true;
SeckillSetState(false);
} else {
SeckillSetState(true);
}
case 15:
case 'end':
return context$1$0.stop();
}
}, null, _this);
};
var secKillState = undefined;
var SeckillSetState = function SeckillSetState(state) {
secKillState = state;
if (state) {
$('.sk-remind-btn').hide();
if (userInfo.wx == "1") {
$('.sk-remind-state1').show();
} else {
$('.sk-remind-state1').hide();
}
$('#gwd_mini_seckill').addClass('seckillSet');
$('#gwd_mini_seckill .minibar-btn-box>span').text("已设抢购提醒");
if (needLog) {}
} else {
//$('.sk-remind-btn').hide()
}
};
var socketSet = false;
var showedOnce = false; // 抢购提醒是否展示过一次
var addEvent = function addEvent() {
price_remind.getQRcode();
window.refQRCode = price_remind.getQRcode;
$('#gwd_mini_seckill').on('mouseenter', function () {
if (G.email) {
$('.seckill-detail').show();
$('.seckill-detail').css('width', '205px');
if (!socketSet && userInfo.wx == "0") {
// 未绑定微信的情况,不显示提醒按钮
// 同时打开websocket
log('notBind:seckillRemind');
cnzz.log('抢购提醒', '未绑定');
$('.sk-remind-state0').show();
if (!secKillState) {
$('.sk-remind-state1').hide();
}
$('.sk-remind-btn').hide();
renderWebsocket();
}
if (needLog) {
if ($('.sk-remind-btn').css('display') !== 'none') {
if (!showedOnce) {
log('showButton:seckillRemind');
cnzz.log('抢购提醒', '显示设置提醒按钮');
}
}
}
showedOnce = true;
} else {
$('.login-detail').show();
}
});
$('#gwd_mini_seckill').on('mouseleave', function () {
$('.seckill-common-detail').hide();
});
$('.sk-remind-btn').on('click', function callee$1$0() {
var dp, time, title, res;
return regeneratorRuntime.async(function callee$1$0$(context$2$0) {
while (1) switch (context$2$0.prev = context$2$0.next) {
case 0:
log('click:seckillRemind');
cnzz.log('抢购提醒', '设置按钮点击');
dp = userData.get('dp_query');
time = new Date(globalTime).toHalfHourTime().format("yyyy-MM-dd hh:mm:ss");
title = G.dp.name.replace(' ', '');
context$2$0.next = 7;
return regeneratorRuntime.awrap(request.get(G.c_server + '/brwext/remind_intime?opt=add&id=' + dp.dp.dp_id + '&title=' + encodeURIComponent(title) + '&stime=' + time + '&url=' + encodeURIComponent(location.href)));
case 7:
res = context$2$0.sent;
if (res.code === 1 || res.msg === '重复收藏') {
if (res.code === 1) {
log('setComplete:seckillRemind');
cnzz.log('抢购提醒', '设置成功');
}
SeckillSetState(true);
}
case 9:
case 'end':
return context$2$0.stop();
}
}, null, _this);
});
//price_remind.init()
$('#loginClickBtn').on('click', function () {
var userN = $('.bjd-login-box .username').val();
var psd = $('.bjd-login-box .password').val();
if (userN && psd) {
price_remind.loginRenderTop();
__webpack_require__(29).userLogin(userN, psd, function () {
location.reload();
});
} else {
$('#login_remind_tle').css('display', 'block').fadeOut(5000);
return;
}
});
};
var heartInterval = 0;
var renderWebsocket = function renderWebsocket() {
// $.ajax({
// url: 'https://www.gwdang.com/user/info',
// xhrFields: {
// withCredentials: true
// },
// //crossDomain: true
// })
var socket = new WebSocket("wss://www.gwdang.com/sck");
socket.onopen = function () {};
socket.onmessage = function (evt) {
var res = JSON.parse(evt.data);
if (res.msg == "Bind") {
userInfo.wx = "1";
$('.sk-remind-state0').hide();
if (secKillState) {
$('.sk-remind-state1').show();
} else {
$('.sk-remind-btn').show();
}
if (needLog) {
cnzz.log('抢购提醒', '用户已绑定');
log('userBindComplete:seckillRemind');
}
window.clearInterval(heartInterval);
socket.close();
}
};
socket.onclose = function () {};
socket.addEventListener('open', function callee$1$0(evt) {
var accountInfo;
return regeneratorRuntime.async(function callee$1$0$(context$2$0) {
while (1) switch (context$2$0.prev = context$2$0.next) {
case 0:
socketSet = true;
accountInfo = {
action: 'bindWechatExt',
msg: {
uid: userInfo.uid
}
};
socket.send(JSON.stringify(accountInfo));
heartInterval = setInterval(function () {
socket.send('{"ping": "pong"}');
}, 10000);
case 4:
case 'end':
return context$2$0.stop();
}
}, null, this);
});
};
module.exports.getNewTime = function () {
hasGetTime = true;
return globalTime;
};
//return
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7), __webpack_require__(1), __webpack_require__(0), __webpack_require__(15)["default"]))
/***/ }),
/* 72 */,
/* 73 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__QrError_vue_vue_type_template_id_29b33b2e_scoped_true___ = __webpack_require__(405);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__QrError_vue_vue_type_script_lang_js___ = __webpack_require__(158);
/* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_1__QrError_vue_vue_type_script_lang_js___) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_1__QrError_vue_vue_type_script_lang_js___[key]; }) }(__WEBPACK_IMPORT_KEY__));
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__QrError_vue_vue_type_style_index_0_id_29b33b2e_scoped_true_lang_less___ = __webpack_require__(407);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__node_modules_15_9_3_vue_loader_lib_runtime_componentNormalizer_js__ = __webpack_require__(12);
/* normalize component */
var component = Object(__WEBPACK_IMPORTED_MODULE_3__node_modules_15_9_3_vue_loader_lib_runtime_componentNormalizer_js__["a" /* default */])(
__WEBPACK_IMPORTED_MODULE_1__QrError_vue_vue_type_script_lang_js___["default"],
__WEBPACK_IMPORTED_MODULE_0__QrError_vue_vue_type_template_id_29b33b2e_scoped_true___["a" /* render */],
__WEBPACK_IMPORTED_MODULE_0__QrError_vue_vue_type_template_id_29b33b2e_scoped_true___["b" /* staticRenderFns */],
false,
null,
"29b33b2e",
null
)
/* hot reload */
if (false) {
var api = require("/Users/huangdie/work-gwdang/extension/browser/dev/node_modules/.2.3.4@vue-hot-reload-api/dist/index.js")
api.install(require('vue'))
if (api.compatible) {
module.hot.accept()
if (!api.isRecorded('29b33b2e')) {
api.createRecord('29b33b2e', component.options)
} else {
api.reload('29b33b2e', component.options)
}
module.hot.accept("./QrError.vue?vue&type=template&id=29b33b2e&scoped=true&", function () {
api.rerender('29b33b2e', {
render: render,
staticRenderFns: staticRenderFns
})
})
}
}
component.options.__file = "src/common/components/QrError.vue"
/* harmony default export */ __webpack_exports__["default"] = (component.exports);
/***/ }),
/* 74 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G) {
var getQRCode = __webpack_require__(30);
module.exports = {
data: function data() {
return {
qrcode: '',
error: false,
logged: false,
loading: false,
site: location.hostname.indexOf('.jd.com') > -1 ? 'jd' : 'taobao'
};
},
methods: {
goLink: function goLink() {
if (this.qr) return;
__webpack_require__(4).log(this.site + 'GiftMoney:click');
if (this.url) {
window.open(this.url);
}
},
over: function over() {
var _this = this;
if (!this.qr) return;
if (this.qrcode) return;
if (this.loading) return;
this.loading = true;
var payload = {
id: G && G.dp ? G.dp.itemId : this.id,
amount: this.value,
title: '',
_type: 'rebate'
};
if (this.price) {
payload.price = this.price;
payload.tip = this.price;
}
if (this.tag) {
payload._tag = this.tag;
}
getQRCode(payload, '', function (res) {
if (res[0].etag) {
_this.error = true;
return;
} else {
_this.error = false;
}
_this.qrcode = res[0].imgSrc;
if (!_this.logged) {
__webpack_require__(4).log(_this.site + 'GiftMoney:hover');
__webpack_require__(4).log(_this.site + 'GiftMoney:-hover');
if (_this.oldPatch) {
__webpack_require__(4).log(_this.site + 'GiftMoney:hover-oldPatch');
}
_this.logged = true;
}
});
}
}
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 75 */
/***/ (function(module, exports) {
module.exports = "
\n
\n当前商品领券立减 \n¥ {{price}} \n \n{{if picUrl && isShowPic}}\n\n
\n\n
{{ useTaobao? '淘宝': '微信' }}扫码领券 \n
\n{{/if}}\n\n{{if isShowPic}}\n\n{{else}}\n\n{{/if}}\n{{if isBottom}}\n\n{{else}}\n\n{{/if}}\n\n\n{{if useTaobao}}\n\n{{/if}}\n "
/***/ }),
/* 76 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G, $) {
var callbacks = undefined,
hasreq = undefined,
urls = undefined;
var request = __webpack_require__(2);
var getPageInfo = function getPageInfo(info, callback) {
var infoObj = {};
if (hasreq) {
callbacks = callback;
urls = info.click_url;
return;
}
var itemId = G.dp.itemId;
if (!itemId && G.site === 'taobao-ju') {
itemId = location.href.match(/item_id=(\d+)/)[1];
}
var obj = {
itemNumId: itemId
};
var url = 'https://acs.m.taobao.com/h5/mtop.taobao.detail.getdetail/6.0/?data=' + encodeURIComponent(JSON.stringify(obj));
request.getPure(url).done(function (data) {
try {
var item = data.data.item;
var seller = data.data.seller;
var item2 = JSON.parse(data.data.apiStack[0].value);
infoObj.title = item.title;
infoObj.picUrl = item.images[0];
infoObj.shopName = seller.shopName;
infoObj.shopLogo = seller.shopIcon;
infoObj.shopUrl = seller.shopUrl;
infoObj.biz30Day = item2.item.sellCount;
infoObj.discountPrice = (Number(item2.skuCore.sku2info['0'].price.priceMoney) / 100).toFixed(2);
} catch (e) {
console.error(e);
}
if (!infoObj.title) {
infoObj.title = document.title;
}
if (!infoObj.title) {
infoObj.title = $('.tb-detail-hd > h1').text().trim();
}
if (!infoObj.picUrl) {
infoObj.picUrl = $('#J_ImgBooth').attr('src');
}
if (!infoObj.discountPrice) {
infoObj.discountPrice = G.dp.price;
}
infoObj.id = itemId;
infoObj.amount = info.coupon.coupon_money;
infoObj.effectiveStartTime = info.coupon.start_time;
infoObj.effectiveEndTime = info.coupon.end_time;
infoObj.pid = info.pid;
infoObj.tkl = info.tkl;
infoObj.tmall = location.host.indexOf('tmall') > -1 ? true : false;
if (G.site === 'taobao-ju') {
infoObj.shopName = $('.sellername:eq(0)').text();
}
callback(infoObj, info.click_url);
//console.log(infoObj)
if (callbacks) {
callbacks(infoObj, urls);
}
});
};
module.exports = getPageInfo;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1)))
/***/ }),
/* 77 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G) {//添加基本的参数配置和函数
var protocol = location.protocol === 'https:' ? 'https:' : 'http:';
G.extend({
/** 接口请求的服务器端地址 */
server: 'https://browser.gwdang.com',
/** 购物党网站地址 */
c_server: 'https://www.gwdang.com',
/** 静态文件地址 */
s_server: protocol + '//cdn.gwdang.com',
v_server: 'http://v.gwdang.com',
u_server: 'https://u.gwdang.com',
u_server2: 'https://u.gwdang.com', //避免冲突
u_house: protocol + '//api.lufangjia.com',
tj_server: protocol + '//v.gwdang.com',
specialUnion: protocol + "//u.smartlinkclick.com/union/go/",
img_server: 'http://f67dfe7ee7e63.cdn.sohucs.com',
img64_server: 'http://645568b71d6b6.cdn.sohucs.com',
product_keyword: protocol + '//keyword.gwdang.com',
toMobileUrl: protocol + '//m.gwdang.com',
imgHost: 'https://cdn.gwdang.com/images/',
noImg: protocol + '//cdn.gwdang.com/images/extensions/gwd-noimg.png',
imgLoad: protocol + '//cdn.gwdang.com/images/extensions/newbar/120.gif',
u_key: 'gwdang',
dval: '#tbsb-notifiers',
mbar: 'gwdang-main',
wishdom: 'bjd_plt_bg',
wishdom2: 'gwd_wishlist_div',
p_k: 'pingluntuan12345',
domain: 'browser'
});
if (location.host.indexOf('taobao') > -1 || location.host.indexOf('tmall') > -1 || location.host.indexOf('1688') > -1) {
var str = 'abcdefghijklmnopqrstuvwxyz';
var str2 = '#';
for (var i = 0; i < 8; i++) {
str2 += str[parseInt(Math.random() * 26)];
}
G.dval = str2;
G.wishdom = str2.replace('#', '') + '_bg';
var browserName = navigator.userAgent.toLowerCase();
var safari = /webkit/i.test(browserName) && !(/chrome/i.test(browserName) && /webkit/i.test(browserName) && /mozilla/i.test(browserName));
if (browserName.indexOf('maxthon') > -1 || browserName.indexOf('2345explorer') > -1 || safari) {
G.wishdom2 = 'max_gwd_wishlist_div';
G.mbar = 'max_gwdang-main';
}
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 78 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
//https://github.com/javascript-obfuscator/javascript-obfuscator
Object.defineProperty(exports, '__esModule', {
value: true
});
var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
exports.parseMovementText = parseMovementText;
exports.collectMovement = collectMovement;
exports.packStaticFeatureValue = packStaticFeatureValue;
exports.unpackStaticFeatureValue = unpackStaticFeatureValue;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var DynamicDetails = (function () {
function DynamicDetails() {
_classCallCheck(this, DynamicDetails);
this.touchPosition = {
x: 0,
y: 0
};
this.touchEventTrusted = false;
this.mouseEventCount = 0;
this.mousePosition = {
x: 0,
y: 0
};
this.mouseDownCount = 0;
this.mouseClickPosition = {
x: 0,
y: 0
};
this.mouseEventTrusted = false;
this.keyDownCount = 0;
this.scrollCount = 0;
this.windowBlur = false;
this.windowFocus = false;
this.consoleWindowOpened = false;
this.ip = 0; //webrtc ipv4 address
this.batteryLevel = 127;
this.deviceOrientationExists = false;
this.features = packStaticFeatureValue();
this.checkConsoleLoopHandle = 0;
}
_createClass(DynamicDetails, [{
key: 'touchStartFn',
value: function touchStartFn(e) {
this.touchEventTrusted = e.isTrusted;
this.mouseEventCount++;
var t = e.touches[0];
this.touchPosition.x = t.clientX | 0;
this.touchPosition.y = t.clientY | 0;
}
}, {
key: 'touchMoveFn',
value: function touchMoveFn(e) {
this.touchEventTrusted = e.isTrusted;
this.mouseEventCount++;
}
}, {
key: 'mouseMoveFn',
value: function mouseMoveFn(e) {
this.mouseEventTrusted = e.isTrusted;
this.mouseEventCount++;
}
}, {
key: 'mouseDownFn',
value: function mouseDownFn(e) {
//数值是不是0, 同时移动没有过界,window.outerHeight跟documentElement.clientHeight 或者document.body.clientHeight是否相等
this.mouseEventTrusted = e.isTrusted;
this.mouseEventCount++;
this.mousePosition.x = e.clientX;
this.mousePosition.y = e.clientY;
this.mouseDownCount++;
}
}, {
key: 'mouseClickFn',
value: function mouseClickFn(e) {
this.mouseEventTrusted = e.isTrusted;
this.mouseEventCount++;
this.mouseClickPosition.x = e.clientX;
this.mouseClickPosition.y = e.clientY;
}
}, {
key: 'keyDownFn',
value: function keyDownFn(e) {
this.keyDownCount++;
}
}, {
key: 'scrollFn',
value: function scrollFn(e) {
this.scrollCount++;
}
}, {
key: 'focusFn',
value: function focusFn(e) {
this.windowFocus = true;
this.windowBlur = false;
}
}, {
key: 'blurFn',
value: function blurFn(e) {
this.windowBlur = true;
}
}, {
key: 'devtoolsCb',
value: function devtoolsCb() {
var details = this;
var element = new Image();
Object.defineProperty(element, 'id', {
get: function get() {
details.consoleWindowOpened = true;
clearInterval(details.checkConsoleLoopHandle);
}
});
//console.log('%c', element);
}
}, {
key: 'consoleCheckLoop',
value: function consoleCheckLoop() {
var func = this.devtoolsCb.bind(this);
func();
this.checkConsoleLoopHandle = setInterval(function (e) {
func();
}, 5e3);
}
}, {
key: 'getBatteryStatus',
value: function getBatteryStatus(details) {
if (!navigator.getBattery) {
return;
}
navigator.getBattery().then(function (battery) {
if (battery) {
details.batteryLevel = battery.level * 100 | 0;
}
});
}
}, {
key: 'getDeviceOrientation',
value: function getDeviceOrientation(details) {
function cb(event) {
if (event.gamma) {
details.deviceOrientationExists = true;
}
document.removeEventListener("deviceorientation", cb, false);
}
window.addEventListener('deviceorientation', cb, false);
}
}, {
key: 'getWebRTCIP',
value: function getWebRTCIP(details) {
var t = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
if (!t) details.ip = 0;
var i = {
optional: [{
"RtpDataChannels": !0
}]
};
var r = {
iceServers: [{
urls: "stun:stun.services.mozilla.com"
}],
sdpSemantics: "plan-b"
};
var a = new t(r, i);
setTimeout(function (n) {
try {
a.close();
} catch (t) {}
}, 5e3);
a.onicecandidate = function (t) {
var i = t.candidate;
if (!i) details.ip = 0;
r = extractIPFromWebRTCCandidate(i.candidate);
if (null != r) {
details.ip = r;
}
a.onicecandidate = null;
};
a.createDataChannel("");
a.createOffer().then(function (n) {
a.setLocalDescription(n, function () {}, function () {});
})["catch"](function (t) {
details.ip = 0;
});
}
}, {
key: 'pack',
value: function pack() {
var group1 = this.touchPosition.x + ',' + this.touchPosition.y + ',' + (this.touchEventTrusted ? 1 : 0);
var group2 = this.mouseEventCount + ',' + this.mousePosition.x + ',' + this.mousePosition.y + ',' + this.mouseClickPosition.x + ',' + this.mouseClickPosition.y + ',' + this.mouseDownCount + ',' + (this.mouseEventTrusted ? 1 : 0);
var group3 = this.keyDownCount + ',' + this.scrollCount + ',' + (this.windowBlur ? 1 : 0) + ',' + (this.windowFocus ? 1 : 0);
var group4 = (this.consoleWindowOpened ? 1 : 0) + ',' + numberToHex(this.ip) + ',' + this.batteryLevel + ',' + (this.deviceOrientationExists ? 1 : 0);
var group5 = '' + numberToHex(this.features);
var all = group1 + ';' + group2 + ';' + group3 + ';' + group4 + ';' + group5;
return all;
}
}, {
key: 'encode',
value: function encode() {
return Base64.encode(this.pack());
}
}]);
return DynamicDetails;
})();
exports.DynamicDetails = DynamicDetails;
;
function parseMovementText(text) {
var _text$split = text.split(";");
var _text$split2 = _slicedToArray(_text$split, 5);
var group1 = _text$split2[0];
var group2 = _text$split2[1];
var group3 = _text$split2[2];
var group4 = _text$split2[3];
var group5 = _text$split2[4];
var details = new DynamicDetails();
var _group1$split = group1.split(",");
var _group1$split2 = _slicedToArray(_group1$split, 3);
details.touchPosition.x = _group1$split2[0];
details.touchPosition.y = _group1$split2[1];
details.touchEventTrusted = _group1$split2[2];
details.touchEventTrusted = !!parseInt(details.touchEventTrusted);
var _group2$split = group2.split(",");
var _group2$split2 = _slicedToArray(_group2$split, 7);
details.mouseEventCount = _group2$split2[0];
details.mousePosition.x = _group2$split2[1];
details.mousePosition.y = _group2$split2[2];
details.mouseClickPosition.x = _group2$split2[3];
details.mouseClickPosition.y = _group2$split2[4];
details.mouseDownCount = _group2$split2[5];
details.mouseEventTrusted = _group2$split2[6];
details.mouseEventTrusted = !!parseInt(details.mouseEventTrusted);
var _group3$split = group3.split(",");
var _group3$split2 = _slicedToArray(_group3$split, 4);
details.keyDownCount = _group3$split2[0];
details.scrollCount = _group3$split2[1];
details.windowBlur = _group3$split2[2];
details.windowFocus = _group3$split2[3];
details.windowBlur = !!parseInt(details.windowBlur);
details.windowFocus = !!parseInt(details.windowFocus);
var _group4$split = group4.split(",");
var _group4$split2 = _slicedToArray(_group4$split, 4);
details.consoleWindowOpened = _group4$split2[0];
details.ip = _group4$split2[1];
details.batteryLevel = _group4$split2[2];
details.deviceOrientationExists = _group4$split2[3];
details.consoleWindowOpened = !!parseInt(details.consoleWindowOpened);
details.deviceOrientationExists = !!parseInt(details.deviceOrientationExists);
details.ip = int2ip(parseInt(details.ip, 16));
return [details, group5];
}
function collectMovement(details) {
var b = document.body;
if ("ontouchmove" in document) {
document.addEventListener("touchmove", details.touchMoveFn.bind(details), true);
}
b.addEventListener("touchstart", details.touchStartFn.bind(details), true);
b.addEventListener("mousemove", details.mouseMoveFn.bind(details), true);
b.addEventListener("mousedown", details.mouseDownFn.bind(details), true);
b.addEventListener("click", details.mouseClickFn.bind(details), true);
b.addEventListener("keydown", details.keyDownFn.bind(details), true);
b.addEventListener("wheel", details.scrollFn.bind(details), true);
window.addEventListener("focus", details.focusFn.bind(details), true);
window.addEventListener("blur", details.blurFn.bind(details), true);
details.getWebRTCIP(details);
details.getDeviceOrientation(details);
details.getBatteryStatus(details);
details.consoleCheckLoop();
}
function extractIPFromWebRTCCandidate(n) {
var t = /(\d+)\.(\d+)\.(\d+)\.(\d+)\D/.exec(n);
return t ? (+t[1] << 24 | +t[2] << 16 | +t[3] << 8 | +t[4]) >>> 0 : null;
}
function int2ip(ipInt) {
return (ipInt >>> 24) + '.' + (ipInt >> 16 & 255) + '.' + (ipInt >> 8 & 255) + '.' + (ipInt & 255);
}
function numberToHex(number) {
return parseInt(number).toString(16);
}
function isNativeObject(o) {
return !!/native code/.test(o.toString.toString()) && !!/native code/.test(o.toString());
}
function isPhantomjs() {
var err = "";
try {
null[0]();
} catch (e) {
err = e;
}
return err.stack.indexOf("phantomjs") > -1;
}
function IsSupportWebGL() {
try {
var canvasElement = document.createElement("canvas");
var webglContext = canvasElement.getContext("webgl");
if (webglContext) {
var i = webglContext.getExtension("WEBGL_lose_context");
if (i) {
i.loseContext();
}
}
return !!webglContext;
} catch (e) {
return false;
}
}
function IsSupportLocalStorage() {
try {
localStorage.a = "b";
return localStorage.a === "b";
} catch (e) {
return false;
}
}
var headStyle = document.head.style;
var isChrome = window.chrome !== undefined;
var isIE = ("ActiveXObject" in window);
var hasWeakMap = "WeakMap" in window.WeakMap && new window.WeakMap();
var ua = navigator.userAgent;
//收集立刻能返回的标志, 通过bit set, 打包进一个interger
var checkFunctions = {
_1: function _1() {
//chrome
return isChrome;
},
_2: function _2() {
//firefox
return "mozRTCIceCandidate" in window || "mozInnerScreenY" in window;
},
_3: function _3() {
//safari
return "safari" in window;
},
_4: function _4() {
//IE
return isIE;
},
_5: function _5() {
//IE doesn't support maxHeight
return isIE && !("maxHeight" in headStyle);
},
_6: function _6() {
//IE 8
return isIE && !document.addEventListener;
},
_7: function _7() {
//IE 9
return isIE && !window.atob;
},
_8: function _8() {
//IE >= 10
return isIE && isNativeObject(window.Uint8Array);
},
_9: function _9() {
//IE >= 11
return isIE && hasWeakMap && isNativeObject(window.WeakMap);
},
_10: function _10() {
//chrome
return "Google Inc." === navigator.vendor;
},
_11: function _11() {
//safari
return "Apple Computer, Inc." === navigator.vendor;
},
_12: function _12() {
//chrome headless
return window.innerWidth === 800 && window.innerHeight === 600 && window.outerWidth === 0 && window.outerHeight === 0 || navigator.languages == "" || /Headless/i.test(ua);
},
_13: function _13() {
//phantomjs
return "callPhantom" in window || /PhantomJS/i.test(ua) || isPhantomjs();
},
_14: function _14() {
//python
return (/python/i.test(navigator.appVersion)
);
},
_15: function _15() {
return IsSupportLocalStorage();
},
_16: function _16() {
return (/Maxthon/i.test(navigator.vendor)
);
},
_17: function _17() {
//opera
return "opr" in window || "opera" in window;
},
_18: function _18() {
//chromium based browsers
return isChrome && /BIDUBrowser/i.test(ua);
},
_19: function _19() {
return isChrome && /LBBROWSER/i.test(ua);
},
_20: function _20() {
return isChrome && /QQBrowser/.test(ua);
},
_21: function _21() {
return isChrome && /UBrowser/i.test(ua);
},
_22: function _22() {
return isChrome && /2345Explorer/.test(ua);
},
_23: function _23() {
return isChrome && /TheWorld/.test(ua);
},
_24: function _24() {
//Not Chrome, it's the Edge browser
return isChrome && "MSGesture" in window;
},
_25: function _25() {
return isNativeObject(Object.getOwnPropertyDescriptor) && Object.getOwnPropertyDescriptor(navigator) != undefined;
},
_26: function _26() {
//webdriver
return "$cdc_asdjflasutopfhvcZLmcfl_" in window || navigator.webdriver;
},
_27: function _27() {
//document is hidden
return document.hidden;
},
_28: function _28() {
//chinese
return (/zh-cn/i.test(navigator.language || navigator.systemLanguage)
);
},
_29: function _29() {
//beijing timezone
return -480 === new Date().getTimezoneOffset();
},
_30: function _30() {
return IsSupportWebGL();
},
_31: function _31() {
//document size compare
//IE8 不支持outerWidth, 同时如果成立表示, 没有显示滚动条
return window.outerWidth !== null && (window.outerWidth === document.documentElement.clientWidth || document.body.clientWidth);
}
};
exports.checkFunctions = checkFunctions;
function packStaticFeatureValue() {
var value = 0;
for (var i in checkFunctions) {
var shift = parseInt(i.split("_")[1]) - 1;
var set = 0;
try {
set = checkFunctions[i]() ? 1 : 0;
} catch (e) {}
value |= set << shift;
}
return value;
}
function unpackStaticFeatureValue(value) {
var number = parseInt(value, 16);
var statuses = [];
for (var i = 0; i < 31; i++) {
var _status = (number & 1 << i) > 0;
statuses.push(_status);
}
return statuses;
}
//用js实现, 打乱码表
var Base64 = {
// private property
_keyStr: "ZLHUPIO4tAok06E/caWCmSFfKusy3nrjJRzDTvBgY7wdMlXp82NViGq=+Qheb91x5",
// public method for encoding
encode: function encode(input) {
var output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0;
input = Base64._utf8_encode(input);
while (i < input.length) {
chr1 = input.charCodeAt(i++);
chr2 = input.charCodeAt(i++);
chr3 = input.charCodeAt(i++);
enc1 = chr1 >> 2;
enc2 = (chr1 & 3) << 4 | chr2 >> 4;
enc3 = (chr2 & 15) << 2 | chr3 >> 6;
enc4 = chr3 & 63;
if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
}
output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
}
return output;
},
// public method for decoding
decode: function decode(input) {
var output = "";
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
while (i < input.length) {
enc1 = this._keyStr.indexOf(input.charAt(i++));
enc2 = this._keyStr.indexOf(input.charAt(i++));
enc3 = this._keyStr.indexOf(input.charAt(i++));
enc4 = this._keyStr.indexOf(input.charAt(i++));
chr1 = enc1 << 2 | enc2 >> 4;
chr2 = (enc2 & 15) << 4 | enc3 >> 2;
chr3 = (enc3 & 3) << 6 | enc4;
output = output + String.fromCharCode(chr1);
if (enc3 != 64) {
output = output + String.fromCharCode(chr2);
}
if (enc4 != 64) {
output = output + String.fromCharCode(chr3);
}
}
output = Base64._utf8_decode(output);
return output;
},
// private method for UTF-8 encoding
_utf8_encode: function _utf8_encode(string) {
string = string.replace(/\r\n/g, "\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
utftext += String.fromCharCode(c);
} else if (c > 127 && c < 2048) {
utftext += String.fromCharCode(c >> 6 | 192);
utftext += String.fromCharCode(c & 63 | 128);
} else {
utftext += String.fromCharCode(c >> 12 | 224);
utftext += String.fromCharCode(c >> 6 & 63 | 128);
utftext += String.fromCharCode(c & 63 | 128);
}
}
return utftext;
},
// private method for UTF-8 decoding
_utf8_decode: function _utf8_decode(utftext) {
var string = "";
var i = 0;
var c = 0;
var c2 = 0;
var c3 = 0;
while (i < utftext.length) {
c = utftext.charCodeAt(i);
if (c < 128) {
string += String.fromCharCode(c);
i++;
} else if (c > 191 && c < 224) {
c2 = utftext.charCodeAt(i + 1);
string += String.fromCharCode((c & 31) << 6 | c2 & 63);
i += 2;
} else {
c2 = utftext.charCodeAt(i + 1);
c3 = utftext.charCodeAt(i + 2);
string += String.fromCharCode((c & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
i += 3;
}
}
return string;
}
};
exports.Base64 = Base64;
/***/ }),
/* 79 */,
/* 80 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G) {
var communicate = __webpack_require__(13);
var browsertype = __webpack_require__(203);
var minibrowser = browsertype.getBrowser();
var globalObj = {};
var haslog = undefined;
var renderInfo = function renderInfo(info) {
if (!info) return;
if (!G.site) return;
if (haslog) return;
if (info.type === 'user_extension_id') {
haslog = true;
__webpack_require__(9)('browser_user:' + G.logsite + ':extType:' + getExtType());
}
};
var getExtType = function getExtType() {
var type = '';
if (G.from_device === 'default') type = minibrowser.utype;else type = G.from_device;
return type;
};
module.exports.init = function () {
if (G.userid) {
renderInfo({
type: 'user_extension_id'
});
return;
}
communicate.trigger({
type: 'user_extension_id'
});
communicate.on(function (info) {
try {
if (info && info.type === 'browser_setinfo') {
if (info.value && info.value instanceof Object) {
for (var p in info.value) {
globalObj[p] = info.value[p];
}
}
} else if (info.type) {
globalObj[info.type] = info.value;
renderInfo(info);
}
} catch (e) {}
});
};
module.exports.getInfo = function (type) {
return globalObj[type];
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 81 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G) {
var browser = {
'url': '',
'utype': ''
};
var chromeType = navigator.userAgent.toLowerCase();
module.exports.getBrowser = function () {
if ("ActiveXObject" in window) {
//mozilla/5.0 (compatible; msie 10.0; windows nt 6.1; wow64; trident/6.0; slcc2; .net clr 2.0.50727; .net clr 3.5.30729; .net clr 3.0.30729; .net4.0c; infopath.3; .net4.0e)
browser.url = G.c_server + ('/files/ext/' + G.extName + '_install_IE.exe');
browser.utype = "ie";
browser.utitle = "IE";
browser.background = "-401px -81px";
} else if (chromeType.indexOf('firefox') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64; rv:42.0) gecko/20100101 firefox/42.0
browser.url = "https://addons.mozilla.org/firefox/downloads/latest/405940/addon-405940-latest.xpi?src=dp-btn-primary";
browser.bjgUrl = "https://addons.mozilla.org/zh-CN/firefox/addon/%E6%AF%94%E4%BB%B7%E7%8B%97-%E7%BD%91%E8%B4%AD%E7%9C%81%E9%92%B1%E7%A5%9E%E5%99%A8/?src=search";
browser.utype = "firefox";
browser.utitle = "火狐";
browser.background = "-401px -44px";
} else if (chromeType.indexOf('opera') > -1 || chromeType.indexOf('opr') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/46.0.2490.86 safari/537.36 opr/33.0.1990.115
browser.url = G.c_server + "/files/ext/opera.crx";
browser.utype = "opera";
browser.utitle = "Opera";
browser.background = "-2px -120px";
} else if (chromeType.indexOf('safari') > -1 && chromeType.indexOf('chrome') == -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/534.57.2 (khtml, like gecko) version/5.1.7 safari/534.57.2
browser.url = G.c_server + ('/files/ext/' + G.extName + '.safariextz');
browser.utype = "safari";
browser.utitle = "Safari";
browser.background = "-301px -44px";
} else if (chromeType.indexOf('chrome') > -1) {
var check360 = checkChromeWeight();
if (chromeType.indexOf('qqbrowser') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/45.0.2454.87 safari/537.36 qqbrowser/9.2.5542.400
browser.url = "https://pcbrowser.dd.qq.com/pcbrowserbig/qbextension/update/20160122/jgphnjokjhjlcnnajmfjlacjnjkhleah.crx";
browser.bjgUrl = "https://pcbrowser.dd.qq.com/pcbrowserbig/qbextension/update/20180615/lpmlfjjccfdcnfplffgcmnkaafcigoil.crx";
browser.utype = "qq";
browser.utitle = "QQ";
browser.background = "-104px -81px";
} else if (chromeType.indexOf('maxthon') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) maxthon/4.4.8.1000 chrome/30.0.1599.101 safari/537.36
browser.url = "http://extension.maxthon.cn/detail/index.php?view_id=358";
browser.utype = "maxthon";
browser.utitle = "傲游";
browser.background = "-401px -4px";
} else if (chromeType.indexOf('bidubrowser') > -1) {
//mozilla/5.0 (compatible; msie 10.0; windows nt 6.1; wow64; trident/6.0; bidubrowser 8.1)
browser.url = "http://chajian.baidu.com/2015/#all/39/mcgoibhhihpolaiioggajoipieefgmoa";
browser.utype = 'baidu';
browser.utitle = '百度';
browser.background = "-104px -120px";
} else if (chromeType.indexOf('ubrowser') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/44.0.2403.157 ubrowser/5.5.6743.207 safari/537.36
browser.url = "http://extensions.uc.cn/newindex.htm#!detail/bpdlhpjkjbdiflnankpohpfepecdjgag";
browser.bjgUrl = "https://www.bijiago.com/static/extensions/chrome_bijiago_uc.crx";
browser.utype = 'uc';
browser.utitle = "UC";
browser.background = "-2px -44px";
} else if (chromeType.indexOf('lbbrowser') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/42.0.2311.154 safari/537.36 lbbrowser
browser.url = "http://store.liebao.cn/admin/extensions/201511/ea878d5a4d2a008ad78978a94eea62a1.crx";
browser.utype = 'liebao';
browser.utitle = "猎豹安全";
browser.background = "-301px -4px";
} else if (chromeType.indexOf('taobrowser') > -1) {
//Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.11 TaoBrowser/3.5 Safari/536.11
browser.url = G.c_server + "/files/ext/chrome.crx";
browser.utype = 'taobao';
browser.utitle = "淘宝";
browser.background = "-104px -44px";
} else if (chromeType.indexOf('2345explorer') > -1) {
//Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36 2345Explorer/6.4.0.10356
browser.url = "http://extension.ie.2345.com/#nfbikdkjfjcejddbdcpbafnclkfdhijd";
browser.utype = '2345';
browser.utitle = "2345王牌";
browser.background = "-301px -81px";
} else if (chromeType.indexOf('2345chrome') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/39.0.2171.99 safari/537.36 2345chrome v3.0.0.9739
browser.url = "http://extension.chrome.2345.com/#nfbikdkjfjcejddbdcpbafnclkfdhijd";
browser.utype = '2345jiasu';
browser.utitle = "2345加速";
} else if (chromeType.indexOf('coolnovo') > -1) {
//Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 CoolNovo/2.0.9.20
browser.url = G.c_server + "/files/ext/chrome.crx";
browser.utype = 'fengshu';
browser.utitle = "枫树";
browser.background = "-2px -81px";
} else if (chromeType.indexOf('greenbrowser') > -1) {
//Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; InfoPath.3; .NET4.0E; GreenBrowser)
browser.url = G.c_server + ('/files/ext/' + G.extName + '_for_greenbrowser.zip');
browser.utype = 'gb';
browser.utitle = "GB";
browser.background = "-203px -81px";
} else if (check360 === "Chrome") {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/46.0.2490.80 safari/537.36
browser.url = G.c_server + "/app/extension?from_device=" + G.from_device_num;
browser.bjgUrl = "https://www.bijiago.com/chromeGuide/";
browser.utype = 'chrome';
browser.utitle = 'Chrome';
browser.background = "-2px -4px";
} else if (check360 === "360SE") {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/31.0.1650.63 safari/537.36
browser.url = "https://ext.se.360.cn/webstore/detail/nfbikdkjfjcejddbdcpbafnclkfdhijd";
browser.bjgUrl = "https://ext.se.360.cn/webstore/detail/dikcgfcdhfcmnicjknpmaakimonplclf";
browser.utype = '360se';
browser.utitle = '360安全';
browser.background = "-203px -4px";
} else if (check360 === "360EE") {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/45.0.2454.101 safari/537.36
browser.url = "https://ext.chrome.360.cn/webstore/detail/nfbikdkjfjcejddbdcpbafnclkfdhijd";
browser.bjgUrl = "https://ext.se.360.cn/webstore/detail/dikcgfcdhfcmnicjknpmaakimonplclf";
browser.utype = '360se';
browser.utitle = '360极速 ';
browser.background = "-104px -4px";
} else if (chromeType.indexOf('se') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/38.0.2125.122 safari/537.36 se 2.x metasr 1.0
browser.url = "http://ie.sogou.com/tools/tool_337.html";
browser.bjgUrl = "http://ie.sogou.com/app/s/YXBwXzU5Njc=";
browser.utype = 'sogou';
browser.utitle = "搜狗";
browser.background = "-401px -120px";
} else {
browser.url = G.c_server + "/app/extension";
browser.bjgUrl = "https://www.bijiago.com/chromeGuide/";
browser.utype = 'chrome';
browser.utitle = 'Chromium内核';
}
} else {
browser.url = G.c_server + "/app/extension";
browser.bjgUrl = "https://www.bijiago.com/chromeGuide/";
browser.utype = 'chrome';
browser.utitle = '未知浏览器';
}
return browser;
};
var chrome_weight = {
"result": "Chrome",
"details": {
"Chrome": 5,
"Chromium": 0,
"_360SE": 0,
"_360EE": 0
},
"sorted": ["Chrome", "360SE", "360EE", "Chromium"],
"exec": function exec(results) {
var details = {
"Chrome": 5,
"Chromium": 0,
"_360SE": 0,
"_360EE": 0
};
var _ua = window.navigator.userAgent;
if (/Chrome\/([\d.])+\sSafari\/([\d.])+$/.test(_ua)) {
if (window.navigator.platform == "Win32") {
if (!window.clientInformation.languages) {
details._360SE += 8;
}
if (/zh/i.test(navigator.language)) {
details._360SE += 3;
details._360EE += 3;
}
if (window.clientInformation.languages) {
var lang_len = window.clientInformation.languages.length;
if (lang_len >= 3) {
details.Chrome += 10;
details.Chromium += 6;
} else if (lang_len == 2) {
details.Chrome += 3;
details.Chromium += 6;
details._360EE += 6;
} else if (lang_len == 1) {
details.Chrome += 4;
details.Chromium += 4;
}
}
for (var i in window.navigator.plugins) {
if (window.navigator.plugins[i].filename == "np-mswmp.dll") {
details._360SE += 20;
details._360EE += 20;
}
}
if (Object.keys(window.chrome.webstore).length <= 1) {
details._360SE += 7;
} else if (Object.keys(window.chrome.webstore).length == 2) {
details._360SE += 4;
details.Chromium += 3;
}
if (window.navigator.plugins.length >= 30) {
details._360EE += 7;
details._360SE += 7;
details.Chrome += 7;
} else if (window.navigator.plugins.length < 30 && window.navigator.plugins.length > 10) {
details._360EE += 3;
details._360SE += 3;
details.Chrome += 3;
} else if (window.navigator.plugins.length <= 10) {
details.Chromium += 6;
}
} else {
details._360SE -= 50;
details._360EE -= 50;
if (/Linux/i.test(window.navigator.userAgent)) {
details.Chromium += 5;
}
}
var found = 0;
var respdf = undefined;
for (var i in window.navigator.plugins) {
if (!!(respdf = /^(.+) PDF Viewer$/.exec(window.navigator.plugins[i].name))) {
if (respdf[1] == "Chrome") {
details.Chrome += 6;
details._360SE += 6;
found = 1;
break;
}
if (respdf[1] == "Chromium") {
details.Chromium += 10;
details._360EE += 6;
found = 1;
break;
}
}
}
if (!found) {
details.Chromium += 9;
}
}
var chrome_result = new Object();
chrome_result['Chrome'] = details.Chrome;
chrome_result['Chromium'] = details.Chromium;
chrome_result['360SE'] = details._360SE;
chrome_result['360EE'] = details._360EE;
var sortable = [];
for (var value in chrome_result) {
sortable.push([value, chrome_result[value]]);
}sortable.sort(function (a, b) {
return b[1] - a[1];
});
this.sorted = sortable;
this.details = details;
this.result = sortable[0][0];
if (results == "result") {
return sortable[0][0];
} else if (results == "details") {
return chrome_result;
} else if (results == "sorted") {
return sortable;
}
}
};
var checkChromeWeight = function checkChromeWeight() {
var _ua = window.navigator.userAgent;
try {
chrome_weight.exec();
if (/Chrome\/([\d.])+\sSafari\/([\d.])+$/.test(_ua)) {
return chrome_weight.result;
} else {}
} catch (e) {
return;
}
};
module.exports.getChromeVersion = function () {
var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
return raw ? parseInt(raw[2], 10) : false;
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 82 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var pako = __webpack_require__(221);
module.exports.gZip = function (str) {
return pako.gzip(JSON.stringify(str));
};
module.exports.unGzip = function (str) {
return JSON.parse(pako.ungzip(str));
};
/***/ }),
/* 83 */,
/* 84 */,
/* 85 */,
/* 86 */,
/* 87 */,
/* 88 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G, $) {var __WEBPACK_AMD_DEFINE_RESULT__;/*
* 监控模块,负责监控库存和价格,上报给服务器,需要依赖 库存监控模块 和价格监控模块
* @version:0.0.1
* @author:caoyuanye
* @since:2014-07-30
*/
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
var request = __webpack_require__(2);
var priceParser = __webpack_require__(26);
var detect = __webpack_require__(17);
var userData = __webpack_require__(6);
var priceCheck = __webpack_require__(40),
inventoryCheck = __webpack_require__(41);
return {
timeOut: 5, //监控的最长时间,秒计算
timer: null, //查询库存的计时器
sendTimer: null, //发送计时器,用来确保获取dp_id
inventory: null, //监控到的库存
price: null, //监控到的价格
specialSendFlag: false, //如果是天猫淘宝,就不抓取库存直接运行
hasRun: false,
init: function init() {
if (this.hasRun) {
return;
}
this.hasRun = true;
var $this = this;
$this._setPrice(function () {
$this._setInventory();
$this._trySendMonitorData();
});
},
_trySendMonitorData: function _trySendMonitorData() {
var $this = this;
var trySendTime = 0;
$this.sendTimer = setInterval(function () {
++trySendTime;
if (trySendTime > $this.timeOut || G.save_dp_query != null) {
var other_info = userData.get('other_info');
var dp_id = other_info && other_info.now && other_info.now.dp_id;
$this._sendMonitorData(dp_id);
clearInterval($this.sendTimer);
}
}, 1000);
},
//发送监控到的库存和价格趋势,如果没有抓取到,就把库存默认设定成-2,价格默认设定成0
_sendMonitorData: function _sendMonitorData(dp_id) {
var $this = this;
var spPage = __webpack_require__(56).specialFilter();
if (spPage) return;
if ($this.inventory == null) {
$this.inventory = "-2";
}
if ($this.price == null) {
$this.price = "0";
}
request.get(G.server + "/brwext/monitor?" + 'site=' + G.site + '&subsite_id=' + G.subsite_id + '&dp_id=' + dp_id + '&province_id=' + G.province_id + '&url=' + encodeURIComponent(G.dp.url) + '&price=' + $this.price + "&stock=" + $this.inventory + '&rawurl=' + encodeURIComponent(window.location.href));
},
_setPrice: function _setPrice(callback) {
var that = this;
var siteName = G.site;
var siteId = detect.getSiteId(siteName);
if (!siteId) siteId = 9999;
priceParser.init(siteId, function (price) {
if (price && price > 0) {
that.price = price;
G.dp.oldPrice = price;
} else {
that.price = G.dp.price;
}
if (!that.price) that.price = priceCheck.getOnlinePrice(siteName);
if (siteName == 'taobao' && that.price != '0') {
that.specialSendFlag = true;
}
if (siteName == '360buy') {
// 京东的定金不发
if ($(".itemInfo-wrap:contains('定 金')").length) {
return;
}
}
if (callback) {
callback();
}
});
},
_setInventory: function _setInventory() {
this.inventory = inventoryCheck.init(G.site);
}
};
}).call(exports, __webpack_require__, exports, module),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1)))
/***/ }),
/* 89 */
/***/ (function(module, exports) {
module.exports = "
\n
\n
\n 第 \n 1 \n 页,共\n {{pages}} \n 页\n
\n
\n
\n
\n
\n
\n \n
"
/***/ }),
/* 90 */
/***/ (function(module, exports) {
module.exports = "
\n
\n
\n 第 \n 1 \n 页,共 \n {{pages}} \n 页\n
\n
\n
\n
\n
\n \n
"
/***/ }),
/* 91 */
/***/ (function(module, exports) {
module.exports = "{{each data}}\n
\n \n ¥{{$value.price}} \n {{$value.site_name2 || $value.site_name}} \n
\n \n{{/each}}"
/***/ }),
/* 92 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G, $) {
var template = __webpack_require__(5);
var userData = __webpack_require__(6);
var request = __webpack_require__(2);
var detect = __webpack_require__(17);
var priceParser = __webpack_require__(26);
var nowpage = 0;
var globalPage = undefined;
var time = 0;
var globalDom = undefined;
module.exports.init = function (data, dom) {
if (G.forbidCoupon) return;
globalDom = dom;
var tbData = userData.get('tbData');
time++;
if (tbData.ss === time) {
if (data.tmall.length === 0 && data.taobao.length === 0) {
getHymInfo(render2);
} else {
var siteName = G.site;
var siteId = detect.getSiteId(siteName);
priceParser.init(siteId, function (price) {
if (price && price > 0) {
G.dp.oldPrice = price;
G.dp.price = price;
}
render(data, tbData);
});
}
}
};
var getHymInfo = function getHymInfo(callback) {
if (true) return;
var info = userData.get('other_info');
var url = G.server + '/extension/getCouponTao?keyword=' + encodeURIComponent(info.now.coreword) + '&class_id=' + info['code-server'].class_id + '&brand=' + encodeURIComponent(info.exact_arr.sbrand) + '&sige_id=' + info.now.site_id;
request.get(url).done(function (data) {
if (data && data.data && data.data.length > 0) {
callback(data.data);
}
});
};
var render2 = function render2(data) {
for (var i = 0; i < data.length; i++) {
data[i].click_url = data[i].url;
data[i].promoPri = data[i].currentPrice;
data[i].price = data[i].originPrice;
data[i].coupon_money = data[i].couponInfo;
}
renderBar(data);
};
var render = function render(data, tbData) {
var comarr = [];
if (tbData.tmm && data.tmall.length > 0) {
for (var i = 0; i < tbData.tmall.product.length; i++) {
var itemi = tbData.tmall.product[i];
for (var j = 0; j < data.tmall.length; j++) {
var itemj = data.tmall[j];
if (itemi.num_iid === itemj.reqid) {
itemi.click_url = itemj.click_url;
itemi.click_url2 = itemj.click_url2;
itemi.coupon_money = itemj.coupon.coupon_money;
itemi.sicon = "https://cdn.gwdang.com/images/favicon/83.ico";
itemi.promoPri = (Number(itemi.price) - itemj.coupon.coupon_money).toFixed(2);
if (Number(itemi.promoPri) > G.dp.price) continue;
comarr.push(itemi);
}
}
}
}
if (tbData.tbb && data.taobao.length > 0) {
for (var i = 0; i < tbData.taobao.product.length; i++) {
var itemi = tbData.taobao.product[i];
for (var j = 0; j < data.taobao.length; j++) {
var itemj = data.taobao[j];
if (itemi.num_iid === itemj.reqid) {
itemi.click_url = itemj.click_url;
itemi.click_url2 = itemj.click_url2;
itemi.coupon_money = itemj.coupon.coupon_money;
itemi.sicon = "https://cdn.gwdang.com/images/favicon/123.ico";
itemi.promoPri = (Number(itemi.price) - itemj.coupon.coupon_money).toFixed(2);
if (Number(itemi.promoPri) > G.dp.price) continue;
comarr.push(itemi);
}
}
}
}
renderBar(comarr);
};
var lunbo = function lunbo() {
try {
var dom = $('#miniCouponCom ul');
var _top = Number(dom.css('top').replace('px', ''));
_top = _top - 62;
nowpage++;
if (nowpage === globalPage) {
dom.css('top', '0px');
nowpage = 0;
return;
}
dom.animate({
'top': _top + 'px'
}, 600);
} catch (e) {}
};
var renderBar = function renderBar(data) {
data = data.sort(function (v1, v2) {
if (Number(v1.promoPri) > Number(v2.promoPri)) return 1;else if (Number(v1.promoPri) === Number(v2.promoPri)) return 0;else return -1;
});
globalPage = data.length;
if (globalPage === 0) return;
var html = __webpack_require__(234);
if (location.host.indexOf('detail.ju.taobao') > -1 && G.ss_name === 'priceDog') {
$('.pricedog-bar').before(template.compile(html)({
data: data,
fmdv: G.from_device,
lang: G.lang
}));
$('.botbar').css('margin-top', '150px');
} else {
$(globalDom).append(template.compile(html)({
data: data,
fmdv: G.from_device,
lang: G.lang
}));
}
setInterval(lunbo, 5000);
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1)))
/***/ }),
/* 93 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G) {
module.exports.init = function (obj) {
var unionUrl = G.u_server;
var ukey = 'u.' + G.u_key + '.com';
if (typeof obj != 'object') return;
if (obj.url.indexOf(ukey) > -1) return obj.url;
var ext = "";
if (obj.ext) ext = "-" + obj.ext;
if (obj.is_mobile) {
if (obj.isbrowser) return obj.url;else return unionUrl + '/union/go/?site_id=' + obj.site_id + '&target_url=' + encodeURIComponent(obj.url) + '&union=' + obj.union + '&column=' + obj.mod + '-' + obj.dp_id + ext;
} else {
return unionUrl + '/union/go/?site_id=' + obj.site_id + '&target_url=' + encodeURIComponent(obj.url) + '&union=' + obj.union + '&column=' + obj.mod + '-' + obj.dp_id + ext;
}
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 94 */
/***/ (function(module, exports) {
module.exports = "
\n
\n
\n 第 \n 1 \n 页,共 \n {{pages}} \n 页\n
\n
\n
查看全部结果> \n
\n
\n
\n
\n "
/***/ }),
/* 95 */
/***/ (function(module, exports) {
module.exports = "
\n
\n
\n 第 \n 1 \n 页,共 \n {{pages}} \n 页\n
\n
\n
查看全部结果> \n
\n
\n
\n
\n "
/***/ }),
/* 96 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G, $) {
module.exports.init = function (css) {
var imgurl = undefined;
try {
if (G.from_device === 'firefox' || G.localHost && G.from_device !== 'default') {
css = G.localHost + 'css/' + css;
imgurl = G.localHost + 'css/images.css';
} else if (chrome && chrome.extension && (G.from_device === 'chrome' || G.from_device === '2345')) {
css = 'css/' + css;
css = chrome.extension.getURL(css);
imgurl = chrome.extension.getURL('css/images.css');
} else {
css = G.s_server + '/css/brwext/' + css;
imgurl = G.s_server + '/css/brwext/images.css';
}
} catch (e) {
css = G.s_server + '/css/brwext/' + css;
imgurl = G.s_server + '/css/brwext/images.css';
}
$('head').append('
');
$('head').append('
');
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1)))
/***/ }),
/* 97 */
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a \n \n {{if lang == 'en'}}\n \n {{/if}}\n
"
/***/ }),
/* 123 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_5_4_2_babel_loader_index_js_node_modules_1_0_3_if_loader_index_js_ref_4_1_node_modules_15_9_3_vue_loader_lib_index_js_vue_loader_options_PromotionPlan_vue_vue_type_script_lang_js___ = __webpack_require__(124);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_5_4_2_babel_loader_index_js_node_modules_1_0_3_if_loader_index_js_ref_4_1_node_modules_15_9_3_vue_loader_lib_index_js_vue_loader_options_PromotionPlan_vue_vue_type_script_lang_js____default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__node_modules_5_4_2_babel_loader_index_js_node_modules_1_0_3_if_loader_index_js_ref_4_1_node_modules_15_9_3_vue_loader_lib_index_js_vue_loader_options_PromotionPlan_vue_vue_type_script_lang_js___);
/* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__node_modules_5_4_2_babel_loader_index_js_node_modules_1_0_3_if_loader_index_js_ref_4_1_node_modules_15_9_3_vue_loader_lib_index_js_vue_loader_options_PromotionPlan_vue_vue_type_script_lang_js___) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__node_modules_5_4_2_babel_loader_index_js_node_modules_1_0_3_if_loader_index_js_ref_4_1_node_modules_15_9_3_vue_loader_lib_index_js_vue_loader_options_PromotionPlan_vue_vue_type_script_lang_js___[key]; }) }(__WEBPACK_IMPORT_KEY__));
/* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__node_modules_5_4_2_babel_loader_index_js_node_modules_1_0_3_if_loader_index_js_ref_4_1_node_modules_15_9_3_vue_loader_lib_index_js_vue_loader_options_PromotionPlan_vue_vue_type_script_lang_js____default.a);
/***/ }),
/* 124 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G) {//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _MemberCouponMixin = __webpack_require__(109);
var _MemberCouponMixin2 = _interopRequireDefault(_MemberCouponMixin);
exports['default'] = {
mixins: [_MemberCouponMixin2['default']],
props: ['data'],
data: function data() {
return {
G: G
};
},
computed: {},
methods: {
link: function link(u, src) {
if (src.indexOf('//') === 0) {
return u.replace('$URL', encodeURIComponent('https:' + src)).replace('ext_promo_plan', 'promo_calc_plan');
}
return u.replace('$URL', encodeURIComponent(src)).replace('ext_promo_plan', 'promo_calc_all');
}
}
};
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 125 */
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a
// `)
// }
};
function bindDpEvent(area) {
$('body').on('mouseover', 'img', function (e) {
var img = e.target;
if (img.parentElement.getAttribute('data-tip')) return false;
if (img.width > 50 && img.height > 50) {
var parent = img.parentElement;
nowTipDom = parent;
if (G.site === 'taobao' && parent.tagName === 'A' && /^https?:\/\//.test(parent.href)) {
var id = parent.getAttribute('data-nid');
nowPrice = $(parent).parent().parent().parent().next().find('.price strong').text();
addId(img);
if (parent.href.match(/(?:item\.taobao\.com|detail\.tmall\.com)/)) {
nowUrl = parent.href;
} else {
if (!id) return;
nowUrl = 'https://item.taobao.com/item.htm?id=' + id;
}
// 加载小标签
renderTip(parent);
bindDpEvent2(parent);
} else if (parent.tagName === 'A' && /^https?:\/\//.test(parent.href) && siteinfo.isProductPage(parent.href)) {
addId(img);
nowUrl = makeUrl(img, parent.href);
renderTip(parent);
bindDpEvent2(parent);
} else if (parent.parentElement.tagName === 'A' && /^https?:\/\//.test(parent.parentElement.href) && siteinfo.isProductPage(parent.parentElement.href)) {
/*amazon.com有一种情况是 a div img 的结构*/
parent = parent.parentElement;
addId(img);
nowUrl = makeUrl(img, parent.href);
renderTip(parent);
bindDpEvent2(parent);
}
}
});
smallTip2.on('mouseenter', smallTipOnMouseOver);
smallTip.on('mouseleave', function () {
tipDetail.hide();
smallTip.hide();
});
tipDetail.on('mouseleave', function () {
tipDetail.hide();
smallTip.hide();
});
}
function makeUrl(obj, url) {
if (G.crc64) {
return url;
}
switch (pageInfo.siteName) {
case 'suning':
console.log($(obj));
var productId = $(obj).parents('.wrap').find('input.hidenInfo').attr('datapro').split('||')[0];
url = "http://www.suning.com/emall/prd_10052_10051_-7_" + productId + "_.html";
break;
}
return url;
}
function bindDpEvent2(dom) {
var $dom = $(dom);
if ($dom.attr(G.extBrand + '_tip_bind')) return;
$dom.on('mouseleave', dpMouseLeave);
$dom.attr(G.extBrand + '_tip_bind', 1);
}
function smallTipOnMouseOver() {
clearTimeout(time);
smallTip.show();
render();
}
function dpMouseLeave() {
smallTip.hide();
tipDetail.hide();
}
function renderTip(dom) {
smallTip.css('left', getLeft(dom));
smallTip.css('top', getTop(dom));
smallTip.show().css('display', 'inline-block');
}
function addId(obj) {
var id = '';
switch (G.site) {
case 'yihaodian':
var d = $(obj).parent().attr('id').split('_');
if (d) d = d[1];
id = "&id=" + d + '-31';
break;
}
newId = id;
}
// function currencyChange(data) {
// if (!G.currency || !data) return data;
// if (data.store && data.store.length > 0) {
// for (var i = 0; i < data.store.length; i++) {
// var item = data.store[i];
// if (item.price && item.price.match(/\d+/))
// data.store[i].price = '¥' + parseprice(item.price);
// }
// }
// if (data.trend && data.trend.store.length > 0) {
// for (var j = 0; j < data.trend.store[0].data.length; j++) {
// var item2 = data.trend.store[0].data[j];
// data.trend.store[0].data[j][1] = parseprice(item2[1]);
// }
// data.trend.store[0].min_price = parseprice(data.trend.store[0].min_price).toFixed(2);
// data.trend.store[0].max_price = parseprice(data.trend.store[0].max_price).toFixed(2);
// data.trend.store[0].current_price = parseprice(data.trend.store[0].current_price);
// }
// return data;
// }
var yanzhengma = function yanzhengma(url) {
var html = __webpack_require__(461);
tipDetail.empty().append(template.compile(html)({
url: url
}));
tipDetail.css('width', 370);
};
function render() {
tipDetail.html('
');
tipDetail.css('width', 50);
// tipDetail.css('left', getLeft($(smallTip)[0]) + $(smallTip).width())
// tipDetail.css('top', getTop($(smallTip)[0]))
tipDetail.show();
if (!tipResult[nowUrl]) {
var url = G.server + '/brwext/tip_new?days=180&ver=1&site=' + G.site + '&price=' + nowPrice + '&url=' + encodeURIComponent(nowUrl) + newId;
request.get(url).then(function (msg) {
try {
if (msg && msg.now_url) {
nowUrl = msg.now_url;
}
if (msg.is_ban && msg.action && msg.action.method === 'redirect' && msg.action.to) {
yanzhengma(msg.action.to);
return;
}
if (msg.trend.store.length === 0) {
msg = noTrendAddTrendData(msg);
}
// msg = currencyChange(msg); //暂时不转化汇率 使用原始货币 价格走势提示框里面才加人民币提示
if (!msg || msg.trend.store.length === 0) return renderError();
if (msg.trend.store[0].current_price == '0.00') return renderError();
tipResult[nowUrl] = msg;
render2(msg);
} catch (e) {}
})['catch'](function () {
return renderError();
});
} else render2(tipResult[nowUrl]);
}
function render2(msg) {
// 处理数据
processData(msg);
var nostore = undefined;
if (!msg.store || msg.store.length === 0) nostore = true;
var lowestTime = util.getTimeNumber(msg.trend.store[0].min_stamp * 1000);
tipDetail.removeClass('tip-error-info');
if (msg.trend.store[0].max_price === msg.trend.store[0].min_price) {
msg.trend.store[0].nowprice = msg.trend.store[0].min_price;
}
//msg.trend.store[0].price_status = require('bjgou/modules/trend').getPriceStatus(msg.trend.store[0].data).price_status
tipDetail.html(template.compile(viewPriceTip)({
data: msg,
new_extension: G.new_extension,
extName: G.extName,
isAliSite: G.aliSite,
nostore: nostore,
lowestTime: lowestTime,
extBrand: G.extBrand,
isGwd: G.from_device !== 'bijiago'
}));
if (G.aliSite || nostore) {
tipDetail.css('width', 370);
} else {
tipDetail.css('width', 460);
}
if ($(window).width() - getLeft($(smallTip)[0]) - $(smallTip).width() < 460) {
tipDetail.css('left', 0 - $(tipDetail).width() - 3 + 'px');
} else {
tipDetail.css('left', '67px');
}
initMiniTrend(msg.trend, msg.taobaoNoTrend, msg.start);
bindFavorEvent(msg);
}
function bindFavorEvent(data) {
$('#' + G.extBrand + '_price_tip_notify_btn').on('click', function (event) {
event.preventDefault();
$('#' + G.extBrand + '_notify_error').hide();
$('#' + G.extBrand + '_price_tip_notify_btn').text('正在添加......');
request.get(G.c_server + '/collect/aj_add?' + 'dp_id=' + data.dp_id + '&from=tip').done(function (msg) {
if (msg.code == 100 || msg.code <= 0) {
window.location.href = 'http://www.' + G.extName + '.com/user/login?from_url=' + encodeURIComponent(window.location.href);
} else if (msg.code == 1) {
$('#' + G.extBrand + '_price_tip_notify_btn').text('已添加到收藏夹').attr('style', 'float:right;color:#fff;background:#18A0F5;');
} else if (msg.code == 2) {
if ($('#' + G.extBrand + '_price_tip_notify_btn').text() == '正在添加......') {
$('#' + G.extBrand + '_price_tip_notify_btn').text('你已经添加过啦').attr('style', 'float:right;color:#fff;background:#18A0F5;');
}
}
});
});
}
function processData(msg) {
var new_icon_site_ids = [1, 103, 108, 123, 124, 126, 129, 134, 136, 14, 141, 15, 167, 168, 19, 2, 21, 25, 26, 28, 3, 31, 34, 35, 41, 6, 66, 7, 86, 93, 9];
var store = msg.store;
if (store) {
for (var i = store.length - 1; i >= 0; i--) {
store[i].icon_url = store[i].icon_url.replace("browser", "s1");
if (store[i].price.indexOf('¥') > -1) store[i].price = '¥' + Number(store[i].price.replace('¥', '').replace(',', '')).toFixed(2);
var site_id = /\/(\d+)\.ico/.exec(store[i].icon_url);
if (site_id) {
site_id = site_id[1];
if (!G.IE6 && new_icon_site_ids.indexOf(Number(site_id)) > -1) {
store[i].icon_url = store[i].icon_url.replace(/\d+\.ico/, site_id + ".png").replace(/browser\./, "s1.");
}
}
}
}
var status_str = 'pri-t' + msg.trend.store[0].price_status;
msg.trend.store[0].status_tle = priceTle[status_str];
msg.trend.store[0].max_price = Number(msg.trend.store[0].max_price.replace(',', '')).toFixed(2);
msg.trend.store[0].min_price = Number(msg.trend.store[0].min_price.replace(',', '')).toFixed(2);
}
function renderError(data) {
if (data && data.is_ban) {
yanzhengma(data.action.to);
} else {
tipDetail.html('
抱歉,当前商品暂无价格走势~
');
tipDetail.addClass('tip-error-info');
tipDetail.css('width', 220);
tipDetail.show();
}
}
function initMiniTrend(data, taobaoNoTrend, sstart) {
if (G.site == '360buy') {
// 京东上的这个影响图表样式
var p = $('.elevator_fix style');
p.remove();
}
var yAxistext = '';
if (moneyInfo) {
yAxistext = moneyInfo[1];
}
var maxP = Number(data.store[0].max_price);
var maxN = undefined;
if (maxP > 5) {
maxN = parseInt(data.store[0].max_price).toString() || '';
} else {
maxN = Number(data.store[0].max_price).toString() || '';
}
var maxN2 = yAxistext.length * 2;
var maxS1 = parseInt(maxN.length * 5.6);
var maxS2 = parseInt(maxN2 * 5.6);
var maxS = Math.max(maxS1, maxS2);
var chartML = maxS + 8 + 8;
var yAxisY = maxS + 8;
var trend_div = $('#gwd_price_tip_trend');
var obj = {
chart: {
renderTo: 'gwd_price_tip_trend',
type: 'line',
marginTop: 10,
marginLeft: chartML,
marginRight: 15,
marginBottom: 27,
spacing: [0, 0, 0, 0],
events: {
load: function load() {
var xinterval = parseInt((this.xAxis[0].dataMax - this.xAxis[0].dataMin) / 3.9) || 1;
this.xAxis[0].update({
tickInterval: xinterval
});
var lmin = undefined,
lmax = undefined;
lmin = Math.floor(this.yAxis[0].dataMin);
lmax = Math.ceil(this.yAxis[0].dataMax);
var interv2 = Math.pow(10, lmin.toString().length - 2);
var tkinterv = undefined;
if (this.yAxis[0].dataMax < 1) {
lmin = this.yAxis[0].dataMin;
lmax = this.yAxis[0].dataMax;
tkinterv = 0;
} else if (this.yAxis[0].dataMin === this.yAxis[0].dataMax) {
lmin = Math.floor(lmin / interv2) * interv2;
lmax = lmin * 2;
lmin = 0;
tkinterv = parseInt((lmax - lmin) / 2);
} else {
lmin = Math.floor(lmin / interv2) * interv2;
lmax = Math.ceil(lmax / interv2) * interv2;
if (lmin === lmax) {
lmin = lmin - 1;
lmax = lmax + 1;
}
tkinterv = parseInt((lmax - lmin) / 4);
if (lmin + tkinterv < this.yAxis[0].dataMin) {
lmin = lmin + tkinterv;
}
}
var tkinterv2 = Math.pow(10, tkinterv.toString().length - 1);
tkinterv = Math.ceil(tkinterv / tkinterv2) * tkinterv2;
// console.log(lmin, lmax, tkinterv)
this.yAxis[0].update({
min: lmin,
max: lmax,
tickInterval: tkinterv || 1
});
}
}
},
credits: {
enabled: false
},
colors: ['#2f7ed8'],
title: {
text: null
},
xAxis: {
type: 'datetime',
labels: {
rotation: 0,
y: 16,
step: 2,
style: {
fontSize: '10px',
fontFamily: 'Helvetica',
color: '#9D9D9D'
},
align: 'center'
},
dateTimeLabelFormats: {
day: '%m-%e',
week: '%m-%e',
month: '%Y/%m',
year: '%Y/%m'
},
tickLength: 0,
gridLineColor: '#e6e9eb',
lineColor: '#e6e9eb',
minorTickLength: 0,
gridLineWidth: 1
},
yAxis: {
title: {
text: "",
rotation: 0,
y: -20,
x: -13,
align: 'high',
offset: 0,
style: {
fontFamily: 'Microsoft YaHei',
fontSize: '10px',
color: '#969899'
}
},
labels: {
align: 'left',
padding: 4,
x: -yAxisY,
y: 3,
style: {
fontSize: '10px',
fontFamily: 'Helvetica',
color: '#9D9D9D'
},
formatter: function formatter() {
return this.value;
}
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}],
gridLineColor: '#e6e9eb',
lineColor: '#e6e9eb',
tickPixelInterval: 50
},
plotOptions: {
series: {
animation: false,
marker: {
radius: 2
},
enableMouseTracking: true,
states: {
hover: {
enabled: true
}
},
shadow: false
}
},
tooltip: {
xDateFormat: '%Y-%m-%d',
borderColor: "#48BEFE",
useHTML: true,
backgroundColor: 'white',
formatter: function formatter() {
var x = new Date(this.x);
var year = x.getFullYear();
var month = x.getMonth() + 1;
var day = x.getDate();
if (month < 10) month = '0' + month.toString();
if (day < 10) day = '0' + day.toString();
// let format = data.msg.formatted[this.x.toString()];
// let disc = format.discount
// if (disc !== 0)
// disc = '-' + disc.toString() + '%';
if (taobaoNoTrend) {
var nowDate = new Date();
if (x.getMonth() !== nowDate.getMonth() || x.getDate() !== nowDate.getDate()) {
return false;
}
}
var price = undefined;
if (this.y !== 0) price = this.y.toFixed(2);else price = '0';
var price2 = "";
if (moneyInfo) {
price2 = '(¥' + parseprice(price) + ')';
price = moneyInfo[0] + price;
}
var dom = '\n
\n
' + year + '/' + month + '/' + day + '
\n
\n ● \n ' + this.series.name + ' \n ' + price + price2 + ' \n
\n
';
return dom;
}
},
legend: {
enabled: false
},
series: []
};
obj.series[0] = {
visible: true,
name: data.store[0].name,
pointStart: sstart,
pointInterval: 86400000 * 179,
color: "#48BEFE",
lineWidth: 1,
marker: {
enabled: false
},
states: {
enabled: false,
hover: {
lineWidth: 1
}
},
data: []
};
if (taobaoNoTrend) {
obj.series[0].dashStyle = "Dash";
}
if (data.store[0].data.length > 0) {
var store = data.store[0];
var len2 = store.data.length;
var datas = store.data;
if (store.min_stamp * 1000 > parseInt(Date.UTC(data.startY, data.startM, data.startD))) {
obj.series[0].data.push(null);
}
if (taobaoNoTrend) {
for (var j = 0; j < len2; j++) {
obj.series[0].data.push({
y: datas[j][1]
});
}
} else {
obj.series[0].data = data.store[0].data;
}
}
if (taobaoNoTrend) {
obj.series[0].data[1].marker = {
enabled: true,
fillColor: '#5ACFFB',
radius: 2.5,
lineWidth: 0,
symbol: "circle"
};
obj.plotOptions.series.states = {
hover: {
enabled: false
}
};
}
if (moneyInfo) {
obj.yAxis.title.text = moneyInfo[1];
obj.yAxis.title.y = 104;
obj.yAxis.title.x = -(chartML - 6 - maxS2);
}
if ($('#' + obj.chart.renderTo).length) {
new Highcharts.Chart(obj);
}
trend_div.show();
}
return exports;
}).call(exports, __webpack_require__, exports, module),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1), __webpack_require__(47)))
/***/ }),
/* 187 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G, $) {
var request = __webpack_require__(2);
var template = __webpack_require__(5);
var util = __webpack_require__(11);
var userData = __webpack_require__(6);
var pagesite = undefined,
urlArr = undefined,
clickTime = {},
show_ljfqrcode = true;
var ListPattern = {
'lianjia': {
list: '.sellListContent li.clear',
hrefitem: '.info .title a',
insertdom: '.sellListContent li.clear'
},
'maitian': {
list: '.list_wrap li.clearfix',
hrefitem: '.list_title h1 a',
insertdom: '.list_wrap li.clearfix'
},
'lianjia2': {
list: '#js-ershoufangList .m-list>ul>li',
hrefitem: '.prop-title a',
insertdom: '#js-ershoufangList .m-list>ul>li'
},
'ke': {
list: '.sellListContent li.clear',
hrefitem: '.info .title a',
insertdom: '.sellListContent li.clear'
},
'ke2': {
list: '.sellListContent li.clear',
hrefitem: '.info .title a',
insertdom: '.sellListContent li.clear'
},
'5i5j': {
list: '.pListBox .pList>li:has(.listImg)',
hrefitem: 'a',
insertdom: '.pListBox .pList>li'
},
'centanet': {
list: '.section-houselists .house-item',
hrefitem: '.house-title a',
insertdom: '.section-houselists .house-item'
},
'centanet2': {
list: '.result-lists .house-main .house-item',
hrefitem: '.house-title a',
insertdom: '.result-lists .house-main .house-item'
}
};
var dpPattern = {
'lianjia': ['.content>.price', '#topImg+.info>.price'],
'lianjia2': ['.houseInfo', '.maininfo-price'],
'ke': ['.content>.price', '#topImg+.info>.price'],
'ke2': ['.houseInfo', '.maininfo-price'],
'5i5j': ['.housesty'],
'centanet': ['#sidefixedbox .infotop'],
'centanet2': ['.roombase-infor .roombase-price'],
"maitian": ['.home_content .hc_left table tr:first-child', '.home_content .home_infos li:first-child']
};
var siteIdPattern = {
'lianjia': 441,
'5i5j': 442,
'ke': 441,
'maitian': 443,
'centanet': 511
};
var getHouseCode = function getHouseCode() {
var type = pageType();
var housecode = undefined;
if (type == 2) {
var url = location.href;
switch (G.site) {
case 'lianjia':
housecode = url.match(/\/([a-z0-9A-Z]+)\.html/)[1];
break;
case 'ke':
housecode = url.match(/\/([a-z0-9A-Z]+)\.html/)[1];
break;
case 'maitian':
housecode = url.match(/\/esfxq\/([a-z0-9A-Z]+)/)[1];
break;
case '5i5j':
housecode = url.match(/\/([a-z0-9]+)\.html/)[1];
break;
case 'centanet':
housecode = url.match(/\/([a-z0-9]+)\.html/)[1];
break;
}
} else {
var urls = urlArr;
switch (G.site) {
case 'lianjia':
housecode = Array.prototype.map.call(urls, function (e) {
return e.match(/\/([a-z0-9A-Z]+)\.html/)[1];
}).join(',');
break;
case 'ke':
housecode = Array.prototype.map.call(urls, function (e) {
return e.match(/\/([a-z0-9A-Z]+)\.html/)[1];
}).join(',');
break;
case 'maitian':
housecode = Array.prototype.map.call(urls, function (e) {
return e.match(/\/esfxq\/([a-z0-9A-Z]+)/)[1];
}).join(',');
break;
case '5i5j':
housecode = Array.prototype.map.call(urls, function (e) {
return e.match(/\/([a-z0-9]+)\.html/)[1];
}).join(',');
break;
case 'centanet':
housecode = Array.prototype.map.call(urls, function (e) {
return e.match(/\/([a-z0-9]+)\.html/)[1];
}).join(',');
break;
}
}
return housecode;
};
var existRemind = function existRemind() {
var siteId = siteIdPattern[G.site];
if (!siteId) return;
var housecode = getHouseCode();
var url = G.u_house + '/api/house_collection?ac=exist&site_id=' + siteId + '&house_code=' + housecode;
request.get(url).done(function (data) {
if (data && data.exist) {
var list = $('.ht-price-remind');
for (var i = 0; i < list.length; i++) {
var code = list.eq(i).attr('data-id');
if (data.exist[code]) {
list.eq(i).addClass('hasremind');
list.eq(i).find('span').text('已添加提醒');
list.eq(i).attr('data-colid', data.exist[code]);
}
}
}
});
};
var addRemind = function addRemind(code, callback) {
if (clickTime[code] >= 4) {
return;
}
if (!clickTime[code]) {
clickTime[code] = 1;
}
clickTime[code]++;
var siteId = siteIdPattern[G.site];
var url = G.u_house + '/api/house_collection?ac=add&site_id=' + siteId + '&house_code=' + code + '&from_url=' + encodeURIComponent(location.href);
request.get(url).done(function (data) {
if (data && data.msg === '收藏成功') {
callback(data);
} else if (data.msg === '请先登录') {
location.href = data.loginUrl;
}
});
};
var delRemind = function delRemind(id, callback) {
var url = G.u_house + '/api/house_collection?ac=del&collection_id=' + id;
request.get(url).done(function (data) {
if (data && data.msg === '删除成功') {
callback();
}
});
};
var addEvent = function addEvent() {
var time = undefined,
time2 = undefined;
$('.ht-trend-desc, #bdext_minibar .bdext-toptabs').on('mouseenter', function () {
var c = $(this).parent().parent().hasClass('trend-box-1');
if (c) return;
var oldsrc = $(this).parent().next().find('.house-trend-img img').attr('src');
if (!oldsrc) {
var src = $(this).parent().next().find('.house-trend-img img').attr('data-src');
$(this).parent().next().find('.house-trend-img img').attr('src', src);
}
$(this).addClass('mshover');
$(this).parent().next().show();
});
$('.ht-trend-desc, #bdext_minibar .bdext-toptabs').on('mouseleave', function () {
var that = this;
time = setTimeout(function () {
$(that).parent().next().hide();
$(that).removeClass('mshover');
}, 300);
});
$('.houset-detail').on('mouseenter', function () {
clearTimeout(time);
});
$('.houset-detail').on('mouseleave', function () {
$(this).hide();
$('.ht-trend-desc, #bdext_minibar').removeClass('mshover');
});
$('.ht-price-remind').on('click', function () {
var that = this;
var txt = $(this).find('span').text();
var code = $(this).attr('data-id');
if (txt === '降价提醒') {
addRemind(code, function (data) {
$(that).addClass('hasremind');
$(that).find('span').text('已添加提醒');
$(that).attr('data-colid', data.collect_id);
});
} else {
var collect_id = $(this).attr('data-colid');
delRemind(collect_id, function () {
$(that).attr('data-colid', null);
$(that).removeClass('hasremind');
$(that).find('span').text('降价提醒');
});
}
});
$('.ht-price-remind').on('mouseenter', function () {
if (userData.get('show_ljfqrcode') == 0 || !show_ljfqrcode) return;
$(this).parent().parent().find('.ht-wxqrcode').show();
});
$('.ht-price-remind').on('mouseleave', function () {
var that = this;
time2 = setTimeout(function () {
$(that).parent().parent().find('.ht-wxqrcode').hide();
}, 150);
});
$('.ht-wxqrcode').on('mouseenter', function () {
clearTimeout(time2);
});
$('.ht-wxqrcode').on('mouseleave', function () {
$('.ht-wxqrcode').hide();
});
$('.ht-wxqrcode .ht-wx-sp3').on('click', function () {
$('.ht-wxqrcode').hide();
show_ljfqrcode = false;
util.settings('set_show_ljfqrcode', 'show_ljfqrcode', '0');
});
$('body').on('click', function (e) {
var dom = $(e.target);
var communityDom = dom.parent().parent().parent().find('.community-price');
if (dom.hasClass('house-trend-b')) {
communityDom.hide();
dom.parent().find('span').removeClass('trend-choose');
dom.addClass('trend-choose');
} else if (dom.hasClass('community-trend-b')) {
if (communityDom.children().length === 0) {
renderChart(communityDom, function () {
dom.parent().find('span').removeClass('trend-choose');
dom.addClass('trend-choose');
communityDom.show();
});
} else {
dom.parent().find('span').removeClass('trend-choose');
dom.addClass('trend-choose');
communityDom.show();
}
}
});
};
var renderChart = function renderChart(dom, callback) {
var href = dom.attr('data-u');
var id = dom.attr('id');
console.log('renderChart called');
getInfo(href, function (data) {
console.log('data got');
__webpack_require__(462)({
el: id,
msg: data
});
if (callback && data.community) {
callback();
}
});
};
var renderBtn = function renderBtn(data) {
var html = __webpack_require__(188);
if (G.from_device === 'baidu') html = __webpack_require__(189);
var listobj = ListPattern[pagesite];
var list = $(listobj['list']);
for (var i = 0; i < list.length; i++) {
var item = list.eq(i).find(listobj['hrefitem']);
var href = item.attr('href');
if (href.indexOf('http') === -1) href = location.protocol + '//' + location.host + href;
var housecode = undefined;
switch (G.site) {
case 'lianjia':
housecode = href.match(/\/([a-z0-9A-Z]+)\.html/)[1];
break;
case 'ke':
housecode = href.match(/\/([a-z0-9A-Z]+)\.html/)[1];
break;
case '5i5j':
housecode = href.match(/\/([a-z0-9]+)\.html/)[1];
break;
case 'maitian':
housecode = href.match(/\/esfxq\/([a-z0-9A-Z]+)/)[1];
break;
case 'centanet':
housecode = href.match(/\/([a-z0-9]+)\.html/)[1];
break;
}
href = encodeURIComponent(href.replace('.ke.', '.lianjia.'));
if (data.data[href]) {
list.eq(i).append(template.compile(html)({
data: data.data[href],
server: G.server,
s_server: G.s_server,
housecode: housecode
}));
}
}
setTimeout(existRemind, 500);
addEvent();
};
var renderBtnDp = function renderBtnDp(data) {
var housecode = getHouseCode();
var dpdom = undefined;
var dpobj = dpPattern[pagesite];
for (var i = 0; i < dpobj.length; i++) {
if ($(dpobj[i]).length > 0) {
dpdom = dpobj[i];
break;
}
}
var html = __webpack_require__(188);
if (G.from_device === 'baidu') html = __webpack_require__(189);
var href = encodeURIComponent(location.href.replace('.ke.', '.lianjia.'));
$(dpdom).eq(0).after(template.compile(html)({
data: data.data[href],
server: G.server,
s_server: G.s_server,
pagetype: 'dppage',
housecode: housecode
}));
addEvent();
setTimeout(existRemind, 500);
};
var getUrls = function getUrls(type) {
var obj = ListPattern[pagesite];
var hrefdom = obj['list'] + ' ' + obj['hrefitem'];
var host = location.host;
if (host.indexOf('lianjia') > -1 && type === 2) {
return location.href;
} else if (host.indexOf('lianjia') > -1) {
var arr = Array.prototype.map.call($(hrefdom), function (e) {
var href = $(e).attr('href');
return (href.indexOf('http') > -1 ? '' : 'http://' + location.host) + href;
});
urlArr = arr;
return arr.join('||');
}
if (host.indexOf('maitian') > -1 && type === 2) {
return location.href;
} else if (host.indexOf('maitian') > -1) {
var arr = Array.prototype.map.call($(hrefdom), function (e) {
var href = $(e).attr('href');
return (href.indexOf('http') > -1 ? '' : 'http://' + location.host) + href;
});
urlArr = arr;
return arr.join('||');
}
if (host.indexOf('ke') > -1 && type === 2) {
return location.href;
} else if (host.indexOf('ke') > -1) {
var arr = Array.prototype.map.call($(hrefdom), function (e) {
var href = $(e).attr('href');
return (href.indexOf('http') > -1 ? '' : 'http://' + location.host) + href;
});
urlArr = arr;
return arr.join('||');
}
if (host.indexOf('5i5j') > -1 && type === 2) {
return location.href;
} else if (host.indexOf('5i5j') > -1) {
var arr = Array.prototype.map.call($('.pListBox .pList>li .listTit>a'), function (e) {
return location.protocol + '//' + location.host + $(e).attr('href');
});
urlArr = arr;
return arr.join('||');
}
if (host.indexOf('centanet') > -1 && type === 2) {
return location.href;
} else if (host.indexOf('centanet') > -1) {
var arr = Array.prototype.map.call($(hrefdom), function (e) {
return location.protocol + '//' + location.host + $(e).attr('href');
});
urlArr = arr;
return arr.join('||');
}
};
var getInfo = function getInfo(url, callback) {
console.log('getInfo', url);
request.get(url).done(function (data) {
callback(data);
});
};
var pageType = function pageType() {
var url = location.href;
var type = 0;
var site = pagesite;
switch (site) {
case 'lianjia':
if (url.match(/\d+\.html/)) {
type = 2;
} else {
type = 1;
}
break;
case 'maitian':
if (url.match(/esfxq\/\w+/)) {
type = 2;
} else {
type = 1;
}
break;
case 'lianjia2':
if (url.match(/\d+\.html/)) {
type = 2;
} else {
type = 1;
}
break;
case '5i5j':
if (url.match(/(?:exchange|ershoufang)\/\d+\.html/) && $('.big-slide').length > 0) {
type = 2;
} else if (url.match(/(?:exchange|ershoufang)/)) {
type = 1;
}
break;
case 'centanet':
if (url.match(/ershoufang\/[a-z0-9]+\.html/) && $('#picBox').length > 0) {
type = 2;
} else if (url.match(/ershoufang/)) {
type = 1;
}
break;
case 'centanet2':
if (url.match(/ershoufang\/[a-z0-9]+\.html/)) {
type = 2;
} else if (url.match(/ershoufang/)) {
type = 1;
}
break;
case 'ke':
if (url.match(/\d+\.html/)) {
type = 2;
} else {
type = 1;
}
break;
}
return type;
};
var renderStyle = function renderStyle() {
var html = __webpack_require__(463);
$('body').append(template.compile(html)({
s_server: G.s_server,
extBrand: G.extBrand
}));
$('body').addClass('house_' + pagesite);
};
module.exports.init = function () {
pagesite = G.site;
if (pagesite != 'lianjia' && pagesite != '5i5j' && pagesite != 'centanet' && pagesite != 'ke' && pagesite != 'maitian') return;
if (location.host === 'sh.centanet.com') {
pagesite = 'centanet2';
}
var type = pageType();
var urls = getUrls(type);
var url = G.server + '/extension/houseTip?url=' + encodeURIComponent(urls);
if (type === 2) {
getInfo(url, renderBtnDp);
} else {
getInfo(url, renderBtn);
}
renderStyle();
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1)))
/***/ }),
/* 188 */
/***/ (function(module, exports) {
module.exports = "
\n
\n
\n
\n {{data.trendMsg}} \n \n
\n
\n \n 降价提醒 \n
\n
\n
\n
\n
\n
\n
\n
每日成交行情 \n
最新降价房源 \n
\n
扫码关注撸房价
\n
降价提醒你
\n
\n
\n {{if data.maxPrice == data.minPrice}}\n 现价:{{data.maxPrice}}万 \n {{else}}\n 最高价:{{data.maxPrice}}万 \n 最低价:{{data.minPrice}}万 \n {{/if}}\n
\n
\n \n
\n
\n
关注公众号 \n
房源降价实时提醒 \n
\n
不再提示 \n
\n\n
"
/***/ }),
/* 189 */
/***/ (function(module, exports) {
module.exports = "
\n
\n
\n
\n
\n \n {{data.trendMsg}} \n
\n
\n
\n
\n
\n
\n
\n
\n
每日成交行情 \n
房源历史报价 \n
\n
扫码关注撸房价
\n
\n
\n {{if data.maxPrice == data.minPrice}}\n 现价:{{data.maxPrice}}万 \n {{else}}\n 最高价:{{data.maxPrice}}万 \n 最低价:{{data.minPrice}}万 \n {{/if}}\n
\n
\n
"
/***/ }),
/* 190 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function($, G) {
var getCoupon = __webpack_require__(42);
var request = __webpack_require__(2);
var cnzz = __webpack_require__(4);
var log = __webpack_require__(9);
var globalInfo = {},
hasReqId = [];
var randomNum = undefined;
var domPattern = {
'tmall1': {
list: '#J_ItemList>div.product',
dom: '.productImg-wrap',
url: 'a.productImg'
},
'taobao1': {
list: '#mainsrp-itemlist .items .item',
dom: '.pic-box',
listen: '#mainsrp-itemlist',
lschild: '.m-itemlist',
url: 'a.pic-link'
},
'taobao11': {
list: '#listsrp-itemlist div.items .J_ItemListSKUItem',
dom: '.pic-box',
listen: '#listsrp-itemlist',
lschild: '.m-itemlist',
url: 'a.pic-link'
},
'taobao2': {
list: 'ul li',
dom: '.x',
listen: '.m-itemlist',
url: 'a'
},
'taobao3': {
list: '.module-wrap.J_tb_lazyload .pro-list li',
dom: '.x',
listen: '.m-itemlist',
url: 'a.item'
},
'taobao4': {
list: '#list-itemList ul.items li.item',
dom: '.J_ItemMainImgWraper',
listen: '.m-itemlist',
url: 'a.J_AtpLog'
},
'taobao5': {
list: '.module-wrap.J_tb_lazyload ul.items li',
dom: '.x',
listen: '.m-itemlist',
url: '.shopTitle+a.img_url'
},
'taobao6': {
list: '.m-itemList ul.items li.item',
dom: 'span.img-inner',
listen: '#minilist-itemList-1',
lschild: '.m-itemList',
url: '.J_ItemLink'
},
'taobao7': {
list: 'ul li',
dom: '.x',
listen: '',
lschild: '',
url: 'a'
}
};
var getTypes = function getTypes() {
var urlPattern = {
'list\\.tmall\\.com': 'tmall1',
's\\.taobao\\.com': 'taobao1',
'www\\.taobao\\.com/market/': 'taobao2',
'www\\.taobao\\.com/markets/promotion/': 'taobao3',
'www\\.taobao\\.com/markets/amusement/': 'taobao6',
'www\\.taobao\\.com/markets/': 'taobao7',
'list\\.taobao\\.com': 'taobao4'
};
var url = location.href;
for (var i in urlPattern) {
if (url.match(new RegExp(i))) {
return urlPattern[i];
}
}
};
var getQRcode = __webpack_require__(30);
var callbacks = undefined,
hasreq = undefined,
urls = undefined;
var getPageInfo = function getPageInfo(info, callback) {
var infoObj = {};
if (hasreq) {
callbacks = callback;
urls = info.click_url;
return;
}
var itemId = info.itemId;
var obj = {
itemNumId: itemId
};
var url = 'https://acs.m.taobao.com/h5/mtop.taobao.detail.getdetail/6.0/?data=' + encodeURIComponent(JSON.stringify(obj));
request.getPure(url).done(function (data) {
try {
var item = data.data.item;
var seller = data.data.seller;
var item2 = JSON.parse(data.data.apiStack[0].value);
infoObj.title = item.title;
infoObj.picUrl = item.images[0];
infoObj.shopName = seller.shopName;
infoObj.shopLogo = seller.shopIcon;
infoObj.shopUrl = seller.shopUrl;
infoObj.biz30Day = item2.item.sellCount;
infoObj.discountPrice = (Number(item2.skuCore.sku2info['0'].price.priceMoney) / 100).toFixed(2);
} catch (e) {
console.error(e);
}
if (!infoObj.title) {
console.log(obj);
infoObj.title = info.titleGot;
}
if (!infoObj.picUrl) {
infoObj.picUrl = info.imgGot;
}
if (!infoObj.discountPrice) {
infoObj.discountPrice = info.priceGot;
}
infoObj.id = itemId;
infoObj.amount = info.coupon.coupon_money;
infoObj.effectiveStartTime = info.coupon.start_time;
infoObj.effectiveEndTime = info.coupon.end_time;
infoObj.pid = info.pid;
infoObj.tkl = info.tkl;
infoObj.tmall = location.host.indexOf('tmall') > -1 ? true : false;
callback(infoObj, info.click_url);
if (callbacks) {
callbacks(infoObj, urls);
}
});
};
var QRReloader = __webpack_require__(174);
var addQRcode = function addQRcode(id, dom) {
if (hasReqId.indexOf(id) > -1) return;
hasReqId.push(id);
if (!id) return;
var data = globalInfo[id];
data.pid = '10002';
data.itemId = id;
console.log('dom:', dom);
data.priceGot = parseInt($(dom).parents('.item').find('.price').text().replace(/ /g, '').replace('¥', ''));
data.titleGot = $(dom).parents('.item').find('.title').text().replace(/ /g, '').replace(/\n/g, '');
data.imgGot = $(dom).parents('.item').find('.pic img').attr('src');
getPageInfo(data, function (newData, url) {
var id = 'gwd-coupon-' + parseInt(Math.random() * 1000);
var view = '
\n
\n
微信扫码领券 \n
';
$(dom).append(view);
QRReloader.init(newData, url, '#' + id + ' > img', function (newData2) {}, false, false);
});
};
var renderCouponTip = function renderCouponTip(id, parentD, site) {
getCoupon.init(id, '10002', function (data) {
if (!data.data) return;
data = data.data;
data.site = site;
globalInfo[id] = data;
var dom = '
¥' + data.coupon.coupon_money + ' 优惠券 ';
if (randomNum > -1) {
dom = ' ¥' + data.coupon.coupon_money + ' 优惠券 ';
}
$(parentD).append($(dom));
});
};
var listenDom = function listenDom() {
var Timer = undefined,
maxTimes = 0;
var type = getTypes();
var obj = domPattern[type];
if (!obj) return;
var dom = $(obj['listen'])[0];
if (!dom) return;
dom.addEventListener('DOMSubtreeModified', function () {
clearTimeout(Timer);
if (maxTimes > 15) return;
if ($(dom).find(obj['lschild']).attr('c_coupon')) return;
Timer = setTimeout(function () {
maxTimes++;
renderInit();
}, 1000);
}, false);
};
var renderInit = function renderInit() {
// 获取链接形式 不同页面 列表页不同
var type = getTypes();
if (!type) return;
var obj = domPattern[type];
var list = $(obj['list']);
if (type === 'taobao1' && list.length === 0) {
obj = domPattern['taobao11'];
list = $(obj['list']);
}
for (var i = 0; i < list.length; i++) {
var dom = list.eq(i).find(obj['url']);
var href = dom.attr('href');
var site = 'taobao';
if (!href) continue;
if (href.indexOf('detail.tmall.com') > -1) site = 'tmall';
var id = href.match(/[?&]id=(\d+)/) && href.match(/[?&]id=(\d+)/)[1];
if (!id) continue;
var appendDom = list.eq(i).find(obj['dom']);
if (appendDom.length === 0) appendDom = list.eq(i);
renderCouponTip(id, appendDom, site);
}
if (type.indexOf('taobao') > -1) {
$(obj['listen']).find(obj['lschild']).attr('c_coupon', '1');
}
$('body').on('click', function (e) {
if ($(e.target).hasClass('search_coupon_tip')) {
cnzz.log('click:searchcoupon');
log('click:searchcoupon');
}
});
$('body').on('mouseover', function (e) {
if ($(e.target).hasClass('search_coupon_tip')) {
var id = $(e.target).attr('data-id');
if ($(e.target).find('.qr_coupondetail').length === 0 && randomNum > -1) {
cnzz.log('track:searchcoupon');
log('track:searchcoupon');
addQRcode(id, e.target);
}
}
});
};
module.exports.init = function () {
if (G.forbidCoupon) return;
// 360浏览器版本不加载优惠券 不然审核不通过
if (G.from_device === '360') return;
randomNum = parseInt(Math.random() * 100);
renderInit();
setTimeout(function () {
// 监听dom 有更新, 再一次加载优惠券
listenDom();
}, 10000);
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(0)))
/***/ }),
/* 191 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(regeneratorRuntime, G, $) {
var _this = this;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var request = __webpack_require__(2);
var cachedRes = {};
var process = function process(list) {
var result;
return regeneratorRuntime.async(function process$(context$1$0) {
while (1) switch (context$1$0.prev = context$1$0.next) {
case 0:
context$1$0.next = 2;
return regeneratorRuntime.awrap(request.post(G.server + '/extension/CouponMulti', {
ids: list.join(','),
site_id: 3
}, true, false));
case 2:
result = context$1$0.sent;
render(result);
cachedRes = _extends({}, result, cachedRes);
case 5:
case 'end':
return context$1$0.stop();
}
}, null, _this);
};
var render = function render(result) {
Object.keys(result).map(function (key) {
if (result[key]) {
var d = result[key];
if ($('li[data-sku=' + key + '] .p-img .search_coupon_tip').length) {
return;
}
$('li[data-sku=' + key + '] .p-img').append('\n ¥' + d.coupon + ' 优惠券 \n ');
}
});
};
module.exports.init = function callee$0$0() {
var list, url, dom;
return regeneratorRuntime.async(function callee$0$0$(context$1$0) {
while (1) switch (context$1$0.prev = context$1$0.next) {
case 0:
list = $('ul.gl-warp li.gl-item').toArray().map(function (item) {
return item.dataset.sku;
});
process(list);
url = location.href;
dom = $('#J_main')[0];
if (dom) {
context$1$0.next = 6;
break;
}
return context$1$0.abrupt('return');
case 6:
dom.addEventListener('DOMSubtreeModified', function () {
var newList = $('ul.gl-warp li.gl-item').toArray().map(function (item) {
return item.dataset.sku;
});
newList = newList.filter(function (x) {
return list.indexOf(x) === -1;
});
if (newList.length > 0) {
console.log(newList);
process(newList);
list = list.concat(newList);
} else if (location.href !== url) {
setTimeout(function () {
render(cachedRes);
}, 1000);
}
url = location.href;
}, false);
case 7:
case 'end':
return context$1$0.stop();
}
}, null, _this);
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7), __webpack_require__(0), __webpack_require__(1)))
/***/ }),
/* 192 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function($) {
// lazyload图片地址获取
function getLazyLoadImageUrl(lazyloadImage) {
var imgLink;
if (lazyloadImage) {
var lazyloadImageUrl = lazyloadImage.getAttribute("data-ks-lazyload");
if (lazyloadImageUrl && (lazyloadImageUrl.indexOf("//") === 0 || lazyloadImageUrl.indexOf("http") === 0)) {
imgLink = lazyloadImageUrl;
}
}
if (!imgLink) {
imgLink = lazyloadImage.src;
}
if (!imgLink) {
return;
}
if (imgLink.indexOf("//") === 0) {
imgLink = "https:" + imgLink;
}
if (imgLink.indexOf("http") !== 0) {
return;
}
var matchResult = imgLink.match(/.*?\.(jpg|png)/);
if (matchResult) {
return matchResult[0];
} else {
return imgLink;
}
}
function fixReviewCount(reviewText) {
var review = reviewText.match(/[\d\.]+/)[0];
if (reviewText.indexOf("万") > -1) {
review = (parseFloat(review) * 10000).toString();
}
return review;
}
// 在某些页面上需要搜集一些信息发送给服务器端
//tmall.com/search.htm,
//比如https://futianchengjl.tmall.com/search.htm?spm=a1z10.3-b.w4011-18934291793.35.41383b485iqDzl&user_number_id=4149992945&rn=8b19ddff892b06d8de80a6e62a35467b&keyword=%B0%D7%BE%C6&search=y&orderType=newOn_desc&tsearch=y
function getTmallShopListInfo() {
var productList = document.querySelectorAll(".J_TItems > div > .item");
var items = [];
var userId = document.documentElement.innerHTML.match(/userId=(\d+)(;|")/)[1];
var shopName = document.querySelector(".slogo-shopname ").textContent;
for (var i = 0; i < productList.length; i++) {
var product = productList[i];
var pid = product.getAttribute("data-id");
var title = product.querySelector(".item-name").textContent.trim();
var imgLink = getLazyLoadImageUrl(product.querySelector(".photo > a > img"));
var price = product.querySelector(".c-price").textContent;
var review = "";
var sellNumber = "";
try {
review = fixReviewCount(product.querySelector(".rates > div > h4 > a > span ").textContent);
sellNumber = fixReviewCount(product.querySelector(".sale-num").textContent);
} catch (e) {}
var item = {
'category': "",
'img': imgLink,
'nnid': pid,
'price': price,
'review': review,
'sale_num': sellNumber,
'shopId': userId,
'shopname': shopName,
'taobao': false,
'title': title
};
items.push(item);
}
return items;
}
//list.tmall.hk, list.tmall.com
//比如https://list.tmall.com/search_product.htm?spm=a220m.1000858.0.0.1391303aXK4E21&s=120&q=%B0%D7%BE%C6&sort=s&style=g&from=mallfp..pc_1_searchbutton&active=1&smAreaId=320106&type=pc#J_Filter
//https://list.tmall.hk/search_product.htm?spm=a2231.7718719.2014120102.1.25fc12feg41o0n&cat=52792006&auction_tag=71682;&sort=d&acm=lb-zebra-34359-425786.1003.4.536907&style=g&q=%C3%E6%C4%A4&from=tmallhk.list.pc_1_searchbutton&scm=1003.4.lb-zebra-34359-425786.OTHER_1_536907&tmhkmain=1#J_Filter
function getTmallListInfo() {
var productList = document.querySelectorAll(".product");
var items = [];
for (var i = 0; i < productList.length; i++) {
var product = productList[i];
var titleNode = product.querySelector(".productTitle > a");
var title = titleNode.title;
var productUrl = product.querySelector(".productImg-wrap > a").href;
var pid = productUrl.match(/(?:\?|&)id=(\d+)/)[1];
try {
var skuId = productUrl.match(/skuId=(\d+)/)[1];
} catch (e) {}
var imgLink = getLazyLoadImageUrl(product.querySelector(".productImg > img "));
var price = product.querySelector(".productPrice > em").textContent.match(/[\d\-\.]+/)[0];
try {
var shopNode = product.querySelector(".productShop-name");
var shopName = shopNode.textContent.trim("↵");
var userId = shopNode.href.match(/user_number_id=(\d+)/)[1];
var review = fixReviewCount(product.querySelector(".productStatus > span > a").textContent);
var sellNumber = fixReviewCount(product.querySelector(".productStatus > span > em").textContent);
} catch (e) {}
var item = {
'category': "",
'img': imgLink,
'nnid': pid,
'price': price,
'review': review,
'sale_num': sellNumber,
'shopId': userId,
'shopname': shopName,
'taobao': false,
'title': title,
'sku': skuId
};
items.push(item);
}
return items;
}
// function getTmallChaoShiListInfo() {
// var productList = document.querySelectorAll(".product");
// var items = [];
// for (var i = 0; i < productList.length; i++ ) {
// var product = productList[i];
// var titleNode = product.querySelector(".product-title > a");
// var title = titleNode.title;
// var pid = product.getAttribute("data-itemid");
// var imgLink = getLazyLoadImageUrl(product.querySelector(".product-img img"));
// var price = product.querySelector(".ui-price > strong").textContent.match(/[\d\-\.]+/)[0];
// var sellNumber = product.querySelector(".item-sum > strong").textContent.match(/\d+/)[0];
// var review = "0";
// try {
// review = product.querySelector(".productStatus > span > a").textContent.match(/\d+/)[0];
// } catch(e) {
//
// }
// var item = {
// 'category': "",
// 'img': imgLink,
// 'nnid': pid,
// 'price': price,
// 'review': review,
// 'sale_num': sellNumber,
// 'shopname': "天猫超市",
// 'taobao': false,
// 'title': title,
// }
// items.push(item);
// }
// return items;
// }
//s.taobao.com
//https://s.taobao.com/search?spm=a21bo.2017.201867-links-1.3.5af911d97W83KL&q=%E6%B5%81%E8%A1%8C%E5%A5%B3%E9%9E%8B&imgfile=&js=1&stats_click=search_radio_all%3A1&initiative_id=staobaoz_20190320&ie=utf8
function getTaobaoListInfo() {
var productList = document.querySelectorAll(".m-itemlist > div > .items > .item");
var items = [];
for (var i = 0; i < productList.length; i++) {
var product = productList[i];
var imgLink = getLazyLoadImageUrl(product.querySelector(".pic > a >img"));
var title = product.querySelector(".title > a").textContent.trim();
var pid = product.querySelector(".title > a").getAttribute("data-nid");
var userId = product.querySelector(".shopname").getAttribute("data-userid");
var shopName = product.querySelector(".shopname").textContent.trim();
var price = product.querySelector(".price").textContent.match(/[\d\-\.]+/)[0];
var sellNumber = fixReviewCount(product.querySelector(".deal-cnt").textContent);
var review = "";
var isTaobao = true;
if (product.querySelector(".icon-service-tianmao")) {
isTaobao = false;
}
var item = {
'category': "",
'img': imgLink,
'nnid': pid,
'price': price,
'review': review,
'sale_num': sellNumber,
'shopId': userId,
'shopname': shopName,
'taobao': isTaobao,
'title': title
};
items.push(item);
}
return items;
}
function tmallOffShelf() {
var items = [];
if (document.querySelector(".sold-out-left")) {
items.push({
"nnid": document.URL.match(/id=(\d+)/)[1],
"price": "-1"
});
}
return items;
}
function tmallPromo() {
if (document.querySelector(".tb-wrTuan-deposit") && document.querySelector(".depositexpand")) {
var presalePrice = document.querySelector(".tb-wrTuan-num ").textContent.replace(/¥/, "");
var deposit = document.querySelector(".tb-wrTuan-deposit").textContent.replace(/¥/, "");
var expand = document.querySelector(".depositexpand").textContent.match(/付定金立减([\d+\.]+)/)[1];
return [{
nnid: document.URL.match(/id=(\d+)/)[1],
title: document.querySelector(".tb-detail-hd > h1").textContent.replace(/\s/g, ""),
promo: [presalePrice, deposit, expand],
price: "0"
}];
} else {
return [];
}
}
// 修改提取结果,使其格式符合要求,然后提交
function processResult(result) {
var toSend = result.map(function (item) {
return {
crc32: "",
price: parseFloat(item.price),
tle: "",
url: JSON.stringify(item)
};
});
__webpack_require__(39).sendPriCheck(toSend);
}
function getInfoAndSend() {
// if (navigator.language != "zh") {
// return;
// }
if (location.href.indexOf('.tmall.com/search.htm?') > -1) {
var result = getTmallShopListInfo();
processResult(result);
}
if (location.href.indexOf('list.tmall.hk/search_product.htm') > -1 || location.href.indexOf('list.tmall.com/search_product.htm') > -1) {
var result = getTmallListInfo();
processResult(result);
}
// if (location.href.indexOf('list.tmall.com/search_product.htm') > -1) {
// let result = getTmallChaoShiListInfo();
// processResult(result)
// }
if (location.href.indexOf('s.taobao.com/search') > -1) {
var result = getTaobaoListInfo();
processResult(result);
}
if (location.href.indexOf('https://detail.tmall.com/item.htm') > -1) {
var result = tmallOffShelf();
if (result.length != 0) {
processResult(result);
}
var promo = tmallPromo();
if (promo.length != 0) {
processResult(promo);
}
}
}
module.exports.init = function () {
$(document).ready(function () {
setTimeout(getInfoAndSend, 1000);
});
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
/***/ }),
/* 193 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G, $) {
var union_url = G.u_server + "/union/go";
var util = __webpack_require__(11);
if (!G.isMobile) union_url = G.specialUnion;
var firstClick = true;
var forbidDict;
var dict = {
'dangdang': 2,
'prescriptives': 5,
'perryellis': 6,
'newegg': 7,
'originalpenguin': 9,
'm18': 10,
'naturalizer': 11,
'sephoracps': 12,
'lefeng': 13,
's': 14,
'51buy': 15,
'moonbasa': 17,
'keede': 18,
'kede': 18,
'vancl': 19,
'luisaviaroma': 20,
'letao': 22,
'giorgioarmanibeauty-usa': 23,
'taoxie': 24,
'suning': 25,
'coo8': 26,
'caudalie': 26,
'gome': 28,
'gome-rushbuy': 28,
'gomehigo': 28,
'murad': 29,
'betseyjohnson': 30,
'yihaodian': 31,
'yihaodian-tuan': 31,
'womai': 32,
'leyou': 33,
'shopin': 34,
'xiu': 35,
'mbaobao': 36,
'thebodyshop': 37,
'hampdenclothing': 38,
'youpin-mi': 39,
'chunshuitang': 40,
'x': 41,
'no5': 43,
'anthropologie': 44,
'sasa': 45,
'armani': 47,
'ecco-us': 48,
'360kxr': 50,
'm6go': 51,
'bananarepublic-gap': 53,
'morefood': 54,
'loft': 55,
'99read': 59,
'china-pub': 60,
'bookschina': 61,
'winxuan': 62,
'efeihu': 63,
'shuuemura-usa': 65,
'yintai': 66,
'strawberrynet': 69,
'happigo': 72,
'gap': 73,
'therealreal': 74,
'c21stores': 76,
'ctshirts': 78,
'superjeweler': 79,
'jimmychoo': 82,
'tmall': 83,
'tiantian': 84,
'fwrd': 85,
'jumei': 86,
"aveda": 87,
"na-kd": 88,
"nancymeyer": 92,
'yougou': 93,
'111': 94,
'jianke': 97,
'muyingzhijia': 98,
'lingshi': 99,
'banggo': 100,
'yesmywine': 101,
'jiumei': 102,
'winenice': 102,
'jiuxian': 103,
"baublebar": 105,
"elevenparis": 106,
'goujiuwang': 108,
'okhqb': 109,
'bookuu': 110,
"lindtusa": 111,
"narscosmetics": 112,
'd1': 115,
"jackrabbit": 116,
"macmall": 117,
"champssports": 120,
"dji": 121,
"bodenusa": 122,
'paixie': 122,
's8': 123,
"crazy8": 124,
'homevv': 124,
'jxdyf': 125,
'jinxiang': 125,
'sfbest': 126,
'benlai': 127,
'tootoo': 128,
'vipshop': 129,
'fclub': 130,
"moltonbrown": 130,
"needsupply": 131,
'ihush': 131,
"solesociety": 132,
'vmall': 134,
'lenovo': 135,
'apple': 136,
'zm7': 138,
'miqi': 139,
"childrensplace": 139,
'zhiwo': 140,
'j1': 141,
'wangjiu': 142,
'liebo': 144,
'esprit': 145,
'lamiu': 146,
'aimer': 147,
'kadang': 148,
"sigmabeauty": 148,
'lizi': 149,
'metromall': 150,
"adidas": 150,
'pba': 151,
'shangpin': 152,
'wbiao': 153,
'handuyishe': 154,
'ehaier': 155,
'secoo': 156,
'camel': 157,
'masamaso': 158,
"veronicabeard": 158,
"cross": 159,
'nop': 159,
'naruku': 160,
"monsterproducts": 161,
'gaojie': 161,
'zhenpin': 162,
'sportica': 163,
'xifuquan': 164,
"theoutnet": 165,
'milier': 165,
// 'xiaomi': 167,
'lemall': 168,
"clarisonic": 170,
'dianping': 171,
'ctrip': 173,
'yiguo': 174,
'yummy77': 175,
"dermadoctor": 175,
'fruitday': 178,
'jumeiglobal': 179,
'feiniu': 180,
"solsticesunglasses": 181,
'feifei': 181,
'zuipin': 182,
"pixiemarket": 183,
'yohobuy': 184,
'lvmama': 185,
'ikjtao': 188,
'speedo': 189,
"yunifang": 190,
"globalwinner": 191,
"biotherm-usa": 193,
'mf910': 194,
'markmall': 194,
'miyabaobei': 195,
'ule': 196,
'mingshengec': 197,
"jomalone": 198,
'wangfujing': 198,
'nuomi': 199,
'qunar': 200,
'meilishuo': 202,
'mogujie': 203,
'55tuan': 204,
'jinjianginns': 205,
'elong': 206,
'500': 209,
'supuy': 210,
'lv': 211,
'caipiao': 212,
'lining': 213,
'koolearn': 214,
'springtour': 215,
'228': 216,
'rrs': 217,
'coocaa': 218,
'lifevc': 220,
'niubia': 221,
'kzj365': 222,
'kaola': 223,
'ymatou': 224,
'metao': 225,
"yvesrocherusa": 225,
'kjt': 226,
'logitech': 227,
'ebay': 230,
'aliexpress': 231,
'xiji': 232,
'nike': 233,
'360kad': 234,
'lbxcn': 235,
'meici': 236,
'beibei': 237,
'6pm': 238,
"mountainhardwear": 240,
'shopbop': 241,
'sierratradingpost': 243,
'ashford': 243,
'newegg-us': 244,
'lookfantastic-com': 248,
'iherb': 250,
'vsigo': 252,
'100yue': 256,
'haitaocheng': 258,
'joesnewbalanceoutlet': 259,
'daling': 267,
'sfht': 268,
'fengqu': 268,
'mei': 269,
'showjoy': 270,
'ocj': 271,
'sundan': 272,
'easeeyes': 273,
'yunhou': 274,
'haituncun': 275,
'walmart': 276,
'vmei': 277,
'jgb': 278,
"boscovs": 278,
"putmeinthestory": 279,
'51din': 279,
'aidai': 280,
'boqii': 281,
'toursforfun': 282,
'lulutrip': 283,
'spider': 284,
'microsoftstore': 285,
'jiae': 286,
'zazhipu': 287,
'xgdq': 288,
'xtep': 289,
'midea': 290,
'staples': 291,
'efotile': 292,
'bestcake': 293,
'lovo': 294,
'hua': 295,
'zhe800': 296,
'bftv': 297,
'tujia': 298,
'tuhu': 299,
'htc': 300,
'roseonly': 301,
'rong360': 302,
'niwodai': 303,
'cosme': 304,
'diapers': 305,
'windeln': 306,
'babyneo': 307,
'escentual': 308,
'thewatchery': 309,
'saksfifthavenue': 310,
'esteelauder': 311,
'biccamera': 312,
"petit-bateau": 313,
'taqu': 313,
'qyer': 314,
'axmall ': 315,
'muji': 316,
'gmarket': 317,
'11st': 318,
'smartbargains': 319,
'yahooshop': 320,
'bloomingdales': 321,
'mikihouse': 322,
'toysrus': 323,
'comfortfirst': 324,
'gymboree': 325,
'albeebaby': 326,
'babymarkt': 327,
'uggaustralia': 328,
'neimanmarcus': 329,
'shoebuy-elevtd': 330,
'szul': 331,
'timex': 332,
'kay': 333,
'ewatches': 334,
'swarovski': 335,
'worldofwatches': 336,
'danielwellington': 337,
'beautybay': 338,
'beauty': 339,
"striderite": 339,
"bcbg": 340,
'beautybar': 340,
'skinstore': 341,
'laneige': 342,
'bose': 343,
'bestbuy': 344,
'bhphotovideo': 345,
'sony': 346,
'bl': 347,
'bestinfoods': 348,
"marissacollections": 348,
'you163': 349,
'jinjiang': 350,
'guojimami': 351,
'baiyangwang': 352,
'royyoungchemist': 354,
'medihealshop': 355,
'1001pharmacies': 356,
'lookfantastic-cn': 357,
'oneplus': 358,
'kaixinbao': 359,
'juanpi': 360,
'booking': 361,
'pharmacyonline': 362,
'bodyguardapotheke': 363,
'purcotton': 364,
'wstx': 367,
'hisense': 368,
'zhongjiu': 369,
'kaluli': 370,
'yangkeduo': 370,
'to8to': 371,
'opposhop': 372,
'baobeigezi': 373,
'yao123': 374,
'baicheng': 375,
'gionee': 376,
'suanjuzi': 377,
'aomygod': 378,
'luolai': 379,
'vivo': 380,
'dixintong': 381,
'coolpad': 382,
'skg': 383,
'iqiyi': 384,
'aolaigo': 385,
'missfresh': 386,
'pushenkuajing': 387,
'feelunique': 388,
'chemistdirect': 389,
'netpharmacy': 390,
"chineselaundry": 390,
'pharmacy4less': 391,
'pharmacydirect': 392,
'amcal': 393,
'laredoute': 394,
'unserekleineapotheke': 395,
'erwinmueller': 396,
'kiwidiscovery': 397,
"ylang23": 397,
"thewalkingcompany": 398,
'springlane': 398,
'jako-o': 399,
'easytoys': 400,
'tlcpharmacy': 401,
'bienmanger': 402,
'dewaren': 403,
'discount-apotheke': 404,
'holland-at-home': 405,
'youyu': 406,
'kiwistarcare': 407,
'lenovomobile': 408,
'motorola': 408,
'kiehls': 409,
'zappos': 410,
'coach': 411,
'yoox': 412,
'11street': 413,
'51taouk': 414,
'hqhair': 415,
'katespade': 416,
'vitafy': 417,
'lotte': 418,
'carrefour': 419,
'tea7': 420,
'puzeyf': 421,
'kohls': 422,
'bodybuilding': 423,
'nordstrom': 424,
'costco': 425,
'target': 426,
'kmart': 427,
'overstock': 428,
'sears': 429,
'shoprobam': 430,
'goumin': 431,
'flyco': 432,
'opplestore': 433,
'syshop': 434,
'yfdyf': 435,
'hotels': 436,
'aihuishou': 437,
'thebeastshop': 438,
'jomooshop': 439,
'septwolves': 440,
'lianjia': 441,
'5i5j': 442,
'home6': 443,
'800pharm': 444,
'ujipin': 445,
'mmb': 446,
'ihaveu': 447,
'ikang': 448,
'wyn88': 449,
'mcake': 450,
'xmeise': 451,
'lecake': 452,
'jd100': 453,
'jinghua': 454,
'taohwu': 455,
'zbird': 456,
'km1818': 457,
'zocai': 458,
'taoshu': 459,
'aizhigu': 460,
'tieyou': 461,
'fieldschina': 462,
'wdmcake': 463,
'lqxshop': 464,
'usashopcn': 467,
'wine9': 468,
'qipaimall': 469,
'yododo': 470,
'1688': 471,
'yoger': 472,
'dapu': 473,
'winona': 474,
'wl': 475,
'shanmai': 476,
'zgshoes': 477,
'maichawang': 478,
'uemall': 489,
"perfumania": 479,
'51you': 480,
'beifabook': 481,
'jpeen': 482,
'huatuoyf': 483,
'fengbuy': 484,
'uiyi': 485,
'hecha': 486,
't10': 487,
'qw': 488,
'miutour': 489,
'ehaoyao': 490,
'idx': 491,
'uya100': 492,
'ssnewyork': 493,
'clinique': 494,
'hxepawn': 495,
'brooksbrothers': 496,
'omtao': 497,
'ep365': 498,
'columbiasports': 499,
'bstapp': 500,
'newbalance': 501,
'wjike': 502,
'bally': 503,
'1hai': 504,
'jialich': 505,
'takeya': 506,
'forever21': 507,
'modernavenue': 508,
'muniao': 509,
'zuihuiyou': 510,
'centanet': 511,
'bobbibrowncosmetics': 512,
'super-in': 513,
'hangowa': 514,
'levi': 515,
'fila': 516,
'converse': 517,
'nextdirect': 518,
'itrip': 519,
'lashou': 520,
'liufeng': 521,
'trt': 522,
'wodinghua': 523,
'wuliwuli': 524,
'forestfood': 525,
'bonjourhk': 526,
'vitagou': 527,
'kinhom': 528,
'360lj': 529,
'changba': 530,
'oakley': 531,
'jpyoo': 532,
'clarksusa': 533,
'starwoodhotels': 534,
'marriott': 535,
'yesstyle': 536,
'evisu': 537,
'lifeseasy': 538,
'ccxpet': 539,
'x0061': 540,
'kkguan': 541,
'style-oclock': 542,
'peikua': 543,
'airfrance': 544,
'accorhotels': 545,
'spacenk': 546,
'haichufang': 547,
'wconcept': 548,
'gant': 549,
'catfootwear': 550,
'saucony': 551,
'zaozuo': 552,
'littleswan': 553,
'can': 554,
'ssrj': 555,
"underarmour": 555,
'guess': 556,
'etihad': 557,
'fiil': 558,
'mianshui365': 559,
'tegoushe': 560,
'wiggle': 561,
'mdreams': 562,
'ecovacs': 563,
'calvinklein': 564,
'memebox': 565,
'hilton': 566,
'revolve': 567,
'shiseido': 568,
'clarinsusa': 569,
'starbucks': 570,
'ray-ban': 571,
'puma': 572,
'nautica': 573,
'cremedelamer': 574,
'kipling-usa': 575,
'jurlique': 576,
'hushpuppies': 577,
'origins': 578,
'follifollie': 779,
'loccitane': 580,
'hpstore': 582,
'01home': 584,
'healthpost': 588,
'imengxiang': 590,
'hysj': 591,
'saohuo7': 592,
'repai': 593,
'mayi': 594,
'yinpiao': 595,
'ihome-ins': 596,
'incake': 597,
'kuwo': 598,
'ywart': 599,
'cct': 600,
'ansgo': 601,
'pilibaba': 602,
'xiaoniu88': 603,
'ahava': 604,
'5-fifth': 605,
'thewatchhut': 606,
'babyhaven': 607,
'cosme-de': 608,
'getthelabel': 609,
'matsuya': 610,
'timberland': 611,
'topman': 612,
'homeaway': 613,
'beautyexpert': 614,
'haimi': 615,
'mankind': 616,
'thehut': 617,
'topshop': 618,
'mamaladen': 619,
'traveler-store': 620,
'travelzoo': 621,
'umishoes': 622,
'ferrari': 624,
'willerexpress': 625,
'unineed': 626,
'acnestudios': 627,
'aeropostale': 628,
'agoda': 629,
'albamoda': 630,
'allbeauty': 631,
'allsaints': 632,
"bestgymequipment": 632,
'allsole': 633,
'urbanoutfitters': 634,
'vitabiotics': 635,
'bellemaison': 636,
'benefitcosmetics': 637,
'bhcosmetics': 638,
'bjmylikes': 639,
"thesportsedit": 639,
'vitaminbay': 640,
'waitrose': 641,
'wolfordshop': 642,
'boohoo': 643,
'boots': 644,
'britishcornershop': 645,
'yirendai': 646,
'ys7': 647,
'coggles': 648,
'corsetdeal': 649,
'cottonon': 650,
'crocs': 651,
'cruisefashion': 652,
'dell': 653,
'dermstore': 654,
'disneystore': 655,
'dorothyperkins': 656,
'doudoukang': 657,
'dujiake': 658,
'dunelondon': 659,
'eastbay': 660,
'eastdane': 661,
'zaful': 662,
'zavvi': 663,
'feinkeit': 664,
'eibmarkt': 665,
'belluna': 666,
"emirates": 667,
'ems': 668,
'eterna': 669,
'eurail': 670,
'exantediet': 671,
'expedia': 672,
'falke': 673,
'famousfootwear': 674,
'foreo': 676,
'wangxinlicai': 677,
'foreverunique': 678,
'forzieri': 679,
'freecountry': 680,
"treds": 681,
'frenchconnection': 682,
'gift-land': 683,
'growgorgeous': 687,
'hotel': 690,
'houseoffraser': 691,
'huizuche': 692,
'iwantoneofthose': 695,
'jjglobal': 696,
'juicycouture': 699,
'kenko': 700,
'kikocosmetics': 702,
'lancerskincare': 703,
'lego': 704,
'lordandtaylor': 706,
'maizhi': 711,
'matchesfashion': 712,
'matsukiyo': 713,
'microsoft': 715,
'mioskincare': 716,
'missselfridge': 717,
'mountaingear': 718,
'mybag': 720,
'myprotein': 721,
'myvitamins': 723,
'net-a-porter': 724,
'newbalance-uk': 725,
'ddky': 726,
'newlook': 727,
'chinaacc': 728,
'bmai': 729,
'nike-hk': 730,
'nike-br': 731,
'inke': 732,
"toryburch-uk": 732,
'nyandcompany': 733,
'oasis-stores': 734,
'orbitz': 735,
'orchira': 736,
'origins-uk': 737,
'petsmart': 738,
'junrongdai': 739,
'napai': 740,
'gree': 741,
'probikekit': 742,
'qatarairways': 743,
'radley': 744,
'allianz': 745,
'ralphlauren': 746,
'rebeccaminkoff': 747,
'youmi': 748,
'21cake': 749,
'rentalcars': 750,
'ricaud': 751,
'rockport': 752,
'ruelala': 753,
'56ren': 754,
'saksoff5th': 755,
'anantara': 756,
'sc24': 757,
'chesudi': 758,
'shoes': 759,
'shopspring': 760,
'simplysupplements': 761,
'ehmall': 762,
'farfetch': 763,
'ssense': 764,
'stevemadden': 765,
'freepeople': 766,
'gaosouyi': 767,
'imomoko': 768,
'taodo': 769,
'michaelkors': 770,
'ttcj': 771,
'uf-club': 772,
'zhaidou': 773,
'163yun': 774,
'apo': 775,
'jimu': 776,
'hao24': 777,
'seagoor': 778,
'wannar': 779,
'caihang': 780,
'csmall': 781,
'kuajing': 782,
'millenniumhotels': 783,
'reebonz': 784,
'wemakeprice': 785,
'wzhouhui': 786,
'huijiayou': 787,
'melimelo': 788,
'91xcm': 789,
'ashford-zh': 790,
'cjonmart': 791,
'cnyto': 792,
'granddfs': 793,
'officedepot': 794,
'tianhong': 795,
'yilingshop': 796,
'klook': 797,
'charm-color': 798,
'felissimo': 799,
'surfstitch': 800,
'lornajane': 801,
'reiss': 802,
'gzl': 803,
'9drug': 804,
'yungoubs': 805,
'yencity': 806,
'hujiang': 807,
'meituan-iphx': 808,
'svgouwu': 809,
'hqwx': 811,
'tcl': 812,
'maimaicn': 813,
'tyfo': 814,
'tthigo': 816,
'mayn': 817,
'harrods': 819,
'theundone': 820,
'perfumesclub': 821,
'godaddy': 822,
'mytheresa': 823,
'backcountry': 824,
'marriott-cn': 825,
'swarovski-en': 826,
'mrporter': 827,
'priceline': 828,
'ctrip-en': 829,
'monnierfreres': 830,
'myprotein-com': 831,
'toryburch-com': 826,
'italist': 832,
'askderm': 833,
'tatcha': 834,
'hollandandbarrett': 835,
'ninewest': 836,
'bergdorfgoodman': 837,
'ihg': 838,
'footlocker': 839,
'rodial': 840,
'feelunique-cn': 841,
'jackwills': 842,
'kidsroom': 843,
'dod': 844,
'karenmillen': 845,
'illicopharma': 846,
'tedbaker': 847,
'b-glowing': 848,
'adiexpress': 849,
'fragrancex': 850,
'peterthomasroth': 851,
'gap-com': 852,
'cecile': 853,
'barneys': 854,
'debuycn': 855,
'smashbox': 856,
'lastcall': 857,
'superdrug': 858,
'libertylondon': 859,
'chemistdirect-uk': 860,
'skincarerx': 861,
'haba': 862,
'panasonic': 863,
'beautifiedyou': 864,
'nba': 865,
'elfcosmetics': 866,
'uniqlo': 867,
'colehaan': 868,
'carters': 869,
'sportsdirect': 870,
'adorama': 871,
'ae': 872,
'amorepacific': 873,
'anntaylor': 874,
'asics': 875,
'asos': 876,
'aveneusa': 877,
'barneyswarehouse': 878,
'bensherman': 879,
'blissworld': 880,
'blueandcream': 881,
'bonds': 882,
'cookieskids': 883,
'cosmeland': 884,
'crabtree-evelyn': 885,
'crocs-ca': 886,
'darphin': 887,
'davidscookies': 888,
'dickiesstore': 889,
'dockers': 890,
'easyspirit': 891,
'ebags': 892,
'echemist': 893,
'eddiebauer': 894,
'elemis': 895,
'elizabetharden': 896,
'ena': 897,
'evitamins': 898,
'fashionesta': 899,
'figleaves': 900,
'folica': 901,
'fragrancenet': 902,
'glamglow-uk': 903,
'godivachocolates': 904,
'goldsmiths': 905,
'growgorgeous-uk': 906,
'happysocks': 907,
'harveynichols': 908,
'hatley': 909,
'herbspro': 910,
'houseofholland': 911,
'jayjays': 912,
'jetairways': 913,
'journeys': 914,
'karmaloop': 915,
'keds': 916,
'labseries': 917,
'leejeans': 918,
'livingsocial': 919,
'wkzuche': 920,
'uzise': 921,
'laiyifen': 922,
'avast': 923,
'kaspersky': 924,
'steepandcheap': 925,
'glamglow-com': 926,
'cledepeaubeaute': 927,
'kicksusa': 928,
'lacoste': 929,
'perriconemd': 930,
'gemvara': 931,
'bluenile': 932,
'modaoperandi': 933,
'parrot': 934,
'fashionbunker': 935,
'final-score': 936,
'dkny': 937,
'mango': 938,
'charlottetilbury': 939,
'vmware': 940,
'avira': 941,
'jewelry': 942,
'eset': 943,
'norton': 944,
'jimmyjazz': 945,
'roxy': 946,
'nastygal': 947,
'marcjacobs': 948,
'beastsmode': 949,
'theapollobox': 950,
'yamibuy': 951,
'hbx': 952,
'horchow': 953,
'bluefly': 954,
'swansonvitamins': 955,
'jcrew': 956,
'bebe': 957,
'mucfc': 958,
'only': 959,
'veromoda': 960,
'jackjones': 961,
'selected': 962,
'hanes': 963,
'algenist': 964,
'jcrew-factory': 965,
'lolewomen': 966,
'underarmour-com': 967,
'theory': 968,
'intimina': 969,
'nydj': 970,
'jny': 971,
'bonobos': 972,
'alphaindustries': 973,
'venuekings': 974,
'goop': 975,
'silkyscents': 976,
'shopsky': 977,
'vitaminworld': 978,
'bumbleandbumble': 979,
'mattandnat': 980,
'ladyfootlocker': 981,
'aliceandolivia': 982,
'lancome-usa': 983,
'sk-ii': 984,
'beautifulhalo': 985,
'footaction': 986,
'vitaminshoppe': 987,
'reebok': 988,
'jet': 989,
'burtsbeesbaby': 990,
'yoins': 991,
'skechers': 992,
'toofaced': 993,
'shoebuy': 994,
'katvondbeauty': 995,
'mountainsteals': 996,
'tours4fun': 997,
'jewelryaffairs': 998,
'perfume': 999,
'tgw': 1000
};
function makeUrl(pre, url) {
if (url.indexOf("http") != 0) {
if (url.indexOf("javascript") == 0) {
pre = "";
url = "";
} else if (url.indexOf("//") == 0) {
pre = "http:";
} else if (url.indexOf("/") == 0) {
pre = pre.replace(/(http:\/\/[^\/]+).*/ig, '$1');
if (G.site === 'youpin-mi') {
return pre + url.replace('/', '');
}
} else {
var head = pre.substr(0, pre.indexOf("//") + 2);
pre = pre.substr(pre.indexOf("//") + 2);
var pre_arr = pre.split("/");
var pre_len = pre_arr.length - 1;
if (url.indexOf("./") == 0) {
url = url.substr(2);
} else if (url.indexOf("../") == 0) {
while (url.indexOf("../") == 0) {
url = url.substr(3);
pre_len--;
}
}
pre = head;
for (var i = 0; i < pre_len; i++) {
pre += pre_arr[i] + "/";
}
}
url = pre + url;
}
return url;
}
function makeSite() {
var site = G.site;
if (G.site == 'yhd') site = 'yihaodian';
if (G.site == 'vip') site = 'vipshop';
return site;
}
function addSpecialDicts() {
if (G.from_device == 'baidu' || G.from_device == 'mi_new' || G.from_device == 'njck' || G.from_device == 'bjlt' || G.new_extension) {
dict['360buy'] = 3;
}
}
// function specialEdit() {
// /*pc端所有版本去掉唯品会的dicts*/
// if (G.site == 'vipshop' && location.host != 'm.vip.com')
// delete dict['vipshop'];
// }
// 返回false表示数组为空或者没有匹配到元素
var matchDict = function matchDict(site, forceArr) {
var d1 = dict[site];
if (forceArr.length === 0 || !(forceArr instanceof Array)) return false;
for (var i = 0; i < forceArr.length; i++) {
var item = forceArr[i];
item = Number(item);
if (item === d1) return true;
}
return false;
};
var specialReplaceUrl = function specialReplaceUrl(site, url) {
if (dict[site] === 173) {
url = 'https://click.linktech.cn/?m=xiecheng&a=A100098459&l=99999&l_cd1=0&l_cd2=1&tu=https%3A%2F%2Fhotels.ctrip.com/international%2FSingapore73#ctm_ref=ssc_hp_htl_sni_pro_1';
} else if (dict[site] === 214) {
url = 'http://un.koolearn.com/alliance/clickword?userid=28267eeb6a904424a152dfec2324dcfa&kid=86919c8addb545bbb384e6c2a4cafac4';
} else if (dict[site] === 728) {
url = 'http://union.chinaacc.com/union/interface/spread.shtm?agentID=3163&siteID=1';
} else if (dict[site] === 384) {
if (G.cooperation || G.from_device === 'bijiago') {
url = 'https://c.duomai.com/track.php?k=mLwlmdGJTJGJTJBNTJzBHd0hWP0ZSPklWdlZCMyczM9QWahZCNxEzM50DZp9VZ0l2cmYiJs1Gdo5yYwNnetdnRyUibvlGdv12byBVau5WQoRnbp5WZyBnRyUSbvNmLplXaxl';
}
}
return url;
};
var init = function init(site) {
addSpecialDicts();
var pageUrl = location.href;
if (pageUrl.indexOf('order') > -1 || pageUrl.indexOf('cart') > -1) return;
if (!G.set_force) return;
// || $.inArray(Number( dict[site]), G.force) >= 0
try {
if (dict[site] && matchDict(site, G.force)) {
return;
}
$('body').delegate('a', 'mouseenter mouseleave mouseover', function (event) {
var ct = $(this).attr('ct');
if (event.type != "mouseover" && ct) {
$(this).attr('href', ct).removeAttr('ct').attr('cted', '1');
}
});
var listeningElement = 'a';
if (site === 'youpin-mi') {
listeningElement = '.m-goods-item-container';
}
$('body').delegate(listeningElement, 'click', function (event) {
if ($.inArray("" + dict[site] + "", G.force) >= 0) {
return;
}
if (forbidDict) return;
if ($(this).attr('cted') === '1' && !G.isMobile) {
return;
}
if (firstClick && !G.isMobile && (G.from_device == 'jsdx' && G.secondShow || G.from_device == 'tlxs' && G.secondShow || G.from_device == 'hndx' || G.from_device == 'xdjf' && G.secondShow || G.from_device == 'hagw' && G.secondShow || G.from_device == 'mi_new')) {
firstClick = false;
return;
}
if (dict[site]) {
var url = $(this).attr('href');
if (site === 'youpin-mi') {
url = $(this).attr('data-src');
}
if (!url || url.indexOf('order') > -1 || url.indexOf('cart') > -1) return;
var classList = $(this).attr('class') || '';
url = makeUrl(G.href, url);
if (url.indexOf('http') == 0 && url.indexOf('' + G.extName) < 0 && classList.indexOf(G.extName + '_link') == -1) {
//if (G.site === '1688') {
// if (G.force_1688_time && parseInt(G.force_1688_time) + 3600000*24 > (new Date).getTime()) {
// return
// }
// util.settings('force_1688_time', 'force_1688_time', (new Date).getTime())
// return
// if (localStorage.getItem('gwd-link') && parseInt(localStorage.getItem('gwd-link')) + 3600000*24 > (new Date).getTime()) {
// return
// }
// localStorage.setItem('gwd-link', (new Date).getTime())
//}
url = union_url + "?site_id=" + dict[site] + "&target_url=" + encodeURIComponent(url) + "&from=ct&column=dicts&union=" + G.union.replace('union_', '');
url = specialReplaceUrl(site, url);
$(this).attr('ct', $(this).attr('href'));
$(this).attr('href', url);
if (site === 'youpin-mi') {
$(this).attr('data-src', url);
}
forbidDict = true;
$.ajax({
'url': G.server + '/brwext/permanent_id/',
'dataType': 'jsonp',
'jsonp': 'callback',
'async': true,
'data': 'version=2&op=set_force&type=' + dict[site] + '&union=' + G.union,
'success': function success(msg) {
G.force = msg.force;
},
'error': function error(a, b, c) {
return;
}
});
}
}
});
} catch (e) {
if (G.debug) {
throw e;
}
}
};
module.exports = function () {
var site = makeSite();
if (site === 'kaola') {
setTimeout(function () {
init(site);
}, 2000);
} else {
init(site);
}
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1)))
/***/ }),
/* 194 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G, $) {/*
product_id:12313, --产品Id
product_name:"Nike耐克KD 8 Elite高帮男士篮球鞋", --产品名称
goods_id:12312, --商品Id(非精确匹配则给出的是最低价的商品Id)
spec_name_desc:"颜色:红色 尺码:36", --商品规格描述
goods_original_price:1231, --商品官网原价 货币类型:官网货币 单位:分
currency:"USD", --货币类型(USD:美元,EUR:欧元,GBP:英镑,JPY:日元,KRW:日元,CNY:人民币)
goods_price:69999, --商品剁手帮价格 货币类型:人民币 单位:分
official_original_postage:2000, --官网原运费 货币类型:人民币 单位:分
official_postage:2000, --官网邮费(剁手帮减免后) 货币类型:人民币 单位:分
official_postage_rule:"满500免邮", --官网邮费规则描述
international_original_postage:3000, --国际转运费 单位:分 单位:分
international_postage:3000, --国际转运费(剁手帮减免后) 单位:分 单位:分
tax_original_fee:1231, --应收税费 货币类型:人民币 单位:分
tax_fee:1231, --实收税费 货币类型:人民币 单位:分
weight:123, --重量 单位:克
max_buy_num:10 --限购最大购买数量
*/
var template = __webpack_require__(5);
var request = __webpack_require__(2);
var parseprice = __webpack_require__(16);
var globalObj = {};
globalObj['settime'] = 150;
var priceDom = {
amazon: ['#priceblock_dealprice span', '#priceblock_ourprice span .buyingPrice', '#priceblock_dealprice', '#priceblock_saleprice', '#priceblock_ourprice', '#price_feature_div .a-color-price']
};
var feeDom = {
amazon: ['#priceBadging_feature_div .a-color-secondary', '#ourprice_shippingmessage .a-color-secondary']
};
var addMark = function addMark(url) {
if (!url) return url;
if (url.indexOf('?') > -1) {
url = url + '&p_r=gouwudang&p_k=plug_' + G.style + '&outer_pid=8507';
} else {
url = url + '?p_r=gouwudang&p_k=plug_' + G.style + '&outer_pid=8507';
}
return url;
};
var getPrice = function getPrice() {
var price = 0,
fee = 0;
for (var i = 0; i < priceDom['amazon'].length; i++) {
var item = priceDom['amazon'][i];
if ($(item).length > 0 && $(item).is(':visible')) {
price = $(item).text().replace(/[¥$¥\s,]+/g, '');
if (price.indexOf('-') > -1) price = price.split('-')[0];
break;
}
}
for (var i = 0; i < feeDom['amazon'].length; i++) {
var item = feeDom['amazon'][i];
if ($(item).length > 0 && $(item).is(':visible')) {
fee = $(item).text().match(/[0-9.]+/) && $(item).text().match(/[0-9.]+/)[1];
break;
}
}
if (!fee) fee = 0;
price = Number(price) + Number(fee);
return price;
};
var getInfo = function getInfo() {
console.log('yjht get info');
var dp = G.dp;
var price = dp.oldPrice;
if (G.site === 'amazon') price = getPrice();
if (!price) price = dp.oldPrice || '';
if (!dp.url) dp.url = location.href;
if (!dp.sku) dp.sku = dp.url.match(/(?:dp|product)\/([0-9a-zA-Z]+)/) && dp.url.match(/(?:dp|product)\/([0-9a-zA-Z]+)/)[1];
var price2 = (Number(price) * 100).toFixed(0);
var url = G.server + '/api/haitao?price=' + price2 + '&url_crc=' + dp.sku + '&url=' + encodeURIComponent(dp.url);
globalObj['requestUrl'] = url;
globalObj['jumpinfo'] = 'url_crc=' + dp.sku + '&url=' + encodeURIComponent(dp.url);
globalObj['fstTime'] = new Date().getTime();
request.get(url).done(function (data) {
if (data && data.data.product_status === 1) {
var obj = data.data.product_detail;
obj.url = addMark(data.data.product_url);
render(obj);
} else if (data && (data.data.product_status === 2 || data.data.product_status === 3)) {
var obj = undefined;
if (data.data.product_detail_estimate) {
obj = data.data.product_detail_estimate;
obj.url = buildJumpUrl();
} else {
obj = {
goods_price: parseprice(price.toFixed(2)),
url: 'javascript:void();',
tle: "抱歉,该商品暂时无法一键海淘",
noinfo: true
};
}
render(obj);
} else {
var tle = "";
if (data.data.product_status === 4) tle = "抱歉,由于相关法律或转运禁运的原因,该商品无法一键海淘。";else if (data.data.product_status === 5) tle = "抱歉,该商品已下架,无法一键海淘。";
var obj = {
goods_price: parseprice(price).toFixed(2),
url: 'javascript:void();',
tle: tle,
noinfo: true
};
render(obj);
}
});
};
var calPrice = function calPrice(dp) {
dp.goods_original_price = Number((dp.goods_original_price / 100).toFixed(2));
dp.goods_price = Number((dp.goods_price / 100).toFixed(2));
dp.official_original_postage = (dp.official_original_postage / 100).toFixed(2);
dp.official_postage = Number((dp.official_postage / 100).toFixed(2));
dp.xm_official = Number(dp.official_original_postage) - dp.official_postage;
dp.international_original_postage = Number((dp.international_original_postage / 100).toFixed(2));
dp.international_postage = Number((dp.international_postage / 100).toFixed(2));
dp.xm_international = dp.international_original_postage - dp.international_postage;
dp.tax_original_fee = Number((dp.tax_original_fee / 100).toFixed(2));
dp.tax_fee = Number((dp.tax_fee / 100).toFixed(2));
dp.xm_fee = dp.tax_original_fee - dp.tax_fee;
dp.purePrice = dp.goods_price + dp.official_postage + dp.international_postage + dp.tax_fee;
dp.purePrice = dp.purePrice.toFixed(2);
dp.goods_price = dp.goods_price.toFixed(2);
for (var pattern in dp) {
if (typeof dp[pattern] === 'number') {
dp[pattern] = dp[pattern].toFixed(2);
}
}
return dp;
};
var renderMiniBar = function renderMiniBar(dp) {
var d = new Date().getTime();
var t1 = getTimeStr(d + 24 * 3600 * 1000 * 20);
var t2 = getTimeStr(d + 24 * 3600 * 1000 * 30);
var timestr = t1 + '-' + t2;
var htInfo = __webpack_require__(147).getHtInfo();
var html = __webpack_require__(464);
$('#yj_haitao').append(template.compile(html)({
data: dp,
hosts: htInfo.HOST,
timestr: timestr,
protype: htInfo.protype,
site: G.site == '6pm' ? '6PM' : '亚马逊'
})).show();
};
var render = function render(dp) {
if (!dp.noinfo) dp = calPrice(dp);
globalObj['dpinfo'] = dp;
renderMiniBar(dp);
};
var getTimeStr = function getTimeStr(time) {
var dateObj = new Date(time);
var y = dateObj.getFullYear();
var m = dateObj.getMonth() + 1;
var d = dateObj.getDate();
if (m < 10) m = '0' + m;
if (d < 10) d = '0' + d;
return y + '.' + m + '.' + d;
};
var buildJumpUrl = function buildJumpUrl() {
var url = 'https://www.gwdang.com/promotion/haitaomid?' + globalObj['jumpinfo'] + '&f_d=' + G.from_device;
return url;
};
module.exports.init = function () {
if (location.host === 'www.amazon.de') return;
getInfo();
// render()
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1)))
/***/ }),
/* 195 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function($, G) {// addCart 添加购物车 checkout 结结算 shipping1 转运 continue1 下一步 creditinfo 信用卡识别 addcredit添加信用卡 promocode 优惠码 chooseCredit 单币双币信用卡 finished 结束
var template = __webpack_require__(5);
var utils = __webpack_require__(465);
var log = __webpack_require__(9);
var Timer = undefined,
insTimes = 0;
var btnDom = {
'addCart': __webpack_require__(468),
'checkout': __webpack_require__(469),
'shipping1': __webpack_require__(470),
'shipping2': __webpack_require__(471),
'continue1': __webpack_require__(472),
'continue2': __webpack_require__(473),
'creditinfo': __webpack_require__(474),
'addcredit': __webpack_require__(475),
'promocode': __webpack_require__(476),
'chooseCredit': __webpack_require__(477),
'finished': __webpack_require__(478)
};
var parentDom = {
'addCart': '#buybox_feature_div #addToCart .a-button-stack .a-button-input',
'checkout': '#hlb-ptc-btn-native',
'shipping1': '#identity-add-new-address #enterAddressFullNameContainer',
'shipping2': '#identity-add-new-address #enterAddressFullNameContainer',
'continue1': '#shippingOptionFormId .a-spacing-medium .continue-button .a-button-inner',
'continue2': '#order-summary #order-summary-container .continue-buttons .a-button-inner #continue-top',
'creditinfo': '#wrapper-new-cc',
'addcredit': '#wrapper-new-cc',
'promocode': '.pmts-redeem-claim-code-form',
'chooseCredit': '#nav-bar+.a-container .a-spacing-base',
'finished': '#order-summary-box'
};
var addDomListener = function addDomListener() {
var dom = $('body')[0];
if (!dom) return;
var func = function func() {
clearTimeout(Timer);
Timer = setTimeout(function () {
insTimes++;
if (insTimes === 45) {
dom.removeEventListener('DOMSubtreeModified', func, false);
return;
}
matchUrl();
}, 2000);
};
if (dom.addEventListener) {
dom.addEventListener('DOMSubtreeModified', func, false);
}
};
var insertDom = function insertDom(type, pos) {
if ($('.gwd_' + type).length > 0) return;
log('haitao_remind_' + type);
var html = btnDom[type];
if (pos == 'after') $(parentDom[type]).eq(0).after(template.compile(html)({
c_server: G.c_server,
s_server: G.s_server
}));else if (pos == 'append') $(parentDom[type]).eq(0).append(template.compile(html)({
c_server: G.c_server,
s_server: G.s_server
}));
};
var addEvent = function addEvent() {
$('.bjd_btn_box .bjd_close').on('click', function () {
$('.bjd_btn_box').hide();
utils.settings('set_hide_shoptip', 'hide_shoptip', '1');
return false;
});
};
var matchUrl = function matchUrl() {
if (G.pageInfo.type == 2) {
insertDom('addCart', 'after');
} else if ($('#hlb-ptc-btn-native').length > 0) insertDom('checkout', 'after');else if ($('#identity-add-new-address').length > 0) {
insertDom('shipping1', 'append');
} else if ($('#shippingOptionFormId .a-spacing-medium .continue-button .a-button-inner').length > 0) {
insertDom('continue1', 'append');
$('#shippingOptionFormId .a-spacing-medium .continue-button .a-button-inner .a-button-text').on('click', function () {
setTimeout(function () {
if ($('#wrapper-new-cc').length > 0) {
insertDom('creditinfo', 'append');
insertDom('addcredit', 'append');
insertDom('chooseCredit', 'append');
}
}, 1500);
});
} else if ($('#continue-top').length > 0) {
insertDom('continue2', 'after');
if ($('#wrapper-new-cc').length > 0) {
insertDom('creditinfo', 'append');
insertDom('addcredit', 'append');
insertDom('chooseCredit', 'append');
$('#order-summary-container #continue-top').on('click', function () {
setTimeout(function () {
insertDom('promocode', 'append');
insertDom('finished', 'append');
$('#order-summary-box .a-button-text.place-your-order-button').on('click', function () {
log('haitao_remind_finishordersuccess');
});
}, 1000);
});
}
} else if ($('.pmts-redeem-claim-code-form').length > 0) {
insertDom('promocode', 'append');
insertDom('finished', 'append');
$('#order-summary-box .a-button-text.place-your-order-button').on('click', function () {
log('haitao_remind_finishordersuccess');
});
} else if ($('#order-summary-box .a-button-text.place-your-order-button').length > 0) {
insertDom('promocode', 'append');
insertDom('finished', 'append');
$('#order-summary-box .a-button-text.place-your-order-button').on('click', function () {
log('haitao_remind_finishordersuccess');
});
}
if ($('#wrapper-new-cc').length > 0) {
insertDom('creditinfo', 'append');
insertDom('addcredit', 'append');
insertDom('chooseCredit', 'append');
}
if ($('#ccAddCard').length) $('#ccAddCard').on('click', function () {
setTimeout(function () {
insertDom('creditinfo', 'append');
insertDom('addcredit', 'append');
insertDom('chooseCredit', 'append');
}, 1500);
});
addEvent();
};
module.exports.init = function (type) {
if (G.IE6 || G.IE7 || G.IE8) return;
if (location.host.indexOf('amazon') > -1 && location.host != 'www.amazon.cn') {
if (location.host.indexOf('.co.jp') > -1) {
$('html').addClass('amazon-jp');
}
if (location.host.indexOf('.de') > -1) {
return;
// $('html').addClass('amazon-de')
}
if (type === 2) {
$(document).on('runhaitao', function () {
matchUrl();
addDomListener();
});
} else {
setTimeout(function () {
matchUrl();
addDomListener();
}, 1500);
}
} else {
return;
}
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(0)))
/***/ }),
/* 196 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G) {
(function () {
'use strict';
//判断是否为重复加载,如果为重复加载,直接结束脚本
if (__webpack_require__(197)) return;
/*IE在淘宝天猫不出插件*/
var IE = __webpack_require__(199)();
if (IE && location.host.match(/(?:taobao|tmall|yao\.95095|1688\.com|aliexpress\.com|ieframe\.dll)/)) return;
// 京东移动端触摸模拟
if (location.href.indexOf('plogin.m.jd.com') > -1) {
__webpack_require__(200).init();
}
__webpack_require__(50);
__webpack_require__(201).init();
__webpack_require__(24).init();
__webpack_require__(80).init();
var cnzz = __webpack_require__(4);
if (cnzz) cnzz.init(G.gwd_cnzz);
if (location.host === 'm.fine3q.com') __webpack_require__(51).init();
if (G.pageInfo.type === 0) return;
//hao123和百度域名全部不加载任何内容
__webpack_require__(204).init();
if (__webpack_require__(205)()) return;
__webpack_require__(206);
__webpack_require__(207);
G.logoName = __webpack_require__(208)(8);
//检查当前网页是否在插件收录范围内
if (navigator.userAgent.indexOf('Maxthon') > -1) {
// if (location.host.indexOf('tmall') > -1 || location.host.indexOf('95095') > -1) {
// G.maxthon_tmall = true
// }
}
G.plugins = [__webpack_require__(209), __webpack_require__(52)];
__webpack_require__(217);
__webpack_require__(218)();
__webpack_require__(53).common(function (data) {
var dictsArr = ['booking', 'elong', 'wbiao', 'agoda', 'hotels', '228', 'roseonly', 'feelunique', "nike", 'kaola', 'vipshop', 'hujiang', '1688', 'opposhop', 'vsigo', 'keede', 'zazhipu', 'banggo', 'discount-apotheke', 'bl', '1hai', 'pharmacydirect', 'flyco', 'takeya', 'xgdq', 'guojimami', 'shoprobam', 'staples', 'boqii', 'mei', 'tuhu', 'hangowa', 'lookfantastic-cn', 'lookfantastic-com', 'iherb', 'shopbop', 'yoox', 'skinstore', 'ctrip', 'koolearn', 'chinaacc', 'youpin-mi', 'opposhop', 'oneplus'];
var blockCityList = ['北京', '上海', '广州', '深圳', '杭州', '南京'];
// let blockCityList = ['北京', '上海', '广州', '深圳', '杭州'];
var blockCity = false;
blockCityList.forEach(function (city) {
if (data && data.result && !(data.result instanceof Array) && data.result.address.indexOf(city) > -1) {
blockCity = true;
}
});
if (data && data.result && !(data.result instanceof Array) && !blockCity) {
if (dictsArr.indexOf) {
if (dictsArr.indexOf(G.site) > -1) {
G.set_force = true;
}
}
G.forbidAd = true;
} else if (data && data.result.address.indexOf('南京') == -1) {
G.forbidAd = true;
}
if (data && data.result.address.indexOf('北京') > -1) {
G.forbidMinibar = true;
G.forbidGiftMoney = true;
}
if (data && data.result && data.result instanceof Array) {
G.forbidCoupon = true;
}
if (data && data.result && !(data.result instanceof Array) && (data.result.address.indexOf('北京') > -1 || data.result.address.indexOf('杭州') > -1)) {
G.forbidCoupon = true;
}
G.isMonkey = true;
__webpack_require__(16).getRate(function () {
__webpack_require__(54).get(function () {
console.log('monkey-1229');
__webpack_require__(232).init();
});
});
});
})();
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 197 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G) {
var script = __webpack_require__(198);
var $ = __webpack_require__(1);
if (script) script.parentNode && script.parentNode.removeChild && script.parentNode.removeChild(script);
if (document.getElementById('BIJIA_HAS_BUILT')) {
$("#BIJIA_HAS_BUILT").addClass(G.from_device);
console.log('has built, return');
module.exports = true;
} else {
var BUILT_FLAG = document.createElement('div');
BUILT_FLAG.id = 'BIJIA_HAS_BUILT';
var head = document.getElementsByTagName('head');
if (head && head[0]) head = head[0];
head.appendChild(BUILT_FLAG);
$("#BIJIA_HAS_BUILT").addClass(G.from_device);
module.exports = false;
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 198 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G) {
function getCurrentScript() {
if (document.currentScript) {
return document.currentScript;
}
var scripts = document.getElementsByTagName("script");
for (var i = 0; i < scripts.length; i++) {
if (new RegExp(G.extName + "-notifier", "i").test(scripts[i].src)) {
return scripts[i];
}
}
}
module.exports = getCurrentScript();
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 199 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G) {
module.exports = function () {
var match = navigator.userAgent.match(/(?:MSIE |Trident\/.*; rv:)(\d+)/);
if (match) G['IE' + parseInt(match[1])] = true;
if (navigator.userAgent.toLowerCase().indexOf('msie') > -1) return true;
if (navigator.userAgent.toLowerCase().indexOf('edge') > -1) return true;
return match ? parseInt(match[1]) : undefined;
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 200 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function touchHandler(event) {
if (event.target.tagName === 'INPUT') return;
//if (!isMouseDown) return
var touches = event.changedTouches,
first = event,
type = "";
switch (event.type) {
case "mousedown":
type = "touchstart";break;
case "mousemove":
type = "touchmove";break;
case "mouseup":
type = "touchend";break;
default:
return;
}
if (type === 'touchstart') {
isMouseDown = true;
} else if (type === 'touchend') {
isMouseDown = false;
}
// initMouseEvent(type, canBubble, cancelable, view, clickCount,
// screenX, screenY, clientX, clientY, ctrlKey,
// altKey, shiftKey, metaKey, button, relatedTarget);
// var simulatedEvent = document.createEvent("TouchEvent");
// simulatedEvent.initTouchEvent(type, true, true, window, 1,
// first.screenX, first.screenY,
// first.clientX, first.clientY, false,
// false, false, false, 0/*left*/, null);
//
// first.target.dispatchEvent(simulatedEvent);
if (type === 'touchmove' && !isMouseDown) return;
sendTouchEvent(first.clientX, first.clientY, first.target, type);
event.preventDefault();
}
function sendTouchEvent(x, y, element, eventType) {
var touchObj = new Touch({
identifier: Date.now(),
target: element,
clientX: x,
clientY: y,
radiusX: 2.5,
radiusY: 2.5,
rotationAngle: 10,
force: 0.5
});
var touchEvent = new TouchEvent(eventType, {
cancelable: true,
bubbles: true,
touches: [touchObj],
targetTouches: [],
changedTouches: [touchObj],
shiftKey: true
});
element.dispatchEvent(touchEvent);
}
var isMouseDown = false;
function mouseDown() {
isMouseDown = true;
}
function mouseUp() {
isMouseDown = false;
}
function init() {
document.addEventListener("mousedown", touchHandler, true);
document.addEventListener("mousemove", touchHandler, true);
document.addEventListener("mouseup", touchHandler, true);
}
module.exports.init = init;
/***/ }),
/* 201 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var DynamicDetails = __webpack_require__(78).DynamicDetails;
var collectMovement = __webpack_require__(78).collectMovement;
var communicate = __webpack_require__(13);
var Fingerprint2 = __webpack_require__(202);
function readLocalStorage() {
return new Promise(function (resolve) {});
}
module.exports.init = function () {
var details = new DynamicDetails();
try {
(function () {
var k = localStorage.getItem('gwdang-dfp-obj');
var r = JSON.parse(k);
Object.keys(r).forEach(function (item) {
details[item] = r[item];
});
})();
} catch (e) {}
if (window.requestIdleCallback) {
requestIdleCallback(function () {
collectMovement(details);
});
} else {
setTimeout(function () {
collectMovement(details);
}, 500);
}
var fp = '';
Fingerprint2.get({
fonts: {
extendedJsFonts: false
},
excludes: {
userAgent: true,
enumerateDevices: true,
pixelRatio: true,
doNotTrack: true,
fontsFlash: true
}
}, function (components) {
var values = components.map(function (component) {
return component.value;
});
var murmur = Fingerprint2.x64hash128(values.join(''), 31);
fp = murmur;
communicate.trigger({
type: 'fp',
value: fp
});
localStorage.setItem('gwdang-fp', fp);
});
var k = setInterval(function () {
var collected = details.encode();
localStorage.setItem('gwdang-dfp-obj', JSON.stringify(details));
communicate.trigger({
type: 'fingerprint',
value: collected
});
localStorage.setItem('gwdang-dfp', collected);
}, 2000);
setTimeout(function () {
clearInterval(k);
}, 300000);
};
/***/ }),
/* 202 */,
/* 203 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var browser = {
'url': '',
'utype': ''
};
var chromeType = navigator.userAgent.toLowerCase();
module.exports.getBrowser = function () {
if ("ActiveXObject" in window) {
//mozilla/5.0 (compatible; msie 10.0; windows nt 6.1; wow64; trident/6.0; slcc2; .net clr 2.0.50727; .net clr 3.5.30729; .net clr 3.0.30729; .net4.0c; infopath.3; .net4.0e)
browser.utype = "ie";
browser.utitle = "IE";
browser.background = "-401px -81px";
} else if (chromeType.indexOf('firefox') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64; rv:42.0) gecko/20100101 firefox/42.0
browser.utype = "firefox";
browser.utitle = "火狐";
browser.background = "-401px -44px";
} else if (chromeType.indexOf('opera') > -1 || chromeType.indexOf('opr') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/46.0.2490.86 safari/537.36 opr/33.0.1990.115
browser.utype = "opera";
browser.utitle = "Opera";
browser.background = "-2px -120px";
} else if (chromeType.indexOf('safari') > -1 && chromeType.indexOf('chrome') == -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/534.57.2 (khtml, like gecko) version/5.1.7 safari/534.57.2
browser.utype = "safari";
browser.utitle = "Safari";
browser.background = "-301px -44px";
} else if (chromeType.indexOf('chrome') > -1) {
var check360 = checkChromeWeight();
if (chromeType.indexOf('qqbrowser') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/45.0.2454.87 safari/537.36 qqbrowser/9.2.5542.400
browser.utype = "qq";
browser.utitle = "QQ";
browser.background = "-104px -81px";
} else if (chromeType.indexOf('maxthon') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) maxthon/4.4.8.1000 chrome/30.0.1599.101 safari/537.36
browser.utype = "maxthon";
browser.utitle = "傲游";
browser.background = "-401px -4px";
} else if (chromeType.indexOf('bidubrowser') > -1) {
//mozilla/5.0 (compatible; msie 10.0; windows nt 6.1; wow64; trident/6.0; bidubrowser 8.1)
browser.utype = 'baidu';
browser.utitle = '百度';
browser.background = "-104px -120px";
} else if (chromeType.indexOf('ubrowser') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/44.0.2403.157 ubrowser/5.5.6743.207 safari/537.36
browser.utype = 'uc';
browser.utitle = "UC";
browser.background = "-2px -44px";
} else if (chromeType.indexOf('lbbrowser') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/42.0.2311.154 safari/537.36 lbbrowser
browser.utype = 'liebao';
browser.utitle = "猎豹安全";
browser.background = "-301px -4px";
} else if (chromeType.indexOf('taobrowser') > -1) {
//Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.11 TaoBrowser/3.5 Safari/536.11
browser.utype = 'taobao';
browser.utitle = "淘宝";
browser.background = "-104px -44px";
} else if (chromeType.indexOf('2345explorer') > -1) {
//Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36 2345Explorer/6.4.0.10356
browser.utype = '2345';
browser.utitle = "2345王牌";
browser.background = "-301px -81px";
} else if (chromeType.indexOf('2345chrome') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/39.0.2171.99 safari/537.36 2345chrome v3.0.0.9739
browser.utype = '2345jiasu';
browser.utitle = "2345加速";
} else if (chromeType.indexOf('coolnovo') > -1) {
//Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 CoolNovo/2.0.9.20
browser.utype = 'fengshu';
browser.utitle = "枫树";
browser.background = "-2px -81px";
} else if (chromeType.indexOf('greenbrowser') > -1) {
//Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; InfoPath.3; .NET4.0E; GreenBrowser)
browser.utype = 'gb';
browser.utitle = "GB";
browser.background = "-203px -81px";
} else if (check360 === "Chrome") {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/46.0.2490.80 safari/537.36
browser.utype = 'chrome';
browser.utitle = 'Chrome';
browser.background = "-2px -4px";
} else if (check360 === "360SE") {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/31.0.1650.63 safari/537.36
browser.utype = '360se';
browser.utitle = '360安全';
browser.background = "-203px -4px";
} else if (check360 === "360EE") {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/45.0.2454.101 safari/537.36
browser.utype = '360se';
browser.utitle = '360极速 ';
browser.background = "-104px -4px";
} else if (chromeType.indexOf('se') > -1) {
//mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/38.0.2125.122 safari/537.36 se 2.x metasr 1.0
browser.utype = 'sogou';
browser.utitle = "搜狗";
browser.background = "-401px -120px";
} else {
browser.utype = 'chrome';
browser.utitle = 'Chromium内核';
}
} else {
browser.utype = 'chrome';
browser.utitle = '未知浏览器';
}
return browser;
};
var chrome_weight = {
"result": "Chrome",
"details": {
"Chrome": 5,
"Chromium": 0,
"_360SE": 0,
"_360EE": 0
},
"sorted": ["Chrome", "360SE", "360EE", "Chromium"],
"exec": function exec(results) {
var details = {
"Chrome": 5,
"Chromium": 0,
"_360SE": 0,
"_360EE": 0
};
var _ua = window.navigator.userAgent;
if (/Chrome\/([\d.])+\sSafari\/([\d.])+$/.test(_ua)) {
if (window.navigator.platform == "Win32") {
if (!window.clientInformation.languages) {
details._360SE += 8;
}
if (/zh/i.test(navigator.language)) {
details._360SE += 3;
details._360EE += 3;
}
if (window.clientInformation.languages) {
var lang_len = window.clientInformation.languages.length;
if (lang_len >= 3) {
details.Chrome += 10;
details.Chromium += 6;
} else if (lang_len == 2) {
details.Chrome += 3;
details.Chromium += 6;
details._360EE += 6;
} else if (lang_len == 1) {
details.Chrome += 4;
details.Chromium += 4;
}
}
for (var i in window.navigator.plugins) {
if (window.navigator.plugins[i].filename == "np-mswmp.dll") {
details._360SE += 20;
details._360EE += 20;
}
}
if (Object.keys(window.chrome.webstore).length <= 1) {
details._360SE += 7;
} else if (Object.keys(window.chrome.webstore).length == 2) {
details._360SE += 4;
details.Chromium += 3;
}
if (window.navigator.plugins.length >= 30) {
details._360EE += 7;
details._360SE += 7;
details.Chrome += 7;
} else if (window.navigator.plugins.length < 30 && window.navigator.plugins.length > 10) {
details._360EE += 3;
details._360SE += 3;
details.Chrome += 3;
} else if (window.navigator.plugins.length <= 10) {
details.Chromium += 6;
}
} else {
details._360SE -= 50;
details._360EE -= 50;
if (/Linux/i.test(window.navigator.userAgent)) {
details.Chromium += 5;
}
}
var found = 0;
var respdf = undefined;
for (var i in window.navigator.plugins) {
if (!!(respdf = /^(.+) PDF Viewer$/.exec(window.navigator.plugins[i].name))) {
if (respdf[1] == "Chrome") {
details.Chrome += 6;
details._360SE += 6;
found = 1;
break;
}
if (respdf[1] == "Chromium") {
details.Chromium += 10;
details._360EE += 6;
found = 1;
break;
}
}
}
if (!found) {
details.Chromium += 9;
}
}
var chrome_result = new Object();
chrome_result['Chrome'] = details.Chrome;
chrome_result['Chromium'] = details.Chromium;
chrome_result['360SE'] = details._360SE;
chrome_result['360EE'] = details._360EE;
var sortable = [];
for (var value in chrome_result) {
sortable.push([value, chrome_result[value]]);
}sortable.sort(function (a, b) {
return b[1] - a[1];
});
this.sorted = sortable;
this.details = details;
this.result = sortable[0][0];
if (results == "result") {
return sortable[0][0];
} else if (results == "details") {
return chrome_result;
} else if (results == "sorted") {
return sortable;
}
}
};
var checkChromeWeight = function checkChromeWeight() {
var _ua = window.navigator.userAgent;
try {
chrome_weight.exec();
if (/Chrome\/([\d.])+\sSafari\/([\d.])+$/.test(_ua)) {
return chrome_weight.result;
} else {}
} catch (e) {
return;
}
};
module.exports.getChromeVersion = function () {
var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
return raw ? parseInt(raw[2], 10) : false;
};
/***/ }),
/* 204 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function($) {
var log = __webpack_require__(9);
var sitePattern = {
'cart\\.jd\\.com/addToCart\\.html': 'addcart_success_page:360buy',
'cart\\.gome\\.com\\.cn/addsuccess': 'addcart_success_page:gome',
'shopping\\.suning\\.com/addToCart\\.do': 'addcart_success_page:suning',
'cart\\.jd\\.com/cart\\.action': 'cart_page_visit:360buy',
'shopping\\.suning\\.com/cart\\.do': 'cart_page_visit:suning',
'cart\\.gome\\.com\\.cn/shopping': 'orderwrite_page_visit:gome',
'cart\\.gome\\.com\\.cn': 'cart_page_visit:gome',
'cart\\.taobao\\.com/cart\\.htm': 'cart_page_visit:tmall',
'cart\\.tmall\\.com': 'cart_page_visit:tmall',
'trade\\.jd\\.com/shopping/order/getOrderInfo\\.action': 'orderwrite_page_visit:360buy',
'shopping\\.suning\\.com/order\\.do': 'orderwrite_page_visit:suning',
'buy\\.tmall\\.com/order/confirm_order\\.htm': 'orderwrite_page_visit:tmall',
'buy\\.tmall\\.com/order/confirmOrder\\.htm': 'orderwrite_page_visit:tmall',
'cashier\\.jd\\.com': 'ordersuccess_page_visit:360buy',
'payment\\.suning\\.com': 'ordersuccess_page_visit:suning',
'gpay\\.gome\\.com\\.cn/cashier/default\\.dhtml': 'ordersuccess_page_visit:gome',
'cashierzth\\.alipay\\.com': 'ordersuccess_page_visit:tmall',
'cashierzui\\.alipay\\.com': 'ordersuccess_page_visit:tmall',
'vip\\.jd\\.com': 'vip_page_visit:360buy',
'vip\\.suning\\.com': 'vip_page_visit:suning',
'v\\.gome\\.com\\.cn': 'vip_page_visit:gome',
'vip\\.tmall\\.com': 'vip_page_visit:tmall'
};
var whiteList = ['jd', 'suning', 'taobao', 'tmall', 'gome'];
/*收藏事件dom*/
var collectEventDicts = {
'360buy': '#choose-btn-coll',
'gome': '#collect',
'suning': '#inerestBox',
'tmall': '#J_AddFavorite'
};
var getInfo = function getInfo(site) {
var type = __webpack_require__(24).isProductPage(document.referrer);
type = type ? 'product' : 'other';
var href = location.href;
for (var pattern in sitePattern) {
if (href.match(new RegExp(pattern))) {
log(type + sitePattern[pattern]);
return;
}
}
};
var collectProduct = function collectProduct(site) {
if (!collectEventDicts[site]) return;
$(collectEventDicts[site]).on('click', function () {
log('click:collection_click:' + site);
});
};
module.exports.init = function () {
getInfo();
for (var i = 0; i < whiteList.length; i++) {
if (location.host.indexOf(whiteList[i]) > -1) {
var site = whiteList[i];
if (site === 'jd') site = '360buy';
collectProduct(site);
return;
}
}
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
/***/ }),
/* 205 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function () {
var host = document.location.host;
if (host.indexOf('hao123') > -1 || host.indexOf('baidu') > -1) return true;else return false;
};
/***/ }),
/* 206 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== 'function') {
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function fNOP() {},
fBound = function fBound() {
return fToBind.apply(this instanceof fNOP ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
};
fNOP.prototype = this.prototype;
fBound.prototype = new fNOP();
return fBound;
};
}
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement, fromIndex) {
var k;
if (this == null) {
throw new TypeError('"this" is null or not defined');
}
var O = Object(this);
var len = O.length >>> 0;
if (len === 0) {
return -1;
}
var n = +fromIndex || 0;
if (Math.abs(n) === Infinity) {
n = 0;
}
if (n >= len) {
return -1;
}
k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
while (k < len) {
if (k in O && O[k] === searchElement) {
return k;
}
k++;
}
return -1;
};
}
// 邮乐网重写了filter
if (!Array.prototype.filter || location.host.indexOf('ule.com') > -1) {
Array.prototype.filter = function (fun /*, thisArg*/) {
if (this === void 0 || this === null) {
throw new TypeError();
}
var t = Object(this);
var len = t.length >>> 0;
if (typeof fun !== 'function') {
throw new TypeError();
}
var res = [];
var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
for (var i = 0; i < len; i++) {
if (i in t) {
var val = t[i];
if (fun.call(thisArg, val, i, t)) {
res.push(val);
}
}
}
return res;
};
}
if (location.host.indexOf('lianjia.com') > -1 || location.host.indexOf('.ke.') > -1) {
Number.prototype.toFixed = function (s) {
var changenum = (parseInt(this * Math.pow(10, s) + 0.5) / Math.pow(10, s)).toString();
var index = changenum.indexOf(".");
if (index < 0 && s > 0) {
changenum = changenum + ".";
for (var i = 0; i < s; i++) {
changenum = changenum + "0";
}
} else {
index = changenum.length - index;
for (var i = 0; i < s - index + 1; i++) {
changenum = changenum + "0";
}
}
return changenum;
};
}
if (location.host === 'item.jd.com' || location.host === 're.jd.com' || location.host === 'item.yhd.com') {
Array.prototype.forEach = function (callback /*, thisArg*/) {
var T, k;
if (this == null) {
throw new TypeError('this is null or not defined');
}
// 1. Let O be the result of calling toObject() passing the
// |this| value as the argument.
var O = Object(this);
// 2. Let lenValue be the result of calling the Get() internal
// method of O with the argument "length".
// 3. Let len be toUint32(lenValue).
var len = O.length >>> 0;
// 4. If isCallable(callback) is false, throw a TypeError exception.
// See: http://es5.github.com/#x9.11
if (typeof callback !== 'function') {
throw new TypeError(callback + ' is not a function');
}
// 5. If thisArg was supplied, let T be thisArg; else let
// T be undefined.
if (arguments.length > 1) {
T = arguments[1];
}
// 6. Let k be 0.
k = 0;
// 7. Repeat while k < len.
while (k < len) {
var kValue;
// a. Let Pk be ToString(k).
// This is implicit for LHS operands of the in operator.
// b. Let kPresent be the result of calling the HasProperty
// internal method of O with argument Pk.
// This step can be combined with c.
// c. If kPresent is true, then
if (k in O) {
// i. Let kValue be the result of calling the Get internal
// method of O with argument Pk.
kValue = O[k];
// ii. Call the Call internal method of callback with T as
// the this value and argument list containing kValue, k, and O.
callback.call(T, kValue, k, O);
}
// d. Increase k by 1.
k++;
}
// 8. return undefined.
};
}
/***/ }),
/* 207 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G) {
if ("ActiveXObject" in window) {
G.browser = {
engine: "trident",
agent: "msie",
ver: window.XMLHttpRequest ? document.querySelector ? document.addEventListener ? window.atob ? window.execScript ? 10 : 11 : 9 : 8 : 7 : 6
};
}
G.browser.version = G.browser.ver;
if (G.browser.agent === 'msie') G.browser.msie = true;
G.IE6 = G.browser.agent == "msie" && G.browser.ver === 6;
G.IE7 = G.browser.agent == "msie" && G.browser.ver === 7;
G.IE8 = G.browser.agent == "msie" && G.browser.ver === 8;
G.IE9 = G.browser.agent == "msie" && G.browser.ver === 9;
G.IE10 = G.browser.agent == "msie" && G.browser.ver === 10;
G.IE11 = G.browser.agent == "msie" && G.browser.ver === 11;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 208 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function (l) {
var x = "0123456789qwertyuioplkjhgfdsazxcvbnm";
var tmp = "";
for (var i = 0; i < l; i++) {
tmp += x.charAt(Math.ceil(Math.random() * 100000000) % x.length);
}
return tmp;
};
/***/ }),
/* 209 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(G, $) {
var template = __webpack_require__(5);
var userData = __webpack_require__(6);
var parseprice = __webpack_require__(16);
var request = __webpack_require__(2);
var log = __webpack_require__(9);
var cnzz = __webpack_require__(4);
var gwd_protocol = 'https:';
var timer, timer2, weight;
var HOST;
var noSale;
var HT = {};
var htX, htY, mouseDownX;
var country = 'us';
var cateDict, transDict;
/*转换成厘对应比例*/
var sizeDict = {
'米': 3000,
'厘米': 30,
'毫米': 3,
'英尺': 914.4,
'英寸': 76.2,
'码': 2743.2,
'尺': 1000,
'寸': 100,
'分': 10,
'厘': 1
};
var weightDict = {
'g': 1,
'kg': 1000,
'ounces': 28.35,
'pounds': 453.60
};
var clothesDict = {
'shangyi': {
'us': {
'man': ['us_man_sz.jpg', 'us_man_sz2.jpg'],
'woman': ['us_woman_sz.jpg', 'us_woman_sz2.jpg']
},
'uk': {
'man': ['uk_man_sz.jpg', 'uk_man_sz2.jpg'],
'woman': ['uk_woman_sz.jpg', 'uk_woman_sz2.jpg']
},
'jp': {
'man': ['jp_man_sz.jpg', 'jp_man_sz2.jpg'],
'woman': ['jp_woman_sz.jpg', 'jp_woman_sz2.jpg']
}
},
'xiazhuang': {
'us': {
'man': ['us_man_xz.jpg', 'us_man_xz2.jpg'],
'woman': ['us_woman_xz.jpg', 'us_woman_xz2.jpg']
},
'uk': {
'man': ['uk_man_xz.jpg', 'uk_man_xz2.jpg'],
'woman': ['uk_woman_xz.jpg', 'uk_woman_xz2.jpg']
},
'jp': {
'man': ['jp_man_xz.jpg', 'jp_man_xz2.jpg'],
'woman': ['jp_woman_xz.jpg', 'jp_woman_xz2.png']
}
},
'kidscloth': {
'us': ['us_kids.jpg', 'us_kids2_0.jpg', 'us_kids2_4.jpg'],
'uk': ['uk_kids.jpg', 'uk_kids2_0.jpg', 'uk_kids2_4.jpg'],
'jp': ['jp_kids.jpg', 'jp_kids2_4.jpg', 'jp_kids2_4.jpg']
},
'shoes': {
'man': ['woman_shoes_1.jpg', 'man_shoes2.jpg'],
'woman': ['woman_shoes_1.jpg', 'woman_shoes2.jpg'],
'kids': ['kids_shoes.jpg', 'kids_shoes2_0.jpg', 'kids_shoes2_4.jpg']
}
};
var sitePattern = {
'www.amazon.com': {
'coun': 'us',
'dom': ['#price_feature_div', '#unifiedPrice_feature_div'],
'position': 'after'
},
'www.amazon.co.jp': {
'coun': 'jp',
'dom': ['#price_feature_div', '#unifiedPrice_feature_div'],
'position': 'after'
},
'www.amazon.de': {
'coun': 'uk',
'dom': ['#price_feature_div', '#unifiedPrice_feature_div'],
'position': 'after'
},
'www.amazon.com.au': {
'coun': 'au',
'dom': ['#price_feature_div', '#unifiedPrice_feature_div'],
'position': 'after'
},
'www.6pm.com': {
'coun': 'us',
'dom': ['.mGIQz'],
'position': 'before'
}
};
var categoryDict1 = {
'coffee': '咖啡',
'snack': '饮料/保健品/其他食品',
'nut': '饮料/保健品/其他食品',
'pistachio': '饮料/保健品/其他食品',
'almond': '饮料/保健品/其他食品',
'chestnuts': '饮料/保健品/其他食品',
'walnut': '饮料/保健品/其他食品',
'hazelnut': '饮料/保健品/其他食品',
'pecan': '饮料/保健品/其他食品',
'cashew': '饮料/保健品/其他食品',
'peanut': '饮料/保健品/其他食品',
'chocolates': '饮料/保健品/其他食品',
'pastry': '饮料/保健品/其他食品',
'candy': '饮料/保健品/其他食品',
'condiment': '饮料/保健品/其他食品',
'ketchup': '饮料/保健品/其他食品',
'beverage': '饮料/保健品/其他食品',
'tea': '茶叶',
'coats': '外衣/衣服/冲锋衣',
'clothes': '外衣/衣服/冲锋衣',
'shirt': '外裤/裤子/衬衫/衬衣/T恤',
'sweaters': '外裤/裤子/衬衫/衬衣/T恤',
'lingerie': '内衣/内裤',
'tankinis': '内衣/内裤',
'bikinis': '内衣/内裤',
'loungewear': '内衣/内裤',
'underwear': '内衣/内裤',
'briefs': '内衣/内裤',
'swimsuit': '内衣/内裤',
'scarves': '配饰(帽子/围巾/头巾/丝巾/领带/腰带/手套)',
'hats': '配饰(帽子/围巾/头巾/丝巾/领带/腰带/手套)',
'scarf': '配饰(帽子/围巾/头巾/丝巾/领带/腰带/手套)',
'tie': '配饰(帽子/围巾/头巾/丝巾/领带/腰带/手套)',
'belt': '配饰(帽子/围巾/头巾/丝巾/领带/腰带/手套)',
'gloves': '配饰(帽子/围巾/头巾/丝巾/领带/腰带/手套)',
'bedding': '毛毯/被子/床罩/睡袋',
'quilt': '毛毯/被子/床罩/睡袋',
'bedspread ': '毛毯/被子/床罩/睡袋',
'leather': '皮鞋',
'boots': '皮靴/靴子',
'outdoor': '运动鞋/徒步鞋/涉水鞋/登山鞋/远足鞋',
'athletic': '运动鞋/徒步鞋/涉水鞋/登山鞋/远足鞋',
'sports': '运动鞋/徒步鞋/涉水鞋/登山鞋/远足鞋',
'wading': '运动鞋/徒步鞋/涉水鞋/登山鞋/远足鞋',
'climbing': '运动鞋/徒步鞋/涉水鞋/登山鞋/远足鞋',
'running': '运动鞋/徒步鞋/涉水鞋/登山鞋/远足鞋',
'sandals': '运动鞋/徒步鞋/涉水鞋/登山鞋/远足鞋',
'slippers': '运动鞋/徒步鞋/涉水鞋/登山鞋/远足鞋',
'insoles': '运动鞋/徒步鞋/涉水鞋/登山鞋/远足鞋',
'shoelaces': '运动鞋/徒步鞋/涉水鞋/登山鞋/远足鞋',
'suitcases': '箱/行李箱/旅行箱/手提箱',
'luggage': '箱/行李箱/旅行箱/手提箱',
'briefcases': '箱/行李箱/旅行箱/手提箱',
'travel': '箱/行李箱/旅行箱/手提箱',
'backpacks': '挎包/背包/邮差包/背包/单肩包/双肩包',
'satchel': '挎包/背包/邮差包/背包/单肩包/双肩包',
'bags': '挎包/背包/邮差包/背包/单肩包/双肩包',
'cases': '挎包/背包/邮差包/背包/单肩包/双肩包',
'handbags': '挎包/背包/邮差包/背包/单肩包/双肩包',
'clutches': '挎包/背包/邮差包/背包/单肩包/双肩包',
'wallet': '钱包/钥匙包',
'money': '钱包/钥匙包',
'key': '钱包/钥匙包',
'watches': '机械表',
'wrist': '机械表',
'dishwashers': '餐具/刀具',
'hoods': '餐具/刀具',
'drawers': '餐具/刀具',
'dath': '餐具/刀具',
'cutlery': '餐具/刀具',
'flatware': '餐具/刀具',
'kitchen & dining': '餐具/刀具',
'dining': '餐具/刀具',
'knife': '餐具/刀具',
'pot': '炊具/锅',
'cookware': '炊具/锅',
'kitchenware': '炊具/锅',
'cooktops': '炊具/锅',
'purifier': '净水器(含滤芯)',
'steamers': '电饭煲',
'ovens': '微波炉',
'juicer': '电动榨汁机',
'coffeemachine': '咖啡机',
'vacuums': '吸尘器',
'ceiling ': '电风扇',
'irons': '电熨斗',
'humidifiers': '增/除湿机/増除湿一体机',
'sewing': '电动缝纫机',
'refrigerators': '家电',
'freezers': '家电',
'compactors': '家电',
'washers': '家电',
'bulbs': '家电',
'shaver': '电动剃须刀',
'blood': '血压计/血糖计',
'glucose': '血压计/血糖计',
'dryer': '电吹风机',
'toothbrush': '电动牙刷',
'sunscreen': '防晒露/防晒霜/防嗮乳液',
'lotions': '防晒露/防晒霜/防嗮乳液',
'scream': '护手霜',
'lipstick': '唇膏',
'perfume': '香水',
'masks': '面膜',
'toner': '爽肤水',
'phones': '触屏式手机',
'cameras': '数码相机/卡片机/DC',
'canon': '数码相机/卡片机/DC',
'joystick': '游戏机遥控器/控制器/手柄/摇杆/方向盘',
'controller': '游戏机遥控器/控制器/手柄/摇杆/方向盘',
'recorder': '录音笔/录音机/收音机',
'radios': '录音笔/录音机/收音机',
'echo': '音箱(音响设备)',
'stereos': '音箱(音响设备)',
'laptop': '笔记本电脑/含平板电脑',
'memory': '内存条4G以上',
'cards': '功能卡/显卡/声卡等',
'card': '功能卡/显卡/声卡等',
'mice': '鼠标',
'keyboards': '键盘',
'input': '键盘',
'scanner': '投影仪',
'screens': '投影仪',
'disk': '移动硬盘1TB-2TB(含2TB)',
'toys': '玩具',
'mp3 players': 'MP3播放器',
'diapering': '婴儿用品'
};
var categoryDict2 = {
'food': {
'tle': '食品',
'cate': 'cate1'
},
'clothing': {
'tle': '服饰',
'cate': 'cate2'
},
'packs': {
'tle': '鞋、箱包',
'cate': 'cate3'
},
'shoes': {
'tle': '鞋、箱包',
'cate': 'cate3'
},
'bags': {
'tle': '鞋、箱包',
'cate': 'cate3'
},
'kitchen & dining': {
'tle': '厨房、餐厅',
'cate': 'cate4'
},
'home & kitchen': {
'tle': '家电',
'cate': 'cate6'
},
'health & personal': {
'tle': '个人护理',
'cate': 'cate7'
},
'beauty ': {
'tle': '美容',
'cate': 'cate8'
},
'camera & photo ': {
'tle': '照相机、摄像机',
'cate': 'cate11'
},
'electronics': {
'tle': '电子数码',
'cate': 'cate12'
},
'cumputers': {
'tle': '个人电脑',
'cate': 'cate15'
},
'diapering': {
'tle': '婴儿用品',
'cate': 'cate18'
}
};
var searchCateDict = ['#wayfinding-breadcrumbs_feature_div .a-list-item .a-link-normal', '#SalesRank .zg_hrsr_ladder a'];
var weightDom = {
'www.amazon.com': ['#detailBullets_feature_div .a-list-item .a-text-bold:contains(Weight) + span', '#technical-details-table td:contains(Weight)+td', '#detail-bullets ul li:contains(Weight)', '#technical-details_feature_div table.a-keyvalue th.a-nowrap:contains("Shipping Weight")+td'],
'www.amazon.de': ['#detail_bullets_id ul li:contains(Produktgewicht)', '#prodDetails .shipping-weight .value'],
'www.amazon.co.jp': ['#detail_bullets_id ul li:contains(発送重量)', '.shipping-weight .value'],
'www.6pm.com': ['#prdInfoText .measurements li:contains(Weight)']
};
/*初始化*/
function init() {
if (G.IE6 || G.IE7 || G.IE8 || G.IE9) return;
if (!isHaitaoPage()) return;
getCountry();
getMessage(function () {
insertHtml();
if ($('#gwd_ht_main').length == 0) return;
render_size_detail();
render_trans_detail();
insertShop();
insertSize(clothesDict['shangyi'][country]['man'][0], clothesDict['shangyi'][country]['man'][1]);
addEvent();
addSizeEvent();
fixPageCss();
getSelect();
searchCate();
showTransport();
changePrice();
listenPrice();
if (G.email) {
check_favor();
} else {
$(document).on('checkfavor', function () {
check_favor();
});
}
checkRemove();
});
}
var checkTime = 0;
var checkRemove = function checkRemove() {
if (checkTime > 10) {
clearTimeout(tt);
return;
}
var tt = setTimeout(function () {
if ($('#gwd_ht_main .ht_head .gwd_site_icon').length === 0) {
$('#gwd_ht_main').remove();
init();
} else {
checkTime++;
checkRemove();
}
}, 4000);
};
function editCurrent(arr) {
/*配置文件有一些不是人民币,需要转换*/
if (!arr) return [];
/*参加活动的转运商家随机排序, 其他的放后面*/
var looparr = [],
elsearr = [];
for (var i = 0; i < arr.length; i++) {
if (arr[i]['current'] && !arr[i]['asce']) {
if (arr[i]['type']) {
arr[i].firstW[1] = parseprice(arr[i].firstW[1], arr[i]['type']);
arr[i].nextW[1] = parseprice(arr[i].nextW[1], arr[i]['type']);
} else {
arr[i].firstW[1] = parseprice(arr[i].firstW[1]);
arr[i].nextW[1] = parseprice(arr[i].nextW[1]);
}
}
if (arr[i].sale_tle) noSale = true;
if (arr[i].cooper) looparr.push(arr[i]);else elsearr.push(arr[i]);
/*有一些转运商家使用货币和当前网页使用的汇率不一致,需要再请求一次汇率*/
}
arr = looparr.sort(function () {
return Math.random() - 0.5;
}).concat(elsearr);
return arr;
}
function getMessage(callback) {
var url = gwd_protocol + '//browser.' + G.extName + '.com/extension?ac=haitaoInfo';
request.get(url).done(function (data) {
if (data && data.cate && data.trans) {
cateDict = data.cate;
transDict = data.trans;
transDict[country] = editCurrent(transDict[country]);
callback();
}
});
}
function isHaitaoPage() {
/*判断是否是海淘页面*/
var host = location.host;
for (var pattern in sitePattern) {
if (host == pattern) return true;
}
return false;
}
function setTariff(t) {
/*自动设置关税 --- 2级分类*/
$('.ht_tariff_btn span').text(t.slice(0, 5));
$('.ht_tariff_btn span').attr('title', t);
$('#cate_small').val(t);
$('.ht_tariff_cate').text(t);
replaceStr('#cate_small');
replaceStr('.ht_tariff_cate', 'text', 4);
for (var pattern in cateDict) {
var len = cateDict[pattern].length;
for (var i = 0; i < len; i++) {
if (cateDict[pattern][i][1] == t) {
var txt = $('#big_xiala a[cate="' + pattern + '"]').text();
$('#cate_big').val(txt);
replaceStr('#cate_big');
insertCate(cateDict[pattern]);
$('.ht_tariff .ht_tariff_num em').text(cateDict[pattern][i][0]);
}
}
}
}
function setTariff2(p) {
/*自动设置关税 --- 1级分类*/
var t = categoryDict2[p].tle;
var cate = categoryDict2[p].cate;
$('.ht_tariff_btn span').text(t.slice(0, 5));
$('.ht_tariff_btn span').attr('title', t);
$('#cate_big').val(t);
replaceStr('#cate_big');
$('#cate_small').val(cateDict[cate][cateDict[cate].length - 1][1]);
$('.ht_tariff_cate').text(cateDict[cate][cateDict[cate].length - 1][1]);
replaceStr('#cate_small');
replaceStr('.ht_tariff_cate', 'text', 4);
insertCate(cateDict[cate]);
$('.ht_tariff .ht_tariff_num em').text(cateDict[cate][cateDict[cate].length - 1][0]);
}
function matchCate(t) {
/*匹配2级分类*/
for (var pattern in categoryDict1) {
if (t.indexOf(pattern) > -1) {
return categoryDict1[pattern];
}
}
/*二级分类未匹配到,匹配一级分类*/
for (var pattern in categoryDict2) {
if (t.indexOf(pattern) > -1) {
setTariff2(pattern);
return;
}
}
return false;
}
function getClothes(t, c) {
switch (t) {
case '男装':
return clothesDict['shangyi'][c]['man'];
case '女装':
return clothesDict['shangyi'][c]['woman'];
case '童装':
return clothesDict['kidscloth'][c];
case '男鞋':
return clothesDict['shoes']['man'];
case '女鞋':
return clothesDict['shoes']['woman'];
case '童鞋':
return clothesDict['shoes']['kids'];
}
}
function searchCate() {
/*查找分类关键词*/
for (var j = 0; j < searchCateDict.length; j++) {
var dom = searchCateDict[j];
var len = $(dom).length;
for (var i = len - 1; i >= 0; i--) {
var txt = $(dom).eq(i).text().toLowerCase();
var m = matchCate(txt);
if (m) {
setTariff(m);
return;
}
}
}
}
function fixPageCss() {
if (navigator.userAgent.toLowerCase().indexOf('chrome') == -1) {
$('#gwd_ht_main').addClass('ie_hack');
$('#transport_detail').addClass('ie_hack');
$('#size_detail').addClass('ie_hack');
}
if (HOST == 'www.6pm.com') {
var width = $('#gwd_ht_main').parent().outerWidth();
var newwidth = width - 355;
$('#gwd_ht_main').css('margin-left', newwidth / 2 + 'px');
}
}
function isZiying() {
if (HOST == 'www.6pm.com') return 'ziying';
if ($('#merchant-info').length > 0) {
if (HOST == 'www.amazon.com') {
if ($('#merchant-info').text().indexOf('sold by Amazon') > -1) return 'ziying';else return 'sanfang';
}
if (HOST == 'www.amazon.co.jp') {
if ($('#merchant-info').text().indexOf('jp が販売') > -1) return 'ziying';else return 'sanfang';
}
if (HOST == 'www.amazon.de') {
if ($('#merchant-info').text().indexOf('Verkauf und Versand durch Amazon') > -1) return 'ziying';else if ($('#merchant-info').text().indexOf('Dispatched from and sold by Amazon') > -1) return 'ziying';else return 'sanfang';
}
} else return 'sanfang';
}
function isZhiyou() {
if (HOST == 'www.amazon.de') {
if ($('#ddmShippingMessage').text().indexOf('Dieser Artikel kann nach') > -1 && $('#ddmInlineAddressInfo').text().indexOf('China') > -1) return 'zhiyou';else return 'feizhiyou';
}
if ($('#detail-bullets .content ul li:contains("International Shipping")').length > 0) return 'zhiyou';
if ($('.shipping-restrictions .label:contains("International")').length > 0) return 'zhiyou';else return 'feizhiyou';
}
function insertHtml() {
/*插入主界面*/
__webpack_require__(211);
var html = __webpack_require__(213);
var t = template.compile(html)({
data: {
'pageclass': addPageclass(),
'getprice': calPrice(),
'unit_price': getPrice(),
'protype': isZiying(),
'mailtype': isZhiyou(),
'he_weight': getWeight(),
'hosts': HOST,
'site': G.site == '6pm' ? '6PM' : '亚马逊',
c_server: G.c_server
}
});
var dom, arr;
arr = sitePattern[HOST]['dom'];
for (var i = 0; i < arr.length; i++) {
if ($(arr[i]).length > 0) dom = arr[i];
}
if (!dom) return;
switch (sitePattern[HOST]['position']) {
case 'before':
$(dom).before(t);
break;
case 'after':
$(dom).after(t);
break;
}
log('track:haitao:main');
cnzz.log('显示海淘主界面');
}
function addPageclass() {
var s = 'ht_' + HOST.split('.')[1];
return s;
}
function getCountry() {
/*获取页面所属地区*/
var host = location.host;
for (var pattern in sitePattern) {
if (pattern == host) {
country = sitePattern[pattern]['coun'];
HOST = pattern;
}
}
}
function getWeightNum(t) {
var p = t.match(/[0-9]+(?:\.|\,|)(?:[0-9]+|)/);
if (p) p = p[0];
if (HOST == 'www.amazon.de') p = p.toString().replace(',', '.');
return p;
}
function getWeightType(t) {
switch (HOST) {
case 'www.amazon.com':
if (t.indexOf('pounds') > -1) return 'pounds';
if (t.indexOf('ounces') > -1) return 'ounces';
break;
case 'www.amazon.de':
if (t.indexOf('Kg') > -1) return 'kg';
if (t.indexOf('g') > -1) return 'g';
break;
case 'www.amazon.co.jp':
if (t.indexOf('Kg') > -1) return 'kg';
if (t.indexOf('g') > -1) return 'g';
break;
case 'www.6pm.com':
if (t.indexOf('lb') > -1 && t.indexOf('oz') > -1) return 'lb_oz';
if (t.indexOf('lb') > -1) return 'pounds';
if (t.indexOf('oz') > -1) return 'ounces';
break;
}
}
function getWeight(noCache) {
if (HT.weight && !noCache) return HT.weight;
var weight_1 = 0;
var domarr = weightDom[HOST];
var len = domarr.length;
for (var i = 0; i < len; i++) {
var w = $(domarr[i]).text();
if (w != '') {
var type = getWeightType(w);
if (type == 'lb_oz') {
var m = w.match(/[0-9]+/g);
weight_1 = Math.round((weightDict['pounds'] / 1000 * parseInt(m[0]) + weightDict['ounces'] / 1000 * parseInt(m[1])) * 100) / 100;
HT.weight = weight_1;
return weight_1;
}
if (type != '') {
weight_1 = Math.round(weightDict[type] / 1000 * getWeightNum(w) * 100) / 100;
if (weight_1 !== 0 && !weight_1) weight_1 = 0;
HT.weight = weight_1;
return weight_1;
}
}
}
}
function showTransport(noCache) {
var weight_2 = getWeight(noCache);
if (!weight_2 || weight_2 == 0) return;
/*nocache为true时候,说明重量更新,需要重新设置重量*/
if (noCache) $('.ht_weight_num').val(weight_2);
var minT = changeTransPrice(weight_2);
var title = $('#trans_list li .trans_com').eq(minT.minindex).text();
if (title == '') return;
if (minT.minprice == 99999999) return;
$('.ht_freight_num').text('¥' + minT.minprice);
$('.ht_transport_btn span').text(title);
}
function getPrice() {
return G.dp.price || '0';
}
function calPrice(p) {
/*计算价格*/
var price = 0;
if (p) price = p;else price = getPrice();
var transP = $('.ht_freight_num').text().match(/[0-9.]+/);
if (transP) transP = transP[0];
var tariffP = $('.ht_tariff .ht_tariff_num em').text().match(/[0-9.]+/);
if (tariffP) tariffP = tariffP[0];
if ($('.ht_tariff .ht_tariff_num') && $('.ht_tariff .ht_tariff_num').attr('data-price') == "0") {
tariffP = 0;
}
if (!tariffP) tariffP = 0;
if (!transP) transP = 0;
price = Number((Number(price) + Number(transP) + Number(tariffP)).toLocaleString().replace(/,/g, ''));
if (price.toString().match(/\.\d{3}/)) {
price = price.toString().replace(/(\.\d{2})\d+/, '$1');
}
return price;
}
function changeZiying() {
/*价格变化可能是否是自营也会变化*/
setTimeout(function () {
var ziying = isZiying();
$('.pro_type em').attr('class', ziying);
if (ziying == 'ziying') {
$('.pro_type .pro_t_tle').text('自营');
$('.pro_type_detail').text((G.site == '6pm' ? '6PM' : '亚马逊') + '直接销售。');
} else {
$('.pro_type .pro_t_tle').text('第三方');
$('.pro_type_detail').text((G.site == '6pm' ? '6PM' : '亚马逊') + '第三方商家销售。');
}
}, 1000);
}
function listenPrice() {
/*监听价格变化*/
var priceDom = '#priceblock_ourprice';
var subdom = 'price_feature_div';
if (G.site == '6pm') {
priceDom = '#priceSlot .price';
subdom = "productForm";
}
var oldprice = $(priceDom).text();
var dom = document.getElementById(subdom);
if (dom && dom.addEventListener) {
dom.addEventListener('DOMSubtreeModified', function () {
var pageprice = $(priceDom).text();
if (pageprice != oldprice && pageprice) {
oldprice = pageprice;
pageprice = parseprice(pageprice);
$('.ht_content .price_num').text('¥' + pageprice);
/*价格发生变化,说明用户改变了一些信息,重量 自营也会跟着改变*/
changePrice(pageprice);
changeZiying();
setTimeout(function () {
showTransport(true);
}, 800);
}
}, false);
}
}
function changePrice(p) {
var price = '¥' + calPrice(p);
$('.ht_getprice_num').text(price);
}
function calDetailPos() {
var wWeight = ($(window).width() - 595) / 2;
var wHeight = ($(window).height() - 420) / 2;
return {
'posx': wWeight,
'posy': wHeight
};
}
function render_size_detail() {
var html = __webpack_require__(214);
$('body').append(template.compile(html)({
pos: calDetailPos()
}));
}
function render_trans_detail() {
var html = __webpack_require__(215);
$('body').append(template.compile(html)({
pos: calDetailPos(),
'ht_weight': getWeight(),
c_server: G.c_server
}));
}
function insertSize(headimg, itemimg) {
/*插入尺码帮助内容*/
var Html = '
';
$('.size_s').empty().append(template.compile(Html)({
'imgurl': headimg
}));
$('.size_item_img').empty().append(template.compile(Html)({
'imgurl': itemimg
}));
}
function findShop(name) {
if (!transDict) return null;
var transdata = transDict[country];
for (var i = 0; i < transdata.length; i++) {
if (name === transdata[i].shopId && transdata[i]['asce']) {
var ascearr = transdata[i]['ascearr'];
var current = transdata[i]['current'];
return {
'ascearr': ascearr,
'current': current
};
}
}
}
/*改变运费值*/
function changeTransPrice(weight) {
var minprice = 99999999;
var minindex = 0;
var dom = $('#trans_list li .trans_pr');
var len = $(dom).length;
for (var i = 0; i < len; i++) {
var fp = Number($(dom).eq(i).attr('data-fp'));
var fw = Number($(dom).eq(i).attr('data-fw'));
var sw = Number($(dom).eq(i).attr('data-sw'));
var sp = Number($(dom).eq(i).attr('data-sp'));
var name = $(dom).eq(i).attr('data-shopname');
if (name) {
var shopInfo = findShop(name);
if (!shopInfo) return;
var price = calTrans2(weight, shopInfo['ascearr'], shopInfo['current']);
} else {
var price = calTrans(weight, [fp, fw, sp, sw]);
}
/*因为不考虑最便宜逻辑,随机选择,因为排列的随机的,所以这里就选择第一个*/
if (i == 0) {
minprice = price;
}
$(dom).eq(i).text('¥' + price);
}
return {
'minindex': minindex,
'minprice': minprice
};
}
function conversionSize() {
/*尺码转换*/
var first = $('.first_xiala').val();
var second = $('.second_xiala').val();
var num = $('#first_size').val();
if (num) num = Number(num);
var n1 = sizeDict[first];
var n2 = sizeDict[second];
var n3 = num * n1 / n2;
if (n3.toString().indexOf('.') > -1) n3 = n3.toFixed(2);
$('#second_size').val(n3);
}
/*计算运费*/
function calTrans(weight, arr) {
/*fp:首重价格 fw 首重的重量 sp 续重价格 sp 续重重量*/
var fp = arr[0],
fw = arr[1],
sp = arr[2],
sw = arr[3];
var price;
var pow = 1;
if (sw.toString().indexOf('.') > -1) pow = sw.toString().match(/\.(\d+)/)[1].length;
if (fp == "0") {
price = weight / sw * sp;
} else if (weight <= fw) {
price = fp;
} else {
var weight2 = weight - fw;
var weight3 = 0;
if (weight2 * Math.pow(10, pow) % (sw * Math.pow(10, pow)) == 0) weight3 = weight2 / sw;else weight3 = parseInt(weight2 / sw) + 1;
var price = fp + weight3 * sp;
}
return Number(price).toFixed(2);
}
/*针对梯度增长计费的转运公司计算运费*/
function calTrans2(weight, arr, rmb) {
weight = Number(weight);
for (var i = 0; i < arr.length; i++) {
if (arr[i][0] > weight) {
if (i == 0) i = 1; //如果是第一个就用第一个的数据
else if (arr[i - 1][0] < weight) i = i + 1; //如果大于前面一个重量, 说明在两者之间, 应该选择当前,所以+1
if (!rmb) {
return Number(arr[i - 1][1]).toFixed(2);
} else {
return parseprice(arr[i - 1][1]).toFixed(2);
}
}
}
if (weight > arr[arr.length - 1][0]) {
if (!rmb) {
return Number(arr[arr.length - 1][1]).toFixed(2);
} else {
return parseprice(arr[arr.length - 1][1]).toFixed(2);
}
}
}
function changeFreight() {
/*改变运费*/
var weight = Number($('.ht_weight .ht_weight_num').val()) || 0;
var transShop = $('.ht_transport_btn span').attr('data-title');
var tsdata = transDict[country];
var first, next, asce, asceArr, current; //asce 判断是否为递增的运费计算方式
for (var i = 0; i < tsdata.length; i++) {
if (tsdata[i]['shopname'] == transShop) {
first = tsdata[i]['firstW'];
next = tsdata[i]['nextW'];
asce = tsdata[i]['asce'];
asceArr = tsdata[i]['ascearr'];
current = tsdata[i]['current'];
}
}
if (asce) {
var price = '¥' + calTrans2(weight, asceArr, current);
} else {
var price = '¥' + calTrans(weight, [first[1], first[0], next[1], next[0]]);
}
$('.ht_freight_num').text(price);
}
function insertShop() {
/*插入转运商家*/
var trans = transDict[country];
var html = '{{each data}}\n
\n {{$value.shopname}} \n {{$value.warehouse}} \n {{$value.firstW[1]==0?"无首重":("¥"+$value.firstW[1])}} \n {{if $value.cooper}}{{$value.sale_tle}} {{/if}}\n \n {{/each}}';
$('#trans_list').append(template.compile(html)({
data: trans
}));
changefirstW();
if (!noSale) $('#transport_detail').addClass('no_sale');
}
function changefirstW() {
var trans = transDict[country];
$('#trans_list li .trans_pr').each(function (index, e) {
if ($(e).text() == "无首重") {
for (var i = 0; i < trans.length; i++) {
if (trans[i].shopId === $(e).attr('data-shopname')) {
if (trans[i].current) $(e).text('¥' + Number(parseprice(trans[i].ascearr[0][1])).toFixed(2));else $(e).text('¥' + Number(trans[i].ascearr[0][1]).toFixed(2));
}
}
} else {
var price = $(e).text().replace('¥', '');
price = '¥' + Number(price).toFixed(2);
$(e).text(price);
}
});
}
function transWeight(type, w) {
if (type == 'LB') {
w = Number(w) * 0.4536;
}
return w;
}
function addShopEvent() {
/*重量输入框焦点事件*/
$('.trans_w input').on('keyup', function () {
var txt = Number($(this).val());
var weight_type = $('.trans_w input+.weight_type').text();
var weight = transWeight(weight_type, txt);
if (txt === 0) return;else if (!txt) {
/*eslint-disable */
alert('请输入数字!');
/*eslint-enable */
} else {
changeTransPrice(weight);
}
});
$('#trans_list li .sale_tle a').on('click', function () {
log('click:haitao:sale_tle');
cnzz.log('海淘转运商家优惠政策点击情况');
});
$('#trans_list li .trans_com').on('click', function () {
log('click:haitao:trans_com');
cnzz.log('海淘转运商家网站点击情况');
});
$('#trans_list li .lo_center, #trans_list li .trans_pr').on('click', function () {
var txt = $(this).parent().find('.trans_com').text();
$('.ht_transport_btn span').text(txt.slice(0, 5));
$('.ht_transport_btn span').attr('data-title', txt);
changeFreight();
changePrice();
$('#transport_detail').hide();
});
}
function addSizeEvent() {
/*添加尺码部分事件*/
$('.clothes_nav li').on('click', function () {
$('.clothes_nav li').removeClass('select');
$(this).addClass('select');
var txt = $(this).text();
var c = getClothes(txt, country);
if (txt.indexOf('鞋') > -1) {
$('.unit_cm').css('display', 'none');
$('.unit_mm').css('display', 'inline-block');
$('#size_detail .detail_left span').hide();
$('.cloth_icon').css('display', 'inline-block');
$('#size_detail .shoes').css('display', 'inline-block');
if (txt.indexOf('男鞋') > -1) {
$('.cloth_icon').attr('class', '').addClass('cloth_icon ht_shoes man_foot');
$('.detail_left .shoes').text(txt);
} else if (txt.indexOf('女鞋') > -1) {
$('.cloth_icon').attr('class', '').addClass('cloth_icon ht_shoes woman_foot');
$('.detail_left .shoes').text(txt);
} else {
$('#size_detail .shoes').hide();
$('.cloth_icon').css('display', 'inline-block');
$('.tongxie').css('display', 'inline-block');
$('.tongxie0').addClass('size_hover');
$('.tongxie4').removeClass('size_hover');
$('.cloth_icon').attr('class', '').addClass('cloth_icon ht_shoes kids_foot');
}
} else if (txt.indexOf('童装') > -1) {
$('.unit_mm').css('display', 'none');
$('.unit_cm').css('display', 'inline-block');
$('#size_detail .detail_left span').hide();
$('#size_detail .tongzhuang').css('display', 'inline-block');
$('.cloth_icon').css('display', 'inline-block');
$('.cloth_icon').attr('class', '').addClass('cloth_icon kid0');
$('.tongzhuang0').addClass('size_hover');
$('.tongzhuang4').removeClass('size_hover');
} else if (txt.indexOf('男装') > -1) {
$('.unit_mm').css('display', 'none');
$('.unit_cm').css('display', 'inline-block');
$('#size_detail .detail_left span').hide();
$('.cloth_icon').css('display', 'inline-block');
$('#size_detail .shangyi').show();
$('#size_detail .xiazhuang').show();
$('.xiazhuang').removeClass('size_hover');
$('.shangyi').addClass('size_hover');
$('.cloth_icon').attr('class', '').addClass('cloth_icon manshangzhuang');
} else {
$('.unit_mm').css('display', 'none');
$('.unit_cm').css('display', 'inline-block');
$('#size_detail .detail_left span').hide();
$('.cloth_icon').css('display', 'inline-block');
$('#size_detail .shangyi').show();
$('#size_detail .xiazhuang').show();
$('.xiazhuang').removeClass('size_hover');
$('.shangyi').addClass('size_hover');
if (txt.indexOf('男装') > -1) $('.cloth_icon').attr('class', '').addClass('cloth_icon manshangzhuang');else $('.cloth_icon').attr('class', '').addClass('cloth_icon womanshangzhuang');
}
insertSize(c[0], c[1]);
});
$('.shangyi').on('click', function () {
if ($(this).attr('class').indexOf('size_hover') > -1) return;
var txt = $('.clothes_nav li[class="select"]').text();
if (txt == "童装") return;
if (txt == "男装") {
$('.cloth_icon').attr('class', '').addClass('cloth_icon manshangzhuang');
}
if (txt == "女装") {
$('.cloth_icon').attr('class', '').addClass('cloth_icon womanshangzhuang');
}
var c = getClothes(txt, country);
insertSize(c[0], c[1]);
$(this).addClass('size_hover');
$('.xiazhuang').removeClass('size_hover');
});
$('.xiazhuang').on('click', function () {
if ($(this).attr('class').indexOf('size_hover') > -1) return;
var txt = $('.clothes_nav li[class="select"]').text();
if (txt == "童装") return;
if (txt == "男装") {
var c = clothesDict['xiazhuang'][country]['man'];
insertSize(c[0], c[1]);
$('.cloth_icon').attr('class', '').addClass('cloth_icon manxiazhuang');
}
if (txt == "女装") {
var c = clothesDict['xiazhuang'][country]['woman'];
insertSize(c[0], c[1]);
$('.cloth_icon').attr('class', '').addClass('cloth_icon womanxiazhuang');
}
$(this).addClass('size_hover');
$('.shangyi').removeClass('size_hover');
});
$('.tongzhuang0').on('click', function () {
var c = getClothes('童装', country);
insertSize(c[0], c[1]);
$(this).addClass('size_hover');
$('.tongzhuang4').removeClass('size_hover');
$('.cloth_icon').attr('class', '').addClass('cloth_icon kid0');
});
$('.tongzhuang4').on('click', function () {
var c = getClothes('童装', country);
insertSize(c[0], c[2]);
$(this).addClass('size_hover');
$('.tongzhuang0').removeClass('size_hover');
$('.cloth_icon').attr('class', '').addClass('cloth_icon kid4');
});
$('.tongxie0').on('click', function () {
var c = getClothes('童鞋', country);
insertSize(c[0], c[1]);
$(this).addClass('size_hover');
$('.tongxie4').removeClass('size_hover');
});
$('.tongxie4').on('click', function () {
var c = getClothes('童鞋', country);
insertSize(c[0], c[2]);
$(this).addClass('size_hover');
$('.tongxie0').removeClass('size_hover');
});
}
var reqCollect = function reqCollect(url, callback) {
request.get(url).done(function (data) {
callback(data);
}).fail(function () {
$('#ht_addcollect').text('添加失败');
$('#ht_addcollect').removeClass('c_adding');
$('#ht_addcollect').addClass('c_added');
});
};
var check_favor = function check_favor() {
var id = userData.get('other_info').now.dp_id;
if (!G.email || !id) return;
var url = G.c_server + '/brwext/check_collected?email=' + G.email + '&dp_id=' + id;
request.get(url).done(function (data) {
if (data && data.msg === true) {
$('#ht_addcollect').text('已添加');
$('#ht_addcollect').addClass('c_added');
}
});
};
function addCollect() {
var pagedp = G.dp;
var oinfo = userData.get('other_info');
var dp = oinfo.now;
if (!dp.dp_id) {
$('#ht_addcollect').text('暂不支持');
$('#ht_addcollect').unbind('click');
return;
}
$('#ht_addcollect').text('正在添加');
$('#ht_addcollect').addClass('c_adding');
dp.price = pagedp.oldPrice || oinfo['code-server'] && oinfo['code-server'].price;
dp.title = pagedp.name || $('title').html();
dp.url = dp.url || location.href;
dp.img = dp.img || pagedp.img;
var url = G.c_server + '/collect/aj_add?dp_id= ' + dp.dp_id + '&url=' + encodeURIComponent(dp.url || G.dp.url) + '&img=' + encodeURIComponent(dp.img || G.dp.img) + '&title=' + encodeURIComponent(dp.title) + '&price=' + dp.price + '&site_id=' + dp.site_id + '&cat_id=' + G.dp.cat_id;
reqCollect(url, function (data) {
if (data.code == 100 || data.code <= 0) {
var href = window.location.href.toString();
//这里进行特殊处理,标记来源的url,在页面返回的时候,自动收藏商品
if (href.indexOf('?') > -1) {
href += '&gwd_add_favor_unique=true';
} else {
href += "?gwd_add_favor_unique=true";
}
window.location.href = G.c_server + "/user/login?from_url=" + encodeURIComponent(href);
} else if (data.code == 1) {
$('#ht_addcollect').text('已添加');
$('#ht_addcollect').removeClass('c_adding');
$('#ht_addcollect').addClass('c_added');
$("#ht_addcollect").unbind('click');
} else if (data.code == 2) {
$('#ht_addcollect').text('添加过了');
$('#ht_addcollect').removeClass('c_adding');
$('#ht_addcollect').addClass('c_added');
$("#ht_addcollect").unbind('click');
}
});
}
function contentEvent() {
/*主窗口事件*/
$('.ht_head .ht_getprice').on('mouseenter', function () {
var dom = $('#ht_content_info');
if (!dom.is(':visible')) {
$('.content_default').hide();
dom.show();
}
});
/*关闭弹窗框*/
$('.closebar').on('click', function () {
$(this).parent().hide();
});
/*添加划词翻译直邮第三方信息提示*/
$('.content_default_left .ht_tariff .del_line').on('mouseenter', function () {
$('.tariff_remind_detail').show();
});
$('.content_default_left .ht_tariff .del_line').on('mouseleave', function () {
$('.tariff_remind_detail').hide();
});
$('.ht_translate').on('mouseenter', function () {
$('.translate_detail').show();
});
$('.ht_translate').on('mouseleave', function () {
$('.translate_detail').hide();
});
$('.pro_type').on('mouseenter', function () {
$('.pro_type_detail').show();
}).on('mouseleave', function () {
$('.pro_type_detail').hide();
});
$('.mail_type').on('mouseenter', function () {
$('.mail_type_detail').show();
}).on('mouseleave', function () {
$('.mail_type_detail').hide();
});
$('.ht_transport_btn, .size_help, .ht_tariff_btn, #ht_addcollect').on('mouseenter', function () {
$(this).find('.div_detail').show();
}).on('mouseleave', function () {
$(this).find('.div_detail').hide();
});
$('.weight_type').on('mouseenter', function () {
$('.weight_type_detail').show();
}).on('mouseleave', function () {
$('.weight_type_detail').hide();
});
// 添加降价提醒
$('#ht_addcollect').on('click', function (event) {
var dom = $('#altImages li img').eq(0);
if (dom) G.collectInfo.img = dom.attr('src');
event.preventDefault();
addCollect();
});
// 重量单位选择
$('.ht_weight .weight_type').on('click', function () {
var t = $(this).text();
if (t === 'LB') {
weight = $('.ht_weight_num').val();
$(this).text('KG');
$('.ht_weight_num').val(Math.round(Number(weight) * 0.4535924 * 100) / 100);
} else {
$(this).text('LB');
if (weight) $('.ht_weight_num').val(weight);
}
});
// 是否选取关税
$('.del_line').on('click', function () {
if ($(this).attr('data-del') === '1') {
$(this).find('.ht_tariff_num').css('text-decoration', 'none');
$(this).attr('data-del', '0');
$(this).find('span').attr('data-price', $(this).find('span').text());
changePrice();
} else {
$(this).find('.ht_tariff_num').css('text-decoration', 'line-through');
$(this).attr('data-del', '1');
$(this).find('span').attr('data-price', 0);
changePrice();
}
});
// 转运中国弹窗框
$('.ht_transport_btn').on('click', function () {
$('#transport_detail').show();
log('click:haitao:transport');
cnzz.log('海淘转运商家点击情况');
});
/*尺寸转换*/
$('.size_help').on('click', function () {
$('#size_detail').show();
log('click:haitao:size_help');
cnzz.log('点击尺码帮助');
});
$('.size_xiala').on('mouseenter', function () {
$(this).next('.size_xialabox').show();
$(this).addClass('msHover');
});
$('.size_xiala').on('mouseleave', function () {
var that = this;
timer = setTimeout(function () {
$(that).next('.size_xialabox').hide();
$(that).removeClass('msHover');
}, 100);
});
$('.size_xialabox').on('mouseenter', function () {
clearTimeout(timer);
});
$('.size_xialabox').on('mouseleave', function () {
$(this).hide();
});
$('.size_xialabox a').on('click', function () {
var txt = $(this).text();
var c = $(this).parent().attr('data-size');
$('.' + c).val(txt);
$(this).parent().hide();
conversionSize();
});
$('#first_size').on('keyup', function () {
conversionSize();
});
}
// function otherPageEvent() {
// let arr = ['#variation_size_name', '#variation_configuration', '#variation_color_name', '#variation_style_name']
// let dom = '';
// for (let i=0; i
0 && $(arr[i]).find('li').length > 0)
// dom = arr[i]
// }
// $(dom).find('li').each(function() {
// $(this).on('click', function() {
// let txt = $(this).find('.a-size-mini').eq(0).text()
// if (txt == '' || !txt) return;
// let price = parseprice(txt)
// $('.ht_content .price_num').text('¥' + price)
// $('.ht_getprice_num').text('¥' + calPrice(price));
// })
// })
// }
function addEvent() {
contentEvent();
cateEvent();
addShopEvent();
// otherPageEvent()
}
function insertCate(c) {
/*插入二级分类*/
var html = '{{each data}}{{$value[1]}} {{/each}}';
$('#cate_small').next('.xialabox').empty().append(template.compile(html)({
data: c
}));
/*插入数据之后修改input框样式*/
$('#cate_small').removeClass('sel_info');
addSmallCateEvent();
}
function addSmallCateEvent() {
/*添加二级分类事件*/
$('#small_xiala a').on('click', function () {
var txt = $(this).text();
$('#cate_small').val(txt);
$('.ht_tariff_cate').text(txt);
$('.ht_tariff .ht_tariff_num em').text($(this).attr('tariff'));
$('#tariff_detail .ht_tariff_num').text($(this).attr('tariff'));
$('.ht_tariff_btn span').text($(this).text().slice(0, 5));
$('.ht_tariff_btn span').attr('title', $(this).text());
$('#small_xiala').hide();
replaceStr('#cate_small');
replaceStr('.ht_tariff_cate', 'text', 4);
});
$('#select_btn').on('click', function () {
changePrice();
$('#tariff_detail').hide();
});
}
function replaceStr(obj, type, num) {
/*字符串很长的做一下替换*/
num = num || 6;
var txt;
var l = 0;
if (type == 'text') txt = $(obj).text();else txt = $(obj).val();
for (var i = 0; i < txt.length; i++) {
var t = new RegExp('[a-z0-9/]').test(txt[i]);
if (t) l += 0.5;else l += 1;
if (l > num) {
txt = txt.slice(0, i) + '...';
if (type == 'text') $(obj).text(txt);else $(obj).val(txt);
return;
}
}
}
function cateEvent() {
/*关税框弹出事件*/
$('.ht_tariff_btn').on('click', function () {
$('#tariff_detail').show();
log('click:haitao:tariff');
cnzz.log('海淘关税点击');
});
/*分类选择*/
$('#cate_select_box input').on('mouseenter', function () {
if ($(this).next('.xialabox').find('a').length > 0) {
$(this).next('.xialabox').show();
$(this).parent().addClass('select_hover');
$(this).addClass('input_hover');
}
});
$('#cate_select_box input').on('mouseleave', function () {
var that = this;
timer = setTimeout(function () {
$(that).next('.xialabox').hide();
$(that).parent().removeClass('select_hover');
$(that).removeClass('input_hover');
}, 100);
});
/*下拉列表*/
$('.xialabox').on('mouseenter', function () {
clearTimeout(timer);
}).on('mouseleave', function () {
$(this).hide();
$(this).parent().removeClass('select_hover');
$(this).parent().find('input').removeClass('input_hover');
});
/*二级分类事件*/
addSmallCateEvent();
/*一级分类选项点击事件*/
$('#big_xiala a').on('click', function () {
var txt = $(this).text();
$('#cate_big').val(txt);
$('.ht_tariff_cate').text(txt);
var cate = $(this).attr('cate');
insertCate(cateDict[cate]);
$('#big_xiala').hide();
replaceStr('#cate_big');
replaceStr('.ht_tariff_cate', 'text', 4);
});
}
function baidufanyi(t, callback) {
/*百度翻译接口*/
var url = location.protocol + ('//browser.' + G.extName + '.com/extension?ac=fanyi&string=') + t;
request.get(url).done(function (data) {
if (data.trans_result && !data.error_code) {
var trans = [];
for (var i = 0; i < data.trans_result.length; i++) {
trans.push(data.trans_result[i].dst);
}
callback(trans);
} else {
callback([t]);
}
});
}
function requestFanyi(t, callback) {
/*请求翻译接口*/
baidufanyi(t, callback);
log('request:haitao:fanyi');
cnzz.log('请求划词翻译');
}
// function youdaofanyi(t, callback) {
// /*有道翻译接口*/
// let doctype = 'jsonp';
// if (G.chrome_extension)
// doctype = 'json'
// var url = "https://fanyi.youdao.com/openapi.do?keyfrom=chrome&key=1361128838&type=data&doctype=" + doctype + "&version=1.1&q="+t;
// request.getPure(url).done(function(data){
// if (data.basic && data.basic.explains && data.basic.explains.length >0)
// callback(data.basic.explains)
// else if( data.translation)
// callback(data.translation)
// else
// callback([t])
// })
// }
function insertFanyi(data) {
/*插入翻译内容*/
data = data.join('');
$('.ht_fanyi').remove();
var html = ' {{data}}
';
var t = template.compile(html)({
data: data,
'htx': calPosition() + 'px',
'hty': htY + 'px'
});
$('body').append(t);
addFanyiEvent();
}
function calPosition() {
/*计算插入位置*/
var pos = 0;
if (htX > mouseDownX) pos = htX - (htX - mouseDownX) / 2 - 65;else pos = htX + (mouseDownX - htX) / 2 - 65;
return pos;
}
function editTxt(t) {
requestFanyi(t, insertFanyi);
}
function addFanyiEvent() {
$('.ht_fanyi').siblings().on('click', function () {
$('.ht_fanyi').remove();
});
}
function getSelect() {
$('body').on('mousedown', function (e) {
clearTimeout(timer2);
mouseDownX = e.pageX;
});
$('body').on('mouseup', function (e) {
timer2 = setTimeout(function () {
var txt = '';
htX = e.pageX;
htY = e.pageY + 20;
if (window.getSelection) {
txt = window.getSelection().toString();
} else if (document.selection) {
txt = document.selection.createRange().text;
}
if (txt == '') return;else editTxt(txt);
}, 100);
});
}
module.exports._init = function () {
var permanent = userData.get('permanent');
if (permanent && permanent.sethaitao === "0") return;
init();
};
module.exports.isHaitao = isHaitaoPage;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1)))
/***/ }),
/* 210 */,
/* 211 */
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a \n "
/***/ }),
/* 235 */
/***/ (function(module, exports) {
module.exports = "