1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/share/index/index"],{"04bd":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n("2f62");function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var r=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/u-goods-list/u-ordinary-list")]).then(function(){return resolve(n("a71e"))}.bind(null,n)).catch(n.oe)},u={components:{uOrdinaryList:r},data:function(){return{setting:null,status:-1,customize:[],name:null,first:!1,page_loading:!0,inApply:!1,apply:!1,template_message:null,index:[],order_price:null,goods_list:null,cat_list:null,share:null,stock:null,region:null,is_can_apply:!1}},computed:a(a({},(0,i.mapState)({userInfo:function(t){return t.user.info},custom_setting:function(t){return t.mallConfig.share_setting_custom},share_setting:function(t){return t.mallConfig.share_setting},mall:function(t){return t.mallConfig.mall}})),{},{percent:function(){return null===this.order_price?0:1==this.share_setting.become_condition?parseFloat(this.order_price)/parseFloat(this.share_setting.auto_share_val)*100:4==this.share_setting.become_condition?parseFloat(this.order_price)/parseFloat(this.share_setting.total_consume)*100:void 0},condition:function(){return 3==this.share_setting.share_condition?"自动":"申请"}},(0,i.mapGetters)("mallConfig",{getTheme:"getTheme"})),methods:{toApply:function(){this.apply=!this.apply},jump:function(e){t.navigateTo({url:e})},subscribe:function(){var t=this;this.$subscribe(this.template_message).then((function(){t.submit()})).catch((function(){t.submit()}))},submit:function(){var e=this;if(t.showLoading({title:"提交中..."}),e.inApply)return!1;e.inApply=!0,e.$request({url:e.$api.share.apply,data:{name:e.userInfo.nickname,mobile:e.userInfo.mobile},method:"post"}).then((function(n){e.inApply=!1,t.hideLoading(),0===n.code?(e.status=0,"3"==e.share_setting.share_condition&&(e.status=1),e.apply=!1,e.getStatus()):t.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(){t.hideLoading()}))},getList:function(){var e=this;e.$request({url:e.$api.share.index}).then((function(n){e.$hideLoading(),0===n.code?(e.index=n.data.list,e.setting=n.data.bonus_setting.list,e.stock=n.data.stock_setting,e.region=n.data.region_setting):t.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(){e.$hideLoading()}))},getStatus:function(){var e=this,n=this;n.$request({url:n.$api.share.new_apply_status}).then((function(i){if(n.first=!0,0===i.code)if(n.template_message=i.data.template_message,n.status=i.data.status,n.share=i.data.share,n.order_price=i.data.orderPrice,n.goods_list=i.data.goodsList,n.cat_list=i.data.catList,n.is_can_apply=i.data.is_can_apply,1==n.status){n.getList();var s=i.data.share.name;"3"==n.share_setting.share_condition&&(s=n.userInfo.nickname),n.name=s}else 2==n.status?(n.$hideLoading(),"1"!=e.share_setting.share_condition&&3!=e.share_setting.share_condition||(n.apply=!0)):n.$hideLoading();else n.$hideLoading(),t.showModal({content:i.msg,showCancel:!1})})).catch((function(){n.$hideLoading(),n.$event.on(n.$const.EVENT_USER_LOGIN).then((function(){n.$store.dispatch("user/info"),n.getStatus()}))}))},againApply:function(){this.is_can_apply?"1"==this.share_setting.share_condition||3==this.share_setting.share_condition?this.apply=!0:this.jump("/pages/share/add/add?template_message="+JSON.stringify(this.template_message)):this.status=3},toGoods:function(t){this.$jump({url:"/pages/goods/list?cat_id="+t,open_type:"navigate"})}},onLoad:function(){this.$commonLoad.onload(),this.$user.isLogin()&&this.$store.dispatch("user/refreshInfo"),this.$showLoading({type:"global",text:"加载中..."}),this.getStatus()},onShow:function(){var t=this;t.first&&t.getStatus()}};e.default=u}).call(this,n("543d")["default"])},"5cd2":function(t,e,n){},"72b7":function(t,e,n){"use strict";n.r(e);var i=n("ceb5"),s=n("bd5d");for(var a in s)"default"!==a&&function(t){n.d(e,t,(function(){return s[t]}))}(a);n("874d");var o,r=n("f0c5"),u=Object(r["a"])(s["default"],i["b"],i["c"],!1,null,"1ec603c6",null,!1,i["a"],o);e["default"]=u.exports},"874d":function(t,e,n){"use strict";var i=n("5cd2"),s=n.n(i);s.a},b090:function(t,e,n){"use strict";(function(t){n("2d0a");i(n("66fd"));var e=i(n("72b7"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},bd5d:function(t,e,n){"use strict";n.r(e);var i=n("04bd"),s=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);e["default"]=s.a},ceb5:function(t,e,n){"use strict";var i;n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return i}));var s=function(){var t=this,e=t.$createElement,n=(t._self._c,1!=t.status&&2==t.status&&"3"!=t.share_setting.share_condition?JSON.stringify(t.template_message):null);t.$mp.data=Object.assign({},{$root:{g0:n}})},a=[]}},[["b090","common/runtime","common/vendor"]]]);
|