📄 productpicker.aspx
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProductPicker.aspx.cs" Inherits="PowerEasy.WebSite.Admin.Shop.ProductPicker" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>商品选择</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width: 100%; height: 90%;" border="0" cellpadding="2" cellspacing="0"
class="border">
<tr>
<td colspan="2" style="height:30px; text-align: right;" class="title" >
选择的商品:
<input id="TxtProductName" readonly="readonly" size="40" style="height: 15px;text-align: left; width: 80%;" type="text" /> <br />
<input id="BtnDelLast" type="button" value="删除最后" onclick="DeleteLast()" />
<input id="BtnDelAll" type="button" value="删除全部" onclick="DeleteAll()" />
<input id="Button1" type="button" value=" 返回 " onclick="ReturnValueToOpener()" />
</td>
</tr>
<tr>
<td class="tdbg" align="center" valign="top" style="width: 20%;">
<iframe id="shoplist" name="shoplist" scrolling="auto" style="width: 100%; height: 450px"
src="ShopTree.aspx" frameborder="0"></iframe>
</td>
<td class="tdbg" align="left" valign="top" style="width: 80%;">
<iframe id="main_right" name="main_right" scrolling="auto" style="width: 100%; height: 450px"
src="ProductShow.aspx" frameborder="0" marginheight="0" marginwidth="1"></iframe>
</td>
</tr>
</table>
</div>
</form>
<script type="text/javascript">
Array.prototype.del=function(n) {
if(n<0)
return this;
else
return this.slice(0,n).concat(this.slice(n+1,this.length));
}
var productList = new Array();
var txtProductName =document.getElementById('TxtProductName');
//返回Opener
function ReturnValueToOpener()
{
if(txtProductName.value =='')
{
alert('请选择商品!');
return;
}
//ProductID,ProductName,Property,isPresent$ProductID,ProductName,Property,isPresent ...
window.opener.DoProductPickerPostBack(productList.join('$'));
window.close();
}
function AddProduct(productId,productName,property,isPresent)
{
var names = txtProductName.value.split(',');
var productName2 = productName;
if(property !='')
{
productName2 +="(" + property + ")";
}
for(i=0;i<names.length;i++)
{
if(names[i] == productName2)
{
alert("此商品已被选择!");
return;
}
}
if(txtProductName.value=='')
{
txtProductName.value = productName2;
}
else
{
txtProductName.value += ","+ productName2;
}
//添加到数组
productList[productList.length] = new Array(productId,productName,property,isPresent);
}
function DeleteLast()
{
txtProductName.value = txtProductName.value.substring(0,txtProductName.value.lastIndexOf(","));
productList=productList.del(productList.length -1);
}
function DeleteAll()
{
txtProductName.value='';
productList = new Array();
}
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -