Commit a360a115 authored by IvyXia123's avatar IvyXia123

购买成功修改

parent ae111fe4
......@@ -105,6 +105,7 @@ export default {
this.groupDetail = JSON.parse(sessionStorage.getItem('groupDetail'));
if (sessionStorage.getItem("buyindex") == 1) {
getUserDetailApi().then(res => {
console.log(9999)
localStorage.setItem("userDesc", JSON.stringify(res));
this.userDesc = res;
this.subscribe = this.userDesc.open_info.is_subscribe;
......@@ -121,6 +122,7 @@ export default {
this.userDesc = JSON.parse(localStorage.getItem("userDesc"));
this.subscribe = this.userDesc.open_info.is_subscribe;
getOrderDetailApi(this.orderNo).then(res => {
console.log(3333)
this.goods_id = res.goods_id;
this.invite_code = `CC-${res.invite_type}-${res.invite_id}`;
this.money = res.money;
......
<template>
<div>
<div style="height: 100vh;overflow: auto">
<div class="group-index" ref="index" v-if="getUserDetailApi" style="min-height: 120vh">
<div class="group-index" ref="index" v-if="groupDetail" style="min-height: 120vh">
<swiper :options="swiperOption" class="banner" ref="mySwiper">
<swiper-slide
v-if="groupDetail.goods_desc"
......@@ -341,10 +341,11 @@ export default {
// this.
},
goToBuyPage() {
console.log(this.groupDetail.is_real);
if(this.groupDetail.is_real){
console.log(2323)
let query = { shopId: this.shopId, invite_code: this.invite_code };
let invite = this.invite_code;
this.$sa.track("buyCourse", {
buyType:
this.groupDetail.goods_type === 2 && this.buyType === 0
......@@ -358,6 +359,7 @@ export default {
if (this.groupId) {
query.group_order_id = this.groupId;
}
console.log(this.buyType);
if (this.buyType === 0 && !this.groupId) {
query.type = "single";
this.buyType = "single";
......@@ -375,7 +377,6 @@ export default {
// window.location.reload();
return false;
} else {
query.type = "";
}
if (localStorage.getItem("gdt_vid")) {
......@@ -430,11 +431,7 @@ export default {
this.orderFlag = false;
payApi(json).then(res=>{
// console.log(res)
console.log(res)
console.log(res.appId)
if(res.out_trade_no && !res.appId){
console.log(352345234)
console.log(this.groupDetail.goods_type)
if(this.groupDetail.goods_type === 2 && !this.type){
this.$router.push({name:'success',query:{out_trade_no:res.out_trade_no,invite_code:this.invite_code}});
}else if(this.groupDetail.goods_type === 4){
......@@ -443,17 +440,14 @@ export default {
this.$router.push({name:'buySuccess',query:{out_trade_no:res.out_trade_no,invite_code:this.invite_code}});
}
}else{
console.log(99999)
let that = this;
this.orderNo = res.out_trade_no;
this.jsApiParameters = res;
wx.miniProgram.getEnv(function(res) {
if(res.miniprogram){
console.log(2342345)
let payParam = encodeURIComponent(JSON.stringify(json));
wx.miniProgram.navigateTo({url: `pages/wxPay/main?payParam=${payParam}`})
}else if (typeof WeixinJSBridge === 'undefined') {
console.log(8983)
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', that.jsApiCall, false)
} else if (document.attachEvent) {
......
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