You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
7.8 KiB
1 lines
7.8 KiB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesB/pages/activity/DargainDetails/index"],{"0572":function(t,a,i){"use strict";(function(t){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=i("70e6"),e=i("2df4"),r=i("2f62");i("bcec");var o=i("b6d1");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("fdd5"))}.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.bargainUid===a.userInfo.uid?(a.helpListStatus=!1,a.page=1,a.bargainHelpList=[],a.getBargainHelpPrice()):t.showToast({title:"您已经砍过了",icon:"none",duration:2e3})})).catch((function(a){t.showToast({title:a.msg,icon:"none",duration:2e3})}))},getBargainHelpPrice:function(){var a=this;(0,n.getBargainHelpPrice)({bargainId:a.bargainId,bargainUserUid:a.bargainUid}).then((function(t){switch(a.bargainHelpPrice=t.data.price,a.getBargainHelpCount(),a.getBargainHelpList(),a.activeMsg){case"SUCCESSFUL":break;case"SUCCESS":a.active=!0;break}})).catch((function(a){t.showToast({title:a.msg,icon:"none",duration:2e3})}))},getBargainHelpList:function(){var a=this;!0!==a.helpListStatus&&(0,n.getBargainHelpList)({bargainId:a.bargainId,bargainUserUid:a.bargainUid,page:a.page,limit:a.limit}).then((function(t){a.helpListStatus=t.data.length<a.limit,1==a.page&&(a.bargainHelpList=[]),a.page++,t.data&&a.bargainHelpList.push.apply(a.bargainHelpList,t.data)})).catch((function(a){a.msg&&t.showToast({title:a.msg||a.response.data.msg||a.response.data.message,icon:"none",duration:2e3})}))},getBargainHelpCount:function(){var a=this;(0,n.getBargainHelpCount)({bargainId:this.bargainId,bargainUserUid:this.bargainUid}).then((function(t){var i=(a.goodsDetail.price-t.data.alreadyPrice).toFixed(2);a.bargainHelpCount=g(g({},t.data),{},{remainingPrice:i}),a.handleButtonStatus()})).catch((function(a){a.msg&&t.showToast({title:a.msg||a.response.data.msg||a.response.data.message,icon:"none",duration:2e3})}))},handleButtonStatus:function(){this.bargainUid===this.userInfo.uid&&0==this.bargainHelpCount.status?this.participate=!0:this.participate=!1,this.bargainUid===this.userInfo.uid&&1==this.bargainHelpCount.status&&this.bargainHelpCount.price>0?this.inviteFriends=!0:this.inviteFriends=!1,this.bargainUid!=this.userInfo.uid&&1==this.bargainHelpCount.status&&this.bargainHelpCount.price>0?this.helpFriendsBargain=!0:this.helpFriendsBargain=!1,this.bargainUid===this.userInfo.uid&&1==this.bargainHelpCount.status&&this.bargainHelpCount.price<=0?this.pay=!0:this.pay=!1,this.bargainUid!=this.userInfo.uid?this.bargain=!0:this.bargain=!1},getBargainStartUser:function(){var a=this;(0,n.getBargainStartUser)({bargainId:a.bargainId,bargainUserUid:a.bargainUid}).then((function(t){a.bargainUserInfo=t.data,a.getBargainHelpList()})).catch((function(a){t.showToast({title:a.msg,icon:"none",duration:2e3})}))},close:function(){this.active=!1},onShareAppMessage:function(){return{title:this.storeInfo.title,imageUrl:this.storeInfo.image,path:"pages/activity/DargainDetails/index?id="+this.storeInfo.id+"&spread="+t.getStorageSync("uid"),success:function(a){t.showToast({title:"分享成功"})},fail:function(a){t.showToast({title:"分享失败",icon:"none"})}}}},onShareAppMessage:function(){return{path:"/pages/activity/DargainDetails/index/?id=".concat(this.$yroute.query.id,"&partake=").concat(this.userInfo.uid)}}};a.default=d}).call(this,i("543d")["default"])},"0ae9":function(t,a,i){"use strict";i.r(a);var n=i("0572"),e=i.n(n);for(var r in n)"default"!==r&&function(t){i.d(a,t,(function(){return n[t]}))}(r);a["default"]=e.a},"19e5":function(t,a,i){"use strict";(function(t){i("ef82");n(i("66fd"));var a=n(i("f6f7"));function n(t){return t&&t.__esModule?t:{default:t}}t(a.default)}).call(this,i("543d")["createPage"])},3933:function(t,a,i){},"867c":function(t,a,i){"use strict";var n=i("3933"),e=i.n(n);e.a},da47:function(t,a,i){"use strict";var n;i.d(a,"b",(function(){return e})),i.d(a,"c",(function(){return r})),i.d(a,"a",(function(){return n}));var e=function(){var t=this,a=t.$createElement;t._self._c},r=[]},f6f7:function(t,a,i){"use strict";i.r(a);var n=i("da47"),e=i("0ae9");for(var r in e)"default"!==r&&function(t){i.d(a,t,(function(){return e[t]}))}(r);i("867c");var o,s=i("f0c5"),g=Object(s["a"])(e["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],o);a["default"]=g.exports}},[["19e5","common/runtime","common/vendor"]]]); |