195.Vue.js智能扫码点餐系统(二十九)【点击去支付调用Nodejs Api接口实现支付(支付宝支付)】2019.04.01

0、知识点

  • 提交订单 Api 接口
  • .提交订单成功跳转到成功页面

1、提交订单 Api 接口

Order.vue

  • 订单支付代码
 doPay(){

                    var that=this;
                    var uid=storage.get('roomid');
                    var api=this.api+'api/doPay';
                    this.$http.post(api,{
                        uid,                      
                        total_price:that.list.total_price,
                        order_id:that.list.order_id,
                        return_url:'http://localhost:8080/#/success'                         
                    }).then((response)=>{                              
                        console.log(response);                        
                        location.href=response.body.result.data;
                    },(err)=>{
                        console.log(err);
                    })
            }

猜你喜欢

转载自blog.csdn.net/youyouwuxin1234/article/details/88945777
今日推荐