<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="shopintcart_parameter.aspx.cs" Inherits="YXShop.Web.admin.templates.label.shopintcart_parameter" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<!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 id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../../style/admin.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function ReturnValue()
{
    var ShowMode;
    var o=document.getElementsByName("rbl_ShowMode");//显示模式
    var len=o.length;   
    for (var i=0;i<len ;i++ )
    {
        if( o[i].checked==true )
        {
            ShowMode=o[i].value;
        }
    }
    var TempletLayout;      
    var o=document.getElementsByName("Rbl_TempletLayout");//布局方式
    var len=o.length;   
    for (var i=0;i<len ;i++ )       
    {
        if( o[i].checked==true )
        {
            TempletLayout=o[i].value;
        }
    }
    //自定义内容
    var mystyle = document.getElementById("txtLabelContent").value;
    var cnm ="[YX:Loop,YX:LableType=ShoppingCar,YX:TempletLayout="+TempletLayout+"]"+mystyle+"[/YX:Loop]";
    if(ShowMode=="1")
    {
        cnm ="[YX:Loop,YX:LableType=ShoppingCarData,YX:ShowMode="+ShowMode+"YX:TempletLayout="+TempletLayout+"]"+mystyle+"[/YX:Loop]";
    }

    parent.getValue(cnm);
    CloseDiv();
}
function CloseDiv()
{
    parent.document.getElementById("LabelDivid").style.display="none";
}



    function getValue(value)
{
    var textObj=document.getElementById("txtLabelContent");
    var textFeildValue=value;
    if(value!="") 
    {
        if(document.all)
        {     
            if(textObj.createTextRange && textObj.caretPos)
            {   
                var caretPos=textObj.caretPos;   
                caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==''?textFeildValue+'':textFeildValue;   
            }
            else
            {   
                textObj.value=textFeildValue;   
            }   
        }
        else
        {   
            if(textObj.setSelectionRange)
            {   
                var rangeStart =textObj.selectionStart;   
                var rangeEnd=textObj.selectionEnd;   
                var tempStr1=textObj.value.substring(0,rangeStart);   
                var tempStr2 =textObj.value.substring(rangeEnd);   
                textObj.value=tempStr1+textFeildValue+tempStr2;   
            }
            else
            {   
                alert("This version of Mozilla based browser does not support setSelectionRange");   
            }   
        }
    }
}
function setCaret(textObj)
{   
    if(textObj.createTextRange)
    {   
        textObj.caretPos=document.selection.createRange().duplicate();   
    }   
} 
function ShowMode(str)
{
    if(str=="2")
    {
       document.getElementById("ShoppingCarInfo").style.display="none";
       document.getElementById("ShoppingCar").style.display="";
    }
    else if(str=="1")
    {
        document.getElementById("ShoppingCarInfo").style.display="";
       document.getElementById("ShoppingCar").style.display="none";
    }
}
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table cellpadding="1" cellspacing="1"  style="width: 99%; margin-top:5px" class="form_table_input">
           <tr>
               <td>显示方式</td>
               <td colspan="3">
                   <asp:RadioButtonList ID="rblShowMode" runat="server" RepeatDirection="Horizontal">
                   <asp:ListItem Value="1" onclick="ShowMode(1)">显示刚加入购物车信息</asp:ListItem>
                   <asp:ListItem Value="2" onclick="ShowMode(2)" Selected="True">显示购物车购买信息</asp:ListItem>
                   </asp:RadioButtonList>
               </td>
           </tr>
           <tr>
                <td>
                    显示信息 </td>
                <td>
                  <div id="ShoppingCar">
                      <asp:DropDownList ID="dd_Condtion" runat="server" 
                            onchange="javascript:getValue(this.value);">
                            <asp:ListItem Value="">--请选择显示信息--</asp:ListItem>
                            <asp:ListItem Value="[#CheckBox]">复选框</asp:ListItem>
                            <asp:ListItem Value="[#Pro_ID]">商品ID</asp:ListItem>
                            <asp:ListItem Value="[#Pro_ItemNo]">商品编号</asp:ListItem>
                            <asp:ListItem Value="[#Pro_Images]">商品图片</asp:ListItem>
                            <asp:ListItem Value="[#Pro_Name]">商品名称</asp:ListItem>
                            <asp:ListItem Value="[#Pro_CID]">商品类别</asp:ListItem>
                            <asp:ListItem Value="[#Pro_Price]">市场价</asp:ListItem>
                            <asp:ListItem Value="[#Pro_ShopPrice]">商城价</asp:ListItem>
                            <asp:ListItem Value="[#Pro_Integral]">商品赠送积分</asp:ListItem>
                            <asp:ListItem Value="[#Pro_NeedIntegral]">所需积分</asp:ListItem>
                            <asp:ListItem Value="[#Pro_NeedDummyMoney]">所需点券</asp:ListItem>
                            <asp:ListItem Value="[#Pro_Count]">购买数量</asp:ListItem>
                            <asp:ListItem Value="[#Pro_Total]">商品小计(元)</asp:ListItem>
                            <asp:ListItem Value="[#Pro_TotalPrice]">商品总价格</asp:ListItem>
                            <asp:ListItem Value="[#Pro_TotalProductCount]">商品总数量</asp:ListItem>
                            <asp:ListItem Value="[#Pro_TotalWeight]">商品总重量</asp:ListItem>
                            <asp:ListItem Value="[#Pro_TotalInter]">商品总积分</asp:ListItem>
                            <asp:ListItem Value="[#Pro_ContinueButton]">继续购物铵钮</asp:ListItem>
                            <asp:ListItem Value="[#Pro_Settlement]">结算按钮</asp:ListItem>
                            <asp:ListItem Value="[#Pro_DeteleButton]">删除按钮</asp:ListItem>
                            <asp:ListItem Value="[#Pro_Url]">查看商品信息Url链接</asp:ListItem>
                        </asp:DropDownList>
                    </div>
                    <div id="ShoppingCarInfo" style="display:none">
                        <asp:DropDownList ID="DropDownList1" runat="server" 
                            onchange="javascript:getValue(this.value);">
                            <asp:ListItem Value="">--请选择显示信息--</asp:ListItem>
                            <asp:ListItem Value="[#Pro_Images]">商品图片</asp:ListItem>
                            <asp:ListItem Value="[#Pro_Name]">商品名称</asp:ListItem>
                            <asp:ListItem Value="[#Pro_Price]">市场价</asp:ListItem>
                            <asp:ListItem Value="[#Pro_ShopPrice]">商城价</asp:ListItem>
                            <asp:ListItem Value="[#Pro_Integral]">商品赠送积分</asp:ListItem>
                            <asp:ListItem Value="[#Pro_Url]">查看商品信息Url链接</asp:ListItem>
                        </asp:DropDownList>
                    </div>
                </td>
                <td>
                    布局方式</td>
                <td>
                    <asp:RadioButtonList ID="Rbl_TempletLayout" runat="server" 
                        RepeatDirection="Horizontal">
                        <asp:ListItem Value="0" Selected="True">Div</asp:ListItem>
                        <asp:ListItem Value="1">Table</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
        <tr>
            <td>
                <input type="button" value="循环内容" onclick="getValue('{# 您要加的内容 #}')" /><br /><br /><span style="color:Red">注：当你添加了要循环的内容,该标签就循环你指定的内容;没有指定循环整个内容.</span><br /><br />
            </td>
            <td colspan="3"  align="left">
                 <asp:TextBox runat="server" ID="txtLabelContent" height="200" onselect="setCaret(this);"  onclick="setCaret(this);"  onkeyup="setCaret(this);" Width="500" TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
        </table>
    </div>
    </form>
    <table style="width: 100%;" class="form_table_input">
        <tr><td style="width: 100%;" align="center"><input type="button" id="bt_back" value="提交" onclick="ReturnValue()" />
            
        </td></tr>
    </table>
    </div>
    </form>
</body>
</html>