Skip to content

Commit

Permalink
example调整
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Oct 14, 2023
1 parent 89c5a35 commit 2cf855a
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 5 deletions.
13 changes: 12 additions & 1 deletion example/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta charset="utf-8" />
<title>Haotrader Demo</title>
<link crossorigin="anonymous" href="https://cdn.staticfile.org/layui/2.8.17/css/layui.min.css" rel="stylesheet">
<script src="/statics/lib/js.cookie.min.js"></script>
<style>
body{
overflow-x: hidden;
Expand Down Expand Up @@ -119,7 +120,12 @@
</div>

<div class="main ">
<div class="header layui-row" style="line-height: 20px; height: 20px;"></div>
<div class="header layui-row" style="line-height: 40px; height: 40px;">
<div class="layui-row">
<div class="layui-col-md10 layui-col-space10">-</div>
<div class="layui-col-md2 layui-col-space10"><p style="padding-left: 20px;">Hi, <span class="user">Guest</span></p></div>
</div>
</div>

<div class="layui-row">
<div class="layui-col-md7">
Expand Down Expand Up @@ -262,6 +268,7 @@
<script type="text/javascript" src="https://unpkg.com/klinecharts/dist/klinecharts.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.staticfile.org/layui/2.8.17/layui.min.js"></script>
<script src="/statics/kline.js"></script>
<script src="/statics/login.js"></script>
<!--您的Layui代码start-->
<script type="text/javascript">
layui.use(['laydate', 'layer', 'table', 'element', 'laytpl', 'form'], function () {
Expand Down Expand Up @@ -289,6 +296,10 @@
});






function formatTime(t) {
var d = new Date(parseInt(t));
return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
Expand Down
4 changes: 0 additions & 4 deletions example/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ func main() {
}

gin.SetMode(gin.DebugMode)

go func() {
// log.Println(http.ListenAndServe(":6060", nil))
}()
startWeb(*port)
}

Expand Down
8 changes: 8 additions & 0 deletions example/statics/lib/js.cookie.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions example/statics/login.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(function(){
layui.use(['layer'], function () {
var layer = layui.layer;

if(!Cookies.get("user_id")) {
layer.prompt({
formType: 0,
value: "1000",
title: '第一次,请设置您的用户ID',
area: ['400px', '50px'] // 自定义文本域宽高
}, function(value, index, elem){
Cookies.set("user_id", value, { expires: 7, path: '' });
layer.close(index); // 关闭层
});
}

layui.$(".user").html(Cookies.get("user_id"));
})

})()

0 comments on commit 2cf855a

Please sign in to comment.