;(function(){function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}System.register(['./vendor-legacy.73abbe39.js','./index-legacy.f25f109a4.js','./index-legacy.f25f109a9.js','./index-legacy.f25f109a12.js','./index-legacy.f25f109a2.js','./index-legacy.f25f109a.js','./index-legacy.f25f109a11.js','./cart-legacy.e8d257f5.js','./index.module-legacy.f5231e7e.js','./index-legacy.e06a4f89.js','./index-legacy.73b66cf6.js','./index-legacy.01f5e72c.js','./index-legacy.18c5eaef.js','./index-legacy.f25f109a7.js','./index-legacy.f25f109a8.js','./index-legacy.637f35563.js'],function(exports){'use strict';var defineComponent,ref,watch,useRouter,createVNode,Card,CellGroup,Cell,SubmitBar,createTextVNode,Popup,Fragment,Toast,cartConfirm,formateAttr,styles,Address,moneyFormat,ColResult,request,ColProtocol,Payment,ColHeader;return{setters:[function(module){defineComponent=module.d;ref=module.M;watch=module.a8;useRouter=module.a6;createVNode=module.b;Card=module.a3;CellGroup=module.m;Cell=module.p;SubmitBar=module.a0;createTextVNode=module.j;Popup=module.P;Fragment=module.F;Toast=module.T;},function(){},function(){},function(){},function(){},function(){},function(){},function(module){cartConfirm=module.c;formateAttr=module.f;},function(module){styles=module.s;},function(module){Address=module.A;},function(module){moneyFormat=module.m;ColResult=module.C;request=module.r;},function(module){ColProtocol=module.C;Payment=module.P;},function(module){ColHeader=module.C;},function(){},function(){},function(){}],execute:function execute(){var index=exports('default',defineComponent({name:'cartConfirmAgin',setup:function setup(){var _cartConfirm$orderInf,_cartConfirm$orderInf2,_cartConfirm$orderInf3,_cartConfirm$orderInf4,_cartConfirm$orderInf5,_cartConfirm$orderInf6,_cartConfirm$orderInf7,_cartConfirm$orderInf8,_cartConfirm$orderInf9,_cartConfirm$orderInf10,_cartConfirm$orderInf11,_cartConfirm$orderInf12;// console.log(cartConfirm)
var list=((_cartConfirm$orderInf=cartConfirm.orderInfo)===null||_cartConfirm$orderInf===void 0?void 0:_cartConfirm$orderInf.orderItemList)||[];var calcAmount={totalAmount:((_cartConfirm$orderInf2=cartConfirm.orderInfo)===null||_cartConfirm$orderInf2===void 0?void 0:_cartConfirm$orderInf2.totalAmount)||0,payAmount:((_cartConfirm$orderInf3=cartConfirm.orderInfo)===null||_cartConfirm$orderInf3===void 0?void 0:_cartConfirm$orderInf3.payAmount)||0,freightAmount:((_cartConfirm$orderInf4=cartConfirm.orderInfo)===null||_cartConfirm$orderInf4===void 0?void 0:_cartConfirm$orderInf4.freightAmount)||0,couponAmount:(_cartConfirm$orderInf5=cartConfirm.orderInfo)===null||_cartConfirm$orderInf5===void 0?void 0:_cartConfirm$orderInf5.couponAmount};ref(0);// 0->未支付；1->支付宝；2->微信
var address={city:(_cartConfirm$orderInf6=cartConfirm.orderInfo)===null||_cartConfirm$orderInf6===void 0?void 0:_cartConfirm$orderInf6.receiverCity,detailAddress:(_cartConfirm$orderInf7=cartConfirm.orderInfo)===null||_cartConfirm$orderInf7===void 0?void 0:_cartConfirm$orderInf7.receiverDetailAddress,name:(_cartConfirm$orderInf8=cartConfirm.orderInfo)===null||_cartConfirm$orderInf8===void 0?void 0:_cartConfirm$orderInf8.receiverName,phoneNumber:(_cartConfirm$orderInf9=cartConfirm.orderInfo)===null||_cartConfirm$orderInf9===void 0?void 0:_cartConfirm$orderInf9.receiverPhone,postCode:(_cartConfirm$orderInf10=cartConfirm.orderInfo)===null||_cartConfirm$orderInf10===void 0?void 0:_cartConfirm$orderInf10.receiverPostCode,province:(_cartConfirm$orderInf11=cartConfirm.orderInfo)===null||_cartConfirm$orderInf11===void 0?void 0:_cartConfirm$orderInf11.receiverProvince,region:(_cartConfirm$orderInf12=cartConfirm.orderInfo)===null||_cartConfirm$orderInf12===void 0?void 0:_cartConfirm$orderInf12.receiverRegion};var agreeStatus=ref(false);var paymentPopup=ref(false);var authPopup=ref(false);var orderInfo=ref();//修复实名认证头部问题
watch(authPopup,function(value,oldValue){if(authPopup.value){// 设置是否显示导航栏 0 显示 1 不显示
postMessage({api:'setBarStatus',content:{status:0}});}else{postMessage({api:'setBarStatus',content:{status:1}});}});// 提交
var _onSubmit=function onSubmit(){if(!agreeStatus.value){Toast('请先阅读并同意《产品及服务协议》');return;}// const users = state.user.data
// 判断是否需要实名认证
// if (!users?.student.realName || !users?.student.idCardNo) {
//   authPopup.value = true
//   return
// }
// 判断是否有订单号
createOrder();};var router=useRouter();var createOrder=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var body,_yield$request$post,code,data;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:console.log(cartConfirm);body={orderNo:cartConfirm.orderInfo.orderSn};_context.prev=2;_context.next=5;return request.post('/api-mall-portal/order/generateOrder',{data:body});case 5:_yield$request$post=_context.sent;code=_yield$request$post.code;data=_yield$request$post.data;if(code===200){paymentPopup.value=true;orderInfo.value=data;}_context.next=13;break;case 11:_context.prev=11;_context.t0=_context["catch"](2);case 13:case"end":return _context.stop();}}},_callee,null,[[2,11]]);}));return function createOrder(){return _ref.apply(this,arguments);};}();return function(){return createVNode(Fragment,null,[createVNode(ColHeader,null,null),list.length?createVNode("div",{"class":styles.cartConfirm},[createVNode("div",{"class":styles.cartConfirmBox},[createVNode(Address,{"item":address,"isLink":false},null)]),createVNode("div",{"style":{marginTop:'20px'},"class":[styles.cartBox,styles.cartConfirmBox]},[createVNode("div",{"class":styles.shopBox},[list.map(function(item){return createVNode("div",{"class":[styles.cartItem],"style":{marginBottom:'10px'}},[createVNode(Card,{"price":moneyFormat(item.productPrice),"desc":formateAttr(item.productAttr),"title":item.productName,"thumb":item.productPic,"num":item.productQuantity},null)]);})]),createVNode(CellGroup,{"border":true},{default:function _default(){return[createVNode(Cell,{"border":false,"title":"优惠券"},{value:function value(){return createVNode("span",{"style":{fontSize:'0.42667rem',color:'#ff3535',fontWeight:'bold'}},['-¥ '+calcAmount.couponAmount]);}}),createVNode(Cell,{"border":false,"title":"总额","value":'¥ '+calcAmount.totalAmount},null)];}})]),createVNode("div",{"class":styles.payProtocol},[createVNode(ColProtocol,{"modelValue":agreeStatus.value,"onUpdate:modelValue":function onUpdateModelValue($event){return agreeStatus.value=$event;}},null),createVNode(SubmitBar,{"buttonText":"\u7ED3\u7B97(".concat(list.length,")"),"buttonColor":"var(--van-primary)","disabled":list.length===0,"onSubmit":function onSubmit(){return _onSubmit();}},{default:function _default(){return[createVNode("div",{"class":styles.confirmBottom},[createTextVNode("\u5408\u8BA1"),' ',createVNode("span",{"class":styles['price-des']},[createTextVNode("\xA5"),moneyFormat(calcAmount.payAmount)])])];}})]),createVNode("div",{"style":{height:'var(--van-submit-bar-height)'}},null),createVNode(Popup,{"show":paymentPopup.value,"closeOnClickOverlay":false,"position":"bottom","round":true,"closeOnPopstate":true,"safeAreaInsetBottom":true,"style":{minHeight:'30%'}},{default:function _default(){return[createVNode(Payment,{"modelValue":paymentPopup.value,"onUpdate:modelValue":function onUpdateModelValue($event){return paymentPopup.value=$event;},"orderInfo":orderInfo.value,"paymentType":"goodsPay","onBackOut":function onBackOut(){return paymentPopup.value=false;}},null)];}})]):createVNode(ColResult,{"buttonText":"去购物车","onClick":function onClick(){router.push({path:'/cart'});}},null)]);};}}));}};});})();
