view.js 5.6 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/view"],{"0c36":function(t,n,o){"use strict";(function(t){var e=o("4ea4");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=e(o("d220")),s={mixins:[i.default],components:{SkuAction:function(){o.e("components/sku-action/sku-action").then(function(){return resolve(o("a4ca"))}.bind(null,o)).catch(o.oe)},GoodsAction:function(){o.e("components/goods-action/goods-action").then(function(){return resolve(o("e500"))}.bind(null,o)).catch(o.oe)},GoodsActionButton:function(){o.e("components/goods-action/goods-action-button").then(function(){return resolve(o("3077"))}.bind(null,o)).catch(o.oe)},authorize:function(){o.e("components/authorize/authorize").then(function(){return resolve(o("5841"))}.bind(null,o)).catch(o.oe)},GoodsActionIcon:function(){o.e("components/goods-action/goods-action-icon").then(function(){return resolve(o("bfa1"))}.bind(null,o)).catch(o.oe)},loading:function(){o.e("components/tool/loading").then(function(){return resolve(o("837c"))}.bind(null,o)).catch(o.oe)},navbar:function(){Promise.all([o.e("common/vendor"),o.e("components/navbar/navbar")]).then(function(){return resolve(o("2445"))}.bind(null,o)).catch(o.oe)}},data:function(){return{isAuthShow:!1,isWechat:!1,path:"",isShowPoster:!1,isCreatePoster:!1,scrollNum:0,isLoading:!0,isError:!1,upOption:{use:!1,auto:!1},fields:["id"],isSkuStatus:!1,isShareStatus:!1,images:[],collect:!1,cartCount:0,current:0,selectedGoodsInfo:{},products:{},attribute:[],comments:[],item:{},goods_id:0,url:"",painter:{width:"650rpx",height:"950rpx",views:[]}}},onLoad:function(t){this.goods_id=t.id},onShow:function(){var t=this.$storage.getJson("users");this.cartCount=null!=t?t.shop_count:0},onPageScroll:function(t){this.scrollNum=t.scrollTop},methods:{updateSku:function(t){this.attribute=t},onSwiperChange:function(t){this.current=t.detail.current},downCallback:function(){var t=this;setTimeout((function(){t.loadGoodsData(),t.mescroll.endSuccess(10,!1)}),1200)},triggerDownScroll:function(){this.mescroll.triggerDownScroll()},loadGoodsData:function(){var t=this;this.$http.getGoodsDetail({id:this.goods_id}).then((function(n){n.status?(t.collect=!!n.data.collect,t.products=n.data.goods,t.attribute=n.data.attr,t.comments=n.data.comments,t.item=n.data.item,t.images=n.data.photo,t.isLoading=!1):t.$utils.redirectTo("public/404")})).catch((function(n){alert(n),t.$utils.redirectTo("public/404")}))},favorite:function(){var t=this;this.$store.dispatch("usersStatus").then((function(){t.$http.goodsDetailFavorite({id:t.goods_id}).then((function(n){n.status?t.collect=1==n.data:t.$utils.msg(n.info)}))})).catch((function(){t.isAuthShow=!0}))},onChange:function(t){this.current=t},onBuyClicked:function(){var t=this;if(0!=this.isSkuStatus)return this.selectedGoodsInfo.isSubmit?void this.$store.dispatch("usersStatus").then((function(){t.$utils.navigateTo("cart/confirm",{id:t.selectedGoodsInfo.id,sku_id:t.selectedGoodsInfo.selectedSku.id,num:t.selectedGoodsInfo.num,type:"buy"})})).catch((function(){t.isAuthShow=!0})):(this.$utils.msg("请选择规格!"),!1);this.isSkuStatus=!0},onAddCartClicked:function(){var n=this;if(0!=this.isSkuStatus)return this.selectedGoodsInfo.isSubmit?void this.$store.dispatch("usersStatus").then((function(){n.$http.goodsDetailAddCart({id:n.selectedGoodsInfo.id,sku_id:n.selectedGoodsInfo.selectedSku.id,num:n.selectedGoodsInfo.num}).then((function(o){n.isShow=!1,o.status?(n.cartCount=o.data.count,n.$store.commit("UPDATECART",o.data.count),n.$utils.msg(o.info),o.data.count>0?t.setTabBarBadge({index:2,text:o.data.count.toString()}):t.removeTabBarBadge({index:2})):n.$utils.msg(o.info)})).catch((function(t){n.$utils.msg("网络出错,请检查网络是否连接")}))})).catch((function(){n.isAuthShow=!0})):(this.$utils.msg("请选择规格!"),!1);this.isSkuStatus=!0}}};n.default=s}).call(this,o("543d")["default"])},4039:function(t,n,o){},"41e9":function(t,n,o){"use strict";o.r(n);var e=o("75a7"),i=o("d3ed");for(var s in i)["default"].indexOf(s)<0&&function(t){o.d(n,t,(function(){return i[t]}))}(s);o("4d73");var u=o("f0c5"),c=Object(u["a"])(i["default"],e["b"],e["c"],!1,null,"efd37012",null,!1,e["a"],void 0);n["default"]=c.exports},"4d73":function(t,n,o){"use strict";var e=o("4039"),i=o.n(e);i.a},7247:function(t,n,o){"use strict";(function(t,n){var e=o("4ea4");o("dc53");e(o("66fd"));var i=e(o("41e9"));t.__webpack_require_UNI_MP_PLUGIN__=o,n(i.default)}).call(this,o("bc2e")["default"],o("543d")["createPage"])},"75a7":function(t,n,o){"use strict";o.d(n,"b",(function(){return i})),o.d(n,"c",(function(){return s})),o.d(n,"a",(function(){return e}));var e={navbar:function(){return Promise.all([o.e("common/vendor"),o.e("components/navbar/navbar")]).then(o.bind(null,"2445"))},mescrollBody:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/mescroll-uni/components/mescroll-body/mescroll-body")]).then(o.bind(null,"adc6"))},skuAction:function(){return o.e("components/sku-action/sku-action").then(o.bind(null,"a4ca"))},authorize:function(){return o.e("components/authorize/authorize").then(o.bind(null,"5841"))}},i=function(){var t=this,n=t.$createElement,o=(t._self._c,!t.isLoading&&t.images?t.images.length:null),e=t.isLoading?null:t.products.briefly.length,i=!t.isLoading&&e?t.products.briefly_color.length:null;t._isMounted||(t.e0=function(n){return t.$utils.navigateTo("message/view")},t.e1=function(n){return t.$utils.switchTab("cart/index")}),t.$mp.data=Object.assign({},{$root:{g0:o,g1:e,g2:i}})},s=[]},d3ed:function(t,n,o){"use strict";o.r(n);var e=o("0c36"),i=o.n(e);for(var s in e)["default"].indexOf(s)<0&&function(t){o.d(n,t,(function(){return e[t]}))}(s);n["default"]=i.a}},[["7247","common/runtime","common/vendor"]]]);