card-editor.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {template 'common/header'}
  2. <link href="./resource/css/app.css" rel="stylesheet">
  3. <ul class="nav nav-tabs">
  4. <li class="active"><a href="{php echo url('mc/card/editor');}">会员卡设置</a></li>
  5. </ul>
  6. <div class="alert alert-info">
  7. <div>
  8. <i class="fa fa-info-circle"></i>
  9. 会员在进行余额充值,会员组变更,会员积分变更,会员卡计次充值,会员卡计时充值等操作时,系统会进行微信模板消息通知。<a href="{php echo url('mc/tplnotice');}">设置模板消息</a>
  10. </div>
  11. <div>
  12. <i class="fa fa-info-circle"></i>
  13. 开启会员卡功能后,请先对会员卡进行设置,然后提交保存.
  14. </div>
  15. </div>
  16. <div class="panel panel-default">
  17. <div class="panel-heading">
  18. 是否启用会员卡:
  19. <input type="checkbox" name="flag" value="1" {if intval($setting['status'])==1} checked="checked" {/if} data="{$setting['id']}"/>
  20. </div>
  21. </div>
  22. {if empty($setting) || $setting['status'] == 1}
  23. <form action="" method="post">
  24. <div class="usercard shopNav" ng-controller="MainCtrl">
  25. <div class="app clearfix">
  26. <input type="hidden" name="wapeditor[params]" id="wapeditor-params" value="{{submit.params}}" />
  27. <input type="hidden" name="wapeditor[html]" id="wapeditor-html" value="{{submit.html}}" />
  28. <div class="app-preview">
  29. <div class="app-header"></div>
  30. <div class="app-content">
  31. <div class="system-card">
  32. <div class="inner">
  33. <div class="clearfix">
  34. <div ng-if="module['id'] && module['id'] == 'cardBasic'" id="module-{{module.index}}" name="{{module.id}}" index="{{module.index}}" ng-class="{'modules-actions': activeItem.index == module.index, 'js-sorttable' : !module.issystem}" ng-repeat="module in activeModules | orderBy:'displayorder'" ng-style="{'border' : module.issystem ? 'none' : ''}">
  35. <div ng-init="displayPanel = ('widget-'+(module['id'].toLowerCase())+'-display.html')" ng-include="displayPanel" ng-click="editItem(module.id)"></div>
  36. <!--自定义模块编辑部分-->
  37. <div class="text-right action-wrap">
  38. <span class="label-default action edit" ng-click="editItem(module.id)">编辑</span>
  39. <!--span class="label-default action app-add">加内容</span-->
  40. <span class="label-default action remove" data-container="body" data-toggle="popover" data-placement="left" ng-click="deleteItem(module.index)">删除</span>
  41. </div>
  42. </div>
  43. <div ng-if="module['id'] && module['id'] != 'cardBasic' && module['issystem']" id="module-{{module.index}}" name="{{module.id}}" index="{{module.index}}" ng-class="{'modules-actions': activeItem.index == module.index, 'js-sorttable' : true}" ng-repeat="module in activeModules | orderBy:'displayorder'">
  44. <div ng-init="displayPanel = ('widget-'+(module['id'].toLowerCase())+'-display.html')" ng-include="displayPanel" ng-click="editItem(module.id)"></div>
  45. <!--自定义模块编辑部分-->
  46. <div class="text-right action-wrap">
  47. <span class="label-default action edit" ng-click="editItem(module.id)">编辑</span>
  48. <!--span class="label-default action app-add">加内容</span-->
  49. <span class="label-default action remove" data-container="body" data-toggle="popover" data-placement="left" ng-click="deleteItem(module.index)" ng-if="module['id'] != 'cardActivity' && module['id'] != 'cardNums' && module['id'] != 'cardTimes'">删除</span>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="app-side">
  58. <div ng-init="editorPanel = ('widget-'+(editorid.toLowerCase())+'-editor.html'.toLowerCase())" ng-show="activeItem.id == editorid" ng-repeat="editorid in editors" test="{{editorPanel}}" ng-include="editorPanel" id="editor{{editorid}}" class="editor"></div>
  59. </div>
  60. <div class="shop-preview col-xs-12 col-sm-9 col-lg-10">
  61. <div class="text-center alert alert-warning">
  62. <button type="submit" class="btn btn-primary js-editor-submit single-submit">上架</button>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </form>
  68. {/if}
  69. {php echo tpl_ueditor('')}
  70. <script type="text/javascript">
  71. $(function(){
  72. $('.app-preview').click(function(){
  73. return false;
  74. });
  75. require(['underscore', 'bootstrap.switch'], function() {
  76. $(":checkbox[name='flag']").bootstrapSwitch();
  77. $(':checkbox').on('switchChange.bootstrapSwitch', function(e, state){
  78. $this = $(this);
  79. var status = this.checked ? 1 : 0;
  80. $.post("{php echo url('mc/card/ajax', array('op' => 'status'));}", {status:status}, function(resp){
  81. if(resp != 'success') {
  82. util.message('操作失败, 请稍后重试.')
  83. } else {
  84. util.message('操作成功', location.href, 'success');
  85. }
  86. });
  87. });
  88. var newcard = false;
  89. var creditnames = {'credit1' : '{$unisetting['creditnames']['credit1']['title']}', 'credit2' : '{$unisetting['creditnames']['credit2']['title']}'};
  90. var activeModules = {php echo !empty($setting['params']) ? $setting['params'] : 'null'};
  91. var fansFields = {php echo json_encode($fields);};
  92. var discounts = {php echo json_encode($discounts);};
  93. var siteroot = "{php echo $_W['siteroot']}";
  94. angular.module('userCardApp').value('config',{
  95. 'newcard' : newcard,
  96. 'creditnames' : creditnames,
  97. 'activeModules' : activeModules,
  98. 'fansFields' : fansFields,
  99. 'discounts' : discounts,
  100. 'siteroot' : siteroot
  101. });
  102. angular.bootstrap(document, ['userCardApp']);
  103. });
  104. $('.modules').click(function(){
  105. return false;
  106. });
  107. });
  108. </script>
  109. {template 'common/footer'}