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