<!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={$charset}" />
<title>{$seo['title']}</title>
<meta name="Keywords" content="{$seo['keywords']}">
<meta name="Description" content="{$seo['description']}">
<link href="templates/{$CFG[tplname]}/style/user.css" type="text/css" rel="stylesheet" />
<script src="js/jquery1.9.1.js"></script>
</head>
<body>
<!--{template header}-->
<div class="wrapper">
	<!-- 主体 -->
    <!--{template member_left_com}-->
	<div class="col_main">
    <!--{template member_topmenu}-->
     <div class="post_li f14">
  <form name="post" method="post">
      <ul>  
        <li><h3>消费金额</h3><input name="money" type="text" size="10" id="money" class="inputs fb fe43 f16" onKeyUp="changeValue()" value="" /> 元</li>
        
        <li><h3>享受折扣</h3><input name="zekou" type="text" size="10" id="zekou" value="0" class="inputs fb" disabled="disabled" />&nbsp;折</li>
        <li><h3>赠送积分</h3><input name="jifen" type="text" size="10" id="jifen" value="0" class="inputs fb" disabled="disabled" />&nbsp;分{if (strpos($cominfo['jf_day'][0],strval(",".$todays.","))!==false)}&nbsp;<span class="pad10 f12 f99">[<strong class="fe43">{$todays}</strong>]号{$CFG['cardname']}积分优惠日，可享受<strong class="fe43">{$cominfo['jf_day'][1]}</strong>倍积分</span>{/if}</li>
        <div class="clearfix h_15"></div>
        <li style="width:50%;"><h3 class="fe43">持卡会员价</h3><strong class="fe43 f22" id="siso">0</strong>&nbsp;元</li>
        <li style="width:50%;"><h3>普通会员价</h3><strong class="fe43 f22" id="sisos">0</strong>&nbsp;元</li>
        <div class="clearfix"></div>
        <li class="t_c"><div class="clearfix h_15"></div>
           <input type="button" class="btn_1" name="buttonid" value="生成二维码" id="buttonid" />
        </li>
      </ul>
</form>
      </div>
        <!--{template member_right}-->　
    </div>
    </div>
	<!--{template footer}-->
    <script>
         var input1pre;
		 var input2pre;
         function changeValue() {
             var val1 = document.getElementById('money').value;
             var val2 = document.getElementById('jifen').value;
			 var val3 = document.getElementById('zekou').value;
			 var val4 = document.getElementById('siso').innerText;
             if(typeof input1pre != 'undefined') {
                 val2 = val2.substring(0, val2.lastIndexOf(input1pre));
             }
			 {if (!empty($cominfo[jf_bl][0]) && !empty($cominfo[jf_bl][1]))}
			 document.getElementById('jifen').value = ((Math.floor(val1/parseInt({$cominfo[jf_bl][0]})))*parseInt({$cominfo[jf_bl][1]})).toFixed(0)+'{if (strpos($cominfo['jf_day'][0],strval(",".$todays.","))!==false)} × {$cominfo['jf_day'][1]}{/if}';
			 {else}
			 document.getElementById('jifen').value = 0;
			 {/if}
			 document.getElementById('sisos').innerText = (val1*1).toFixed(2);
			 if(typeof input2pre != 'undefined') {
                 val3 = val3.substring(0, val3.lastIndexOf(input2pre));
             }
			  {loop $zk_list $key $val}
			   {if ($val[0]!=0)}
			   {if ($key==0)}	   
			    if(val1<{$val[0]}){
			     document.getElementById('zekou').value = '0';
			     document.getElementById('siso').innerText = (val1*1).toFixed(2);
			    }
			   {/if}
			   if(val1>={$val[0]}){
			     document.getElementById('zekou').value = ({$val[1]}).toFixed(0);
			     document.getElementById('siso').innerText = ((val1*(parseInt(document.getElementById('zekou').value)/100))).toFixed(2);
			    }
				{else}
				   document.getElementById('zekou').value = '0';
			       document.getElementById('siso').innerText = (val1*1).toFixed(2);
				{/if}
			   {/loop}
         }
</script>
<script src="js/layer/layer.min.js"></script>
<script>
$('#buttonid').on('click',  function(){           
	$.layer({
    type : 2,
	maxmin: false,
	title:'使用手机微信扫描二维码',
	shadeClose: false,
	offset: ['150px',''],
    area : ['450px', '240px'],
    border : [5, 0.5, '#666666'],
	fix : false,
    iframe : {src: 'member.php?act=com_mainfo&id={$cominfo[comid]}&m='+$("input#money").val()}
    });
});
</script>
</body>
</html>
