zhangguidong vor 2 Jahren
Ursprung
Commit
d833955578

+ 20 - 1
app/admin/controller/Shopjoin.php

@@ -134,6 +134,25 @@ class Shopjoin extends BaseAdmin
 
         return $this->fetch('shopjoin/platform_privacy');
     }
-	
+
+    /**
+     * 关于我们
+     */
+    public function aboutUs()
+    {
+        $config_model = new ConfigModel();
+        if (request()->isAjax()) {
+            $title = input('title', '');//标题
+            $content = input('content', '');//内容
+
+            return $config_model->setAboutUs($title, $content);
+
+        }
+
+        $shop_apply_agreement = $config_model->getAboutUs();
+        $this->assign('platform_privacy', $shop_apply_agreement);
+
+        return $this->fetch('shopjoin/about_us');
+    }
 	
 }

+ 80 - 0
app/admin/view/shopjoin/about_us.html

@@ -0,0 +1,80 @@
+{extend name="base"/}
+{block name="resources"}
+<style>
+	.layui-colla-content li {
+		line-height: 30px;
+	}
+</style>
+{/block}
+{block name="main"}
+<div class="layui-collapse ns-tips">
+	<div class="layui-colla-item">
+		<h2 class="layui-colla-title">操作提示</h2>
+		<div class="layui-colla-content layui-show">
+			<ul>
+				<li>遵循以下隐私协议</li>
+			</ul>
+		</div>
+	</div>
+</div>
+
+<div class="layui-form ns-form">
+	<div class="layui-form-item">
+		<label class="layui-form-label"><span class="required">*</span>隐私协议:</label>
+		<div class="layui-input-block">
+			<input type="text" name="title" value="{$platform_privacy.data.title}" autocomplete="off" class="layui-input ns-len-long">
+		</div>
+	</div>
+
+	<label class="layui-form-label"><span class="required">*</span>协议内容:</label>
+	<script id="editor" type="text/plain" style="width:600px; height:250px; margin-left: 200px;"></script>
+
+	<div class="ns-form-row">
+		<button class="layui-btn ns-bg-color" lay-submit lay-filter="save">保存</button>
+	</div>
+
+	<input type="hidden" name="content" id="setContent" value="{$platform_privacy.data.content}" />
+</div>
+{/block}
+{block name="script"}
+<script type="text/javascript" charset="utf-8" src="STATIC_EXT/ueditor/ueditor.config.js"></script>
+<script type="text/javascript" charset="utf-8" src="STATIC_EXT/ueditor/ueditor.all.js"></script>
+<script type="text/javascript" charset="utf-8" src="STATIC_EXT/ueditor/lang/zh-cn/zh-cn.js"></script>
+<script>
+	var ue = UE.getEditor('editor');
+	ue.ready(function() {
+		ue.setContent($('#setContent').val());
+	});
+	
+	layui.use('form', function() {
+		var form = layui.form,
+			repeat_flag = false; //防重复标识
+		form.render();
+
+		// 搜索
+		form.on('submit(save)', function(data) {
+			var html = '';
+			ue.ready(function() {
+				html = ue.getContent();
+			});
+			
+			data.field.content = html;
+			
+			if(repeat_flag) return;
+			repeat_flag = true;
+			
+			$.ajax({
+				url: ns.url("admin/shopjoin/platformprivacy"),
+				data: data.field,
+				dataType: 'JSON',
+				type: 'POST',
+				success: function(res) {
+					repeat_flag = false;
+					layer.msg(res.message);
+					
+				}
+			});
+		});
+	});
+</script>
+{/block}

+ 1 - 1
app/model/shop/Config.php

@@ -121,7 +121,7 @@ class Config extends BaseModel
     /**
      * 设置隐私协议
      */
-    public function seAboutUs($title, $content)
+    public function setAboutUs($title, $content)
     {
         $document = new DocumentModel();
         $res = $document->setDocument($title, $content, [ [ 'site_id', '=', 0 ], [ 'app_module', '=', 'admin' ], [ 'document_key', '=', "ABOUT_US" ] ]);