Commit 64f23072 by zujiaozhang

'修改第一次获取数据为空的情况'

parent ef0c7772
...@@ -8,6 +8,7 @@ body { ...@@ -8,6 +8,7 @@ body {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
} }
#content { #content {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -149,11 +150,17 @@ textarea[maxlength="300"]{ ...@@ -149,11 +150,17 @@ textarea[maxlength="300"]{
border:0; border:0;
background:rgba(249,249,249,1); background:rgba(249,249,249,1);
border-radius:2px; border-radius:2px;
padding: .2rem; padding: .2rem;
font-size:.28rem;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(51,51,51,1);
line-height:.28rem;
} }
.content_body_programme{ .content_body_programme{
display: none; display: none;
} }
textarea::-webkit-input-placeholder { textarea::-webkit-input-placeholder {
/* placeholder颜色 */ /* placeholder颜色 */
color: #aab2bd; color: #aab2bd;
......
...@@ -13,7 +13,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -13,7 +13,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
flag: true, flag: true,
// 检查选择数据 // 检查选择数据
discomfortGPObj:{ discomfortGPObj:{
'15': true, '15': false,
'16': false, '16': false,
'17': false, '17': false,
'18': false, '18': false,
...@@ -33,7 +33,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -33,7 +33,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
'32': false, '32': false,
'33': false '33': false
}, },
checkList: ["15"], checkList: [],
// 选中数据 // 选中数据
checks:'', checks:'',
...@@ -143,11 +143,42 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -143,11 +143,42 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
success: function(res) { success: function(res) {
console.log(res) console.log(res)
if(!res.success) return medtap.winPop('获取数据失败') if(!res.success) return medtap.winPop('获取数据失败')
if(!res.content.followAnswer.answer) {
discomfort.flag=true
discomfort.checks='15'
discomfort.discomfortGPObj ={
'15': true,
'16': false,
'17': false,
'18': false,
'19': false,
'20': false,
'21': false,
'22': false,
'23': false,
'24': false,
'25': false,
'26': false,
'27': false,
'28': false,
'29': false,
'30': false,
'31': false,
'32': false,
'33': false
}
$('.checkbox_pl').prop('checked',true)
return
}
if(res.content.followAnswer.answer.status=='0'){
discomfort.flag=false
$('.noHas').addClass('active').siblings('.has').removeClass('active')
$('.content_select_no').addClass('active').siblings('.content_select').removeClass('active')
return
}
if(res.content.followAnswer.answer.status=='1'){ if(res.content.followAnswer.answer.status=='1'){
discomfort.flag=true
discomfort.checks = res.content.followAnswer.answer.checks discomfort.checks = res.content.followAnswer.answer.checks
console.log(discomfort.checks)
console.log('1')
var arr = res.content.followAnswer.answer.checks var arr = res.content.followAnswer.answer.checks
discomfort.checkList = arr.split(',') discomfort.checkList = arr.split(',')
discomfort.discomfortGPObj['15'] = false discomfort.discomfortGPObj['15'] = false
...@@ -232,11 +263,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -232,11 +263,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
break; break;
} }
}); });
}else{ }
console.log('0')
$('.noHas').addClass('active').siblings('.has').removeClass('active')
$('.content_select_no').addClass('active').siblings('.content_select').removeClass('active')
}
} }
}) })
}, },
......
...@@ -325,6 +325,9 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -325,6 +325,9 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
success: function(res) { success: function(res) {
if(!res.success) return medtap.winPop('获取数据失败') if(!res.success) return medtap.winPop('获取数据失败')
console.log(res) console.log(res)
if(!res.content.followAnswer.answer) {
return
}
if(res.content.followAnswer.answer.isHandleVal=='是'){ if(res.content.followAnswer.answer.isHandleVal=='是'){
$('.doctorExplanation').show() $('.doctorExplanation').show()
} }
......
...@@ -13,7 +13,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -13,7 +13,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
flag: true, flag: true,
// 检查选择数据 // 检查选择数据
examinationObj:{ examinationObj:{
'6': true, '6': false,
'7': false, '7': false,
'8': false, '8': false,
'9': false, '9': false,
...@@ -21,7 +21,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -21,7 +21,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
'11': false, '11': false,
'12': false '12': false
}, },
checkList: ["6"], checkList: [],
// 选中数据 // 选中数据
checks:'', checks:'',
init:function(){ init:function(){
...@@ -84,7 +84,8 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -84,7 +84,8 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
"followUpId": examination.followUpId "followUpId": examination.followUpId
} }
examination.getNextQuestion(dataHas) examination.getNextQuestion(dataHas)
}else { }
if(!examination.flag) {
var dataNo = { var dataNo = {
"parentId":examination.parentId, "parentId":examination.parentId,
"questionId":examination.questionId, "questionId":examination.questionId,
...@@ -126,9 +127,27 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -126,9 +127,27 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
success: function(res) { success: function(res) {
console.log(res) console.log(res)
if(!res.success) return medtap.winPop('获取数据失败') if(!res.success) return medtap.winPop('获取数据失败')
console.log(res.content.followAnswer.answer.checks) // 如果没做过题那么answer没有
if(!res.content.followAnswer.answer) {
examination.flag=true
examination.checks='6'
examination.examinationObj ={
'6': true,
'7': false,
'8': false,
'9': false,
'10': false,
'11': false,
'12': false
}
$('.bloodTest').prop('checked',true)
console.log(examination.checks)
return
}
// console.log(res.content.followAnswer.answer.checks)
examination.checks = res.content.followAnswer.answer.checks examination.checks = res.content.followAnswer.answer.checks
if(res.content.followAnswer.answer.status=='1'){ if(res.content.followAnswer.answer.status=='1'){
examination.flag = true
examination.checks = res.content.followAnswer.answer.checks examination.checks = res.content.followAnswer.answer.checks
var chceksStr = res.content.followAnswer.answer.checks var chceksStr = res.content.followAnswer.answer.checks
examination.checkList = chceksStr.split(',') examination.checkList = chceksStr.split(',')
...@@ -166,6 +185,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -166,6 +185,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
} }
}); });
} else{ } else{
examination.flag = false
$('.noHas').addClass('active').siblings('.has').removeClass('active') $('.noHas').addClass('active').siblings('.has').removeClass('active')
$('.content_select_no').addClass('active').siblings('.content_select').removeClass('active') $('.content_select_no').addClass('active').siblings('.content_select').removeClass('active')
} }
......
...@@ -15,7 +15,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -15,7 +15,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
judgePicker: '', judgePicker: '',
movePicker: '', movePicker: '',
// 选择有或者无 // 选择有或者无
flag: true, flag: '',
// 图片集合 // 图片集合
imgList: [], imgList: [],
// //
...@@ -24,6 +24,19 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -24,6 +24,19 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
// 图片https://地址 // 图片https://地址
imgKey: '', imgKey: '',
init:function(){ init:function(){
console.log(furtherConsultation.flag)
// 点击删除图片
$('#ImgUp').on('click', '.image_del', function() {
var src = $(this).siblings('img').attr('src')
var index = furtherConsultation.imgList.findIndex(function(item){
return item = src
})
console.log(index)
if (confirm('确定要删除图片吗?')) {
furtherConsultation.imgList.splice(index,1)
$(this).parent().remove();
}
});
// 用户点击了无 // 用户点击了无
$('.noHas').on('tap',function(){ $('.noHas').on('tap',function(){
furtherConsultation.flag=false furtherConsultation.flag=false
...@@ -156,6 +169,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -156,6 +169,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
url: window.location.href url: window.location.href
}, },
success: function(res) { success: function(res) {
console.log(res)
var data = res.content; var data = res.content;
wx.config({ wx.config({
debug: false, debug: false,
...@@ -174,7 +188,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -174,7 +188,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
}, },
//选择图片 //选择图片
choseImage: function() { choseImage: function() {
$('.upload_img').on('click', function() { $('.upload_img').on('click',function() {
console.log('点击了选择图片') console.log('点击了选择图片')
var html = ''; var html = '';
wx.ready(function() { wx.ready(function() {
...@@ -182,7 +196,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -182,7 +196,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
localId = localIds[0]; localId = localIds[0];
localIds = localIds.length > 1 ? localIds.slice(1) : localIds[0]; localIds = localIds.length > 1 ? localIds.slice(1) : localIds[0];
wx.uploadImage({ wx.uploadImage({
localId: localId, localId: localId||'',
isShowProgressTips: 1, isShowProgressTips: 1,
success: function(res) { success: function(res) {
var serverId = res.serverId; // 返回图片的服务器端ID var serverId = res.serverId; // 返回图片的服务器端ID
...@@ -253,6 +267,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -253,6 +267,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
var imgKey = res.url; var imgKey = res.url;
furtherConsultation.imgList.push(imgKey); furtherConsultation.imgList.push(imgKey);
console.log('上传后图片的imgKey',imgKey) console.log('上传后图片的imgKey',imgKey)
console.log(localId)
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" >' +
...@@ -264,7 +279,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -264,7 +279,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
}) })
}, },
// 获取问题答案 // 获取问题答案
getQuestionAnswer: function(){ getQuestionAnswer: function(){
medtap.submitAjax({ medtap.submitAjax({
url: "https://testdevgw.medtap.cn/operation/followUp/getAnswer", url: "https://testdevgw.medtap.cn/operation/followUp/getAnswer",
type: 'post', type: 'post',
...@@ -277,16 +292,38 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -277,16 +292,38 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
success: function(res) { success: function(res) {
console.log(res) console.log(res)
if(!res.success) return medtap.winPop('获取数据失败') if(!res.success) return medtap.winPop('获取数据失败')
// 如果没做过题那么answer没有
if(!res.content.followAnswer.answer) {
furtherConsultation.flag=true
return
}
if(res.content.followAnswer.answer.status=='0'){
$('.noHas').addClass('active').siblings('.has').removeClass('active')
$('.content_select_no').addClass('active').siblings('.content_select').removeClass('active')
furtherConsultation.flag=false
return
}
if(res.content.followAnswer.answer.judge=="出现新发病灶或其他部位转移"){ if(res.content.followAnswer.answer.judge=="出现新发病灶或其他部位转移"){
$('.content_body_height_box').show() $('.content_body_height_box').show()
} }
if(res.content.followAnswer.answer.status=='0'){ if(res.content.followAnswer.answer.status=='1'){
$('.noHas').addClass('active').siblings('.has').removeClass('active') furtherConsultation.flag=true
$('.content_select_no').addClass('active').siblings('.content_select').removeClass('active') $('.input_item_move').val(res.content.followAnswer.answer.movePositionVal||'')
}
$('.input_item_move').val(res.content.followAnswer.answer.movePositionVal||'')
$('.input_item_judge').val(res.content.followAnswer.answer.judge||'') $('.input_item_judge').val(res.content.followAnswer.answer.judge||'')
// 图片相关操作。。 // 图片相关操作。。
var imgList = res.content.followAnswer.answer.imgKey
furtherConsultation.imgList = res.content.followAnswer.answer.imgKey
var html =''
if(imgList.length>0){
for(var i = 0;i<imgList.length;i++){
html+='<div class="image_files_item">' +
'<img src="' + imgList[i] + '" class="image_files_img">' +
'<img src="../images/post_delete_btn@2x.png" class="image_del" >' +
'</div>';
}
$('#ImgUp').append(html)
}
}
} }
}) })
}, },
...@@ -339,5 +376,4 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -339,5 +376,4 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
furtherConsultation.getQuestionAnswer(); furtherConsultation.getQuestionAnswer();
furtherConsultation.choseImage(); furtherConsultation.choseImage();
furtherConsultation.previewImage(); furtherConsultation.previewImage();
furtherConsultation.upLoadImg();
}) })
\ No newline at end of file
...@@ -28,7 +28,17 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -28,7 +28,17 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
// 医生对检测结果的说明 // 医生对检测结果的说明
testDescription:'', testDescription:'',
init: function(){ init: function(){
// 点击删除图片
$('#ImgUp').on('click', '.image_del', function() {
var src = $(this).siblings('img').attr('src')
var index = geneDetection.imgList.findIndex(function(item){
return item = src
})
if (confirm('确定要删除图片吗?')) {
geneDetection.imgList.splice(index,1)
$(this).parent().remove();
}
});
// 用户点击了无 // 用户点击了无
$('.noHas').on('tap',function(){ $('.noHas').on('tap',function(){
geneDetection.flag=false geneDetection.flag=false
...@@ -239,6 +249,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -239,6 +249,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
$('#ImgUp').on('click', '.image_del', function() { $('#ImgUp').on('click', '.image_del', function() {
if (confirm('确定要删除图片吗?')) { if (confirm('确定要删除图片吗?')) {
$(this).parent().remove(); $(this).parent().remove();
console.log($(this))
} }
}); });
}, },
...@@ -287,15 +298,43 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -287,15 +298,43 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
}, },
success: function(res) { success: function(res) {
console.log(res) console.log(res)
if(!res.success) return medtap.winPop('获取数据失败') if(!res.success) return medtap.winPop('获取数据失败')
if(!res.content.followAnswer.answer) {
if(res.content.followAnswer.answer.EGFRval=="突变"){ geneDetection.flag=true
return
}
if(res.content.followAnswer.answer.status=='0'){
geneDetection.flag=false
$('.noHas').addClass('active').siblings('.has').removeClass('active')
$('.content_select_no').addClass('active').siblings('.content_select').removeClass('active')
$('.input_item_EGFR').val('')
$('.input_item_position').val('')
$('#content_body_fill').val('')
return
}
if(res.content.followAnswer.answer.status=='1'){
geneDetection.flag=true
if(res.content.followAnswer.answer.EGFRval=="突变"){
$('.content_body_position').show() $('.content_body_position').show()
} }
$('.input_item_EGFR').val(res.content.followAnswer.answer.EGFRval || '') $('.input_item_EGFR').val(res.content.followAnswer.answer.EGFRval || '')
$('.input_item_position').val(res.content.followAnswer.answer.positionVal || '') $('.input_item_position').val(res.content.followAnswer.answer.positionVal || '')
$('#content_body_fill').val(res.content.followAnswer.answer.testDescription || '') $('#content_body_fill').val(res.content.followAnswer.answer.testDescription || '')
// 图片。。 // 图片。。
var imgList = res.content.followAnswer.answer.imgList
geneDetection.imgList = res.content.followAnswer.answer.imgList
var html =''
if(imgList.length>0){
for(var i = 0;i<imgList.length;i++){
html+='<div class="image_files_item">' +
'<img src="' + imgList[i] + '" class="image_files_img">' +
'<img src="../images/post_delete_btn@2x.png" class="image_del" >' +
'</div>';
}
$('#ImgUp').append(html)
}
}
} }
}) })
...@@ -371,5 +410,4 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -371,5 +410,4 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
geneDetection.getQuestionAnswer(); geneDetection.getQuestionAnswer();
geneDetection.choseImage(); geneDetection.choseImage();
geneDetection.previewImage(); geneDetection.previewImage();
geneDetection.upLoadImg();
}) })
\ No newline at end of file
...@@ -51,7 +51,17 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -51,7 +51,17 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
$('.content_body_title').text('6、请拍照上传病理检查结果') $('.content_body_title').text('6、请拍照上传病理检查结果')
break; break;
} }
// 点击删除图片
$('#ImgUp').on('click', '.image_del', function() {
var src = $(this).siblings('img').attr('src')
var index = generalPage.imgList.findIndex(function(item){
return item = src
})
if (confirm('确定要删除图片吗?')) {
generalPage.imgList.splice(index,1)
$(this).parent().remove();
}
});
// 点击下一题 // 点击下一题
$('.next').on('click',function(){ $('.next').on('click',function(){
// 获取用户填写的数据 // 获取用户填写的数据
...@@ -142,6 +152,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -142,6 +152,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
$('#ImgUp').on('click', '.image_files_img', function() { $('#ImgUp').on('click', '.image_files_img', function() {
var imgArray = []; var imgArray = [];
var curImageSrc = $(this).attr('src'); var curImageSrc = $(this).attr('src');
console.log($(this).attr('src'))
if (curImageSrc) { if (curImageSrc) {
$('#ImgUp .image_files_img').each(function(index, el) { $('#ImgUp .image_files_img').each(function(index, el) {
var itemSrc = $(this).attr('src'); var itemSrc = $(this).attr('src');
...@@ -153,11 +164,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -153,11 +164,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
}); });
} }
}); });
$('#ImgUp').on('click', '.image_del', function() {
if (confirm('确定要删除图片吗?')) {
$(this).parent().remove();
}
});
}, },
//上传图片 //上传图片
upLoadImg: function(serverId, localId) { upLoadImg: function(serverId, localId) {
...@@ -205,8 +212,23 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -205,8 +212,23 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
success: function(res) { success: function(res) {
if(!res.success) return medtap.winPop('获取数据失败') if(!res.success) return medtap.winPop('获取数据失败')
console.log(res) console.log(res)
if(!res.content.followAnswer.answer) {
return
}
$('#content_body_fill').val(res.content.followAnswer.answer.dataText || '') $('#content_body_fill').val(res.content.followAnswer.answer.dataText || '')
// 图片未加 // 图片
var imgList = res.content.followAnswer.answer.checkImgList
generalPage.imgList = res.content.followAnswer.answer.checkImgList
var html =''
if(imgList.length>0){
for(var i = 0;i<imgList.length;i++){
html+='<div class="image_files_item">' +
'<img src="' + imgList[i] + '" class="image_files_img">' +
'<img src="../images/post_delete_btn@2x.png" class="image_del" >' +
'</div>';
}
$('#ImgUp').append(html)
}
} }
}) })
}, },
...@@ -302,5 +324,4 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -302,5 +324,4 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
generalPage.getQuestionAnswer(); generalPage.getQuestionAnswer();
generalPage.choseImage(); generalPage.choseImage();
generalPage.previewImage(); generalPage.previewImage();
generalPage.upLoadImg();
}) })
\ No newline at end of file
...@@ -23,22 +23,25 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -23,22 +23,25 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
}, },
success: function(res) { success: function(res) {
console.log(res.content) console.log(res)
var html = '' var html = ''
var QuestionnaireList = res.content.followUpList var QuestionnaireList = res.content.followUpList
for (var i = 0; i < QuestionnaireList.length; i++) { for (var i = 0; i < QuestionnaireList.length; i++) {
var times =QuestionnaireList[i].createTime.split(' ')[0] var times = QuestionnaireList[i].answerTime.split('-')
var mouthTime =times.slice(5,7) var mouthTime =times[1]
var yearTime = times.slice(0,4) var yearTime = times[0]
html += '<li class="my_questionnaire_list">' html += '<li class="my_questionnaire_list" data-id='+QuestionnaireList[i].status+'>'
+ yearTime + '年' + mouthTime + '月随访问卷' + yearTime + '年' + mouthTime + '月随访问卷'
+'<span class="my_questionnaire_list_after" data-id='+QuestionnaireList[i].status+'>已完成</span></li>' +'<span class="my_questionnaire_list_after">已完成</span></li>'
} }
$('.my_questionnaire_box').append(html) $('.my_questionnaire_box').append(html)
if($('.my_questionnaire_list_after').attr('data-id')!=1){ var list = document.querySelectorAll('.my_questionnaire_box li')
$('.my_questionnaire_list_after').hide() for(var i=0; i<list.length;i++){
} if(list[i].dataset.id!=1){
list[i].children[0].hidden=true
}
}
// 点击进入详情 // 点击进入详情
$('.my_questionnaire_box').on('tap','.my_questionnaire_list',function(){ $('.my_questionnaire_box').on('tap','.my_questionnaire_list',function(){
console.log('跳转') console.log('跳转')
......
...@@ -11,7 +11,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -11,7 +11,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
// //
treatmentTypePicker: '', treatmentTypePicker: '',
// 选择有或者无 // 选择有或者无
flag: true, flag: '',
// 治疗类型 // 治疗类型
treatmentTypeVal: '', treatmentTypeVal: '',
// 具体疗法和药物 // 具体疗法和药物
...@@ -117,13 +117,23 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -117,13 +117,23 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
success: function(res) { success: function(res) {
console.log(res) console.log(res)
if(!res.success) return winPop('获取数据失败') if(!res.success) return winPop('获取数据失败')
if(res.content.followAnswer.answer.status=='1'){ if(!res.content.followAnswer.answer) {
otherTreatment.flag=true
return
}
var status = res.content.followAnswer.answer.status=undefined? '1':res.content.followAnswer.answer.status
if(status=='1'){
otherTreatment.flag=true
$('.input_item_treatmentType').val(res.content.followAnswer.answer.treatmentTypeVal || '') $('.input_item_treatmentType').val(res.content.followAnswer.answer.treatmentTypeVal || '')
$('#content_body__specificTherapy').val(res.content.followAnswer.answer.specificTherapy || '') $('#content_body__specificTherapy').val(res.content.followAnswer.answer.specificTherapy || '')
}else{ }else if(status=='0'){
otherTreatment.flag=false otherTreatment.flag=false
$('.noHas').addClass('active').siblings('.has').removeClass('active') $('.noHas').addClass('active').siblings('.has').removeClass('active')
$('.content_select_no').addClass('active').siblings('.content_select').removeClass('active') $('.content_select_no').addClass('active').siblings('.content_select').removeClass('active')
}else{
otherTreatment.flag=true
$('.input_item_treatmentType').val(res.content.followAnswer.answer.treatmentTypeVal || '')
$('#content_body__specificTherapy').val(res.content.followAnswer.answer.specificTherapy || '')
} }
} }
}) })
......
...@@ -36,6 +36,9 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -36,6 +36,9 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
success: function(res) { success: function(res) {
console.log(res) console.log(res)
if(!res.success) return medtap.winPop('获取数据失败') if(!res.success) return medtap.winPop('获取数据失败')
if(!res.content.followAnswer.answer) {
return
}
$('#weight').val(res.content.followAnswer.answer.weight||'') $('#weight').val(res.content.followAnswer.answer.weight||'')
$('#height').val(res.content.followAnswer.answer.height||'') $('#height').val(res.content.followAnswer.answer.height||'')
} }
......
...@@ -23,7 +23,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -23,7 +23,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
// 是否下一步治疗 // 是否下一步治疗
isNextpicker: '', isNextpicker: '',
// 选择有或者无 // 选择有或者无
flag: true, flag: '',
// 使用的奥西替尼 // 使用的奥西替尼
drugTypesVal:'', drugTypesVal:'',
// 所在的地区能否报销泰瑞沙的费用 // 所在的地区能否报销泰瑞沙的费用
...@@ -369,14 +369,22 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -369,14 +369,22 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
success: function(res) { success: function(res) {
console.log(res) console.log(res)
if(!res.success) return medtap.winPop('获取数据失败') if(!res.success) return medtap.winPop('获取数据失败')
// 如果没做过题那么answer没有
if(!res.content.followAnswer.answer) {
targetedTherapy.flag=true
return
}
// 有 // 有
if(res.content.followAnswer.answer.status=='1'){ var status = res.content.followAnswer.answer.status=undefined? '1':res.content.followAnswer.answer.status
if(status=='1'){
targetedTherapy.flag=true
$('.input_item_drugTypes').val(res.content.followAnswer.answer.drugTypesVal||'') $('.input_item_drugTypes').val(res.content.followAnswer.answer.drugTypesVal||'')
$('.input_item_reimbursement').val(res.content.followAnswer.answer.reimbursementVal||'') $('.input_item_reimbursement').val(res.content.followAnswer.answer.reimbursementVal||'')
$('.input_item_drugCost').val(res.content.followAnswer.answer.drugCostVal||'') $('.input_item_drugCost').val(res.content.followAnswer.answer.drugCostVal||'')
$('.input_item_city').val(res.content.followAnswer.answer.cityVal||'') $('.input_item_city').val(res.content.followAnswer.answer.cityVal||'')
$('.input_item_medicalType').val(res.content.followAnswer.answer.medicalType||'') $('.input_item_medicalType').val(res.content.followAnswer.answer.medicalType||'')
}else{ }else if(status=='0'){
console.log('1')
// 无 // 无
targetedTherapy.flag=false targetedTherapy.flag=false
$('.noHas').addClass('active').siblings('.has').removeClass('active') $('.noHas').addClass('active').siblings('.has').removeClass('active')
...@@ -389,6 +397,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) {  ...@@ -389,6 +397,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
$('.input_item_isNext').val(res.content.followAnswer.answer.isNextVal||'') $('.input_item_isNext').val(res.content.followAnswer.answer.isNextVal||'')
$('#content_body_programme').val(res.content.followAnswer.answer.programme||'') $('#content_body_programme').val(res.content.followAnswer.answer.programme||'')
} }
console.log(targetedTherapy.flag)
} }
}) })
}, },
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<textarea name="" id="content_body_fill" cols="30" rows="3" placeholder="请输入" maxlength="300"></textarea> <textarea name="" id="content_body_fill" cols="30" rows="3" placeholder="请输入" maxlength="300"></textarea>
</div> </div>
  </div>   </div>
<div> <div class="content_select_no">
  <div></div>   <div></div>
</div> </div>
</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