1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/mch/goods/goods"],{4683:function(e,t,o){"use strict";var n=o("c54c8"),i=o.n(n);i.a},"65a5":function(e,t,o){"use strict";o.r(t);var n=o("b3bb"),i=o("698d");for(var c in i)"default"!==c&&function(e){o.d(t,e,(function(){return i[e]}))}(c);o("4683");var r,a=o("f0c5"),s=Object(a["a"])(i["default"],n["b"],n["c"],!1,null,"1f404bda",null,!1,n["a"],r);t["default"]=s.exports},"698d":function(e,t,o){"use strict";o.r(t);var n=o("7154"),i=o.n(n);for(var c in n)"default"!==c&&function(e){o.d(t,e,(function(){return n[e]}))}(c);t["default"]=i.a},7154:function(e,t,o){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o("2f62");function i(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function c(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?i(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function r(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var a=function(){Promise.all([o.e("common/vendor"),o.e("components/page-component/goods/app-goods-banner")]).then(function(){return resolve(o("de38"))}.bind(null,o)).catch(o.oe)},s=function(){Promise.all([o.e("common/vendor"),o.e("components/page-component/goods/app-goods-price")]).then(function(){return resolve(o("50c2"))}.bind(null,o)).catch(o.oe)},d=function(){Promise.all([o.e("common/vendor"),o.e("components/page-component/goods/app-goods-service")]).then(function(){return resolve(o("be7d"))}.bind(null,o)).catch(o.oe)},u=function(){o.e("components/page-component/goods/app-goods-attr").then(function(){return resolve(o("e7a9"))}.bind(null,o)).catch(o.oe)},p=function(){Promise.all([o.e("common/vendor"),o.e("components/page-component/app-attr/app-attr")]).then(function(){return resolve(o("4761"))}.bind(null,o)).catch(o.oe)},l=function(){Promise.all([o.e("common/vendor"),o.e("components/page-component/goods/app-goods-marketing")]).then(function(){return resolve(o("b3c0"))}.bind(null,o)).catch(o.oe)},h=function(){Promise.all([o.e("common/vendor"),o.e("components/basic-component/app-rich/parse")]).then(function(){return resolve(o("ee52"))}.bind(null,o)).catch(o.oe)},m=function(){Promise.all([o.e("common/vendor"),o.e("components/page-component/app-comments/app-comments")]).then(function(){return resolve(o("3627"))}.bind(null,o)).catch(o.oe)},f=function(){Promise.all([o.e("common/vendor"),o.e("components/page-component/app-goods-list/app-goods-list")]).then(function(){return resolve(o("e27d"))}.bind(null,o)).catch(o.oe)},g=function(){Promise.all([o.e("common/vendor"),o.e("components/basic-component/app-iphone-x/app-iphone-x")]).then(function(){return resolve(o("bd7b"))}.bind(null,o)).catch(o.oe)},v=function(){Promise.all([o.e("common/vendor"),o.e("components/basic-component/app-empty-bottom/app-empty-bottom")]).then(function(){return resolve(o("51dc"))}.bind(null,o)).catch(o.oe)},b={name:"goods",components:{appGoodsBanner:a,appGoodsPrice:s,appService:d,appGoodsAttr:u,appAttr:p,appGoodsMarketing:l,appRichText:h,appComments:m,appGoodsList:f,appIphoneX:g,appEmptyBottom:v},data:function(){return{goods:null,selectAttr:null,recommend_list:null,attrShow:0,order_preview:this.$api.mch.order_preview,order_submit:this.$api.mch.order_submit,id:0,mch_id:0,mch_store:null,mch_setting:null,poster:this.$api.mch.poster}},computed:c({},(0,n.mapState)({theme:function(e){return e.mallConfig.theme},mall:function(e){return e.mallConfig.mall}}),{},(0,n.mapState)("gConfig",{iphone:function(e){return e.iphone},iphoneHeight:function(e){return e.iphoneHeight}})),onLoad:function(e){var t=[e.mch_id,e.id];this.mch_id=t[0],this.id=t[1],this.getAddress(),this.loadRecommend()},onShareAppMessage:function(){return this.$shareAppMessage({title:this.goods.app_share_title?this.goods.app_share_title:this.goods.name,imageUrl:this.goods.app_share_pic?this.goods.app_share_pic:"",path:"/plugins/mch/goods/goods",params:{id:this.id,mch_id:this.mch_id}})},methods:{getAddress:function(){var t=this;e.getLocation({type:"wgs84",success:function(e){t.getMch(e.latitude,e.longitude)},fail:function(e){t.getMch(0,0)}})},getMch:function(t,o){var n=this;n.$showLoading(),n.$request({url:n.$api.mch.detail,data:{id:n.mch_id,latitude:t,longitude:o}}).then((function(t){if(n.$hideLoading(),0===t.code){var o=[t.data.detail,t.data.mchSetting];n.mch_store=o[0],n.mch_setting=o[1],n.getDetail()}else e.showModal({title:"提示",content:t.msg,showCancel:!1,success:function(t){t.confirm&&e.navigateBack({delta:1})}})})).catch((function(e){n.$hideLoading()}))},getDetail:function(){var t=this,o=this;o.$showLoading(),o.$request({url:o.$api.mch.goods_detail,data:{id:o.id,mch_id:o.mch_id}}).then((function(t){o.$hideLoading(),0===t.code?o.goods=t.data.detail:e.showModal({title:"提示",content:t.msg,showCancel:!1})})).catch((function(e){t.$hideLoading()}))},loadRecommend:function(){var e=this,t=this;t.$request({url:t.$api.goods.new_recommend,data:{goods_id:t.id},method:"get"}).then((function(t){0===t.code&&(e.recommend_list=t.data.list)}))},navMap:function(){e.openLocation({latitude:parseFloat(this.mch_store.store.latitude),longitude:parseFloat(this.mch_store.store.longitude),name:this.mch_store.store.name,address:this.mch_store.store.address})},onAttr:function(e){this.selectAttr=e},navService:function(){e.navigateTo({url:"/pages/web/web?url="+this.mch_setting.web_service_url})},navShop:function(){e.redirectTo({url:"/plugins/mch/shop/shop?mch_id="+this.mch_id})},back:function(){e.redirectTo({url:"/pages/index/index"})},favorite:function(){var t=this.$api.user.favorite_add,o=!0;this.goods.favorite&&(t=this.$api.user.favorite_remove,o=!1),this.goods.favorite=o,this.$request({url:t,data:{goods_id:this.goods.id}}).then((function(t){0===t.code||e.showModal({title:"提示",content:t.msg,showCancel:!1})}))},clickAttr:function(){this.attrShow=Math.random()}}};t.default=b}).call(this,o("543d")["default"])},b3bb:function(e,t,o){"use strict";var n,i=function(){var e=this,t=e.$createElement,o=(e._self._c,Number(110));e.$mp.data=Object.assign({},{$root:{m0:o}})},c=[];o.d(t,"b",(function(){return i})),o.d(t,"c",(function(){return c})),o.d(t,"a",(function(){return n}))},c54c8:function(e,t,o){},ee68:function(e,t,o){"use strict";(function(e){o("8748");n(o("66fd"));var t=n(o("65a5"));function n(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,o("543d")["createPage"])}},[["ee68","common/runtime","common/vendor"]]]);
|