home.js
12.3 KB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/home/home"],{"2d8e":function(e,n,t){"use strict";(function(e,n){var o=t("47a9");t("2fec");o(t("3240"));var i=o(t("6141"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(i.default)}).call(this,t("3223")["default"],t("df3c")["createPage"])},5762:function(e,n,t){"use strict";var o=t("d068"),i=t.n(o);i.a},6141:function(e,n,t){"use strict";t.r(n);var o=t("91a3"),i=t("e6fe");for(var r in i)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(r);t("5762");var s=t("828b"),c=Object(s["a"])(i["default"],o["b"],o["c"],!1,null,"2a1d3fa1",null,!1,o["a"],void 0);n["default"]=c.exports},"91a3":function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"c",(function(){return r})),t.d(n,"a",(function(){return o}));var o={customNavbar:function(){return t.e("components/custom-navbar/custom-navbar").then(t.bind(null,"f901"))},uIcon:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(t.bind(null,"3f69"))}},i=function(){var e=this,n=e.$createElement,t=(e._self._c,e.commonFunctions.length>0||e.isSettingMode||e.tempCommonFunctions.length>0),o=e.__map(e.getAllSections(),(function(n,t){var o=e.__get_orig(n),i=e.isSectionShow(n.id),r=e.isSectionShow(n.id),s=e.isSectionShow(n.id),c=e.__map(n.children,(function(n,t){var o=e.__get_orig(n),i=e.isSettingMode&&n.url&&!e.isInCommonFunctions(n.url);return{$orig:o,m3:i}}));return{$orig:o,m0:i,m1:r,m2:s,l0:c}}));e._isMounted||(e.e0=function(n,t){var o=arguments[arguments.length-1].currentTarget.dataset,i=o.eventParams||o["event-params"];t=i.section;return e.toggleSection(t.id)},e.e1=function(n,t){var o=arguments[arguments.length-1].currentTarget.dataset,i=o.eventParams||o["event-params"];t=i.item;e.isSettingMode?e.toggleCommonFunction({text:t.fullName,url:t.url,icon:t.icon,iconClass:t.iconClass}):e.goToPage(t.url)}),e.$mp.data=Object.assign({},{$root:{g0:t,l1:o}})},r=[]},b3a1:function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o={components:{CustomTabBar:function(){Promise.all([t.e("common/vendor"),t.e("components/custom-tab-bar/index")]).then(function(){return resolve(t("ba90"))}.bind(null,t)).catch(t.oe)},CustomNavbar:function(){t.e("components/custom-navbar/custom-navbar").then(function(){return resolve(t("f901"))}.bind(null,t)).catch(t.oe)}},data:function(){return{navbarHeightRpx:0,sectionShowStates:{},newuserInfo:{},userInfo:{},isSettingMode:!1,commonFunctions:[],tempCommonFunctions:[],menuData:[],menuSections:{},features:[{text:"开单",url:"/pagesA/lx/lx",icon:"/static/home/order.png",iconClass:"icon-circle-bg-1",theme:{h:210,s:45,l:62}},{text:"活动开单",url:"/pagesA/lx/lx?type=1",icon:"/static/home/activity-order.png",iconClass:"icon-circle-bg-3",theme:{h:0,s:45,l:62}},{text:"耗卡",url:"/pagesA/member-consume/member-consume",icon:"/static/home/consume-card.png",iconClass:"icon-circle-bg-2",theme:{h:140,s:45,l:50}},{text:"退卡",url:"/pagesA/refund/refund",icon:"/static/home/refund-card.png",iconClass:"icon-circle-bg-4",theme:{h:186,s:45,l:50}},{text:"转卡",url:"/pages/transferCard/transferCard",icon:"/static/home/transfer-card.png",iconClass:"icon-circle-bg-5",theme:{h:30,s:50,l:55}},{text:"建档",url:"/pages/member-create/member-create",icon:"/static/home/create-member.png",iconClass:"icon-circle-bg-6",theme:{h:286,s:40,l:60}},{text:"拓客",url:"/pages/expansion/expansion",icon:"/static/home/expansion.png",iconClass:"icon-circle-bg-7",theme:{h:330,s:40,l:60}},{text:"鼎轩开单",url:"/pagesA/lx/lx?time=2025-10-01",icon:"/static/home/dingxuan-order.png",iconClass:"icon-circle-bg-8",theme:{h:48,s:45,l:58}},{text:"会员",url:"/pages/clue-list/clue-list",icon:"/static/home/member.png",iconClass:"icon-circle-bg-9",theme:{h:217,s:45,l:55}},{text:"物品购买",url:"/pages/purchase-list/purchase-list",icon:"/static/home/purchase.png",iconClass:"icon-circle-bg-10",theme:{h:130,s:45,l:52}},{text:"报销审核",url:"/pages/reimbursement-audit-list/reimbursement-audit-list",icon:"/static/home/reimbursement-audit.png",iconClass:"icon-circle-bg-11",theme:{h:355,s:45,l:55}},{text:"报销申请",url:"/pages/reimbursement-list/reimbursement-list",icon:"/static/home/reimbursement-apply.png",iconClass:"icon-circle-bg-12",theme:{h:190,s:45,l:52}},{text:"使用记录",url:"/pages/usage-list/usage-list",icon:"/static/home/usage-record.png",iconClass:"icon-circle-bg-13",theme:{h:32,s:45,l:55}},{text:"毛巾记录",url:"/pages/laundry-flow-list/laundry-flow-list",icon:"/static/home/towel-record.png",iconClass:"icon-circle-bg-14",theme:{h:277,s:40,l:52}},{text:"门店管理",url:"/pages/store-list/store-list",icon:"/static/home/store-management.png",iconClass:"icon-circle-bg-15",theme:{h:330,s:40,l:55}},{text:"AI问答",url:"/pages/web/web",icon:"/static/home/ai-qa.png",iconClass:"icon-circle-bg-16",theme:{h:50,s:45,l:58}},{text:"日志",url:"/pages/lognew/lognew",icon:"/static/home/report.png",iconClass:"icon-circle-bg-log",theme:{h:200,s:15,l:45}},{text:"报表",url:"/pagesA/dailyReport/dailyReport",icon:"/static/home/report.png",iconClass:"icon-circle-bg-report-1",theme:{h:24,s:20,l:50}}]}},computed:{contentTopMargin:function(){return this.navbarHeightRpx>0?this.navbarHeightRpx+20+"rpx":"90rpx"},iskjb:function(){return"科技老师"!=this.newuserInfo.gw},showReport:function(){if(!this.userInfo||!this.userInfo.userAccount)return!1;return["admin","13198568627","18884847552","13608016021","18628973287"].includes(this.userInfo.userAccount)}},onLoad:function(){this.checkLoginStatus(),this.init()},onShow:function(){this.userInfo=e.getStorageSync("userInfo"),this.newuserInfo=e.getStorageSync("newuserInfo")||{},this.loadCommonFunctions(),this.loadMenuData()},methods:{loadMenuData:function(){var n=this,t=e.getStorageSync("appMenuData");if(t&&Array.isArray(t)&&t.length>0)return this.menuData=t,void this.parseMenuData();var o=e.getStorageSync("userInfo");o&&o.userId&&this.API.getAppAuthorize().then((function(t){200===t.code&&t.data&&(n.menuData=t.data,e.setStorageSync("appMenuData",t.data),n.parseMenuData())})).catch((function(e){console.error("获取菜单数据失败:",e)}))},parseMenuData:function(){var e=this;if(this.menuData&&0!==this.menuData.length){var n=this.menuData.find((function(e){return"app首页"===e.fullName}));n&&n.children&&(this.menuSections={},n.children.forEach((function(n){n.children&&n.children.length>0&&(e.menuSections[n.id]={id:n.id,fullName:n.fullName,children:n.children.map((function(n){var t=e.parseDescription(n.description||""),o=t.icon,i=t.iconClass,r=(n.urlAddress||"").trim()||e.getUrlByFullName(n.fullName);return{id:n.id,fullName:n.fullName,icon:o,iconClass:i,url:r,sortCode:n.sortCode||0}})).sort((function(e,n){return e.sortCode-n.sortCode}))},e.sectionShowStates.hasOwnProperty(n.id)||e.$set(e.sectionShowStates,n.id,!0))})))}},parseDescription:function(e){if(!e)return{icon:"",iconClass:""};var n=e.split(","),t=n[0]||"",o=n[1]||"";return{icon:t.trim(),iconClass:o.trim()}},getUrlByFullName:function(e){return{"开单":"/pagesA/lx/lx","活动开单":"/pagesA/lx/lx?type=1","耗卡":"/pagesA/member-consume/member-consume","退卡":"/pagesA/refund/refund","转卡":"/pages/transferCard/transferCard","鼎轩开单":"/pagesA/lx/lx?time=2025-10-01","会员":"/pages/clue-list/clue-list","建档":"/pages/member-create/member-create","拓客":"/pages/expansion/expansion","物品购买":"/pages/purchase-list/purchase-list","报销申请":"/pages/reimbursement-list/reimbursement-list","报销审核":"/pages/reimbursement-audit-list/reimbursement-audit-list","使用记录":"/pages/usage-list/usage-list","毛巾记录":"/pages/laundry-flow-list/laundry-flow-list","门店管理":"/pages/store-list/store-list","AI问答":"/pages/web/web?url=https://erp.lvqianmeiye.com/ai/","日报":"/pages/web/web?url=https://erp.lvqianmeiye.com/html/dailyReportnew.html"}[e]||""},getSectionByFullName:function(e){var n=this;if(!this.menuData||0===this.menuData.length)return null;var t=this.menuData.find((function(e){return"app首页"===e.fullName}));if(!t||!t.children)return null;var o=t.children.find((function(n){return n.fullName===e}));return o&&o.children?o.children.map((function(e){var t=n.parseDescription(e.description||""),o=t.icon,i=t.iconClass,r=(e.urlAddress||"").trim()||n.getUrlByFullName(e.fullName);return{id:e.id,fullName:e.fullName,icon:o,iconClass:i,url:r,sortCode:e.sortCode||0}})).sort((function(e,n){return e.sortCode-n.sortCode})):null},getAllSections:function(){var e=this;if(!this.menuData||0===this.menuData.length)return[];var n=this.menuData.find((function(e){return"app首页"===e.fullName}));return n&&n.children?n.children.filter((function(e){return e.children&&e.children.length>0})).map((function(n){return{id:n.id,fullName:n.fullName,children:e.getSectionByFullName(n.fullName)}})):[]},toggleSection:function(e){this.$set(this.sectionShowStates,e,!this.sectionShowStates[e])},isSectionShow:function(e){return!1!==this.sectionShowStates[e]},sectionRowClass:function(e){return{"业务操作":"fun_box_fir","会员管理":"mgmt-row","采购报销":"fun_box_fir","记录查询":"bottom-row","其他":"fun_box_fir"}[e]||"fun_box_fir"},sectionBtnClass:function(e){return{"业务操作":"fun_fir_1 fun_fir_border","会员管理":"mgmt-btn","采购报销":"fun_fir_1 fun_fir_border","记录查询":"bottom-btn","其他":"fun_fir_1 fun_fir_border"}[e]||"fun_fir_1 fun_fir_border"},sectionIconClass:function(e){return{"业务操作":"icon","会员管理":"mgmt-icon","采购报销":"icon","记录查询":"bottom-icon","其他":"icon"}[e]||"icon"},sectionTextClass:function(e){return{"业务操作":"","会员管理":"mgmt-text","采购报销":"","记录查询":"bottom-text","其他":""}[e]||""},shouldShowMenuItem:function(e,n){return!0},init:function(){var n=this;this.userInfo=e.getStorageSync("userInfo"),this.userInfo&&this.userInfo.userId&&this.API.getUsers(this.userInfo.userId).then((function(t){200===t.code&&(n.newuserInfo=t.data,"1"!=n.newuserInfo.enabledMark?(e.showToast({title:"您的账号已被禁用",icon:"none"}),e.clearStorageSync(),setTimeout((function(){e.reLaunch({url:"/pages/login/login"})}),1500)):(e.setStorageSync("newuserInfo",n.newuserInfo),n.loadCommonFunctions()))}))},loadCommonFunctions:function(){try{var n=e.getStorageSync("commonFunctions");n&&Array.isArray(n)?this.commonFunctions=n:this.saveCommonFunctions()}catch(t){console.error("加载常用功能失败:",t)}},saveCommonFunctions:function(){try{e.setStorageSync("commonFunctions",this.commonFunctions)}catch(n){console.error("保存常用功能失败:",n)}},openSettingMode:function(){this.isSettingMode=!0,this.tempCommonFunctions=JSON.parse(JSON.stringify(this.commonFunctions))},cancelSetting:function(){this.isSettingMode=!1,this.tempCommonFunctions=[]},confirmSetting:function(){this.commonFunctions=JSON.parse(JSON.stringify(this.tempCommonFunctions)),this.saveCommonFunctions(),this.isSettingMode=!1,this.tempCommonFunctions=[],e.showToast({title:"设置成功",icon:"success"})},toggleCommonFunction:function(n){if(this.isSettingMode){var t=this.tempCommonFunctions.findIndex((function(e){return e.url===n.url}));if(t>-1)this.tempCommonFunctions.splice(t,1);else{if(this.tempCommonFunctions.length>=8)return void e.showToast({title:"最多只能添加8个常用功能",icon:"none"});this.tempCommonFunctions.push(JSON.parse(JSON.stringify(n)))}}},isInCommonFunctions:function(e){return this.tempCommonFunctions.some((function(n){return n.url===e}))},checkLoginStatus:function(){var n=e.getStorageSync("token");n?this.userInfo=e.getStorageSync("userInfo"):e.reLaunch({url:"/pages/login/login"})},goToPage:function(n){var t=(n||"").trim();t&&(t.indexOf("https:")>-1?e.navigateTo({url:"/pages/web/web?url=".concat(encodeURIComponent(t))}):e.navigateTo({url:t}))},goToDashboard:function(){e.navigateTo({url:"/pagesA/dashboard/dashboard",fail:function(n){console.error("跳转失败:",n),e.showToast({title:"页面未找到",icon:"none"})}})},handleNavbarHeightChange:function(e){this.navbarHeightRpx=e.rpx||0},handleLogout:function(){var n=this;e.showModal({title:"提示",content:"确定要退出登录吗?",success:function(t){t.confirm&&n.API.logout().then((function(n){200==n.code&&(e.clearStorageSync(),e.reLaunch({url:"/pages/login/login"}))}))}})}}};n.default=o}).call(this,t("df3c")["default"])},d068:function(e,n,t){},e6fe:function(e,n,t){"use strict";t.r(n);var o=t("b3a1"),i=t.n(o);for(var r in o)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(r);n["default"]=i.a}},[["2d8e","common/runtime","common/vendor"]]]);