glhcp/server/public/_nuxt/ef10585.js

1 line
12 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[37,9,18],{488:function(t,e,r){var content=r(491);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,r(18).default)("d7ac674a",content,!0,{sourceMap:!1})},489:function(t,e,r){"use strict";r.r(e);r(300);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(t){this.priceFormat()}},methods:{priceFormat:function(){var t=this.price,e={};null!==t&&(t=String(t).split("."),e.first=t[0],e.second=t[1],this.priceSlice=e)}}},o=(r(490),r(9)),component=Object(o.a)(n,(function(){var t=this,e=t._self._c;return e("span",{class:(t.lineThrough?"line-through":"")+"price-format",style:{color:t.color,"font-weight":t.weight}},[t.showSubscript?e("span",{style:{"font-size":t.subscriptSize+"px","margin-right":"1px"}},[t._v("¥")]):t._e(),t._v(" "),e("span",{style:{"font-size":t.firstSize+"px","margin-right":"1px"}},[t._v(t._s(t.priceSlice.first))]),t._v(" "),t.priceSlice.second?e("span",{style:{"font-size":t.secondSize+"px"}},[t._v("."+t._s(t.priceSlice.second))]):t._e()])}),[],!1,null,null,null);e.default=component.exports},490:function(t,e,r){"use strict";r(488)},491:function(t,e,r){var n=r(17)((function(i){return i[1]}));n.push([t.i,".price-format{align-items:baseline;display:flex}",""]),n.locals={},t.exports=n},496:function(t,e,r){"use strict";r.r(e);r(300),r(87),r(63),r(12),r(47),r(39),r(88);var n=6e4,o=36e5,c=24*o;function d(t){return(0+t.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(t){t&&this.reset()}}},data:function(){return{timeObj:{},formateTime:0}},created:function(){},computed:{},methods:{createTimer:function(t){return setTimeout(t,100)},isSameSecond:function(t,e){return Math.floor(t)===Math.floor(e)},start:function(){this.counting||(this.counting=!0,this.endTime=Date.now()+1e3*this.remain,this.setTimer())},setTimer:function(){var t=this;this.tid=this.createTimer((function(){var e=t.getRemain();t.isSameSecond(e,t.remain)&&0!==e||t.setRemain(e),0!==t.remain&&t.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(t){var e=this.format;this.remain=t;var time,r=(time=t,{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(t,e){var r=e.days,n=e.hours,o=e.minutes,c=e.seconds;return-1!==t.indexOf("dd")&&(t=t.replace("dd",r)),-1!==t.indexOf("hh")&&(t=t.replace("hh",d(n))),-1!==t.indexOf("mm")&&(t=t.replace("mm",d(o))),-1!==t.indexOf("ss")&&(t=t.replace("ss",d(c))),t}(e,r),this.$emit("change",r),0===t&&(this.pause(),this.$emit("finish"))}}},m=r(9),component=Object(m.a)(l,(function(){var t=this,e=t._self._c;return t.time>=0?e("div",[e("client-only",[t.isSlot?t._t("default"):e("span",[t._v(t._s(t.formateTime))])],2)],1):t._e()}),[],!1,null,null,null);e.default=component.exports},501:function(t,e,r){"use strict";r.d(e,"d",(function(){return n})),r.d(e,"e",(function(){return o})),r.d(e,"c",(function(){return c})),r.d(e,"b",(function(){return d})),r.d(e,"a",(function(){return l}));var n=5,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:"normal",HANDLING:"apply",FINISH:"finish"}},553:function(t,e,r){t.exports=r.p+"img/pay_success.ba8c958.png"},574:function(t,e,r){var content=r(629);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,r(18).default)("0b99cf8c",content,!0,{sourceMap:!1})},627:function(t,e,r){t.exports=r.p+"img/pay_wait.7e5d06b.png"},628:function(t,e,r){"use strict";r(574)},629:function(t,e,r){var n=r(17)((function(i){return i[1]}));n.push([t.i,".payment[data-v-3bd5351c]{margin:16px 0;padding:0 40px}.payment .payment-hd>img[data-v-3bd5351c]{height:32px;width:32px}.payment .payment-hd .status[data-v-3bd5351c]{font-size:24px}.payment .payment-con[data-v-3bd5351c],.payment .payment-hd[data-v-3bd5351c]{border-bottom:1px dashed hsla(0,0%,90%,.898);padding:32px 0}.payment .payment-con .item[data-v-3bd5351c]{align-items:flex-start}.payment .payment-footer[data-v-3bd5351c]{padding:32px 0}.payment .payment-footer .pay-way[data-v-3bd5351c]{border:1px dashed hsla(0,0%,90%,.898);cursor:pointer;height:68px;margin-right:32px;min-width:200px;padding:0 20px}.payment .payment-footer .pay-way img[data-v-3bd5351c]{height:30px;width:30px}.payment .payment-footer .btn[data-v-3bd5351c]{border:1px solid hsla(0,0%,90%,.898);height:40px;width:134px}.payment .el-dialog .pay-code[data-v-3bd5351c]{height:270px;width:270px}.payment .el-dialog .pay-money[data-v-3bd5351c]{align-items:baseline;font-size:18px;margin-top:24px}",""]),n.locals={},t.exports=n},712:function(t,e,r){"use strict";r.r(e);r(30);var n=r(8),o=(r(87),r(56),r(501),{head:function(){return{title:this.$store.getters.headTitle,link:[{rel:"icon",type:"image/x-icon",href:this.$store.getters.favicon}]}},asyncData:function(t){return Object(n.a)(regeneratorRuntime.mark((function e(){var r,n,o,data;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.query,n=t.$get,e.next=3,n("order/getPayStatus",{params:{id:r.id,from:r.from}});case 3:return o=e.sent,data=o.data,e.abrupt("return",{order:data,address:data.address});case 6:case"end":return e.stop()}}),e)})))()},data:function(){return{showWxpay:!1,showAlipay:!1,payWayArr:[],payInfo:{},cancelTime:0,alipayHtml:"",address:{}}},created:function(){this.id=this.$route.query.id,this.from=this.$route.query.from,this.getPayway()},beforeDestroy:function(){clearInterval(this.timer)},methods:{getPayway:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r,code,data;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$get("order/getPayWay",{params:{from:"order",order_id:t.id}});case 2:r=e.sent,code=r.code,data=r.data,1==code&&(t.payWayArr=data.pay_way,t.payWayArr.length||t.$message({message:"请联系管理员配置支付方式",type:"error"}));case 6:case"end":return e.stop()}}),e)})))()},orderPay:function(t){var e=this;return Object(n.a)(regeneratorRuntime.mark((function r(){var n,data,code,o,c,div;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.$post("pay/unifiedpay",{order_id:e.id,pay_way:t,from:e.from});case 2:n=r.sent,data=n.data,code=n.code,o=n.msg,1==code?(e.payInfo=data,e.showWxpay=!0,e.createTimer()):10001==code?((c=document.getElementsByTagName("divform")).length&&document.body.removeChild(c[0]),(div=document.createElement("divform")).innerHTML=data,document.body.appendChild(div),document.forms[0].submit()):20001==code&&(e.$message({message:o,type:"success"}),e.getOrder());case 7:case"end":return r.stop()}}),r)})))()},clearTimer:function(){clearInterval(this.timer)},createTimer:function(){var t=this;this.timer&&clearInterval(this.timer),this.timer=setInterval((function(){t.getOrder()}),2e3)},getOrder:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r,data,code;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$get("order/getPayStatus",{params:{id:t.id,from:t.from}});case 2:r=e.sent,data=r.data,code=r.code,r.msg,1==code&&(t.order=data,1==data.pay_status&&(clearInterval(t.timer),t.showWxpay=!1));case 7:case"end":return e.stop()}}),e)})))()}},computed:{getOrderStatus:function(){return function(t){var text="";switch(t){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}}}}),c=(r(628),r(9)),component=Object(c.a)(o,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"payment bg-white"},[e("div",{staticClass:"payment-hd flex"},[0==t.order.pay_status?[e("img",{attrs:{src:r(627),alt:""}}),t._v(" "),e("div",{staticClass:"status m-l-8 m-r-16 weight-500"},[t._v("\n "+t._s(t.getOrderStatus(t.order.order_status))+"\n ")]),t._v(" "),t.getCancelTime(t.order.cancel_time)>0?e("div",{staticClass:"flex"},[t._v("\n 请在\n "),e("count-down",{style:{color:"#FF2C3C"},attrs:{time:t.getCancelTime(t.order.cancel_time),format:"hh时mm分ss秒"},on:{finish:t.getOrder}}),t._v("\n 完成支付, 超时后将取消订单\n ")],1):t._e()]:t._e(),t._v(" "),1==t.order.pay_status?[e("img",{attrs:{src:r(553),alt:""}}),t._v(" "),e("div",{staticClass:"status m-l-8 m-r-16 weight-500"},[t._v("支付成功")])]:t._e()],2),t._v(" "),e("div",{staticClass:"payment-con"},[e("div",{staticClass:"item flex m-b-16"},[t._v("订单编号:"+t._s(t.order.order_sn))]),t._v(" "),e("div",{staticClass:"item flex m-b-16"},[t._v("\n 订单价格:"),e("span",{staticClass:"primary"},[t._v("¥"+t._s(t.order.total_amount))])]),t._v(" "),e("div",{staticClass:"item flex m-b-16"},[t._v("\n 收货地址:\n "),e("div",[t._v("\n "+t._s(t.address.contact)+" "+t._s(t.address.mobile)+"\n "),e("span",{staticClass:"m-l-16"},[t._v(t._s(t.address.delivery_address))])])]),t._v(" "),e("div",{staticClass:"item flex m-b-16"},[t._v("\n 商品名称:\n "),e("div",t._l(t.order.order_goods,(function(r,n){return e("div",{key:n},[e("div",{staticClass:"flex lin-1"},[t._v("\n 【商品"+t._s(n+1)+"】- "+t._s(r.goods_name)+"\n ")])])})),0)])]),t._v(" "),e("div",{staticClass:"payment-footer"},[0==t.order.pay_status&&0==t.order.order_status?[e("div",{staticClass:"title lg weight-500"},[t._v("请选择支付方式")]),t._v(" "),e("div",{staticClass:"flex m-t-16"},t._l(t.payWayArr,(function(r,n){return e("div",{key:n,staticClass:"pay-way flex row-center",on:{click:function(e){return t.orderPay(r.pay_way)}}},[e("img",{attrs:{src:r.image,alt:""}}),t._v(" "),e("div",{staticClass:"m-l-16"},[e("span",{staticClass:"md"},[t._v(t._s(r.name))]),t._v(" "),e("div",{staticClass:"muted m-t-2 sm"},[t._v(t._s(r.extra))])])])})),0)]:e("nuxt-link",{staticClass:"btn flex row-center",attrs:{to:"/user/order"}},[t._v("查看订单")])],2),t._v(" "),e("el-dialog",{attrs:{title:"微信支付",visible:t.showWxpay,width:"700px",center:""},on:{"update:visible":function(e){t.showWxpay=e},close:t.clearTimer}},[e("div",{staticClass:"flex-col col-center black"},[e("img",{staticClass:"pay-code",attrs:{src:t.payInfo,alt:""}}),t._v(" "),e("div",{staticClass:"m-t-8",staticStyle:{"font-size":"18px"}},[t._v("\n 微信扫一扫,完成支付\n ")]),t._v(" "),e("div",{staticClass:"pay-money flex"},[e("span",[t._v("需支付金额:")]),t._v(" "),e("span",{staticClass:"primary"},[e("price-formate",{attrs:{price:t.order.total_amount,"subscript-size":18,"first-size":28,"second-size":28}})],1)])])])],1)}),[],!1,null,"3bd5351c",null);e.default=component.exports;installComponents(component,{CountDown:r(496).default,PriceFormate:r(489).default})}}]);