{"version":3,"sources":["finance.js"],"sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 11);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = {\r\n tabsMoveChange: function (element) {\r\n var $this = $(element);\r\n var setTime = null;\r\n $this.each(function (i) {\r\n var $this = $(this);\r\n var tabsList = $('.tabs_list', $this);\r\n var tabsMoreItem = $('.tabs_more>a', $this);\r\n var tabsPannel = $('.tabs_item', $this);\r\n\r\n tabsList.on('mouseover', 'li', function () {\r\n var that = this;\r\n \r\n setTime = setTimeout(function () {\r\n var index = $(that).index();\r\n var href = $(that).find('a').attr('href');\r\n $(that).addClass('active').siblings().removeClass('active');\r\n if(tabsMoreItem.length > 1){\r\n tabsMoreItem.eq(index).show().siblings().hide();\r\n }else if(tabsMoreItem.length === 1 && href){\r\n tabsMoreItem.eq(0).attr('href',href)\r\n }\r\n tabsPannel.eq(index).fadeIn().addClass('active').siblings().hide().removeClass('active');\r\n }, 200)\r\n\r\n })\r\n tabsList.on('mouseout', 'li', function () {\r\n window.clearTimeout(setTime);\r\n })\r\n })\r\n },\r\n subTabsMove: function (element) {\r\n var $this = $(element);\r\n var setTime = null;\r\n $this.each(function () {\r\n var $this = $(this);\r\n var subTabsList = $('.sub_tabs_header', $this);\r\n var subTabsItem = $('.sub_tabs_item', $this);\r\n\r\n subTabsList.on('mouseover', 'li', function () {\r\n var slef = this;\r\n setTime = setTimeout(function () {\r\n var index = $(slef).index();\r\n $(slef).addClass('active').siblings().removeClass('active');\r\n subTabsItem.eq(index).fadeIn().addClass('active').siblings().hide().removeClass('active');\r\n }, 200)\r\n })\r\n\r\n subTabsList.on('mouseout', 'li', function () {\r\n window.clearTimeout(setTime);\r\n })\r\n })\r\n },\r\n tabsMouseTable:function(eleId,that,callback){\r\n $('#'+ eleId).on('mouseover','.tabs_list li',function(){\r\n if($(this).hasClass(\"active\")){\r\n return\r\n }\r\n var _self =this;\r\n that.setTime = setTimeout(function(){\r\n var id = $(_self).data('id');\r\n var href = $(_self).children(\"a\").attr(\"href\") || \"\";\r\n if(id){\r\n id = id.split('#');\r\n that.fid = id[0];\r\n that.po = id[1] || 0;\r\n that.beforeLoad();\r\n if(that.refresh){\r\n $(_self).addClass('active').siblings().removeClass('active');\r\n callback && callback(href);\r\n that.refresh();\r\n }\r\n }\r\n },200)\r\n })\r\n \r\n $('#'+ id).on('mouseout', '.tabs_list li', function () {\r\n if(that.setTime){\r\n window.clearTimeout(that.setTime);\r\n }\r\n })\r\n },\r\n /**\r\n * 替换id\r\n */\r\n replaceId: function (str, id) {\r\n try {\r\n return str.replace('{{#id#}}', id);\r\n } catch (error) {\r\n return str;\r\n }\r\n\r\n },\r\n getData: function (url, success, fail) {\r\n $.ajax({\r\n type: \"GET\",\r\n url: url,\r\n dataType: \"jsonp\",\r\n // timeout : 1500,\r\n jsonp: 'cb',\r\n success: function (json) {\r\n try {\r\n if (json && json.data && json.data.diff) {\r\n success(json.data.diff)\r\n } else {\r\n fail && fail()\r\n return false;\r\n }\r\n } catch (error) {\r\n fail && fail()\r\n return false;\r\n }\r\n },\r\n error: function (err) {\r\n fail && fail();\r\n return false;\r\n }\r\n })\r\n },\r\n getOldData: function (url, suc, fail) {\r\n $.ajax({\r\n type: \"GET\",\r\n url: url,\r\n dataType: \"jsonp\",\r\n // timeout : 1500,\r\n jsonp: 'cb',\r\n success: function (json) {\r\n try {\r\n if (!!json && json.length >= 1) {\r\n suc(json)\r\n } else {\r\n fail && fail();\r\n return false;\r\n }\r\n } catch (error) {\r\n fail && fail();\r\n return false;\r\n }\r\n },\r\n error: function (err) {\r\n fail && fail();\r\n return false;\r\n }\r\n })\r\n },\r\n /*\r\n *判断值是否非空\r\n */\r\n getTextValOrEmpty: function (value) {\r\n if (value != '' && value != undefined && value != null) {\r\n return value\r\n } else {\r\n return '-'\r\n }\r\n },\r\n /**\r\n * @param {data}字符串 \r\n * @param {num}保留小数点几位\r\n * @param {fix}单位\r\n * @param {divide} 除以多少,eg:10000 ,如果没有则自动填充\r\n */\r\n getColorByDate: function (data, num, fix, divide) {\r\n try {\r\n if (data === '' || data === undefined || data === null || data === '-' || isNaN(data)) {\r\n return '-'\r\n }\r\n data = parseFloat(data);\r\n var retult = '';\r\n\r\n if (!divide) {\r\n retult = this.FixAmt(data, num, fix);\r\n } else {\r\n num = !!parseFloat(num) ? parseFloat(num) : 2;\r\n retult = (data / parseInt(divide)).toFixed(num) + fix;\r\n }\r\n\r\n var color = '';\r\n color = !!data ? (data == 0 ? '' : data > 0 ? 'red' : 'green') : '';\r\n retult = '' + retult + ''\r\n\r\n return retult;\r\n } catch (err) {\r\n return '-'\r\n }\r\n },\r\n /*\r\n *单位自动换算\r\n */\r\n FixAmt: function (str, num, fix, ride) {\r\n try {\r\n if (str === '' || str === undefined || str === null || str === '-' || isNaN(str)) {\r\n return '-';\r\n }\r\n var result;\r\n fix = !!fix ? fix : '';\r\n num = isNaN(parseFloat(num)) ? 2 : parseFloat(num);\r\n ride = !!ride ? ride : 1;\r\n str = parseFloat(str) * parseInt(ride);\r\n var intStr = Math.abs(parseInt(str));\r\n if (intStr.toString().length > 12) {\r\n result = (parseFloat(str) / 1000000000000).toFixed(num) + '万亿' + fix;\r\n } else if (intStr.toString().length > 8) {\r\n result = (parseFloat(str) / 100000000).toFixed(num) + '亿' + fix;\r\n } else if (intStr.toString().length > 4) {\r\n result = (parseFloat(str) / 10000).toFixed(num) + '万' + fix;\r\n } else {\r\n if(parseFloat(str) === parseInt(str)){\r\n result = parseFloat(str) + fix;\r\n }else{\r\n result = parseFloat(str).toFixed(num) + fix;\r\n }\r\n }\r\n // console.log(result)\r\n return result;\r\n } catch (err) {\r\n return '-'\r\n }\r\n },\r\n /*\r\n *单位不自动换算(主要用于价格Price)\r\n */\r\n FixAmtPrice: function (str, num, fix, ride) {\r\n try {\r\n if (str === '' || str === undefined || str === null || str === '-' || isNaN(str)) {\r\n return '-';\r\n }\r\n var result;\r\n fix = !!fix ? fix : '';\r\n num = isNaN(parseFloat(num)) ? 2 : parseFloat(num);\r\n ride = !!ride ? ride : 1;\r\n str = parseFloat(str) * parseInt(ride);\r\n \r\n result = parseFloat(str).toFixed(num) + fix;\r\n \r\n return result;\r\n } catch (err) {\r\n return '-'\r\n }\r\n },\r\n /*\r\n *换算成百分比\r\n */\r\n toPercent: function (data, num) {\r\n if (data === '' || data === undefined || data === null || data === '-' || isNaN(data)) {\r\n return '-';\r\n }\r\n num = isNaN(parseInt(num)) ? 2 : parseInt(num);\r\n return !isNaN(parseFloat(data)) ? parseFloat(data).toFixed(num) + '%' : '-';\r\n },\r\n toFixed: function (data, num) {\r\n if (data === '' || data === undefined || data === null || data === '-' || isNaN(data)) {\r\n return '-';\r\n }\r\n num = isNaN(parseInt(num)) ? 2 : parseInt(num);\r\n return parseFloat(data).toFixed(num);\r\n },\r\n getColor: function (data) {\r\n data = parseFloat(data);\r\n return !!data ? (data == 0 ? '' : data > 0 ? 'red' : 'green') : '';\r\n },\r\n quoteLink: function (code, market) {\r\n return 'http://quote.eastmoney.com/unify/r/' + market + '.' + code + '/';\r\n },\r\n CloneObj: function (common, obj) {\r\n var newObj = $.extend(true, {}, common);\r\n for (var key in obj) {\r\n newObj[key] = obj[key]\r\n }\r\n return newObj;\r\n },\r\n isArray:function(o){\r\n return Object.prototype.toString.call(o) === '[object Array]';\r\n }\r\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (option) {\r\n if (!option.id) return;\r\n var defaultOption = {\r\n tabList: \".tabs_list\",\r\n tabListTarget: \"li\",\r\n tabsMore: '.tabs_more',\r\n tabsMoreTarget: 'a',\r\n tabsItem: \".tabs_item\",\r\n activeClass: \"active\",\r\n touches: \"mouse\",\r\n delayTime: 200,\r\n callback: function () {}\r\n }\r\n option = $.extend(true, defaultOption, option)\r\n var $this = $(option.id);\r\n var tabsList = $(option.tabList, $this);\r\n var tabsMoreItem = $(option.tabsMore, $this).find(option.tabsMoreTarget);\r\n var tabsPannel = $(option.tabsItem, $this);\r\n\r\n if (option.touches === \"click\") {\r\n tabsList.on(\"click\", option.tabListTarget, function () {\r\n if ($(this).hasClass(option.activeClass)) return;\r\n var index = $(this).index();\r\n var href = $(this).find('a').attr('href');\r\n $(this).addClass(option.activeClass).siblings().removeClass(option.activeClass);\r\n if (tabsMoreItem.length > 1) {\r\n tabsMoreItem.eq(index).show().siblings().hide();\r\n } else if (tabsMoreItem.length === 1 && href) {\r\n tabsMoreItem.eq(0).attr('href', href)\r\n }\r\n tabsPannel.eq(index).fadeIn().addClass(option.activeClass).siblings().hide().removeClass(option.activeClass);\r\n option.callback(index);\r\n })\r\n } else if (option.touches === \"mouse\") {\r\n var setTime;\r\n tabsList.on('mouseover', option.tabListTarget, function () {\r\n if ($(this).hasClass(option.activeClass)) return;\r\n var that = this;\r\n setTime = setTimeout(function () {\r\n var index = $(that).index();\r\n var href = $(that).find('a').attr('href');\r\n $(that).addClass(option.activeClass).siblings().removeClass(option.activeClass);\r\n if (tabsMoreItem.length > 1) {\r\n tabsMoreItem.eq(index).show().siblings().hide();\r\n } else if (tabsMoreItem.length === 1 && href) {\r\n tabsMoreItem.eq(0).attr('href', href)\r\n }\r\n tabsPannel.eq(index).fadeIn().addClass(option.activeClass).siblings().hide().removeClass(option.activeClass);\r\n option.callback(index);\r\n }, option.delayTime)\r\n\r\n })\r\n tabsList.on('mouseout', 'li', function () {\r\n window.clearTimeout(setTime);\r\n })\r\n }\r\n}\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n/**\r\n * 快讯\r\n */\r\n\r\nvar $ = jQuery;\r\n\r\nvar kuaixun = (function () {\r\n\r\n function kuaixun(options) {\r\n var defaultoptions = {\r\n refreshbtn : null, //刷新按钮\r\n fontsizebtn : null, //字号按钮\r\n autobtn : null, //自刷按钮\r\n autosec : null, //自刷时间\r\n kxlist : null, //内容容器\r\n kxloading : null, //loading\r\n refreshtime : 60, //刷新时间\r\n kxtype: '102', //快讯类型\r\n kxlink: 'http://kuaixun.eastmoney.com/' //快讯链接\r\n }\r\n this.options = $.extend(defaultoptions, options);\r\n this.cdci = null; //自动刷新\r\n this.isautocd = true; //是否自动刷新\r\n this.iskxshow = true; //快讯是否在展示中\r\n this.fontsize = 12; //当前字号\r\n }\r\n\r\n /**\r\n * 初始化\r\n * @return {[type]} [description]\r\n */\r\n kuaixun.prototype.init = function () {\r\n this.options.autosec.text(this.options.refreshtime);\r\n this.bind();\r\n this.refresh();\r\n this.refreshcd();\r\n };\r\n\r\n /**\r\n * 绑定事件\r\n * @return {[type]} [description]\r\n */\r\n kuaixun.prototype.bind = function (){\r\n var _this = this;\r\n //刷新按钮\r\n this.options.refreshbtn.on('click', function(){\r\n _this.refresh();\r\n return false;\r\n });\r\n //自动刷新按钮\r\n this.options.autobtn.on('click',function () {\r\n var thisbtn = $(this);\r\n if (thisbtn.is('.kx_autoing')) { //暂停\r\n thisbtn.removeClass('kx_autoing');\r\n _this.isautocd = false;\r\n clearInterval(_this.cdci);\r\n _this.options.autosec.text(_this.options.refreshtime);\r\n } else { //开启\r\n thisbtn.addClass('kx_autoing');\r\n _this.isautocd = true;\r\n _this.refreshcd();\r\n }\r\n });\r\n \r\n if( this.options.fontsizebtn ){\r\n this.options.fontsizebtn.on('click', function () { //调整字号\r\n var thisbtn = $(this);\r\n if (_this.fontsize == 12) {\r\n _this.fontsize = 14;\r\n thisbtn.text('小字-');\r\n } else {\r\n _this.fontsize = 12;\r\n thisbtn.text('大字+');\r\n }\r\n _this.options.kxlist.css('font-size', _this.fontsize + 'px');\r\n }); \r\n }\r\n }\r\n\r\n /**\r\n * 刷新倒计时\r\n * @return {[type]} [description]\r\n */\r\n kuaixun.prototype.refreshcd = function (){\r\n var _this = this;\r\n clearInterval(this.cdci);\r\n this.cdci = null;\r\n this.options.autosec.text(this.options.refreshtime);\r\n if (this.isautocd && this.iskxshow) {\r\n this.cdci = setInterval(function () {\r\n var oldTime = _this.options.autosec.text();\r\n if (oldTime == 1) {\r\n _this.refresh();\r\n } else {\r\n _this.options.autosec.text(oldTime - 1);\r\n }\r\n }, 1000);\r\n }\r\n }\r\n \r\n /**\r\n * 停止倒计时\r\n */\r\n kuaixun.prototype.stopRefresh = function(){\r\n clearInterval(this.cdci);\r\n this.options.autosec.text(this.options.refreshtime);\r\n };\r\n\r\n /**\r\n * 刷新内容\r\n * @return {[type]} [description]\r\n */\r\n kuaixun.prototype.refresh = function (){\r\n var _this = this;\r\n this.options.kxloading.show();\r\n \r\n $.ajax({\r\n url: '//newsapi.eastmoney.com/kuaixun/v2/api/list',\r\n type: 'GET',\r\n dataType: 'jsonp',\r\n jsonpCallback: 'ajaxResult_' + _this.options.kxtype,\r\n scriptCharset : 'utf-8',\r\n cache: false,\r\n data: {\r\n column: _this.options.kxtype,\r\n limit: 20,\r\n p: 1,\r\n callback: 'kxall_ajaxResult' + _this.options.kxtype\r\n }\r\n })\r\n .done(function(data) { \r\n data = data.news; \r\n var _kxhtml = [];\r\n _kxhtml.push('
'+_price+'';\r\n if(className){\r\n html+='';\r\n }\r\n html+= '
'+_zde+''+_zdf+'