Commit da5d0c0f6facae7166d768c2e8f1b5413d211453

Authored by yvan.ni
1 parent 64e142d7

pos收银支付

packageD/pages/user/deposit/prepaid/prepaid.js
... ... @@ -114,8 +114,8 @@ Page({
114 114 if(!th.data.ok_order_sn) return false;
115 115 var ck_url="/api/weshop/recharge/get/"+os.stoid+"/"+th.data.ok_order_sn;
116 116 getApp().request.promiseGet(ck_url,{}).then(res=>{
117   - if(ut.ajax_ok(res)){
118   - var item=res.data.data.pageData[0];
  117 + if(res.data.code==0 && res.data.data){
  118 + var item=res.data.data;
119 119 if(item.pay_status==1){
120 120 //支付支付,返回首页
121 121 ut.m_toast('支付成功');
... ...
packageD/pages/user/integral/integral.js
... ... @@ -295,10 +295,8 @@ Page({
295 295 // })
296 296 })
297 297 })
298   -
299   -
300   -
301   - },
  298 +
  299 + },
302 300 //------支付成功页面--------
303 301 jumpPaymentPage: function () {
304 302 console.log("支付成功页面2333");
... ... @@ -348,11 +346,15 @@ Page({
348 346  
349 347 //-- 通联的第三方支付的返回优化 --
350 348 ut.is_pay_ok("/packageD/pages/user/deposit/prepaid/msg/msg",null,function (){
  349 +
  350 + console.log('show--11')
  351 + console.log(th.data.ok_order_sn);
  352 +
351 353 if(!th.data.ok_order_sn) return false;
352 354 var ck_url="/api/weshop/recharge/get/"+os.stoid+"/"+th.data.ok_order_sn;
353 355 getApp().request.promiseGet(ck_url,{}).then(res=>{
354   - if(ut.ajax_ok(res)){
355   - var item=res.data.data.pageData[0];
  356 + if(res.data.code==0 && res.data.data){
  357 + var item=res.data.data;
356 358 if(item.pay_status==1){
357 359 //支付支付,返回首页
358 360 ut.m_toast('支付成功');
... ...
packageE/pages/user/cardinfo/cardinfo.js
... ... @@ -50,6 +50,9 @@ Page({
50 50 */
51 51 onLoad: function (options) {
52 52  
  53 + //定义第一次进入
  54 + this.data.fir_in=1;
  55 +
53 56 //--先判断会员状态--
54 57 var user_info = getApp().globalData.userInfo;
55 58 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
... ... @@ -683,8 +686,42 @@ Page({
683 686 */
684 687 onShow: function () {
685 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("/pages/payment/pay_success/pay_success?type=2&order_sn=" + this.data.ok_order_sn,null,function (){
  700 + if(!th.data.ok_order_sn) return false;
  701 + getApp().request.promiseGet("/api/weshop/order/page",
  702 + {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{
  703 + if(ut.ajax_ok(res)){
  704 + var item=res.data.data.pageData[0];
  705 + if(item.pay_status==1){
  706 + //支付支付,返回首页
  707 + ut.m_toast('支付成功');
  708 + setTimeout(()=>{
  709 + getApp().goto("/pages/payment/pay_success/pay_success?type=2&order_sn=" + th.data.ok_order_sn);
  710 + },1000)
  711 +
  712 + }else{
  713 + //支付支付,返回首页
  714 + ut.m_toast('支付失败');
  715 + setTimeout(()=>{
  716 + getApp().goto("/pages/index/index/index");
  717 + },1000)
  718 + }
  719 + }
  720 + })
  721 + });
  722 + }
  723 +
  724 +
688 725 //同步初始化
689 726 this.init();
690 727  
... ... @@ -748,10 +785,7 @@ Page({
748 785  
749 786 //-----立即续费的功能------
750 787 xufei:async function(){
751   -
752   -
753   -
754   - var th = this,is_card = 0,end_time=0;
  788 + var th = this,is_card = 0,end_time=0;
755 789 await getApp().request.promiseGet("/store/storemoduleendtime/page?store_id="+os.stoid+"&type=3",
756 790 {1:1}).then(res => {
757 791 if (ut.ajax_ok(res)) {
... ... @@ -789,7 +823,6 @@ Page({
789 823 if(this.data.paying) return false;
790 824 this.data.paying=1;
791 825  
792   -
793 826 var item = th.data.user_card;
794 827 var req = {};
795 828 req.cardId = item.CardId;
... ...
pages/user/plus/plus.js
... ... @@ -56,8 +56,11 @@ Page({
56 56 * 生命周期函数--监听页面加载
57 57 */
58 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 64 var store_id = getApp().globalData.setting.stoid;
62 65 //获取用户设备信息,屏幕宽度
63 66 wx.getSystemInfo({
... ... @@ -130,17 +133,48 @@ Page({
130 133 onShow: function () {
131 134 var user_info = getApp().globalData.userInfo;
132 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("/pages/payment/pay_success/pay_success?type=2&order_sn=" + this.data.ok_order_sn,null,function (){
  148 + if(!th.data.ok_order_sn) return false;
  149 + getApp().request.promiseGet("/api/weshop/order/page",
  150 + {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{
  151 + if(ut.ajax_ok(res)){
  152 + var item=res.data.data.pageData[0];
  153 + if(item.pay_status==1){
  154 + //支付支付,返回首页
  155 + ut.m_toast('支付成功');
  156 + setTimeout(()=>{
  157 + getApp().goto("/pages/payment/pay_success/pay_success?type=2&order_sn=" + th.data.ok_order_sn);
  158 + },1000)
  159 +
  160 + }else{
  161 + //支付支付,返回首页
  162 + ut.m_toast('支付失败');
  163 + setTimeout(()=>{
  164 + getApp().goto("/pages/index/index/index");
  165 + },1000)
  166 + }
  167 + }
  168 + })
  169 + });
  170 + }
134 171  
135 172 this.setData({
136 173 is_select:0,
137 174 focus:true,
138 175 })
139   - t_pay.set_fir();
140 176  
141   - var th = this,
142   - that = th,
143   - app_d = getApp().globalData;
  177 + var app_d = getApp().globalData;
144 178 var store_id = os.stoid;
145 179 var fir_leader = this.data.fir_leader;
146 180  
... ...