"use strict";var e=require("../common/vendor.js"),t=require("../api/integral.js");require("../common/request.js");const l={data(){return{addressId:null,address:null,orderId:null,order:null,item:null}},onLoad(s){this.goodsId=s.goodsId;var d=this;e.index.$on("updateAddress",n=>{d.addressId=n.addressId,d.address=n,d.address.address=n.province+n.city+n.district+n.detail}),this.getIntegralGoodsById()},methods:{getIntegralGoodsById(){var s={goodsId:this.goodsId};console.log(s),t.getIntegralGoodsById(s).then(d=>{d.code==200&&(this.item=d.data)},d=>{})},openAddress(){e.index.navigateTo({url:"/pages_user/address"})},payOrder(){if(this.addressId==null){e.index.showToast({icon:"none",title:"\u8BF7\u9009\u62E9\u6536\u8D27\u5730\u5740"});return}var s={goodsId:this.goodsId,addressId:this.addressId};e.index.showLoading(),t.createOrder(s).then(d=>{d.code==200?e.index.redirectTo({url:"./integralOrderPaySuccess?orderId="+d.order.orderId}):e.index.showToast({icon:"none",title:d.msg})},d=>{})}}};function a(s,d,n,u,r,o){return e.e({a:r.address==null},r.address==null?{b:e.o(i=>o.openAddress())}:{},{c:r.address!=null},r.address!=null?e.e({d:e.t(r.address.realName),e:r.address.phone!=null},r.address.phone!=null?{f:e.t(r.address.phone)}:{},{g:e.t(r.address.address),h:e.o(i=>o.openAddress())}):{},{i:r.item.imgUrl==""?"/static/images/drug.svg":r.item.imgUrl,j:e.t(r.item.goodsName),k:e.t(r.item.integral),l:e.t(r.item.integral),m:r.item!=null},r.item!=null?{n:e.o(i=>o.payOrder())}:{})}var g=e._export_sfc(l,[["render",a],["__file","E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_user/integralOrderPay.vue"]]);wx.createPage(g);
