123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- {extend name="public/layout" /} {block name="title"}自定义设置{/block} {block name="body"}
- <style type="text/css">
- html,
- body {
- display: block;
- min-width: 1100px;
- background-color: #fff;
- }
- .layui-fluid {
- display: block;
- box-shadow: 0 0 4px 0 #B6CADE;
- border-radius: 5px;
- margin: 15px;
- background-color: #ffffff;
- }
- .layui-icon {
- font-size: 20px !important;
- line-height: 38px;
- }
- .layui-form-switch {
- margin-top: 0px;
- }
- .ml5 {
- margin-left: 5px;
- }
- .mr5 {
- margin-right: 5px;
- }
- .flex {
- display: flex !important;
- }
- .active {
- color: #249EFB;
- font-weight: 600;
- }
- .leftViewBox {
- width: 120px;
- display: inline-block;
- background-color: #fff;
- border-right: 1px solid #f5f5f5;
- }
- .leftViewBox > div {
- width: 100%;
- height: 40px;
- background-color: #fff;
- line-height: 40px;
- border-bottom: 1px solid #f5f5f5;
- display: flex;
- align-items: center;
- box-sizing: border-box;
- padding-left: 5px;
- cursor: pointer;
- }
- .rightViewBox {
- width: calc(100% - 100px);
- display: inline-block;
- }
- .rightViewBox > div {
- width: 100%;
- height: 100%;
- }
- iframe {
- width: 100%;
- height: 100%;
- }
- .height100vh_200 {
- height: calc(100vh + 200px);
- }
- .height100vh-200 {
- height: calc(100vh - 0px);
- }
- .height100vh_200{height: calc(100vh - 2px) !important;}
- .disabledClass span{color:#999;}
- /* .disabledClass .layui-form-onswitch{background:#999 !important;} */
- .layui-form-switch{min-width:30px !important;height: 18px !important;line-height: 18px !important;}
- .layui-form-switch i{width: 12px !important;height: 12px !important;}
- .layui-form-onswitch i{margin-left: -18px !important;}
- </style>
- <body>
- <div class="layui-card flex">
- <div class="leftViewBox layui-form height100vh_200">
- <div data-index="0" class="active">报备设置</div>
- <div data-index="1">客户跟踪</div>
- <div data-index="2" class="disabledClass">
- <span class="mr5">信息完善</span>
- <input type="checkbox" lay-filter="switchEl1" name="switch" {if $perfect}checked{/if} lay-skin="switch">
- </div>
- <div data-index="3">
- <span class="mr5">客户转化</span>
- <input type="checkbox" lay-filter="switchEl2" name="switch" {if $change}checked{/if} lay-skin="switch">
- </div>
- <div data-index="4">
- <span class="mr5">客户预约</span>
- <input type="checkbox" lay-filter="switchEl3" name="switch" {if $subscribe}checked{/if} lay-skin="switch">
- </div>
- <div data-index="5">团队客户</div>
- <div data-index="6">操作设置</div>
- {auth:check name="customerSetting/report"}
- <div data-index="7">PC端报备设置</div>
- {/auth:check}
- </div>
- <div class="rightViewBox height100vh_200">
- <div>
- <iframe src="/dashboard/customer_setting/module_report.html" frameborder="0"></iframe>
- </div>
- <div class="layui-hide">
- <iframe src="/dashboard/customer_setting/moduleVisit.html" frameborder="0"></iframe>
- </div>
- <div class="layui-hide"></div>
- <div class="layui-hide">
- <iframe src="/dashboard/customer_setting/moduleChange.html" frameborder="0"></iframe>
- </div>
- <div class="layui-hide">
- <iframe src="/dashboard/customer_setting/moduleSubscribe.html" frameborder="0"></iframe>
- </div>
- <div class="layui-hide">
- <iframe src="/dashboard/customer_setting/team_statistics_data.html" frameborder="0"></iframe>
- </div>
- <div class="layui-hide">
- <iframe src="/dashboard/customer_setting/moduleHandel.html" frameborder="0"></iframe>
- </div>
- {auth:check name="customerSetting/report"}
- <div class="layui-hide">
- <iframe src="/dashboard/customer_setting/report.html" frameborder="0"></iframe>
- </div>
- {/auth:check}
- </div>
- </div>
- </body>
- {/block} {block name="js"}
- <script>
- layui.config({
- base: '__LAYUI__/' //静态资源所在路径
- ,
- urlbase: '/sys'
- }).extend({
- index: 'lib/index' //主入口模块
- }).use(['index', 'table', 'layedit', 'element', 'upload'], function () {
- var $ = layui.$,
- table = layui.table,
- element = layui.element,
- upload = layui.upload,
- form = layui.form;
- form.render();
- let activenum = localStorage.getItem('CUR_ACTIVE_NUM');
- if (activenum) {
- $('.leftViewBox').children().eq(parseInt(activenum)).addClass('active').siblings().removeClass('active');
- $('.rightViewBox div').eq(parseInt(activenum)).removeClass('layui-hide').siblings().addClass('layui-hide');
- }
- //切换模块设置
- $('.leftViewBox div').click(function() {
- let index = parseInt($(this).prop('dataset').index);
- localStorage.setItem('CUR_ACTIVE_NUM',$(this).prop('dataset').index);
- if (index == 5) {
- $('.leftViewBox').removeClass('height100vh_200')
- $('.rightViewBox').removeClass('height100vh_200')
- $('.leftViewBox').addClass('height100vh-200')
- $('.rightViewBox').addClass('height100vh-200')
- } else {
- $('.leftViewBox').removeClass('height100vh-200')
- $('.rightViewBox').removeClass('height100vh-200')
- $('.leftViewBox').addClass('height100vh_200')
- $('.rightViewBox').addClass('height100vh_200')
- }
- if (index == 2) {
- return false;
- } else {
- $(this).addClass('active').siblings().removeClass("active");
- }
- $('.rightViewBox div').eq(index).removeClass('layui-hide').siblings().addClass('layui-hide');
- })
- window.reloadFunc = function () {
- location.reload();
- }
-
- form.on('switch(switchEl1)', function (data) {
- let formData = new FormData();
- formData.append('perfect',(data.elem.checked ? 1 : '0'))
- $.ajax({
- url: '{:url("customerSetting/moduleSetting")}',
- type: 'post',
- data: formData,
- dataType: 'json',
- processData: false,
- contentType: false,
- success: function (res) {
- if (res.code === 0) {
- layer.msg(res.msg, { anim: 0 });
- } else {
- layer.msg(res.msg, { anim: 6 });
- setTimeout(() => {
- location.reload();
- },1000)
- }
- }
- });
- data.stopPropagation();
- return false;
- });
- form.on('switch(switchEl2)', function (data) {
- let formData = new FormData();
- formData.append('change',(data.elem.checked ? 1 : '0'))
- $.ajax({
- url: '{:url("customerSetting/moduleSetting")}',
- type: 'post',
- data: formData,
- dataType: 'json',
- processData: false,
- contentType: false,
- success: function (res) {
- if (res.code === 0) {
- layer.msg(res.msg, { anim: 0 });
- } else {
- layer.msg(res.msg, { anim: 6 });
- setTimeout(() => {
- location.reload();
- },1000)
- }
- }
- });
- data.stopPropagation();
- return false;
- });
- form.on('switch(switchEl3)', function (data) {
- let formData = new FormData();
- formData.append('subscribe',(data.elem.checked ? 1 : '0'))
- $.ajax({
- url: '{:url("customerSetting/moduleSetting")}',
- type: 'post',
- data: formData,
- dataType: 'json',
- processData: false,
- contentType: false,
- success: function (res) {
- if (res.code === 0) {
- layer.msg(res.msg, { anim: 0 });
- } else {
- layer.msg(res.msg, { anim: 6 });
- setTimeout(() => {
- location.reload();
- },1000)
- }
- }
- });
- data.stopPropagation();
- return false;
- });
- });
- </script>
- {/block}
|