Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

switch_map_new.htm 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="min-width: auto;">
  3. <div class="on-off_panel">
  4. <div class="title">会员中心
  5. <span id="guide_web_users_switch" {eq name="$userConfig.web_users_switch" value="0"}hidden {/eq}>
  6. <a href="javascript:void(0);" onclick="ajax_submit(this, 'web', 'web_users_switch',0);" data-lmenuid="Member_users_index">关闭<i class="fa fa-window-close-o" aria-hidden="true"></i></a>
  7. <a href="javascript:void(0);" onclick="tag_call('web_users_switch');" class="red">[标签调用]</a>
  8. </span>
  9. </div>
  10. <div class="on-off_content {eq name="$globalConfig.web_users_switch" value="0"}show-shade{/eq}" id="users_centre">
  11. <div class="on-off_shade ">
  12. <div class="on-off_shadeCon">
  13. <span>目前还没有开启会员模块功能,<a href="javascript:void(0);" onclick="ajax_submit(this, 'web', 'web_users_switch',1);" data-lmenuid="Member_users_index">我要开启</a></span>
  14. </div>
  15. </div>
  16. <div class="on-off_btns">
  17. <form class="layui-form" action="">
  18. <ul>
  19. <li>
  20. <div class="on-off_btn">
  21. <div class="on-off_btn_l">
  22. <p>会员投稿:</p>
  23. </div>
  24. <div class="on-off_btn_r">
  25. <input type="checkbox" name="users[users_open_release]" lay-skin="switch" lay-text="开启|关闭" lay-filter="switchTest"
  26. data-authortoken="{$is_eyou_authortoken}" data-is_online="{$is_online}" {eq name="$userConfig.users_open_release" value="1"}checked="" {/eq}
  27. data-type="users" data-name="users_open_release" data-lmenuid="Member_users_index" value="{$userConfig.users_open_release}">
  28. </div>
  29. </div>
  30. </li>
  31. <li>
  32. <div class="on-off_btn">
  33. <div class="on-off_btn_l">
  34. <p>会员升级:</p>
  35. </div>
  36. <div class="on-off_btn_r">
  37. <input type="checkbox" name="level[level_member_upgrade]" lay-skin="switch" lay-text="开启|关闭" lay-filter="switchTest"
  38. data-authortoken="{$is_eyou_authortoken}" data-is_online="{$is_online}" {eq name="$userConfig.level_member_upgrade" value="1"}checked="" {/eq}
  39. data-type="level" data-name="level_member_upgrade" data-lmenuid="Member_users_index" value="{$userConfig.level_member_upgrade}">
  40. </div>
  41. </div>
  42. </li>
  43. <li>
  44. <div class="on-off_btn">
  45. <div class="on-off_btn_l">
  46. <p>商城中心:</p>
  47. </div>
  48. <div class="on-off_btn_r">
  49. <input type="checkbox" name="shop[shop_open]" lay-skin="switch" lay-text="开启|关闭" lay-filter="switchTest"
  50. data-authortoken="{$is_eyou_authortoken}" data-is_online="{$is_online}" {eq name="$userConfig.shop_open" value="1"}checked="" {/eq}
  51. data-type="shop" data-name="shop_open" data-lmenuid="Shop_home" value="{$userConfig.shop_open}">
  52. </div>
  53. </div>
  54. </li>
  55. <li>
  56. <div class="on-off_btn">
  57. <div class="on-off_btn_l">
  58. <p>支付功能:</p>
  59. </div>
  60. <div class="on-off_btn_r">
  61. <input type="checkbox" name="pay[pay_open]" lay-skin="switch" lay-text="开启|关闭" lay-filter="switchTest"
  62. data-authortoken="{$is_eyou_authortoken}" data-is_online="{$is_online}" {eq name="$userConfig.pay_open" value="1"}checked="" {/eq}
  63. data-type="pay" data-name="pay_open" data-lmenuid="Member_users_index" value="{$userConfig.pay_open}">
  64. </div>
  65. </div>
  66. </li>
  67. </ul>
  68. </form>
  69. </div>
  70. <div class="on-off_list">
  71. <ul>
  72. <li><a href="javascript:void(0);" data-href="{:url('Member/users_index')}" data-leftmenu="Member_users_index" onclick="gourl2(this);"><span>会员列表</span></a></li>
  73. <li><a href="javascript:void(0);" data-href="{:url('Member/users_config')}" data-leftmenu="Member_users_index" onclick="gourl2(this);"><span>功能配置</span></a></li>
  74. </ul>
  75. </div>
  76. <div id="guide_users_open_release" {eq name="$userConfig.users_open_release" value="0"}hidden {/eq}>
  77. <div class="son-tit">
  78. <span>├ 会员投稿</span>
  79. </div>
  80. <div class="on-off_list">
  81. <ul>
  82. <li><a href="javascript:void(0);" data-href="{:url('UsersRelease/conf')}" data-leftmenu="Member_users_index" onclick="gourl2(this);"><span>功能配置</span></a></li>
  83. </ul>
  84. </div>
  85. </div>
  86. <div id="guide_level_member_upgrade" {eq name="$userConfig.level_member_upgrade" value="0"}hidden {/eq}>
  87. <div class="son-tit">
  88. <span>├ 会员升级</span>
  89. </div>
  90. <div class="on-off_list">
  91. <ul>
  92. <li><a href="javascript:void(0);" data-href="{:url('Level/index')}" data-leftmenu="Member_users_index" onclick="gourl2(this);"><span>会员产品分类</span></a></li>
  93. <li><a href="javascript:void(0);" data-href="{:url('Level/upgrade_index')}" data-leftmenu="Member_users_index" onclick="gourl2(this);"><span>会员业务记录</span></a></li>
  94. </ul>
  95. </div>
  96. </div>
  97. <div id="guide_shop_open" {eq name="$userConfig.shop_open" value="0"}hidden {/eq}>
  98. <div class="son-tit">
  99. <span>├ 商城中心</span>
  100. <a href="javascript:void(0);" onclick="tag_call('shop_open');" class="red">[标签调用]</a>
  101. </div>
  102. <div class="on-off_list">
  103. <ul>
  104. <li><a href="javascript:void(0);" data-href="{:url('Shop/index')}" data-leftmenu="Shop_home" onclick="gourl2(this);"><span>订单列表</span></a></li>
  105. <li><a href="javascript:void(0);" data-href="{:url('Shop/conf')}" data-leftmenu="Shop_home" onclick="gourl2(this);"><span>功能配置</span></a></li>
  106. </ul>
  107. </div>
  108. </div>
  109. <div id="guide_pay_open" {eq name="$userConfig.pay_open" value="0"}hidden {/eq}>
  110. <div class="son-tit">
  111. <span>├ 支付功能</span>
  112. </div>
  113. <div class="on-off_list">
  114. <ul>
  115. <li><a href="javascript:void(0);" data-href="{:url('System/api_conf')}" data-leftmenu="Member_users_index" onclick="gourl2(this);"><span>接口配置</span></a></li>
  116. <li><a href="javascript:void(0);" data-href="{:url('Member/money_index')}" data-leftmenu="Member_users_index" onclick="gourl2(this);"><span>充值列表</span></a></li>
  117. </ul>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. <div class="on-off_panel">
  123. <div class="title">高级选项</div>
  124. <div class="on-off_content">
  125. <div class="on-off_btns">
  126. <form class="layui-form" action="">
  127. <ul>
  128. {eq name="weapp_switch" value="true"}
  129. <li>
  130. <div class="on-off_btn">
  131. <div class="on-off_btn_l">
  132. <p>插件应用:</p>
  133. </div>
  134. <div class="on-off_btn_r">
  135. <input type="checkbox" name="web[web_weapp_switch]" lay-skin="switch" lay-text="开启|关闭" lay-filter="switchWeapp"
  136. data-type="web" data-name="web_weapp_switch" data-lmenuid="Weapp_index" value="{$globalConfig.web_weapp_switch}"
  137. {eq name="$globalConfig.web_weapp_switch" value="1"}checked="" {/eq}>
  138. </div>
  139. </div>
  140. </li>
  141. {/eq}
  142. <li>
  143. <div class="on-off_btn">
  144. <div class="on-off_btn_l">
  145. <p>多语言:</p>
  146. </div>
  147. <div class="on-off_btn_r">
  148. <input type="checkbox" name="web[web_language_switch]" lay-skin="switch" lay-text="开启|关闭" lay-filter="switchTest"
  149. data-type="web" data-name="web_language_switch" data-lmenuid="Language_index" value="{$globalConfig.web_language_switch}"
  150. {eq name="$globalConfig.web_language_switch" value="1"}checked="" {/eq}>
  151. <!--<p class="notic">开启之后,顶部菜单会显示多语言入口</p>-->
  152. <span id="guide_web_language_switch" style="{if condition='empty($globalConfig.web_language_switch)'} display: none;{/if}">
  153. &nbsp;<a href="{:url('Language/index')}">[多语言设置]</a>
  154. &nbsp;<a href="javascript:void(0);" onclick="tag_call('web_language_switch');" class="red">[标签调用]</a>
  155. </span>
  156. </div>
  157. </div>
  158. </li>
  159. </ul>
  160. </form>
  161. </div>
  162. </div>
  163. </div>
  164. <input type="hidden" name="is_themeusers_exist" id="is_themeusers_exist" value="{$is_themeusers_exist}">
  165. <input type="hidden" name="is_themeshop_exist" id="is_themeshop_exist" value="{$is_themeshop_exist}">
  166. <script>
  167. layui.use(['form'], function() {
  168. var form = layui.form,
  169. layer = layui.layer
  170. //监听指定开关
  171. form.on('switch(switchWeapp)', function(data) {
  172. if (this.checked) {
  173. var name = $(this).attr('data-name');
  174. $(this).val(1);
  175. ajax_submit(this, 'web', name,1);
  176. } else {
  177. var name = $(this).attr('data-name');
  178. $(this).val(0);
  179. ajax_submit(this, 'web', name,-1);
  180. }
  181. });
  182. form.on('switch(switchTest)', function(data) {
  183. if (this.checked) {
  184. var name = $(this).attr('data-name');
  185. var type = $(this).attr('data-type');
  186. $(this).val(1);
  187. ajax_submit(this, type, name,1);
  188. } else {
  189. var name = $(this).attr('data-name');
  190. var type = $(this).attr('data-type');
  191. $(this).val(0);
  192. ajax_submit(this,type, name,0);
  193. }
  194. });
  195. });
  196. // 提交表单
  197. function ajax_submit(obj, inc_type, name,value){
  198. var _parent = parent;
  199. var lmenuid = $(obj).attr('data-lmenuid');
  200. var url = "{:url('Index/switch_map', ['_ajax'=>1])}";
  201. var syn_open_users = false; // 是否同步开启会员中心
  202. // 验证
  203. switch (name)
  204. {
  205. case 'shop_open':
  206. case 'pay_open':
  207. case 'users_open_release':
  208. case 'level_member_upgrade':
  209. if (-1 < $.inArray(name, ['shop_open','pay_open']))
  210. {
  211. if(false == check_shop_open())
  212. {
  213. return false;
  214. }
  215. } else if (-1 < $.inArray(name, ['users_open_release','level_member_upgrade']))
  216. {
  217. if(false == check_users_open_release())
  218. {
  219. return false;
  220. }
  221. }
  222. break;
  223. }
  224. // 标签调用按钮的显示与隐藏
  225. if (1 == value) {
  226. $('#guide_'+name).show();
  227. } else {
  228. $('#guide_'+name).hide();
  229. }
  230. if ('web_users_switch' == name ){
  231. if (value == 1){
  232. $("#users_centre").removeClass('show-shade');
  233. } else{
  234. $("#users_centre").addClass('show-shade');
  235. }
  236. }
  237. if (1 == $('#is_themeusers_exist').val()) {
  238. $('#is_themeusers_exist').val(0)
  239. loadmsg = '初始化中';
  240. } else if (1 == $('#is_themeshop_exist').val()) {
  241. $('#is_themeshop_exist').val(0)
  242. loadmsg = '初始化中';
  243. } else {
  244. loadmsg = '正在处理';
  245. }
  246. parent_layer_loading(loadmsg);
  247. $.ajax({
  248. type: "POST",
  249. url: url,
  250. data: {inc_type:inc_type,name:name,value:value,lmenuid:lmenuid},
  251. dataType: 'json',
  252. success: function (res) {
  253. if(res.code == 1){
  254. // 第一次模板同步下载
  255. if ('web_users_switch' == name && 1 == res.data.is_syn) { // 会员中心模板下载
  256. syn_theme_users(value,lmenuid);
  257. return false;
  258. } else if ('shop_open' == name && 1 == res.data.is_syn) { // 订单中心模板下载
  259. syn_theme_shop(value,lmenuid);
  260. return false;
  261. } else {
  262. _parent.layer.closeAll();
  263. // 根据不同场景进行页面加载的处理
  264. _parent.layer.msg(res.msg, {icon: 1, time: 1000}, function(){
  265. if (1 == res.data.reload) {
  266. window.location.reload();
  267. } else if (2 == res.data.reload) {
  268. top.window.location.reload();
  269. }
  270. });
  271. }
  272. }else{
  273. if (1 == res.data.code) {
  274. $('input[name="shop[shop_open]').removeAttr('checked');
  275. $('input[name="shop[shop_open]').val(0);
  276. $('input[name="shop[shop_open]').next().removeClass('layui-form-onswitch');
  277. $('input[name="shop[shop_open]').next().html('<em>关闭</em><i></i>');
  278. _parent.layer.closeAll();
  279. _parent.layer.alert(res.msg, {btn: ['购买授权'], icon: 4, title:false}, function(){
  280. _parent.layer.closeAll();
  281. window.location.reload();
  282. window.open('http://www.eyoucms.com/buy');
  283. });
  284. } else {
  285. _parent.layer.closeAll();
  286. _parent.layer.alert(res.msg, {icon: 2, title:false}, function(){
  287. _parent.layer.closeAll();
  288. window.location.reload();
  289. });
  290. }
  291. }
  292. // 控制顶部与左侧菜单的显示与隐藏
  293. try{
  294. if (1 == value) {
  295. $('#'+lmenuid, window.parent.document).show();
  296. if ('shop_open' == name) {
  297. $('#Member_users_index', window.parent.document).show();
  298. } else if ('web_users_switch' == name && 1 == $("input[name='shop[shop_open]']:checked").val()) {
  299. $('#Shop_home', window.parent.document).show();
  300. }
  301. } else {
  302. if (-1 < $.inArray(name, ['web_users_switch','web_language_switch','web_diyminipro_switch','shop_open','web_weapp_switch'])) {
  303. $('#'+lmenuid, window.parent.document).hide();
  304. if ('web_users_switch' == name) {
  305. $('#Shop_home', window.parent.document).hide();
  306. }
  307. }
  308. }
  309. }catch(e){}
  310. },
  311. error:function(e){
  312. _parent.layer.closeAll();
  313. _parent.layer.alert(e.responseText, {icon: 2, title:false}, function(){
  314. _parent.layer.closeAll();
  315. window.location.reload();
  316. });
  317. }
  318. });
  319. }
  320. function tag_call(name)
  321. {
  322. $.ajax({
  323. type: "POST",
  324. url: "{:url('System/ajax_tag_call', ['_ajax'=>1])}",
  325. data: {name:name},
  326. dataType: 'json',
  327. success: function (res) {
  328. if(res.code == 1){
  329. //询问框
  330. var confirm = layer.confirm(res.data.msg, {
  331. title: false,
  332. shade: layer_shade,
  333. area: ['70%','80%'],
  334. btn: ['关闭'] //按钮
  335. }, function(){
  336. layer.close(confirm);
  337. }
  338. );
  339. }else{
  340. layer.alert(res.msg, {icon: 2, title:false});
  341. }
  342. },
  343. error:function(e){
  344. layer.alert(e.responseText, {icon: 2, title:false});
  345. }
  346. });
  347. }
  348. function gourl2(obj)
  349. {
  350. var leftmenu = $(obj).data('leftmenu');
  351. var href = $(obj).data('href');
  352. $('.eycms_cont_left .sub-menu a', window.parent.document).removeClass('on');
  353. $('#'+leftmenu, window.parent.document).addClass('on');
  354. window.location.href = href;
  355. }
  356. function check_users_open_release()
  357. {
  358. var obj = $('input[name="users[users_open_release]"]:checked');
  359. var is_online = $(obj).attr('data-is_online');
  360. if (1 == is_online) {
  361. var users_open_release = $(obj).val();
  362. if (1 == users_open_release && $(obj).attr('data-authortoken') == -1) {
  363. $('input[name="users[users_open_release]"]').removeAttr('checked');
  364. $('input[name="users[users_open_release]"]').val(0);
  365. $('input[name="users[users_open_release]"]').next().removeClass('layui-form-onswitch');
  366. $('input[name="users[users_open_release]"]').next().html('<em>关闭</em><i></i>');
  367. var alert1 = layer.alert('会员投稿功能只限于授权域名!', {
  368. icon: 4,
  369. shade: layer_shade,
  370. title:false,
  371. btn: ['购买授权']
  372. }, function(){
  373. window.open('http://www.eyoucms.com/buy');
  374. layer.close(alert1);
  375. });
  376. return false;
  377. }
  378. }
  379. return true;
  380. }
  381. function check_shop_open()
  382. {
  383. var obj = $('input[name="shop[shop_open]"]:checked');
  384. var is_online = $(obj).attr('data-is_online');
  385. if (1 == is_online) {
  386. var shop_open = $(obj).val();
  387. if (1 == shop_open && $(obj).attr('data-authortoken') == -1) {
  388. $('input[name="shop[shop_open]').removeAttr('checked');
  389. $('input[name="shop[shop_open]').val(0);
  390. $('input[name="shop[shop_open]').next().removeClass('layui-form-onswitch');
  391. $('input[name="shop[shop_open]').next().html('<em>关闭</em><i></i>');
  392. var alert1 = layer.alert('订单功能只限于授权域名!', {
  393. icon: 4,
  394. shade: layer_shade,
  395. title:false,
  396. btn: ['购买授权']
  397. }, function(){
  398. window.open('http://www.eyoucms.com/buy');
  399. layer.close(alert1);
  400. });
  401. return false;
  402. }
  403. }
  404. return true;
  405. }
  406. // 订单模板初始化下载
  407. function syn_theme_shop(value,lmenuid)
  408. {
  409. $.ajax({
  410. type : 'get',
  411. url : "{:url('Shop/ajax_syn_theme_shop', ['_ajax'=>1])}",
  412. data : {},
  413. dataType : 'json',
  414. success : function(res){
  415. parent.layer.closeAll();
  416. if(res.code == 1){
  417. parent.layer.msg(res.msg, {icon: 1, time: 1000});
  418. }else{
  419. var icon = 2;
  420. if (res.data.icon) {icon = res.data.icon;}
  421. parent.layer.alert(res.msg, {icon: icon, title:false}, function(){
  422. parent.layer.closeAll();
  423. window.location.reload();
  424. });
  425. }
  426. // 控制顶部与左侧菜单的显示与隐藏
  427. try{
  428. if (1 == value) {
  429. $('#Member_users_index', window.parent.document).show();
  430. $('#'+lmenuid, window.parent.document).show();
  431. }
  432. }catch(e){}
  433. },
  434. error: function(e){
  435. parent.layer.closeAll();
  436. parent.layer.alert(e.responseText, {icon: 2, title:false}, function(){
  437. parent.layer.closeAll();
  438. window.location.reload();
  439. });
  440. }
  441. })
  442. }
  443. // 会员模板初始化下载
  444. function syn_theme_users(value,lmenuid)
  445. {
  446. $.ajax({
  447. type : 'get',
  448. url : "{:url('Member/ajax_syn_theme_users', ['_ajax'=>1])}",
  449. data : {},
  450. dataType : 'json',
  451. success : function(res){
  452. parent.layer.closeAll();
  453. if(res.code == 1){
  454. parent.layer.msg(res.msg, {icon: 1, time: 1000});
  455. }else{
  456. parent.layer.alert(res.msg, {icon: 2, title:false}, function(){
  457. parent.layer.closeAll();
  458. window.location.reload();
  459. });
  460. }
  461. // 控制顶部与左侧菜单的显示与隐藏
  462. if (1 == value) {
  463. $('#'+lmenuid, window.parent.document).show();
  464. } else {
  465. $('#'+lmenuid, window.parent.document).hide();
  466. }
  467. },
  468. error: function(e){
  469. parent.layer.closeAll();
  470. parent.layer.alert(e.responseText, {icon: 2, title:false}, function(){
  471. parent.layer.closeAll();
  472. window.location.reload();
  473. });
  474. }
  475. })
  476. }
  477. </script>
  478. {include file="public/footer" /}