(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/bargain/activity/activity"],{1531:function(t,e,i){},"2e73":function(t,e,i){"use strict";(function(t){i("8748");n(i("66fd"));var e=n(i("a32d"));function n(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,i("543d")["createPage"])},"5db0":function(t,e,i){"use strict";i.r(e);var n=i("9c7e"),a=i.n(n);for(var r in n)"default"!==r&&function(t){i.d(e,t,(function(){return n[t]}))}(r);e["default"]=a.a},"9bf0":function(t,e,i){"use strict";var n=i("1531"),a=i.n(n);a.a},"9c7e":function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i("2f62");function a(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function r(t){for(var e=1;e-1){var n=i.data.title.split("\n"),a=Math.floor(Math.random()*n.length);e.title=n[a]}}else t.showToast({title:i.msg,icon:"none",duration:1e3})})).catch((function(t){e.$hideLoading()}))},join:function(e){var i=this;i.$request({url:i.$api.bargain.user_join_bargain,data:{bargain_order_id:e}}).then((function(n){if(0==n.code){var a=n.data.queueId,r=n.data.token;i.result(a,r,e)}else t.showToast({title:n.msg,icon:"none",duration:1e3}),"用户已参与本次砍价"==n.msg&&i.getDetail(e,1)})).catch((function(t){i.$hideLoading()}))},result:function(e,i,n){var a=this;a.$request({url:a.$api.bargain.user_join_bargain_result,data:{queueId:e,token:i}}).then((function(r){0==r.code?1==r.data.retry?setTimeout((function(){a.result(e,i,n)}),1e3):(a.$hideLoading(),a.info=r.data.info,a.bargain=r.data.bargain,a.bargainAnimation(),a.getDetail(n,1)):"已砍至最低价"==r.msg?(a.tip=r.msg,a.getDetail(n,1)):t.showToast({title:r.msg,icon:"none",duration:1e3})})).catch((function(t){a.$hideLoading()}))},getDetail:function(e,i){var n=this;n.$request({url:n.$api.bargain.activity,data:{bargain_order_id:e,page:i}}).then((function(e){setTimeout((function(){n.$hideLoading()}),500),0==e.code?e.data.list.length>0?(n.detail=e.data,n.reset_time=n.detail.reset_time,e.data.total_people>3&&(n.toMore=!0,3==e.data.list.length?n.more=!0:n.more=!1),n.list=n.list.concat(e.data.list),n.timer=setInterval((function(){n.time(),0==n.reset_time&&clearInterval(n.timer)}),1e3)):(n.tip="暂无更多用户",n.toMore=!1):t.showModal({title:"提示",content:e.data.msg,showCancel:!1,success:function(e){e.confirm&&t.redirectTo({url:"/pages/index/index"})}})})).catch((function(t){n.$hideLoading()}))},time:function(){this.reset_time=this.reset_time-1,this.dd=0,this.hh=parseInt(this.reset_time/3600),this.reset_time>86400&&(this.dd=parseInt(this.reset_time/86400),this.hh=parseInt((this.reset_time-86400*dd)/3600));var t=this.reset_time%3600;this.mm=parseInt(t/60),this.ss=parseInt(60*(t/60-this.mm)),this.hh<10&&(this.hh="0"+this.hh.toString()),this.mm<10&&(this.mm="0"+this.mm.toString()),this.ss<10&&(this.ss="0"+this.ss.toString())},bargainAnimation:function(){var t=this;t.kanjia=!0,t.dialog=!0,setTimeout((function(){t.kanjia=!1,t.success()}),1200),t.$forceUpdate()},lookMore:function(){this.page++,this.getDetail(this.order_id,this.page)},closeList:function(){this.list=this.list.slice(0,3),this.page=1,this.more=!0},success:function(){this.dialog=!0;var e=t.createAnimation({duration:500,timingFunction:"linear"});this.animation=e,e.scale(1).step().rotate(2).step().rotate(-2).step().rotate(0).step(),this.animationData=e.export()},changeSize:function(){var e=t.createAnimation({duration:1e3,timingFunction:"linear"});this.size=e,e.scale(.8).step().scale(1).step(),this.sizeAnimation=e.export()},toIndex:function(){t.reLaunch({url:"/pages/index/index"})},toBuy:function(){var e=this.detail,i=[{mch_id:0,bargain_order_id:e.bargain_order_id,goods_list:[{id:e.goods_id,attr:[],num:1,cart_id:0,goods_attr_id:e.goods_attr_id}]}];t.navigateTo({url:"/pages/order-submit/order-submit?mch_list="+JSON.stringify(i)+"&preview_url="+encodeURIComponent(this.$api.bargain.order_preview)+"&submit_url="+encodeURIComponent(this.$api.bargain.order_submit)})},toJoin:function(){this.detail.goods_id?t.navigateTo({url:"/plugins/bargain/goods/goods?goods_id="+this.detail.goods_id}):t.showModal({title:"提示",content:"活动已结束",showCancel:!1,success:function(e){e.confirm&&t.redirectTo({url:"/pages/index/index"})}})}}};e.default=c}).call(this,i("543d")["default"])},a32d:function(t,e,i){"use strict";i.r(e);var n=i("f8be"),a=i("5db0");for(var r in a)"default"!==r&&function(t){i.d(e,t,(function(){return a[t]}))}(r);i("9bf0");var o,s=i("f0c5"),u=Object(s["a"])(a["default"],n["b"],n["c"],!1,null,"667d0730",null,!1,n["a"],o);e["default"]=u.exports},f8be:function(t,e,i){"use strict";var n,a=function(){var t=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.dialog=!1},t.e1=function(e){t.tip=""})},r=[];i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){return n}))}},[["2e73","common/runtime","common/vendor"]]]);