Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wechat_lung
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hanpeng
wechat_lung
Commits
8c6bf1e2
Commit
8c6bf1e2
authored
Aug 22, 2019
by
hanpeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-mark-社区详情,帖子详情,点赞
parent
0d70eb77
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
565 additions
and
227 deletions
+565
-227
index.html
medtap_bbs_lung/index.html
+3
-94
cardDetail.js
medtap_bbs_lung/javaScript/cardDetail.js
+55
-0
index.js
medtap_bbs_lung/javaScript/index.js
+483
-127
cardDetail.html
medtap_bbs_lung/pages/cardDetail.html
+24
-6
No files found.
medtap_bbs_lung/index.html
View file @
8c6bf1e2
...
@@ -48,10 +48,10 @@
...
@@ -48,10 +48,10 @@
</div>
</div>
</div>
</div>
<div
class=
"silder_tap clearfix"
>
<div
class=
"silder_tap clearfix"
>
<div
class=
"silder_tap_item"
id=
"recommend"
>
<div
class=
"silder_tap_item
on
"
id=
"recommend"
>
推荐
推荐
</div>
</div>
<div
class=
"silder_tap_item
on
"
id=
"newest"
>
<div
class=
"silder_tap_item"
id=
"newest"
>
最新
最新
</div>
</div>
<!-- <div class="silder_tap_item" id="follow">
<!-- <div class="silder_tap_item" id="follow">
...
@@ -62,98 +62,7 @@
...
@@ -62,98 +62,7 @@
</div> -->
</div> -->
</div>
</div>
<div
class=
"list_warp"
>
<div
class=
"list_warp"
>
<div
class=
"list_item"
>
<div
class=
"list_item_header clearfix"
>
<img
src=
"images/post_title_bg@2x.png"
class=
"user_profile"
>
<div
class=
"user_info"
>
<p
class=
"user_name"
>
张天问
</p>
<p
class=
"txt_gray post_card_time"
>
07-08 11:12
</p>
</div>
</div>
<div
class=
"list_item_content"
>
<div
class=
"list_item_content_desc"
>
大家好,我是胃癌患者,现在肺转移,上星期开始胸闷胸痛伴有咳嗽,昨天开始胸痛感觉好些,可是咳嗽和胸闷还是一样,怎么处理好?医生说等水多了抽掉一部分,然后再去医院做检查什么的
</div>
<div
class=
"list_item_content_img"
>
<img
src=
"images/post_title_bg@2x.png"
>
</div>
</div>
<div
class=
"list_item_tools clearfix"
>
<div
class=
"tools clearfix seen"
>
<img
src=
"images/post_seen_png@2x.png"
>
<span
class=
"seenNum"
>
246
</span>
</div>
<div
class=
"tools clearfix reply"
>
<img
src=
"images/post_reply_png@2x.png"
>
<span
class=
"replyNum"
>
12
</span>
</div>
<div
class=
"tools clearfix like"
>
<img
src=
"images/post_unlike_png@2x.png"
>
<span
class=
"likeNum"
>
12
</span>
</div>
</div>
</div>
<div
class=
"list_item"
>
<div
class=
"list_item_header clearfix"
>
<img
src=
"images/post_title_bg@2x.png"
class=
"user_profile"
>
<div
class=
"user_info"
>
<p
class=
"user_name"
>
张天问
</p>
<p
class=
"txt_gray post_card_time"
>
07-08 11:12
</p>
</div>
</div>
<div
class=
"list_item_content"
>
<div
class=
"list_item_content_desc"
>
你好
</div>
</div>
<div
class=
"list_item_tools clearfix"
>
<div
class=
"tools clearfix seen"
>
<img
src=
"images/post_seen_png@2x.png"
>
<span
class=
"seenNum"
>
246
</span>
</div>
<div
class=
"tools clearfix reply"
>
<img
src=
"images/post_reply_png@2x.png"
>
<span
class=
"replyNum"
>
12
</span>
</div>
<div
class=
"tools clearfix like"
>
<img
src=
"images/post_unlike_png@2x.png"
>
<span
class=
"likeNum"
>
12
</span>
</div>
</div>
</div>
<div
class=
"list_item"
>
<div
class=
"list_item_header clearfix"
>
<img
src=
"images/post_title_bg@2x.png"
class=
"user_profile"
>
<div
class=
"user_info"
>
<p
class=
"user_name"
>
张天问
</p>
<p
class=
"txt_gray post_card_time"
>
07-08 11:12
</p>
</div>
</div>
<div
class=
"list_item_content"
>
<div
class=
"list_item_content_desc"
>
大家好,我是胃癌患者,现在肺转移,上星期开始胸闷胸痛伴有咳嗽,昨天开始胸痛感觉好些,可是咳嗽和胸闷还是一样,怎么处理好?医生说等水多了抽掉一部分,然后再去医院做检查什么的
</div>
<div
class=
"list_item_content_imgMore clearfix"
>
<img
src=
"images/post_title_bg@2x.png"
>
<img
src=
"images/post_title_bg@2x.png"
>
<img
src=
"images/post_title_bg@2x.png"
>
</div>
<div
class=
"list_item_tools clearfix"
>
<div
class=
"tools clearfix seen"
>
<img
src=
"images/post_seen_png@2x.png"
>
<span
class=
"seenNum"
>
246
</span>
</div>
<div
class=
"tools clearfix reply"
>
<img
src=
"images/post_reply_png@2x.png"
>
<span
class=
"replyNum"
>
12
</span>
</div>
<div
class=
"tools clearfix like"
>
<img
src=
"images/post_unlike_png@2x.png"
>
<span
class=
"likeNum"
>
12
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"change_name_warp"
>
<div
class=
"change_name_warp"
>
<div
class=
"chang_name_header"
>
<div
class=
"chang_name_header"
>
...
...
medtap_bbs_lung/javaScript/cardDetail.js
0 → 100644
View file @
8c6bf1e2
define
([
'zepto'
,
'medtap'
],
function
(
$
,
medtap
){
var
card
=
{
cardId
:
medtap
.
getRequest
(
'cardId'
),
limit
:
10
,
offset
:
1
,
hasMore
:
false
,
firstLoad
:
false
,
init
:
function
(){
card
.
getCardDetail
();
card
.
getCommentList
();
},
getCardDetail
:
function
(){
medtap
.
loading
(
1
);
medtap
.
submitAjax
({
url
:
'https://devgw.medtap.cn//operation/pubbbs/publish/'
+
card
.
cardId
,
type
:
'GET'
,
async
:
false
,
data
:{
},
success
:
function
(
res
){
medtap
.
loading
(
0
);
if
(
res
.
success
==
true
){
var
detailInfo
=
res
.
content
.
publish
;
$
(
'.user_name'
).
html
(
detailInfo
.
nickname
);
$
(
'.card_time'
).
html
(
detailInfo
.
updateTime
.
substring
(
5
,
16
));
$
(
'.user_profile'
).
attr
(
'src'
,
detailInfo
.
profile
);
$
(
'.cardDetail'
).
html
(
detailInfo
.
content
);
$
(
'.seenNum'
).
html
(
detailInfo
.
viewCount
);
$
(
'.replyNum'
).
html
(
detailInfo
.
commentCount
);
}
}
})
},
//获取评论列表
getCommentList
:
function
(){
medtap
.
loading
(
1
);
medtap
.
submitAjax
({
url
:
'https://devgw.medtap.cn/operation/pubbbs/publishComment'
,
type
:
'GET'
,
async
:
false
,
data
:
{
offset
:
card
.
offset
,
limit
:
card
.
limit
,
publishId
:
card
.
cardId
},
success
:
function
(
res
){
medtap
.
loading
(
0
);
}
})
}
}
card
.
init
();
})
\ No newline at end of file
medtap_bbs_lung/javaScript/index.js
View file @
8c6bf1e2
define
([
'zepto'
,
'medtap'
/* ,'https://review-formal.iplusmed.com/Common/javaScript/beforeSubmitForLung.js?v=2.0' */
],
function
(
$
,
medtap
/* ,beforeSubmit */
){
define
([
'zepto'
,
'medtap'
/* ,'https://review-formal.iplusmed.com/Common/javaScript/beforeSubmitForLung.js?v=2.0' */
],
var
index
=
{
function
(
$
,
medtap
/* ,beforeSubmit */
)
{
wechatId
:
medtap
.
getRequest
(
'wechatId'
),
var
index
=
{
init
:
function
(){
wechatId
:
medtap
.
getRequest
(
'wechatId'
),
index
.
getUserToken
();
limit
:
10
,
},
offset
:
1
,
bindEve
:
function
(){
hasMore
:
false
,
$
(
'.user_nickName'
).
on
(
'click'
,
function
(){
firstLoad
:
false
,
$
(
'.content_mod'
).
show
();
init
:
function
()
{
$
(
'.change_name_warp'
).
show
();
index
.
getUserToken
();
});
index
.
getForumList
(
1
);
},
//取消
bindEve
:
function
()
{
$
(
'.change_name_warp'
).
on
(
'click'
,
'.change_btn_cancle'
,
function
(){
$
(
'.user_nickName'
).
on
(
'click'
,
function
()
{
$
(
'.content_mod'
).
hide
();
$
(
'.content_mod'
).
show
();
$
(
'.change_name_warp'
).
hide
();
$
(
'.change_name_warp'
).
show
();
$
(
'.new_nick'
).
val
(
''
);
});
})
//取消
//确定
$
(
'.change_name_warp'
).
on
(
'click'
,
'.change_btn_cancle'
,
function
()
{
$
(
'.change_name_warp'
).
on
(
'click'
,
'.change_btn_confirm'
,
function
(){
$
(
'.content_mod'
).
hide
();
var
newNick
=
$
(
'.new_nick'
).
val
();
$
(
'.change_name_warp'
).
hide
();
index
.
upDateUserInfo
(
newNick
);
$
(
'.new_nick'
).
val
(
''
);
})
})
},
//换取微信token
//确定
getUserToken
:
function
(){
$
(
'.change_name_warp'
).
on
(
'click'
,
'.change_btn_confirm'
,
function
()
{
localStorage
.
wxLungToken
=
''
;
var
newNick
=
$
(
'.new_nick'
).
val
();
medtap
.
loading
(
1
);
index
.
upDateUserInfo
(
newNick
);
medtap
.
submitAjax
({
});
url
:
'https://devgw.medtap.cn/user/auth/token'
,
type
:
'POST'
,
//tab分类查询帖子列表
async
:
false
,
$
(
'.silder_tap_item'
).
on
(
'click'
,
function
()
{
contentType
:
'application/json'
,
$
(
this
).
addClass
(
'on'
);
data
:{
$
(
this
).
siblings
().
removeClass
(
'on'
);
wechatId
:
index
.
wechatId
var
type
=
''
;
},
var
id
=
$
(
this
).
attr
(
'id'
);
success
:
function
(
res
){
if
(
id
==
'recommend'
)
{
medtap
.
loading
(
0
);
index
.
firstLoad
=
false
;
if
(
res
.
success
==
true
){
index
.
offset
=
1
;
var
token
=
res
.
content
.
token
;
type
=
1
;
localStorage
.
setItem
(
'wxLungToken'
,
token
);
}
else
if
(
id
==
'newest'
)
{
/* beforeSubmit.config({
index
.
firstLoad
=
false
;
wechatId: index.wechatId,
index
.
offset
=
1
;
getInfo: true,
type
=
2
;
success: function() {
}
index.getForumInfo();
index
.
getForumList
(
type
)
index.getUserInfo()
});
//滚动加载
$
(
window
).
scroll
(
function
()
{
var
scrollTop
=
$
(
this
).
scrollTop
();
//滚动条距离顶部的高度
var
scrollHeight
=
$
(
document
).
height
();
//当前页面的总高度
var
clientHeight
=
$
(
this
).
height
();
//当前可视的页面高度
if
(
scrollTop
+
clientHeight
>=
scrollHeight
)
{
//距离顶部+当前高度 >=文档总高度 即代表滑动到底部
//滚动条到达底部
if
(
index
.
hasMore
==
true
)
{
var
type
=
''
if
(
$
(
'#recommend'
).
hasClass
(
'on'
))
{
index
.
firstLoad
=
true
;
index
.
offset
+=
1
;
type
=
1
;
}
else
if
(
$
(
'#newest'
).
hasClass
(
'on'
))
{
index
.
firstLoad
=
true
;
index
.
offset
+=
1
;
type
=
2
;
}
}
}).init(); */
index
.
getForumList
(
type
)
index
.
getForumInfo
();
}
else
{
index
.
getUserInfo
();
}
else
{
}
}
else
if
(
scrollTop
<=
0
)
{
//滚动条到达顶部
return
}
});
},
//换取微信token
getUserToken
:
function
()
{
localStorage
.
wxLungToken
=
''
;
medtap
.
loading
(
1
);
medtap
.
submitAjax
({
url
:
'https://devgw.medtap.cn/user/auth/token'
,
type
:
'POST'
,
async
:
false
,
contentType
:
'application/json'
,
data
:
{
wechatId
:
index
.
wechatId
},
success
:
function
(
res
)
{
medtap
.
loading
(
0
);
if
(
res
.
success
==
true
)
{
var
token
=
res
.
content
.
token
;
localStorage
.
setItem
(
'wxLungToken'
,
token
);
/* beforeSubmit.config({
wechatId: index.wechatId,
getInfo: true,
success: function() {
index.getForumInfo();
index.getUserInfo()
}
}).init(); */
index
.
getForumInfo
();
index
.
getUserInfo
();
index
.
joinPublish
();
}
else
{
}
},
error
:
function
(
res
)
{
console
.
log
(
res
.
resultDesc
);
}
})
},
//获取用户信息
getUserInfo
:
function
()
{
medtap
.
loading
(
1
);
medtap
.
submitAjax
({
url
:
'https://devgw.medtap.cn/user/getUserDetail'
,
type
:
'GET'
,
async
:
false
,
data
:
{
},
success
:
function
(
res
)
{
medtap
.
loading
(
0
);
var
userInfo
=
res
.
content
.
userInfo
;
$
(
'.user_nickName'
).
html
(
userInfo
.
nickname
)
$
(
'.change_name_nickname'
).
html
(
userInfo
.
nickname
)
}
})
},
//更新用户信息
upDateUserInfo
:
function
(
name
)
{
medtap
.
loading
(
1
);
medtap
.
submitAjax
({
url
:
'https://devgw.medtap.cn/user/saveUserInfo'
,
type
:
'POST'
,
async
:
false
,
contentType
:
'application/json'
,
data
:
{
nickname
:
name
},
success
:
function
(
res
)
{
medtap
.
loading
(
0
);
setTimeout
(
function
()
{
medtap
.
toast
({
message
:
'修改成功'
,
time
:
2000
})
index
.
getUserInfo
();
$
(
'.content_mod'
).
hide
();
$
(
'.change_name_warp'
).
hide
();
$
(
'.new_nick'
).
val
(
''
);
},
1000
)
}
}
},
})
error
:
function
(
res
){
},
console
.
log
(
res
.
resultDesc
);
//获取论坛信息
}
getForumInfo
:
function
()
{
})
medtap
.
loading
(
1
);
},
medtap
.
submitAjax
({
getUserInfo
:
function
(){
url
:
'https://devgw.medtap.cn//operation/pubbbs/group/1'
,
medtap
.
loading
(
1
);
type
:
'GET'
,
medtap
.
submitAjax
({
async
:
false
,
url
:
'https://devgw.medtap.cn/user/getUserDetail'
,
data
:
{
type
:
'GET'
,
async
:
false
,
},
data
:{
success
:
function
(
res
)
{
medtap
.
loading
(
0
);
},
if
(
res
.
success
==
true
)
{
success
:
function
(
res
){
var
forumInfo
=
res
.
content
.
publishGroup
;
medtap
.
loading
(
0
);
$
(
'.bbs_title'
).
html
(
forumInfo
.
name
);
//社区名
var
userInfo
=
res
.
content
.
userInfo
;
$
(
'.bbs_profile_img'
).
attr
(
'src'
,
forumInfo
.
icon
);
//社区icon
$
(
'.user_nickName'
).
html
(
userInfo
.
nickname
)
$
(
'.bbs_attentionNum'
).
html
(
forumInfo
.
userCount
);
//社区关注人数
$
(
'.change_name_nickname'
).
html
(
userInfo
.
nickname
)
$
(
'.bbs_cardNum'
).
html
(
forumInfo
.
publishCount
);
//社区帖子数量
}
}
})
}
},
})
//更新用户信息
},
upDateUserInfo
:
function
(
name
){
//根据分类获取论坛信息
medtap
.
loading
(
1
);
getForumList
:
function
(
listType
)
{
medtap
.
submitAjax
({
medtap
.
loading
(
1
);
url
:
'https://devgw.medtap.cn/user/saveUserInfo'
,
medtap
.
submitAjax
({
type
:
'POST'
,
url
:
'https://devgw.medtap.cn/operation/pubbbs/publish'
,
async
:
false
,
type
:
'GET'
,
contentType
:
'application/json'
,
async
:
false
,
data
:{
data
:
{
nickname
:
name
offset
:
index
.
offset
,
},
limit
:
index
.
limit
,
success
:
function
(
res
){
good
:
listType
||
'1'
,
medtap
.
loading
(
0
);
},
setTimeout
(
function
(){
success
:
function
(
res
)
{
medtap
.
toast
({
medtap
.
loading
(
0
);
message
:
'修改成功'
,
if
(
res
.
success
==
true
)
{
time
:
2000
var
forumList
=
res
.
content
.
list
;
})
if
(
forumList
.
length
==
0
)
{
index
.
getUserInfo
();
index
.
hasMore
=
false
;
$
(
'.content_mod'
).
hide
();
setTimeout
(
function
()
{
$
(
'.change_name_warp'
).
hide
();
medtap
.
toast
({
$
(
'.new_nick'
).
val
(
''
);
message
:
'没有更多了'
,
},
1000
)
time
:
2000
}
})
})
},
1000
)
},
}
else
{
//获取论坛信息
index
.
hasMore
=
true
;
getForumInfo
:
function
(){
//dealData
medtap
.
loading
(
1
);
var
str
=
''
;
medtap
.
submitAjax
({
for
(
var
i
=
0
;
i
<
forumList
.
length
;
i
++
){
url
:
'https://devgw.medtap.cn//operation/pubbbs/group/1'
,
//当前帖子用户未点赞
type
:
'GET'
,
if
(
forumList
[
i
].
upStatus
==
0
){
async
:
false
,
var
picUrl
=
forumList
[
i
].
picUrls
;
data
:{
//单张图片
if
(
picUrl
.
length
!=
0
&&
picUrl
.
length
<
2
){
},
str
+=
'<div class="list_item" data-id="'
+
forumList
[
i
].
id
+
'">'
+
success
:
function
(
res
){
'<div class="list_item_header clearfix">'
+
medtap
.
loading
(
0
);
'<img src="'
+
forumList
[
i
].
profile
+
'" class="user_profile">'
+
if
(
res
.
success
==
true
){
'<div class="user_info">'
+
var
forumInfo
=
res
.
content
.
publishGroup
;
'<p class="user_name">'
+
forumList
[
i
].
nickname
+
'</p>'
+
$
(
'.bbs_title'
).
html
(
forumInfo
.
name
);
//社区名
'<p class="txt_gray post_card_time">'
+
forumList
[
i
].
updateTime
.
substring
(
5
,
16
)
+
'</p>'
+
$
(
'.bbs_profile_img'
).
attr
(
'src'
,
forumInfo
.
icon
);
//社区icon
'</div>'
+
$
(
'.bbs_attentionNum'
).
html
(
forumInfo
.
userCount
);
//社区关注人数
'</div>'
+
$
(
'.bbs_cardNum'
).
html
(
forumInfo
.
publishCount
);
//社区帖子数量
'<div class="list_item_content">'
+
'<div class="list_item_content_desc">'
+
forumList
[
i
].
content
+
'</div>'
+
'<div class="list_item_content_img">'
+
'<img src="'
+
picUrl
+
'">'
+
'</div>'
+
'</div>'
+
'<div class="list_item_tools clearfix">'
+
'<div class="tools clearfix seen">'
+
'<img src="images/post_seen_png@2x.png">'
+
'<span class="seenNum">'
+
forumList
[
i
].
viewCount
+
'</span>'
+
'</div>'
+
'<div class="tools clearfix reply">'
+
'<img src="images/post_reply_png@2x.png">'
+
'<span class="replyNum">'
+
forumList
[
i
].
commentCount
+
'</span>'
+
'</div>'
+
'<div class="tools clearfix like">'
+
'<img src="images/post_unlike_png@2x.png">'
+
'<span class="likeNum">'
+
forumList
[
i
].
upCount
+
'</span>'
+
'</div>'
+
'</div>'
+
'</div>'
;
}
else
if
(
picUrl
.
length
>
1
){
//多张图片
var
imgStr
=
''
;
for
(
var
j
=
0
;
j
<
picUrl
.
length
;
j
++
){
imgStr
+=
'<img src="'
+
picUrl
[
j
]
+
'">'
;
}
str
+=
'<div class="list_item" data-id="'
+
forumList
[
i
].
id
+
'">'
+
'<div class="list_item_header clearfix">'
+
'<img src="i'
+
forumList
[
i
].
profile
+
'" class="user_profile">'
+
'<div class="user_info">'
+
'<p class="user_name">'
+
forumList
[
i
].
nickname
+
'</p>'
+
'<p class="txt_gray post_card_time">'
+
forumList
[
i
].
updateTime
.
substring
(
5
,
16
)
+
'</p>'
+
'</div>'
+
'</div>'
+
'<div class="list_item_content">'
+
'<div class="list_item_content_desc">'
+
forumList
[
i
].
content
+
'</div>'
+
'<div class="list_item_content_imgMore clearfix">'
+
imgStr
+
'</div>'
+
'<div class="list_item_tools clearfix">'
+
'<div class="tools clearfix seen">'
+
'<img src="images/post_seen_png@2x.png">'
+
'<span class="seenNum">'
+
forumList
[
i
].
viewCount
+
'</span>'
+
'</div>'
+
'<div class="tools clearfix reply">'
+
'<img src="images/post_reply_png@2x.png">'
+
'<span class="replyNum">'
+
forumList
[
i
].
commentCount
+
'</span>'
+
'</div>'
+
'<div class="tools clearfix like">'
+
'<img src="images/post_unlike_png@2x.png">'
+
'<span class="likeNum">'
+
forumList
[
i
].
upCount
+
'</span>'
+
'</div>'
+
'</div>'
+
'</div>'
+
'</div>'
;
}
else
{
str
+=
'<div class="list_item" data-id="'
+
forumList
[
i
].
id
+
'">'
+
'<div class="list_item_header clearfix">'
+
'<img src="'
+
forumList
[
i
].
profile
+
'" class="user_profile">'
+
'<div class="user_info">'
+
'<p class="user_name">'
+
forumList
[
i
].
nickname
+
'</p>'
+
'<p class="txt_gray post_card_time">'
+
forumList
[
i
].
updateTime
.
substring
(
5
,
16
)
+
'</p>'
+
'</div>'
+
'</div>'
+
'<div class="list_item_content">'
+
'<div class="list_item_content_desc">'
+
forumList
[
i
].
content
+
'</div>'
+
'</div>'
+
'<div class="list_item_tools clearfix">'
+
'<div class="tools clearfix seen">'
+
'<img src="images/post_seen_png@2x.png">'
+
'<span class="seenNum">'
+
forumList
[
i
].
viewCount
+
'</span>'
+
'</div>'
+
'<div class="tools clearfix reply">'
+
'<img src="images/post_reply_png@2x.png">'
+
'<span class="replyNum">'
+
forumList
[
i
].
commentCount
+
'</span>'
+
'</div>'
+
'<div class="tools clearfix like">'
+
'<img src="images/post_unlike_png@2x.png">'
+
'<span class="likeNum">'
+
forumList
[
i
].
upCount
+
'</span>'
+
'</div>'
+
'</div>'
+
'</div>'
;
}
}
else
if
(
forumList
[
i
].
upStatus
==
1
){
var
picUrl
=
forumList
[
i
].
picUrls
;
//单张图片
if
(
picUrl
.
length
!=
0
&&
picUrl
.
length
<
2
){
str
+=
'<div class="list_item" data-id="'
+
forumList
[
i
].
id
+
'">'
+
'<div class="list_item_header clearfix">'
+
'<img src="'
+
forumList
[
i
].
profile
+
'" class="user_profile">'
+
'<div class="user_info">'
+
'<p class="user_name">'
+
forumList
[
i
].
nickname
+
'</p>'
+
'<p class="txt_gray post_card_time">'
+
forumList
[
i
].
updateTime
.
substring
(
5
,
16
)
+
'</p>'
+
'</div>'
+
'</div>'
+
'<div class="list_item_content">'
+
'<div class="list_item_content_desc">'
+
forumList
[
i
].
content
+
'</div>'
+
'<div class="list_item_content_img">'
+
'<img src="'
+
picUrl
+
'">'
+
'</div>'
+
'</div>'
+
'<div class="list_item_tools clearfix">'
+
'<div class="tools clearfix seen">'
+
'<img src="images/post_seen_png@2x.png">'
+
'<span class="seenNum">'
+
forumList
[
i
].
viewCount
+
'</span>'
+
'</div>'
+
'<div class="tools clearfix reply">'
+
'<img src="images/post_reply_png@2x.png">'
+
'<span class="replyNum">'
+
forumList
[
i
].
commentCount
+
'</span>'
+
'</div>'
+
'<div class="tools clearfix like">'
+
'<img src="images/post_like_png@2x.png">'
+
'<span class="likeNum">'
+
forumList
[
i
].
upCount
+
'</span>'
+
'</div>'
+
'</div>'
+
'</div>'
;
}
else
if
(
picUrl
.
length
>
1
){
//多张图片
var
imgStr
=
''
;
for
(
var
j
=
0
;
j
<
picUrl
.
length
;
j
++
){
imgStr
+=
'<img src="'
+
picUrl
[
j
]
+
'">'
;
}
str
+=
'<div class="list_item" data-id="'
+
forumList
[
i
].
id
+
'">'
+
'<div class="list_item_header clearfix">'
+
'<img src="'
+
forumList
[
i
].
profile
+
'" class="user_profile">'
+
'<div class="user_info">'
+
'<p class="user_name">'
+
forumList
[
i
].
nickname
+
'</p>'
+
'<p class="txt_gray post_card_time">'
+
forumList
[
i
].
updateTime
.
substring
(
5
,
16
)
+
'</p>'
+
'</div>'
+
'</div>'
+
'<div class="list_item_content">'
+
'<div class="list_item_content_desc">'
+
forumList
[
i
].
content
+
'</div>'
+
'<div class="list_item_content_imgMore clearfix">'
+
imgStr
+
'</div>'
+
'<div class="list_item_tools clearfix">'
+
'<div class="tools clearfix seen">'
+
'<img src="images/post_seen_png@2x.png">'
+
'<span class="seenNum">'
+
forumList
[
i
].
viewCount
+
'</span>'
+
'</div>'
+
'<div class="tools clearfix reply">'
+
'<img src="images/post_reply_png@2x.png">'
+
'<span class="replyNum">'
+
forumList
[
i
].
commentCount
+
'</span>'
+
'</div>'
+
'<div class="tools clearfix like">'
+
'<img src="images/post_like_png@2x.png">'
+
'<span class="likeNum">'
+
forumList
[
i
].
upCount
+
'</span>'
+
'</div>'
+
'</div>'
+
'</div>'
+
'</div>'
;
}
else
{
str
+=
'<div class="list_item" data-id="'
+
forumList
[
i
].
id
+
'">'
+
'<div class="list_item_header clearfix">'
+
'<img src="'
+
forumList
[
i
].
profile
+
'" class="user_profile">'
+
'<div class="user_info">'
+
'<p class="user_name">'
+
forumList
[
i
].
nickname
+
'</p>'
+
'<p class="txt_gray post_card_time">'
+
forumList
[
i
].
updateTime
.
substring
(
5
,
16
)
+
'</p>'
+
'</div>'
+
'</div>'
+
'<div class="list_item_content">'
+
'<div class="list_item_content_desc">'
+
forumList
[
i
].
content
+
'</div>'
+
'</div>'
+
'<div class="list_item_tools clearfix">'
+
'<div class="tools clearfix seen">'
+
'<img src="images/post_seen_png@2x.png">'
+
'<span class="seenNum">'
+
forumList
[
i
].
viewCount
+
'</span>'
+
'</div>'
+
'<div class="tools clearfix reply">'
+
'<img src="images/post_reply_png@2x.png">'
+
'<span class="replyNum">'
+
forumList
[
i
].
commentCount
+
'</span>'
+
'</div>'
+
'<div class="tools clearfix like">'
+
'<img src="images/post_like_png@2x.png">'
+
'<span class="likeNum">'
+
forumList
[
i
].
upCount
+
'</span>'
+
'</div>'
+
'</div>'
+
'</div>'
;
}
}
}
if
(
index
.
offser
>
1
){
$
(
'.list_warp'
).
append
(
str
);
}
else
{
$
(
'.list_warp'
).
html
(
str
);
}
$
(
'.like'
).
on
(
'click'
,
function
(){
var
id
=
$
(
this
).
parents
(
'.list_item'
).
attr
(
'data-id'
);
var
num
=
$
(
this
).
children
(
'.likeNum'
).
html
();
var
status
=
index
.
publishUp
(
id
);
if
(
status
==
0
){
var
newNum
=
parseInt
(
num
)
-
1
;
$
(
this
).
children
(
'img'
).
attr
(
'src'
,
'images/post_unlike_png@2x.png'
);
$
(
this
).
children
(
'.likeNum'
).
html
(
newNum
);
}
else
if
(
status
==
1
){
var
newNum
=
parseInt
(
num
)
+
1
;
$
(
this
).
children
(
'img'
).
attr
(
'src'
,
'images/post_like_png@2x.png'
);
$
(
this
).
children
(
'.likeNum'
).
html
(
newNum
);
}
})
$
(
'.list_item'
).
on
(
'click'
,
function
(){
var
id
=
$
(
this
).
attr
(
'data-id'
);
medtap
.
pushWindow
(
'pages/cardDetail.html?cardId='
+
id
)
})
}
}
}
})
},
//点赞
publishUp
:
function
(
publishId
){
var
status
;
medtap
.
loading
(
1
);
medtap
.
submitAjax
({
url
:
'https://devgw.medtap.cn/operation/pubbbs/publish/up'
,
type
:
'POST'
,
async
:
false
,
contentType
:
'application/json'
,
data
:
{
publishId
:
publishId
},
success
:
function
(
res
){
medtap
.
loading
(
0
);
if
(
res
.
success
==
true
){
status
=
res
.
content
.
upStatus
;
}
}
})
return
status
;
},
//加入社区(便于后台统计人数)
joinPublish
:
function
(){
medtap
.
loading
(
1
);
medtap
.
submitAjax
({
url
:
'https://devgw.medtap.cn/operation/pubbbs/groupUser'
,
type
:
'POST'
,
async
:
false
,
contentType
:
'application/json'
,
data
:{
},
success
:
function
(
res
){
medtap
.
loading
(
0
);
}
}
}
}
)
}
)
}
}
}
}
index
.
init
();
index
.
init
();
index
.
bindEve
();
index
.
bindEve
();
})
})
\ No newline at end of file
medtap_bbs_lung/pages/cardDetail.html
View file @
8c6bf1e2
...
@@ -11,19 +11,34 @@
...
@@ -11,19 +11,34 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"../css/cardDetail.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"../css/cardDetail.css"
/>
<script
src=
"https://review-formal.iplusmed.com/Common/javaScript/calRem.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"https://review-formal.iplusmed.com/Common/javaScript/calRem.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<title>
详情
</title>
<title>
详情
</title>
<script
src=
"https://review-formal.iplusmed.com/Common/javaScript/require.min.js"
></script>
<script
type=
"text/javascript"
>
require
.
config
({
baseUrl
:
"./"
,
paths
:
{
"zepto"
:
"https://review-formal.iplusmed.com/Common/javaScript/zepto.min"
,
"medtap"
:
"https://review-formal.iplusmed.com/Common/javaScript/medtap_core_wx"
,
"md5"
:
"https://review-formal.iplusmed.com/Common/javaScript/md5.min"
},
shim
:
{
"zepto"
:
{
exports
:
"$"
}
}
});
</script>
</head>
</head>
<body>
<body>
<div
id=
"content"
>
<div
id=
"content"
>
<div
class=
"card_content"
>
<div
class=
"card_content"
>
<div
class=
"card_content_header clearfix"
>
<div
class=
"card_content_header clearfix"
>
<img
src=
"
../images/post_title_bg@2x.png
"
class=
"user_profile"
>
<img
src=
""
class=
"user_profile"
>
<div
class=
"user_info"
>
<div
class=
"user_info"
>
<p
class=
"user_name"
>
明天天晴
</p>
<p
class=
"user_name"
></p>
<p
class=
"txt_gray card_time"
>
07-08 11:12
</p>
<p
class=
"txt_gray card_time"
></p>
</div>
</div>
</div>
</div>
<div
class=
"cardDetail"
>
<div
class=
"cardDetail"
>
我老婆45岁肺腺癌,查出来就晚期了,目前胸口也一直隐隐作痛,不是很想做化疗。也不是很想做手术。想问问有啥好的中药可以吃啊,效果好的发给我。非常感谢大家的帮忙,我们现在很无助,不知该怎么办。
</div>
</div>
<div
class=
"cardImage clearfix"
>
<div
class=
"cardImage clearfix"
>
<img
src=
"../images/post_title_bg@2x.png"
>
<img
src=
"../images/post_title_bg@2x.png"
>
...
@@ -34,11 +49,11 @@
...
@@ -34,11 +49,11 @@
<div
class=
"card_tools clearfix"
>
<div
class=
"card_tools clearfix"
>
<div
class=
"tools clearfix seen"
>
<div
class=
"tools clearfix seen"
>
<img
src=
"../images/post_seen_png@2x.png"
>
<img
src=
"../images/post_seen_png@2x.png"
>
<span
class=
"seenNum txt_gray"
>
246
</span>
<span
class=
"seenNum txt_gray"
></span>
</div>
</div>
<div
class=
"tools clearfix reply"
>
<div
class=
"tools clearfix reply"
>
<img
src=
"../images/post_reply_png@2x.png"
>
<img
src=
"../images/post_reply_png@2x.png"
>
<span
class=
"replyNum txt_gray"
>
12
</span>
<span
class=
"replyNum txt_gray"
></span>
</div>
</div>
</div>
</div>
<div
class=
"fabulous clearfix"
>
<div
class=
"fabulous clearfix"
>
...
@@ -119,4 +134,7 @@
...
@@ -119,4 +134,7 @@
</div>
</div>
</div>
</div>
</body>
</body>
<script
type=
"text/javascript"
>
require
([
'../javaScript/cardDetail.js'
])
</script>
</html>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment