| 1 |
- require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["bundle/pages/seckill_detail/seckill_detail"],{"42c0":function(e,n,t){"use strict";(function(e,n){var o=t("47a9");t("b46f");o(t("3240"));var i=o(t("9315"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(i.default)}).call(this,t("3223")["default"],t("df3c")["createPage"])},5842:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"c",(function(){return s})),t.d(n,"a",(function(){return o}));var o={navbar:function(){return Promise.all([t.e("common/vendor"),t.e("components/navbar/navbar")]).then(t.bind(null,"909a"))},bubble:function(){return t.e("components/bubble/bubble").then(t.bind(null,"8899"))},goodsSwiper:function(){return t.e("components/goods-swiper/goods-swiper").then(t.bind(null,"8dda"))},price:function(){return t.e("components/price/price").then(t.bind(null,"1266"))},countDown:function(){return t.e("components/count-down/count-down").then(t.bind(null,"3c21"))},uIcon:function(){return t.e("components/uview-ui/components/u-icon/u-icon").then(t.bind(null,"1340"))},uPopup:function(){return t.e("components/uview-ui/components/u-popup/u-popup").then(t.bind(null,"002f"))},goodsSpec:function(){return Promise.all([t.e("common/vendor"),t.e("components/goods-spec/goods-spec")]).then(t.bind(null,"b12d"))},wReviews:function(){return t.e("components/widgets/reviews/reviews").then(t.bind(null,"6ef1"))},wGoodsrecom:function(){return t.e("components/widgets/goodsrecom/goodsrecom").then(t.bind(null,"ef69"))},uParse:function(){return Promise.all([t.e("common/vendor"),t.e("components/uview-ui/components/u-parse/u-parse")]).then(t.bind(null,"ee86"))},sharePopup:function(){return t.e("components/share-popup/share-popup").then(t.bind(null,"f897"))},pageStatus:function(){return t.e("components/page-status/page-status").then(t.bind(null,"7cfb"))},uEmpty:function(){return t.e("components/uview-ui/components/u-empty/u-empty").then(t.bind(null,"7bc9"))},uBackTop:function(){return t.e("components/uview-ui/components/u-back-top/u-back-top").then(t.bind(null,"c97f"))}},i=function(){var e=this,n=e.$createElement,t=(e._self._c,{background:"rgba(256,256,256,"+e.percent+")"}),o=Number(e.goodsInfo.min_price),i=e.goodsInfo.service_guarantee.length,s=i?e.__map(e.goodsInfo.service_guarantee,(function(n,t){var o=e.__get_orig(n),i=e.goodsInfo.service_guarantee.length;return{$orig:o,g1:i}})):null,r={image:e.goodsInfo.image,price:e.activityInfo.min_seckill_price,stock:e.goodsInfo.total_stock,unit:e.goodsInfo.unit_name,limit_type:0==e.activityInfo.max_buy?1:3,limit_value:e.activityInfo.max_buy},c={path:"/pages/goods_detail/goods_detail",query:{id:e.goodsInfo.id}},u={image:e.goodsInfo.image,name:e.goodsInfo.name};e._isMounted||(e.e0=function(n){e.showShare=!0},e.e1=function(n){e.showSafeguard=!0},e.e2=function(n){e.showSafeguard=!1},e.e3=function(n){e.showSafeguard=!1},e.e4=function(n){e.showGoodsSpec=!1}),e.$mp.data=Object.assign({},{$root:{a0:t,m0:o,g0:i,l0:s,a1:r,a2:c,a3:u}})},s=[]},"6fcd":function(e,n,t){},9315:function(e,n,t){"use strict";t.r(n);var o=t("5842"),i=t("b68f");for(var s in i)["default"].indexOf(s)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(s);t("a9e2");var r=t("828b"),c=Object(r["a"])(i["default"],o["b"],o["c"],!1,null,"cf2c32c4",null,!1,o["a"],void 0);n["default"]=c.exports},a9e2:function(e,n,t){"use strict";var o=t("6fcd"),i=t.n(o);i.a},af9b:function(e,n,t){"use strict";(function(e){var o=t("47a9");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=o(t("7eb4")),s=o(t("ee10")),r=o(t("7ca3")),c=t("1815"),u=t("dc70"),a=t("30a0"),d=t("704d"),l=t("8f59"),p=t("7398"),f=o(t("32e8"));function g(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?g(Object(t),!0).forEach((function(n){(0,r.default)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):g(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var m={name:"GoodsDetail",mixins:[f.default],data:function(){return{addressId:"",isDischarge:!1,pageStatus:d.PageStatusEnum["LOADING"],pagesData:[],pageErrorMsg:"",scrollTop:0,percent:0,showShare:!1,goodsInfo:{free_shipping_tips:"",service_guarantee:[],address:{}},goodsComment:{},seckillID:"",goodsID:"",isGoodsCollect:!1,showSafeguard:!1,showGoodsSpec:!1,goodsSpecOptions:{},specButtonsList:[],specButtonsGroups:{buy:{event:"buy",text:"立即抢购"}},activityInfo:{}}},computed:h(h({},(0,l.mapGetters)(["isLogin","ServiceConfig","userInfo","appConfig","shareConfig"])),{},{specValueStr:function(){var e,n,t;return null!==(e=null===(n=this.goodsSpecOptions)||void 0===n||null===(t=n.spec)||void 0===t?void 0:t.spec_value_str)&&void 0!==e?e:""}}),methods:{gotoService:function(){this.$Router.push({path:"/bundle/pages/artificial_service/artificial_service"})},handleSend:function(){var n=this;e.$once("changeAddress",function(){var e=(0,s.default)(i.default.mark((function e(t){return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n.addressId=t,e.next=3,n.initGoodsDetail();case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),this.$Router.push({path:"/pages/address/address",query:{type:1}})},getPage:function(){var n=this;(0,u.apiGetPage)({type:5,goods_id:this.goodsID}).then((function(t){var o=t.common,i=t.content;n.pagesData=i,e.setNavigationBarTitle({title:o.title})}))},changeGoodsSpec:function(e){this.goodsSpecOptions=e,console.log(e)},onCart:function(){this.showGoodsSpec=!0,this.specButtonsList=[this.specButtonsGroups.cart]},changeCollect:function(e){var n=this;if(e=e?0:1,!this.isLogin)return this.$Router.push("/pages/login/login");(0,a.apiGoodsCollect)({goods_id:this.goodsID,is_collect:e}).then((function(t){n.isGoodsCollect=e})).catch((function(e){console.log(e)}))},goHome:function(){this.$Router.replaceAll({path:"/pages/index/index"})},goCart:function(){this.$Router.replaceAll({path:"/pages/shop_cart/shop_cart"})},onBuy:function(){this.showGoodsSpec=!0,this.specButtonsList=[this.specButtonsGroups["buy"]]},onGoodsOptions:function(){this.showGoodsSpec=!0,this.specButtonsList=[this.specButtonsGroups["buy"]]},handleBuy:function(e){var n,t=e.spec,o=e.number;this.$Router.push({path:"/pages/goods_order/goods_order",query:{from:d.OrderTypeEnum["SECKILL"],payload:{address_id:this.addressId,seckill_id:null===(n=this.activityInfo)||void 0===n?void 0:n.id,goods:[{goods_num:o,item_id:t.id}]}}})},initGoodsDetail:function(){var e=this;return new Promise((function(n,t){(0,c.apiSeckillDetail)({id:e.seckillID,address_id:e.addressId}).then((function(n){e.goodsInfo=n,e.goodsID=n.id,e.activityInfo=n.activity;var t="[]"!==JSON.stringify(n.goods_comment);return e.goodsComment=t?n.goods_comment:{},e.isGoodsCollect=!!n.is_collect,n})).then((function(e){n(e)})).catch((function(e){t(e)}))}))}},onPageScroll:function(n){var t=e.upx2px(100),o=n.scrollTop;this.percent=o/t>1?1:o/t,this.scrollTop=o},onLoad:function(){var e=this;return(0,s.default)(i.default.mark((function n(){var t;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t=e.$Route.query,e.seckillID=t["scene"]?(0,p.strToParams)(t["scene"])["id"]:t.id,n.prev=2,e.seckillID){n.next=5;break}throw new Error("该商品不存在");case 5:return n.next=7,e.initGoodsDetail();case 7:return n.next=9,e.getPage();case 9:e.pageStatus=d.PageStatusEnum["NORMAL"],n.next=17;break;case 12:n.prev=12,n.t0=n["catch"](2),console.log(n.t0),e.pageErrorMsg=n.t0,e.pageStatus=d.PageStatusEnum["ERROR"];case 17:case"end":return n.stop()}}),n,null,[[2,12]])})))()},onShareAppMessage:function(){var e=this.goodsInfo,n=e.name,t=e.image;return{title:n,path:"/bundle/pages/seckill_detail/seckill_detail?id=".concat(this.seckillID,"&invite_code=").concat(this.userInfo.code),imageUrl:t}},onHide:function(){this.isDischarge=!0},onShow:function(){this.isDischarge=!1}};n.default=m}).call(this,t("df3c")["default"])},b68f:function(e,n,t){"use strict";t.r(n);var o=t("af9b"),i=t.n(o);for(var s in o)["default"].indexOf(s)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(s);n["default"]=i.a}},[["42c0","common/runtime","common/vendor"]]]);
|