Commit 5fe1a36d by zujiaozhang

'分享贴子统一弹窗与发帖优化'

parent 8ac3ba75
...@@ -137,11 +137,18 @@ define(['zepto', 'medtap'], function($, medtap) { ...@@ -137,11 +137,18 @@ define(['zepto', 'medtap'], function($, medtap) {
'onMenuShareAppMessage' 'onMenuShareAppMessage'
] ]
}) })
card.share();
}
})
},
share: function() {
var desc = $('.cardDetail').text().substring(0,20)
//微信分享
wx.ready(function() { wx.ready(function() {
//分享给朋友 //分享给朋友
wx.onMenuShareAppMessage({ wx.onMenuShareAppMessage({
title: '肺癌靶向家园社区', title: '肺癌靶向家园',
desc: '...', // 分享描述 desc: desc+'...', // 分享描述
link: 'https://testdevgw.medtap.cn/wechat/lung/oauth_stepEnd?type=BBS_LUNG_SHARE&cardId=' + card.cardId + link: 'https://testdevgw.medtap.cn/wechat/lung/oauth_stepEnd?type=BBS_LUNG_SHARE&cardId=' + card.cardId +
'&agencyId=' + card.shareId, '&agencyId=' + card.shareId,
// link: window.location.href, // link: window.location.href,
...@@ -157,7 +164,7 @@ define(['zepto', 'medtap'], function($, medtap) { ...@@ -157,7 +164,7 @@ define(['zepto', 'medtap'], function($, medtap) {
}); });
//分享到朋友圈 //分享到朋友圈
wx.onMenuShareTimeline({ wx.onMenuShareTimeline({
title: '肺癌靶向家园社区', // 分享标题 title: '肺癌靶向家园', // 分享标题
link: 'https://testdevgw.medtap.cn/wechat/lung/oauth_stepEnd?type=BBS_LUNG_SHARE&cardId=' + card.cardId + link: 'https://testdevgw.medtap.cn/wechat/lung/oauth_stepEnd?type=BBS_LUNG_SHARE&cardId=' + card.cardId +
'&agencyId=' + card.shareId, '&agencyId=' + card.shareId,
// link: window.location.href, // link: window.location.href,
...@@ -170,12 +177,6 @@ define(['zepto', 'medtap'], function($, medtap) { ...@@ -170,12 +177,6 @@ define(['zepto', 'medtap'], function($, medtap) {
} }
}); });
}); });
}
})
},
share: function() {
// var desc = $('.cardDetail').text().substring(0,25)
//微信分享
}, },
previewImage: function() { previewImage: function() {
$('.cardImage').on('click', 'img', function() { $('.cardImage').on('click', 'img', function() {
......
define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], function($, medtap,beforeSubmit,mui) { define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js'], function($, medtap,beforeSubmit) {
var card = { var card = {
wechatId: medtap.getRequest('wechatId') || '', wechatId: medtap.getRequest('wechatId') || '',
cardId: medtap.getRequest('cardId') || '', cardId: medtap.getRequest('cardId') || '',
...@@ -10,9 +10,6 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio ...@@ -10,9 +10,6 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
agencyId:medtap.getRequest('agencyId') || '', agencyId:medtap.getRequest('agencyId') || '',
shareId:'', shareId:'',
userId:'', userId:'',
mask : mui.createMask(function(){
$('.mask').hide()
}),//callback为用户点击蒙版时自动执行的回调;
init: function() { init: function() {
card.checkUser(); card.checkUser();
card.getToken(); card.getToken();
...@@ -56,9 +53,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio ...@@ -56,9 +53,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
card.replyPublish(); card.replyPublish();
}) })
}else { }else {
card.mask.show() $('#showDialog').show()
$('.mask').show()
// window.location.href='https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html'
} }
}); });
...@@ -119,26 +114,19 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio ...@@ -119,26 +114,19 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
console.log(res.content.wechatUser) console.log(res.content.wechatUser)
var info = res.content.wechatUser var info = res.content.wechatUser
if(info.hasOwnProperty('userId')){ 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() { bindEve: function() {
$('.dialog-btn-cancel').on('click',function(){
$('.mask_text_gologin').on('click',function(){ $('#showDialog').hide()
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(){ $('.dialog-btn-confirm').on('click',function(){
$('.mask').hide(); $('#showDialog').hide()
card.mask.close(); window.location.href='https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html?wechatId=' + card.wechatId
}) })
//为TA加油 //为TA加油
$('.fabulous').on('click', function() { $('.fabulous').on('click', function() {
if(card.userId){ if(card.userId){
...@@ -151,10 +139,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio ...@@ -151,10 +139,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
$('.unFabulous').children('.fabulous_desc').html(newNum); $('.unFabulous').children('.fabulous_desc').html(newNum);
} }
}else{ }else{
card.mask.show() $('#showDialog').show()
$('.mask').show()
// window.location.href='https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html'
} }
}); });
//取消点赞 //取消点赞
...@@ -167,9 +152,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio ...@@ -167,9 +152,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
$('.fabulous').children('.fabulous_desc').html('为TA加油'); $('.fabulous').children('.fabulous_desc').html('为TA加油');
} }
}else { }else {
card.mask.show() $('#showDialog').show()
$('.mask').show()
// window.location.href='https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html'
} }
}); });
//收藏 //收藏
...@@ -189,9 +172,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio ...@@ -189,9 +172,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
}, 1000) }, 1000)
} }
}else { }else {
card.mask.show() $('#showDialog').show()
$('.mask').show()
// window.location.href='https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html'
} }
}) })
...@@ -223,7 +204,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio ...@@ -223,7 +204,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
}) })
}, },
share: function() { share: function() {
var desc = $('.cardDetail').text().substring(0,25) var desc = $('.cardDetail').text().substring(0,20)
//微信分享 //微信分享
wx.ready(function() { wx.ready(function() {
//分享给朋友 //分享给朋友
...@@ -236,14 +217,10 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio ...@@ -236,14 +217,10 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
type: 'link', // 分享类型,music、video或link,不填默认为link type: 'link', // 分享类型,music、video或link,不填默认为link
dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空 dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
success: function() { success: function() {
if(!(/iphone|ipad/gi).test(navigator.userAgent)) {
medtap.winPop('分享成功');
}
}, },
cancel: function() { cancel: function() {
if(!(/iphone|ipad/gi).test(navigator.userAgent)) {
medtap.winPop('取消分享');
}
} }
}); });
//分享到朋友圈 //分享到朋友圈
...@@ -253,14 +230,10 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio ...@@ -253,14 +230,10 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js','mui'], functio
'&agencyId=' + card.shareId, '&agencyId=' + card.shareId,
imgUrl: 'https://review-formal.iplusmed.com/Common/images/bbs_logo_icon/logo_feiai_new.jpg', // 分享图标 imgUrl: 'https://review-formal.iplusmed.com/Common/images/bbs_logo_icon/logo_feiai_new.jpg', // 分享图标
success: function() { success: function() {
if(!(/iphone|ipad/gi).test(navigator.userAgent)) {
medtap.winPop('分享成功');
}
}, },
cancel: function() { cancel: function() {
if(!(/iphone|ipad/gi).test(navigator.userAgent)) {
medtap.winPop('取消分享');
}
} }
}); });
}); });
......
...@@ -147,6 +147,14 @@ define(['zepto', 'medtap'], function($, medtap) { ...@@ -147,6 +147,14 @@ define(['zepto', 'medtap'], function($, medtap) {
}) })
}, },
postPubbbs: function() { postPubbbs: function() {
var strLength = $.trim($('.card_content').val())
if(strLength.length<20){
medtap.toast({
message: '字数不能少于20字',
time: 2000
})
return
}
var urls = [], var urls = [],
picUrl = ""; picUrl = "";
[].forEach.call($('#ImgUp .image_files_img'), function(item) { [].forEach.call($('#ImgUp .image_files_img'), function(item) {
...@@ -187,6 +195,14 @@ define(['zepto', 'medtap'], function($, medtap) { ...@@ -187,6 +195,14 @@ define(['zepto', 'medtap'], function($, medtap) {
}) })
}, },
updatePubbs:function(id){ updatePubbs:function(id){
var strLength = $.trim($('.card_content').val())
if(strLength.length<20){
medtap.toast({
message: '字数不能少于20字',
time: 2000
})
return
}
var urls = [], var urls = [],
picUrl = ""; picUrl = "";
[].forEach.call($('#ImgUp .image_files_img'), function(item) { [].forEach.call($('#ImgUp .image_files_img'), function(item) {
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
<meta content="email=no" name="format-detection"> <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="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="../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://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> <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<title>详情</title> <title>详情</title>
...@@ -20,7 +19,6 @@ ...@@ -20,7 +19,6 @@
paths: { paths: {
"zepto": "https://review-formal.iplusmed.com/Common/javaScript/zepto.min", "zepto": "https://review-formal.iplusmed.com/Common/javaScript/zepto.min",
"medtap": "https://review-formal.iplusmed.com/Common/javaScript/medtap_core_wx", "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" "md5": "https://review-formal.iplusmed.com/Common/javaScript/md5.min"
}, },
shim: { shim: {
...@@ -31,41 +29,6 @@ ...@@ -31,41 +29,6 @@
}); });
</script> </script>
<style type="text/css"> <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{ .top_header{
width:100%; width:100%;
height:0.8rem; height:0.8rem;
...@@ -94,6 +57,9 @@ ...@@ -94,6 +57,9 @@
margin-top:0.16rem; margin-top:0.16rem;
margin-right:0.32rem; margin-right:0.32rem;
} }
#showDialog{
display: none;
}
</style> </style>
</head> </head>
<body> <body>
...@@ -174,11 +140,17 @@ ...@@ -174,11 +140,17 @@
</div> </div>
</div> </div>
<!-- mask --> <!-- mask -->
<div class="mask"> <div class="dialog dialog-open dialog-modal" data-style="ios" id="showDialog">
<p class="mask_title">注册登录</p> <div class="dialog-overlay"></div>
<div class="mask_text"> <div class="dialog-content">
<span class="mask_text_gologin">去登录</span> <div class="dialog-content-hd">
<span class="mask_text_cancle">取消</span> <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> </div>
</body> </body>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<body> <body>
<div id="content"> <div id="content">
<div class="card_info"> <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> <p class='real_time_StrNum'><span id="text-count">0</span>/300</p>
</div> </div>
<div class="image_info clearfix"> <div class="image_info clearfix">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment