Browse Source

笔记

layui
yirenyishi 6 years ago
parent
commit
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] // @router /iframe/note [get]
func (this *PageController) IframeNote() { 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" this.TplName = "iframe/note.html"
} }

11
views/iframe/note.html

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

2
views/note.html

@ -63,7 +63,7 @@
<ul class="sub-menu" value="{{.Id}}"> <ul class="sub-menu" value="{{.Id}}">
{{range .Notes}} {{range .Notes}}
<li> <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> </li>
{{end}} {{end}}
</ul> </ul>

Loading…
Cancel
Save