index.js 5.8 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/share/index/index"],{2441:function(t,e,n){"use strict";var a=n("9aae"),i=n.n(a);i.a},5756:function(t,e,n){"use strict";var a;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return a}));var i=function(){var t=this,e=t.$createElement;t._self._c},o=[]},6729:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=n("2f62");function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function o(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){s(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 s(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/app-goods-list/app-goods-list")]).then(function(){return resolve(n("cb83"))}.bind(null,n)).catch(n.oe)},u={components:{"app-goods-list":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,is_can_apply:!1}},computed:o(o({},(0,a.mapState)({theme:function(t){return t.mallConfig.theme},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:parseFloat(this.order_price)/parseFloat(this.share_setting.auto_share_val)*100},condition:function(){return 3==this.share_setting.share_condition?"自动":"申请"}}),methods:{toApply:function(){this.apply=!this.apply},toIndex:function(){t.navigateTo({url:"/pages/index/index"})},toMoney:function(){t.navigateTo({url:"/pages/share/money/money"})},toOrder:function(){t.navigateTo({url:"/pages/share/order/order"})},toDetail:function(){t.navigateTo({url:"/pages/share/cash-detail/cash-detail"})},toTeam:function(){t.navigateTo({url:"/pages/share/team/team"})},toQrcode:function(){t.navigateTo({url:"/pages/share/qrcode/qrcode"})},toBonus:function(){t.navigateTo({url:"/plugins/bonus/index/index"})},toStock:function(){t.navigateTo({url:"/plugins/stock/index/index?name="+this.share.name+"&mobile="+this.share.mobile})},toAdd:function(){var e=JSON.stringify(this.template_message);t.navigateTo({url:"/pages/share/add/add?parent_name="+this.userInfo.identity.parent_name+"&template_message="+e})},toCash:function(){t.navigateTo({url:"/pages/share/cash/cash?money="+this.index.money})},subscribe:function(){var t=this;this.$subscribe(this.template_message).then((function(e){t.submit()})).catch((function(e){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(e){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):t.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(t){e.$hideLoading()}))},getStatus:function(){var e=this,n=this;n.$request({url:n.$api.share.new_apply_status}).then((function(a){if(n.first=!0,0==a.code)if(n.template_message=a.data.template_message,n.status=a.data.status,n.share=a.data.share,n.order_price=a.data.orderPrice,n.goods_list=a.data.goodsList,n.cat_list=a.data.catList,n.is_can_apply=a.data.is_can_apply,1==n.status){n.getList();var i=a.data.share.name;"3"==n.share_setting.share_condition&&(i=n.userInfo.nickname),n.name=i}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:a.msg,showCancel:!1})})).catch((function(t){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.toAdd():this.status=3},toGoods:function(t){this.$jump({url:"/pages/goods/list?cat_id="+t,open_type:"navigate"})}},onLoad:function(){this.$store.dispatch("user/info"),this.$showLoading({type:"global",text:"加载中..."}),this.getStatus()},onShow:function(){var t=this;t.first&&t.getStatus()}};e.default=u}).call(this,n("543d")["default"])},"791f":function(t,e,n){"use strict";(function(t){n("ecb4");a(n("66fd"));var e=a(n("fde5"));function a(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},"9aae":function(t,e,n){},eddb:function(t,e,n){"use strict";n.r(e);var a=n("6729"),i=n.n(a);for(var o in a)"default"!==o&&function(t){n.d(e,t,(function(){return a[t]}))}(o);e["default"]=i.a},fde5:function(t,e,n){"use strict";n.r(e);var a=n("5756"),i=n("eddb");for(var o in i)"default"!==o&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("2441");var s,r=n("f0c5"),u=Object(r["a"])(i["default"],a["b"],a["c"],!1,null,"7a532753",null,!1,a["a"],s);e["default"]=u.exports}},[["791f","common/runtime","common/vendor"]]]);