Commit 7e0147dc by hanpeng

论坛,正式环境

parent 1d7bc9f6
{
"liveServer.settings.port": 5501
}
\ No newline at end of file
...@@ -13,13 +13,14 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js'], function($, m ...@@ -13,13 +13,14 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js'], function($, m
// 贴子审核状态 // 贴子审核状态
status: '0', status: '0',
init: function() { init: function() {
card.getToken(); card.getToken();
card.checkUser(); card.checkUser();
card.getCardDetail(); card.getCardDetail();
if(card.status!=1){ /* if(card.status!=1){
window.location.replace('../pages/refuseTips.html') window.location.replace('../pages/refuseTips.html')
return return
} } */
card.getCommentList(); card.getCommentList();
card.bindEve(); card.bindEve();
card.getWechatTicket(); card.getWechatTicket();
...@@ -73,16 +74,16 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js'], function($, m ...@@ -73,16 +74,16 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js'], function($, m
// 点击加入社区 // 点击加入社区
$('.join_now').on('click',function(){ $('.join_now').on('click',function(){
if(card.userId){ if(card.userId){
medtap.pushWindow('https://review-formal.iplusmed.com/wechatForLungCancer/prd/medtap_bbs_lung/index.html?wechatId=' + card.wechatId) medtap.pushWindow('https://review-formal.iplusmed.com/wechatForLungCancer/dev/medtap_bbs_lung/index.html?wechatId=' + card.wechatId)
}else{ }else{
medtap.pushWindow('https://review-formal.iplusmed.com/wechatForLungCancer/prd/wechat_lung_login/login.html?wechatId=' + card.wechatId +'&toBBS=1') medtap.pushWindow('https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html?wechatId=' + card.wechatId +'&toBBS=1')
} }
}) })
$('.top_tip_blue').on('click',function(){ $('.top_tip_blue').on('click',function(){
if(card.userId){ if(card.userId){
medtap.pushWindow('https://review-formal.iplusmed.com/wechatForLungCancer/prd/medtap_bbs_lung/index.html?wechatId=' + card.wechatId) medtap.pushWindow('https://review-formal.iplusmed.com/wechatForLungCancer/dev/medtap_bbs_lung/index.html?wechatId=' + card.wechatId)
}else{ }else{
medtap.pushWindow('https://review-formal.iplusmed.com/wechatForLungCancer/prd/wechat_lung_login/login.html?wechatId=' + card.wechatId +'&toBBS=1') medtap.pushWindow('https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html?wechatId=' + card.wechatId +'&toBBS=1')
} }
}) })
}, },
...@@ -139,7 +140,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js'], function($, m ...@@ -139,7 +140,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js'], function($, m
}) })
$('.dialog-btn-confirm').on('click',function(){ $('.dialog-btn-confirm').on('click',function(){
$('#showDialog').hide() $('#showDialog').hide()
window.location.href='https://review-formal.iplusmed.com/wechatForLungCancer/prd/wechat_lung_login/login.html?wechatId=' + card.wechatId +'&cardId='+ card.cardId window.location.href='https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html?wechatId=' + card.wechatId +'&cardId='+ card.cardId
}) })
//为TA加油 //为TA加油
$('.fabulous').on('click', function() { $('.fabulous').on('click', function() {
...@@ -485,7 +486,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js'], function($, m ...@@ -485,7 +486,7 @@ define(['zepto', 'medtap','../javaScript/beforeSubmitForLung.js'], function($, m
var id = $(this).attr('data-id'); var id = $(this).attr('data-id');
medtap.pushWindow('replyDetail.html?commentId=' + id); medtap.pushWindow('replyDetail.html?commentId=' + id);
} else { } else {
window.location.href='https://review-formal.iplusmed.com/wechatForLungCancer/prd/wechat_lung_login/login.html' window.location.href='https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_login/login.html'
} }
}) })
} }
......
...@@ -7,7 +7,11 @@ define(['zepto', 'medtap'], function($, medtap) { ...@@ -7,7 +7,11 @@ define(['zepto', 'medtap'], function($, medtap) {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
init: function() { init: function() {
myCard.getUserInfo(); if(!medtap.getRequest('wechatId')){
myCard.getUserInfo();
}else{
myCard.getToken();
}
myCard.getMyCard(); myCard.getMyCard();
// myCard.getMyReply(); // myCard.getMyReply();
myCard.bindEve(); myCard.bindEve();
...@@ -896,6 +900,32 @@ define(['zepto', 'medtap'], function($, medtap) { ...@@ -896,6 +900,32 @@ define(['zepto', 'medtap'], function($, medtap) {
$('.publish_user_profile').attr('src',userInfo.profile); $('.publish_user_profile').attr('src',userInfo.profile);
} }
}) })
},
getToken:function(){
localStorage.wxLungToken = '';
medtap.loading(1);
medtap.submitAjax({
url: 'https://gateway.medtap.cn/user/auth/token',
type: 'POST',
async: false,
contentType: 'application/json',
data: {
wechatId: medtap.getRequest('wechatId')
},
success: function(res) {
medtap.loading(0);
if (res.success == true) {
var token = res.content.token;
localStorage.setItem('wxLungToken', token);
myCard.getUserInfo();
} else {
}
},
error: function(res) {
console.log(res.resultDesc);
}
})
} }
} }
myCard.init(); myCard.init();
......
define(['zepto', 'medtap'], function($, medtap) { define(['zepto', 'medtap'], function($, medtap) {
var newCard = { var newCard = {
cardId:medtap.getRequest('id'), cardId: medtap.getRequest('id'),
localIds: [], localIds: [],
serverId: "", serverId: "",
imgList: [], imgList: [],
init: function() { init: function() {
newCard.getWechatTicket(); newCard.getWechatTicket();
newCard.bindEve(); newCard.bindEve();
if(!newCard.cardId){ if (!newCard.cardId) {
}else{ } else {
newCard.getEditById(); newCard.getEditById();
} }
}, },
bindEve: function() { bindEve: function() {
/* 新加文本输入框字数限制与动态字数 */ /* 新加文本输入框字数限制与动态字数 */
$("#area").on("input propertychange", function() { $("#area").on("input propertychange", function() {
var $this = $(this), var $this = $(this),
_val = $this.val(), _val = $this.val(),
count = ""; count = "";
if (_val.length > 300) { if (_val.length > 300) {
$this.val(_val.substring(0, 300)); $this.val(_val.substring(0, 300));
} }
count = $this.val().length; count = $this.val().length;
$("#text-count").text(count); $("#text-count").text(count);
}); });
$('.footer_btn').on('click', function() { $('.footer_btn').on('click', function() {
if(!newCard.cardId){ if (!newCard.cardId) {
newCard.postPubbbs(); newCard.postPubbbs();
}else{ } else {
newCard.updatePubbs(newCard.cardId); newCard.updatePubbs(newCard.cardId);
} }
}) })
...@@ -126,16 +126,16 @@ define(['zepto', 'medtap'], function($, medtap) { ...@@ -126,16 +126,16 @@ define(['zepto', 'medtap'], function($, medtap) {
mediaId: serverId, mediaId: serverId,
ext: 'jpg' ext: 'jpg'
}, },
headers:{ headers: {
'apptype':'wechat_lung', 'apptype': 'wechat_lung',
'user-os':'wechat' 'user-os': 'wechat'
}, },
success: function(data) { success: function(data) {
if (data.success == true) { if (data.success == true) {
var res = data.content; var res = data.content;
var imgKey = res.ossKey; var imgKey = res.ossKey;
newCard.imgList.push(imgKey); newCard.imgList.push(imgKey);
console.log('上传后图片的imgKey',imgKey) console.log('上传后图片的imgKey', imgKey)
var html = '<div class="image_files_item">' + var html = '<div class="image_files_item">' +
'<img src="' + localId + '" class="image_files_img" imgkey="' + imgKey + '">' + '<img src="' + localId + '" class="image_files_img" imgkey="' + imgKey + '">' +
'<img src="../images/post_delete_btn@2x.png" class="image_del" >' + '<img src="../images/post_delete_btn@2x.png" class="image_del" >' +
...@@ -147,8 +147,8 @@ define(['zepto', 'medtap'], function($, medtap) { ...@@ -147,8 +147,8 @@ define(['zepto', 'medtap'], function($, medtap) {
}) })
}, },
postPubbbs: function() { postPubbbs: function() {
var strLength = $.trim($('.card_content').val()) var strLength = $.trim($('.card_content').val())
if(strLength.length<20){ if (strLength.length < 20) {
medtap.toast({ medtap.toast({
message: '字数不能少于20字', message: '字数不能少于20字',
time: 2000 time: 2000
...@@ -169,7 +169,7 @@ define(['zepto', 'medtap'], function($, medtap) { ...@@ -169,7 +169,7 @@ define(['zepto', 'medtap'], function($, medtap) {
asynv: false, asynv: false,
contentType: 'application/json', contentType: 'application/json',
data: { data: {
groupId:parseInt(medtap.getRequest('groupId')), groupId: parseInt(medtap.getRequest('groupId')),
content: $('.card_content').val(), content: $('.card_content').val(),
picUrls: picUrl picUrls: picUrl
}, },
...@@ -181,22 +181,29 @@ define(['zepto', 'medtap'], function($, medtap) { ...@@ -181,22 +181,29 @@ define(['zepto', 'medtap'], function($, medtap) {
message: '发布成功!请等待审核', message: '发布成功!请等待审核',
time: 2000 time: 2000
}) })
setTimeout(function(){ setTimeout(function() {
//medtap.pushWindow('myCardList.html'); //medtap.pushWindow('myCardList.html');
if(!newCard.cardId){ if (!newCard.cardId) {
medtap.pushWindow('myCardList.html'); medtap.pushWindow('myCardList.html');
}else{ } else {
window.history.go(-1) window.history.go(-1)
} }
},1000) }, 1000)
}, 1000) }, 1000)
}else if(res.success == false){
if(res.resultCode == 202161){
medtap.toast({
message: '抱歉,您暂无发帖权限!',
time: 2000
})
}
} }
} }
}) })
}, },
updatePubbs:function(id){ updatePubbs: function(id) {
var strLength = $.trim($('.card_content').val()) var strLength = $.trim($('.card_content').val())
if(strLength.length<20){ if (strLength.length < 20) {
medtap.toast({ medtap.toast({
message: '字数不能少于20字', message: '字数不能少于20字',
time: 2000 time: 2000
...@@ -217,7 +224,7 @@ define(['zepto', 'medtap'], function($, medtap) { ...@@ -217,7 +224,7 @@ define(['zepto', 'medtap'], function($, medtap) {
asynv: false, asynv: false,
contentType: 'application/json', contentType: 'application/json',
data: { data: {
id:parseInt(id), id: parseInt(id),
content: $('.card_content').val(), content: $('.card_content').val(),
picUrls: picUrl picUrls: picUrl
}, },
...@@ -230,36 +237,37 @@ define(['zepto', 'medtap'], function($, medtap) { ...@@ -230,36 +237,37 @@ define(['zepto', 'medtap'], function($, medtap) {
message: '发布成功!请等待审核', message: '发布成功!请等待审核',
time: 2000 time: 2000
}) })
setTimeout(function(){ setTimeout(function() {
// medtap.pushWindow('myCardList.html'); // medtap.pushWindow('myCardList.html');
// window.history.go(-1) // window.history.go(-1)
window.location.replace('myCardList.html') window.location.replace('myCardList.html')
},1000) }, 1000)
}, 1000) }, 1000)
} }
} }
}) })
}, },
getEditById:function(){ getEditById: function() {
medtap.loading(1); medtap.loading(1);
medtap.submitAjax({ medtap.submitAjax({
url:'https://gateway.medtap.cn/operation/pubbbs/publish/' + newCard.cardId, url: 'https://gateway.medtap.cn/operation/pubbbs/publish/' + newCard.cardId,
type:'GET', type: 'GET',
async: false, async: false,
data:{ data: {
}, },
success:function(res){ success: function(res) {
medtap.loading(0); medtap.loading(0);
if(res.success == true){ if (res.success == true) {
var detailInfo = res.content.publish; var detailInfo = res.content.publish;
$('.card_content').val(detailInfo.content); $('.card_content').val(detailInfo.content);
if(detailInfo.hasOwnProperty('picUrls')){ if (detailInfo.hasOwnProperty('picUrls')) {
var imgHtml = '' var imgHtml = ''
for(var i = 0;i < detailInfo.picUrls.length;i++){ for (var i = 0; i < detailInfo.picUrls.length; i++) {
imgHtml += /* '<img src="'+detailInfo.picUrls[i]+'" >'; */ imgHtml += /* '<img src="'+detailInfo.picUrls[i]+'" >'; */
'<div class="image_files_item">' + '<div class="image_files_item">' +
'<img src="'+detailInfo.picUrls[i]+'" class="image_files_img" imgkey="'+detailInfo.picUrls[i]+'">' + '<img src="' + detailInfo.picUrls[i] + '" class="image_files_img" imgkey="' + detailInfo.picUrls[i] +
'">' +
'<img src="../images/post_delete_btn@2x.png" class="image_del" >' + '<img src="../images/post_delete_btn@2x.png" class="image_del" >' +
'</div>'; '</div>';
} }
......
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