|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="US_MapOrder2.aspx.cs" Inherits="TradeManage.map.US_MapOrder2" %>
|
|
|
|
|
|
<!DOCTYPE HTML>
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
<%--<link rel="icon" href="https://static.jianshukeji.com/highcharts/images/favicon.ico">--%>
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
<script type="text/javascript" src="code/jquery-1.8.3.min.js"></script>
|
|
|
<script type="text/javascript" src="code/highmaps.js"></script>
|
|
|
<script type="text/javascript" src="code/modules/data.js"></script>
|
|
|
<script type="text/javascript" src="code/exporting.js"></script>
|
|
|
<script type="text/javascript" src="code/themes/sand-signika.src.js"></script>
|
|
|
|
|
|
|
|
|
<!--
|
|
|
*************************************************************************
|
|
|
Generated by HCODE at 2018-01-04 17:58:34
|
|
|
From: https://code.hcharts.cn/highmaps/hhhhvk?hc-theme=dark-unica
|
|
|
*************************************************************************
|
|
|
-->
|
|
|
<!-- 所有地图数据详情见:https://img.hcharts.cn/mapdata/index.html -->
|
|
|
<script type="text/javascript" src="code/us-all.js?a=14"></script>
|
|
|
<script src="../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/Global.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/jquery.url.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/WindowLoad.js" type="text/javascript"></script>
|
|
|
</head>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
var GoodsCode = '';
|
|
|
var sdate = null;
|
|
|
var edate = null;
|
|
|
var days = 1;
|
|
|
$(document).ready(function () {
|
|
|
ajaxInit(null);
|
|
|
GoodsCode = $.url.param("GoodsCode");
|
|
|
if (GoodsCode == undefined) {
|
|
|
GoodsCode = "";
|
|
|
}
|
|
|
var dd = new Date();
|
|
|
sdate = $.url.param("sdate");
|
|
|
if (sdate == undefined) {
|
|
|
sdate = dd.localeFormat("yyyy-01-01");
|
|
|
}
|
|
|
edate = $.url.param("edate");
|
|
|
if (edate == undefined) {
|
|
|
edate = dd.localeFormat("yyyy-MM-dd");
|
|
|
}
|
|
|
days = $.url.param("days");
|
|
|
if (days == undefined) {
|
|
|
days = 1;
|
|
|
}
|
|
|
newdate = dd.localeFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
GetListUSMap();
|
|
|
GetListUSMapModel();
|
|
|
GetOrder();
|
|
|
speckText("美国订单销量地图来了");
|
|
|
});
|
|
|
|
|
|
//#endregion
|
|
|
var newdate = null;
|
|
|
function GetOrder() {
|
|
|
var param = new Object();
|
|
|
param.Sdate = newdate;
|
|
|
|
|
|
$.ajax({
|
|
|
url: "map.asmx/IsNewOrder",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
async: false,
|
|
|
success: function (data) {
|
|
|
if (data.d != null) {
|
|
|
|
|
|
newdate = data.d;
|
|
|
GetListUSMap();
|
|
|
GetListUSMapModel();
|
|
|
speckText("有新的订单哦");
|
|
|
}
|
|
|
},
|
|
|
error: function (xhr, status) {
|
|
|
if (status != "success")
|
|
|
{ }
|
|
|
}
|
|
|
});
|
|
|
setTimeout("GetOrder()", 60000);
|
|
|
|
|
|
}
|
|
|
function speckText(str) {
|
|
|
//var request= new URLRequest();
|
|
|
// alert(str);
|
|
|
var url = "http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&text=" + encodeURI(str); // baidu
|
|
|
//url = "http://translate.google.cn/translate_tts?ie=UTF-8&tl=zh-CN&total=1&idx=0&textlen=19&prev=input&q=" + encodeURI(str); // google
|
|
|
//request.url = encodeURI(url);
|
|
|
// request.contentType = "audio/mp3"; // for baidu
|
|
|
//request.contentType = "audio/mpeg"; // for google
|
|
|
var n = new Audio(url);
|
|
|
n.src = url;
|
|
|
n.play();
|
|
|
// $("...").play();
|
|
|
// var sound = new Sound(request);
|
|
|
// sound.play();
|
|
|
}
|
|
|
var datas = "";
|
|
|
//#region 读取机构
|
|
|
function GetListUSMap() {
|
|
|
|
|
|
var param = new Object();
|
|
|
param.GoodsCode = GoodsCode;
|
|
|
param.Sdate = sdate;
|
|
|
param.edate = edate;
|
|
|
param.days = days;
|
|
|
var shtml = new Sys.StringBuilder();
|
|
|
$.ajax({
|
|
|
url: "map.asmx/GetListUSMap22",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
async: false,
|
|
|
success: function (data) {
|
|
|
datas = data.d;
|
|
|
|
|
|
|
|
|
GetChart();
|
|
|
|
|
|
// shtml.append('<tr><th colspan="12">美国订单销量排行</th></tr>');
|
|
|
// shtml.append('<tr><th>排名</th><th>州</th><th>订单量</th><th>排名</th><th>州</th><th>订单量</th><th>排名</th><th>州</th><th>订单量</th> <th>排名</th><th>州</th><th>订单量</th></tr>');
|
|
|
// var dd = eval("(" + data.d + ")");
|
|
|
// $(dd).each(function (i) {
|
|
|
// var j = i + 1;
|
|
|
// if (j % 4 == 1)
|
|
|
// shtml.append('<tr>');
|
|
|
// shtml.append('<td align="center">' + j + '</td>');
|
|
|
// shtml.append('<td align="center">' + this.statename + '</td>');
|
|
|
// shtml.append('<td align="center">' + this.Num + '【' + this.Price + '$】</td>');
|
|
|
// if (j % 4 == 0)
|
|
|
// shtml.append('</tr>');
|
|
|
// });
|
|
|
// shtml.append('<td align="center"></td><td align="center"></td><td align="center"></td>');
|
|
|
// shtml.append('<td align="center"></td><td align="center"></td><td align="center"></td>');
|
|
|
// shtml.append('<td align="center"></td><td align="center"></td><td align="center"></td></tr>');
|
|
|
// $("#tb1").html(shtml.toString());
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function GetListUSMapModel() {
|
|
|
|
|
|
var param = new Object();
|
|
|
param.GoodsCode = GoodsCode;
|
|
|
param.Sdate = sdate;
|
|
|
param.edate = edate;
|
|
|
param.days = days;
|
|
|
$.ajax({
|
|
|
url: "map.asmx/GetModel_USMapModel2",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
async: false,
|
|
|
success: function (data) {
|
|
|
if (data.d != null) {
|
|
|
$("#a_hj").html("订单量:【" + data.d.Num + "】 订单金额:【" + data.d.Price + "$】");
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function getData() {
|
|
|
|
|
|
//var data = "[{name: '速卖通',data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]}, {name: '亚马逊',data: [5, 5.5, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5]}, {name: 'EBay',data: [3, 3, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0]}, {name: 'Wish',data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]}]";
|
|
|
var dataJsonobj = eval("(" + datas + ")"); //转换成json对象
|
|
|
|
|
|
return dataJsonobj;
|
|
|
|
|
|
}
|
|
|
function GetChart() {
|
|
|
|
|
|
|
|
|
|
|
|
// Instanciate the map
|
|
|
$('#container').highcharts('Map', {
|
|
|
chart: {
|
|
|
borderWidth: 1
|
|
|
},
|
|
|
title: {
|
|
|
text: '美国区域订单销量图'
|
|
|
},
|
|
|
legend: {
|
|
|
layout: 'horizontal',
|
|
|
borderWidth: 0,
|
|
|
backgroundColor: 'rgba(255,255,255,0.85)',
|
|
|
floating: true,
|
|
|
verticalAlign: 'top',
|
|
|
y: 25
|
|
|
},
|
|
|
mapNavigation: {
|
|
|
enabled: true
|
|
|
},
|
|
|
colorAxis: {
|
|
|
min: 1,
|
|
|
type: 'logarithmic',
|
|
|
minColor: '#FFFFFF',
|
|
|
maxColor: '#FF0000',
|
|
|
stops: [
|
|
|
[0, '#FFFFFF'],
|
|
|
[0.1, '#FFFFCC'],
|
|
|
[0.3, '#FFCCFF'],
|
|
|
[0.5, '#FF0099'],
|
|
|
[0.7, '#FF0066'],
|
|
|
[0.9, '#FF0033'],
|
|
|
[1, '#FF0000']
|
|
|
|
|
|
]
|
|
|
},
|
|
|
series: [{
|
|
|
animation: {
|
|
|
duration: 4000
|
|
|
},
|
|
|
data: getData(),
|
|
|
mapData: Highcharts.maps['countries/us/us-all'],
|
|
|
joinBy: ['postal-code', 'code'],
|
|
|
dataLabels: {
|
|
|
enabled: true,
|
|
|
color: 'black',
|
|
|
style: { 'fontSize': '15px' },
|
|
|
format: '<br/>{point.statename}<br/>【{point.Num}】'
|
|
|
},
|
|
|
name: '订单销量',
|
|
|
tooltip: {
|
|
|
pointFormat: '{point.statename}<br/>单量:{point.Num}金额:【{point.Price}$】'
|
|
|
}
|
|
|
}]
|
|
|
});
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
<body>
|
|
|
<div id="container" style="height:480px; min-width:500px; max-width: 1000px; margin: 0 auto">
|
|
|
</div>
|
|
|
<div id="table-div">
|
|
|
<table width="100%">
|
|
|
<tr>
|
|
|
<th colspan="12"><a id="a_hj">
|
|
|
</a>
|
|
|
</th>
|
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
<table width="100%" id="tb1">
|
|
|
|
|
|
|
|
|
|
|
|
</table>
|
|
|
</div>
|
|
|
</body>
|
|
|
</html>
|
|
|
|