Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 617637d

Browse files
committed
加上二维码信息
1 parent 3cae0b8 commit 617637d

File tree

4 files changed

+49
-3
lines changed

4 files changed

+49
-3
lines changed

model/feed.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func PublishFeed(object interface{}, objectExt interface{}, me *Me) {
154154
feedDay := config.ConfigFile.MustInt("feed", "day", 3)
155155
feed.Seq = feedDay * 24
156156
if me != nil && me.IsAdmin {
157-
feed.Seq += 1000
157+
feed.Seq += 100000
158158
}
159159

160160
_, err := db.MasterDB.Insert(feed)

template/articles/detail.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<li><a href="/articles">文章</a></li>
1111
</ol>
1212
<div class="page">
13-
<div class="box_white">
13+
<div class="box_white" style="overflow: visible;">
1414
<div class="title">
1515
{{if .article.IsSelf}}
1616
<div class="pull-right">
@@ -96,6 +96,9 @@ <h1 id="title" data-id="{{.article.Id}}">
9696
{{end}}
9797
</div>
9898

99+
<!-- 加群等 -->
100+
{{include "common/promotion.html" .}}
101+
99102
<div class="content-buttons">
100103
<div class="pull-right c9 f11" style="line-height: 12px; padding-top: 3px; text-shadow: 0px 1px 0px #fff;">{{.article.Viewnum}} 次点击 &nbsp;{{if .article.Likenum}}∙&nbsp; {{.article.Likenum}} 赞 &nbsp; {{end}}</div>
101104
<a class="tb collect" href="javascript:;" title="{{if .hadcollect}}取消收藏{{else}}加入收藏{{end}}" data-objid="{{.article.Id}}" data-objtype="1" data-collect="{{.hadcollect}}">{{if .hadcollect}}取消收藏{{else}}加入收藏{{end}}</a>
@@ -260,6 +263,13 @@ <h1 id="title" data-id="{{.article.Id}}">
260263
} else {
261264
$('.read-time').text('预计阅读时间不到 1 分钟');
262265
}
266+
267+
$('.qrcode').on('mouseover', function(evt) {
268+
$('.qrcode-pop').show();
269+
});
270+
$('.qrcode').on('mouseout', function(evt) {
271+
$('.qrcode-pop').hide();
272+
});
263273
});
264274
</script>
265275
{{include "cssjs/ckeditor.js.html" .}}

template/common/promotion.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<div class="cell qrcode" style="position: relative;">
2+
<p>入群交流(和以上内容无关):Go中文网 QQ 交流群:798786647 或加微信入微信群:274768166 备注:入群;关注公众号:<a href="javascript:void(0)" title="" target="_self">Go语言中文网<img width="16" src="https://weixin.sogou.com/new/pc/images/ico_ewm.png"></a></p>
3+
<span style="display: none;" class="qrcode-pop">
4+
关注Go语言中文网<br>
5+
<img src="{{.static.domain}}/static/img/wx_sg_qrcode.jpg?imageView2/2/w/280" alt="关注微信" class="img-responsive">
6+
<span style="color: red;">领全套学习资料</span>
7+
</span>
8+
</div>
9+
10+
<style type="text/css">
11+
.qrcode-pop {
12+
background: #fff;
13+
border: 1px solid #ddd;
14+
position: absolute;
15+
left: 42%;
16+
top: 32px;
17+
-moz-box-shadow: 0 2px 5px #ddd;
18+
-webkit-box-shadow: 0 2px 5px #d9d9d9;
19+
box-shadow: 0 2px 5px #d9d9d9;
20+
border-radius: 2px;
21+
text-align: center;
22+
padding: 5px 10px 16px;
23+
line-height: 32px;
24+
width: 150px;
25+
}
26+
</style>

template/topics/detail.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<li><a href="{{if .topic.node.ename}}/go/{{.topic.node.ename}}{{else}}/topics/node/{{.topic.node.nid}}{{end}}">{{.topic.node.name}}</a></li>
1313
</ol>
1414
<div class="page">
15-
<div class="box_white">
15+
<div class="box_white" style="overflow: visible;">
1616
<div class="title">
1717
<div class="pull-right">
1818
<a href="/user/{{.topic.user.Username}}" title="{{.topic.user.Username}}">
@@ -81,6 +81,9 @@ <h1>
8181
</div>
8282
{{end}}
8383

84+
<!-- 加群等 -->
85+
{{include "common/promotion.html" .}}
86+
8487
<div class="content-buttons">
8588
<div class="pull-right c9 f11" style="line-height: 12px; padding-top: 3px; text-shadow: 0px 1px 0px #fff;">{{add .topic.view 1}} 次点击 &nbsp;{{if .topic.like}}∙&nbsp; {{.topic.like}} 赞 &nbsp; {{end}}</div>
8689
<a class="tb collect" href="javascript:;" title="{{if .hadcollect}}取消收藏{{else}}加入收藏{{end}}" data-objid="{{.topic.tid}}" data-objtype="0" data-collect="{{.hadcollect}}">{{if .hadcollect}}取消收藏{{else}}加入收藏{{end}}</a>
@@ -211,6 +214,13 @@ <h1>
211214

212215
return false;
213216
});
217+
218+
$('.qrcode').on('mouseover', function(evt) {
219+
$('.qrcode-pop').show();
220+
});
221+
$('.qrcode').on('mouseout', function(evt) {
222+
$('.qrcode-pop').hide();
223+
});
214224
});
215225
</script>
216226

0 commit comments

Comments
 (0)