1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/gift/goods/goods"],{6011:function(t,e,n){"use strict";(function(t){n("8748");o(n("66fd"));var e=o(n("f27d"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},"79ae":function(t,e,n){"use strict";var o,r=function(){var t=this,e=t.$createElement,n=(t._self._c,{attr_list:t.selectAttr.attr_list}),o=Number(110);t.$mp.data=Object.assign({},{$root:{a0:n,m0:o}})},a=[];n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return o}))},"90a6":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=a(n("4795")),r=n("2f62");function a(t){return t&&t.__esModule?t:{default:t}}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t,e,n,o,r,a,i){try{var s=t[a](i),c=s.value}catch(u){return void n(u)}s.done?e(c):Promise.resolve(c).then(o,r)}function d(t){return function(){var e=this,n=arguments;return new Promise((function(o,r){var a=t.apply(e,n);function i(t){u(a,o,r,i,s,"next",t)}function s(t){u(a,o,r,i,s,"throw",t)}i(void 0)}))}}var l=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/goods/app-goods-banner")]).then(function(){return resolve(n("de38"))}.bind(null,n)).catch(n.oe)},p=function(){n.e("components/page-component/app-goods-detail/app-name").then(function(){return resolve(n("11d7"))}.bind(null,n)).catch(n.oe)},f=function(){n.e("plugins/gift/components/goods/detail-parameter").then(function(){return resolve(n("01af"))}.bind(null,n)).catch(n.oe)},h=function(){n.e("components/page-component/app-join-member/app-join-member").then(function(){return resolve(n("af6d"))}.bind(null,n)).catch(n.oe)},g=function(){n.e("components/page-component/goods/app-goods-detail").then(function(){return resolve(n("04ea"))}.bind(null,n)).catch(n.oe)},m=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/app-vip-card/app-vip-card")]).then(function(){return resolve(n("744f"))}.bind(null,n)).catch(n.oe)},_=function(){n.e("components/page-component/app-related-suggestion-product/app-related-suggestion-product").then(function(){return resolve(n("f0d4"))}.bind(null,n)).catch(n.oe)},b=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/goods/app-goods-service")]).then(function(){return resolve(n("be7d"))}.bind(null,n)).catch(n.oe)},v=function(){Promise.all([n.e("common/vendor"),n.e("components/basic-component/app-empty-bottom/app-empty-bottom")]).then(function(){return resolve(n("51dc"))}.bind(null,n)).catch(n.oe)},w=function(){Promise.all([n.e("common/vendor"),n.e("components/basic-component/app-iphone-x/app-iphone-x")]).then(function(){return resolve(n("bd7b"))}.bind(null,n)).catch(n.oe)},$=function(){n.e("plugins/gift/components/goods/bottom-button").then(function(){return resolve(n("709c"))}.bind(null,n)).catch(n.oe)},y=function(){n.e("components/page-component/goods/app-goods-attr").then(function(){return resolve(n("e7a9"))}.bind(null,n)).catch(n.oe)},O=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/app-attr/app-attr")]).then(function(){return resolve(n("4761"))}.bind(null,n)).catch(n.oe)},j={name:"goods",data:function(){return{goods_id:-1,goods_detail:{},goods_list:[],attr_bool:!1,select_data:{},select_str:"",number:1,ask_gift:"",mch_id:-1,loading:!1,join_disabled:!0,is_share:0,is_search:0,selectAttr:{},attrShow:0}},onLoad:function(t){var e=this;this.goods_id=t.id,t.mch_id&&(this.mch_id=t.mch_id),1==t.is_share&&(this.is_share=1),1==t.is_search&&(this.is_search=1),this.$store.dispatch("gift/getConfig",this.$api.gift.config),this.request().then((function(){e.requestList(),e.requestConfig()}))},onShareAppMessage:function(){return this.$shareAppMessage({path:"/plugins/gift/goods/goods",title:this.ask_gift,imageUrl:this.goods_detail.app_share_pic?this.goods_detail.app_share_pic:"",params:{id:this.goods_id,is_share:1}})},methods:{clickAttr:function(){this.attrShow=Math.random()},onAttr:function(t){if(t){this.selectAttr=t;for(var e="",n=0;n<t.attr_list.length;n++)e+="".concat(t.attr_list[n].attr_group_name,": ").concat(t.attr_list[n].attr_name," ");this.select_data={name:this.goods_detail.name,price:t.price,attr:{id:t.id,attr_list:t.attr_list,stock:t.stock,goods_id:t.goods_id},attr_str:e,pic_url:t.pic_url?t.pic_url:this.goods_detail.cover_pic}}},request:function(){var e=this;return d(o.default.mark((function n(){var r,a,i,c;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.$utils.showLoading(),n.prev=1,r={id:e.goods_id},n.next=5,e.$request({url:e.$api.gift.goods,method:"get",data:s({},r)});case 5:if(a=n.sent,e.$utils.hideLoading(),0===a.code)for(e.goods_detail=a.data.goods,e.loading=!0,i=0;i<e.goods_detail.attr_groups.length;i++)for(c=0;c<e.goods_detail.attr_groups[i].attr_list.length;c++)e.goods_detail.attr_groups[i].attr_list[c].active=0===c;else t.showModal({title:"提示",content:a.msg});n.next=14;break;case 10:throw n.prev=10,n.t0=n["catch"](1),e.$utils.hideLoading(),new Error(n.t0);case 14:case"end":return n.stop()}}),n,null,[[1,10]])})))()},requestConfig:function(){var e=this;return d(o.default.mark((function n(){var r;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.$utils.showLoading(),n.prev=1,n.next=4,e.$request({url:e.$api.gift.config,method:"get"});case 4:r=n.sent,e.$utils.hideLoading(),0===r.code?(e.ask_gift=r.data.ask_gift,e.$store.commit("gift/setTheme",Number(r.data.theme.id))):t.showModal({title:"提示",content:r.msg}),n.next=13;break;case 9:throw n.prev=9,n.t0=n["catch"](1),e.$utils.hideLoading(),new Error(n.t0);case 13:case"end":return n.stop()}}),n,null,[[1,9]])})))()},requestList:function(){var e=this;return d(o.default.mark((function n(){var r;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.$utils.showLoading(),n.prev=1,n.next=4,e.$request({url:e.$api.goods.new_recommend,method:"get",data:{goods_id:e.goods_id,type:"goods"}});case 4:r=n.sent,e.$utils.hideLoading(),0===r.code?e.goods_list=r.data.list:t.showModal({title:"提示",content:r.msg}),n.next=13;break;case 9:throw n.prev=9,n.t0=n["catch"](1),e.$utils.hideLoading(),new Error(n.t0);case 13:case"end":return n.stop()}}),n,null,[[1,9]])})))()},attrSwitch:function(t){this.attr_bool=t},pay:function(e){if(console.log(this.select_data),this.number=e,this.$storage.getStorageSync("GIFT_CART")){for(var n=0,o=this.$storage.getStorageSync("GIFT_CART"),r=0;r<o.length;r++)o[r].attr.id===this.select_data.attr.id?o[r].number+=this.number:n+=1;if(n===o.length){var a=this.select_data;a.number=this.number,o.push(a)}this.$storage.setStorageSync("GIFT_CART",o)}else{var i=this.select_data;i.number=this.number,this.$storage.setStorageSync("GIFT_CART",[i])}1===this.is_share?t.navigateTo({url:"/plugins/gift/index/index"}):1===this.is_search?t.navigateBack({delta:3}):t.navigateBack({delta:2})}},computed:s({},(0,r.mapState)("gift",{theme:function(t){return t.theme}}),{},(0,r.mapState)("mallConfig",{mall:function(t){return t.mall}})),components:{"app-goods-banner":l,"app-name":p,"detail-parameter":f,"app-join-member":h,"app-goods-detail":g,"app-vip-card":m,"app-related-suggestion-product":_,"app-goods-service":b,"app-empty-bottom":v,"app-iphone-x":w,"bottom-button":$,"show-attr":y,appAttr:O}};e.default=j}).call(this,n("543d")["default"])},"9bbd":function(t,e,n){},c717:function(t,e,n){"use strict";var o=n("9bbd"),r=n.n(o);r.a},f27d:function(t,e,n){"use strict";n.r(e);var o=n("79ae"),r=n("f779");for(var a in r)"default"!==a&&function(t){n.d(e,t,(function(){return r[t]}))}(a);n("c717");var i,s=n("f0c5"),c=Object(s["a"])(r["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],i);e["default"]=c.exports},f779:function(t,e,n){"use strict";n.r(e);var o=n("90a6"),r=n.n(o);for(var a in o)"default"!==a&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=r.a}},[["6011","common/runtime","common/vendor"]]]);
|