瀏覽代碼

笔记

layui
yirenyishi 6 年前
父節點
當前提交
8b70f364b4
  1. 10
      controllers/PageController.go
  2. 11
      views/iframe/note.html
  3. 2
      views/note.html

10
controllers/PageController.go

@ -40,6 +40,16 @@ func (this *PageController) IframeUser() {
// @router /iframe/note [get]
func (this *PageController) IframeNote() {
uid := this.GetSession("userid")
if uid == nil {
this.Data["IsLogin"] = false
}else {
this.Data["IsLogin"] = true
noteColls,err:=service.GetNoteColl(uid.(int64))
if err== nil {
this.Data["NoteColl"] = noteColls
}
}
this.TplName = "iframe/note.html"
}

11
views/iframe/note.html

@ -28,11 +28,9 @@
<span>所属文件夹:</span>
<span style="flex: 1">
<select class="form-control " style="display: inline-block;height: 32px" id="catory">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
{{range .NoteColl}}
<option value="{{.Id}}">{{.Title}}</option>
{{end}}
</select>
</span>
</div>
@ -47,6 +45,9 @@
</body>
<script>
$(function () {
if (!{{.IsLogin}}) {
parent.location.href = "/login"
}
$("#saveBtn").click(function () {
var pid = $("#catory").val()
var title = $("#lable").val()

2
views/note.html

@ -63,7 +63,7 @@
<ul class="sub-menu" value="{{.Id}}">
{{range .Notes}}
<li>
<a href="javascript:void(0)" onclick="noteClick({{.Id}})" value="{{.Id}}">{{.Id}}-{{.Title}}</a>
<a href="javascript:void(0)" onclick="noteClick({{.Id}})" value="{{.Id}}">{{.Title}}</a>
</li>
{{end}}
</ul>

載入中…
取消
儲存