|
|
|
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesB/pages/activity/DargainDetails/index"],{"2f79":function(t,a,i){"use strict";(function(t){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=i("8c03"),e=i("fc49"),r=i("2f62");i("183b");var o=i("8c38");function s(t,a){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable}))),i.push.apply(i,n)}return i}function g(t){for(var a=1;a<arguments.length;a++){var i=null!=arguments[a]?arguments[a]:{};a%2?s(Object(i),!0).forEach((function(a){u(t,a,i[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(i,a))}))}return t}function u(t,a,i){return a in t?Object.defineProperty(t,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[a]=i,t}var c=function(){i.e("components/CountDown").then(function(){return resolve(i("7e6d"))}.bind(null,i)).catch(i.oe)},d={name:"DargainDetails",components:{CountDown:c},props:{},data:function(){return{bargainId:0,bargainSumCount:0,activeMsg:"",active:!1,bargainHelpPrice:0,bargainHelpList:[],helpListStatus:!1,page:1,limit:2,pricePercent:0,bargainShare:{},bargainHelpCount:{},goodsDetail:{},bargainUserInfo:[],bargainUid:0,pay:!1,bargain:!1,participate:!1,inviteFriends:!1,helpFriendsBargain:!1,bargainSuccess:!1,mainBargainSuccess:!1}},computed:(0,r.mapGetters)(["userInfo","isLogin"]),mounted:function(){this.mountedStart()},methods:{mountedStart:function(){var t=this,a=(0,o.handleQrCode)();a?(t.bargainId=a.bargainId,t.bargainUid=a.partake):(t.bargainId=t.$yroute.query.id,t.bargainUid=t.$yroute.query.partake),0!=this.bargainUid&&this.bargainUid||(t.bargainUid=t.userInfo.uid),t.getBargainDetail(),t.getBargainShare(0),t.bargainUid!==t.userInfo.uid&&t.getBargainStartUser()},goParticipate:function(){this.bargainUid===this.userInfo.uid?this.getBargainStart():this.getBargainStartUser(),this.getBargainHelpCount()},openAlone:function(){this.$yrouter.push({path:"/pages/shop/GoodsCon/index",query:{id:this.goodsDetail.productId}})},goPay:function(){var a={},i=this;a.productId=i.goodsDetail.productId,a.cartNum=i.goodsDetail.num,a.uniqueId="",a.bargainId=i.bargainId,a.new=1,(0,e.postCartAdd)(a).then((function(t){i.$yrouter.push({path:"/pages/order/OrderSubmission/index",query:{id:t.data.cartId}})})).catch((function(a){t.showToast({title:a.msg||a.response.data.msg||a.response.data.message,icon:"none",duration:2e3})}))},goPoster:function(){var t=this;t.getBargainShare(t.bargainId),this.$yrouter.push({path:"/pages/activity/Poster/index",query:{id:t.bargainId,type:2}})},goList:function(){this.$yrouter.push({path:"/pages/activity/GoodsBargain/index"})},getBargainShare:function(t){var a=this;(0,n.getBargainShare)({bargainId:t}).then((function(t){a.bargainShare=t.data}))},getBargainDetail:function(){var a=this;t.showLoading({title:"加载中",mask:!0}),(0,n.getBargainDetail)(a.bargainId).then((function(i){t.hideLoading(),a.goodsDetail=i.data.bargain,console.log(a.goodsDetail),a.goodsDetail.description=a.goodsDetail.description.replace(/\<img/gi,'<img style="max-width:100%;height:auto;"'),a.goodsDetail.rule=a.goodsDetail.rule.replace(/\<img/gi,'<img style="max-width:100%;height:auto;"'),a.getBargainHelpCount()})).catch((function(a){t.hideLoading(),t.showToast({title:a.msg,icon:"none",duration:2e3})}))},getBargainStart:function(){var a=this;(0,n.getBargainStart)({bargainId:a.bargainId}).then((function(){a.bargainUid=a.userInfo.uid,a.getBargainHelp(),a.getBargainHelpCount()})).catch((function(a){t.showToast({title:a.msg,icon:"none",duration:2e3})}))},getBargainHelp:function(){var a=this;if(0===this.bargainHelpCount.price&&a.bargainUid!==a.userInfo.uid)return t.showToast({title:"好友已经砍价成功",icon:"success",duration:2e3});var i={bargainId:a.bargainId,bargainUserUid:a.bargainUid};(0,n.getBargainHelp)(i).then((function(i){a.activeMsg=i.data.status,"SUCCESSFUL"!==i.data.status||a.b
|