668fc46.js 13 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[43,9,20],{498:function(e,t,r){var content=r(502);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[e.i,content,""]]),content.locals&&(e.exports=content.locals);(0,r(21).default)("1df0c15c",content,!0,{sourceMap:!1})},499:function(e,t,r){"use strict";r(22),r(65);t.a={head:function(){var e=this.$store.getters.headerMeta;return{title:e.title,link:[{rel:"icon",type:"image/x-icon",href:e.ico}],meta:[{hid:"description",name:"description",content:e.description},{hid:"keywords",name:"keywords",content:e.keywords}]}}}},500:function(e,t,r){"use strict";r.r(t);r(309);var n={data:function(){return{priceSlice:{}}},components:{},props:{firstSize:{type:Number,default:14},secondSize:{type:Number,default:14},color:{type:String},weight:{type:[String,Number],default:400},price:{type:[String,Number],default:""},showSubscript:{type:Boolean,default:!0},subscriptSize:{type:Number,default:14},lineThrough:{type:Boolean,default:!1}},created:function(){this.priceFormat()},watch:{price:function(e){this.priceFormat()}},methods:{priceFormat:function(){var e=this.price,t={};null!==e&&(e=parseFloat(e),e=String(e).split("."),t.first=e[0],t.second=e[1],this.priceSlice=t)}}},o=(r(501),r(9)),component=Object(o.a)(n,(function(){var e=this,t=e._self._c;return t("span",{class:(e.lineThrough?"line-through":"")+"price-format",style:{color:e.color,"font-weight":e.weight}},[e.showSubscript?t("span",{style:{"font-size":e.subscriptSize+"px","margin-right":"1px"}},[e._v("¥")]):e._e(),e._v(" "),t("span",{style:{"font-size":e.firstSize+"px","margin-right":"1px"}},[e._v(e._s(e.priceSlice.first))]),e._v(" "),e.priceSlice.second?t("span",{style:{"font-size":e.secondSize+"px"}},[e._v("."+e._s(e.priceSlice.second))]):e._e()])}),[],!1,null,null,null);t.default=component.exports},501:function(e,t,r){"use strict";r(498)},502:function(e,t,r){var n=r(20)((function(i){return i[1]}));n.push([e.i,".price-format{align-items:baseline;display:flex}",""]),n.locals={},e.exports=n},503:function(e,t,r){"use strict";r.r(t);r(309),r(66),r(67),r(13),r(38),r(49),r(87);var n=6e4,o=36e5,c=24*o;function d(e){return(0+e.toString()).slice(-2)}var l={components:{},props:{isSlot:{type:Boolean,default:!1},time:{type:Number,default:0},format:{type:String,default:"hh:mm:ss"},autoStart:{type:Boolean,default:!0}},watch:{time:{immediate:!0,handler:function(e){e&&this.reset()}}},data:function(){return{timeObj:{},formateTime:0}},created:function(){},computed:{},methods:{createTimer:function(e){return setTimeout(e,100)},isSameSecond:function(e,t){return Math.floor(e)===Math.floor(t)},start:function(){this.counting||(this.counting=!0,this.endTime=Date.now()+1e3*this.remain,this.setTimer())},setTimer:function(){var e=this;this.tid=this.createTimer((function(){var t=e.getRemain();e.isSameSecond(t,e.remain)&&0!==t||e.setRemain(t),0!==e.remain&&e.setTimer()}))},getRemain:function(){return Math.max(this.endTime-Date.now(),0)},pause:function(){this.counting=!1,clearTimeout(this.tid)},reset:function(){this.pause(),this.remain=this.time,this.setRemain(this.remain),this.autoStart&&this.start()},setRemain:function(e){var t=this.format;this.remain=e;var time,r=(time=e,{days:Math.floor(time/c),hours:d(Math.floor(time%c/o)),minutes:d(Math.floor(time%o/n)),seconds:d(Math.floor(time%n/1e3))});this.formateTime=function(e,t){var r=t.days,n=t.hours,o=t.minutes,c=t.seconds;return-1!==e.indexOf("dd")&&(e=e.replace("dd",r)),-1!==e.indexOf("hh")&&(e=e.replace("hh",d(n))),-1!==e.indexOf("mm")&&(e=e.replace("mm",d(o))),-1!==e.indexOf("ss")&&(e=e.replace("ss",d(c))),e}(t,r),this.$emit("change",r),0===e&&(this.pause(),this.$emit("finish"))}}},m=r(9),component=Object(m.a)(l,(function(){var e=this,t=e._self._c;return e.time>=0?t("div",[t("client-only",[e.isSlot?e._t("default"):t("span",[e._v(e._s(e.formateTime))])],2)],1):e._e()}),[],!1,null,null,null);t.default=component.exports},507:function(e,t,r){"use strict";r.d(t,"d",(function(){return n})),r.d(t,"e",(function(){return o})),r.d(t,"c",(function(){return c})),r.d(t,"b",(function(){return d})),r.d(t,"a",(function(){return l}));var n=4,o={SMS:0,ACCOUNT:1},c={REGISTER:"ZCYZ",FINDPWD:"ZHMM",LOGIN:"YZMDL",SJSQYZ:"SJSQYZ",CHANGE_MOBILE:"BGSJHM",BIND:"BDSJHM"},d={NONE:"",SEX:"sex",NICKNAME:"nickname",AVATAR:"avatar",MOBILE:"mobile"},l={NORMAL:"apply",HANDLING:"status_ing",FINISH:"status_success_fail"}},554:function(e,t,r){e.exports=r.p+"img/pay_success.ba8c958.png"},591:function(e,t,r){var content=r(644);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[e.i,content,""]]),content.locals&&(e.exports=content.locals);(0,r(21).default)("15d5ba25",content,!0,{sourceMap:!1})},642:function(e,t,r){e.exports=r.p+"img/pay_wait.7e5d06b.png"},643:function(e,t,r){"use strict";r(591)},644:function(e,t,r){var n=r(20)((function(i){return i[1]}));n.push([e.i,".payment[data-v-41aa1bda]{margin:16px 0;padding:0 40px}.payment .payment-hd>img[data-v-41aa1bda]{height:32px;width:32px}.payment .payment-hd .status[data-v-41aa1bda]{font-size:24px}.payment .payment-con[data-v-41aa1bda],.payment .payment-hd[data-v-41aa1bda]{border-bottom:1px dashed hsla(0,0%,90%,.898);padding:32px 0}.payment .payment-con .item[data-v-41aa1bda]{align-items:flex-start}.payment .payment-footer[data-v-41aa1bda]{padding:32px 0}.payment .payment-footer .pay-way[data-v-41aa1bda]{border:1px dashed hsla(0,0%,90%,.898);cursor:pointer;height:68px;margin-right:32px;width:200px}.payment .payment-footer .pay-way img[data-v-41aa1bda]{height:30px;width:30px}.payment .payment-footer .btn[data-v-41aa1bda]{border:1px solid hsla(0,0%,90%,.898);height:40px;width:134px}.payment .el-dialog .pay-code[data-v-41aa1bda]{height:270px;width:270px}.payment .el-dialog .pay-money[data-v-41aa1bda]{align-items:baseline;font-size:18px;margin-top:24px}",""]),n.locals={},e.exports=n},721:function(e,t,r){"use strict";r.r(t);r(32);var n=r(7),o=(r(66),r(48),r(503)),c=(r(507),{mixins:[r(499).a],components:{CountDown:o.default},asyncData:function(e){return Object(n.a)(regeneratorRuntime.mark((function t(){var r,n,o,data;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.query,n=e.$get,t.next=3,n("order/detail",{params:{id:r.id}});case 3:return o=t.sent,data=o.data,t.abrupt("return",{order:data});case 6:case"end":return t.stop()}}),t)})))()},data:function(){return{showWxpay:!1,showAlipay:!1,payWayArr:[],payInfo:{config:{code_url:"",order_amount:0}},cancelTime:0,alipayHtml:"",handlepay:!1}},created:function(){this.id=this.$route.query.id,this.getPayway()},beforeDestroy:function(){clearInterval(this.timer)},methods:{getPayway:function(){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){var r,code,data;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$get("pay/payway",{params:{from:"order",order_id:e.id,scene:4}});case 2:r=t.sent,code=r.code,data=r.data,1==code&&(e.payWayArr=data.lists,e.payWayArr.length||e.$message({message:"请联系管理员配置支付方式",type:"error"}));case 6:case"end":return t.stop()}}),t)})))()},orderPay:function(e){var t=this;return Object(n.a)(regeneratorRuntime.mark((function r(){var n,o,data,code,c,div;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=t.$loading({lock:!0,text:"请稍后...",spinner:"el-icon-loading"}),r.prev=1,r.next=4,t.$post("pay/prepay",{order_id:t.id,pay_way:e,from:"order"});case 4:o=r.sent,data=o.data,code=o.code,o.msg,n.close(),1==code&&2==data.pay_way?(t.payInfo=data,t.showWxpay=!0,t.createTimer()):1==code&&3==data.pay_way?((c=document.getElementsByTagName("divform")).length&&document.body.removeChild(c[0]),(div=document.createElement("divform")).innerHTML=data.config,document.body.appendChild(div),document.forms[0].submit()):1==code&&1==data.pay_way?t.getOrder():1==code&&5==data.pay_way&&(t.handlepay=!0,t.getOrder()),r.next=15;break;case 12:r.prev=12,r.t0=r.catch(1),n.close();case 15:case"end":return r.stop()}}),r,null,[[1,12]])})))()},clearTimer:function(){clearInterval(this.timer)},createTimer:function(){var e=this;this.timer&&clearInterval(this.timer),this.timer=setInterval((function(){e.getOrder()}),2e3)},getOrder:function(){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){var r,data,code;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$get("order/detail",{params:{id:e.id}});case 2:r=t.sent,data=r.data,code=r.code,r.msg,1==code&&(e.order=data,1==data.pay_status&&(clearInterval(e.timer),e.showWxpay=!1,e.$message({message:"支付成功",type:"success"})));case 7:case"end":return t.stop()}}),t)})))()}},computed:{getOrderStatus:function(){return function(e){var text="";switch(e){case 0:text="待支付";break;case 1:text="待发货";break;case 2:text="待收货";break;case 3:text="已完成";break;case 4:text="订单已关闭"}return text}},getCancelTime:function(){return function(time){return time-Date.now()/1e3}}}}),d=(r(643),r(9)),component=Object(d.a)(c,(function(){var e,t,n,o,c,d=this,l=d._self._c;return l("div",{staticClass:"payment bg-white"},[l("div",{staticClass:"payment-hd flex"},[0==d.order.pay_status&&5!==d.order.pay_way?[l("img",{attrs:{src:r(642),alt:""}}),d._v(" "),l("div",{staticClass:"status m-l-8 m-r-16 bold"},[d._v("\n "+d._s(d.getOrderStatus(d.order.order_status))+"\n ")]),d._v(" "),d.getCancelTime(d.order.cancel_unpaid_orders_time)>0?l("div",{staticClass:"row"},[d._v("\n 请在\n "),l("count-down",{style:{color:"#FF2C3C"},attrs:{time:d.getCancelTime(d.order.cancel_unpaid_orders_time),format:"hh时mm分ss秒"},on:{finish:d.getOrder}}),d._v("完成支付, 超时后将取消订单\n ")],1):d._e()]:d._e(),d._v(" "),0==d.order.pay_status&&5==d.order.pay_way?[l("img",{attrs:{src:r(554),alt:""}}),d._v(" "),l("div",{staticClass:"status m-l-8 m-r-16 bold"},[d._v("订单创建成功")]),d._v(" "),l("div",{staticClass:"row"},[d._v("如已付款,请通知商家【确认收款】")])]:d._e(),d._v(" "),1==d.order.pay_status?[l("img",{attrs:{src:r(554),alt:""}}),d._v(" "),l("div",{staticClass:"status m-l-8 m-r-16 bold"},[d._v("支付成功")])]:d._e()],2),d._v(" "),l("div",{staticClass:"payment-con"},[l("div",{staticClass:"item flex m-b-16"},[d._v("订单编号:"+d._s(d.order.sn))]),d._v(" "),l("div",{staticClass:"item flex m-b-16"},[d._v("\n 订单价格:\n "),l("span",{staticClass:"primary"},[d._v("¥"+d._s(d.order.order_amount))])]),d._v(" "),1==d.order.delivery_type?[l("div",{staticClass:"item flex m-b-16"},[d._v("\n 收 货 人:\n "),l("div",[l("span",{staticClass:"bold"},[d._v(" "+d._s(null===(e=d.order.address)||void 0===e?void 0:e.contact)+" ")]),d._v(d._s(null===(t=d.order.address)||void 0===t?void 0:t.mobile)+"\n ")])]),d._v(" "),l("div",{staticClass:"item flex m-b-16"},[d._v("\n 收货地址:\n "),l("div",[l("span",[d._v(d._s(d.order.delivery_address))])])])]:d._e(),d._v(" "),2==d.order.delivery_type?[l("div",{staticClass:"item flex m-b-16"},[d._v("\n 提 货 人:\n "),l("div",[l("span",{staticClass:"bold"},[d._v(" "+d._s(null===(n=d.order.address)||void 0===n?void 0:n.contact)+" ")]),d._v(d._s(null===(o=d.order.address)||void 0===o?void 0:o.mobile)+"\n ")])]),d._v(" "),l("div",{staticClass:"item flex m-b-16"},[d._v("\n 提货地址:\n "),l("div",[l("span",[d._v(d._s(null===(c=d.order.selffetch_shop)||void 0===c?void 0:c.detailed_address))])])])]:d._e(),d._v(" "),l("div",{staticClass:"item flex m-b-16"},[d._v("\n 商品名称:\n "),l("div",d._l(d.order.order_goods,(function(e,t){return l("div",{key:t},[l("div",{staticClass:"flex"},[d._v("\n "+d._s(e.goods_name)+" /\n "),l("span",{staticClass:"m-l-8"},[d._v(d._s(e.spec_value_str))])])])})),0)])],2),d._v(" "),l("div",{staticClass:"payment-footer"},[0!=d.order.pay_status||0!=d.order.order_status||d.handlepay?l("nuxt-link",{staticClass:"btn flex row-center",attrs:{to:"/user/order"}},[d._v("查看订单")]):[l("div",{staticClass:"title lg bold"},[d._v("请选择支付方式")]),d._v(" "),l("div",{staticClass:"flex m-t-16"},d._l(d.payWayArr,(function(e,t){return l("div",{key:t},[l("div",{staticClass:"pay-way flex row-center",on:{click:function(t){return d.orderPay(e.pay_way)}}},[l("img",{attrs:{src:e.icon,alt:""}}),d._v(" "),l("span",{staticClass:"m-l-16 xxl"},[d._v(d._s(e.name))])])])})),0)]],2),d._v(" "),l("el-dialog",{attrs:{title:"微信支付",visible:d.showWxpay,width:"700px",center:""},on:{"update:visible":function(e){d.showWxpay=e},close:d.clearTimer}},[l("div",{staticClass:"flex flex-col row-center black"},[l("vue-qr",{staticClass:"bicode",attrs:{logoScale:20,margin:0,dotScale:1,text:d.payInfo.config.code_url}}),d._v(" "),l("div",{staticClass:"m-t-8",staticStyle:{"font-size":"18px"}},[d._v("\n 微信扫一扫,完成支付\n ")]),d._v(" "),l("div",{staticClass:"pay-money flex"},[l("span",[d._v("需支付金额:")]),d._v(" "),l("span",{staticClass:"primary"},[l("price-formate",{attrs:{price:d.payInfo.config.order_amount,"subscript-size":18,"first-size":28,"second-size":28}})],1)])],1)])],1)}),[],!1,null,"41aa1bda",null);t.default=component.exports;installComponents(component,{CountDown:r(503).default,PriceFormate:r(500).default})}}]);