截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

policy.html 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. {layout name="layout1" /}
  2. <link href="__PUBLIC__/static/lib/layui/layeditor/layedit.css" rel="stylesheet"/>
  3. <script src="__PUBLIC__/static/lib/layui/layeditor/index.js"></script>
  4. <script src="__PUBLIC__/static/lib/layui/layeditor/ace/ace.js"></script>
  5. <div class="wrapper">
  6. <div class="layui-card">
  7. <div class="layui-card-body">
  8. <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
  9. <div class="layui-colla-item">
  10. <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
  11. <div class="layui-colla-content layui-show">
  12. <p>*会员注册时的服务协议,在登录注册页面显示。</p>
  13. <p>*会员隐私政策协议,在登录注册页面显示。</p>
  14. <p>*售后保障协议,在退款申请页面显示。</p>
  15. </div>
  16. </div>
  17. </div>
  18. </div>
  19. <div class="layui-form" lay-filter="">
  20. <div class="layui-tab layui-tab-card">
  21. <ul class="layui-tab-title">
  22. <li class="layui-this">服务协议</li>
  23. <li>隐私政策</li>
  24. <li>售后保障</li>
  25. <li>用户注销协议</li>
  26. </ul>
  27. <div class="layui-tab-content">
  28. <div class="layui-tab-item layui-show">
  29. <label class="layui-form-label" style="white-space: nowrap;">内容:</label>
  30. <div class="layui-input-block">
  31. <textarea name="service" id="service" lay-verify="content" class="field-content">{$config.service}</textarea>
  32. </div>
  33. </div>
  34. <div class="layui-tab-item">
  35. <label class="layui-form-label" style="white-space: nowrap;">内容:</label>
  36. <div class="layui-input-block">
  37. <textarea name="privacy" id="privacy" lay-verify="content" class="field-content">{$config.privacy}</textarea>
  38. </div>
  39. </div>
  40. <div class="layui-tab-item">
  41. <label class="layui-form-label" style="white-space: nowrap;">内容:</label>
  42. <div class="layui-input-block">
  43. <textarea name="after_sale" id="after_sale" lay-verify="content" class="field-content">{$config.after_sale}</textarea>
  44. </div>
  45. </div>
  46. <div class="layui-tab-item">
  47. <label class="layui-form-label" style="white-space: nowrap;">内容:</label>
  48. <div class="layui-input-block">
  49. <textarea name="user_delete" id="user_delete" lay-verify="content" class="field-content">{$config.user_delete}</textarea>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="layui-form-item">
  54. <div class="layui-input-block">
  55. <button class="layui-btn {$view_theme_color}" lay-submit lay-filter="addSubmit">确认</button>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <script>
  63. layui.config({
  64. base: "/static/lib/"
  65. }).extend({
  66. likeedit: "likeedit/likeedit"
  67. }).use(["form", "layEditor"], function () {
  68. var $ = layui.$
  69. , form = layui.form
  70. , layEditor = layui.layEditor;
  71. //富文本
  72. layEditor.set({
  73. uploadImage: {
  74. url: '{:url("file/lists")}?type=10'
  75. },
  76. })
  77. var likeedit_service = layEditor.build('service');
  78. var likeedit_privacy = layEditor.build('privacy');
  79. var likeedit_after_sale = layEditor.build('after_sale');
  80. var likeedit_user_delete = layEditor.build('user_delete');
  81. form.verify({
  82. content: function () {
  83. layEditor.sync(likeedit_service);
  84. layEditor.sync(likeedit_privacy);
  85. layEditor.sync(likeedit_after_sale);
  86. layEditor.sync(likeedit_user_delete);
  87. }
  88. });
  89. form.on("submit(addSubmit)", function(data){
  90. data.field['service'] = layEditor.getContent(likeedit_service);
  91. data.field['privacy'] = layEditor.getContent(likeedit_privacy);
  92. data.field['after_sale'] = layEditor.getContent(likeedit_after_sale);
  93. data.field['user_delete'] = layEditor.getContent(likeedit_user_delete);
  94. like.ajax({
  95. url: "{:url('setting.basic/setPolicy')}",
  96. data: data.field,
  97. type: "POST",
  98. success:function(res) {
  99. if(res.code === 1) {
  100. layer.msg(res.msg, {
  101. offset: '15px'
  102. , icon: 1
  103. , time: 1500
  104. },function () {
  105. location.href = location.href;
  106. });
  107. }
  108. }
  109. });
  110. });
  111. });
  112. </script>