2 lines
6.7 KiB
JavaScript
2 lines
6.7 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-420573e1"],{"1f05":function(t,s,r){},"709e":function(t,s,r){"use strict";r("1f05")},bd72:function(t,s,r){"use strict";r.r(s);var e=function(){var t=this,s=t._self._c;return s("div",{staticClass:"cart-box"},[s("div",{staticClass:"nb"},[t._m(0),s("div",{staticClass:"add-deliver"},[t._m(1),s("el-row",[s("el-col",{attrs:{span:12}},[s("div",{staticClass:"sh-address"},[s("ul",[s("li",{staticClass:"default-add"},[s("div",{staticClass:"inner-infos"},[s("div",{staticClass:"addr-hd"},[s("span",[t._v(t._s(t.orderInfo.storeOrderAddressDto.username))])]),s("div",{staticClass:"addr-bd"},[s("span"),s("span",[t._v(t._s(t.orderInfo.storeOrderAddressDto.address)+t._s(t.orderInfo.storeOrderAddressDto.tel))])])])])])])]),s("el-col",{attrs:{span:12}},[s("div",{staticClass:"sh-address",staticStyle:{height:"148px"}},[s("ul",[s("div",{staticStyle:{float:"left","margin-top":"55px"}},[s("img",{staticStyle:{width:"33px",height:"33px","vertical-align":"middle",display:"inline-block","margin-right":"9px"},attrs:{src:"/img/img/wxpay_native.png"}}),s("a",{attrs:{href:"javascript:void(0);"}},[t._v("使用微信扫码支付")])]),s("div",{staticStyle:{float:"left","margin-top":"120px","margin-left":"-120px",color:"red","font-size":"initial"}},[t._v("也可以联系管理员转账")]),s("div",{staticStyle:{width:"146px",height:"146px",float:"left","margin-left":"50px"},attrs:{id:"qrcode"}})])])])],1)],1),s("div",{staticClass:"goods-infor"},[t._m(2),s("div",{staticClass:"goods-table"},[t._m(3),s("div",{staticClass:"goods-tbody"},t._l(t.orderInfo.storeOrderCartDtos,(function(r,e){return s("div",{key:e,staticClass:"goodinfor"},[s("div",{staticClass:"col col1 goods-title-pic"},[s("router-link",{attrs:{to:"/pages/plateform/productDetail?productId="+r.productId,target:"_blank"}},[s("img",{attrs:{src:r.coverPhoto,width:"60",height:"60"}})]),s("div",{staticClass:"goods-describ elli"},[s("p",[s("router-link",{attrs:{to:"/pages/plateform/productDetail?productId="+r.productId,target:"_blank"}},[t._v(" "+t._s(r.prodName)+" ")])],1),s("p",[t._v(t._s(r.prodDesc))])])],1),s("div",{staticClass:"col col3 goods-price"},[t._v(" ¥"+t._s(r.price)+" ")]),s("div",{staticClass:"col col4 good-num"},[t._v(" "+t._s(r.cartNum)+" ")]),s("div",{staticClass:"col col5 orange-bold xiaoji",staticStyle:{"border-bottom":"none"}},[t._v(" ¥"+t._s(r.cartNum*r.price)+" ")])])})),0)])]),s("div",{staticClass:"style-zhifu"},[s("div",{staticClass:"fare-result"},[t._m(4),s("div",{staticClass:"result-box"},[s("ul",[s("li",{staticClass:"first"},[s("div",{staticClass:"calu-box"},[s("p",{staticClass:"slivergrey"},[s("span",[s("b",{staticClass:"orange-bold"},[t._v(t._s(t.orderInfo.totalNum))]),t._v(" 件商品,总计:")]),s("span",{staticClass:"orange-bold big"},[t._v("¥"),s("b",{attrs:{id:"payAmount"}},[t._v(t._s(t.orderInfo.totalPrice))])])]),t._m(5)])])])])])])])])},a=[function(){var t=this,s=t._self._c;return s("div",{staticClass:"cart-step"},[s("ul",[s("li",{staticClass:"cart1"},[s("i"),t._v("购物车")]),s("li",{staticClass:"cart2 oncart2"},[s("i"),t._v("确认订单")]),s("li",{staticClass:"cart3 oncart3"},[s("i"),t._v("付款")]),s("li",{staticClass:"cart4"},[s("i"),t._v("支付成功")])])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"cart-title"},[s("h3",[s("span",[t._v("收货人信息")])])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"cart-title",staticStyle:{"margin-top":"166px"}},[s("h3",[s("span",[t._v("商品信息")])])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"goods-thead"},[s("div",{staticClass:"col col1"},[t._v("商品")]),s("div",{staticClass:"col col3"},[t._v("单价")]),s("div",{staticClass:"col col4"},[t._v("数量")]),s("div",{staticClass:"col col5"},[t._v("小计")])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"cart-title"},[s("h3",[s("span",[t._v("结算信息")])])])},function(){var t=this,s=t._self._c;return s("p",{staticClass:"slivergrey"},[s("span",[t._v("运费:")]),s("span",{staticClass:"txtmoney"},[t._v("¥"),s("b",{attrs:{id:"expfee"}},[t._v("0.00")])])])}],o=r("d044"),i=r.n(o),l=r("b775");function d(t){return new Promise((s,r)=>{Object(l["a"])({url:"/storeOrder.listStoreOrder",method:"get",params:t}).then(t=>{const r=t.data;s(r)}).catch(t=>{r(t)})})}function c(t){return new Promise((s,r)=>{Object(l["a"])({url:"/payment.nativeQrcodePayment",method:"post",data:t,headers:{"Content-Type":"application/json"}}).then(t=>{const r=t.data;s(r)}).catch(t=>{r(t)})})}var n={name:"Pay",data(){return{orderInfo:{appId:"",freightPrice:"",oId:"",orderId:"",personId:"",personName:"",records:0,remark:"",stateName:"",storeOrderAddressDto:{},storeOrderCartDtos:[]},timer:null,stopPolling:!1}},created(){this.listOrders(1,1)},beforeDestroy(){this.timer&&clearInterval(this.timer)},methods:{listOrders(t,s){const r={page:t,row:s,orderId:this.$route.query.orderId};d(r).then(r=>{if(0===r.data.length)this.$message.error("订单号不正确,请正确使用");else{if(this.orderInfo=r.data[0],"0"===this.orderInfo.state)return void this.$router.push("/pages/plateform/paySuccess?orderId="+this.$route.query.orderId);this.caculTotalMount(),this.getQrCode(this.orderInfo),this.startPolling(t,s)}}).catch(t=>{console.log("请求失败处理",t)})},getQrCode(t){"1"!==t.state&&this.$router.push("/pages/plateform/payResult?orderId="+t.orderId);const s={orderId:t.orderId,money:t.totalPrice,name:t.remark};c(s).then(t=>{if(0===t.code)return this.$message.success("请使用微信扫描二维码支付"),void this.viewQr(t.codeUrl);this.$message.error(t.msg)}).catch(t=>{console.log("请求失败处理",t),this.$message.error(t)})},startPolling(t,s){this.timer=setInterval(()=>{const r={page:t,row:s,orderId:this.$route.query.orderId};d(r).then(t=>{if(0===t.data.length)this.$message.error("订单号不正确,请正确使用");else{const s=t.data[0];if("1"!==s.state)return clearInterval(this.timer),void this.$router.push("/pages/plateform/payResult?orderId="+s.orderId)}}).catch(t=>{clearInterval(this.timer),console.log("请求失败处理",t)})},5e3)},viewQr(t){document.getElementById("qrcode").innerHTML="",new i.a(document.getElementById("qrcode"),{text:t,width:146,height:146,colorDark:"#000000",colorLight:"#ffffff",correctLevel:i.a.CorrectLevel.L})},caculTotalMount(){let t=0,s=0;this.orderInfo.storeOrderCartDtos.forEach(r=>{if(isNaN(r.cartNum)||isNaN(r.price))throw this.orderInfo.totalMount="请输入正确的数字",this.orderInfo.totalNum="请输入正确的数字",Error();t+=parseFloat(r.cartNum)*parseFloat(r.price).toFixed(2),s+=parseFloat(r.cartNum)}),this.orderInfo.totalMount=t.toFixed(2),this.orderInfo.totalNum=s}}},p=n,u=(r("709e"),r("2877")),v=Object(u["a"])(p,e,a,!1,null,"144cc326",null);s["default"]=v.exports}}]);
|
|
//# sourceMappingURL=chunk-420573e1.e4febe93.js.map
|