Commit 5b8cddaf05643172d7a56dc7d84fe65d0068f6d0
合并通联收银支付
Showing
30 changed files
with
1288 additions
and
151 deletions
app.js
| @@ -519,6 +519,9 @@ App({ | @@ -519,6 +519,9 @@ App({ | ||
| 519 | } | 519 | } |
| 520 | 520 | ||
| 521 | }, | 521 | }, |
| 522 | + re_to(url){ | ||
| 523 | + wx.redirectTo({ url: url, }) //跳到非tabbar页 | ||
| 524 | + }, | ||
| 522 | 525 | ||
| 523 | //显示提示,word提示内容,type 0失败,提示 1成功 | 526 | //显示提示,word提示内容,type 0失败,提示 1成功 |
| 524 | my_warnning(word, type, that, width) { | 527 | my_warnning(word, type, that, width) { |
packageA/pages/cart2_ser/cart2_ser.js
| @@ -3,7 +3,7 @@ var t = getApp(), | @@ -3,7 +3,7 @@ var t = getApp(), | ||
| 3 | a = t.request, | 3 | a = t.request, |
| 4 | e = require("../../../utils/common.js"), | 4 | e = require("../../../utils/common.js"), |
| 5 | s = require("../../../utils/util.js"), | 5 | s = require("../../../utils/util.js"), |
| 6 | - o = require("../../../utils/md5.js"), | 6 | + ut=s, o = require("../../../utils/md5.js"), |
| 7 | to = getApp(); | 7 | to = getApp(); |
| 8 | var oo = t.globalData.setting, | 8 | var oo = t.globalData.setting, |
| 9 | os = oo; | 9 | os = oo; |
| @@ -49,6 +49,10 @@ Page({ | @@ -49,6 +49,10 @@ Page({ | ||
| 49 | is_cart: 0, //是不是购物车进来的购买 | 49 | is_cart: 0, //是不是购物车进来的购买 |
| 50 | }, | 50 | }, |
| 51 | onLoad: function(t) { | 51 | onLoad: function(t) { |
| 52 | + | ||
| 53 | + //定义第一次进入 | ||
| 54 | + this.data.fir_in=1; | ||
| 55 | + | ||
| 52 | wx.setNavigationBarTitle({ | 56 | wx.setNavigationBarTitle({ |
| 53 | title: "填写订单", | 57 | title: "填写订单", |
| 54 | }); | 58 | }); |
| @@ -274,11 +278,47 @@ Page({ | @@ -274,11 +278,47 @@ Page({ | ||
| 274 | 278 | ||
| 275 | //----------子页返回父页触发---------- | 279 | //----------子页返回父页触发---------- |
| 276 | onShow: function() { | 280 | onShow: function() { |
| 277 | - var fy=s.fy_back("/pages/user/order_list/order_list?index=2&tabindex=1",1); | ||
| 278 | - if(fy) return false; | ||
| 279 | 281 | ||
| 280 | - t_pay.set_fir(); | ||
| 281 | var th = this; | 282 | var th = this; |
| 283 | + | ||
| 284 | + //判断是不是第一次进入 | ||
| 285 | + if(this.data.fir_in){ | ||
| 286 | + this.data.fir_in=0; | ||
| 287 | + }else{ | ||
| 288 | + var fy=s.fy_back("/pages/user/order_list/order_list?index=2&tabindex=1",1); | ||
| 289 | + if(fy) return false; | ||
| 290 | + t_pay.set_fir(); | ||
| 291 | + | ||
| 292 | + var back_url="/pages/payment/pay_success/pay_success?card=1&order_id=" + th.data.order_id; | ||
| 293 | + //-- 通联的第三方支付的返回优化 -- | ||
| 294 | + ut.is_pay_ok(back_url,"/pages/user/order_list/order_list?index=2&tabindex=1",function (){ | ||
| 295 | + | ||
| 296 | + if(!th.data.order_id) return false; | ||
| 297 | + getApp().request.promiseGet("/api/weshop/recharge/user/page", | ||
| 298 | + {data:{store_id:os.stoid,order_id:th.data.order_id,user_id:getApp().globalData.user_id }}).then(res=>{ | ||
| 299 | + if(ut.ajax_ok(res)){ | ||
| 300 | + var item=res.data.data.pageData[0]; | ||
| 301 | + if(item.pay_status==1){ | ||
| 302 | + //支付支付,返回首页 | ||
| 303 | + ut.m_toast('支付成功'); | ||
| 304 | + setTimeout(()=>{ | ||
| 305 | + getApp().re_to(back_url); | ||
| 306 | + },1000) | ||
| 307 | + | ||
| 308 | + }else{ | ||
| 309 | + //支付支付,返回首页 | ||
| 310 | + ut.m_toast('支付失败'); | ||
| 311 | + setTimeout(()=>{ | ||
| 312 | + getApp().re_to("/pages/user/order_list/order_list?index=2&tabindex=1"); | ||
| 313 | + },1000) | ||
| 314 | + } | ||
| 315 | + } | ||
| 316 | + }) | ||
| 317 | + }); | ||
| 318 | + | ||
| 319 | + } | ||
| 320 | + | ||
| 321 | + | ||
| 282 | if (th.data.isclose == 0) { | 322 | if (th.data.isclose == 0) { |
| 283 | wx.navigateTo({ | 323 | wx.navigateTo({ |
| 284 | url: "/pages/index/index/index" | 324 | url: "/pages/index/index/index" |
| @@ -647,6 +687,9 @@ Page({ | @@ -647,6 +687,9 @@ Page({ | ||
| 647 | }, 1000) | 687 | }, 1000) |
| 648 | 688 | ||
| 649 | },function (e){ | 689 | },function (e){ |
| 690 | + | ||
| 691 | + console.log('kkkkkkk'); | ||
| 692 | + | ||
| 650 | wx.showToast({ | 693 | wx.showToast({ |
| 651 | title: e, | 694 | title: e, |
| 652 | icon: 'none', | 695 | icon: 'none', |
packageA/pages/details_serviceCard/details_serviceCard.js
| @@ -20,6 +20,9 @@ Page({ | @@ -20,6 +20,9 @@ Page({ | ||
| 20 | */ | 20 | */ |
| 21 | onLoad: function(options) { | 21 | onLoad: function(options) { |
| 22 | 22 | ||
| 23 | + //定义第一次进入 | ||
| 24 | + this.data.fir_in=1; | ||
| 25 | + | ||
| 23 | self = this; | 26 | self = this; |
| 24 | this.data.options = options; | 27 | this.data.options = options; |
| 25 | 28 | ||
| @@ -47,8 +50,87 @@ Page({ | @@ -47,8 +50,87 @@ Page({ | ||
| 47 | */ | 50 | */ |
| 48 | onShow: function() { | 51 | onShow: function() { |
| 49 | this.data.is_summit_ing=0; | 52 | this.data.is_summit_ing=0; |
| 50 | - util.fy_back('',0) | ||
| 51 | - t_pay.set_fir(); | 53 | + |
| 54 | + var th=this; | ||
| 55 | + //判断是不是第一次进入 | ||
| 56 | + if(this.data.fir_in){ | ||
| 57 | + this.data.fir_in=0; | ||
| 58 | + }else{ | ||
| 59 | + util.fy_back('',0) | ||
| 60 | + t_pay.set_fir(); | ||
| 61 | + | ||
| 62 | + var back_url='/pages/user/order_list/order_list?index=2&tabindex=1'; | ||
| 63 | + var err_url='/pages/user/order_list/order_list?index=2&tabindex=1'; | ||
| 64 | + | ||
| 65 | + if(th.data.details) { | ||
| 66 | + //-- 判断一下活动的类型 -- | ||
| 67 | + var prom_type = th.data.details.list[0].prom_type > 0 ? th.data.details.list[0].prom_type : 0; | ||
| 68 | + var order_id = th.data.details.order_id; | ||
| 69 | + var order_sn = th.data.details.order_sn; | ||
| 70 | + | ||
| 71 | + var ck_url = ''; //请求地址 | ||
| 72 | + var req_data = {}; //请求参数 | ||
| 73 | + if (parseInt(prom_type) == 6) { | ||
| 74 | + //跳转到组图的页面 | ||
| 75 | + back_url= "/packageA/pages/serviceCard_pd/team_success/team_success?ordersn=" + order_sn | ||
| 76 | + ck_url = "/api/weshop/rechargeServicelist/page"; | ||
| 77 | + req_data = {store_id: os.stoid, order_id: order_id}; | ||
| 78 | + } else { | ||
| 79 | + ck_url = "/api/weshop/recharge/user/page"; | ||
| 80 | + req_data = {store_id: os.stoid, order_id: order_id, user_id: getApp().globalData.user_id}; | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + //-- 通联的第三方支付的返回优化 -- | ||
| 84 | + ut.is_pay_ok(back_url, err_url, function () { | ||
| 85 | + | ||
| 86 | + if (!th.data.details) return false; | ||
| 87 | + | ||
| 88 | + getApp().request.promiseGet(ck_url, | ||
| 89 | + {data: req_data}).then(res => { | ||
| 90 | + if (ut.ajax_ok(res)) { | ||
| 91 | + var item = res.data.data.pageData[0]; | ||
| 92 | + if (parseInt(prom_type) == 6) { | ||
| 93 | + if (item.pt_status == 1 || item.pt_status == 2) { | ||
| 94 | + //支付支付,返回首页 | ||
| 95 | + ut.m_toast('支付成功'); | ||
| 96 | + setTimeout(() => { | ||
| 97 | + getApp().re_to(back_url); | ||
| 98 | + }, 1000) | ||
| 99 | + | ||
| 100 | + } else { | ||
| 101 | + //支付支付,返回首页 | ||
| 102 | + ut.m_toast('支付失败'); | ||
| 103 | + setTimeout(() => { | ||
| 104 | + getApp().re_to(err_url); | ||
| 105 | + }, 1000) | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + } else { | ||
| 109 | + if (item.pay_status == 1) { | ||
| 110 | + //支付支付,返回首页 | ||
| 111 | + ut.m_toast('支付成功'); | ||
| 112 | + setTimeout(() => { | ||
| 113 | + getApp().re_to(back_url); | ||
| 114 | + }, 1000) | ||
| 115 | + | ||
| 116 | + } else { | ||
| 117 | + //支付支付,返回首页 | ||
| 118 | + ut.m_toast('支付失败'); | ||
| 119 | + setTimeout(() => { | ||
| 120 | + getApp().re_to(err_url); | ||
| 121 | + }, 1000) | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + | ||
| 126 | + } | ||
| 127 | + }) | ||
| 128 | + }); | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + | ||
| 52 | getApp().check_can_share(); | 134 | getApp().check_can_share(); |
| 53 | if (app.globalData.userInfo) { | 135 | if (app.globalData.userInfo) { |
| 54 | if (!this.data.isLogin) { | 136 | if (!this.data.isLogin) { |
packageA/pages/myGift/myGift.js
| @@ -4,6 +4,7 @@ let self = null; | @@ -4,6 +4,7 @@ let self = null; | ||
| 4 | var os = app.globalData.setting; | 4 | var os = app.globalData.setting; |
| 5 | var t_pay = require("../../../utils/pay2.js"); | 5 | var t_pay = require("../../../utils/pay2.js"); |
| 6 | var util = require('../../../utils/util.js'); | 6 | var util = require('../../../utils/util.js'); |
| 7 | +var ut=util; | ||
| 7 | 8 | ||
| 8 | Page({ | 9 | Page({ |
| 9 | 10 | ||
| @@ -53,6 +54,9 @@ Page({ | @@ -53,6 +54,9 @@ Page({ | ||
| 53 | */ | 54 | */ |
| 54 | onLoad: function (options) { | 55 | onLoad: function (options) { |
| 55 | 56 | ||
| 57 | + //定义第一次进入 | ||
| 58 | + this.data.fir_in=1; | ||
| 59 | + | ||
| 56 | self = this; | 60 | self = this; |
| 57 | if(options.index){ | 61 | if(options.index){ |
| 58 | this.setData({currentIndex:1}); //查看我的礼包 | 62 | this.setData({currentIndex:1}); //查看我的礼包 |
| @@ -92,9 +96,50 @@ Page({ | @@ -92,9 +96,50 @@ Page({ | ||
| 92 | */ | 96 | */ |
| 93 | onShow: function () { | 97 | onShow: function () { |
| 94 | 98 | ||
| 95 | - util.fy_back('',0) | ||
| 96 | this.data.is_summit_ing=0; | 99 | this.data.is_summit_ing=0; |
| 97 | - t_pay.set_fir(); | 100 | + |
| 101 | + | ||
| 102 | + var th=this; | ||
| 103 | + //判断是不是第一次进入 | ||
| 104 | + if(this.data.fir_in){ | ||
| 105 | + this.data.fir_in=0; | ||
| 106 | + }else{ | ||
| 107 | + //富友插件支付 | ||
| 108 | + util.fy_back('',0) | ||
| 109 | + t_pay.set_fir(); | ||
| 110 | + | ||
| 111 | + //-- 通联的第三方支付的返回优化 -- | ||
| 112 | + util.is_pay_ok("none","none",function (){ | ||
| 113 | + if(!th.data.ok_order_sn) return false; | ||
| 114 | + | ||
| 115 | + var b_url="/api/weshop/libao/libaoFormvip/page"; | ||
| 116 | + var rq_data={ | ||
| 117 | + store_id: app.globalData.setting.stoid, | ||
| 118 | + user_id: app.globalData.user_id, | ||
| 119 | + number: th.data.ok_order_sn | ||
| 120 | + }; | ||
| 121 | + | ||
| 122 | + getApp().request.promiseGet(b_url, | ||
| 123 | + {data:rq_data}).then(res=>{ | ||
| 124 | + if(ut.ajax_ok(res)){ | ||
| 125 | + var item=res.data.data.pageData[0]; | ||
| 126 | + if(item.fbillstate==1){ | ||
| 127 | + //支付支付,返回首页 | ||
| 128 | + util.m_toast('支付成功'); | ||
| 129 | + }else{ | ||
| 130 | + //支付支付,返回首页 | ||
| 131 | + util.m_toast('支付失败'); | ||
| 132 | + } | ||
| 133 | + } | ||
| 134 | + }) | ||
| 135 | + }); | ||
| 136 | + | ||
| 137 | + } | ||
| 138 | + | ||
| 139 | + | ||
| 140 | + | ||
| 141 | + | ||
| 142 | + | ||
| 98 | getApp().check_can_share(); | 143 | getApp().check_can_share(); |
| 99 | if(app.globalData.userInfo) { | 144 | if(app.globalData.userInfo) { |
| 100 | if(!this.data.isLogin) { | 145 | if(!this.data.isLogin) { |
| @@ -306,7 +351,7 @@ Page({ | @@ -306,7 +351,7 @@ Page({ | ||
| 306 | },function (e){ | 351 | },function (e){ |
| 307 | th.data.is_summit_ing=0; | 352 | th.data.is_summit_ing=0; |
| 308 | getApp().my_warnning(e, 0, th); | 353 | getApp().my_warnning(e, 0, th); |
| 309 | - }) | 354 | + },th) |
| 310 | // var url = "/api/weshop/libao/libaoFormvip/libaoOrder"; | 355 | // var url = "/api/weshop/libao/libaoFormvip/libaoOrder"; |
| 311 | // getApp().request.post(url, | 356 | // getApp().request.post(url, |
| 312 | // { | 357 | // { |
packageA/pages/myGiftDetails/myGiftDetails.js
| @@ -24,8 +24,10 @@ Page({ | @@ -24,8 +24,10 @@ Page({ | ||
| 24 | * 生命周期函数--监听页面加载 | 24 | * 生命周期函数--监听页面加载 |
| 25 | */ | 25 | */ |
| 26 | onLoad: function (options) { | 26 | onLoad: function (options) { |
| 27 | + //定义第一次进入 | ||
| 28 | + this.data.fir_in=1; | ||
| 27 | 29 | ||
| 28 | - self = this; | 30 | + self = this; |
| 29 | 31 | ||
| 30 | // 如果从商品详情页点击促销栏里的礼包跳转过来的话,不显示底部按钮 | 32 | // 如果从商品详情页点击促销栏里的礼包跳转过来的话,不显示底部按钮 |
| 31 | // showBtn 控制按钮是否显示 | 33 | // showBtn 控制按钮是否显示 |
| @@ -68,9 +70,60 @@ Page({ | @@ -68,9 +70,60 @@ Page({ | ||
| 68 | * 生命周期函数--监听页面显示 | 70 | * 生命周期函数--监听页面显示 |
| 69 | */ | 71 | */ |
| 70 | onShow: function () { | 72 | onShow: function () { |
| 71 | - this.data.is_summit_ing=0; | ||
| 72 | - ut.fy_back('',0) | ||
| 73 | - t_pay.set_fir(); | 73 | + |
| 74 | + this.data.is_summit_ing=0; | ||
| 75 | + var th=this; | ||
| 76 | + //判断是不是第一次进入 | ||
| 77 | + if(this.data.fir_in){ | ||
| 78 | + this.data.fir_in=0; | ||
| 79 | + }else{ | ||
| 80 | + ut.fy_back('',0) | ||
| 81 | + t_pay.set_fir(); | ||
| 82 | + | ||
| 83 | + //-- 通联的第三方支付的返回优化 -- | ||
| 84 | + ut.is_pay_ok("/packageA/pages/libao_payment/payment?type=2","none",function (){ | ||
| 85 | + | ||
| 86 | + console.log('is_pay_ok'); | ||
| 87 | + console.log(th.data.ok_order_sn); | ||
| 88 | + | ||
| 89 | + if(!th.data.ok_order_sn) return false; | ||
| 90 | + | ||
| 91 | + var b_url="/api/weshop/libao/libaoFormvip/page"; | ||
| 92 | + var rq_data={ | ||
| 93 | + store_id: app.globalData.setting.stoid, | ||
| 94 | + user_id: app.globalData.user_id, | ||
| 95 | + number: th.data.ok_order_sn | ||
| 96 | + }; | ||
| 97 | + | ||
| 98 | + getApp().request.promiseGet(b_url, | ||
| 99 | + {data:rq_data}).then(res=>{ | ||
| 100 | + | ||
| 101 | + console.log('is_pay_ok2'); | ||
| 102 | + console.log('1111111'); | ||
| 103 | + | ||
| 104 | + if(ut.ajax_ok(res)){ | ||
| 105 | + | ||
| 106 | + var item=res.data.data.pageData[0]; | ||
| 107 | + if(item.fbillstate==1){ | ||
| 108 | + //支付支付,返回首页 | ||
| 109 | + ut.m_toast('支付成功'); | ||
| 110 | + setTimeout(()=>{ | ||
| 111 | + getApp().goto("/packageA/pages/libao_payment/payment?type=2"); | ||
| 112 | + },1000) | ||
| 113 | + | ||
| 114 | + }else{ | ||
| 115 | + //支付支付,返回首页 | ||
| 116 | + ut.m_toast('支付失败'); | ||
| 117 | + setTimeout(()=>{ | ||
| 118 | + getApp().goto("/pages/index/index/index"); | ||
| 119 | + },1000) | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + }) | ||
| 123 | + }); | ||
| 124 | + | ||
| 125 | + } | ||
| 126 | + | ||
| 74 | getApp().check_can_share(); | 127 | getApp().check_can_share(); |
| 75 | if(app.globalData.userInfo) { | 128 | if(app.globalData.userInfo) { |
| 76 | if(!this.data.isLogin) { | 129 | if(!this.data.isLogin) { |
| @@ -248,7 +301,7 @@ Page({ | @@ -248,7 +301,7 @@ Page({ | ||
| 248 | },function (msg){ | 301 | },function (msg){ |
| 249 | th.data.is_summit_ing=0; | 302 | th.data.is_summit_ing=0; |
| 250 | getApp().my_warnning(msg, 0, th); | 303 | getApp().my_warnning(msg, 0, th); |
| 251 | - }) | 304 | + },th) |
| 252 | 305 | ||
| 253 | // var url = "/api/weshop/libao/libaoFormvip/libaoOrder"; | 306 | // var url = "/api/weshop/libao/libaoFormvip/libaoOrder"; |
| 254 | // getApp().request.post(url, | 307 | // getApp().request.post(url, |
packageA/pages/serviceCard_pd/cart/cart.js
| 1 | var t = getApp(), app = t, a = t.request, e = require("../../../../utils/common.js"), | 1 | var t = getApp(), app = t, a = t.request, e = require("../../../../utils/common.js"), |
| 2 | - s = require("../../../../utils/util.js"), o = require("../../../../utils/md5.js"), to = getApp(); | 2 | + s = require("../../../../utils/util.js"),ut=s, o = require("../../../../utils/md5.js"), to = getApp(); |
| 3 | var oo = t.globalData.setting, os = oo; | 3 | var oo = t.globalData.setting, os = oo; |
| 4 | var regeneratorRuntime = require('../../../../utils/runtime.js'); | 4 | var regeneratorRuntime = require('../../../../utils/runtime.js'); |
| 5 | var util_pay = require("../../../../utils/pay.js"); | 5 | var util_pay = require("../../../../utils/pay.js"); |
| @@ -71,7 +71,8 @@ Page({ | @@ -71,7 +71,8 @@ Page({ | ||
| 71 | }, | 71 | }, |
| 72 | onLoad: function (t) { | 72 | onLoad: function (t) { |
| 73 | console.log("onLoad_pt_cart"); | 73 | console.log("onLoad_pt_cart"); |
| 74 | - | 74 | + //定义第一次进入 |
| 75 | + this.data.fir_in=1; | ||
| 75 | 76 | ||
| 76 | var th = this; this.setData({ is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow, }); | 77 | var th = this; this.setData({ is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow, }); |
| 77 | var appD = getApp().get_b_now(); | 78 | var appD = getApp().get_b_now(); |
| @@ -245,12 +246,45 @@ Page({ | @@ -245,12 +246,45 @@ Page({ | ||
| 245 | //----------子页返回父页触发---------- | 246 | //----------子页返回父页触发---------- |
| 246 | onShow: function () { | 247 | onShow: function () { |
| 247 | 248 | ||
| 248 | - s.fy_back('',0); | 249 | + var th = this; |
| 250 | + //判断是不是第一次进入 | ||
| 251 | + if(this.data.fir_in){ | ||
| 252 | + this.data.fir_in=0; | ||
| 253 | + }else{ | ||
| 254 | + s.fy_back('',0); | ||
| 255 | + t_pay.set_fir(); | ||
| 256 | + util_pay.set_fir(); | ||
| 257 | + | ||
| 258 | + var back_url="/packageA/pages/serviceCard_pd/team_success/team_success?ordersn=" + th.data.order_sn; | ||
| 259 | + | ||
| 260 | + //-- 通联的第三方支付的返回优化 -- | ||
| 261 | + ut.is_pay_ok(back_url,"/pages/user/order_list/order_list?index=2&tabindex=1",function (){ | ||
| 262 | + if(!th.data.order_id) return false; | ||
| 263 | + getApp().request.promiseGet("/api/weshop/rechargeServicelist/page",{ | ||
| 264 | + data: { store_id: os.stoid, order_id: th.data.order_id} | ||
| 265 | + }).then(res=>{ | ||
| 266 | + if(ut.ajax_ok(res)){ | ||
| 267 | + var item=res.data.data.pageData[0]; | ||
| 268 | + if(item.pt_status==1 || item.pt_status==2){ | ||
| 269 | + //支付支付,返回首页 | ||
| 270 | + ut.m_toast('支付成功'); | ||
| 271 | + setTimeout(()=>{ | ||
| 272 | + getApp().re_to(back_url); | ||
| 273 | + },1000) | ||
| 274 | + | ||
| 275 | + }else{ | ||
| 276 | + //支付支付,返回首页 | ||
| 277 | + ut.m_toast('支付失败'); | ||
| 278 | + setTimeout(()=>{ | ||
| 279 | + getApp().re_to("/pages/user/order_list/order_list?index=2&tabindex=1"); | ||
| 280 | + },1000) | ||
| 281 | + } | ||
| 282 | + } | ||
| 283 | + }) | ||
| 284 | + }); | ||
| 285 | + } | ||
| 249 | 286 | ||
| 250 | - t_pay.set_fir(); | ||
| 251 | - util_pay.set_fir(); | ||
| 252 | 287 | ||
| 253 | - var th = this; | ||
| 254 | if (th.data.isclose == 0) { | 288 | if (th.data.isclose == 0) { |
| 255 | wx.navigateTo({ | 289 | wx.navigateTo({ |
| 256 | url: "/pages/index/index/index" | 290 | url: "/pages/index/index/index" |
packageA/pages/serviceCard_pd/cart_wk/cart_wk.js
| @@ -59,6 +59,8 @@ Page({ | @@ -59,6 +59,8 @@ Page({ | ||
| 59 | * 生命周期函数--监听页面加载 | 59 | * 生命周期函数--监听页面加载 |
| 60 | */ | 60 | */ |
| 61 | onLoad: function (options) { | 61 | onLoad: function (options) { |
| 62 | + //定义第一次进入 | ||
| 63 | + this.data.fir_in=1; | ||
| 62 | 64 | ||
| 63 | //清空is_pick_up | 65 | //清空is_pick_up |
| 64 | getApp().request.put("/api/weshop/useraddress/updatePickUp", { | 66 | getApp().request.put("/api/weshop/useraddress/updatePickUp", { |
| @@ -94,11 +96,49 @@ Page({ | @@ -94,11 +96,49 @@ Page({ | ||
| 94 | */ | 96 | */ |
| 95 | onShow: function () { | 97 | onShow: function () { |
| 96 | 98 | ||
| 97 | - ut.fy_back('',0); | ||
| 98 | this.data.paying=0; | 99 | this.data.paying=0; |
| 99 | - util_pay.set_fir(); | ||
| 100 | - getApp().check_can_share(); | 100 | + |
| 101 | var th = this; | 101 | var th = this; |
| 102 | + //判断是不是第一次进入 | ||
| 103 | + if(this.data.fir_in){ | ||
| 104 | + this.data.fir_in=0; | ||
| 105 | + }else{ | ||
| 106 | + ut.fy_back('',0); | ||
| 107 | + util_pay.set_fir(); | ||
| 108 | + | ||
| 109 | + | ||
| 110 | + var back_url="/pages/payment/pay_success/pay_success?order_id=" + th.data.order.order_id + "&type=1&card=1"; | ||
| 111 | + //-- 通联的第三方支付的返回优化 -- | ||
| 112 | + ut.is_pay_ok(back_url,"/pages/user/order_list/order_list?index=2&tabindex=1",function (){ | ||
| 113 | + if(!th.data.wk_pyed) return false; | ||
| 114 | + getApp().request.promiseGet("/api/weshop/rechargeServicelist/page",{ | ||
| 115 | + data: { store_id: os.stoid, order_id: th.data.order.order_id} | ||
| 116 | + }).then(res=>{ | ||
| 117 | + if(ut.ajax_ok(res)){ | ||
| 118 | + var item=res.data.data.pageData[0]; | ||
| 119 | + if(item.pt_status==4 || item.pt_status==5){ | ||
| 120 | + //支付支付,返回首页 | ||
| 121 | + ut.m_toast('支付成功'); | ||
| 122 | + setTimeout(()=>{ | ||
| 123 | + getApp().re_to(back_url); | ||
| 124 | + },1000) | ||
| 125 | + | ||
| 126 | + }else{ | ||
| 127 | + //支付支付,返回首页 | ||
| 128 | + ut.m_toast('支付失败'); | ||
| 129 | + setTimeout(()=>{ | ||
| 130 | + getApp().re_to("/pages/user/order_list/order_list?index=2&tabindex=1"); | ||
| 131 | + },1000) | ||
| 132 | + } | ||
| 133 | + } | ||
| 134 | + }) | ||
| 135 | + }); | ||
| 136 | + | ||
| 137 | + } | ||
| 138 | + | ||
| 139 | + | ||
| 140 | + | ||
| 141 | + getApp().check_can_share(); | ||
| 102 | if (th.data.isclose == 0) { | 142 | if (th.data.isclose == 0) { |
| 103 | wx.navigateTo({ | 143 | wx.navigateTo({ |
| 104 | url: "/pages/index/index/index" | 144 | url: "/pages/index/index/index" |
| @@ -606,6 +646,7 @@ Page({ | @@ -606,6 +646,7 @@ Page({ | ||
| 606 | return false; | 646 | return false; |
| 607 | } | 647 | } |
| 608 | 648 | ||
| 649 | + th.data.wk_pyed=1; | ||
| 609 | util_pay.pay_data(t,function (){ | 650 | util_pay.pay_data(t,function (){ |
| 610 | var allmoney = th.data.allpice; | 651 | var allmoney = th.data.allpice; |
| 611 | th.jumpPaymentPage(th.data.order.order_id, allmoney); | 652 | th.jumpPaymentPage(th.data.order.order_id, allmoney); |
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
| @@ -128,6 +128,9 @@ Page({ | @@ -128,6 +128,9 @@ Page({ | ||
| 128 | }, | 128 | }, |
| 129 | onLoad: function (t) { | 129 | onLoad: function (t) { |
| 130 | 130 | ||
| 131 | + //定义第一次进入 | ||
| 132 | + this.data.fir_in=1; | ||
| 133 | + | ||
| 131 | // console.log('收到的传参', t); | 134 | // console.log('收到的传参', t); |
| 132 | wx.setNavigationBarTitle({ | 135 | wx.setNavigationBarTitle({ |
| 133 | title: '填写订单', | 136 | title: '填写订单', |
| @@ -654,11 +657,48 @@ Page({ | @@ -654,11 +657,48 @@ Page({ | ||
| 654 | //----------子页返回父页触发---------- | 657 | //----------子页返回父页触发---------- |
| 655 | onShow: function () { | 658 | onShow: function () { |
| 656 | 659 | ||
| 657 | - var fy=ut.fy_back('/pages/user/order_list/order_list',1); | ||
| 658 | - if(fy) return false; | ||
| 659 | - | ||
| 660 | var th = this; | 660 | var th = this; |
| 661 | - util_pay.set_fir(); | 661 | + |
| 662 | + //判断是不是第一次进入 | ||
| 663 | + if(this.data.fir_in){ | ||
| 664 | + this.data.fir_in=0; | ||
| 665 | + }else{ | ||
| 666 | + var fy=ut.fy_back('/pages/user/order_list/order_list',1); | ||
| 667 | + if(fy) return false; | ||
| 668 | + util_pay.set_fir(); | ||
| 669 | + | ||
| 670 | + var back="/packageC/pages/luckyGo/luckyGo_details/luckyGo_details?type=1&ordersn=" + this.data.ok_order_sn + | ||
| 671 | + "&group_id=" + th.data.param.group_id + "&goods_id=" + th.data.param.goods_id + | ||
| 672 | + "&goods_name=" + th.data.bn_goods.goods_name; | ||
| 673 | + | ||
| 674 | + //-- 通联的第三方支付的返回优化 -- | ||
| 675 | + ut.is_pay_ok(back,'/pages/user/order_list/order_list',function (){ | ||
| 676 | + if(!th.data.ok_order_sn) return false; | ||
| 677 | + getApp().request.promiseGet("/api/weshop/order/page", | ||
| 678 | + {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ | ||
| 679 | + if(ut.ajax_ok(res)){ | ||
| 680 | + var item=res.data.data.pageData[0]; | ||
| 681 | + if(item.pay_status==1){ | ||
| 682 | + //支付支付,返回首页 | ||
| 683 | + ut.m_toast('支付成功'); | ||
| 684 | + setTimeout(()=>{ | ||
| 685 | + getApp().re_to(back); | ||
| 686 | + },1000) | ||
| 687 | + | ||
| 688 | + }else{ | ||
| 689 | + //支付支付,返回首页 | ||
| 690 | + ut.m_toast('支付失败'); | ||
| 691 | + setTimeout(()=>{ | ||
| 692 | + getApp().re_to("/pages/user/order_list/order_list"); | ||
| 693 | + },1000) | ||
| 694 | + } | ||
| 695 | + } | ||
| 696 | + }) | ||
| 697 | + }); | ||
| 698 | + | ||
| 699 | + } | ||
| 700 | + | ||
| 701 | + | ||
| 662 | 702 | ||
| 663 | if (th.data.isclose == 0) { | 703 | if (th.data.isclose == 0) { |
| 664 | wx.navigateTo({ | 704 | wx.navigateTo({ |
| @@ -1477,6 +1517,8 @@ Page({ | @@ -1477,6 +1517,8 @@ Page({ | ||
| 1477 | // order_sn: data.data, | 1517 | // order_sn: data.data, |
| 1478 | // type:1, | 1518 | // type:1, |
| 1479 | // }, 1); | 1519 | // }, 1); |
| 1520 | + | ||
| 1521 | + th.data.ok_order_sn=data.data; | ||
| 1480 | util_pay.pay(data.data, function () { | 1522 | util_pay.pay(data.data, function () { |
| 1481 | setTimeout(function () { | 1523 | setTimeout(function () { |
| 1482 | // wx.reLaunch({ | 1524 | // wx.reLaunch({ |
packageC/pages/presell/cart/cart.js
| @@ -147,6 +147,9 @@ Page({ | @@ -147,6 +147,9 @@ Page({ | ||
| 147 | }, | 147 | }, |
| 148 | onLoad: function (t) { | 148 | onLoad: function (t) { |
| 149 | 149 | ||
| 150 | + //定义第一次进入 | ||
| 151 | + this.data.fir_in=1; | ||
| 152 | + | ||
| 150 | if (t.order_id) this.data.order_id = t.order_id; | 153 | if (t.order_id) this.data.order_id = t.order_id; |
| 151 | if (t.order_sn) this.data.order_sn = t.order_sn; | 154 | if (t.order_sn) this.data.order_sn = t.order_sn; |
| 152 | 155 | ||
| @@ -190,17 +193,65 @@ Page({ | @@ -190,17 +193,65 @@ Page({ | ||
| 190 | is_no_by: {}, | 193 | is_no_by: {}, |
| 191 | is_by: {} | 194 | is_by: {} |
| 192 | }) | 195 | }) |
| 196 | + this.data.fir_in=0; | ||
| 193 | }, | 197 | }, |
| 194 | 198 | ||
| 195 | //----------子页返回父页触发---------- | 199 | //----------子页返回父页触发---------- |
| 196 | onShow: function () { | 200 | onShow: function () { |
| 201 | + | ||
| 197 | this.data.paying=0; | 202 | this.data.paying=0; |
| 198 | 203 | ||
| 199 | - var fy= ut.fy_back("/pages/user/order_list/order_list",1); | ||
| 200 | - if(fy) return false; | 204 | + console.log('onshow-2222'); |
| 201 | 205 | ||
| 202 | - util_pay.set_fir(); | ||
| 203 | var th = this; | 206 | var th = this; |
| 207 | + //判断是不是第一次进入 | ||
| 208 | + if(this.data.fir_in){ | ||
| 209 | + this.data.fir_in=0; | ||
| 210 | + }else{ | ||
| 211 | + | ||
| 212 | + console.log('onshow-3333'); | ||
| 213 | + //-- 富友支付的 -- | ||
| 214 | + var fy= ut.fy_back("/pages/user/order_list/order_list",1); | ||
| 215 | + if(fy) return false; | ||
| 216 | + util_pay.set_fir(); | ||
| 217 | + | ||
| 218 | + //-- 通联的第三方支付的返回优化 -- | ||
| 219 | + ut.is_pay_ok("back","back",function (){ | ||
| 220 | + | ||
| 221 | + console.log('onshow-444'); | ||
| 222 | + console.log(th.data.ok_order_sn); | ||
| 223 | + | ||
| 224 | + if(!th.data.ok_order_sn) return false; | ||
| 225 | + getApp().request.promiseGet("/api/weshop/order/page", | ||
| 226 | + {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ | ||
| 227 | + if(ut.ajax_ok(res)){ | ||
| 228 | + | ||
| 229 | + console.log('onshow-444'); | ||
| 230 | + console.log(res); | ||
| 231 | + | ||
| 232 | + var item=res.data.data.pageData[0]; | ||
| 233 | + if(item.pay_status==1){ | ||
| 234 | + //支付支付,返回首页 | ||
| 235 | + ut.m_toast('支付成功'); | ||
| 236 | + setTimeout(()=>{ | ||
| 237 | + wx.navigateBack(); | ||
| 238 | + },1000) | ||
| 239 | + | ||
| 240 | + }else{ | ||
| 241 | + //支付支付,返回首页 | ||
| 242 | + ut.m_toast('支付失败'); | ||
| 243 | + setTimeout(()=>{ | ||
| 244 | + wx.navigateBack(); | ||
| 245 | + },1000) | ||
| 246 | + } | ||
| 247 | + } | ||
| 248 | + }) | ||
| 249 | + }); | ||
| 250 | + | ||
| 251 | + } | ||
| 252 | + | ||
| 253 | + | ||
| 254 | + | ||
| 204 | th.setData({ show_submit: 0 }); //让提交先掩藏 | 255 | th.setData({ show_submit: 0 }); //让提交先掩藏 |
| 205 | th.data.g_cart_q_time = null; | 256 | th.data.g_cart_q_time = null; |
| 206 | if (th.data.isclose == 0) { | 257 | if (th.data.isclose == 0) { |
| @@ -2519,6 +2570,9 @@ Page({ | @@ -2519,6 +2570,9 @@ Page({ | ||
| 2519 | return false; | 2570 | return false; |
| 2520 | } | 2571 | } |
| 2521 | 2572 | ||
| 2573 | + //-- 订单OK -- | ||
| 2574 | + th.data.ok_order_sn=th.data.order.order_sn; | ||
| 2575 | + | ||
| 2522 | util_pay.pay_data(t,function (){ | 2576 | util_pay.pay_data(t,function (){ |
| 2523 | //---用余额支付--- | 2577 | //---用余额支付--- |
| 2524 | getApp().my_warnning("支付成功", 1, th); | 2578 | getApp().my_warnning("支付成功", 1, th); |
| @@ -2981,6 +3035,8 @@ Page({ | @@ -2981,6 +3035,8 @@ Page({ | ||
| 2981 | type: 1 //正常单 | 3035 | type: 1 //正常单 |
| 2982 | }, 1);--*/ | 3036 | }, 1);--*/ |
| 2983 | 3037 | ||
| 3038 | + | ||
| 3039 | + th.data.ok_order_sn=this.data.order.order_sn; | ||
| 2984 | util_pay.pay(this.data.order.order_sn, function () { | 3040 | util_pay.pay(this.data.order.order_sn, function () { |
| 2985 | wx.showToast({ title: '支付成功' }) | 3041 | wx.showToast({ title: '支付成功' }) |
| 2986 | wx.navigateBack(); | 3042 | wx.navigateBack(); |
packageC/pages/presell/cart/cart2.js
| @@ -157,6 +157,10 @@ Page({ | @@ -157,6 +157,10 @@ Page({ | ||
| 157 | }) | 157 | }) |
| 158 | }, | 158 | }, |
| 159 | onLoad: function (t) { | 159 | onLoad: function (t) { |
| 160 | + | ||
| 161 | + //定义第一次进入 | ||
| 162 | + this.data.fir_in=1; | ||
| 163 | + | ||
| 160 | wx.setNavigationBarTitle({ title: "填写订单", }) | 164 | wx.setNavigationBarTitle({ title: "填写订单", }) |
| 161 | var th = this; | 165 | var th = this; |
| 162 | 166 | ||
| @@ -191,19 +195,51 @@ Page({ | @@ -191,19 +195,51 @@ Page({ | ||
| 191 | //----------子页返回父页触发---------- | 195 | //----------子页返回父页触发---------- |
| 192 | onShow: function () { | 196 | onShow: function () { |
| 193 | var th = this; | 197 | var th = this; |
| 194 | - var fy= ut.fy_back('',0,function (){ | ||
| 195 | - var cps = getCurrentPages(); | ||
| 196 | - if (cps.length > 1) { | ||
| 197 | - wx.navigateBack({ delta: 1 }) | ||
| 198 | - } else { | ||
| 199 | - getApp().goto("/pages/index/index/index"); | ||
| 200 | - } | 198 | + //判断是不是第一次进入 |
| 199 | + if(this.data.fir_in){ | ||
| 200 | + this.data.fir_in=0; | ||
| 201 | + }else{ | ||
| 202 | + //富友支付插件 | ||
| 203 | + var fy= ut.fy_back('',0,function (){ | ||
| 204 | + var cps = getCurrentPages(); | ||
| 205 | + if (cps.length > 1) { | ||
| 206 | + wx.navigateBack({ delta: 1 }) | ||
| 207 | + } else { | ||
| 208 | + getApp().goto("/pages/index/index/index"); | ||
| 209 | + } | ||
| 201 | 210 | ||
| 202 | - }) | ||
| 203 | - if(fy) return false; | 211 | + }) |
| 212 | + if(fy) return false; | ||
| 213 | + util_pay.set_fir(); | ||
| 214 | + | ||
| 215 | + //-- 通联的第三方支付的返回优化 -- | ||
| 216 | + ut.is_pay_ok("/pages/payment/pay_success/pay_success?type=2&order_sn=" + this.data.ok_order_sn, | ||
| 217 | + "/pages/user/order_list/order_list",function (){ | ||
| 218 | + if(!th.data.ok_order_sn) return false; | ||
| 219 | + getApp().request.promiseGet("/api/weshop/order/page", | ||
| 220 | + {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ | ||
| 221 | + if(ut.ajax_ok(res)){ | ||
| 222 | + var item=res.data.data.pageData[0]; | ||
| 223 | + if(item.pay_status==1){ | ||
| 224 | + //支付支付,返回首页 | ||
| 225 | + ut.m_toast('支付成功'); | ||
| 226 | + setTimeout(()=>{ | ||
| 227 | + getApp().re_to("/pages/payment/pay_success/pay_success?type=2&order_sn=" + th.data.ok_order_sn); | ||
| 228 | + },1000) | ||
| 229 | + | ||
| 230 | + }else{ | ||
| 231 | + //支付支付,返回首页 | ||
| 232 | + ut.m_toast('支付失败'); | ||
| 233 | + setTimeout(()=>{ | ||
| 234 | + getApp().goto("/pages/index/index/index"); | ||
| 235 | + },1000) | ||
| 236 | + } | ||
| 237 | + } | ||
| 238 | + }) | ||
| 239 | + }); | ||
| 240 | + } | ||
| 204 | 241 | ||
| 205 | 242 | ||
| 206 | - util_pay.set_fir(); | ||
| 207 | th.data.g_cart_q_time = null; | 243 | th.data.g_cart_q_time = null; |
| 208 | if (th.data.isclose == 0) { | 244 | if (th.data.isclose == 0) { |
| 209 | wx.navigateTo({ | 245 | wx.navigateTo({ |
| @@ -1667,6 +1703,8 @@ Page({ | @@ -1667,6 +1703,8 @@ Page({ | ||
| 1667 | //void e.jumpToCart4({ | 1703 | //void e.jumpToCart4({ |
| 1668 | // order_sn: data.data, | 1704 | // order_sn: data.data, |
| 1669 | //}, 1); | 1705 | //}, 1); |
| 1706 | + th.data.ok_order_sn=data.data; | ||
| 1707 | + | ||
| 1670 | util_pay.pay(data.data, function () { | 1708 | util_pay.pay(data.data, function () { |
| 1671 | //app.my_warnning("支付成功",1,th); | 1709 | //app.my_warnning("支付成功",1,th); |
| 1672 | //setTimeout(function () { | 1710 | //setTimeout(function () { |
packageC/pages/presell/cart/cart2_pre.js
| @@ -78,6 +78,9 @@ Page({ | @@ -78,6 +78,9 @@ Page({ | ||
| 78 | }) | 78 | }) |
| 79 | }, | 79 | }, |
| 80 | onLoad: function (t) { | 80 | onLoad: function (t) { |
| 81 | + //定义第一次进入 | ||
| 82 | + this.data.fir_in=1; | ||
| 83 | + | ||
| 81 | wx.setNavigationBarTitle({ | 84 | wx.setNavigationBarTitle({ |
| 82 | title: "填写订单", | 85 | title: "填写订单", |
| 83 | }); | 86 | }); |
| @@ -280,9 +283,42 @@ Page({ | @@ -280,9 +283,42 @@ Page({ | ||
| 280 | 283 | ||
| 281 | var fy=ut.fy_back("/pages/user/order_list/order_list",1); | 284 | var fy=ut.fy_back("/pages/user/order_list/order_list",1); |
| 282 | if(fy) return false; | 285 | if(fy) return false; |
| 283 | - | ||
| 284 | util_pay.set_fir(); | 286 | util_pay.set_fir(); |
| 285 | var th = this; | 287 | var th = this; |
| 288 | + //判断是不是第一次进入 | ||
| 289 | + if(this.data.fir_in){ | ||
| 290 | + this.data.fir_in=0; | ||
| 291 | + }else{ | ||
| 292 | + | ||
| 293 | + //-- 支付完成后的跳转的时间 -- | ||
| 294 | + var ok_url = "/packageC/pages/presell/cart/cart?order_sn=" +this.data.ok_order_sn; | ||
| 295 | + var err_url="/pages/user/order_list/order_list"; | ||
| 296 | + //-- 通联的第三方支付的返回优化 -- | ||
| 297 | + ut.is_pay_ok(ok_url,err_url,function (){ | ||
| 298 | + if(!th.data.ok_order_sn) return false; | ||
| 299 | + getApp().request.promiseGet("/api/weshop/order/page", | ||
| 300 | + {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ | ||
| 301 | + if(ut.ajax_ok(res)){ | ||
| 302 | + var item=res.data.data.pageData[0]; | ||
| 303 | + if(item.pay_time){ | ||
| 304 | + //支付支付,返回首页 | ||
| 305 | + ut.m_toast('支付成功'); | ||
| 306 | + setTimeout(()=>{ | ||
| 307 | + getApp().re_to(ok_url); | ||
| 308 | + },1000) | ||
| 309 | + | ||
| 310 | + }else{ | ||
| 311 | + //支付支付,返回首页 | ||
| 312 | + ut.m_toast('支付失败'); | ||
| 313 | + setTimeout(()=>{ | ||
| 314 | + getApp().re_to(err_url); | ||
| 315 | + },1000) | ||
| 316 | + } | ||
| 317 | + } | ||
| 318 | + }) | ||
| 319 | + }); | ||
| 320 | + } | ||
| 321 | + | ||
| 286 | if (th.data.isclose == 0) { | 322 | if (th.data.isclose == 0) { |
| 287 | wx.navigateTo({ | 323 | wx.navigateTo({ |
| 288 | url: "/pages/index/index/index" | 324 | url: "/pages/index/index/index" |
| @@ -918,6 +954,8 @@ Page({ | @@ -918,6 +954,8 @@ Page({ | ||
| 918 | //要进行判断,如果是用微信支付,就要跳转到支付界面 | 954 | //要进行判断,如果是用微信支付,就要跳转到支付界面 |
| 919 | if (order_amount && parseFloat(order_amount) > 0) { | 955 | if (order_amount && parseFloat(order_amount) > 0) { |
| 920 | th.setData({ isclose: 0 }); | 956 | th.setData({ isclose: 0 }); |
| 957 | + | ||
| 958 | + th.data.ok_order_sn=data.data; | ||
| 921 | util_pay.pay(data.data, function () { | 959 | util_pay.pay(data.data, function () { |
| 922 | var url = "/packageC/pages/presell/cart/cart?order_sn=" + data.data; | 960 | var url = "/packageC/pages/presell/cart/cart?order_sn=" + data.data; |
| 923 | setTimeout(function () { | 961 | setTimeout(function () { |
packageD/pages/user/deposit/prepaid/msg/msg.js
packageD/pages/user/deposit/prepaid/prepaid.js
| @@ -15,6 +15,10 @@ Page({ | @@ -15,6 +15,10 @@ Page({ | ||
| 15 | perpaid: [], //数据, | 15 | perpaid: [], //数据, |
| 16 | paying:0 | 16 | paying:0 |
| 17 | }, | 17 | }, |
| 18 | + onLoad:function (){ | ||
| 19 | + //定义第一次进入 | ||
| 20 | + this.data.fir_in=1; | ||
| 21 | + }, | ||
| 18 | /* 生命周期函数--监听页面初次渲染完成*/ | 22 | /* 生命周期函数--监听页面初次渲染完成*/ |
| 19 | onReady: function() { | 23 | onReady: function() { |
| 20 | var th=this; | 24 | var th=this; |
| @@ -96,19 +100,49 @@ Page({ | @@ -96,19 +100,49 @@ Page({ | ||
| 96 | */ | 100 | */ |
| 97 | onShow: function () { | 101 | onShow: function () { |
| 98 | 102 | ||
| 103 | + var th=this; | ||
| 104 | + //判断是不是第一次进入 | ||
| 105 | + if(this.data.fir_in){ | ||
| 106 | + this.data.fir_in=0; | ||
| 107 | + }else{ | ||
| 108 | + //-- 富友插件 -- | ||
| 109 | + ut.fy_back('',0) | ||
| 110 | + t_pay.set_fir(); | ||
| 111 | + | ||
| 112 | + //-- 通联的第三方支付的返回优化 -- | ||
| 113 | + ut.is_pay_ok("/packageD/pages/user/deposit/prepaid/msg/msg","none",function (){ | ||
| 114 | + if(!th.data.ok_order_sn) return false; | ||
| 115 | + var ck_url="/api/weshop/recharge/get/"+os.stoid+"/"+th.data.ok_order_sn; | ||
| 116 | + getApp().request.promiseGet(ck_url,{}).then(res=>{ | ||
| 117 | + if(res.data.code==0 && res.data.data){ | ||
| 118 | + var item=res.data.data; | ||
| 119 | + if(item.pay_status==1){ | ||
| 120 | + //支付支付,返回首页 | ||
| 121 | + ut.m_toast('支付成功'); | ||
| 122 | + setTimeout(()=>{ | ||
| 123 | + getApp().re_to("/packageD/pages/user/deposit/prepaid/msg/msg"); | ||
| 124 | + },1000) | ||
| 99 | 125 | ||
| 126 | + }else{ | ||
| 127 | + //支付支付,返回首页 | ||
| 128 | + ut.m_toast('支付失败'); | ||
| 129 | + | ||
| 130 | + } | ||
| 131 | + } | ||
| 132 | + }) | ||
| 133 | + }); | ||
| 134 | + } | ||
| 100 | 135 | ||
| 101 | wx.setNavigationBarTitle({ | 136 | wx.setNavigationBarTitle({ |
| 102 | title: "流动资金转预存", | 137 | title: "流动资金转预存", |
| 103 | }) | 138 | }) |
| 104 | 139 | ||
| 105 | this.data.paying=0; | 140 | this.data.paying=0; |
| 106 | - ut.fy_back('',0) | ||
| 107 | - t_pay.set_fir(); | ||
| 108 | 141 | ||
| 109 | - if(getApp().globalData.user_id && !this.data.is_get){ | ||
| 110 | - this.yuck(); | ||
| 111 | - } | 142 | + |
| 143 | + if(getApp().globalData.user_id && !this.data.is_get){ | ||
| 144 | + this.yuck(); | ||
| 145 | + } | ||
| 112 | 146 | ||
| 113 | }, | 147 | }, |
| 114 | //确定充值 | 148 | //确定充值 |
| @@ -170,6 +204,8 @@ Page({ | @@ -170,6 +204,8 @@ Page({ | ||
| 170 | var parentSn = msg.order_sn; | 204 | var parentSn = msg.order_sn; |
| 171 | var store_id = os.stoid; | 205 | var store_id = os.stoid; |
| 172 | t_pay.set_pay_url("/api/weshop/order/pay/createRechargeOrder"); | 206 | t_pay.set_pay_url("/api/weshop/order/pay/createRechargeOrder"); |
| 207 | + | ||
| 208 | + e.data.ok_order_sn=parentSn; | ||
| 173 | t_pay.pay({ | 209 | t_pay.pay({ |
| 174 | parentSn: parentSn, | 210 | parentSn: parentSn, |
| 175 | store_id: store_id | 211 | store_id: store_id |
packageD/pages/user/integral/integral.js
| @@ -208,6 +208,9 @@ Page({ | @@ -208,6 +208,9 @@ Page({ | ||
| 208 | */ | 208 | */ |
| 209 | onLoad: function (options) { | 209 | onLoad: function (options) { |
| 210 | 210 | ||
| 211 | + //定义第一次进入 | ||
| 212 | + this.data.fir_in=1; | ||
| 213 | + | ||
| 211 | var th=this; | 214 | var th=this; |
| 212 | getApp().request.get("/api/wx/weappSendlist/page", { | 215 | getApp().request.get("/api/wx/weappSendlist/page", { |
| 213 | data: { | 216 | data: { |
| @@ -258,6 +261,8 @@ Page({ | @@ -258,6 +261,8 @@ Page({ | ||
| 258 | var store_id = os.stoid; | 261 | var store_id = os.stoid; |
| 259 | 262 | ||
| 260 | t_pay.set_pay_url("/api/weshop/order/pay/createRechargeOrder"); | 263 | t_pay.set_pay_url("/api/weshop/order/pay/createRechargeOrder"); |
| 264 | + | ||
| 265 | + th.data.ok_order_sn=parentSn; | ||
| 261 | t_pay.pay({ | 266 | t_pay.pay({ |
| 262 | parentSn: parentSn, | 267 | parentSn: parentSn, |
| 263 | store_id: store_id | 268 | store_id: store_id |
| @@ -290,10 +295,8 @@ Page({ | @@ -290,10 +295,8 @@ Page({ | ||
| 290 | // }) | 295 | // }) |
| 291 | }) | 296 | }) |
| 292 | }) | 297 | }) |
| 293 | - | ||
| 294 | - | ||
| 295 | - | ||
| 296 | - }, | 298 | + |
| 299 | + }, | ||
| 297 | //------支付成功页面-------- | 300 | //------支付成功页面-------- |
| 298 | jumpPaymentPage: function () { | 301 | jumpPaymentPage: function () { |
| 299 | console.log("支付成功页面2333"); | 302 | console.log("支付成功页面2333"); |
| @@ -331,9 +334,44 @@ Page({ | @@ -331,9 +334,44 @@ Page({ | ||
| 331 | */ | 334 | */ |
| 332 | onShow: function () { | 335 | onShow: function () { |
| 333 | 336 | ||
| 334 | - ut.fy_back('',0); | 337 | + |
| 338 | + var th=this; | ||
| 339 | + //判断是不是第一次进入 | ||
| 340 | + if(this.data.fir_in){ | ||
| 341 | + this.data.fir_in=0; | ||
| 342 | + }else{ | ||
| 343 | + //-- 富友的插件 -- | ||
| 344 | + ut.fy_back('',0); | ||
| 345 | + t_pay.set_fir(); | ||
| 346 | + | ||
| 347 | + //-- 通联的第三方支付的返回优化 -- | ||
| 348 | + ut.is_pay_ok("/packageD/pages/user/integral/msg/msg",'none',function (){ | ||
| 349 | + | ||
| 350 | + console.log('show--11') | ||
| 351 | + console.log(th.data.ok_order_sn); | ||
| 352 | + | ||
| 353 | + if(!th.data.ok_order_sn) return false; | ||
| 354 | + var ck_url="/api/weshop/recharge/get/"+os.stoid+"/"+th.data.ok_order_sn; | ||
| 355 | + getApp().request.promiseGet(ck_url,{}).then(res=>{ | ||
| 356 | + if(res.data.code==0 && res.data.data){ | ||
| 357 | + var item=res.data.data; | ||
| 358 | + if(item.pay_status==1){ | ||
| 359 | + //支付支付,返回首页 | ||
| 360 | + ut.m_toast('支付成功'); | ||
| 361 | + setTimeout(()=>{ | ||
| 362 | + getApp().re_to("/packageD/pages/user/integral/msg/msg"); | ||
| 363 | + },1000) | ||
| 364 | + | ||
| 365 | + }else{ | ||
| 366 | + //支付支付,返回首页 | ||
| 367 | + ut.m_toast('支付失败'); | ||
| 368 | + } | ||
| 369 | + } | ||
| 370 | + }) | ||
| 371 | + }); | ||
| 372 | + } | ||
| 373 | + | ||
| 335 | this.data.paying=0; | 374 | this.data.paying=0; |
| 336 | - t_pay.set_fir(); | ||
| 337 | getApp().check_can_share(); | 375 | getApp().check_can_share(); |
| 338 | //--先判断会员状态-- | 376 | //--先判断会员状态-- |
| 339 | var user_info = getApp().globalData.userInfo; | 377 | var user_info = getApp().globalData.userInfo; |
packageD/pages/user/integral/msg/msg.js
packageE/pages/cart/cart2/cart2.js
| @@ -196,6 +196,8 @@ Page({ | @@ -196,6 +196,8 @@ Page({ | ||
| 196 | 196 | ||
| 197 | onLoad: function (t) { | 197 | onLoad: function (t) { |
| 198 | 198 | ||
| 199 | + this.data.fir_in=1; | ||
| 200 | + | ||
| 199 | wx.setNavigationBarTitle({ title: "填写订单", }) | 201 | wx.setNavigationBarTitle({ title: "填写订单", }) |
| 200 | var th = this; | 202 | var th = this; |
| 201 | this.setData({ is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow, }); | 203 | this.setData({ is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow, }); |
| @@ -271,15 +273,47 @@ Page({ | @@ -271,15 +273,47 @@ Page({ | ||
| 271 | //----------子页返回父页触发---------- | 273 | //----------子页返回父页触发---------- |
| 272 | onShow: function () { | 274 | onShow: function () { |
| 273 | 275 | ||
| 274 | - //富友支付取消支付强行回去 | ||
| 275 | - var fy=ut.fy_back("/pages/user/order_list/order_list",1); | ||
| 276 | - if(fy) return false; | ||
| 277 | - | ||
| 278 | - util_pay.set_fir(); | ||
| 279 | 276 | ||
| 280 | var th = this; | 277 | var th = this; |
| 281 | - th.data.g_cart_q_time = null; | 278 | + //判断是不是第一次进入 |
| 279 | + if(this.data.fir_in){ | ||
| 280 | + this.data.fir_in=0; | ||
| 281 | + }else{ | ||
| 282 | + //富友支付取消支付强行回去 | ||
| 283 | + var fy=ut.fy_back("/pages/user/order_list/order_list",1); | ||
| 284 | + if(fy) return false; | ||
| 285 | + util_pay.set_fir(); | ||
| 286 | + | ||
| 287 | + //-- 通联的第三方支付的返回优化 -- | ||
| 288 | + ut.is_pay_ok("/pages/payment/pay_success/pay_success?type=2&order_sn=" + this.data.ok_order_sn, | ||
| 289 | + "/pages/user/order_list/order_list",function (){ | ||
| 290 | + //支付信息会先记录着 | ||
| 291 | + if(!th.data.ok_order_sn) return false; | ||
| 292 | + getApp().request.promiseGet("/api/weshop/order/page", | ||
| 293 | + {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ | ||
| 294 | + if(ut.ajax_ok(res)){ | ||
| 295 | + var item=res.data.data.pageData[0]; | ||
| 296 | + if(item.pay_status==1){ | ||
| 297 | + //支付支付,返回首页 | ||
| 298 | + ut.m_toast('支付成功'); | ||
| 299 | + setTimeout(()=>{ | ||
| 300 | + getApp().re_to("/pages/payment/pay_success/pay_success?type=2&order_sn=" + th.data.ok_order_sn); | ||
| 301 | + },1000) | ||
| 282 | 302 | ||
| 303 | + }else{ | ||
| 304 | + //支付支付,返回首页 | ||
| 305 | + ut.m_toast('支付失败'); | ||
| 306 | + setTimeout(()=>{ | ||
| 307 | + getApp().goto("/pages/index/index/index"); | ||
| 308 | + },1000) | ||
| 309 | + } | ||
| 310 | + } | ||
| 311 | + }) | ||
| 312 | + }); | ||
| 313 | + } | ||
| 314 | + | ||
| 315 | + | ||
| 316 | + th.data.g_cart_q_time = null; | ||
| 283 | if (th.data.isclose == 0) { | 317 | if (th.data.isclose == 0) { |
| 284 | wx.navigateTo({ | 318 | wx.navigateTo({ |
| 285 | url: "/pages/index/index/index" | 319 | url: "/pages/index/index/index" |
| @@ -5183,8 +5217,7 @@ Page({ | @@ -5183,8 +5217,7 @@ Page({ | ||
| 5183 | // order_sn: data.data, | 5217 | // order_sn: data.data, |
| 5184 | //}, 1); | 5218 | //}, 1); |
| 5185 | 5219 | ||
| 5186 | - | ||
| 5187 | - | 5220 | + th.data.ok_order_sn=data.data; |
| 5188 | util_pay.pay(data.data, async function () { | 5221 | util_pay.pay(data.data, async function () { |
| 5189 | //app.my_warnning("支付成功",1,th); | 5222 | //app.my_warnning("支付成功",1,th); |
| 5190 | //setTimeout(function () { | 5223 | //setTimeout(function () { |
packageE/pages/cart/cart2_inte/cart2_inte.js
| @@ -110,6 +110,8 @@ Page({ | @@ -110,6 +110,8 @@ Page({ | ||
| 110 | }) | 110 | }) |
| 111 | }, | 111 | }, |
| 112 | onLoad: function (t) { | 112 | onLoad: function (t) { |
| 113 | + | ||
| 114 | + this.data.fir_in=1; | ||
| 113 | wx.setNavigationBarTitle({ title: "填写订单", }) | 115 | wx.setNavigationBarTitle({ title: "填写订单", }) |
| 114 | var th = this; | 116 | var th = this; |
| 115 | th.data.param = t; | 117 | th.data.param = t; |
| @@ -204,20 +206,52 @@ Page({ | @@ -204,20 +206,52 @@ Page({ | ||
| 204 | //----------子页返回父页触发---------- | 206 | //----------子页返回父页触发---------- |
| 205 | onShow: function () { | 207 | onShow: function () { |
| 206 | 208 | ||
| 207 | - var fy=ut.fy_back('',1,function (){ | ||
| 208 | - var cps = getCurrentPages(); | ||
| 209 | - if (cps.length > 1) { | ||
| 210 | - wx.navigateBack({ delta: 1 }) | ||
| 211 | - } else { | ||
| 212 | - getApp().goto("/pages/index/index/index"); | ||
| 213 | - } | ||
| 214 | - }); | ||
| 215 | 209 | ||
| 216 | - if(fy) return false; | 210 | + var th = this; |
| 211 | + //判断是不是第一次进入 | ||
| 212 | + if(this.data.fir_in){ | ||
| 213 | + this.data.fir_in=0; | ||
| 214 | + }else{ | ||
| 215 | + //-- 富有的支付插件 -- | ||
| 216 | + var fy=ut.fy_back('',1,function (){ | ||
| 217 | + var cps = getCurrentPages(); | ||
| 218 | + if (cps.length > 1) { | ||
| 219 | + wx.navigateBack({ delta: 1 }) | ||
| 220 | + } else { | ||
| 221 | + getApp().goto("/pages/index/index/index"); | ||
| 222 | + } | ||
| 223 | + }); | ||
| 224 | + if(fy) return false; | ||
| 225 | + util_pay.set_fir(); | ||
| 226 | + | ||
| 227 | + //-- 通联的第三方支付的返回优化 -- | ||
| 228 | + ut.is_pay_ok("/pages/payment/pay_success/pay_success?type=2&order_sn=" + th.data.ok_order_sn, | ||
| 229 | + "/pages/user/order_list/order_list",function (){ | ||
| 230 | + if(!th.data.ok_order_sn) return false; | ||
| 231 | + getApp().request.promiseGet("/api/weshop/order/page", | ||
| 232 | + {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ | ||
| 233 | + if(ut.ajax_ok(res)){ | ||
| 234 | + var item=res.data.data.pageData[0]; | ||
| 235 | + if(item.pay_status==1){ | ||
| 236 | + //支付支付,返回首页 | ||
| 237 | + ut.m_toast('支付成功'); | ||
| 238 | + setTimeout(()=>{ | ||
| 239 | + getApp().re_to("/pages/payment/pay_success/pay_success?type=2&order_sn=" + th.data.ok_order_sn); | ||
| 240 | + },1000) | ||
| 241 | + | ||
| 242 | + }else{ | ||
| 243 | + //支付支付,返回首页 | ||
| 244 | + ut.m_toast('支付失败'); | ||
| 245 | + setTimeout(()=>{ | ||
| 246 | + getApp().goto("/pages/index/index/index"); | ||
| 247 | + },1000) | ||
| 248 | + } | ||
| 249 | + } | ||
| 250 | + }) | ||
| 251 | + }); | ||
| 252 | + } | ||
| 217 | 253 | ||
| 218 | - util_pay.set_fir(); | ||
| 219 | 254 | ||
| 220 | - var th = this; | ||
| 221 | th.data.g_cart_q_time = null; | 255 | th.data.g_cart_q_time = null; |
| 222 | 256 | ||
| 223 | if (th.data.isclose == 0) { | 257 | if (th.data.isclose == 0) { |
| @@ -1330,6 +1364,8 @@ Page({ | @@ -1330,6 +1364,8 @@ Page({ | ||
| 1330 | //void e.jumpToCart4({ | 1364 | //void e.jumpToCart4({ |
| 1331 | // order_sn: data.data, | 1365 | // order_sn: data.data, |
| 1332 | //}, 1); | 1366 | //}, 1); |
| 1367 | + | ||
| 1368 | + th.data.ok_order_sn=data.data; | ||
| 1333 | util_pay.pay(data.data, function () { | 1369 | util_pay.pay(data.data, function () { |
| 1334 | //app.my_warnning("支付成功",1,th); | 1370 | //app.my_warnning("支付成功",1,th); |
| 1335 | //setTimeout(function () { | 1371 | //setTimeout(function () { |
packageE/pages/cart/cart2_pt/cart2_pt.js
| @@ -585,7 +585,8 @@ Page({ | @@ -585,7 +585,8 @@ Page({ | ||
| 585 | if(fy) return false; | 585 | if(fy) return false; |
| 586 | util_pay.set_fir(); | 586 | util_pay.set_fir(); |
| 587 | //-- 通联的第三方支付的返回优化 -- | 587 | //-- 通联的第三方支付的返回优化 -- |
| 588 | - ut.is_pay_ok("/pages/team/team_success/team_success?ordersn=" + th.data.ok_order_sn,null,function (){ | 588 | + ut.is_pay_ok("/pages/team/team_success/team_success?ordersn=" + th.data.ok_order_sn, |
| 589 | + "/pages/user/order_list/order_list",function (){ | ||
| 589 | if(!th.data.ok_order_sn) return false; | 590 | if(!th.data.ok_order_sn) return false; |
| 590 | getApp().request.promiseGet("/api/weshop/order/page", | 591 | getApp().request.promiseGet("/api/weshop/order/page", |
| 591 | {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ | 592 | {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ |
packageE/pages/user/cardinfo/cardinfo.js
| @@ -50,6 +50,9 @@ Page({ | @@ -50,6 +50,9 @@ Page({ | ||
| 50 | */ | 50 | */ |
| 51 | onLoad: function (options) { | 51 | onLoad: function (options) { |
| 52 | 52 | ||
| 53 | + //定义第一次进入 | ||
| 54 | + this.data.fir_in=1; | ||
| 55 | + | ||
| 53 | //--先判断会员状态-- | 56 | //--先判断会员状态-- |
| 54 | var user_info = getApp().globalData.userInfo; | 57 | var user_info = getApp().globalData.userInfo; |
| 55 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | 58 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| @@ -683,8 +686,53 @@ Page({ | @@ -683,8 +686,53 @@ Page({ | ||
| 683 | */ | 686 | */ |
| 684 | onShow: function () { | 687 | onShow: function () { |
| 685 | this.data.paying=0; | 688 | this.data.paying=0; |
| 686 | - ut.fy_back('',0); | ||
| 687 | - t_pay.set_fir(); | 689 | + var th=this; |
| 690 | + //判断是不是第一次进入 | ||
| 691 | + if(this.data.fir_in){ | ||
| 692 | + this.data.fir_in=0; | ||
| 693 | + }else{ | ||
| 694 | + //-- 富友支付插件的优化 -- | ||
| 695 | + ut.fy_back('',0); | ||
| 696 | + t_pay.set_fir(); | ||
| 697 | + | ||
| 698 | + //-- 通联的第三方支付的返回优化 -- | ||
| 699 | + ut.is_pay_ok("func",'none',function (){ | ||
| 700 | + | ||
| 701 | + console.log('1111'); | ||
| 702 | + console.log(th.data.ok_order_sn); | ||
| 703 | + | ||
| 704 | + if(!th.data.ok_order_sn) return false; | ||
| 705 | + | ||
| 706 | + var ck_url="/api/weshop/recharge/get/"+os.stoid+"/"+th.data.ok_order_sn; | ||
| 707 | + getApp().request.promiseGet(ck_url,{}).then(res=>{ | ||
| 708 | + if(res.data.code==0 && res.data.data){ | ||
| 709 | + | ||
| 710 | + var item=res.data.data; | ||
| 711 | + | ||
| 712 | + console.log('222'); | ||
| 713 | + console.log(item); | ||
| 714 | + | ||
| 715 | + if(item.pay_status==1){ | ||
| 716 | + //支付支付,返回首页 | ||
| 717 | + th.success(); //支付成功提示 | ||
| 718 | + }else{ | ||
| 719 | + //支付支付,返回首页 | ||
| 720 | + ut.m_toast('支付失败'); | ||
| 721 | + } | ||
| 722 | + } | ||
| 723 | + }) | ||
| 724 | + }, | ||
| 725 | + //支付成功后的提示 | ||
| 726 | + function (){ | ||
| 727 | + | ||
| 728 | + console.log('2222'); | ||
| 729 | + console.log(th.data.ok_order_sn); | ||
| 730 | + | ||
| 731 | + th.success(); //支付成功提示 | ||
| 732 | + }); | ||
| 733 | + } | ||
| 734 | + | ||
| 735 | + | ||
| 688 | //同步初始化 | 736 | //同步初始化 |
| 689 | this.init(); | 737 | this.init(); |
| 690 | 738 | ||
| @@ -748,10 +796,7 @@ Page({ | @@ -748,10 +796,7 @@ Page({ | ||
| 748 | 796 | ||
| 749 | //-----立即续费的功能------ | 797 | //-----立即续费的功能------ |
| 750 | xufei:async function(){ | 798 | xufei:async function(){ |
| 751 | - | ||
| 752 | - | ||
| 753 | - | ||
| 754 | - var th = this,is_card = 0,end_time=0; | 799 | + var th = this,is_card = 0,end_time=0; |
| 755 | await getApp().request.promiseGet("/store/storemoduleendtime/page?store_id="+os.stoid+"&type=3", | 800 | await getApp().request.promiseGet("/store/storemoduleendtime/page?store_id="+os.stoid+"&type=3", |
| 756 | {1:1}).then(res => { | 801 | {1:1}).then(res => { |
| 757 | if (ut.ajax_ok(res)) { | 802 | if (ut.ajax_ok(res)) { |
| @@ -789,7 +834,6 @@ Page({ | @@ -789,7 +834,6 @@ Page({ | ||
| 789 | if(this.data.paying) return false; | 834 | if(this.data.paying) return false; |
| 790 | this.data.paying=1; | 835 | this.data.paying=1; |
| 791 | 836 | ||
| 792 | - | ||
| 793 | var item = th.data.user_card; | 837 | var item = th.data.user_card; |
| 794 | var req = {}; | 838 | var req = {}; |
| 795 | req.cardId = item.CardId; | 839 | req.cardId = item.CardId; |
| @@ -801,7 +845,7 @@ Page({ | @@ -801,7 +845,7 @@ Page({ | ||
| 801 | t_pay.pay(req, th.success, function (e) { | 845 | t_pay.pay(req, th.success, function (e) { |
| 802 | th.data.paying=0; | 846 | th.data.paying=0; |
| 803 | getApp().my_warnning("支付失败", 0, th); | 847 | getApp().my_warnning("支付失败", 0, th); |
| 804 | - }); | 848 | + },th); |
| 805 | 849 | ||
| 806 | }, | 850 | }, |
| 807 | 851 | ||
| @@ -872,7 +916,7 @@ Page({ | @@ -872,7 +916,7 @@ Page({ | ||
| 872 | t_pay.pay(req, th.success, function () { | 916 | t_pay.pay(req, th.success, function () { |
| 873 | th.data.paying=0; | 917 | th.data.paying=0; |
| 874 | getApp().my_warnning("支付失败", 0, th); | 918 | getApp().my_warnning("支付失败", 0, th); |
| 875 | - }); | 919 | + },th); |
| 876 | }, | 920 | }, |
| 877 | //显示弹出框 | 921 | //显示弹出框 |
| 878 | show_change:function () { this.setData({is_show_change_pop:1}); }, | 922 | show_change:function () { this.setData({is_show_change_pop:1}); }, |
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js
| 1 | var i = require("../../../../../utils/util.js"); | 1 | var i = require("../../../../../utils/util.js"); |
| 2 | +var ut=i; | ||
| 2 | var com = require("../public/buy_com.js"); | 3 | var com = require("../public/buy_com.js"); |
| 3 | var e = getApp(), | 4 | var e = getApp(), |
| 4 | a = e.globalData.setting, | 5 | a = e.globalData.setting, |
| @@ -74,6 +75,9 @@ Page({ | @@ -74,6 +75,9 @@ Page({ | ||
| 74 | onLoad: function (options) { | 75 | onLoad: function (options) { |
| 75 | var th=this; | 76 | var th=this; |
| 76 | 77 | ||
| 78 | + //定义第一次进入 | ||
| 79 | + this.data.fir_in=1; | ||
| 80 | + | ||
| 77 | this.setData({ | 81 | this.setData({ |
| 78 | params: options, | 82 | params: options, |
| 79 | now:Date.parse(new Date()) / 1000, | 83 | now:Date.parse(new Date()) / 1000, |
| @@ -143,10 +147,9 @@ Page({ | @@ -143,10 +147,9 @@ Page({ | ||
| 143 | onShow: function () { | 147 | onShow: function () { |
| 144 | var th=this; | 148 | var th=this; |
| 145 | this.setData({submit:0}) | 149 | this.setData({submit:0}) |
| 146 | - | ||
| 147 | - com.set_py_fir(); | 150 | + |
| 148 | getApp().check_can_share(); | 151 | getApp().check_can_share(); |
| 149 | - var th=this; | 152 | + |
| 150 | //--先判断会员状态-- | 153 | //--先判断会员状态-- |
| 151 | getApp().is_Single_page(this, function () { | 154 | getApp().is_Single_page(this, function () { |
| 152 | var user_info = getApp().globalData.userInfo; | 155 | var user_info = getApp().globalData.userInfo; |
| @@ -164,23 +167,66 @@ Page({ | @@ -164,23 +167,66 @@ Page({ | ||
| 164 | }) | 167 | }) |
| 165 | this.init(); | 168 | this.init(); |
| 166 | 169 | ||
| 167 | - setTimeout(()=> { | ||
| 168 | - i.fy_back('', 0, function () { | 170 | + //判断是不是第一次进入 |
| 171 | + if(this.data.fir_in){ | ||
| 172 | + this.data.fir_in=0; | ||
| 173 | + }else{ | ||
| 174 | + //富友支付插件 | ||
| 175 | + com.set_py_fir(); | ||
| 176 | + | ||
| 177 | + setTimeout(() => { | ||
| 178 | + i.fy_back('', 0, function () { | ||
| 169 | 179 | ||
| 170 | - console.log(getApp().globalData.py_month_bg, '111111'); | ||
| 171 | - console.log(th.data.back_ord, '22222'); | 180 | + console.log(getApp().globalData.py_month_bg, '111111'); |
| 181 | + console.log(th.data.back_ord, '22222'); | ||
| 172 | 182 | ||
| 173 | - if (getApp().globalData.py_month_bg && th.data.back_ord) { | ||
| 174 | - getApp().globalData.fuyou_clear = 1; | ||
| 175 | - var b_ord = th.data.back_ord; | ||
| 176 | - com.reduce(b_ord, os.stoid); | ||
| 177 | - //要进行清空粗粒 | ||
| 178 | - getApp().globalData.py_month_bg = 0; | ||
| 179 | - th.data.back_ord = null; | 183 | + if (getApp().globalData.py_month_bg && th.data.back_ord) { |
| 184 | + getApp().globalData.fuyou_clear = 1; | ||
| 185 | + var b_ord = th.data.back_ord; | ||
| 186 | + com.reduce(b_ord, os.stoid); | ||
| 187 | + //要进行清空粗粒 | ||
| 188 | + getApp().globalData.py_month_bg = 0; | ||
| 189 | + th.data.back_ord = null; | ||
| 180 | 190 | ||
| 181 | - } | ||
| 182 | - }) | ||
| 183 | - },1000) | 191 | + } |
| 192 | + }) | ||
| 193 | + | ||
| 194 | + var money = th.data.payMoney; | ||
| 195 | + var bk_url = "/packageE/pages/user/monthgiftbag/payment/payment?money=" + money + "&order_sn=" + th.data.back_ord; | ||
| 196 | + //-- 通联的第三方支付的返回优化 -- | ||
| 197 | + ut.is_pay_ok(bk_url, "none", function () { | ||
| 198 | + if (!th.data.back_ord) return false; | ||
| 199 | + //订单查询的接口 | ||
| 200 | + getApp().request.promiseGet("/api/weshop/marketing/marketingMonthgiftbagRecord/page", | ||
| 201 | + { | ||
| 202 | + data: { | ||
| 203 | + store_id: os.stoid, | ||
| 204 | + order_sn: th.data.back_ord, | ||
| 205 | + user_id: getApp().globalData.user_id | ||
| 206 | + } | ||
| 207 | + }).then(res => { | ||
| 208 | + if (ut.ajax_ok(res)) { | ||
| 209 | + | ||
| 210 | + var item = res.data.data.pageData[0]; | ||
| 211 | + if (item.pay_state == 1) { | ||
| 212 | + //支付支付,返回首页 | ||
| 213 | + ut.m_toast('支付成功'); | ||
| 214 | + th.data.back_ord=null; | ||
| 215 | + setTimeout(()=>{ | ||
| 216 | + getApp().goto(bk_url); | ||
| 217 | + },1500) | ||
| 218 | + | ||
| 219 | + } else { | ||
| 220 | + //支付支付,返回首页 | ||
| 221 | + ut.m_toast('支付失败'); | ||
| 222 | + } | ||
| 223 | + } | ||
| 224 | + }) | ||
| 225 | + }, null, null, 1); | ||
| 226 | + | ||
| 227 | + | ||
| 228 | + }, 1000) | ||
| 229 | + } | ||
| 184 | }, | 230 | }, |
| 185 | //获取搜索门店输入的值 | 231 | //获取搜索门店输入的值 |
| 186 | input_store: function(e) { | 232 | input_store: function(e) { |
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
| @@ -83,6 +83,8 @@ Page({ | @@ -83,6 +83,8 @@ Page({ | ||
| 83 | sec_i:-1,//选中分类门店 下标 | 83 | sec_i:-1,//选中分类门店 下标 |
| 84 | }, | 84 | }, |
| 85 | onLoad: function (options) { | 85 | onLoad: function (options) { |
| 86 | + //定义第一次进入 | ||
| 87 | + this.data.fir_in=1; | ||
| 86 | 88 | ||
| 87 | var th = this; | 89 | var th = this; |
| 88 | console.log('分享参数---'); | 90 | console.log('分享参数---'); |
| @@ -412,7 +414,10 @@ Page({ | @@ -412,7 +414,10 @@ Page({ | ||
| 412 | onShow: function () { | 414 | onShow: function () { |
| 413 | var th=this; | 415 | var th=this; |
| 414 | this.setData({submit:0}) | 416 | this.setData({submit:0}) |
| 415 | - com.set_py_fir(); | 417 | + |
| 418 | + //res = res.data.data.result; | ||
| 419 | + //if (!res) return false; | ||
| 420 | + | ||
| 416 | getApp().check_can_share(this); | 421 | getApp().check_can_share(this); |
| 417 | getApp().is_Single_page(this, function () { | 422 | getApp().is_Single_page(this, function () { |
| 418 | //--先判断会员状态-- | 423 | //--先判断会员状态-- |
| @@ -429,25 +434,64 @@ Page({ | @@ -429,25 +434,64 @@ Page({ | ||
| 429 | } | 434 | } |
| 430 | }) | 435 | }) |
| 431 | 436 | ||
| 432 | - setTimeout(()=>{ | ||
| 433 | - ut.fy_back('',0,function (){ | ||
| 434 | - if(getApp().globalData.py_month_bg && th.data.back_ord){ | ||
| 435 | - getApp().globalData.fuyou_clear=1; | ||
| 436 | - var b_ord=th.data.back_ord; | ||
| 437 | - com.reduce(b_ord,os.stoid); | ||
| 438 | - //要进行清空粗粒 | ||
| 439 | - getApp().globalData.py_month_bg=0; | ||
| 440 | - th.data.back_ord=null; | ||
| 441 | 437 | ||
| 442 | - } | ||
| 443 | - }) | ||
| 444 | - },1000) | 438 | + //判断是不是第一次进入 |
| 439 | + if(this.data.fir_in){ | ||
| 440 | + this.data.fir_in=0; | ||
| 441 | + }else { | ||
| 442 | + com.set_py_fir(); | ||
| 443 | + | ||
| 444 | + setTimeout(() => { | ||
| 445 | + ut.fy_back('', 0, function () { | ||
| 446 | + if (getApp().globalData.py_month_bg && th.data.back_ord) { | ||
| 447 | + getApp().globalData.fuyou_clear = 1; | ||
| 448 | + var b_ord = th.data.back_ord; | ||
| 449 | + com.reduce(b_ord, os.stoid); | ||
| 450 | + //要进行清空粗粒 | ||
| 451 | + getApp().globalData.py_month_bg = 0; | ||
| 452 | + th.data.back_ord = null; | ||
| 453 | + | ||
| 454 | + } | ||
| 455 | + }) | ||
| 456 | + | ||
| 457 | + var money=th.data.payMoney; | ||
| 458 | + var bk_url = "/packageE/pages/user/monthgiftbag/payment/payment?money=" + money + "&order_sn=" + th.data.back_ord; | ||
| 459 | + | ||
| 460 | + //-- 通联的第三方支付的返回优化 -- | ||
| 461 | + ut.is_pay_ok(bk_url,"none",function (){ | ||
| 462 | + if(!th.data.back_ord) return false; | ||
| 463 | + getApp().request.promiseGet("/api/weshop/marketing/marketingMonthgiftbagRecord/page", | ||
| 464 | + {data:{store_id:os.stoid,order_sn:th.data.back_ord,user_id:getApp().globalData.user_id}}).then(res=>{ | ||
| 465 | + | ||
| 466 | + if(ut.ajax_ok(res)){ | ||
| 467 | + var item=res.data.data.pageData[0]; | ||
| 468 | + if(item.pay_state==1){ | ||
| 469 | + //支付支付,返回首页 | ||
| 470 | + ut.m_toast('支付成功'); | ||
| 471 | + th.data.back_ord=null; | ||
| 472 | + setTimeout(()=>{ | ||
| 473 | + getApp().goto(bk_url); | ||
| 474 | + },1000) | ||
| 475 | + | ||
| 476 | + }else{ | ||
| 477 | + //支付支付,返回首页 | ||
| 478 | + ut.m_toast('支付失败'); | ||
| 479 | + setTimeout(()=>{ | ||
| 480 | + getApp().goto("/pages/index/index/index"); | ||
| 481 | + },1000) | ||
| 482 | + } | ||
| 483 | + } | ||
| 484 | + }) | ||
| 485 | + },null,null,1); | ||
| 486 | + | ||
| 487 | + }, 1000) | ||
| 488 | + } | ||
| 445 | 489 | ||
| 446 | }, | 490 | }, |
| 447 | GetBuyPrice: function (e) { | 491 | GetBuyPrice: function (e) { |
| 448 | var that = this.data; | 492 | var that = this.data; |
| 449 | var th = this; | 493 | var th = this; |
| 450 | - let scene =this.data.scene; | 494 | + let scene=this.data.scene; |
| 451 | if (scene==1154) { | 495 | if (scene==1154) { |
| 452 | wx.navigateTo({ | 496 | wx.navigateTo({ |
| 453 | url: '/packageE/pages/togoin/togoin', | 497 | url: '/packageE/pages/togoin/togoin', |
pages/cart/cart_wk/cart_wk.js
| @@ -60,6 +60,9 @@ Page({ | @@ -60,6 +60,9 @@ Page({ | ||
| 60 | */ | 60 | */ |
| 61 | onLoad: function (options) { | 61 | onLoad: function (options) { |
| 62 | 62 | ||
| 63 | + //定义第一次进入 | ||
| 64 | + this.data.fir_in=1; | ||
| 65 | + | ||
| 63 | //清空is_pick_up | 66 | //清空is_pick_up |
| 64 | getApp().request.put("/api/weshop/useraddress/updatePickUp", { | 67 | getApp().request.put("/api/weshop/useraddress/updatePickUp", { |
| 65 | data: { user_id: getApp().globalData.user_id, is_pickup: 0 }, | 68 | data: { user_id: getApp().globalData.user_id, is_pickup: 0 }, |
| @@ -94,11 +97,47 @@ Page({ | @@ -94,11 +97,47 @@ Page({ | ||
| 94 | */ | 97 | */ |
| 95 | onShow: function () { | 98 | onShow: function () { |
| 96 | 99 | ||
| 97 | - ut.fy_back('',0); | ||
| 98 | - this.data.paying=0; | ||
| 99 | - util_pay.set_fir(); | ||
| 100 | - getApp().check_can_share(); | ||
| 101 | var th = this; | 100 | var th = this; |
| 101 | + //判断是不是第一次进入 | ||
| 102 | + if(this.data.fir_in){ | ||
| 103 | + this.data.fir_in=0; | ||
| 104 | + }else{ | ||
| 105 | + //-- 富友插件的优化 -- | ||
| 106 | + ut.fy_back('',0); | ||
| 107 | + this.data.paying=0; | ||
| 108 | + util_pay.set_fir(); | ||
| 109 | + | ||
| 110 | + //-- 通联的第三方支付的返回优化 -- | ||
| 111 | + ut.is_pay_ok("/pages/payment/pay_success/pay_success?type=1&order_sn=" + this.data.ok_order_sn,'back',function (){ | ||
| 112 | + if(!th.data.ok_order_sn) return false; | ||
| 113 | + getApp().request.promiseGet("/api/weshop/order/page", | ||
| 114 | + {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ | ||
| 115 | + | ||
| 116 | + if(ut.ajax_ok(res)){ | ||
| 117 | + var item=res.data.data.pageData[0]; | ||
| 118 | + //已经支付尾款,或者所有的会员都已经支付尾款 | ||
| 119 | + if(item.pt_status==4 || item.pt_status==5){ | ||
| 120 | + //支付支付,返回首页 | ||
| 121 | + ut.m_toast('支付成功'); | ||
| 122 | + setTimeout(()=>{ | ||
| 123 | + getApp().re_to("/pages/payment/pay_success/pay_success?type=1&order_sn=" + th.data.ok_order_sn); | ||
| 124 | + },1000) | ||
| 125 | + | ||
| 126 | + }else{ | ||
| 127 | + //支付支付,返回首页 | ||
| 128 | + ut.m_toast('支付失败'); | ||
| 129 | + setTimeout(()=>{ | ||
| 130 | + getApp().goto("/pages/index/index/index"); | ||
| 131 | + },1000) | ||
| 132 | + } | ||
| 133 | + } | ||
| 134 | + }) | ||
| 135 | + }); | ||
| 136 | + | ||
| 137 | + } | ||
| 138 | + | ||
| 139 | + getApp().check_can_share(); | ||
| 140 | + | ||
| 102 | if (th.data.isclose == 0) { | 141 | if (th.data.isclose == 0) { |
| 103 | wx.navigateTo({ | 142 | wx.navigateTo({ |
| 104 | url: "/pages/index/index/index" | 143 | url: "/pages/index/index/index" |
| @@ -652,6 +691,8 @@ Page({ | @@ -652,6 +691,8 @@ Page({ | ||
| 652 | return false; | 691 | return false; |
| 653 | } | 692 | } |
| 654 | 693 | ||
| 694 | + //-- 把订单号记录起来 -- | ||
| 695 | + th.data.ok_order_sn=th.data.order.order_sn; | ||
| 655 | util_pay.pay_data(t,function (){ | 696 | util_pay.pay_data(t,function (){ |
| 656 | var allmoney = th.data.allpice; | 697 | var allmoney = th.data.allpice; |
| 657 | th.jumpPaymentPage(th.data.order.order_sn, allmoney); | 698 | th.jumpPaymentPage(th.data.order.order_sn, allmoney); |
pages/giftpack/buygiftpack/giftpackbuy.js
| 1 | var i = require("../../../utils/util.js"); | 1 | var i = require("../../../utils/util.js"); |
| 2 | +var ut=i; | ||
| 2 | var com = require("../public/buy_com.js"); | 3 | var com = require("../public/buy_com.js"); |
| 3 | var e = getApp(), | 4 | var e = getApp(), |
| 4 | a = e.globalData.setting, | 5 | a = e.globalData.setting, |
| @@ -74,6 +75,9 @@ Page({ | @@ -74,6 +75,9 @@ Page({ | ||
| 74 | onLoad: function (options) { | 75 | onLoad: function (options) { |
| 75 | var th=this; | 76 | var th=this; |
| 76 | 77 | ||
| 78 | + //定义第一次进入 | ||
| 79 | + this.data.fir_in=1; | ||
| 80 | + | ||
| 77 | this.setData({ | 81 | this.setData({ |
| 78 | params: options, | 82 | params: options, |
| 79 | now:Date.parse(new Date()) / 1000, | 83 | now:Date.parse(new Date()) / 1000, |
| @@ -143,10 +147,51 @@ Page({ | @@ -143,10 +147,51 @@ Page({ | ||
| 143 | onShow: function () { | 147 | onShow: function () { |
| 144 | 148 | ||
| 145 | this.setData({submit:0}) | 149 | this.setData({submit:0}) |
| 146 | - i.fy_back('',0); | ||
| 147 | - com.set_py_fir(); | ||
| 148 | - getApp().check_can_share(); | ||
| 149 | var th=this; | 150 | var th=this; |
| 151 | + | ||
| 152 | + //判断是不是第一次进入 | ||
| 153 | + if(this.data.fir_in){ | ||
| 154 | + this.data.fir_in=0; | ||
| 155 | + }else{ | ||
| 156 | + //富友支付插件 | ||
| 157 | + i.fy_back('',0); | ||
| 158 | + com.set_py_fir(); | ||
| 159 | + | ||
| 160 | + //-- 通联的第三方支付的返回优化 -- | ||
| 161 | + var money=th.data.payMoney; | ||
| 162 | + var back_url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + th.data.ok_order_sn; | ||
| 163 | + | ||
| 164 | + ut.is_pay_ok(back_url,'none',function (){ | ||
| 165 | + if(!th.data.ok_order_sn) return false; | ||
| 166 | + getApp().request.promiseGet("/api/weshop/marketing/my/giftbag/detail/get", | ||
| 167 | + {data:{storeId:os.stoid,orderSn:th.data.ok_order_sn,userId:getApp().globalData.user_id}}).then(res=>{ | ||
| 168 | + | ||
| 169 | + th.data.ok_order_sn=null; | ||
| 170 | + | ||
| 171 | + if(res.data.code==0 && res.data.data){ | ||
| 172 | + var item=res.data.data; | ||
| 173 | + if(item.payState==1){ | ||
| 174 | + //支付支付,返回首页 | ||
| 175 | + ut.m_toast('支付成功'); | ||
| 176 | + setTimeout(()=>{ | ||
| 177 | + getApp().goto(back_url); | ||
| 178 | + },1000) | ||
| 179 | + | ||
| 180 | + }else{ | ||
| 181 | + //支付支付,返回首页 | ||
| 182 | + ut.m_toast('支付失败'); | ||
| 183 | + } | ||
| 184 | + } | ||
| 185 | + }) | ||
| 186 | + },null,null,1); | ||
| 187 | + | ||
| 188 | + | ||
| 189 | + } | ||
| 190 | + | ||
| 191 | + | ||
| 192 | + | ||
| 193 | + getApp().check_can_share(); | ||
| 194 | + | ||
| 150 | //--先判断会员状态-- | 195 | //--先判断会员状态-- |
| 151 | getApp().is_Single_page(this, function () { | 196 | getApp().is_Single_page(this, function () { |
| 152 | var user_info = getApp().globalData.userInfo; | 197 | var user_info = getApp().globalData.userInfo; |
pages/giftpack/giftpacklist/giftpacklist.js
| @@ -82,6 +82,9 @@ Page({ | @@ -82,6 +82,9 @@ Page({ | ||
| 82 | }, | 82 | }, |
| 83 | onLoad: function (options) { | 83 | onLoad: function (options) { |
| 84 | 84 | ||
| 85 | + //定义第一次进入 | ||
| 86 | + this.data.fir_in=1; | ||
| 87 | + | ||
| 85 | var th = this; | 88 | var th = this; |
| 86 | 89 | ||
| 87 | this.setData({ | 90 | this.setData({ |
| @@ -170,8 +173,45 @@ Page({ | @@ -170,8 +173,45 @@ Page({ | ||
| 170 | 173 | ||
| 171 | onShow: function () { | 174 | onShow: function () { |
| 172 | this.setData({submit:0}) | 175 | this.setData({submit:0}) |
| 173 | - ut.fy_back('',0); | ||
| 174 | - com.set_py_fir(); | 176 | + |
| 177 | + var th=this; | ||
| 178 | + //判断是不是第一次进入 | ||
| 179 | + if(this.data.fir_in){ | ||
| 180 | + this.data.fir_in=0; | ||
| 181 | + }else{ | ||
| 182 | + //富友支付插件的判断 | ||
| 183 | + ut.fy_back('',0); | ||
| 184 | + com.set_py_fir(); | ||
| 185 | + | ||
| 186 | + //-- 通联的第三方支付的返回优化 -- | ||
| 187 | + var money=th.data.payMoney; | ||
| 188 | + var back_url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + th.data.ok_order_sn; | ||
| 189 | + | ||
| 190 | + ut.is_pay_ok(back_url,'none',function (){ | ||
| 191 | + if(!th.data.ok_order_sn) return false; | ||
| 192 | + getApp().request.promiseGet("/api/weshop/marketing/my/giftbag/detail/get", | ||
| 193 | + {data:{storeId:os.stoid,orderSn:th.data.ok_order_sn,userId:getApp().globalData.user_id}}).then(res=>{ | ||
| 194 | + | ||
| 195 | + th.data.ok_order_sn=null; | ||
| 196 | + if(res.data.code==0 && res.data.data){ | ||
| 197 | + var item=res.data.data; | ||
| 198 | + if(item.payState==1){ | ||
| 199 | + //支付支付,返回首页 | ||
| 200 | + ut.m_toast('支付成功'); | ||
| 201 | + setTimeout(()=>{ | ||
| 202 | + getApp().goto(back_url); | ||
| 203 | + },1000) | ||
| 204 | + | ||
| 205 | + }else{ | ||
| 206 | + //支付支付,返回首页 | ||
| 207 | + ut.m_toast('支付失败'); | ||
| 208 | + } | ||
| 209 | + } | ||
| 210 | + }) | ||
| 211 | + },null,null,1); | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + | ||
| 175 | getApp().check_can_share(this); | 215 | getApp().check_can_share(this); |
| 176 | getApp().is_Single_page(this, function () { | 216 | getApp().is_Single_page(this, function () { |
| 177 | //--先判断会员状态-- | 217 | //--先判断会员状态-- |
pages/giftpack/public/buy_com.js
| @@ -251,9 +251,6 @@ module.exports = { | @@ -251,9 +251,6 @@ module.exports = { | ||
| 251 | function (res) { | 251 | function (res) { |
| 252 | if (res.data.code == 0 && res.data.data) { | 252 | if (res.data.code == 0 && res.data.data) { |
| 253 | 253 | ||
| 254 | - | ||
| 255 | - | ||
| 256 | - | ||
| 257 | switch(that.data.buyType){ | 254 | switch(that.data.buyType){ |
| 258 | case 1://立即兑换 | 255 | case 1://立即兑换 |
| 259 | var order_sn = res.data.data; | 256 | var order_sn = res.data.data; |
| @@ -266,6 +263,7 @@ module.exports = { | @@ -266,6 +263,7 @@ module.exports = { | ||
| 266 | case 2://立即购买 | 263 | case 2://立即购买 |
| 267 | 264 | ||
| 268 | var order_sn = res.data.data.orderSn; | 265 | var order_sn = res.data.data.orderSn; |
| 266 | + that.data.ok_order_sn=order_sn; | ||
| 269 | 267 | ||
| 270 | var money=that.data.payMoney; | 268 | var money=that.data.payMoney; |
| 271 | var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; | 269 | var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; |
pages/user/order_detail/order_detail.js
| @@ -16,6 +16,9 @@ Page({ | @@ -16,6 +16,9 @@ Page({ | ||
| 16 | }, | 16 | }, |
| 17 | onLoad: function(e) { | 17 | onLoad: function(e) { |
| 18 | 18 | ||
| 19 | + //定义第一次进入 | ||
| 20 | + this.data.fir_in=1; | ||
| 21 | + | ||
| 19 | var th=this; | 22 | var th=this; |
| 20 | var r = void 0 !== e.isGoup && e.isGoup; | 23 | var r = void 0 !== e.isGoup && e.isGoup; |
| 21 | 24 | ||
| @@ -64,9 +67,45 @@ Page({ | @@ -64,9 +67,45 @@ Page({ | ||
| 64 | }), this.requestOrderDetail(e.order_id), wx.removeStorageSync("order:order_detail:update"); | 67 | }), this.requestOrderDetail(e.order_id), wx.removeStorageSync("order:order_detail:update"); |
| 65 | }, | 68 | }, |
| 66 | onShow: function() { | 69 | onShow: function() { |
| 67 | - ut.fy_back('',0) | 70 | + |
| 71 | + var th=this; | ||
| 68 | this.setData({paying:0}); | 72 | this.setData({paying:0}); |
| 69 | - py.set_fir(); | 73 | + |
| 74 | + //判断是不是第一次进入 | ||
| 75 | + if(this.data.fir_in){ | ||
| 76 | + this.data.fir_in=0; | ||
| 77 | + }else{ | ||
| 78 | + //富友支付 | ||
| 79 | + ut.fy_back('',0) | ||
| 80 | + py.set_fir(); | ||
| 81 | + | ||
| 82 | + //通联第三方 | ||
| 83 | + //-- 通联的第三方支付的返回优化 -- | ||
| 84 | + ut.is_pay_ok("back","none",function (){ | ||
| 85 | + if(!th.data.ok_order_sn) return false; | ||
| 86 | + getApp().request.promiseGet("/api/weshop/order/page", | ||
| 87 | + {data:{store_id:os.stoid,order_sn:th.data.ok_order_sn}}).then(res=>{ | ||
| 88 | + if(ut.ajax_ok(res)){ | ||
| 89 | + var item=res.data.data.pageData[0]; | ||
| 90 | + if(item.pay_status==1){ | ||
| 91 | + //支付支付,返回首页 | ||
| 92 | + ut.m_toast('支付成功'); | ||
| 93 | + setTimeout(()=>{ | ||
| 94 | + wx.navigateBack(); | ||
| 95 | + },1000) | ||
| 96 | + | ||
| 97 | + }else{ | ||
| 98 | + //支付支付,返回首页 | ||
| 99 | + ut.m_toast('支付失败'); | ||
| 100 | + setTimeout(()=>{ | ||
| 101 | + wx.navigateBack(); | ||
| 102 | + },1000) | ||
| 103 | + } | ||
| 104 | + } | ||
| 105 | + }) | ||
| 106 | + }); | ||
| 107 | + } | ||
| 108 | + | ||
| 70 | wx.getStorageSync("order:order_detail:update") && (wx.removeStorageSync("order:order_detail:update"), | 109 | wx.getStorageSync("order:order_detail:update") && (wx.removeStorageSync("order:order_detail:update"), |
| 71 | this.requestOrderDetail(this.data.order.order_id)); | 110 | this.requestOrderDetail(this.data.order.order_id)); |
| 72 | }, | 111 | }, |
| @@ -1132,6 +1171,7 @@ Page({ | @@ -1132,6 +1171,7 @@ Page({ | ||
| 1132 | } | 1171 | } |
| 1133 | 1172 | ||
| 1134 | 1173 | ||
| 1174 | + th.data.ok_order_sn=this.data.order.order_sn; | ||
| 1135 | py.pay(this.data.order.order_sn, function() { | 1175 | py.pay(this.data.order.order_sn, function() { |
| 1136 | th.setData({paying:0}); | 1176 | th.setData({paying:0}); |
| 1137 | wx.showToast({title: '支付成功'}) | 1177 | wx.showToast({title: '支付成功'}) |
pages/user/plus/plus.js
| @@ -56,8 +56,11 @@ Page({ | @@ -56,8 +56,11 @@ Page({ | ||
| 56 | * 生命周期函数--监听页面加载 | 56 | * 生命周期函数--监听页面加载 |
| 57 | */ | 57 | */ |
| 58 | onLoad: function (options) { | 58 | onLoad: function (options) { |
| 59 | - var that = this, | ||
| 60 | - th = that; | 59 | + |
| 60 | + //定义第一次进入 | ||
| 61 | + this.data.fir_in=1; | ||
| 62 | + | ||
| 63 | + var that = this,th = that; | ||
| 61 | var store_id = getApp().globalData.setting.stoid; | 64 | var store_id = getApp().globalData.setting.stoid; |
| 62 | //获取用户设备信息,屏幕宽度 | 65 | //获取用户设备信息,屏幕宽度 |
| 63 | wx.getSystemInfo({ | 66 | wx.getSystemInfo({ |
| @@ -130,17 +133,60 @@ Page({ | @@ -130,17 +133,60 @@ Page({ | ||
| 130 | onShow: function () { | 133 | onShow: function () { |
| 131 | var user_info = getApp().globalData.userInfo; | 134 | var user_info = getApp().globalData.userInfo; |
| 132 | if (!user_info) return false; | 135 | if (!user_info) return false; |
| 133 | - ut.fy_back('',0); | 136 | + |
| 137 | + var th = this,that = th; | ||
| 138 | + | ||
| 139 | + //判断是不是第一次进入 | ||
| 140 | + if(this.data.fir_in){ | ||
| 141 | + this.data.fir_in=0; | ||
| 142 | + }else{ | ||
| 143 | + //富友插件支付 | ||
| 144 | + ut.fy_back('',0); | ||
| 145 | + t_pay.set_fir(); | ||
| 146 | + //-- 通联的第三方支付的返回优化 -- | ||
| 147 | + ut.is_pay_ok("func","func",function (){ | ||
| 148 | + | ||
| 149 | + if(!th.data.ok_order_sn) return false; | ||
| 150 | + var ck_url="/api/weshop/recharge/get/"+os.stoid+"/"+th.data.ok_order_sn; | ||
| 151 | + getApp().request.promiseGet(ck_url,{}).then(res=>{ | ||
| 152 | + | ||
| 153 | + if(res.data.code==0 && res.data.data){ | ||
| 154 | + var item=res.data.data; | ||
| 155 | + if(item.pay_status==1){ | ||
| 156 | + //支付支付,返回首页 | ||
| 157 | + th.success() | ||
| 158 | + | ||
| 159 | + }else{ | ||
| 160 | + //支付支付,返回首页 | ||
| 161 | + getApp().my_warnning('支付失败', 0, th); | ||
| 162 | + th.setData({ | ||
| 163 | + is_select:0, | ||
| 164 | + focus:true, | ||
| 165 | + }) | ||
| 166 | + } | ||
| 167 | + } | ||
| 168 | + }) | ||
| 169 | + }, //成功的回调 | ||
| 170 | + function (){ | ||
| 171 | + th.success(); | ||
| 172 | + },//失败的回调 | ||
| 173 | + function (){ | ||
| 174 | + | ||
| 175 | + getApp().my_warnning('支付失败', 0, th); | ||
| 176 | + th.setData({ | ||
| 177 | + is_select:0, | ||
| 178 | + focus:true, | ||
| 179 | + }) | ||
| 180 | + | ||
| 181 | + }); | ||
| 182 | + } | ||
| 134 | 183 | ||
| 135 | this.setData({ | 184 | this.setData({ |
| 136 | is_select:0, | 185 | is_select:0, |
| 137 | focus:true, | 186 | focus:true, |
| 138 | }) | 187 | }) |
| 139 | - t_pay.set_fir(); | ||
| 140 | 188 | ||
| 141 | - var th = this, | ||
| 142 | - that = th, | ||
| 143 | - app_d = getApp().globalData; | 189 | + var app_d = getApp().globalData; |
| 144 | var store_id = os.stoid; | 190 | var store_id = os.stoid; |
| 145 | var fir_leader = this.data.fir_leader; | 191 | var fir_leader = this.data.fir_leader; |
| 146 | 192 | ||
| @@ -196,9 +242,9 @@ Page({ | @@ -196,9 +242,9 @@ Page({ | ||
| 196 | var userInfo = e.data.data; | 242 | var userInfo = e.data.data; |
| 197 | if (userInfo['card_field'] && !getApp().globalData.is_card_back) { | 243 | if (userInfo['card_field'] && !getApp().globalData.is_card_back) { |
| 198 | var u_url = "/packageE/pages/user/cardinfo/cardinfo"; | 244 | var u_url = "/packageE/pages/user/cardinfo/cardinfo"; |
| 199 | - wx.reLaunch({ | ||
| 200 | - url: u_url | ||
| 201 | - }) | 245 | + // wx.reLaunch({ |
| 246 | + // url: u_url | ||
| 247 | + // }) | ||
| 202 | } | 248 | } |
| 203 | }, | 249 | }, |
| 204 | }); | 250 | }); |
| @@ -476,7 +522,7 @@ Page({ | @@ -476,7 +522,7 @@ Page({ | ||
| 476 | is_select:0, | 522 | is_select:0, |
| 477 | focus:true, | 523 | focus:true, |
| 478 | }) | 524 | }) |
| 479 | - }); | 525 | + },th); |
| 480 | } | 526 | } |
| 481 | }, | 527 | }, |
| 482 | //返回会员页面 | 528 | //返回会员页面 |
| @@ -506,13 +552,12 @@ Page({ | @@ -506,13 +552,12 @@ Page({ | ||
| 506 | t_pay.set_pay_url('/api/weshop/plus/create/plus/order'); | 552 | t_pay.set_pay_url('/api/weshop/plus/create/plus/order'); |
| 507 | t_pay.pay(req, th.success, function (msg) { | 553 | t_pay.pay(req, th.success, function (msg) { |
| 508 | if(!msg) msg="支付失败"; | 554 | if(!msg) msg="支付失败"; |
| 509 | - | ||
| 510 | getApp().my_warnning(msg, 0, th); | 555 | getApp().my_warnning(msg, 0, th); |
| 511 | th.setData({ | 556 | th.setData({ |
| 512 | is_select:0, | 557 | is_select:0, |
| 513 | focus:true, | 558 | focus:true, |
| 514 | }) | 559 | }) |
| 515 | - }); | 560 | + },th); |
| 516 | } | 561 | } |
| 517 | } else { | 562 | } else { |
| 518 | getApp().my_warnning(res.data.msg, 0, th); | 563 | getApp().my_warnning(res.data.msg, 0, th); |
utils/pay.js
| @@ -49,6 +49,9 @@ module.exports = { | @@ -49,6 +49,9 @@ module.exports = { | ||
| 49 | wx.hideLoading(); | 49 | wx.hideLoading(); |
| 50 | if(t.data.code==0){ | 50 | if(t.data.code==0){ |
| 51 | 51 | ||
| 52 | + | ||
| 53 | + var is_pos_pay=t.data.data.is_pos_pay; | ||
| 54 | + //-- 富有的插件支付 -- | ||
| 52 | if(t.data.data.is_fuioupay){ | 55 | if(t.data.data.is_fuioupay){ |
| 53 | const plugin = requirePlugin('fuiou-pay') | 56 | const plugin = requirePlugin('fuiou-pay') |
| 54 | getApp().globalData.no_clear=1; | 57 | getApp().globalData.no_clear=1; |
| @@ -84,12 +87,26 @@ module.exports = { | @@ -84,12 +87,26 @@ module.exports = { | ||
| 84 | },1000) | 87 | },1000) |
| 85 | 88 | ||
| 86 | }) | 89 | }) |
| 90 | + } | ||
| 91 | + //-- 通联的支付插件 -- | ||
| 92 | + else if(is_pos_pay){ | ||
| 93 | + | ||
| 94 | + var p_data=t.data.data; | ||
| 95 | + delete p_data.is_pos_pay; //清理掉,不然签名不通过 | ||
| 96 | + wx.openEmbeddedMiniProgram({ | ||
| 97 | + appId: 'wxef277996acc166c3', | ||
| 98 | + extraData: p_data, | ||
| 99 | + fail(){ | ||
| 100 | + //-- 取消不支付 -- | ||
| 101 | + i.wx_paying=0; | ||
| 102 | + "function" == typeof a && a(); | ||
| 103 | + } | ||
| 104 | + }) | ||
| 105 | + | ||
| 87 | }else{ | 106 | }else{ |
| 88 | i.weixinPay(t.data.data, e, a); | 107 | i.weixinPay(t.data.data, e, a); |
| 89 | } | 108 | } |
| 90 | 109 | ||
| 91 | - | ||
| 92 | - | ||
| 93 | }else{ | 110 | }else{ |
| 94 | i.wx_paying=0; | 111 | i.wx_paying=0; |
| 95 | getApp().confirmBox(t.data.msg); | 112 | getApp().confirmBox(t.data.msg); |
| @@ -125,6 +142,7 @@ module.exports = { | @@ -125,6 +142,7 @@ module.exports = { | ||
| 125 | fail('支付参数错误'); | 142 | fail('支付参数错误'); |
| 126 | return false; | 143 | return false; |
| 127 | } | 144 | } |
| 145 | + //富友插件的优化 | ||
| 128 | if(ob.is_fuioupay){ | 146 | if(ob.is_fuioupay){ |
| 129 | const plugin = requirePlugin('fuiou-pay') | 147 | const plugin = requirePlugin('fuiou-pay') |
| 130 | 148 | ||
| @@ -150,7 +168,24 @@ module.exports = { | @@ -150,7 +168,24 @@ module.exports = { | ||
| 150 | fail(msg) | 168 | fail(msg) |
| 151 | 169 | ||
| 152 | }) | 170 | }) |
| 153 | - }else { | 171 | + } |
| 172 | + //-- 通联的支付插件 -- | ||
| 173 | + else if(ob.is_pos_pay){ | ||
| 174 | + | ||
| 175 | + var p_data=t.data.data; | ||
| 176 | + delete p_data.is_pos_pay; //清理掉,不然签名不通过 | ||
| 177 | + wx.openEmbeddedMiniProgram({ | ||
| 178 | + appId: 'wxef277996acc166c3', | ||
| 179 | + extraData: p_data, | ||
| 180 | + fail(){ | ||
| 181 | + //-- 取消不支付 -- | ||
| 182 | + i.wx_paying=0; | ||
| 183 | + "function" == typeof a && a(); | ||
| 184 | + } | ||
| 185 | + }) | ||
| 186 | + | ||
| 187 | + } | ||
| 188 | + else { | ||
| 154 | this.weixinPay(ob, succ, fail); | 189 | this.weixinPay(ob, succ, fail); |
| 155 | } | 190 | } |
| 156 | }, | 191 | }, |
utils/pay2.js
| @@ -10,7 +10,8 @@ module.exports = { | @@ -10,7 +10,8 @@ module.exports = { | ||
| 10 | this.wx_paying=0; | 10 | this.wx_paying=0; |
| 11 | }, | 11 | }, |
| 12 | //-- createRechargeOrder create/plus/order -- | 12 | //-- createRechargeOrder create/plus/order -- |
| 13 | - pay: function(dd, succ,fail) { | 13 | + // get_order是通联专用,获取订单号 |
| 14 | + pay: function(dd, succ,fail,th) { | ||
| 14 | if(this.wx_paying) return false; | 15 | if(this.wx_paying) return false; |
| 15 | this.wx_paying=1; | 16 | this.wx_paying=1; |
| 16 | wx.showLoading(); | 17 | wx.showLoading(); |
| @@ -24,6 +25,7 @@ module.exports = { | @@ -24,6 +25,7 @@ module.exports = { | ||
| 24 | "function" == typeof succ && succ(1); | 25 | "function" == typeof succ && succ(1); |
| 25 | }else{ | 26 | }else{ |
| 26 | 27 | ||
| 28 | + var is_pos_pay=t.data.data.is_pos_pay; | ||
| 27 | if(t.data.data.is_fuioupay){ | 29 | if(t.data.data.is_fuioupay){ |
| 28 | const plugin = requirePlugin('fuiou-pay') | 30 | const plugin = requirePlugin('fuiou-pay') |
| 29 | getApp().globalData.no_clear=1; | 31 | getApp().globalData.no_clear=1; |
| @@ -51,6 +53,32 @@ module.exports = { | @@ -51,6 +53,32 @@ module.exports = { | ||
| 51 | fail(msg) | 53 | fail(msg) |
| 52 | i.wx_paying=0; | 54 | i.wx_paying=0; |
| 53 | }) | 55 | }) |
| 56 | + } | ||
| 57 | + //-- 通联的支付插件 -- | ||
| 58 | + else if(is_pos_pay){ | ||
| 59 | + var p_data=t.data.data; | ||
| 60 | + delete p_data.is_pos_pay; //清理掉,不然签名不通过 | ||
| 61 | + | ||
| 62 | + if(th){ | ||
| 63 | + | ||
| 64 | + var ordno=p_data.reqsn; | ||
| 65 | + if(ordno.indexOf('_')){ | ||
| 66 | + var str_arr=ordno.split('_'); | ||
| 67 | + ordno=str_arr[0]; | ||
| 68 | + } | ||
| 69 | + th.data.ok_order_sn=ordno; | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + wx.openEmbeddedMiniProgram({ | ||
| 73 | + appId: 'wxef277996acc166c3', | ||
| 74 | + extraData: p_data, | ||
| 75 | + fail(){ | ||
| 76 | + | ||
| 77 | + //-- 取消不支付 -- | ||
| 78 | + i.wx_paying=0; | ||
| 79 | + "function" == typeof fail && fail('取消支付'); | ||
| 80 | + } | ||
| 81 | + }) | ||
| 54 | }else { | 82 | }else { |
| 55 | i.weixinPay(t.data.data, succ, fail); | 83 | i.weixinPay(t.data.data, succ, fail); |
| 56 | } | 84 | } |
| @@ -75,9 +103,11 @@ module.exports = { | @@ -75,9 +103,11 @@ module.exports = { | ||
| 75 | }, | 103 | }, |
| 76 | 104 | ||
| 77 | //-- 这里是专享礼包的调用 -- | 105 | //-- 这里是专享礼包的调用 -- |
| 78 | - pay_data:function (t,succ,fail){ | 106 | + pay_data:function (t,succ,fail,get_order){ |
| 79 | var th=this; | 107 | var th=this; |
| 80 | var ob=t.data.data.result; | 108 | var ob=t.data.data.result; |
| 109 | + this.wx_paying=1; | ||
| 110 | + | ||
| 81 | if(!ob){ | 111 | if(!ob){ |
| 82 | this.set_fir(); | 112 | this.set_fir(); |
| 83 | fail('支付参数错误'); | 113 | fail('支付参数错误'); |
| @@ -113,7 +143,28 @@ module.exports = { | @@ -113,7 +143,28 @@ module.exports = { | ||
| 113 | fail(msg) | 143 | fail(msg) |
| 114 | 144 | ||
| 115 | }) | 145 | }) |
| 116 | - }else { | 146 | + } |
| 147 | + | ||
| 148 | + //-- 通联的支付插件 -- | ||
| 149 | + else if(ob.is_pos_pay){ | ||
| 150 | + var p_data=ob; | ||
| 151 | + delete p_data.is_pos_pay; //清理掉,不然签名不通过 | ||
| 152 | + if(get_order){ | ||
| 153 | + get_order(p_data.reqsn); //把单号返回 | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + wx.openEmbeddedMiniProgram({ | ||
| 157 | + appId: 'wxef277996acc166c3', | ||
| 158 | + extraData: p_data, | ||
| 159 | + fail(){ | ||
| 160 | + //-- 取消不支付 -- | ||
| 161 | + th.wx_paying=0; | ||
| 162 | + "function" == typeof a && a(); | ||
| 163 | + } | ||
| 164 | + }) | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + else { | ||
| 117 | this.weixinPay(ob, succ, fail); | 168 | this.weixinPay(ob, succ, fail); |
| 118 | } | 169 | } |
| 119 | }, | 170 | }, |
utils/util.js
| @@ -799,7 +799,7 @@ module.exports = { | @@ -799,7 +799,7 @@ module.exports = { | ||
| 799 | return false | 799 | return false |
| 800 | }, | 800 | }, |
| 801 | 801 | ||
| 802 | - //优惠促销的数据的格式话 | 802 | + //-- 优惠促销的数据的格式话 -- |
| 803 | format_yh_act(fir_act){ | 803 | format_yh_act(fir_act){ |
| 804 | var more_arr = []; | 804 | var more_arr = []; |
| 805 | if(fir_act){ | 805 | if(fir_act){ |
| @@ -874,6 +874,99 @@ module.exports = { | @@ -874,6 +874,99 @@ module.exports = { | ||
| 874 | } | 874 | } |
| 875 | return more_arr | 875 | return more_arr |
| 876 | }, | 876 | }, |
| 877 | + | ||
| 878 | + //-- 长的提示框 -- | ||
| 879 | + m_toast(txt){ | ||
| 880 | + wx.showToast({ | ||
| 881 | + title: txt, | ||
| 882 | + icon: 'none', | ||
| 883 | + duration: 2500 | ||
| 884 | + }) | ||
| 885 | + }, | ||
| 886 | + //-- 支付的结果判断是不是完成了,通联支付pos收银的返回 -- | ||
| 887 | + /** | ||
| 888 | + * | ||
| 889 | + * @param back_url 如果是地址,就跳转,如果是back,就返回。如果是func,就是要回调 | ||
| 890 | + * @param err_url 如果是地址,就跳转,如果是back,就返回。如果是func,就是要回调,如果是none,就没有反应,提示而已 | ||
| 891 | + * @param func 因为是物理键的返回,所以要调用结果,查询结果 | ||
| 892 | + * @param success //成功的回调函数, 当back_url是func | ||
| 893 | + * @param fail //失败的回调函数, 当err_url是func | ||
| 894 | + * @param is_navigateTo //跳转的页面是不是要is_re_to | ||
| 895 | + */ | ||
| 896 | + is_pay_ok(back_url,err_url,func,success,fail,is_navigateTo){ | ||
| 897 | + if(!err_url){ | ||
| 898 | + err_url="/pages/index/index/index"; | ||
| 899 | + } | ||
| 900 | + | ||
| 901 | + | ||
| 902 | + | ||
| 903 | + let options = wx.getEnterOptionsSync(); | ||
| 904 | + if (options.scene == '1038' && options.referrerInfo.appId=='wxef277996acc166c3') { | ||
| 905 | + let extraData = options.referrerInfo.extraData; | ||
| 906 | + if (!extraData) { | ||
| 907 | + if(func) func(); | ||
| 908 | + } else { | ||
| 909 | + // "支付成功"; | ||
| 910 | + if (extraData.code == 'success') { | ||
| 911 | + this.m_toast("支付成功") | ||
| 912 | + //支付失败 | ||
| 913 | + setTimeout(function () { | ||
| 914 | + if(back_url=='back') { | ||
| 915 | + wx.navigateBack(); | ||
| 916 | + } | ||
| 917 | + else if(back_url=='func'){ | ||
| 918 | + success(); | ||
| 919 | + } | ||
| 920 | + else if(back_url!='none'){ | ||
| 921 | + | ||
| 922 | + if(is_navigateTo){ | ||
| 923 | + getApp().goto(back_url) //跳到tabbar页 | ||
| 924 | + }else{ | ||
| 925 | + wx.redirectTo({ url: back_url}); | ||
| 926 | + } | ||
| 927 | + | ||
| 928 | + | ||
| 929 | + } | ||
| 930 | + },2000) | ||
| 931 | + } | ||
| 932 | + // "支付已取消"; | ||
| 933 | + else if (extraData.code == 'cancel') { | ||
| 934 | + this.m_toast("取消支付") | ||
| 935 | + //支付失败 | ||
| 936 | + setTimeout(function () { | ||
| 937 | + if(err_url=='back'){ | ||
| 938 | + wx.navigateBack(); | ||
| 939 | + } | ||
| 940 | + else if(err_url=='func'){ | ||
| 941 | + fail(); | ||
| 942 | + } | ||
| 943 | + else if(err_url!='none'){ | ||
| 944 | + if(is_navigateTo){ | ||
| 945 | + getApp.goto({ url: err_url, }) //跳到tabbar页 | ||
| 946 | + }else { | ||
| 947 | + wxd.redirectTo(err_url); | ||
| 948 | + } | ||
| 949 | + } | ||
| 950 | + | ||
| 951 | + },2000) | ||
| 952 | + } | ||
| 953 | + // "支付失败:" + extraData.errmsg; | ||
| 954 | + else { | ||
| 955 | + this.m_toast("支付失败:" + extraData.errmsg) | ||
| 956 | + //支付失败 | ||
| 957 | + setTimeout(function () { | ||
| 958 | + if(err_url=='back'){ | ||
| 959 | + wx.navigateBack(); | ||
| 960 | + }else{ | ||
| 961 | + getApp().goto(err_url); | ||
| 962 | + } | ||
| 963 | + },2000) | ||
| 964 | + } | ||
| 965 | + | ||
| 966 | + } | ||
| 967 | + | ||
| 968 | + } | ||
| 969 | + }, | ||
| 877 | 970 | ||
| 878 | unserialize: unserialize, | 971 | unserialize: unserialize, |
| 879 | _throttle:_throttle, | 972 | _throttle:_throttle, |