Commit 0b882060 authored by IvyXia123's avatar IvyXia123

订单页面授权

parent dc5ad450
...@@ -70,6 +70,20 @@ ...@@ -70,6 +70,20 @@
</div> </div>
</div> </div>
<!-- 支付方式选择 -->
<!--<div class="pay-list">
<div class="pay-choice">支付方式选择</div>
<ul class="pay">
<li v-for="item in payList" :key="item.value" @click="payListClick(item.value)">
<img :src="item.icon" alt="">
<span>{{ item.title }}</span>
<div class="icon-re">
<img :src="payIndex === item.value ? icon_re_acitve : iconRe" alt="">
</div>
</li>
</ul>
</div>-->
<footer> <footer>
<div class="sub-block"> <div class="sub-block">
<span v-if="groupDetail.goods_desc">{{priceTotal}}</span> <span v-if="groupDetail.goods_desc">{{priceTotal}}</span>
...@@ -77,7 +91,10 @@ ...@@ -77,7 +91,10 @@
class="tips-price" class="tips-price"
v-if="groupDetail.goods_desc" v-if="groupDetail.goods_desc"
>{{groupDetail.goods_desc.tips?groupDetail.goods_desc.tips:''}}</span> >{{groupDetail.goods_desc.tips?groupDetail.goods_desc.tips:''}}</span>
<div class="pay-btn" @click="payOrder(orderFlag)">提交订单</div> <div class="pay-btn" @click="payOrder(orderFlag)"
v-clipboard:copy="payIndex !== 0 ? payUrl : ''"
v-clipboard:success="copy"
v-clipboard:error="onError">提交订单</div>
</div> </div>
</footer> </footer>
<transition name="slide-fade"> <transition name="slide-fade">
...@@ -120,7 +137,8 @@ import { ...@@ -120,7 +137,8 @@ import {
getwechatParam, getwechatParam,
getStatusWechatApi, getStatusWechatApi,
getCouponListApi, getCouponListApi,
getCourseInfoApi getCourseInfoApi,
postPayBillApi
} from "../../service/api"; } from "../../service/api";
import addAddress from "./address"; import addAddress from "./address";
import loginPage from "./login"; import loginPage from "./login";
...@@ -228,6 +246,20 @@ export default { ...@@ -228,6 +246,20 @@ export default {
} }
}, },
methods: { methods: {
copy(e) {
if(this.payIndex === 1) {
Toast("支付宝支付获取成功,请把粘贴到支付宝里");
}
},
onError() {
if(this.payIndex === 1) {
Toast("支付宝支付获取成功,请把粘贴到支付宝里");
}
},
// 支付方式
payListClick(val) {
this.payIndex = val
},
recursion() { recursion() {
getCourseInfoApi().then(res => { getCourseInfoApi().then(res => {
if(res.status){ if(res.status){
...@@ -343,6 +375,56 @@ export default { ...@@ -343,6 +375,56 @@ export default {
json.group_order_id = this.$route.query.group_order_id; json.group_order_id = this.$route.query.group_order_id;
} }
this.orderFlag = false; this.orderFlag = false;
/* let payTypeArr = ['WX', 'ALI', '卡分期']
let data = { pay_type: payTypeArr[this.payIndex], return_url: window.location.href, goods_id: json.goods_id, buy_type: this.groupDetail.goods_type, group_order_id: json.group_order_id, order_coupon_id:json.order_coupon_id }
postPayBillApi(data).then(res => {
if(this.payIndex === 0) {
this.orderNo = res.out_trade_no;
if (res.out_trade_no && !res.appId) {
getCourseInfoApi().then(res => {
this.userCourse = res;
localStorage.setItem(
"userCourse",
JSON.stringify(this.userCourse)
);
this.navPage(res);
});
} else {
let that = this;
this.orderNo = res.out_trade_no;
this.jsApiParameters = res;
wx.miniProgram.getEnv(function(res) {
if (res.miniprogram) {
let payParam = encodeURIComponent(JSON.stringify(json));
wx.miniProgram.navigateTo({
url: `pages/wxPay/main?payParam=${payParam}`
});
} else if (typeof WeixinJSBridge === "undefined") {
if (document.addEventListener) {
document.addEventListener(
"WeixinJSBridgeReady",
that.jsApiCall,
false
);
} else if (document.attachEvent) {
document.attachEvent("WeixinJSBridgeReady", that.jsApiCall);
document.attachEvent(
"onWeixinJSBridgeReady",
that.jsApiCall
);
}
} else {
that.jsApiCall();
}
});
}
}else if(this.payIndex === 1){
this.payUrl = res.pay_url;
}
})
return false*/
payApi(json).then(res => { payApi(json).then(res => {
this.orderNo = res.out_trade_no; this.orderNo = res.out_trade_no;
if (res.out_trade_no && !res.appId) { if (res.out_trade_no && !res.appId) {
......
...@@ -620,9 +620,8 @@ router.beforeEach((to, from, next) => { ...@@ -620,9 +620,8 @@ router.beforeEach((to, from, next) => {
} }
// extensionV1Shop // extensionV1Shop
// extensionV1 // extensionV1
if (to.name === 'author' || to.name === 'bindMobile' || to.name === 'noWechat' || to.name === 'inspectorActivit' || to.name === 'passShop'|| to.name === 'ybIndex' ) { if (to.name === 'extensionV1' || to.name === 'extensionV1Shop' || to.name === 'author' || to.name === 'bindMobile' || to.name === 'noWechat' || to.name === 'inspectorActivit' || to.name === 'passShop'|| to.name === 'ybIndex' ) {
// 无需登录的页面 // 无需登录的页面
console.log(488)
next() next()
} else if (window.location.href.indexOf('token') > -1 && to.name === 'index') { } else if (window.location.href.indexOf('token') > -1 && to.name === 'index') {
let token = common.getUrlParam().token || to.query.token; let token = common.getUrlParam().token || to.query.token;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment