You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

268 lines
11 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DD_ShopifyOrders.aspx.cs" Inherits="TradeManageNew.DingDan.DD_ShopifyOrders" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Shopify订单</title>
<link rel="stylesheet" type="text/css" href="../themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="../themes/icon.css" />
<link rel="stylesheet" type="text/css" href="../themes/New.css" />
<link rel="stylesheet" type="text/css" href="../themes/DataGrid.css" />
<script src="../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="../Scripts/jquery.min.js" type="text/javascript"></script>
<script src="../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
<script src="../Scripts/DataGrid.js" type="text/javascript"></script>
<script src="../Scripts/DataPager.js" type="text/javascript"></script>
<script src="../Scripts/jquery.url.js" type="text/javascript"></script>
<script src="../Scripts/jquery.bgiframe.min.js" type="text/javascript"></script>
<script src="../Scripts/Global.js" type="text/javascript"></script>
<script src="../Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="../Scripts/WindowLoad.js" type="text/javascript"></script>
<script src="../Scripts/MaskedTextBox.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox/jquery.fancybox-1.3.4.css"
media="screen" />
<script type="text/javascript" src="../Scripts/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<script type="text/javascript" src="../Scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript">
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
var UserId = "<%=Session["UserId"]%>";
var WindowLoadModel = new WindowLoad();
var Id = 0;
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.ControlID = "WindowLoad";
WindowLoadModel.Isbgiframe = true;
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
GetShopifyShops();
CreateDataGrid();
ReadData();
$("#btn_sch").bind("click", function () {
ReadData();
});
$("#" + datagrid1.TableID + " [CommandName='cmdCapture']").live("click", function () {
var orderid = $(this).closest('tr').find('td span.shopifyorderid').attr('orderid');
var shopid = $(this).closest('tr').find('td span.shopid').attr('shopid');
var result = confirm("确定要执行此操作吗?");
if (result) {
WindowLoadModel.Show();
var param = new Object();
param.orderid = orderid;
param.shopid = shopid;
$.ajax({
url: "../DD_OrderServiceNew.asmx/UpdateShopifyShopOrderCaptureStatus",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
if (data.d != null) {
showAlert(data.d.Message, handleAlertConfirmation);
}
}
});
}
});
$("#btn_sync").bind("click", function () {
debugger;
var result = confirm("确定要拉取Shopify订单吗");
if (result) {
WindowLoadModel.Show();
$.ajax({
url: "../DD_OrderServiceNew.asmx/SyncAllShopifyShopOrders",
success: function (data) {
WindowLoadModel.Hide();
if (data.d != null) {
showAlert(data.d.Message, handleAlertConfirmation);
}
}
});
}
})
});
//#endregion
//#region 初始化DataGrid
function CreateDataGrid() {
var col = new nblf.ui.DataGridColumn();
col.HeaderText = "店铺名";
col.CellTemplate = "<span class='shopid' shopid={Bind ShopId}>{Bind ShopName}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "Order";
col.CellTemplate = "<span class='shopifyorderid' orderid={Bind ShopifyOrder_Id}>{Bind OrderName}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "图片";
col.CellTemplate = "<span>{Bind ImageStr}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "SKU";
col.CellTemplate = "<a>{Bind SKU}</a>";
Array.add(datagrid1.Columns, col);
var col = new nblf.ui.DataGridColumn();
col.HeaderText = "日期";
col.CellTemplate = "<span>{Bind CreateDate}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "Capture Status";
col.CellTemplate = "<span>{Bind CaptureState}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "Customer";
col.CellTemplate = "<span>{Bind CustomerName}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "Total";
col.CellTemplate = "<a>{Bind Currency}{Bind TotalPrice}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "Payment Status";
col.CellTemplate = "<span>{Bind PaymentStatus}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "Fulfillment Status";
col.CellTemplate = "<span>{Bind FulfillmentStatus}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "Items";
col.CellTemplate = "<span>{Bind ItemCount}</span>";
Array.add(datagrid1.Columns, col);
//col = new nblf.ui.DataGridColumn();
//col.HeaderText = "Delivery Status";
//col.CellTemplate = "<span>{Bind DeliveryStatus}</span>";
//Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "Delivery Method";
col.CellTemplate = "<span>{Bind DeliveryMethod}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "Tags";
col.CellTemplate = "<span>{Bind Tags}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "操作";
col.Width = "180px";
col.CellTemplate = "<input CommandName='cmdCapture' class='btnClass dgbtnEdit' type='button' value='Capture Payment'>";
Array.add(datagrid1.Columns, col);
datagrid1.SetPageSize(30);
datagrid1.SetPageIndex(1);
datagrid1.IsFixHeader = false;
datagrid1.ShowIndexColumn = false;
datagrid1.AllowPaging = true;
datagrid1.Width = "100%";
datagrid1.SelectMode = nblf.ui.SelectMode.None;
datagrid1.Init();
datagrid1.add_PageIndexChanged(function () { ReadData(); });
}
//#endregion
//#region 读取数据
function ReadData() {
var param = new Object();
param.SDate = $("#txtSDate").val();
param.EDate = $("#txtEDate").val();
param.ShopId = $("#select_shops").val();
param.PageSize = datagrid1.Get_PageSize();
param.PageIndex = datagrid1.Get_PageIndex();
WindowLoadModel.Show();
$.ajax({
url: "../DD_OrderServiceNew.asmx/GetShopifyShopsAllOrdersList",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
datagrid1.Set_RowCount(data.d.RowCount);
datagrid1.DataBind(data.d.DataSource);
}
});
}
//获取shopify平台的所有店铺
function GetShopifyShops() {
$("#select_shops").append("<option value='0'>全部</option>");
WindowLoadModel.Show();
$.ajax({
url: "../DD_OrderServiceNew.asmx/GetAllShopifyShopsList",
success: function (data) {
WindowLoadModel.Hide();
if (data.d != null) {
$(data.d).each(function () {
$("#select_shops").append("<option value='" + this.ShopId + "'>" + this.ShopName + "</option>");
})
}
}
});
}
function showAlert(message, callback) {
alert(message);
if (typeof callback === 'function') {
callback();
}
}
function handleAlertConfirmation() {
console.log("用户点击了确定按钮");
ReadData();
}
</script>
</head>
<body class="headbody">
<div class="title_ico">
Shopify订单数据
</div>
<table id="tb1" class="tableAll" style="width: 100%;">
<tr>
<td class="f1" width="13%">日期:</td>
<td><input id="txtSDate" class="editTextbox" style="width: 120px;" type="text" onfocus="WdatePicker()" autocomplete="off" />-<input id="txtEDate" class="editTextbox" style="width: 120px;" type="text" onfocus="WdatePicker()" autocomplete="off" /></td>
<td class="f1" width="13%">店铺:</td>
<td><select id="select_shops" class="selectClass" style="width: 120px" name="D2"></select></td>
<td><input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" /></td>
</tr>
<tr>
<td class="f1" width="13%"><input id="btn_sync" class="btnClass btnClassFind" type="button" value="同步订单" /></td>
</tr>
<tr>
<td valign="top" colspan="5">
<div id="DataGrid1" class="DataGridStyle"></div>
</td>
</tr>
</table>
</body>
</html>