|
@@ -81,7 +81,7 @@
|
|
|
<div class="just_buy">
|
|
|
<flexbox>
|
|
|
<flexbox-item :span="4/6" style="text-align: center;line-height: 93px; font-size: 30px;">应付: <span class="letter_warn">¥ {{datas.payinfo['pay_cash_pred']}}</span></flexbox-item>
|
|
|
- <flexbox-item :span="2/6" style="text-align: center;background:#EB4E4F;color: #fff;line-height: 93px; "><p>去付款</p></flexbox-item>
|
|
|
+ <flexbox-item :span="2/6" style="text-align: center;background:#EB4E4F;color: #fff;line-height: 93px; "><p @click="onBridgeReady">去付款</p></flexbox-item>
|
|
|
</flexbox>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -157,6 +157,34 @@
|
|
|
{
|
|
|
link_address(){
|
|
|
this.$router.push({path:'/address/list',query:{need_goBack:true}});
|
|
|
+ },
|
|
|
+ onBridgeReady(){
|
|
|
+ let goods_id = this.$route.query["goods_id"];
|
|
|
+ let goods_num = this.$route.query['num'];
|
|
|
+ let iscart = this.$route.query["iscart"];
|
|
|
+ let cart_id = this.$route.query["cart_id"]?this.$route.query["cart_id"]:'';
|
|
|
+ let vat_hash = this.datas['payinfo'].vat_hash;
|
|
|
+ let offpay_hash = this.datas['payinfo'].offpay_hash;
|
|
|
+ let offpay_hash_batch = this.datas['payinfo'].offpay_hash_batch;
|
|
|
+ let address_id = this.datas['address'].address_id;
|
|
|
+ this.$http.jsonp(Api.step_second(cart_id,goods_id,goods_num,address_id,0,vat_hash,offpay_hash,offpay_hash_batch)).then(function(res){
|
|
|
+ let param = res.body.datas.param.data;
|
|
|
+ WeixinJSBridge.invoke(
|
|
|
+ 'getBrandWCPayRequest', {
|
|
|
+ "appId": param.appid, //公众号名称,由商户传入
|
|
|
+ "timeStamp": param.timestamp, //时间戳,自1970年以来的秒数
|
|
|
+ "nonceStr": param.noncestr, //随机串
|
|
|
+ "package": 'prepay_id='+param.prepayid,
|
|
|
+ "signType": "MD5", //微信签名方式:
|
|
|
+ "paySign": param.sign //微信签名
|
|
|
+ },
|
|
|
+ function (res) {
|
|
|
+ if (res.err_msg == "get_brand_wcpay_request:ok") {
|
|
|
+ alert('支付成功');
|
|
|
+ } // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回 ok,但并不保证它绝对可靠。
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
components:
|