⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 powereasy.product.asp

📁 个人网站比较简短
💻 ASP
📖 第 1 页 / 共 5 页
字号:
'13       ShowPropertyType ------显示产品属性(固顶/推荐/普通)的方式,0为不显示,1为小图片,2为符号
'14       ShowDateType ------显示更新日期的样式,0为不显示,1为显示年月日,2为只显示月日,3为以“月-日”方式显示月日。
'15       ShowHotSign -----------是否显示热门产品标志,True为显示,False为不显示
'16       ShowNewSign -------是否显示新产品标志,True为显示,False为不显示
'17       UsePage -----------是否分页显示,True为分页显示,False为不分页显示,每页显示的产品数量由MaxPerPage指定
'18       OpenType -----产品打开方式,0为在原窗口打开,1为在新窗口打开

'19       UrlType ---- 链接地址类型,0为相对路径,1为带网址的绝对路径,注意此参数在标签中不公开

'20       IntervalLines ---- 每隔N行空白一行,为0时不空行
'21       Cols ----每行的列数。超过此列数就换行。

'以下参数只有当ShowType参数设为表格式时才有效
'22       ShowTableTitle ---- 是否显示表格头部,只有当ShowType参数设为表格式时才有效,True为显示,False为不显示
'23       TableTitleStr ---- 表格头部文字(例如:商品名称|型号|规格|上市时间|单位|库存量|重量|市场价|商城价|优惠价|会员价|折扣率|操作),请勿删除项目。只有当ShowType参数设为表格式时才有效,如果为空,不显示表格头部
'24       ShowProductModel ---- 是否显示商品型号,只有当ShowType参数设为表格式时才有效,True为显示,False为不显示
'25       ShowProductStandard ---- 是否显示商品规格,只有当ShowType参数设为表格式时才有效,True为显示,False为不显示
'26       ShowUnit ---- 是否显示商品单位,只有当ShowType参数设为表格式时才有效,True为显示,False为不显示
'27       ShowStocksType ----显示商品库存方式,只有当ShowType参数设为表格式时才有效,0为不显示,1为显示虚拟库存,2为显示实际库存
'28       ShowWeight ---- 是否显示商品重量,只有当ShowType参数设为表格式时才有效,True为显示,False为不显示
'29       ShowPrice_Market ---- 是否显示市场价,只有当ShowType参数设为表格式时才有效,True为显示,False为不显示
'30       ShowPrice_Original ---- 是否显示原价,只有当ShowType参数设为表格式时才有效,True为显示,False为不显示
'31       ShowPrice ---- 是否显示当前零售价,只有当ShowType参数设为表格式时才有效,True为显示,False为不显示
'32       ShowPrice_Member ---- 是否显示会员价,只有当ShowType参数设为表格式时才有效,True为显示,False为不显示
'33       ShowDiscount  ---- 是否显示折扣率,只有当ShowType参数设为表格式时才有效,True为显示,False为不显示
'34       ShowButtonType ---- 按钮显示方式,0为不显示,1为显示购买按钮,2为显示详细按钮,3为收藏按钮,4为显示购买+详细按钮,5为显示购买+收藏按钮,6为详细+收藏按钮,7为三个都显示
'35       ButtonStyle ---- 按钮样式

'36       CssNameTable ---- 表格的CSS类名,可选参数
'37       CssNameTitle ---- 表格头部行的CSS类名,可选参数
'38       CssNameA ---- 列表中文字链接调用的CSS类名,可选参数
'39       CssName1 ---- 列表中奇数行的CSS效果的类名,可选参数
'40       CssName2 ---- 列表中偶数行的CSS效果的类名,可选参数
'=================================================

Public Function GetProductList(arrClassID, IncludeChild, iSpecialID, ProductNum, ProductType, IsHot, IsElite, DateNum, OrderType, ShowType, TitleLen, ContentLen, ShowClassName, ShowPropertyType, ShowDateType, ShowHotSign, ShowNewSign, UsePage, OpenType, UrlType, IntervalLines, Cols, ShowTableTitle, TableTitleStr, ShowProductModel, ShowProductStandard, ShowUnit, ShowStocksType, ShowWeight, ShowPrice_Market, ShowPrice_Original, ShowPrice, ShowPrice_Member, ShowDiscount, ShowButtonType, ButtonStyle, CssNameTable, CssNameTitle, CssNameA, CssName1, CssName2)
    Dim sqlProduct, rsProductList, iCount, iNumber, strProductList, TitleStr, strThisClass, trs, strProperty, strLink
    Dim CssName, iAuthor
    Dim arrTitle, iLines
    iCount = 0
    strThisClass = ""
    UrlType = PE_CLng(UrlType)
    Cols = PE_CLng1(Cols)
    If Cols <= 0 Then Cols = 1
    
    IntervalLines = PE_CLng(IntervalLines)
    
    If TitleLen < 0 Or TitleLen > 200 Then
        TitleLen = 50
    End If

    If IsNull(CssNameTable) Or CssNameTable = "" Then CssNameA = "productlist_table"
    If IsNull(CssNameTitle) Or CssNameTitle = "" Then CssNameA = "productlist_title"
    If IsNull(CssNameA) Or CssNameA = "" Then CssNameA = "productlist_A"
    If IsNull(CssName1) Or CssName1 = "" Then CssName1 = "productlist_tr1"
    If IsNull(CssName2) Or CssName2 = "" Then CssName2 = "productlist_tr2"
    CssName = CssName1

    If TableTitleStr = "" Then
        TableTitleStr = "商品名称|型号|规格|上市时间|单位|库存量|重量|市场价|商城价|优惠价|会员价|折扣率|操作"
    End If
    arrTitle = Split(TableTitleStr, "|")
    If UBound(arrTitle) <> 12 Then
        arrTitle = Split("商品名称|型号|规格|上市时间|单位|库存量|重量|市场价|商城价|优惠价|会员价|折扣率|操作", "|")
    End If

    If ProductNum > 0 Then
        sqlProduct = "select top " & ProductNum & " "
    Else
        sqlProduct = "select "
    End If
    If ContentLen > 0 Then
        sqlProduct = sqlProduct & "P.ProductExplain,"
    End If
    sqlProduct = sqlProduct & "P.ClassID,P.ProductID,P.ProductNum,P.ProductName,P.UpdateTime,P.ProductThumb,P.ProductIntro,P.Hits"
    sqlProduct = sqlProduct & ",P.IsHot,P.IsElite,P.OnTop,P.ProductModel,P.ProductStandard,P.ProducerName,P.Unit,P.Stocks,P.OrderNum,P.Stars"
    sqlProduct = sqlProduct & ",P.ProductType,P.Price,Price_Original,P.Price_Market,P.Price_Member,P.BeginDate,P.EndDate,P.Discount,P.Weight"
    sqlProduct = sqlProduct & GetSqlStr(arrClassID, IncludeChild, iSpecialID, ProductType, IsHot, IsElite, DateNum, OrderType, ShowClassName, False)
    Set rsProductList = Server.CreateObject("ADODB.Recordset")
    rsProductList.Open sqlProduct, Conn, 1, 1
    If rsProductList.BOF And rsProductList.EOF Then
        If UsePage = True And ShowType < 5 Then totalPut = 0
        If ShowType < 5 Then
            If IsHot = False And IsElite = False Then
                strProductList = "<li>" & strThisClass & XmlText_Class("ProductList/t1", "没有") & ChannelShortName & "</li>"
            ElseIf IsHot = True And IsElite = False Then
                strProductList = "<li>" & strThisClass & XmlText_Class("ProductList/t1", "没有") & strHot & ChannelShortName & "</li>"
            ElseIf IsHot = False And IsElite = True Then
                strProductList = "<li>" & strThisClass & XmlText_Class("ProductList/t1", "没有") & strElite & ChannelShortName & "</li>"
            Else
                strProductList = "<li>" & strThisClass & XmlText_Class("ProductList/t1", "没有") & strHot & strElite & ChannelShortName & "</li>"
            End If
        End If
        rsProductList.Close
        Set rsProductList = Nothing
        GetProductList = strProductList
        Exit Function
    End If
    If UsePage = True And ShowType < 5 Then
        totalPut = rsProductList.RecordCount
        If CurrentPage < 1 Then
            CurrentPage = 1
        End If
        If (CurrentPage - 1) * MaxPerPage > totalPut Then
            If (totalPut Mod MaxPerPage) = 0 Then
                CurrentPage = totalPut \ MaxPerPage
            Else
                CurrentPage = totalPut \ MaxPerPage + 1
            End If
        End If
        If CurrentPage > 1 Then
            If (CurrentPage - 1) * MaxPerPage < totalPut Then
                iMod = 0
                If CurrentPage > UpdatePages Then
                    iMod = totalPut Mod MaxPerPage
                    If iMod <> 0 Then iMod = MaxPerPage - iMod
                End If
                rsProductList.Move (CurrentPage - 1) * MaxPerPage - iMod
            Else
                CurrentPage = 1
            End If
        End If
    End If

    iLines = 0

    Select Case PE_CLng(ShowType)
    Case 1, 3
        If Cols > 1 Then
            strProductList = "<table width='100%' cellpadding='0' cellspacing='0' class='" & CssNameTable & "'><tr>"
        Else
            strProductList = ""
        End If
    Case 2
        strProductList = "<table width='100%' cellpadding='2' cellspacing='1' class='" & CssNameTable & "'>"
        If ShowTableTitle = True Then
            strProductList = strProductList & "<tr align='center'><td class='" & CssNameTitle & "'></td>"
            strProductList = strProductList & "<td class='" & CssNameTitle & "'>" & arrTitle(0) & "</td>"
            If ShowProductModel = True Then
                strProductList = strProductList & "<td class='" & CssNameTitle & "'>" & arrTitle(1) & "</td>"
            End If
            If ShowProductStandard = True Then
                strProductList = strProductList & "<td class='" & CssNameTitle & "'>" & arrTitle(2) & "</td>"
            End If
            If ShowDateType > 0 Then
                strProductList = strProductList & "<td class='" & CssNameTitle & "'>" & arrTitle(3) & "</td>"
            End If
            If ShowUnit = True Then
                strProductList = strProductList & "<td class='" & CssNameTitle & "'>" & arrTitle(4) & "</td>"
            End If
            If ShowStocksType > 0 Then
                strProductList = strProductList & "<td class='" & CssNameTitle & "'>" & arrTitle(5) & "</td>"
            End If
            If ShowWeight = True Then
                strProductList = strProductList & "<td class='" & CssNameTitle & "'>" & arrTitle(6) & "</td>"
            End If
            If ShowPrice_Market = True Then
                strProductList = strProductList & "<td class='" & CssNameTitle & "'>" & arrTitle(7) & "</td>"
            End If
            If ShowPrice_Original = True Then
                strProductList = strProductList & "<td class='" & CssNameTitle & "'>" & arrTitle(8) & "</td>"
            End If
            If ShowPrice = True Then
                strProductList = strProductList & "<td class='" & CssNameTitle & "'>" & arrTitle(9) & "</td>"
            End If
            If ShowPrice_Member = True Then
                strProductList = strProductList & "<td class='" & CssNameTitle & "'>" & arrTitle(10) & "</td>"
            End If
            If ShowDiscount = True Then
                strProductList = strProductList & "<td class='" & CssNameTitle & "'>" & arrTitle(11) & "</td>"
            End If
            If ShowButtonType > 0 Then
                strProductList = strProductList & "<td class='" & CssNameTitle & "'>" & arrTitle(12) & "</td>"
            End If
            strProductList = strProductList & "</tr><tr>"
        End If
        strProductList = strProductList & "<tr>"
    End Select
    If ShowType = 5 Then Set XMLDOM = Server.CreateObject("Microsoft.FreeThreadedXMLDOM")

    Do While Not rsProductList.EOF
        If UsePage = True Then
            iNumber = (CurrentPage - 1) * MaxPerPage + iCount + 1
        Else
            iNumber = iCount + 1
        End If
        If TitleLen > 0 Then
            TitleStr = ReplaceText(GetSubStr(rsProductList("ProductName"), TitleLen, ShowSuspensionPoints), 2)
        Else
            TitleStr = ReplaceText(rsProductList("ProductName"), 2)
        End If
        Select Case PE_CLng(ShowPropertyType)
        Case 0
            strProperty = ""
        Case 1
            If rsProductList("OnTop") = True Then
                strProperty = "<img src=""" & ChannelUrl & "/images/Product_ontop.gif"" alt=""" & strTop & ChannelShortName & """>"
            ElseIf rsProductList("IsElite") = True Then
                strProperty = "<img src=""" & ChannelUrl & "/images/Product_elite.gif"" alt=""" & strElite & ChannelShortName & """>"
            Else
                strProperty = "<img src=""" & ChannelUrl & "/images/Product_common.gif"" alt=""" & strCommon & ChannelShortName & """>"
            End If
        Case 2
            strProperty = "·"
        Case 11
            strProperty = iNumber
        Case Else
            If rsProductList("OnTop") = True Then
                strProperty = "<img src=""" & ChannelUrl & "/images/Product_ontop" & ShowPropertyType - 1 & ".gif"" alt=""" & strTop & ChannelShortName & """>"
            ElseIf rsProductList("IsElite") = True Then
                strProperty = "<img src=""" & ChannelUrl & "/images/Product_elite" & ShowPropertyType - 1 & ".gif"" alt=""" & strElite & ChannelShortName & """>"
            Else
                strProperty = "<img src=""" & ChannelUrl & "/images/Product_common" & ShowPropertyType - 1 & ".gif"" alt=""" & strCommon & ChannelShortName & """>"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -