Commit a360a115 authored by IvyXia123's avatar IvyXia123

购买成功修改

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