| 1 |
- require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["bundle/pages/presell_detail/presell_detail"],{"091a":function(e,n,t){"use strict";(function(e,n){var o=t("47a9");t("b46f");o(t("3240"));var s=o(t("b994"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(s.default)}).call(this,t("3223")["default"],t("df3c")["createPage"])},"6aa6":function(e,n,t){"use strict";var o=t("7181"),s=t.n(o);s.a},"6c27":function(e,n,t){"use strict";(function(e){var o=t("47a9");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var s=o(t("7eb4")),i=o(t("ee10")),r=o(t("7ca3")),u=(t("1815"),t("dc70")),a=t("30a0"),c=t("704d"),d=t("8f59"),p=t("7398"),l=o(t("32e8"));function f(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 g(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?f(Object(t),!0).forEach((function(n){(0,r.default)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var h={name:"GoodsDetail",mixins:[l.default],data:function(){return{addressId:"",isDischarge:!1,pageStatus:c.PageStatusEnum["LOADING"],pagesData:[],pageErrorMsg:"",scrollTop:0,percent:0,showShare:!1,goodsInfo:{free_shipping_tips:"",service_guarantee:[],address:{}},goodsComment:{},Presell:"",goodsID:"",isGoodsCollect:!1,showSafeguard:!1,showGoodsSpec:!1,goodsSpecOptions:{},specButtonsList:[],specButtonsGroups:{buy:{event:"buy",text:"立即预定"}},activityInfo:{goods_detail:{}}}},computed:g(g({},(0,d.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,i.default)(s.default.mark((function e(t){return s.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,s=t.content;n.pagesData=s,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:c.OrderTypeEnum["PRESELL"],payload:{address_id:this.addressId,presell_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,a.apiGoodsDetail)({id:e.goodsID,address_id:e.addressId}).then((function(n){return e.goodsInfo=n,e.goodsID=n.id,e.activityInfo=n.presell,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,i.default)(s.default.mark((function n(){var t;return s.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t=e.$Route.query,e.goodsID=t["scene"]?(0,p.strToParams)(t["scene"])["id"]:t.id,n.prev=2,e.goodsID){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=c.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=c.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/presell_detail/presell_detail?id=".concat(this.goodsID,"&invite_code=").concat(this.userInfo.code),imageUrl:t}},onHide:function(){this.isDischarge=!0},onShow:function(){this.isDischarge=!1}};n.default=h}).call(this,t("df3c")["default"])},7181:function(e,n,t){},b994:function(e,n,t){"use strict";t.r(n);var o=t("bc32"),s=t("f3b1");for(var i in s)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return s[e]}))}(i);t("6aa6");var r=t("828b"),u=Object(r["a"])(s["default"],o["b"],o["c"],!1,null,"2630ee6d",null,!1,o["a"],void 0);n["default"]=u.exports},bc32:function(e,n,t){"use strict";t.d(n,"b",(function(){return s})),t.d(n,"c",(function(){return i})),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"))}},s=function(){var e=this,n=e.$createElement,t=(e._self._c,{background:"rgba(256,256,256,"+e.percent+")"}),o=Number(e.goodsInfo.min_price),s=e.goodsInfo.service_guarantee.length,i=s?e.__map(e.goodsInfo.service_guarantee,(function(n,t){var o=e.__get_orig(n),s=e.goodsInfo.service_guarantee.length;return{$orig:o,g1:s}})):null,r={image:e.goodsInfo.image,price:e.activityInfo.goods_detail.min_price,stock:e.goodsInfo.total_stock,unit:e.goodsInfo.unit_name,limit_type:0==e.activityInfo.buy_limit?1:3,limit_value:e.activityInfo.buy_limit_num},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:s,l0:i,a1:r,a2:u}})},i=[]},f3b1:function(e,n,t){"use strict";t.r(n);var o=t("6c27"),s=t.n(o);for(var i in o)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(i);n["default"]=s.a}},[["091a","common/runtime","common/vendor"]]]);
|