goods-card.js 3.9 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/app_admin/goods-card/goods-card"],{"1be7":function(e,n,t){"use strict";t.r(n);var i=t("95fa"),o=t.n(i);for(var a in i)"default"!==a&&function(e){t.d(n,e,(function(){return i[e]}))}(a);n["default"]=o.a},"20ca":function(e,n,t){"use strict";(function(e){t("8748");i(t("66fd"));var n=i(t("a14f"));function i(e){return e&&e.__esModule?e:{default:e}}e(n.default)}).call(this,t("543d")["createPage"])},5643:function(e,n,t){"use strict";var i,o=function(){var e=this,n=e.$createElement;e._self._c},a=[];t.d(n,"b",(function(){return o})),t.d(n,"c",(function(){return a})),t.d(n,"a",(function(){return i}))},"95fa":function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=t("2f62");function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var d={data:function(){return{iphone_x:!1,card:[],list:[],modal:!1,page_loading:!0,to_add:!1,num:1,beCard:null,index:-1,dialog:!1,newIndex:0}},computed:a({},(0,i.mapState)({theme:function(e){return e.mallConfig.theme},userInfo:function(e){return e.user.info},adminImg:function(e){return e.mallConfig.__wxapp_img.app_admin}})),methods:{showDialog:function(){this.dialog=!this.dialog},getCard:function(){var n=this;n.$request({url:n.$api.app_admin.card}).then((function(t){n.$hideLoading(),0==t.code?n.cat=t.data.list:e.showToast({title:t.msg,icon:"none",duration:1e3})})).catch((function(e){n.$hideLoading()}))},bindChange:function(e){this.newIndex=e.detail.value[0]},toggle:function(e){this.dialog=!1,1==e&&(this.beCard=this.card[this.newIndex],this.newIndex=0)},close:function(e){this.list.splice(e,1)},submit:function(){var n=this;null!=n.beCard?(n.beCard.num=n.num,n.index>-1?n.list[n.index]=n.beCard:n.list.push(n.beCard),n.num=null,n.to_add=!1):e.showToast({title:"请选择卡券",icon:"none",duration:1e3})},save:function(){e.setStorage({key:"goods_card",data:this.list}),setTimeout((function(){e.navigateBack()}),500)},cancel:function(){this.to_add=!1,this.beCard=null},add:function(n,t){var i=this;i.$request({url:i.$api.app_admin.card}).then((function(o){if(i.$hideLoading(),0==o.code){var a=o.data.list;i.num=1;if(a.length>0)if(i.to_add=!0,n>-1)for(var r in i.beCard=i.list[n],i.num=t.num,i.index=n,a)a[r].id==i.beCard.id&&(i.newIndex=r);else i.index=-1,i.newIndex=0,i.beCard=null;else e.showToast({title:"暂无可添加卡券",icon:"none",duration:1e3});i.card=a}else e.showToast({title:o.msg,icon:"none",duration:1e3})})).catch((function(e){i.$hideLoading()}))}},onLoad:function(n){var t=this;t.$showLoading({type:"global",text:"加载中..."}),e.getStorage({key:"goods_card",success:function(e){t.list=e.data}}),e.getSystemInfo({success:function(e){(e.model.indexOf("iPhone X")>-1||e.model.indexOf("iPhone 11")>-1||e.model.indexOf("iPhone11")>-1||e.model.indexOf("iPhone12")>-1||e.model.indexOf("Unknown Device")>-1)&&(t.iphone_x=!0)}}),t.getCard()}};n.default=d}).call(this,t("543d")["default"])},a14f:function(e,n,t){"use strict";t.r(n);var i=t("5643"),o=t("1be7");for(var a in o)"default"!==a&&function(e){t.d(n,e,(function(){return o[e]}))}(a);t("a707");var r,d=t("f0c5"),c=Object(d["a"])(o["default"],i["b"],i["c"],!1,null,"69f1835d",null,!1,i["a"],r);n["default"]=c.exports},a707:function(e,n,t){"use strict";var i=t("d73c"),o=t.n(i);o.a},d73c:function(e,n,t){}},[["20ca","common/runtime","common/vendor"]]]);