<%
'安装系统
if trim(Application("SqlDbHost"))="" or trim(Application("SqlDbName"))="" or trim(Application("SqlUserName"))="" or trim(Application("SqlUserPass"))="" then
response.Redirect "/setup.asp"
response.end
end if

'判断是否访问首页 还是带有参数访问购买页 代码开始
if request.QueryString("id")="" then isbuyform="no"

'访问首页 代码开始
if isbuyform="no" then
%>
<!--#include virtual="/show/indexhead.asp"-->
<div class="flexslider"><ul class="slides">
		<%if bannerpic1<>"" then%>
        <li style="background:url(<%=bannerpic1%>) 50% 0 no-repeat;"><a style="width:100%;height:100%;display:block" target="_blank" href="<%=bannerlink1%>"></a></li>
        <%end if%>
		<%if bannerpic2<>"" then%>
        <li style="background:url(<%=bannerpic2%>) 50% 0 no-repeat;"><a style="width:100%;height:100%;display:block" target="_blank" href="<%=bannerlink2%>"></a></li>
        <%end if%>
		<%if bannerpic3<>"" then%>
        <li style="background:url(<%=bannerpic3%>) 50% 0 no-repeat;"><a style="width:100%;height:100%;display:block" target="_blank" href="<%=bannerlink3%>"></a></li>
        <%end if%>
        <%if bannerpic4<>"" then%>
		<li style="background:url(<%=bannerpic4%>) 50% 0 no-repeat;"><a style="width:100%;height:100%;display:block" target="_blank" href="<%=bannerlink4%>"></a></li>
        <%end if%>
        <%if bannerpic5<>"" then%>
		<li style="background:url(<%=bannerpic5%>) 50% 0 no-repeat;"><a style="width:100%;height:100%;display:block" target="_blank" href="<%=bannerlink5%>"></a></li>
        <%end if%>
</ul></div>
<script>
$(function(){
	$('.flexslider').flexslider({
		directionNav: true,
		pauseOnAction: false
	});
});
</script>
<div class="sygg conter">公司公告</div>
<div class="syggyw conter">—— PARTNER——</div>
<div class="syggbox conter">
<div class="syggl left">
    <%
    rs.open "select top 1 * from aytongzhi where ayisshow=1 order by aytongzhiid desc",conn,1,1
    if not(rs.eof) then%>
    <div class="syggimg left"><img src="<%=trim(rs("aytongzhipic"))%>" width="435" height="248"></div>
        <div class="syggtop right">
            <div class="syggtopbt">
            <%
            if len(trim(rs("aytongzhibiao")))>20 then
            response.Write left(rs("aytongzhibiao"),20)&"…"
            else
            response.Write trim(rs("aytongzhibiao"))
            end if
            %>
            <p style="font-size:12px; color:#999; line-height:25px"><%=rs("aytongzhidate")%></p>
            </div>
            <div class="syggtopjj"><%
            if len(trim(rs("ayshowcon")))>98 then
            response.Write left(rs("ayshowcon"),98)&"…"
            else 
            response.Write trim(rs("ayshowcon"))
            end if%>
            </div>
        <a href="/notice/<%=rs("suijiid")%>" target="_blank"><img src="<%=ossurl%>Template/Template5/images/ckxq.jpg" width="140" height="40"></a>
        </div>
    <%end if
    rs.close%>
    </div>
<div class="syggr right"><div class="sygglist"><ul>
<%
rs.open "select top 6 t5,aytongzhikejian,aytongzhisx,aytongzhiid,aytongzhibiao,suijiid from aytongzhi where t5=1 and aytongzhikejian=0 order by aytongzhisx,aytongzhiid desc",conn,1,1
if not(rs.eof) then
do while not rs.eof
%>
<li><a href="/notice/<%=rs("suijiid")%>" target="_blank">
<% 
if len(trim(rs("aytongzhibiao")))>16 then
response.Write left(rs("aytongzhibiao"),16)&"…"
else
response.Write trim(rs("aytongzhibiao"))
end if
%>
</a></li>
<%rs.movenext 
loop
else
response.Write("暂无最新信息！")
end if
rs.close%>
</ul></div></div></div>
<div class="clearit"></div>

<div class="syhxysbox">
<div class="sygg conter">核心优势</div><div class="syggyw conter">——ADVANTAGE——</div>
<div class="syhxysnr conter">
<div class="syhxysl" style="width:215px"><p style=" font-size:21px; line-height:60px; color:#38425c">急速发货</p><p style=" font-size:12px; line-height:22px; color:#666666">发货1秒急速响应<br> 省时省心省力<br> 享受高枕无忧</p></div>
<div class="syhxysl" style="width:415px"><p style=" font-size:21px; line-height:60px; color:#38425c">精确统计</p><p style=" font-size:12px; line-height:22px; color:#666666">商品销售过程中，<br>对每笔订单都认真对待，<br> 不丢单，保证安全高效</p></div>
<div class="syhxysl" style="width:210px"><p style=" font-size:21px; line-height:60px; color:#38425c">安全保障</p><p style=" font-size:12px; line-height:22px; color:#666666">24小时监视订单<br>和资金安全，确保销量稳定<br> 集群防御部署，网络安全无忧</p></div>
<div class="syhxysl" style="width:215px; float:right"><p style=" font-size:21px; line-height:60px; color:#38425c">贴心平台</p><p style=" font-size:12px; line-height:22px; color:#666666">公司自主研发系统<br>更新升级快速响应，问题积极处理<br> 我们听取任何建议，快速完善</p></div>
</div>
</div>

<div class="sygltt"><div class="p-title-one">对我们来说,"持续发展"是一个用来描述和客户关系的词语,因为我们和客户一起创造价值,更为客户带来更大的价值。</div><div class="p-title-two"><%=jname%>团队</div></div>

<div class="syhzhbbox conter">
<div class="sygg conter">合作伙伴</div><div class="syggyw conter">——PARTNER——</div><div class="jianju"></div>
<div class="syhzhb"><img src="<%=ossurl%>Template/Template5/images/hz1.jpg" width="170" height="66"></div>
<div class="syhzhb"><img src="<%=ossurl%>Template/Template5/images/hz5.jpg" width="170" height="66"></div>
<div class="syhzhb"><img src="<%=ossurl%>Template/Template5/images/hz4.jpg" width="170" height="66"></div>
<div class="syhzhb"><img src="<%=ossurl%>Template/Template5/images/hz2.jpg" width="170" height="66"></div>
<div class="syhzhb"><img src="<%=ossurl%>Template/Template5/images/hz3.jpg" width="170" height="66"></div>
<div class="syhzhb"><img src="<%=ossurl%>Template/Template5/images/hz6.jpg" width="170" height="66"></div>
</div>
<div class="clearit"></div>
<!--#include virtual="/show/indexfoot.asp"-->
<%
response.End()
end if
'访问首页 代码结束

'访问购买页 代码开始 ####################################################################################################
%>
<!--#include virtual="/inc/conn.asp"-->
<!--#include virtual="/inc/sitecon.asp"-->
<!--#include virtual="/Template/newbuy2/bank.asp"-->
<!--#include virtual="/inc/buysyspc.asp"-->
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="/Template/newbuy2/css/ak_style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/Template/newbuy2/js/jquery-1.9.min.js"></script>
<script type="text/javascript" src="/inc/layer/layer.js" ></script>
<script type="text/javascript" src="/inc/qrcode.min.js"></script>
<script type="text/javascript">
//function checklx(str){$('#lxclub').show();$('#bg123').show();lianxitx.innerHTML=str;}
//function checkmail(){$('#mailclub').show();$('#bg123').show();}
function check_log(){if(document.formlog.username.value==""){alert("请填写帐号");return false}if(document.formlog.password.value==""){alert("请填写密码");return false}} 
function closeDiv(){document.getElementById("gift_tip").style.visibility="hidden";}
</script> 
</head>

<body>
<!--loading-->
<div class="loading" id="loading"><img src="<%=ossurl%>Template/newbuy2/images/loading.gif" /></img></div>

<%
formform=trim(SafeRequest("form"))			'来路方式 后缀
formid=trim(SafeRequest("id"))				'来路ID
isduliurl=trim(SafeRequest("isduliurl")) 	'是否独立链接来源
 

'来路参数检测
if formform="" or formid="" then call PopErr2("数据获取失败，请联系商户！错误代码ERR_G01",weburl)

if request.Cookies("lailuyu")="" then
response.Cookies("lailuyu")=request.ServerVariables("HTTP_REFERER")'来路域名
end if

zdwapurl=wapurl

'生成 微信获取卡密 获取微信openid 所需验证字符串
Const stringmodarr = "abcdefghijklmnopqrstuvwxyzABCDEDFHIJKLMNOPQRSTUVWXYZ0123456789"
strlength = Len(stringmodarr)
Randomize timer
For i = 1 To 20 
getopenidstr = getopenidstr&Mid(stringmodarr,Int(Rnd * strlength + 1),1)  
Next 
response.Cookies("getopenidstr")=getopenidstr

'############来源ID为分类############
if formform="fenlei" then
houzhui=".html"  
	if isduliurl<>"y" then
	flwhere="aykafenleimd5='"&formid&"'"  'MD5链接
	else
	flwhere="ayfldlmd5url='"&formid&"'"   '固定链接
	end if
	rs.open "select aykafenleiid,aykanamesuoyou,aykafenleimd5,aykafenleikg,ayfldlmd5url,iszhuxiao from aykafenlei where "&flwhere&" and aykafenleikg=0 and iszhuxiao=0",conn,1,1
	if rs.bof and rs.eof then call PopErr2("未找到分类信息，请联系商户确认!错误代码ERR_G08",weburl)
	fid=rs("aykafenleiid")       '分类数字ID
	uid=rs("aykanamesuoyou")     '商户数字ID
	rs.close
	sql="select * from ayname where aynameid="&uid&" and iszhuxiao=0"
end if

'############来源ID为商品ID############
if formform="shangpin" then
houzhui=".htm" 
	if isduliurl<>"y" then
	spwhere="aygoodmd5='"&formid&"'" 	 'MD5链接
	else
	spwhere="aygdlmd5url='"&formid&"'"   '固定链接
	end if
	rs.open "select aygoodid,aygoodsuoyouid,aygdlmd5url,aygoodmd5,aygoodfl,aygoodzhuangtai,iszhuxiao from aygood where "&spwhere&" and aygoodzhuangtai=0 and iszhuxiao=0",conn,1,1
	if rs.bof and rs.eof then call PopErr2("未找商品信息，请联系商户确认!错误代码ERR_G09",weburl)
	fid=rs("aygoodfl") 			 '分类数字ID
	gid=rs("aygoodid")           '商品数字ID
	uid=rs("aygoodsuoyouid")     '商户数字ID
	rs.close
	sql="select * from ayname where aynameid="&uid&" and iszhuxiao=0"
end if
 
'############来源ID为商户ID############
if formform="name" then
houzhui=""
sql="select * from ayname where aygename='"&formid&"' and iszhuxiao=0"
end if

'获取后缀*********************************************
if formform="name" then 
houzhui=""
elseif formform="fenlei" then
houzhui=".html"
elseif formform="shangpin" then
houzhui=".htm" 
end if

'############商户数据信息 开始############
rs.open sql,conn,1,1
if rs.bof and rs.eof then call PopErr2("未找到此商户信息，请联系商家确认!错误代码ERR_G02",weburl)
	
'if cint(rs("ayusersuo"))=1 then call PopErr2("未找到该商家，请联系管理员!错误代码ERR_G03",weburl)
if cint(rs("ayispay"))=1 then call PopErr2("该商家被禁止销售!",weburl)
if isnull(trim(rs("ayqq")))=true or trim(rs("ayqq"))="" then call PopErr2("商家还未设置联系QQ!暂时不能购买!错误代码ERR_G09",weburl)

'############购买页 模板选择############
if trim(rs("moban"))<>"index" then
	if isduliurl="y" then 
	response.Redirect weburl&"shop/"&trim(rs("moban"))&"/buy/"&formid&houzhui
	else
	response.Redirect weburl&"shop/"&trim(rs("moban"))&"/"&formid&houzhui
	end if	
response.End()
end if

uid=rs("aynameid")
ayjibie=rs("ayjibie")       				 '级别
ayisxiaobao=rs("ayisxiaobao")   			 '是否加入诚信保障 0否 1是
ayisxiaojin=rs("ayisxiaojin")   			 '消保金额  默认0  
aychengjiao=rs("aychengjiao")   			 '成交笔数 默认0
aywebname=trim(rs("aywebname")) 			 '站点名称
ayweburl=trim(rs("ayweburl"))   			 '站点url
shanghuqq=trim(rs("ayqq"))      			 'QQ
ismailrz=rs("ismailrz")         			 '邮箱认证
istelrz=rs("istelrz")           			 '电话认证
ischengxin=rs("ischengxin")     			 '可信商家
ayusermiaoshu=rs("ayusermiaoshu")			 '商户描述
iswappay=rs("iswappay")          			 '是否开启wap支付
isbutishi=rs("isbutishi")        			 '是否开启购买提示

tanchuang=trim(rs("tanchuang"))
if tanchuang<>"" then 
tanchuang=trim(ReplaceTrim(rs("tanchuang"))) '商家设置 弹窗提示
tanchuang=replace(tanchuang,"\n","<br>")
end if

ayweixinid=trim(rs("ayweixinid"))			 '微信二维码
shangjiabao_user=rs("shangjiabao")    		 '未缴纳消保是否允许上架销售 1禁止
isbuylog=rs("isbuylog")			 			 '是否强制买家登录购买 0随全局 1开启	2关闭	if cint(ayjibie)=1 or cint(ayjibie)=10 or cint(ayjibie)=8 or cint(ayjibie)=12 then isbuylog=1
tousumd5=trim(rs("aymd5"))					 'MD5 ID
aydata=DateValue(rs("aydata"))				 '商家注册时间
isjiekoustr=trim(rs("isjiekou")) 			 '强制接口  isjiekoustr(0)网银  isjiekoustr(1)支付宝 isjiekoustr(2)财付通 isjiekoustr(3)微信 isjiekoustr(4) 手Q
if cint(rs("ayisweixinok"))=2 then showweixinerweima=trim(rs("ayweixinpic")) '已审核通过 商家展示二维码

'############当前购买页链接 用于跳回使用############
if isduliurl="y" then 
thispcurl=weburl&"buy/"&formid&houzhui
else
thispcurl=weburl&formid&houzhui
end if

'############买家是否已登录############
isbuymailog="no" 				
if request.Cookies("aynameid")<>"" then

'检查是否在全站买家ID黑名单
call chkbuyheiall(request.Cookies("aynameid"))

isbuymailog="yes"
	if trim(rs("nobuyid"))<>"" and isnull(trim(rs("nobuyid")))=false then
	diankastr=mid(trim(rs("nobuyid")),1,len(trim(rs("nobuyid")))-1)	
	diankastr=split(trim(diankastr),",") 
		For dianka=0 To Ubound(diankastr) 
			if trim(diankastr(dianka))=request.Cookies("aynameid") then
			call logadd(request.Cookies("aynameid"),"买家被商家限制购买",0,1)
			call PopErr2("商家禁止该买家购买!错误代码ERR_G10",weburl)
			response.end
			end if
		next 
	end if
	maitel=gettelnum(request.Cookies("aynameid"))
end if

rs.close
'############商户数据信息 结束############

'买家ID信息
'if request.Cookies("aynameid")<>"" then 
'set rsmail=server.CreateObject("adodb.recordset")
'sqlmail="select aynameid,aymail,ayyue,ayusername from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
'rsmail.open sqlmail,conn,1,1
'buyuseryue=trim(rsmail("ayyue"))       '账户余额
'buyusername=trim(rsmail("ayusername")) '用户名
'rsmail.close
'end if

'购买提示框设置 inc/buysyspc.asp中设置
if isbuytishi="yes" then
if ayjibie=1 or ayjibie=10 then istishi="yes" 
end if

'购买提示框
if buytishi="yes" or istishi="yes" or isbutishi=1 then
listbuytishi="yes"
end if

'##########获取wap地址##########
if iswap="yes" then
	if isduliurl="y" then 
	wapurl=zdwapurl&"buy/"&formid&houzhui
	else
	wapurl=zdwapurl&formid&houzhui
	end if	
	if getistel="wap" then '手机访问 直接跳转到WAP	 inc/conn.asp设置		if clng(uid)<>58 then
	response.Redirect wapurl
	end if
end if


'##########全局设置 支付接口##########
sql="select buyisdl,ayisjdpay,shangjiabao,ayisbankpay,ayisalipay,ayistenpay,ayissaopay,aybankpay,ayisqqpay from ayquanju"
rs.open sql,conn,1,1

if cint(shangjiabao_user)<>2 then
	if cint(rs("shangjiabao"))=1 or cint(shangjiabao_user)=1 then
		if ccur(ayisxiaojin)<ccur(xiaobaojine) then
			call PopErr2("2018-1-18日起为保障交易安全，非VIP会员商家，暂时不能上架销售","/") 
			response.End
		end if
	end if
end if

ayisbankpay=rs("ayisbankpay")			 '网银支付 		1开启
aybankpay=rs("aybankpay")    			 '网银使用接口  1支付宝 2财富通 3易宝 4盛付通 5国付宝 6 51网银
ayisalipay=rs("ayisalipay")  			 '支付宝支付 	1开启
ayistenpay=rs("ayistenpay")  			 '财付通支付	1开启
ayissaopay=rs("ayissaopay")  			 '微信扫码支付	1开启
ayisqqpay=rs("ayisqqpay")    			 '手Q开关		1开启
ayisjdpay=rs("ayisjdpay")    			 '京东开关		1开启
if cint(isbuylog)<>2 then				 '2=关闭强制登录
if cint(rs("buyisdl"))=1 then isbuylog=1 '全站设置 买家必须登录才可以购买 1是 0否
end if
rs.close

'##########商家级别 支付接口##########
if cint(ayjibie)<>5 and cint(ayjibie)<>9 then
rs.open "select ayisjdpay,aybankpay,ayujbgid,ayisbankpay,ayisalipay,ayistenpay,ayissaopay,ayisqqpay from ayujb where ayujbgid="&ayjibie&"" ,conn,1,1
if rs.bof and rs.eof then call PopErr2("获取参数有误，请重新尝试",weburl&"index/exit")
ayisbankpay=rs("ayisbankpay")			'网银开关	1开启
aybankpay=rs("aybankpay")				'网银使用接口  1支付宝 2财付通 3易宝 4盛付通 5国付宝 6 51网银
ayisalipay=rs("ayisalipay")				'支付宝开关 1开启
ayistenpay=rs("ayistenpay")				'财付通开关 1开启
ayissaopay=rs("ayissaopay")				'微信开关	1开启
ayisjdpay=rs("ayisjdpay")				'京东开关	1开启
ayisqqpay=rs("ayisqqpay")				'手Q开关 	1开启
rs.close
end if

'JS提示框
%>
<script language="javascript">
window.onload = function()
{
	//if('<%'=tanchuang%>' != null && '<%'=tanchuang%>' != ""){alert('商家重要提示：\n<%'=tanchuang%>');}
	if('<%=listbuytishi%>'=="yes"){	$('#joinclub').show();$('#bg123').show();}
	if('<%=tanchuang%>' != null && '<%=tanchuang%>' != ""){layer.alert('<%=tanchuang%>', {title: '商家通知公告',});}
	//layer.alert('爱卡平台抵制一切网络违禁商品，倡导并践行绿色网络，如遇到涉黄/涉毒/贩卖公民信息及其他违规，请立即向平台客服人员进行举报！', {title: '爱卡平台提示',});
}
</script>

<div id="bg123" class="bg123" style="display:none;"></div>

<!--已审核通过 商家展示二维码-->
<div class="weixinid" id="weixinid" style="display: none;">
<img src="<%=showweixinerweima%>"  width="250"/>
</div>

<!--购买提示框-->
<div class="joinclub" id="joinclub" style="display:none;">
<div class="joinclub01"><img src="<%=ossurl%>images/wxts.jpg" /></img></div>
	<div class="joinclub02">
    购买须知：<br>
    【<%=webname%>】运营性质和某宝一样！<br>
    【<%=webname%>】并非商品直接销售商！<br>
    【<%=webname%>】是买家与商家之间的中间平台！<br>
    <div class="joinclub03"></div>
    <span style="color:#F60">重要提示：</span><br>
    <span style="color:#F60">商品的使用与售后，需要联系商家，请知晓！！！</span><br>
    <span style="color:#F60">商家QQ：<span id="jsqq"><a style="color:#F60" href="tencent://message/?uin=<%=shanghuqq%>&Site=<%=shanghuqq%>&Menu=yes" title="<%=shanghuqq%>"><%=shanghuqq%></a> (先添加好友)</span></span><br>
    <%if ayweixinid<>"" then%>
    <span style="color:#F60">商家微信：<%=ayweixinid%></span><br>
    <%end if%>
    <div class="joinclub03"></div>
    关于投诉与退款：<br>
    商品出现任何问题请在24小时内<a href="<%=weburl%>tousu" target="_blank">【进行投诉】</a>！<br>
    <div class="joinclub04"></div>
    <input type="button" value=" 继续购买，我知道商品售后联系商家 " id="closeCustomer" style="cursor:pointer" />&nbsp;&nbsp;
    <input type="button" value=" 我要离开 " id="closeurl" style="cursor:pointer" />
    </div>
</div>

<!--联系方式提示框
<div id="lxclub" class="lxclub" style="display:none;">
	<div class="lxclub01">你预留的订单查询唯一依据，<span style="color:#F60">联系方式</span>为：</div>
    <div class="lxclub02" id="lianxitx"></div>
	<div class="lxclub03">订单查询/提卡地址  <a href="<%'=weburl%>chaxun" target="_blank"><%'=weburl%>chaxun</a></div>
    <div class="lxclub04"><input type="button" class="logindlreg" value=" 我知道了 " id="closelx" style="cursor:pointer" /></div>
</div>
-->

<!--买家邮箱提示框 开始
<div id="mailclub" class="lxclub" style="display:none;">
	<div class="lxclub05"><%'=jname%>提示您：</div>
    <div class="lxclub06">由于发信机制限制。<br>我们发送给您的邮件可能被归类到垃圾邮件中！<br><br>当您收件箱没有收到我们的邮件时，不妨查看一下垃圾邮件！<br></div><br>
    <div class="lxclub04"><input type="button" class="logindlreg" value=" 我知道了 " id="closemail" style="cursor:pointer" /></div>
</div>
-->

<!--微信接收通知 提示框 开始  --> 
<div class="wxclub" id="wxclub" style="display:none;">
	<div class="wxclub01">
        <div class="wxclubl">
    	<span style="color:#F60">如果还未关注公众号<br>请扫描下面二维码关注公众号</span><br>
    	<img src="<%=ossurl%>images/weixinma.jpg" width="190" /></img>
        </div>
        <div class="gexian"></div>
        <div class="wxclubr">
    	<span style="color:#F60">我已关注公众号<br>直接扫描下面二维码</span><br>
        <%thisurl=zdwapurl&"index/getopenid?id="&request.Cookies("getopenidstr")%>
        <div id="qrcodewx" style="padding-left:45px; padding-top:10px;"></div>
        <script type="text/javascript">var qrcodewx = new QRCode(document.getElementById("qrcodewx"), {width:170,height:170});qrcodewx.makeCode("<%=thisurl%>");</script>
        </div>
    <input type="button" class="logindlreg" value=" 关    闭 " id="closewx" style="cursor:pointer" />
    </div>
</div>

<!--买家登录 开始-->
<div class="logclub" id="logclub" style="display:none;">
	<div class="wxclub01">
        <div class="wxclubl">
    	<span style="color:#F60">买家快捷登录</span><br><br>
        
		<%if isqqkfon="yes" then%>
        <a href="https://open.weixin.qq.com/connect/qrconnect?appid=<%=wxkfappid%>&redirect_uri=<%=wxkfre%>&response_type=code&scope=snsapi_login&state=<%=thispcurl%>#wechat_redirect"><img src="<%=ossurl%>Template/newbuy2/images/wxlog.png" /></img></a><br><br>
        <%end if%>
        <%if iswxkfon="yes" then%>
        <a href="https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=<%=qqkfappid%>&redirect_uri=<%=qqkfre%>&state=<%=thispcurl%>"><img src="<%=ossurl%>Template/newbuy2/images/qqlog.png" /></img></a>
        <%end if%>

        </div>
        <div class="gexian"></div>
        <div class="wxclubr">
    	<span style="color:#F60">使用密码登录</span><br><br>
        <form action="/index/checkuser" method="post" name="formlog" target="_self" id="formlog" onSubmit="return check_log()">
        手机：<input name="username" type="text"  class="xzspsrk1" id="username" /><br><br>
		密码：<input name="password" type="password"  class="xzspsrk1" id="password" />
        <input name="pcurl" type="hidden" value="<%=thispcurl%>" />
        <input name="act" type="hidden" value="logindex" />
        <input name="lei" type="hidden" value="mai" />
		<input class="buymai" name="mailog" type="submit" id="mailog" value=" 买 家 登 录 " />
        &nbsp;
        <input class="buymai" name="reguid" type="button" id="reguid" value=" 快 速 注册 " onClick="javascript:window.location.href='/u/addbuyuser?l=w&url=<%=thispcurl%>'" />
        </form>
        </div>
    <input type="button" class="logindlreg" value=" 关    闭 " id="closelog" style="cursor:pointer" />
    </div>
</div>

<title><%=aywebname%>(<%=webname%>)</title>

<script type="text/javascript">
	  var jsondata = null;
			
      $(function()
	  {
				$.post('/Template/newbuy2/',{uid:'<%=uid%>'},function(data)
				{
						//获取所有分类
						var mt = data;
						var fenleilist = '<option value="0">-=请选择商品分类=-</option>';
						var goodlist = '<option value="0">-=请选择商品=-</option>';
						window.Q_flid = '0';window.Q_spid = '0'; //默认分类ID 0 默认商品ID 0    $("#flid").attr("value", '0');$("#spid").attr("value", '0');
						
						for (var i = 0; i < mt.length; i++) 
						{
								//获取分类列表
								if(mt[i].L == 0)
								{		
										if('<%=isduliurl%>' == 'y') 						 //固定链接
										{
												if(mt[i].I == '<%=fid%>')					 //来源=分类 下拉菜单选定来源分类
												{
												$('#flname').html(mt[i].N);
												window.Q_flid = mt[i].I;					 //分类ID	$("#flid").attr("value", mt[i].I);

													if(mt[i].Q != null && mt[i].Q != '' && mt[i].Q != '0')
													{
													$('#sqq').html(mt[i].Q);
													$('#sqq2').html("<a href=tencent://message/?uin="+mt[i].Q+"&Site="+mt[i].Q+"&Menu=yes title="+mt[i].Q+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>");
													$('#sqq3').html("<a href=tencent://message/?uin="+mt[i].Q+"&Site="+mt[i].Q+"&Menu=yes title="+mt[i].Q+">"+mt[i].Q+"</a>");
													}
													if(mt[i].U != null && mt[i].U != '')
													{
													$('#surl').html("<a href="+mt[i].U+" target=_blank>"+mt[i].U+"</a>");
													}
												}
										}
										else //非独立链接
										{		
												if(mt[i].I == '<%=fid%>')			 //来源=分类 下拉菜单选定来源分类
												{
												fenleilist += '<option value="'+ mt[i].I +'" selected="selected">'+ mt[i].N +'</option>'; 

												window.Q_flid = '<%=fid%>';			 //分类ID	$("#flid").attr("value", '<%'=fid%>');
													if(mt[i].Q != null && mt[i].Q != '' && mt[i].Q != '0')
													{
													$('#sqq').html(mt[i].Q);
													$('#sqq2').html("<a href=tencent://message/?uin="+mt[i].Q+"&Site="+mt[i].Q+"&Menu=yes title="+mt[i].Q+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>");
													$('#sqq3').html("<a href=tencent://message/?uin="+mt[i].Q+"&Site="+mt[i].Q+"&Menu=yes title="+mt[i].Q+">"+mt[i].Q+"</a>");
													}
													if(mt[i].U != null && mt[i].U != '')
													{
													$('#surl').html("<a href="+mt[i].U+" target=_blank>"+mt[i].U+"</a>");
													}
												}
												else
												{
												fenleilist += '<option value="'+ mt[i].I +'">'+ mt[i].N +'</option>'; 
												}
										}
								}
								//获取商品列表
								if('<%=gid%>' != null && '<%=gid%>' != '')							 //来源=商品 下拉菜单选定来源商品
								{
										if('<%=isduliurl%>' == 'y' && '<%=formform%>'=='shangpin')  //固定链接
										{
												if(mt[i].L == 1 && mt[i].F == '<%=fid%>')
												{
														if(mt[i].I == '<%=gid%>')
														{
														$('#spname').html(mt[i].N);
														window.Q_spid = mt[i].I;					 //点卡比例 $("#spid").attr("value", mt[i].I); 	
															if(mt[i].Q != null && mt[i].Q != '' && mt[i].Q != '0')
															{
															$('#sqq').html(mt[i].Q);
															$('#sqq2').html("<a href=tencent://message/?uin="+mt[i].Q+"&Site="+mt[i].Q+"&Menu=yes title="+mt[i].Q+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>");
															$('#sqq3').html("<a href=tencent://message/?uin="+mt[i].Q+"&Site="+mt[i].Q+"&Menu=yes title="+mt[i].Q+">"+mt[i].Q+"</a>");
															}
															if(mt[i].U != null && mt[i].U != '')
															{
															$('#surl').html("<a href="+mt[i].U+" target=_blank>"+mt[i].U+"</a>");
															}
														chasp('<%=gid%>'); 							 //传递 触发该商品信息
														}
												}
										}
										else //非独立链接
										{
												if(mt[i].L == 1 && mt[i].F == '<%=fid%>')
												{
														if(mt[i].I == '<%=gid%>')
														{
														goodlist += '<option value="'+ mt[i].I +'" selected="selected">'+ mt[i].N +'</option>'; 
														window.Q_spid = '<%=gid%>';		//$("#spid").attr("value", '<%'=gid%>');
														//$('#spshuoming').html(mt[i].S);	
															if(mt[i].Q != null && mt[i].Q != '' && mt[i].Q != '0')

															{
															$('#sqq').html(mt[i].Q);
															$('#sqq2').html("<a href=tencent://message/?uin="+mt[i].Q+"&Site="+mt[i].Q+"&Menu=yes title="+mt[i].Q+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>");
															$('#sqq3').html("<a href=tencent://message/?uin="+mt[i].Q+"&Site="+mt[i].Q+"&Menu=yes title="+mt[i].Q+">"+mt[i].Q+"</a>");
															}
															if(mt[i].U != null && mt[i].U != '')
															{
															$('#surl').html("<a href="+mt[i].U+" target=_blank>"+mt[i].U+"</a>");
															}
														chasp('<%=gid%>'); 			 //传递 触发该商品信息
														}
														else
														{
														goodlist += '<option value="'+ mt[i].I +'">'+ mt[i].N +'</option>'; 
														}
												}
										}
								}
						}
						
						//初始列表
						if('<%=isduliurl%>' != 'y'){$('#fenleilist').html(fenleilist);} //非独立链接  写入分类下拉列表
						if('<%=gid%>' != null && '<%=gid%>' != '')	//来源=商品
						{
							if('<%=isduliurl%>' != 'y' || '<%=formform%>'!='shangpin')
							{
							$('#goodlist').html(goodlist); //非来源 商品的固定链接 写入列表
							}
						}
						else
						{
						chafl('<%=fid%>');  //当来源不是商品时启用 避免多次触发  传递 触发该分类下商品列表 
						}
						
						$('#loading').hide();
						
						//购买提示 
						$('#closeurl').on('click',function(){window.location.href="/";});
						$('#closeCustomer').on('click',function(){$('#joinclub').hide();$('#bg123').hide();});
							
						//联系方式提示 
						//$('#closelx').on('click',function(){$('#lxclub').hide();$('#bg123').hide();});

						//联系方式提示 
						//$('#closemail').on('click',function(){$('#mailclub').hide();$('#bg123').hide();});
						
						//买家登录
						$('#closelog').on('click',function(){$('#logclub').hide();$('#bg123').hide();$(".hot-dakai").attr("disabled",false);});

						//打开买家登录框
						$('#openlog').on('click',function(){$('#logclub').show();$('#bg123').show();});
						
						//微信获取卡密
						$('#closewx').on('click',function(){$('#wxclub').hide();$('#bg123').hide();clearInterval(timerx);});
						$('#huoquopenid').on('click',function(){
						$('#wxclub').show();$('#bg123').show();
						var handlerx = function()
						{$.post("/inc/getopenid/",null,function(msgx){if(msgx != 'no'){$('#wxclub').hide();$('#bg123').hide();$('#hqopenid').html('扫码成功！卡密将发送至 '+msgx+' 的微信');clearInterval(timerx);}});} 
						timerx = setInterval(handlerx , 2000);
						});
					
						//分类 触发 alert(myw);
						$('#fenleilist').change(function(event)
						{		
								$('#loading').show();
								var fenleiid=$('#fenleilist option:selected').val();  //当前分类选定值
								var evt = event || window.event;
								evt.stopPropagation();			//终止事件
								window.Q_flid = fenleiid;		//$("#flid").attr("value",fenleiid);
								window.Q_spid = '0';			//默认商品ID 0	$("#spid").attr("value", '0');
								if(fenleiid=="0"){alert("请选择商品分类");return false}	
								
								var goodlist = '<option value="0">-=请选择商品=-</option>';
								//获取所有商品
								for (var i = 0; i < mt.length; i++) 
								{
									//获取当前分类 简要说明
									if(mt[i].L == 0 && mt[i].I == fenleiid)
									{
									//$('#flshuoming').html(mt[i].S);
										if(mt[i].Q != null && mt[i].Q != '' && mt[i].Q != '0')
										{
										window.Q_shanghuqq = mt[i].Q;
										$('#sqq').html(mt[i].Q);
										$('#sqq2').html("<a href=tencent://message/?uin="+mt[i].Q+"&Site="+mt[i].Q+"&Menu=yes title="+mt[i].Q+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>");
										$('#sqq3').html("<a href=tencent://message/?uin="+mt[i].Q+"&Site="+mt[i].Q+"&Menu=yes title="+mt[i].Q+">"+mt[i].Q+"</a>");
										}
										else
										{
										window.Q_shanghuqq = <%=shanghuqq%>;
										$('#sqq').html('<%=shanghuqq%>');
										$('#sqq2').html("<a href=tencent://message/?uin="+'<%=shanghuqq%>'+"&Site="+'<%=shanghuqq%>'+"&Menu=yes title="+'<%=shanghuqq%>'+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>");
										$('#sqq3').html("<a href=tencent://message/?uin="+'<%=shanghuqq%>'+"&Site="+'<%=shanghuqq%>'+"&Menu=yes title="+'<%=shanghuqq%>'+">"+'<%=shanghuqq%>'+"</a>");
										}
										if(mt[i].U != null && mt[i].U != '')
										{
										$('#surl').html("<a href="+mt[i].U+" target=_blank>"+mt[i].U+"</a>");
										}
										else
										{
										$('#surl').html("<a href="+'<%=ayweburl%>'+" target=_blank>"+'<%=ayweburl%>'+"</a>");
										}
										//window.Q_dianka_fenlei = mt[i].D; //分类点卡比例 $("#dianka_fenlei").val(mt[i].D);
									}
									//获取该分类下全部商品
									if(mt[i].L == 1 && mt[i].F == fenleiid)
									{
									goodlist += '<option value="'+ mt[i].I +'">'+ mt[i].N +'</option>'; 
									}
								}
								$('#goodlist').html(goodlist);
								$('#loading').hide();
						})
					
						//商品 触发
						$('#goodlist').change(function(event)
						{		
								$('#loading').show();
								var goodid=$('#goodlist option:selected').val();  //当前商品选定值
								var evt = event || window.event;
								evt.stopPropagation();		//终止事件
								window.Q_spid = goodid;		//$("#spid").attr("value", goodid);
								if(goodid=="0"){alert("请选择商品");return false}
								chasp(goodid); 				//传递 触发该分类下商品列表
								$('#loading').hide();
						})
						
					
						//获取该分类下的商品列表
						function chafl(fid)
						{		
								var goodlist = '<option value="0">-=请选择商品=-</option>';
								//获取指定商品
								for (var i = 0; i < mt.length; i++) 
								{
									//获取该分类下全部商品
									if(mt[i].L == 1 && mt[i].F == fid)
									{
									goodlist += '<option value="'+ mt[i].I +'">'+ mt[i].N +'</option>'; 
									}
								}
								$('#goodlist').html(goodlist);
						}
						
						
						//获取商品信息
						function chasp(gid)
						{
								//库存卡
								$.post('/Template/newbuy2/chkkucunka/',{act:'kucunka',uid:'<%=uid%>',gid:gid},function(dataku)
								{
									var mtk = dataku;
									window.Q_spname = mtk[0].N;									//商品名称		
									window.Q_danjia = mtk[0].J;									//单价 $("#danjia").val(mtk[0].J);									
									window.Q_yuandanjia = mtk[0].J;								//初始单价 $("#yuandanjia").val(mtk[0].J);
									window.Q_youhuiquanzhi = '0';								//初始优惠券
									window.Q_buylx = mtk[0].B;									//预留联系方式	$("#buylx").val(mtk[0].B);
									window.Q_kucun = mtk[0].KU;									//库存卡	$("#kucun").val(mtk[0].KU);	
									window.Q_xiangou = mtk[0].X;								//限购		$("#xiangou").val(mtk[0].X);
									
									$("#quantity").val('1');
									$("#quantity").attr("disabled",false);
									window.Q_shanghuqq = <%=shanghuqq%>;
									$('#sqq').html('<%=shanghuqq%>');
									$('#sqq2').html("<a href=tencent://message/?uin="+'<%=shanghuqq%>'+"&Site="+'<%=shanghuqq%>'+"&Menu=yes title="+'<%=shanghuqq%>'+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>");
									$('#sqq3').html("<a href=tencent://message/?uin="+'<%=shanghuqq%>'+"&Site="+'<%=shanghuqq%>'+"&Menu=yes title="+'<%=shanghuqq%>'+">"+'<%=shanghuqq%>'+"</a>");
									$('#surl').html("<a href="+'<%=ayweburl%>'+" target=_blank>"+'<%=ayweburl%>'+"</a>");
									$('#jiage').html(parseFloat(mtk[0].J).toFixed(2)+'元');  	//商品价格
									$('#istikapass').hide();									//提卡密码
									$('#isbuypass').hide();										//购卡密码
									$('#isyouhuis').hide();										//优惠券
									//获取商品QQ
									if(mtk[0].Q != null && mtk[0].Q != '' && mtk[0].Q != '0')
									{
									$('#sqq').html(mtk[0].Q);
									$('#sqq2').html("<a href=tencent://message/?uin="+mtk[0].Q+"&Site="+mtk[0].Q+"&Menu=yes title="+mtk[0].Q+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>");
									$('#sqq3').html("<a href=tencent://message/?uin="+mtk[0].Q+"&Site="+mtk[0].Q+"&Menu=yes title="+mtk[0].Q+">"+mtk[0].Q+"</a>");
									}
									//获取商品URL
									if(mtk[0].U != null && mtk[0].U != ''){$('#surl').html("<a href="+mtk[0].U+" target=_blank>"+mtk[0].U+"</a>");}
									//是否限购
									if(mtk[0].X != '0'){$("#quantity").val(mtk[0].X);$("#quantity").attr("disabled",true); $('#s_xiangou').html("限购"+mtk[0].X+"张");}else{$('#s_xiangou').html('')} 
									//提卡密码
									if(mtk[0].TI == '1'){$('#istikapass').show();}
									//购卡密码
									if(mtk[0].BP == '1')	{$('#isbuypass').show();}
									//优惠券
									if(mtk[0].YH == '1')	{$('#isyouhuis').show();}
									//强制联系方式
									if(mtk[0].B=='0'){$('#lxfs').html("联系方式为任意字符");}
									if(mtk[0].B=='1'){$('#lxfs').html("联系方式必须为数字");}  
									if(mtk[0].B=='2'){$('#lxfs').html("联系方式必须为字母");}  
									if(mtk[0].B=='3'){$('#lxfs').html("联系方式必须为字母和数字");}  
									if(mtk[0].B=='4'){$('#lxfs').html("联系方式为数字或字母和下划线");}  
									if(mtk[0].B=='5'){$('#lxfs').html("联系方式必须为中文");}  
									if(mtk[0].B=='6'){$('#lxfs').html("联系方式必须为邮箱账号");}  
									if(mtk[0].B=='7'){$('#lxfs').html("联系方式必须为手机号码");}  
									//限购 不启用批发
									if(mtk[0].X != '0')	{window.Q_ispf='0';}else{window.Q_ispf=mtk[0].PF;}
									//批发
									if(mtk[0].X == '0' && mtk[0].PF == '1')
									{
									window.Q_pi1=mtk[0].P1;window.Q_pi2=mtk[0].P2;window.Q_pi3=mtk[0].P3;window.Q_pi4=mtk[0].P4;window.Q_pi5=mtk[0].P5;
									window.Q_pij1=mtk[0].J1;window.Q_pij2=mtk[0].J2;window.Q_pij3=mtk[0].J3;window.Q_pij4=mtk[0].J4;window.Q_pij5=mtk[0].J5;
									}
									//代理检测
									if(mtk[0].ERR == 'ERR01'){alert("上级商品ID错误，请联系商家ERR01");window.location.href="/";return false;}
									if(mtk[0].ERR == 'ERR02'){alert("上级商品ID错误，请联系商家ERR02");window.location.href="/";return false;}
									if(mtk[0].ERR == 'ERR03'){alert("3代理价格设置错误，请联系商家ERR03");window.location.href="/";return false;}
									if(mtk[0].ERR == 'ERR04'){alert("未找到代理关系，请联系商家ERR04");window.location.href="/";return false;}
									if(mtk[0].ERR == 'ERR05'){alert("未找到代理商品，请联系商家ERR05");window.location.href="/";return false;}
									if(mtk[0].ERR == 'ERR05'){alert("商品成本价格低于代理价，请联系商家ERR06");window.location.href="/";return false;}
									
									//显示库存
									if(mtk[0].XS=='0')
									{
										//批发
										if(Q_ispf=='1')
										{
										$('#c_kucunshow1').hide();$('#kucunshow2').show();
										if(parseInt(mtk[0].KU)>9998){$('#s_kucunshow2').html("库存大于"+mtk[0].KU+"张");}else{$('#s_kucunshow2').html("库存"+mtk[0].KU+"张");}
										
										var pifalist=' 单价优惠：<br>';
										if (parseInt(Q_pi1)>0){pifalist += "≥"+Q_pi1+"张"+parseFloat(Q_pij1).toFixed(2)+"元 "}
										if (parseInt(Q_pi2)>0){pifalist += "≥"+Q_pi2+"张"+parseFloat(Q_pij2).toFixed(2)+"元 "}
										if (parseInt(Q_pi3)>0){pifalist += "≥"+Q_pi3+"张"+parseFloat(Q_pij3).toFixed(2)+"元 "}
										if (parseInt(Q_pi4)>0){pifalist += "≥"+Q_pi4+"张"+parseFloat(Q_pij4).toFixed(2)+"元 "}
										if (parseInt(Q_pi5)>0){pifalist += "≥"+Q_pi5+"张"+parseFloat(Q_pij5).toFixed(2)+"元 "}
										$('#s_pifa').html(pifalist);
										}
										else
										{
										$('#c_kucunshow1').show();$('#kucunshow2').hide();	
										if(parseInt(mtk[0].KU)>9998){$('#s_kucunshow1').html("库存大于"+mtk[0].KU+"张");}else{$('#s_kucunshow1').html("库存"+mtk[0].KU+"张");}
										}
									}
									else	//隐藏库存
									{
										//批发
										if(Q_ispf=='1')
										{
										$('#c_kucunshow1').hide();$('#kucunshow2').show();
										if(mtk[0].KU=="0"){$('#s_kucunshow2').html('暂时无货');}
										if(parseInt(mtk[0].KU)>0 && parseInt(mtk[0].KU)<21){$('#s_kucunshow2').html('库存紧张');}
										if(parseInt(mtk[0].KU)>20 && parseInt(mtk[0].KU)<51){$('#s_kucunshow2').html('库存一般');}
										if(parseInt(mtk[0].KU)>50){$('#s_kucunshow2').html('库存充足');}
										
										var pifalist=' 单价优惠：<br>';
										if (parseInt(Q_pi1)>0){pifalist += "≥"+Q_pi1+"张"+parseFloat(Q_pij1).toFixed(2)+"元 "}
										if (parseInt(Q_pi2)>0){pifalist += "≥"+Q_pi2+"张"+parseFloat(Q_pij2).toFixed(2)+"元 "}
										if (parseInt(Q_pi3)>0){pifalist += "≥"+Q_pi3+"张"+parseFloat(Q_pij3).toFixed(2)+"元 "}
										if (parseInt(Q_pi4)>0){pifalist += "≥"+Q_pi4+"张"+parseFloat(Q_pij4).toFixed(2)+"元 "}
										if (parseInt(Q_pi5)>0){pifalist += "≥"+Q_pi5+"张"+parseFloat(Q_pij5).toFixed(2)+"元 "}
										$('#s_pifa').html(pifalist);
										}
										else
										{
										$('#c_kucunshow1').show();$('#kucunshow2').hide();	
										if(mtk[0].KU=="0"){$('#s_kucunshow1').html('暂时无货');}
										if(parseInt(mtk[0].KU)>0 && parseInt(mtk[0].KU)<21){$('#s_kucunshow1').html('库存紧张');}
										if(parseInt(mtk[0].KU)>20 && parseInt(mtk[0].KU)<51){$('#s_kucunshow1').html('库存一般');}
										if(parseInt(mtk[0].KU)>50){$('#s_kucunshow1').html('库存充足');}
										}
									}
								
									//支付接口
									var ayisbankpay=<%=ayisbankpay%>;
									var ayisalipay=<%=ayisalipay%>;
									var ayistenpay=<%=ayistenpay%>;
									var ayissaopay=<%=ayissaopay%>;
									var ayisqqpay=<%=ayisqqpay%>;
									var ayisjdpay=<%=ayisjdpay%>;
									var jiekoustr='<%=isjiekoustr%>';	
									userjk=jiekoustr.split("|");
									if(ayisbankpay==1 && mtk[0].ZB==1 && userjk[0]==1){$('#bankzhifu').show();}else{$('#bankzhifu').hide();} 	
									if(ayisalipay==1 && mtk[0].ZA==1 && userjk[1]==1){$('#alipayzhifu').show();}else{$('#alipayzhifu').hide();} 
									if(ayistenpay==1 && mtk[0].ZC==1 && userjk[2]==1){$('#tenpayzhifu').show();}else{$('#tenpayzhifu').hide();} 
									if(ayissaopay==1 && mtk[0].ZW==1 && userjk[3]==1){$('#saozhifu').show();}else{$('#saozhifu').hide();} 	
									if(ayisqqpay==1 && mtk[0].ZQ==1 && userjk[4]==1){$('#qqzhifu').show();}else{$('#qqzhifu').hide();}
									if(ayisjdpay==1 && mtk[0].ZJ==1 && userjk[5]==1){$('#jdzhifu').show();}else{$('#jdzhifu').hide();}
									
								return jisuan();
	
								},"json");	

								//详细说明
								$.post("/Template/newbuy2/chkgoodxx/",{act:"goodxx",gid:gid,uid:'<%=uid%>'},
								function(data,status){if(data != null && data != ''){$('#goodxx').show();$('#goodxxcon').html(data);}else{$('#goodxx').hide();}});	
								

						}


						//免责						
						$('#ismianze').on('click',function(){if($("#mianze").is(":hidden")==true){$('#mianze').show();$(document).scrollTop($(document).height()-$(window).height());}else{$('#mianze').hide();}});	
						//返回顶部	
						$('#totop').on('click',function(){$(document).scrollTop($(window).height()-$(document).height());});	
						//选择其他方式 取消点卡值
						//$($("input[name='pid']")).on('click',function(){if($(this).val()=='ALIPAY' || $(this).val()=='TENPAY' || $(this).val()=='WEIXIN' || $(this).val()=='QQPAY'){window.Q_diankayuohui='0';return jisuan();}});	

						
						//提交 alert(fenleiid);
						//function hot(){$('#hot').show();}
						 
						$('.hot-close').on('click',function(){$('#hot').hide();$('#loading').hide();$(".hot-dakai").attr("disabled",false);$(".hot-dakai").val('确认支付');$("#tcan1").attr("disabled",false);$("#tcan1").val('确认支付');clearInterval(timer);});
						$('.hot-dakai').on('click',function()
						{
							$(".hot-dakai").attr("disabled",true);
							
							var pid=$('input[name="pid"]:checked').val();
							jddh='';
							//提交检测
							if('<%=isbuylog%>' == '1' && '<%=isbuymailog%>'=='no'){$('#logclub').show();$('#bg123').show();return false;}
							if($('#isagree').is(":checked") == false){alert("请阅读并勾选合作协议");$(".hot-dakai").attr("disabled",false);return false;}
							//if($('#istelka').is(":checked") == false){alert("为方便提取卡密，请勾选短信接收卡密！");$(".hot-dakai").attr("disabled",false);return false;}
							if(Q_flid=="0"){alert("请选择商品分类");$(".hot-dakai").attr("disabled",false);return false}
							if(Q_spid=="0"){alert("请选择商品");$(".hot-dakai").attr("disabled",false);return false}
							if($('#contact').val()==""){alert("请填写联系方式，以便查询订单使用");$(".hot-dakai").attr("disabled",false);return false;}
							if($('#contact').val().length<6){alert("联系方式不能少于6位");$(".hot-dakai").attr("disabled",false);return false;}
							if($('#contact').val()=="123456" || $('#contact').val()=="000000" || $('#contact').val()=="0000000" || $('#contact').val()=="888888" || $('#contact').val()=="112233" || $('#contact').val()=="111111"){alert("联系方式过于简单，请重新填写");$(".hot-dakai").attr("disabled",false);return false;}
							//联系方式只能数字
							if(Q_buylx=='1'){if(/^[-]{0,1}[0-9]{1,}$/.test($('#contact').val())==false){alert("联系方式必须为数字");$(".hot-dakai").attr("disabled",false);return false;}}
							//联系方式只能字母
							if(Q_buylx=='2'){if(/^[A-Za-z]+$/.test($('#contact').val())==false){alert("联系方式必须为字母");$(".hot-dakai").attr("disabled",false);return false;}}
							//联系方式只能数字和字母
							if(Q_buylx=='3'){if(/^(?!\D+$)(?![^a-zA-Z]+$)/.test($('#contact').val())==false || /[\u4E00-\u9FA5]/i.test($('#contact').val())){alert("联系方式必须为数字和字母的非中文");$(".hot-dakai").attr("disabled",false);return false;}}
							//联系方式数字或字母 下划线
							if(Q_buylx=='4'){if( /^(?!\D+$)(?![^a-zA-Z]+$)/.test($('#contact').val())==false || /\_/.test($('#contact').val())==false){alert("联系方式为数字或字母和下划线");$(".hot-dakai").attr("disabled",false);return false;}}
							//联系方式必须为中文
							if(Q_buylx=='5'){if (/[\u4E00-\u9FA5]/i.test($('#contact').val())==false){alert("联系方式必须为中文");$(".hot-dakai").attr("disabled",false);return false;}}
							//联系方式必须为邮箱
							if(Q_buylx=='6'){if(/^[-_A-Za-z0-9]+@([_A-Za-z0-9]+\.)+[A-Za-z0-9]{2,3}$/.test($('#contact').val())==false){alert("联系方式需填写正确邮箱");$(".hot-dakai").attr("disabled",false);return false;}}
							//联系方式必须为手机
							if(Q_buylx=='7'){if (/^[1][3-9][0-9]{9}$/.test($('#contact').val())==false){alert("联系方式必须为正确手机号码");$(".hot-dakai").attr("disabled",false);return false;}}
							//手机接收卡密 联系方式为手机
							if($('#istelka').is(":checked") == true){if (/^[1][3-9][0-9]{9}$/.test($('#contact').val())==false){alert("勾选使用短信接收卡密,联系方式请填写手机号码");$(".hot-dakai").attr("disabled",false);return false;}}
							//取卡密码
							if($("#tikapass").is(":hidden")==false){if($('#tikapass').val()==''){alert("请设置一个取卡密码，在支付成功后使用密码取卡");$(".hot-dakai").attr("disabled",false);return false;}else{if(($('#tikapass').val().length<3)||($('#tikapass').val().length>10)){alert("取卡密码长度为3-10字符");$(".hot-dakai").attr("disabled",false);return false;}}}
							//库存
							if(parseInt($("#quantity").val())>parseInt(Q_kucun)){alert("库存不足，请联系商户加卡,或尝试少量购买");$(".hot-dakai").attr("disabled",false);return false;}
							//限购
							if(Q_xiangou!='0'){if(parseInt($("#quantity").val())<parseInt(Q_xiangou)){alert("商品设置了限购数量,购买数量不能少于"+Q_xiangou+"张");$(".hot-dakai").attr("disabled",false);return false;}}
							//购卡密码 显示 false  隐藏 true
							if($("#buypass").is(":hidden")==false){if($('#buypass').val()==''){alert("商家对商品设置了购卡验证密码，请填写购卡密码");$(".hot-dakai").attr("disabled",false);return false;}}
							//支付方式
							if(pid == null){alert("请选择一种支付方式");$(".hot-dakai").attr("disabled",false);return false;}
							//开启loading
							$(".hot-dakai").val('提交中');
							$('#loading').show();
														
							var tiaoshi='<%=istiaoshi%>';
							if(tiaoshi=='yes')
							{
							bdlist=''
							bdlist += '<form action=/Template/newbuy2/pay/ name=formtj id=formtj method=post target=_blank>'; 
							bdlist += '<input name=feilei type=hidden value="'+ Q_flid +'" />';   
							bdlist += '<input name=shangid type=hidden value="'+ Q_spid +'" />'; 
							bdlist += '<input name=gooduserid type=hidden value="'+ <%=uid%>+'" />'; 
							bdlist += '<input name=pid type=hidden value="'+ pid +'" />'; 
							bdlist += '<input name=quantity type=hidden value="'+ $("#quantity").val() +'" />'; 
							bdlist += '<input name=danjia type=hidden value="'+ Q_danjia +'" />'; 
							bdlist += '<input name=goodyj type=hidden value="'+ Q_yuandanjia +'" />'; 
							bdlist += '<input name=goodzongjia type=hidden value="'+ Q_yingfu +'" />'; 
							bdlist += '<input name=contact type=hidden value="'+ escape($("#contact").val())+'" />';
							bdlist += '<input name=aybankpay type=hidden value="'+ $("#aybankpay").val()+'" />';
							bdlist += '<input name=tikapass type=hidden value="'+ $("#tikapass").val()+'" />';
							bdlist += '<input name=act type=hidden value=buy />';
							bdlist += '</form>';
							//alert(bdlist);return false;
							$('#bdlist').html(bdlist);
							$('#formtj').submit();return false;
							}
							
							
							//提交支付 alert($("#buypass").val());
							$.post('/Template/newbuy2/pay/',
							{
								tikapass:$('#tikapass').val(),
								feilei:Q_flid,
								shangid:Q_spid,
								gooduserid:'<%=uid%>',
								pid:pid,
								quantity:$("#quantity").val(),
								danjia:Q_danjia,
								goodyj:Q_yuandanjia,
								goodzongjia:Q_yingfu,
								shanghuqq:Q_shanghuqq,
								contact:escape($("#contact").val()),
								buypass:escape($("#buypass").val()),
								istelka:$('#istelka').is(":checked"),
								isxinyongka:$('#isxinyongka').is(":checked"),
								isyouhui:$('#isyouhui').is(":checked"),
								youhuiquan:$("#youhuiquan").val(),
								youhuiquanzhi:Q_youhuiquanzhi,
								aybankpay:$("#aybankpay").val(),
								act:'buy'
							
							},function(re)
							{
							//错误提示	
							//alert(unescape(re.xxx));return false;
							
							if(re.err != null && re.err!=''){$('#loading').hide();alert(re.err);$(".hot-dakai").attr("disabled",false);$(".hot-dakai").val('确认支付');return false;}
							
                            //开启支付框
							$('#hot').show();
							
							//订单信息 
							$('#t_name').html(Q_spname); //$('#t_name').html($('#goodlist option:selected').text());
							$('#t_lx').html($("#contact").val());
							$('#t_sum').html($("#quantity").val());
							$('#t_yf').html(Q_yingfu);
							$('#t_ddh').html(re.ddh);

							//支付图标
							//if(Q_diankayuohui!='0')
							//{
							//$('#t_pic').html("<img src=<%'=weburl%>Template/newbuy2/images/card/"+$("#cardlu").val()+"/"+pid+".gif>");
							//}
							if(pid=='ALIPAY' || pid=='TENPAY' || pid=='WEIXIN' || pid=='QQPAY' || pid=='JDPAY')
							{
							$('#t_pic').html("<img src=<%=ossurl%>Template/newbuy2/images/"+pid+".gif>");
							}
							else
							{
							$('#t_pic').html("<img src=<%=ossurl%>Template/newbuy2/images/bank/"+pid+".gif>");
							}
							
							//表单支付
							if(re.fs=='biaodan')
							{
								$('#tcan1').show();				//按钮设置
								$('#saofs').hide();	
								$('#bdlist').html(re.bdlist);	//配置表单
							}	
							
							//重置订单号
							jddh=re.ddh;

							//二维码支付
							if(re.fs=='erweima')
							{
								$('#qrcodeurl').html('');		//初始二维码
								if(pid=='ALIPAY'){$('#payname').html('支付宝');}	//初始二维码支付名称
								if(pid=='WEIXIN'){$('#payname').html('微信');}
								if(pid=='QQPAY'){$('#payname').html('QQ');}
								if(pid=='JDPAY'){$('#payname').html('京东');}
								$('#tcan1').hide();				//按钮设置
								$('#saofs').show();	
								showerwema(re.code);	
							}	
							
							//获取结果
							var handler = function(){$.post("/pay/?id="+jddh,null,function(msg){if(msg == 'ok'){document.location.href="/tika?ka="+jddh;clearInterval(timer);}});};timer = setInterval(handler , 2000); 

							
							//按钮 查看结果
							$('#tcan2').on('click',function(){window.open('<%=weburl%>chaxun?ka='+jddh);evt.stopPropagation();});
							
							//按钮 提交表单
							$('#tcan1').on('click',function(){$('#formtj').submit();$("#tcan1").attr("disabled",true);$("#tcan1").val('正在付款');evt.stopPropagation();});
							
							//关闭loading
							$('#loading').hide();
							
							},"json");

						});

                },"json");
				
       })
			

			
//JS HTMLEncode
function HTMLEncode(input){var converter = document.createElement("DIV");converter.innerText = input;var output = converter.innerHTML;converter = null;return output;} 

//数字检测
function CheckIfid( String )
{ 
	var Letters = "1234567890";
	var i;
	var c;
	if(String.charAt( 0 )=='-')
	return false;
	if( String.charAt( String.length - 1 ) == '-' )
	return false;
	for( i = 0; i < String.length; i ++ )
	{
	c = String.charAt( i );
	if (Letters.indexOf( c ) < 0)
	return false;
	}
	return true;
}
			
//使用优惠券 触发
function is_youhui()
{
window.Q_youhuiquanzhi = '0';	
$("#youhuiquan").val('');	
$('#checkcoupon').hide();
if($('#isyouhui').is(":checked") == true){$('#youhuiquancon').show();}else{$('#youhuiquancon').hide();}
return jisuan();
}

//检测优惠券是否可用
function ckyouhuiquan()
{
window.Q_youhuiquanzhi = '0';
$('#checkcoupon').show();
$('#checkcoupon').html("<img src=<%=ossurl%>Template/Template4/images/load.gif> 正在查询..");	

	if($("#youhuiquan").val()=='')
	{
	$('#isyouhui').prop('checked',false); 
	$('#checkcoupon').html("请填写优惠券!");
	}
	else
	{
		$.post("/Template/newbuy2/chkyouhui/",{act:"ckyhq",id:$("#youhuiquan").val(),fenleiid:Q_flid,shangid:Q_spid,userid:'<%=uid%>'},

		function(data,status)
		{
				if (data=="no")
				{ 
				$('#isyouhui').prop('checked',false);$("#youhuiquan").val('');$('#checkcoupon').html("<font color=red>获取参数错误</font>");return jisuan();return false;
				}
		    	else if(data=="1111")
				{
				$('#isyouhui').prop('checked',false);$("#youhuiquan").val('');	$('#checkcoupon').html("<font color=red>未找到优惠券信息</font>");return jisuan();return false;
		    	}
				else if(data=="0000")
		    	{
				$('#isyouhui').prop('checked',false);$("#youhuiquan").val('');$('#checkcoupon').html("<font color=red>优惠券已过期或已无效</font>");return jisuan();return false;	
		   		}
				else if (data=="2222")
		   	 	{
				$('#isyouhui').prop('checked',false);$("#youhuiquan").val('');	$('#checkcoupon').html("<font color=red>此优惠券不允许在此商品分类下使用</font>");return jisuan();return false;	
		    	}
				else if (data=="3333")
				{
				$('#isyouhui').prop('checked',false);$("#youhuiquan").val('');	$('#checkcoupon').html("<font color=red>此优惠券不允许在此商品下使用</font>");return jisuan();return false;	
		    	}
		    	else
			    {
				$('#isyouhui').prop('checked',true)
				window.Q_youhuiquanzhi = data;
				$('#checkcoupon').html("优惠"+data+"元 (充值卡支付暂不支持使用优惠券)");
				return jisuan();
				}
		});	

	}
}  


//购买数量检测
function upperCase(zhi)
{
	if(Q_danjia == null || Q_danjia == ''){Q_danjia=0}
		
	if(zhi != null || zhi != '')
	{
		if(!CheckIfid(zhi))
		{
			$("#quantity").val('1');
			$('#jiage').html(parseFloat(Q_danjia).toFixed(2)+'元');
			alert('请正确填写购买数量！');
			return jisuan();
			return false;
		}
		if(zhi=='0')
			{
			$("#quantity").val('1');
			$('#jiage').html(parseFloat(Q_danjia).toFixed(2)+'元');
			alert('请正确填写购买数量！');
			return jisuan();
			return false;
		}
		

		if(zhi<=0 || zhi>9999)
		{
		$("#quantity").val('1');
		$('#jiage').html(parseFloat(Q_danjia).toFixed(2)+'元');
		alert('购买数量范围有误！！');
		return jisuan();
		return false;
		}
		
		return jisuan();
	}
	else
	{
	Q_danjia=0
	}
}
						
						
//价格计算	alert();	
function jisuan()
{

	var v_quantity = $("#quantity").val();
	
		//批发
		if(Q_ispf=='1')
		{
			if(Q_pi5 == '' || Q_pi5 == '0'){Q_pi5='9999'};if(Q_pi4 == '' || Q_pi4 == '0'){Q_pi4='9998'};if(Q_pi3 == '' || Q_pi3 == '0'){Q_pi3='9997'};if(Q_pi2 == '' || Q_pi2 == '0'){Q_pi2='9996'};	if(Q_pi1 == '' || Q_pi1 == '0'){Q_pi1='9995'}
			window.Q_danjia=Q_yuandanjia;$('#jiage').html(parseFloat(Q_yuandanjia).toFixed(2)+'元'); //初始原单价
			if(parseInt(v_quantity)>=parseInt(Q_pi1) && parseInt(v_quantity)<parseInt(Q_pi2)){window.Q_danjia=Q_pij1;$('#jiage').html(parseFloat(Q_pij1).toFixed(2)+'元');}
			if(parseInt(v_quantity)>=parseInt(Q_pi2) && parseInt(v_quantity)<parseInt(Q_pi3)){window.Q_danjia=Q_pij2;$('#jiage').html(parseFloat(Q_pij2).toFixed(2)+'元');}
			if(parseInt(v_quantity)>=parseInt(Q_pi3) && parseInt(v_quantity)<parseInt(Q_pi4)){window.Q_danjia=Q_pij3;$('#jiage').html(parseFloat(Q_pij3).toFixed(2)+'元');}
			if(parseInt(v_quantity)>=parseInt(Q_pi4) && parseInt(v_quantity)<parseInt(Q_pi5)){window.Q_danjia=Q_pij4;$('#jiage').html(parseFloat(Q_pij4).toFixed(2)+'元');}
			if(parseInt(v_quantity)>=parseInt(Q_pi5)){window.Q_danjia=Q_pij5;$('#jiage').html(parseFloat(Q_pij5).toFixed(2)+'元');}
		}
		
		

		var v_yingfu=v_quantity*Q_danjia;

	
			//'优惠券
			if(Q_youhuiquanzhi!='')
			{    
			var v_yingfu=v_yingfu-Q_youhuiquanzhi;
			}
		
		
	//手机短信接收卡密
	if($('#istelka').is(":checked") == true){v_yingfu=v_yingfu+0.1;}
	
	//if(v_yingfu<0){v_yingfu=0;}
	
	window.Q_yingfu=parseFloat(v_yingfu).toFixed(2);
	$('#yingfu').html(parseFloat(v_yingfu).toFixed(2));	
	//alert(v_danjia);
}
</script>




<!-- 页头 开始 -->
<div class="top_bg">
  <div class="top_in">
    <div class="logo"><a href="/"><img src="<%=ossurl%>Template/newbuy2/images/logo.jpg" alt="爱卡" width="164" height="58" /></a></div>
    <div class="top_anniu">
      <%if request.Cookies("aynameid")<>"" then%>	
      <div class="chakanbuyuser">已登录账号：<a href="/u/index"><%=request.Cookies("aytrueuser")%></a>  <a href="/index/exit">[退出]</a></div>
      <%end if%>
      <div class="chakan"><a href="/chaxun" target="_blank">订单查询</a></div>
      <div class="chakan"><a href="/tousu">订单投诉</a></div>
      <%if request.Cookies("aynameid")="" then%>	
      <div class="chakan" id="openlog" style="cursor:pointer">买家登录</div>
      <%end if%>
    </div>
  </div>
</div>
<!-- 页头 结束 -->



<!-- 上部分 开始 -->
<div class="shangjia_wai">

      <div class="shangjia_out">
            <div class="shangjia_t_bg">商家信息</div>
            <div class="shagnjia_kuang">
                  <div class="shangjia_nei">
                  
                        <div class="shangjiamc">
                          <div class="gonggao">商家名称：</div>
                          <div class="gonggao_de"><%=aywebname%> <a style="color:#F00" href="/index/weiguijubao?id=<%=thispcurl%>">【违法举报】</a></div>
                        </div>
                        
                        <div class="shangjiaqq">
                          <div class="gonggao">商家ＱＱ：</div>
                          <div class="gonggao_de">
                            <div class="showq1"><span id="sqq"><%=shanghuqq%></span></div>
                            <div class="showq2"><span id="sqq2"><a href="tencent://message/?uin=<%=shanghuqq%>&Site=<%=shanghuqq%>&Menu=yes" title="<%=shanghuqq%>"><img src="<%=ossurl%>images/kf_qq.gif" alt="点击咨询" align="absmiddle"></a></span></div>
                            <%if ayweixinid<>"" then%>
                          	&nbsp;&nbsp;&nbsp;&nbsp;商家微信号：<%=ayweixinid%>
                            <%end if%>
                            <%if showweixinerweima<>"" then%>
                            &nbsp;&nbsp;<a onMouseOver="weixinid.style.display='';" onMouseOut="weixinid.style.display='none';"  style="cursor:pointer;color:#39F">[扫一扫 添加微信好友]</a>
                            <%end if%>
                          </div>
                        </div>
                        
                        <div class="shangjiamc">
                          <div class="gonggao">商家网站：</div>
                          <div class="gonggao_de"><span id="surl"><a href="<%=ayweburl%>" target="_blank"><%=ayweburl%></a></span></div>
                        </div>
                        
                        <div class="shangjiagg">
                          <div class="gonggao">商家公告：</div>
                          <div style="width:640px;height:60px; overflow:auto;">
						  <%
						  if trim(ayusermiaoshu)<>"" then response.Write server.HTMLEncode(trim(ayusermiaoshu))
						  %></div>
                        </div>
                        
                        <div class="clearit"></div>
                        
                        <!--
                        <div class="shangjiamc">
                          <div class="gonggao">发货类型：</div>
                          <div class="gonggao_de"> <img src="<%'=ossurl%>Template/newbuy2/images/fahuo_icon.jpg" width="22" height="16" /> 自动发货<span class="font_12">（订单支付成功后，即可在网页上获得卡密，也可通过<a href="#" class="green">【订单查询】</a>获取卡密信息）</span></div>
                        </div>
                    	-->
                        
                  </div>
            </div>
        
            
            <div class="xuanze_t_bg">
            <div class="shangjia_wenzi">选择商品</div>
                 <%if iswap="yes" and cint(iswappay)=1 then%> 		
                 <div class="saoma">
                     <div class="saoma_icon">
                         <img src="<%=ossurl%>Template/newbuy2/images/saoma_icon.gif" width="28" height="28" />
                         <div class="xsewm" style="position:absolute;"><div id="qrcode"></div></div>
                       <script type="text/javascript">var qrcode = new QRCode(document.getElementById("qrcode"), {width:140,height:140});qrcode.makeCode("<%=wapurl%>");</script>
                     </div>
                     <div class="saoma_word">扫一扫  手机支付</div>
                 </div>
                 <%end if%>
            </div>
        
            <div class="clearit"></div>
        
            <div class="xzspbox">
       
                    <div class="xzsrk">
                    <font color="#cf0000">*</font> 商品分类：
                    <span id="flname"><select name="feilei" class="xzspxzk" id="fenleilist"><option value="0">-=请选择商品分类=-</option></select></span>
                    &nbsp;<div class="shuoming" id="flshuoming"></div>
                    </div>
            		<div class="clearit"></div>
                    
                    <div class="xzsrk">
                    <font color="#cf0000">*</font> 商品名称：
                    <span id="spname"><select name="shangpin" class="xzspxzk" id="goodlist"><option value="0">-=请选择商品=-</option></select> </span>
                    &nbsp;<div class="shuoming" id="spshuoming" ></div> 
                    </div>
            		<div class="clearit"></div>
                    
                    <div class="xzsrk"><font color="#cf0000">*</font> 商品价格：&nbsp;<span style="color:#cf0000" id="jiage">0.00元</span></div>
            		<div class="clearit"></div>
                    
                    <div class="xzsrk">
                    <font color="#cf0000">*</font> 购买数量： 
                    <input name="quantity" type="text"  class="xzspsrk1" id="quantity" value="1" onKeyUp="upperCase(this.value)" />
                      <div class="xzspbz1" id="c_kucunshow1"><span id="s_kucunshow1"></span> <span id="s_xiangou"></span></div>
                      <div class="xzspbzpf" id="kucunshow2" style="display:none"><span id="s_kucunshow2"></span>   <span id="s_pifa"></span></div>
                    </div>
            		<div class="clearit"></div>
                    
                    <div class="xzsrk">
                    <font color="#cf0000">*</font> 联系方式：
                    <input name="contact" type="text"  class="xzspsrk1" id="contact" value="<%if trim(maitel)<>"" then response.Write maitel%>" /> <!--  onBlur="return checklx(this.value);" -->
                      <div class="xzspbz1"><span id="lxfs">请填写联系方式</span> <font color="#CC3300">订单查询重要凭证</font></div>
              		</div>
            		<div class="clearit"></div> 
                    
                    <div class="xzsrk" id="istikapass" style="display:none">
                    <font color="#cf0000">*</font> 提卡密码：
                    <input type="text" name="tikapass" id="tikapass" class="xzspsrk1" />
                        <div class="xzspbz1">设置一个提卡密码，用于提取卡密，不要与联系方式相同</div>
                    </div>
            		<div class="clearit"></div>
                    
                    <div class="xzsrk" id="isbuypass" style="display:none" >
                    <font color="#cf0000">*</font> 购卡密码：
                    <input type="text" name="buypass" id="buypass" class="xzspsrk1" />
                        <div class="xzspbz1">商家对商品设置了一个购卡密码，只有输入正确才可以购买</div>
                    </div>
                	<div class="clearit"></div>
            
                    <!--
                    <div class="xzsrk">
                    <font color="#fff">*</font> 接收邮箱：
                    <input name="email" type="text"  class="xzspsrk1" id="email" onBlur="return checkmail();"/>
                        <div class="xzspbz1">支付成功后,将卡密发送到我的邮箱,如不需要请留空</div>
              		</div>
           			<div class="clearit"></div>
            		-->
            
            
                    <div class="xzsrk2" id="isyouhuis" style="display:none">
                    <input name="isyouhui" id="isyouhui" type="checkbox" onClick="is_youhui()"/>&nbsp;&nbsp;<label for="isyouhui" onClick="is_youhui()" style="cursor:pointer">使用优惠券。</label>
                    <span id="youhuiquancon" style="display:none">请输入优惠券：<input type="text" name="youhuiquan"  id="youhuiquan" class="input" style="width:140px;" onBlur="ckyouhuiquan()"></span>
                    <span id="checkcoupon" style="display:none"><img src="<%=ossurl%>Template/Template4/images/load.gif"> 正在查询...</span>	
                    </div>
            		<div class="clearit"></div>
                    
                    <div class="xzsrk2">
                    <input name="istelka" type="checkbox" id="istelka" value="yes" onClick="jisuan()" />&nbsp;&nbsp;<label for="istelka" onClick="jisuan()" style="cursor:pointer">短信接收卡密(0.1元，联系方式请填写手机号)。</label>
                    </div>
            		<div class="clearit"></div>
                    
                    <div class="xzsrk">
                    <%if isgzhtika="yes" then%>
                    <span style="font-size:13px;color:#06C;">&nbsp;&nbsp;&nbsp;【<span id="hqopenid"><a id="huoquopenid" style="color:#06C;cursor:pointer">还可以使用微信接收卡密</a></span>】</span>
                    <%end if%>
              		</div>
           			<div class="clearit"></div>
                    
                    <div style="height:12px"></div>
                    <div class="yfje">应付金额：<span id="yingfu" style="color:#cf0000">0.00</span>元 RMB</div>
                    <div class="clearit"></div>

        </div>
      </div>
  
  

  
  	  <!-- 商家信誉  -->
      <div class="fangxin_out">
            <div class="fangxin_biankuang">
            
                  <div class="goumai"><img src="<%=ossurl%>Template/newbuy2/images/goumai.jpg" width="200" /></div>
              
                  <div class="mjxybox center">
                          <div class="sjxybt"><img style="padding-bottom:2px;" src="<%=ossurl%>Template/newbuy2/images/zhengque.jpg" width="17"/> 商家信誉</div>
                      
                          <div class="xyzs">
							<%
							if ccur(aychengjiao)=0 then 
							response.Write("未成交过")
							else
							if ccur(aychengjiao)>0 and ccur(aychengjiao)<11 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/11.gif title='成交1-10笔' align='absmiddle'>"
							if ccur(aychengjiao)>10 and ccur(aychengjiao)<41 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/12.gif title='成交11-40笔' align='absmiddle'>"
							if ccur(aychengjiao)>40 and ccur(aychengjiao)<91 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/13.gif title='成交41-90笔' align='absmiddle'>"
							if ccur(aychengjiao)>90 and ccur(aychengjiao)<151 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/14.gif title='成交91-150笔' align='absmiddle'>"
							if ccur(aychengjiao)>150 and ccur(aychengjiao)<251 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/15.gif title='成交151-250笔' align='absmiddle'>"
							if ccur(aychengjiao)>250 and ccur(aychengjiao)<501 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/21.gif title='成交251-500笔' align='absmiddle'>"
							if ccur(aychengjiao)>500 and ccur(aychengjiao)<1001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/22.gif title='成交501-1000笔' align='absmiddle'>"
							if ccur(aychengjiao)>1000 and ccur(aychengjiao)<2001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/23.gif title='成交1001-2000笔' align='absmiddle'>"
							if ccur(aychengjiao)>2000 and ccur(aychengjiao)<5001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/24.gif title='成交2001-5000笔' align='absmiddle'>"
							if ccur(aychengjiao)>5000 and ccur(aychengjiao)<10001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/25.gif title='成交5001-10000笔' align='absmiddle'>"
							if ccur(aychengjiao)>10000 and ccur(aychengjiao)<20001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/31.gif title='成交10001-20000笔' align='absmiddle'>"

							if ccur(aychengjiao)>20000 and ccur(aychengjiao)<50001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/32.gif title='成交20001-50000笔' align='absmiddle'>"
							if ccur(aychengjiao)>50000 and ccur(aychengjiao)<100001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/33.gif title='成交50001-100000笔' align='absmiddle'>"
							if ccur(aychengjiao)>100000 and ccur(aychengjiao)<200001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/34.gif title='成交100001-200000笔' align='absmiddle'>"
							if ccur(aychengjiao)>200000 and ccur(aychengjiao)<500001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/35.gif title='成交200001-500000笔' align='absmiddle'>"
							if ccur(aychengjiao)>500000 and ccur(aychengjiao)<1000001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/41.gif title='成交500001-1000000笔' align='absmiddle'>"
							if ccur(aychengjiao)>1000000 and ccur(aychengjiao)<2000001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/42.gif title='成交1000001-2000000笔' align='absmiddle'>"
							if ccur(aychengjiao)>2000000 and ccur(aychengjiao)<5000001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/43.gif title='成交2000001-5000000笔' align='absmiddle'>"
							if ccur(aychengjiao)>5000000 and ccur(aychengjiao)<10000001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/44.gif title='成交5000001-10000000笔' align='absmiddle'>"
							if ccur(aychengjiao)>10000000 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/45.gif title='成交10000000笔以上' align='absmiddle'>"
							end if%>
                          <span class="showxinyu">(活跃<%=DateDiff("d",aydata,now())%>天)</span>
                          </div>
                                                   
                          <div class="sjxybt"><img style="padding-bottom:2px;" src="<%=ossurl%>Template/newbuy2/images/zhengque.jpg" width="17"/> VIP商家</div>
                          <div class="textindent15"> 
							<%if cint(ayisxiaobao)=0 then %>
                            <img src="<%=ossurl%>images/renzheng/vip1_2.jpg" width="27" height="20" />
                            <span class="showxinyu">非平台VIP商家！</span>
                            <%elseif cint(ayisxiaobao)=1 then%>
							<img src="<%=ossurl%>images/renzheng/vip1.jpg" width="27" height="20" />
                            <span class="showxinyu">平台VIP商家！</span>
                            <%end if%> 
                          </div>
                         
                          <div class="sjxybt"><img style="padding-bottom:2px;" src="<%=ossurl%>Template/newbuy2/images/zhengque.jpg" width="17"/> 商家认证</div>
                          <div class="textindent15"> 
                          <!--
							<%'if cint(ismailrz)=1 then%>
                            <img src="<%'=ossurl%>images/renzheng/rzmail.jpg" alt="已认证" width="25" title="邮箱已认证"/>
                            <%'else%>
                            <img src="<%'=ossurl%>images/renzheng/rzmailh.jpg" alt="未认证" width="25" title="邮箱未认证"/>
                            <%'end if%>
                           -->
                            <%if cint(istelrz)=1 then%>
                            <img src="<%=ossurl%>images/renzheng/rztel.jpg" alt="已认证" width="23" title="电话已认证"/>
                            <%else%>
                            <img src="<%=ossurl%>images/renzheng/rztelh.jpg" alt="未认证" width="23" title="电话未认证"/>
                            <%end if%>
                            <%if cint(ischengxin)=1 then%>
                            <img src="<%=ossurl%>images/kexin.gif" alt="可信商家" height="25" title="可信商家 订单交易累计超过30笔 不含虚假/无效卡密 未收到投诉或举报"/>
                            <%else%>
                            <img src="<%=ossurl%>images/kexin2.gif" alt="非可信商家" height="25" title="暂未达到可信商家标准 再接再厉！"/>
                            <%end if%>
                          </div>
                          
                          <div style="height:12px"></div>
                  </div>
        	</div>
    		<!-- 商家信誉  -->
    
            <div class="mzsm">
                  <div class="mzsmbt">免责声明</div>
                  <p>    
                  在购买前务必先联系商家，确认商品可以正常使用，或了解如何使用！商家联系QQ：
                  <span id="sqq3" style="color:#36C"><a href=tencent://message/?uin=<%=shanghuqq%>&Site=<%=shanghuqq%>&Menu=yes title=<%=shanghuqq%>><%=shanghuqq%></a></span>
                  </p>
                  <div style="height:5px"></div>
                  <p> 
                  订单支付成功后，直接提取卡密<a style="color:#F30" href="<%=weburl%>chaxun" target="_blank"><%=weburl%>chaxun</a> 提卡后的商品有使用问题，请联系商家！
                  </p>
                  <div style="height:5px"></div>
                  <p>  
                  如果您在支付过程中遇到虚假商品或取卡问题，请点击联系我们平台客服 QQ：<a href="tencent://message/?uin=<%=fuwuqq%>&Site=<%=fuwuqq%>&Menu=yes" title="联系平台客服"><%=fuwuqq%></a>
                  </p>
                  <div style="height:11px"></div>
                  <p>
                  <span style="color:#F60">请注意：</span>
                  </p>
                  <p>
                  <span style="color:#F60">订单投诉时效为24小时，付款后出现任何问题请在24小时内进行投诉，超过24小时的订单将不再受理投诉问题！</span><br>
                  </p>
            </div>
  	  </div>

</div>
<div class="clearit"></div>
<!-- 上部分 结束 -->



<!--详细说明 详细说明-->
<div class="xxsmbox center" id="goodxx" style="display:none">
    <div class="xxsmbt">详细说明</div>
    <div class="xxsm center">
    <span id="goodxxcon"></span>
    </div>
</div>
<div class="clearit"></div>





<!-- 付款方式 开始 -->
<div class="xxsmbox center"> 
	<div class="xxsmbt">付款方式</div>
    <div class="cyfkfs center">
        <ul>
            <li id="alipayzhifu"><input name="pid" type="radio" id="ALIPAY" value="ALIPAY" /><label for="ALIPAY"><img src="<%=ossurl%>Template/newbuy2/images/ALIPAY.gif" align="middle" width="145" height="46" /></label></li>
            <li id="saozhifu"><input name="pid" type="radio" id="WEIXIN" value="WEIXIN" /><label for="WEIXIN"><img src="<%=ossurl%>Template/newbuy2/images/<%=wxbiao%>" width="145" height="46" /></label></li>
            <li id="tenpayzhifu"><input name="pid" type="radio" id="TENPAY" value="TENPAY" /><label for="TENPAY"><img src="<%=ossurl%>Template/newbuy2/images/TENPAY.gif" width="145" height="46" /></label></li>
            <li id="qqzhifu"><input name="pid" type="radio" id="QQPAY" value="QQPAY" /><label for="QQPAY"><img src="<%=ossurl%>Template/newbuy2/images/QQPAY.gif" width="145" height="46" /></label></li>
            <li id="jdzhifu"><input name="pid" type="radio" id="JDPAY" value="JDPAY" /><label for="JDPAY"><img src="<%=ossurl%>Template/newbuy2/images/JDPAY.gif" width="145" height="46" /></label></li>
			<div id="bankzhifu">
			<%if cint(aybankpay)=1 then '支付宝网银 
			call alipaybank()
			elseif cint(aybankpay)=2 then '财付通网银 
			call tenpaybank()
			elseif cint(aybankpay)=3 then '易宝网银 
			call yeepaybank()
			elseif cint(aybankpay)=4 then '盛付通网银 
			call sftbank()
			elseif cint(aybankpay)=5 then '国付宝网银 
			call gfbbank()
			elseif cint(aybankpay)=6 then '聚合网银 
			call juhebank()
			end if%>
            <!--
            <div class="xinyongka"><input type="checkbox" name="isxinyongka" id="isxinyongka" value="1"> <label style="cursor:pointer" for="isxinyongka">信用卡支付</label></div>
         	-->
       		</div>
        </ul>
    </div>
	<div class="clearit"></div>
</div>
<div class="clearit"></div>
<!-- 付款方式 结束   -->


<!--免责声明--> 
<div class="xxsmbox center" id="mianze" style="display:none">
    <div class="mzsm1 center">
    <font style=" color:#FF9933; font-size:16px"><%=webname%>免责声明：<br></font>
    一、本平台服务范围仅限为商家提供商品寄售、为买家提供多途径在线支付和自动发卡的便捷服务，该项服务适用于您对售卡商家及商品有充分了解和信任的小额交易。<br>
    二、本平台支付服务交易方式为非担保性质的交易，有关商品售后服务相关问题均属于商家服务范畴，与本平台无关。<br>
    三、使用本平台系统购买商品之前，请确认商品数量及金额，如果支付过程中出现余额不足，请通过查询订单号补足余额之后即可获取卡密。<br>
    四、如果您选择使用充值卡类支付，面额超出的部分无法退还及找零；同时请您确认所选择的充卡面额与充值卡实际面额相符，否则造成充值卡报废损失由您自行承担。<br>
    五、如果出现商品交易纠纷、商品使用及售后服务等相关问题，请与售卡商家自行协商处理，<%=webname%>不负责支付过程以外的任何后续问题。<br>
    六、一旦您确认付款购买商家寄售在本平台的商品，即表示您认同<%=webname%>《免责声明》。<br>
    <!--
    <input name="jc_dianka" type="text" id="jc_dianka" size="160"/>
    -->
    </div>
</div>
<div class="clearit"></div>


<div class="dyxy center">  
<input name="aybankpay" type="hidden" id="aybankpay" value="<%=aybankpay%>"/>
<input name="cardlu" type="hidden" id="cardlu" value="<%=imglu%>"/>
<input name="isagree" id="isagree" type="checkbox" checked="checked" />
同意接受 <a class="ismianze" id="ismianze"><%=jname%>寄售平台《免责声明》</a>
</div>

<input class="hot-dakai qrzfan" type="button" value=" 确认支付 " />

<span id="bdlist" style="display:none"></span>

<!--弹窗开始-->
<div id="hot" style="display: none;">

			<div class="hot-in wow bounceIn">
            
                    <div class="tcbt">订单信息</div>
                    <span class="hot-close"></span>
                    
                    <div class="tcnrbox center">
                        <div class="tcnr">
                        订单编号：<span class="ddhtext" id="t_ddh"></span><br>
                        联系方式：<span class="lxtext" id="t_lx"></span><span class="tstext"> 【提取卡密重要凭证】</span><br>
                        商品名称：<span id="t_name"></span><br>
                        购买数量：<span id="t_sum"></span>张<br>
                        支付金额：<span id="t_yf"></span>元<br>
                      	<p>支付方式：<span id="t_pic"></span></p>
                        <table border="0" align="center" id="saofs" style="display:none">
                          <tr><td height="30" align="center"><span class="tstext">【使用<span id="payname"></span>扫描二维码，进行支付】</span></td></tr>
                          <tr><td align="center"><span id="qrcodeurl"></span></td></tr>
                        </table>
                    </div>
                    
                        <div class="tcmzsm">
                           		<div class="tcmzsmbt">免责声明</div>
                                <div class="tcmzsmnr">
                                    <font color="#399eb4"> &bull;</font> 我们仅提供自动发卡服务，售后问题请及时联系卖家<br>
                                    <font color="#399eb4"> &bull;</font> 如产生交易纠纷请联系卖家处理，也可以联系客服介入<br>
                                    <font color="#399eb4"> &bull;</font> 如果您遇到虚假商品或取卡问题，请尽快联系网站客服
                                </div>
                        </div>
                     
                        <div class="zhong">
                        <input type="button" class="tcan1" id="tcan1" value=" 确认支付 " style="cursor:pointer;" />
                        <input type="button" class="tcan2" id="tcan2" value=" 查看结果 " style="cursor:pointer" />
                        <br><br><%'=ReplaceTrim(tanchuang)%>
                        </div>
                        
                   </div>	
                        
            </div>
            
</div>
<!--弹窗结束--> 

<script>
//生成二维码
function showerwema(url)
{
var qrcode = new QRCode(document.getElementById("qrcodeurl"),{width:145,height:145});
qrcode.makeCode(url);
}
</script> 


<%if iswxkfon="yes" then%>
<a href="https://open.weixin.qq.com/connect/qrconnect?appid=<%=wxkfappid%>&redirect_uri=<%=wxkfre%>&response_type=code&scope=snsapi_login&state=<%=thispcurl%>#wechat_redirect" target="_blank"><div class="wxdl"></div></a>
<%end if%>

<%if isqqkfon="yes" then%>
<a href="https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=<%=qqkfappid%>&redirect_uri=<%=qqkfre%>&state=<%=thispcurl%>" target="_blank"><div class="qqdl"></div></a>
<%end if%>

<div class="fanhui"><a id="totop" class="totop"></a></div>

<div style="text-align:center">
<script>
//var _hmt = _hmt || [];
//(function() {
//  var hm = document.createElement("script");
//  hm.src = "https://hm.baidu.com/hm.js?";
//  var s = document.getElementsByTagName("script")[0]; 
//  s.parentNode.insertBefore(hm, s);
//})();
</script>


</div>

</body>
</html>
