作者 lihan

最终完善+充值卡支付

... ... @@ -2,12 +2,14 @@
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" type="text/css" href="/themes/simplebootx/Portal/Template/css/swiper-3.4.2.min.css" />
<link rel="stylesheet" type="text/css" href="/themes/simplebootx/Portal/Template/css/init.css" />
<link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_647640_n3cow34ja3gzaor.css" />
<link rel="stylesheet" type="text/css" href="/themes/simplebootx/Portal/Template/css/PersonCenter/topus.css" />
<script src="/themes/simplebootx/Portal/Template/js/base.js" type="text/javascript" charset="utf-8"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<title>充值</title>
<style>
.wrapper{
... ... @@ -73,26 +75,7 @@
<p class="explain">充值卡使用说明</p>
</div>
<div class="text">
美食美食美食美食美食美食美食美食
美食美食美食美食美食美食美食美食
美食美食美食美食
美食美食美食美食
美食美食美食美食
美食美食美食美食美食美食美食美食
美食美食美食美食美食美食美食美食
美食美食美食美食
美食美食美食美食
美食美食美食美食
美食美食美食美食美食美食美食美食
美食美食美食美食美食美食美食美食
美食美食美食美食
美食美食美食美食
美食美食美食美食
美食美食美食美食美食美食美食美食
美食美食美食美食美食美食美食美食
美食美食美食美食
美食美食美食美食
美食美食美食美食
充值说明
</div>
<button class="certain">确定</button>
</div>
... ... @@ -101,18 +84,46 @@
<div class="header">
<i class="iconfont icon-my_icon"></i><p>充值卡使用说明</p>
</div>
<div class="top_us_card" v-for="item in cardindex" :id="item.id">
<div class="top_us_card" v-for="item in cardindex">
<p class="top_us_num">充值面额</p>
<div class="top_us_num_wrap">
<p class="forever">有效期:永久</p>
<p class="give_num">赠送{{item.bonus}}元</p>
<span class="btn" @click="recharge(item)">立即充值</span>
<span class="btn" onclick="recharge(this.id)" :id="item.id">立即充值</span>
</div>
<div class="money">
<p class="icon">¥</p><p class="money_num">{{item.denomination}}</p>
</div>
</div>
</div>
<script>
function recharge(id) {
$.ajax({
url:"{:U('Portal/Card/recharge_s')}",
data:{
id:id,
from:2,
unique_id: localStorage.getItem('unique_id')
},
type:"POST",
dataType:"JSON",
success: function (data) {
console.log(data);
wx.chooseWXPay({
timestamp: data.data.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
nonceStr: data.data.nonceStr, // 支付签名随机串,不长于 32 位
package: data.data.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
signType: data.data.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
paySign: data.data.paySign, // 支付签名
success: function (res) {
// 支付成功后的回调函数
}
});
}
})
}
</script>
<script src="/themes/simplebootx/Portal/Template/js/vue.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/js/cookie.js" type="text/javascript" charset="utf-8"></script>
... ... @@ -130,8 +141,19 @@
// alert(111)
$(".wrapper").css("display","block")
});
</script>
<script>
wx.config({
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: '{$sdk.appId}', // 必填,公众号的唯一标识
timestamp: '{$sdk.timestamp}', // 必填,生成签名的时间戳
nonceStr: '{$sdk.nonceStr}', // 必填,生成签名的随机串
signature: '{$sdk.signature}',// 必填,签名
jsApiList: [
'chooseWXPay'
] // 必填,需要使用的JS接口列表
});
</script>
</body>
... ...
... ... @@ -282,7 +282,7 @@ new Vue({
var cartid=obj.cart_id;
cartdid.push(cartid);
console.log(cartdid);
window.location.href=linkPath+'/order.html?id='+cartdid
window.location.href="/index.php?g=&m=template&a=order&id="+cartdid;
}
//else if(that.checklist.length==0){
... ...
... ... @@ -21,9 +21,6 @@ new Vue({
var data=res.data;
that.cardindex=data;
console.log(that.cardindex)
})
},
//充值卡充值
... ... @@ -31,7 +28,7 @@ new Vue({
var that = this;
var id=obj.id;
var url = '/Card/recharge'
var url = '/Card/recharges'
var params = {
unique_id: localStorage.getItem('unique_id'),
id:id,
... ... @@ -40,18 +37,9 @@ new Vue({
ajaxsend(url, params, function(res) {
/*console.log(JSON.stringify(res))*/
console.log(res);
// var data=res.data;
// that.cardindex=data;
// console.log(that.cardindex)
})
},
},
... ...
... ... @@ -4,22 +4,22 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" type="text/css" href="css/swiper-3.4.2.min.css" />
<link rel="stylesheet" type="text/css" href="/themes/simplebootx/Portal/Template/css/swiper-3.4.2.min.css" />
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
<link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_647640_rgou3w6dip.css" />
<link rel="stylesheet" type="text/css" href="css/order.css" />
<script src="js/base.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="/themes/simplebootx/Portal/Template/css/order.css" />
<script src="/themes/simplebootx/Portal/Template/js/base.js" type="text/javascript" charset="utf-8"></script>
<!--jquery weui-->
<link rel="stylesheet" href="css/weui.min.css">
<link rel="stylesheet" href="css/jquery-weui.css">
<link rel="stylesheet" href="css/demos.css">
<link rel="stylesheet" href="/themes/simplebootx/Portal/Template/css/weui.min.css">
<link rel="stylesheet" href="/themes/simplebootx/Portal/Template/css/jquery-weui.css">
<link rel="stylesheet" href="/themes/simplebootx/Portal/Template/css/demos.css">
<!--时间插件-->
<link rel="stylesheet" href="datecss/mobiscroll.css" />
<link rel="stylesheet" href="datecss/mobiscroll_003.css" />
<link rel="stylesheet" href="datecss/mobiscroll_002.css" />
<link rel="stylesheet" href="/themes/simplebootx/Portal/Template/datecss/mobiscroll.css" />
<link rel="stylesheet" href="/themes/simplebootx/Portal/Template/datecss/mobiscroll_003.css" />
<link rel="stylesheet" href="/themes/simplebootx/Portal/Template/datecss/mobiscroll_002.css" />
<!--<link rel="stylesheet" type="text/css" href="css/index.css" />-->
<link rel="stylesheet" type="text/css" href="css/init.css" />
<link rel="stylesheet" type="text/css" href="/themes/simplebootx/Portal/Template/css/init.css" />
<title>提交订单</title>
<style>
.state {
... ... @@ -581,25 +581,25 @@
</div>
</div>
<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
<script src="js/vue.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/cookie.js" type="text/javascript" charset="utf-8"></script>
<script src="js/swiper-3.4.2.jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/order.js" type="text/javascript" charset="utf-8"></script>
<script src="datejs/jquery-1.js" type="text/javascript" charset="utf-8"></script>
<script src="datejs/jquery.1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/js/vue.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/js/vue.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/js/cookie.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/js/swiper-3.4.2.jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/js/order.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/datejs/jquery-1.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/datejs/jquery.1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
<!--jquery weui-->
<script src="js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
<script src="js/fastclick.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery-weui.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/js/fastclick.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/js/jquery-weui.js" type="text/javascript" charset="utf-8"></script>
<!--jQuery weui-->
<script src="datejs/mobiscroll_002.js" type="text/javascript" charset="utf-8"></script>
<script src="datejs/mobiscroll.js" type="text/javascript" charset="utf-8"></script>
<script src="datejs/mobiscroll_004.js" type="text/javascript" charset="utf-8"></script>
<script src="datejs/mobiscroll_003.js" type="text/javascript" charset="utf-8"></script>
<script src="datejs/mobiscroll_005.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/datejs/mobiscroll_002.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/datejs/mobiscroll.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/datejs/mobiscroll_004.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/datejs/mobiscroll_003.js" type="text/javascript" charset="utf-8"></script>
<script src="/themes/simplebootx/Portal/Template/datejs/mobiscroll_005.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var hope_address = document.getElementsByClassName('hope_address')[0];
var wrap = document.getElementsByClassName('wrap')[0];
... ...