fd-gulp-convert-encoding
Version:
convert file to assigned charset
156 lines (146 loc) • 3.85 kB
JavaScript
(function($,doc){
var hasColRight;
function autoAdapt(){
if($(window).width()<850)
{
$(".offer-info-box .col-right").hide();
}
else
{
$(".offer-info-box .col-right").show();
}
}
function getJiageURL(themeName,areaName){
return "http://jiage.1688.com/price/forout/jsonFromSearch.htm?fromInfoIndex=Y&themeName=" + themeName + "&areaName=" + areaName + "&dateFrom=&dateTo=&count=30&pointCount=6";
}
function initColRight(){
//var jiageDomain = $(".upperMiddle .col-right .raw-chart .chart-domain").val();
var current = $(".upperMiddle .col-right .raw-chart .chart-select a.current");
var themeName = current.attr("data-theme");
var areaName = current.attr("data-area");
current = null;
var dataUrl = getJiageURL(themeName,areaName);
renderPriceQuotationChart(dataUrl,function(){
$(".upperMiddle .col-right .raw-chart .chart-select a").click(function(e){
e.preventDefault();
$(".upperMiddle .col-right .raw-chart .chart-select a").removeClass("current");
$(this).addClass("current");
themeName = $(this).attr("data-theme");
areaName = $(this).attr("data-area");
renderPriceQuotationChart(getJiageURL(themeName,areaName));
});
});
}
$(doc).ready(function(){
hasColRight = ($(".col-right .raw-chart").length !== 0);
if(hasColRight)
{
autoAdapt();
initColRight();
$(window).resize(function(){
autoAdapt();
});
}
});
var chart;
function renderPriceQuotationChart(dataUrl,callback){
if(!callback)
{
chart.flash("getFlash").load(dataUrl,"GBK");
return;
}
var lineStyle = 'chart {\
colors : #fd8100;\
smooth : true;\
leftAxisVisibility: visible;\
animate: true;\
width: 212;\
height: 72;\
}\
tooltip{\
backgroundType :simple;\
borderThickness: 1;\
fontSize:10;\
borderAlpha: 0.3;\
}\
line {\
dropshadow : none;\
lineMethod : line;\
thickness : 2;\
fillType : gradient;\
fillAlpha.active: .3;\
}\
line dot {\
color : #FFFFFF;\
borderColor : inherit#color;\
borderThickness : 2;\
shape : circle;\
radius : 3;\
color.hl : inherit#color;\
borderColor.hl : #FFFFFF;\
radius.hl : 5;\
}\
xAxis {\
lineColor : #666666;\
lineThickness : 0;\
tickThickness : 0;\
}\
xAxis label {\
paddingRight : 0;\
paddingLeft: 0;\
fontSize : 10;\
color : #9F9F9F;\
}\
yAxis {\
lineThickness : 0;\
tickThickness : 0;\
labelGap : auto;\
}\
yAxis label {\
color : #9F9F9F;\
fontSize: 10;\
paddingRight: 0;\
paddingLeft: 0;\
}\
canvas {\
backgroundColor : #FFFFFF;\
borderThickness : 2;\
borderColor: #D5E2F0;\
priLineThickness: 1;\
priLineColor : #D5E2F0;\
priLineStyle : dashed;\
secLineThickness: 1;\
secLineColor : #D5E2F0;\
secLineStyle : dashed;\
border: 1\
}\
guideLine {\
color : #BBBBBB;\
}\
legend {\
position : bottom;\
align : center;\
interactive : false;\
paddingTop : 0;\
}\
legend item { iconType: square; }\
legend item icon { size: 10; }\
legend item label {\
color: inherit;\
paddingLeft: 0;\
}';
$.use('ui-flash-chart', function(){
chart = $('.col-right .raw-chart .chart-box ul').flash({
module : 'chart',
type : 'line',
width : 288,
height : 132
});
chart.on("swfReady",function(){
chart.flash('parseCSS',lineStyle);
chart.flash("getFlash").load(dataUrl,"GBK")
callback();
});
});
}
})(jQuery,document);