1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/mch/goods/goods"],{"7cac":function(t,e,o){"use strict";var n=o("8986"),i=o.n(n);i.a},"84cc":function(t,e,o){"use strict";o.r(e);var n=o("9e5a"),i=o("f7f6");for(var s in i)"default"!==s&&function(t){o.d(e,t,(function(){return i[t]}))}(s);o("7cac");var c,a=o("f0c5"),r=Object(a["a"])(i["default"],n["b"],n["c"],!1,null,"0d20ef86",null,!1,n["a"],c);e["default"]=r.exports},8986:function(t,e,o){},"993c":function(t,e,o){"use strict";(function(t){o("2d0a");n(o("66fd"));var e=n(o("84cc"));function n(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,o("543d")["createPage"])},"9e5a":function(t,e,o){"use strict";var n;o.d(e,"b",(function(){return i})),o.d(e,"c",(function(){return s})),o.d(e,"a",(function(){return n}));var i=function(){var t=this,e=t.$createElement;t._self._c},s=[]},d966:function(t,e,o){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o("2f62"),i=s(o("e829"));function s(t){return t&&t.__esModule?t:{default:t}}function c(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,n)}return o}function a(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?c(Object(o),!0).forEach((function(e){r(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):c(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function r(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var l=function(){o.e("components/page-component/goods/app-goods-banner").then(function(){return resolve(o("d9fb"))}.bind(null,o)).catch(o.oe)},d=function(){o.e("components/page-component/goods/app-goods-full-reduce").then(function(){return resolve(o("bc5a"))}.bind(null,o)).catch(o.oe)},u=function(){Promise.all([o.e("common/vendor"),o.e("components/page-component/u-goods-list/u-ordinary-list")]).then(function(){return resolve(o("a71e"))}.bind(null,o)).catch(o.oe)},h=function(){Promise.all([o.e("common/vendor"),o.e("components/page-component/goods/u-attr")]).then(function(){return resolve(o("338d"))}.bind(null,o)).catch(o.oe)},p=function(){o.e("components/page-component/goods/bd-info").then(function(){return resolve(o("543b"))}.bind(null,o)).catch(o.oe)},f=function(){o.e("components/page-component/goods/bd-xbc").then(function(){return resolve(o("48be"))}.bind(null,o)).catch(o.oe)},g=function(){o.e("components/page-component/goods/bd-kb").then(function(){return resolve(o("f02b"))}.bind(null,o)).catch(o.oe)},m=function(){o.e("components/page-component/goods/bd-hc").then(function(){return resolve(o("7eb9"))}.bind(null,o)).catch(o.oe)},_=function(){o.e("components/page-component/goods/bd-detail").then(function(){return resolve(o("7e0d"))}.bind(null,o)).catch(o.oe)},b=function(){o.e("components/page-component/goods/bd-comments").then(function(){return resolve(o("66eb"))}.bind(null,o)).catch(o.oe)},v=function(){o.e("components/basic-component/app-close/app-close").then(function(){return resolve(o("1653"))}.bind(null,o)).catch(o.oe)},w=function(){o.e("components/page-component/goods/app-sell-tip").then(function(){return resolve(o("f3ad"))}.bind(null,o)).catch(o.oe)},y={name:"goods",mixins:[i.default],components:{appGoodsBanner:l,uOrdinaryList:u,uAttr:h,appGoodsFullReduce:d,bdInfo:p,bdXbc:f,bdKb:g,bdHc:m,bdDetail:_,bdComments:b,appClose:v,appSellTip:w},data:function(){return{showClose:!1,is_open:0,goods:null,full_reduce:null,selectAttr:null,recommend_list:null,attrShow:!1,id:0,mch_id:0,mch_store:null,mch_setting:null,flash_sale:null,poster:this.$api.mch.poster,poster_config:this.$api.mch.poster_config,poster_generate:this.$api.mch.poster_generate,param_content:[],disable:"disable"}},computed:a(a(a(a({},(0,n.mapState)({mall:function(t){return t.mallConfig.mall},isListUnderlinePrice:function(t){return t.mallConfig.mall.setting.is_list_underline_price},isTip:function(t){return t.mallConfig.mall.setting.is_remind_sell_time}})),(0,n.mapState)("gConfig",{iphone:function(t){return t.iphone},iphoneHeight:function(t){return t.iphoneHeight}})),(0,n.mapGetters)("mallConfig",{getTheme:"getTheme"})),{},{uBottomHeight:function(){return this.full_reduce&&this.goods&&this.goods.sell_time>0?"u-bottom-height-2":this.full_reduce||this.goods&&this.goods.sell_time>0?"u-bottom-height-1":"u-bottom-height-0"},leftTip:function(){var t="";return t=0==this.isTip&&this.goods&&this.goods.sell_time>0?"box-grow-1":"bd-btn-left",t},disableBtn:function(){return this.goods&&this.goods.is_finish_sell?"btn-finish-sell":"bd-oversell-btn"},remindParams:function(){return this.goods?{sell_time:this.goods.sell_time,goods_id:this.goods.id,template_message_list:this.goods.template_message_list,buy_text:"立即购买"}:{}}}),onLoad:function(t){this.$commonLoad.onload(t);var e=[t.mch_id,t.id];this.mch_id=e[0],this.id=e[1],this.getAddress(),this.loadRecommend(),wx.showShareMenu({withShareTicket:!0,menus:["shareAppMessage","shareTimeline"]})},onShow:function(){var t=this;this.showClose=!1,setTimeout((function(){t.showClose=!0}))},onShareTimeline:function(){return this.$shareTimeline({title:this.goods.app_share_title?this.goods.app_share_title:this.goods.name,query:{id:this.id,mch_id:this.mch_id}})},onShareAppMessage:function(){return this.hShareAppMessage()},methods:{hShareAppMessage:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];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:this.goods.pic_url[0].pic_url,path:"/plugins/mch/goods/goods",desc:this.goods.subtitle,params:{id:this.id,mch_id:this.mch_id}},t)},getMall:function(t){this.is_open=t.is_open},getAddress:function(){var e=this;t.getLocation({type:"wgs84",success:function(t){e.getMch(t.latitude,t.longitude)},fail:function(t){e.getMch(0,0)}})},getMch:function(e,o){var n=this;n.$showLoading(),n.$request({url:n.$api.mch.detail,data:{id:n.mch_id,latitude:e,longitude:o}}).then((function(e){if(n.$hideLoading(),0===e.code){var o=[e.data.detail,e.data.mchSetting];n.mch_store=o[0],n.mch_setting=o[1],n.getDetail()}else t.showModal({title:"提示",content:e.msg,showCancel:!1,success:function(e){e.confirm&&t.navigateBack({delta:1})}})})).catch((function(){n.$hideLoading()}))},getDetail:function(){var e=this;this.$showLoading(),this.$request({url:this.$api.mch.goods_detail,data:{id:this.id,mch_id:this.mch_id}}).then((function(o){if(e.$hideLoading(),0===o.code){var n=o.data.detail.goods_activity;e.goods=o.data.detail;var i=o.data.detail.param_content;e.param_content=i,n&&(e.full_reduce=n.full_reduce)}else t.showModal({title:"提示",content:o.msg,showCancel:!1})})).catch((function(){e.$hideLoading()}))},loadRecommend:function(){var t=this,e=this;e.$request({url:e.$api.goods.new_recommend,data:{goods_id:e.id},method:"get"}).then((function(e){0===e.code&&(t.recommend_list=e.data.list)}))},navMap:function(){t.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(t){var e=t.item;this.selectAttr=e},navService:function(){t.navigateTo({url:"/pages/web/web?url="+this.mch_setting.web_service_url})},navShop:function(){t.redirectTo({url:"/plugins/mch/shop/shop?mch_id="+this.mch_id})},back:function(){t.redirectTo({url:"/pages/index/index"})},favorite:function(){this.goods.favorite?this.goods.favorite=!1:this.goods.favorite=!0,this.$request({url:this.goods.favorite?this.$api.user.favorite_add:this.$api.user.favorite_remove,data:{goods_id:this.goods.id}}).then((function(e){0!==e.code&&t.showModal({title:"提示",content:e.msg,showCancel:!1})}))},clickAttr:function(){this.goods.buy_goods_auth?"ecard"!==this.goods.type?this.attrShow=!0:t.showToast({title:"虚拟商品不允许加入购物车",icon:"none"}):t.showToast({title:"您暂无权限购买该商品",icon:"none"})},changeTime:function(t){this.goods.sell_time=t},buyClick:function(){this.goods.sell_time>0?this.rightTip():this.clickAttr()}}};e.default=y}).call(this,o("543d")["default"])},f7f6:function(t,e,o){"use strict";o.r(e);var n=o("d966"),i=o.n(n);for(var s in n)"default"!==s&&function(t){o.d(e,t,(function(){return n[t]}))}(s);e["default"]=i.a}},[["993c","common/runtime","common/vendor"]]]);
|