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
5fe1a36d
Commit
5fe1a36d
authored
Oct 31, 2019
by
zujiaozhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'分享贴子统一弹窗与发帖优化'
parent
8ac3ba75
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
122 deletions
+84
-122
cardDetail.js
medtap_bbs_lung/javaScript/cardDetail.js
+35
-34
cardDetailForShare.js
medtap_bbs_lung/javaScript/cardDetailForShare.js
+17
-44
newCard.js
medtap_bbs_lung/javaScript/newCard.js
+16
-0
cardDetailForShare.html
medtap_bbs_lung/pages/cardDetailForShare.html
+15
-43
newCard.html
medtap_bbs_lung/pages/newCard.html
+1
-1
No files found.
medtap_bbs_lung/javaScript/cardDetail.js
View file @
5fe1a36d
...
...
@@ -137,45 +137,46 @@ define(['zepto', 'medtap'], function($, medtap) {
'onMenuShareAppMessage'
]
})
wx
.
ready
(
function
()
{
//分享给朋友
wx
.
onMenuShareAppMessage
({
title
:
'肺癌靶向家园社区'
,
desc
:
'...'
,
// 分享描述
link
:
'https://testdevgw.medtap.cn/wechat/lung/oauth_stepEnd?type=BBS_LUNG_SHARE&cardId='
+
card
.
cardId
+
'&agencyId='
+
card
.
shareId
,
// link: window.location.href,
imgUrl
:
'https://review-formal.iplusmed.com/Common/images/bbs_logo_icon/logo_feiai_new.jpg'
,
// 分享图标
type
:
'link'
,
// 分享类型,music、video或link,不填默认为link
dataUrl
:
''
,
// 如果type是music或video,则要提供数据链接,默认为空
success
:
function
()
{
},
cancel
:
function
()
{
}
});
//分享到朋友圈
wx
.
onMenuShareTimeline
({
title
:
'肺癌靶向家园社区'
,
// 分享标题
link
:
'https://testdevgw.medtap.cn/wechat/lung/oauth_stepEnd?type=BBS_LUNG_SHARE&cardId='
+
card
.
cardId
+
'&agencyId='
+
card
.
shareId
,
// link: window.location.href,
imgUrl
:
'https://review-formal.iplusmed.com/Common/images/bbs_logo_icon/logo_feiai_new.jpg'
,
// 分享图标
success
:
function
()
{
},
cancel
:
function
()
{
}
});
});
card
.
share
();
}
})
},
share
:
function
()
{
// var desc = $('.cardDetail').text().substring(0,25
)
var
desc
=
$
(
'.cardDetail'
).
text
().
substring
(
0
,
20
)
//微信分享
wx
.
ready
(
function
()
{
//分享给朋友
wx
.
onMenuShareAppMessage
({
title
:
'肺癌靶向家园'
,
desc
:
desc
+
'...'
,
// 分享描述
link
:
'https://testdevgw.medtap.cn/wechat/lung/oauth_stepEnd?type=BBS_LUNG_SHARE&cardId='
+
card
.
cardId
+
'&agencyId='
+
card
.
shareId
,
// link: window.location.href,
imgUrl
:
'https://review-formal.iplusmed.com/Common/images/bbs_logo_icon/logo_feiai_new.jpg'
,
// 分享图标
type
:
'link'
,
// 分享类型,music、video或link,不填默认为link
dataUrl
:
''
,
// 如果type是music或video,则要提供数据链接,默认为空
success
:
function
()
{
},
cancel
:
function
()
{
}
});
//分享到朋友圈
wx
.
onMenuShareTimeline
({
title
:
'肺癌靶向家园'
,
// 分享标题
link
:
'https://testdevgw.medtap.cn/wechat/lung/oauth_stepEnd?type=BBS_LUNG_SHARE&cardId='
+
card
.
cardId
+
'&agencyId='
+
card
.
shareId
,
// link: window.location.href,
imgUrl
:
'https://review-formal.iplusmed.com/Common/images/bbs_logo_icon/logo_feiai_new.jpg'
,
// 分享图标
success
:
function
()
{
},
cancel
:
function
()
{
}
});
});
},
previewImage
:
function
()
{
$
(
'.cardImage'
).
on
(
'click'
,
'img'
,
function
()
{
...
...
medtap_bbs_lung/javaScript/cardDetailForShare.js
View file @
5fe1a36d
define
([
'zepto'
,
'medtap'
,
'../javaScript/beforeSubmitForLung.js'
,
'mui'
],
function
(
$
,
medtap
,
beforeSubmit
,
mui
)
{
define
([
'zepto'
,
'medtap'
,
'../javaScript/beforeSubmitForLung.js'
],
function
(
$
,
medtap
,
beforeSubmit
)
{
var
card
=
{
wechatId
:
medtap
.
getRequest
(
'wechatId'
)
||
''
,
cardId
:
medtap
.
getRequest
(
'cardId'
)
||
''
,
...
...
@@ -10,9 +10,6 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
agencyId
:
medtap
.
getRequest
(
'agencyId'
)
||
''
,
shareId
:
''
,
userId
:
''
,
mask
:
mui
.
createMask
(
function
(){
$
(
'.mask'
).
hide
()
}),
//callback为用户点击蒙版时自动执行的回调;
init
:
function
()
{
card
.
checkUser
();
card
.
getToken
();
...
...
@@ -56,9 +53,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
card
.
replyPublish
();
})
}
else
{
card
.
mask
.
show
()
$
(
'.mask'
).
show
()
// window.location.href='https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html'
$
(
'#showDialog'
).
show
()
}
});
...
...
@@ -119,26 +114,19 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
console
.
log
(
res
.
content
.
wechatUser
)
var
info
=
res
.
content
.
wechatUser
if
(
info
.
hasOwnProperty
(
'userId'
)){
//
card.userId = info.userId
card
.
userId
=
info
.
userId
}
// }else{
// window.location.replace('https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html?wechatId=' + card.wechatId)
// }
}
})
},
bindEve
:
function
()
{
$
(
'.mask_text_gologin'
).
on
(
'click'
,
function
(){
card
.
mask
.
close
();
$
(
'.mask'
).
hide
()
window
.
location
.
href
=
'https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html?wechatId='
+
card
.
wechatId
})
$
(
'.mask_text_cancle'
).
on
(
'click'
,
function
(){
$
(
'.mask'
).
hide
();
card
.
mask
.
close
();
$
(
'.dialog-btn-cancel'
).
on
(
'click'
,
function
(){
$
(
'#showDialog'
).
hide
()
})
$
(
'.dialog-btn-confirm'
).
on
(
'click'
,
function
(){
$
(
'#showDialog'
).
hide
()
window
.
location
.
href
=
'https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html?wechatId='
+
card
.
wechatId
})
//为TA加油
$
(
'.fabulous'
).
on
(
'click'
,
function
()
{
if
(
card
.
userId
){
...
...
@@ -151,10 +139,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
$
(
'.unFabulous'
).
children
(
'.fabulous_desc'
).
html
(
newNum
);
}
}
else
{
card
.
mask
.
show
()
$
(
'.mask'
).
show
()
// window.location.href='https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html'
$
(
'#showDialog'
).
show
()
}
});
//取消点赞
...
...
@@ -167,9 +152,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
$
(
'.fabulous'
).
children
(
'.fabulous_desc'
).
html
(
'为TA加油'
);
}
}
else
{
card
.
mask
.
show
()
$
(
'.mask'
).
show
()
// window.location.href='https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html'
$
(
'#showDialog'
).
show
()
}
});
//收藏
...
...
@@ -189,9 +172,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
},
1000
)
}
}
else
{
card
.
mask
.
show
()
$
(
'.mask'
).
show
()
// window.location.href='https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html'
$
(
'#showDialog'
).
show
()
}
})
...
...
@@ -223,7 +204,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
})
},
share
:
function
()
{
var
desc
=
$
(
'.cardDetail'
).
text
().
substring
(
0
,
2
5
)
var
desc
=
$
(
'.cardDetail'
).
text
().
substring
(
0
,
2
0
)
//微信分享
wx
.
ready
(
function
()
{
//分享给朋友
...
...
@@ -236,14 +217,10 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
type
:
'link'
,
// 分享类型,music、video或link,不填默认为link
dataUrl
:
''
,
// 如果type是music或video,则要提供数据链接,默认为空
success
:
function
()
{
if
(
!
(
/iphone|ipad/gi
).
test
(
navigator
.
userAgent
))
{
medtap
.
winPop
(
'分享成功'
);
}
},
cancel
:
function
()
{
if
(
!
(
/iphone|ipad/gi
).
test
(
navigator
.
userAgent
))
{
medtap
.
winPop
(
'取消分享'
);
}
}
});
//分享到朋友圈
...
...
@@ -253,14 +230,10 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
'&agencyId='
+
card
.
shareId
,
imgUrl
:
'https://review-formal.iplusmed.com/Common/images/bbs_logo_icon/logo_feiai_new.jpg'
,
// 分享图标
success
:
function
()
{
if
(
!
(
/iphone|ipad/gi
).
test
(
navigator
.
userAgent
))
{
medtap
.
winPop
(
'分享成功'
);
}
},
cancel
:
function
()
{
if
(
!
(
/iphone|ipad/gi
).
test
(
navigator
.
userAgent
))
{
medtap
.
winPop
(
'取消分享'
);
}
}
});
});
...
...
medtap_bbs_lung/javaScript/newCard.js
View file @
5fe1a36d
...
...
@@ -147,6 +147,14 @@ define(['zepto', 'medtap'], function($, medtap) {
})
},
postPubbbs
:
function
()
{
var
strLength
=
$
.
trim
(
$
(
'.card_content'
).
val
())
if
(
strLength
.
length
<
20
){
medtap
.
toast
({
message
:
'字数不能少于20字'
,
time
:
2000
})
return
}
var
urls
=
[],
picUrl
=
""
;
[].
forEach
.
call
(
$
(
'#ImgUp .image_files_img'
),
function
(
item
)
{
...
...
@@ -187,6 +195,14 @@ define(['zepto', 'medtap'], function($, medtap) {
})
},
updatePubbs
:
function
(
id
){
var
strLength
=
$
.
trim
(
$
(
'.card_content'
).
val
())
if
(
strLength
.
length
<
20
){
medtap
.
toast
({
message
:
'字数不能少于20字'
,
time
:
2000
})
return
}
var
urls
=
[],
picUrl
=
""
;
[].
forEach
.
call
(
$
(
'#ImgUp .image_files_img'
),
function
(
item
)
{
...
...
medtap_bbs_lung/pages/cardDetailForShare.html
View file @
5fe1a36d
...
...
@@ -9,7 +9,6 @@
<meta
content=
"email=no"
name=
"format-detection"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://review-formal.iplusmed.com/Common/css/wechat_Reset.min.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"../css/cardDetail.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://review-formal.iplusmed.com/Common/css/mui.min.css"
>
<script
src=
"https://review-formal.iplusmed.com/Common/javaScript/calRem.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"https://res.wx.qq.com/open/js/jweixin-1.2.0.js"
></script>
<title>
详情
</title>
...
...
@@ -20,7 +19,6 @@
paths
:
{
"zepto"
:
"https://review-formal.iplusmed.com/Common/javaScript/zepto.min"
,
"medtap"
:
"https://review-formal.iplusmed.com/Common/javaScript/medtap_core_wx"
,
"mui"
:
"https://review-formal.iplusmed.com/Common/javaScript/mui.min"
,
"md5"
:
"https://review-formal.iplusmed.com/Common/javaScript/md5.min"
},
shim
:
{
...
...
@@ -31,41 +29,6 @@
});
</script>
<style
type=
"text/css"
>
.mask
{
display
:
none
;
position
:
fixed
;
margin
:
0
auto
;
top
:
50%
;
left
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
height
:
1.8rem
;
width
:
2.8rem
;
background-color
:
#fff
;
z-index
:
999
;
text-align
:
center
;
border-radius
:
0.1rem
;
}
.mask_title
{
margin-top
:
0.1rem
;
padding
:
.2rem
;
font-size
:
.3rem
;
font-size
:
.28rem
;
}
.mask_text
{
margin-top
:
.2rem
;
width
:
100%
;
display
:
flex
;
justify-content
:
space-around
;
}
.mask_text_gologin
{
padding
:
.15rem
;
color
:
#2CBCA0
;
font-size
:
.2rem
;
}
.mask_text_cancle
{
padding
:
.15rem
;
font-size
:
.2rem
;
}
.top_header
{
width
:
100%
;
height
:
0.8rem
;
...
...
@@ -94,6 +57,9 @@
margin-top
:
0.16rem
;
margin-right
:
0.32rem
;
}
#showDialog
{
display
:
none
;
}
</style>
</head>
<body>
...
...
@@ -174,13 +140,19 @@
</div>
</div>
<!-- mask -->
<div
class=
"mask"
>
<p
class=
"mask_title"
>
注册登录
</p>
<div
class=
"mask_text"
>
<span
class=
"mask_text_gologin"
>
去登录
</span>
<span
class=
"mask_text_cancle"
>
取消
</span>
<div
class=
"dialog dialog-open dialog-modal"
data-style=
"ios"
id=
"showDialog"
>
<div
class=
"dialog-overlay"
></div>
<div
class=
"dialog-content"
>
<div
class=
"dialog-content-hd"
>
<h3
class=
"dialog-content-title"
>
提示
</h3>
</div>
<div
class=
"dialog-content-bd content-scroll"
style=
"max-height: 508px;"
>
请您先去登录
</div>
<div
class=
"dialog-content-ft side"
>
<button
class=
"dialog-btn dialog-btn-cancel "
>
取消
</button>
<button
class=
"dialog-btn dialog-btn-confirm "
>
去登录
</button>
</div>
</div>
</div>
</div>
</body>
<script
type=
"text/javascript"
>
require
([
'../javaScript/cardDetailForShare.js'
])
...
...
medtap_bbs_lung/pages/newCard.html
View file @
5fe1a36d
...
...
@@ -32,7 +32,7 @@
<body>
<div
id=
"content"
>
<div
class=
"card_info"
>
<textarea
rows=
""
cols=
""
placeholder=
"请输入内容"
class=
"card_content"
maxlength=
"300"
id=
"area"
></textarea>
<textarea
rows=
""
cols=
""
placeholder=
"请输入内容
(不少20字)
"
class=
"card_content"
maxlength=
"300"
id=
"area"
></textarea>
<p
class=
'real_time_StrNum'
><span
id=
"text-count"
>
0
</span>
/300
</p>
</div>
<div
class=
"image_info clearfix"
>
...
...
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