Commit 64f23072 by zujiaozhang

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

parent ef0c7772
......@@ -8,6 +8,7 @@ body {
margin: 0px;
padding: 0px;
}
#content {
width: 100%;
height: 100%;
......@@ -150,10 +151,16 @@ textarea[maxlength="300"]{
background:rgba(249,249,249,1);
border-radius:2px;
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{
display: none;
}
textarea::-webkit-input-placeholder {
/* placeholder颜色 */
color: #aab2bd;
......
......@@ -13,7 +13,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
flag: true,
// 检查选择数据
discomfortGPObj:{
'15': true,
'15': false,
'16': false,
'17': false,
'18': false,
......@@ -33,7 +33,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
'32': false,
'33': false
},
checkList: ["15"],
checkList: [],
// 选中数据
checks:'',
......@@ -143,11 +143,42 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
success: function(res) {
console.log(res)
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'){
discomfort.flag=true
discomfort.checks = res.content.followAnswer.answer.checks
console.log(discomfort.checks)
console.log('1')
var arr = res.content.followAnswer.answer.checks
discomfort.checkList = arr.split(',')
discomfort.discomfortGPObj['15'] = false
......@@ -232,10 +263,6 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
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) { 
success: function(res) {
if(!res.success) return medtap.winPop('获取数据失败')
console.log(res)
if(!res.content.followAnswer.answer) {
return
}
if(res.content.followAnswer.answer.isHandleVal=='是'){
$('.doctorExplanation').show()
}
......
......@@ -13,7 +13,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
flag: true,
// 检查选择数据
examinationObj:{
'6': true,
'6': false,
'7': false,
'8': false,
'9': false,
......@@ -21,7 +21,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
'11': false,
'12': false
},
checkList: ["6"],
checkList: [],
// 选中数据
checks:'',
init:function(){
......@@ -84,7 +84,8 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
"followUpId": examination.followUpId
}
examination.getNextQuestion(dataHas)
}else {
}
if(!examination.flag) {
var dataNo = {
"parentId":examination.parentId,
"questionId":examination.questionId,
......@@ -126,9 +127,27 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
success: function(res) {
console.log(res)
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
if(res.content.followAnswer.answer.status=='1'){
examination.flag = true
examination.checks = res.content.followAnswer.answer.checks
var chceksStr = res.content.followAnswer.answer.checks
examination.checkList = chceksStr.split(',')
......@@ -166,6 +185,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
}
});
} else{
examination.flag = false
$('.noHas').addClass('active').siblings('.has').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) { 
judgePicker: '',
movePicker: '',
// 选择有或者无
flag: true,
flag: '',
// 图片集合
imgList: [],
//
......@@ -24,6 +24,19 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
// 图片https://地址
imgKey: '',
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(){
furtherConsultation.flag=false
......@@ -156,6 +169,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
url: window.location.href
},
success: function(res) {
console.log(res)
var data = res.content;
wx.config({
debug: false,
......@@ -174,7 +188,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
},
//选择图片
choseImage: function() {
$('.upload_img').on('click', function() {
$('.upload_img').on('click',function() {
console.log('点击了选择图片')
var html = '';
wx.ready(function() {
......@@ -182,7 +196,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
localId = localIds[0];
localIds = localIds.length > 1 ? localIds.slice(1) : localIds[0];
wx.uploadImage({
localId: localId,
localId: localId||'',
isShowProgressTips: 1,
success: function(res) {
var serverId = res.serverId; // 返回图片的服务器端ID
......@@ -253,6 +267,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
var imgKey = res.url;
furtherConsultation.imgList.push(imgKey);
console.log('上传后图片的imgKey',imgKey)
console.log(localId)
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" >' +
......@@ -277,16 +292,38 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
success: function(res) {
console.log(res)
if(!res.success) return medtap.winPop('获取数据失败')
if(res.content.followAnswer.answer.judge=="出现新发病灶或其他部位转移"){
$('.content_body_height_box').show()
// 如果没做过题那么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=="出现新发病灶或其他部位转移"){
$('.content_body_height_box').show()
}
if(res.content.followAnswer.answer.status=='1'){
furtherConsultation.flag=true
$('.input_item_move').val(res.content.followAnswer.answer.movePositionVal||'')
$('.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) { 
furtherConsultation.getQuestionAnswer();
furtherConsultation.choseImage();
furtherConsultation.previewImage();
furtherConsultation.upLoadImg();
})
\ No newline at end of file
......@@ -28,7 +28,17 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
// 医生对检测结果的说明
testDescription:'',
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(){
geneDetection.flag=false
......@@ -239,6 +249,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
$('#ImgUp').on('click', '.image_del', function() {
if (confirm('确定要删除图片吗?')) {
$(this).parent().remove();
console.log($(this))
}
});
},
......@@ -288,7 +299,21 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
success: function(res) {
console.log(res)
if(!res.success) return medtap.winPop('获取数据失败')
if(!res.content.followAnswer.answer) {
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()
}
......@@ -296,6 +321,20 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
$('.input_item_position').val(res.content.followAnswer.answer.positionVal || '')
$('#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) { 
geneDetection.getQuestionAnswer();
geneDetection.choseImage();
geneDetection.previewImage();
geneDetection.upLoadImg();
})
\ No newline at end of file
......@@ -51,7 +51,17 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
$('.content_body_title').text('6、请拍照上传病理检查结果')
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(){
// 获取用户填写的数据
......@@ -142,6 +152,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
$('#ImgUp').on('click', '.image_files_img', function() {
var imgArray = [];
var curImageSrc = $(this).attr('src');
console.log($(this).attr('src'))
if (curImageSrc) {
$('#ImgUp .image_files_img').each(function(index, el) {
var itemSrc = $(this).attr('src');
......@@ -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) {
......@@ -205,8 +212,23 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
success: function(res) {
if(!res.success) return medtap.winPop('获取数据失败')
console.log(res)
if(!res.content.followAnswer.answer) {
return
}
$('#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) { 
generalPage.getQuestionAnswer();
generalPage.choseImage();
generalPage.previewImage();
generalPage.upLoadImg();
})
\ No newline at end of file
......@@ -23,21 +23,24 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
},
success: function(res) {
console.log(res.content)
console.log(res)
var html = ''
var QuestionnaireList = res.content.followUpList
for (var i = 0; i < QuestionnaireList.length; i++) {
var times =QuestionnaireList[i].createTime.split(' ')[0]
var mouthTime =times.slice(5,7)
var yearTime = times.slice(0,4)
var times = QuestionnaireList[i].answerTime.split('-')
var mouthTime =times[1]
var yearTime = times[0]
html += '<li class="my_questionnaire_list">'
html += '<li class="my_questionnaire_list" data-id='+QuestionnaireList[i].status+'>'
+ 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)
if($('.my_questionnaire_list_after').attr('data-id')!=1){
$('.my_questionnaire_list_after').hide()
var list = document.querySelectorAll('.my_questionnaire_box li')
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(){
......
......@@ -11,7 +11,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
//
treatmentTypePicker: '',
// 选择有或者无
flag: true,
flag: '',
// 治疗类型
treatmentTypeVal: '',
// 具体疗法和药物
......@@ -117,13 +117,23 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
success: function(res) {
console.log(res)
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 || '')
$('#content_body__specificTherapy').val(res.content.followAnswer.answer.specificTherapy || '')
}else{
}else if(status=='0'){
otherTreatment.flag=false
$('.noHas').addClass('active').siblings('.has').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) { 
success: function(res) {
console.log(res)
if(!res.success) return medtap.winPop('获取数据失败')
if(!res.content.followAnswer.answer) {
return
}
$('#weight').val(res.content.followAnswer.answer.weight||'')
$('#height').val(res.content.followAnswer.answer.height||'')
}
......
......@@ -23,7 +23,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
// 是否下一步治疗
isNextpicker: '',
// 选择有或者无
flag: true,
flag: '',
// 使用的奥西替尼
drugTypesVal:'',
// 所在的地区能否报销泰瑞沙的费用
......@@ -369,14 +369,22 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
success: function(res) {
console.log(res)
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_reimbursement').val(res.content.followAnswer.answer.reimbursementVal||'')
$('.input_item_drugCost').val(res.content.followAnswer.answer.drugCostVal||'')
$('.input_item_city').val(res.content.followAnswer.answer.cityVal||'')
$('.input_item_medicalType').val(res.content.followAnswer.answer.medicalType||'')
}else{
}else if(status=='0'){
console.log('1')
// 无
targetedTherapy.flag=false
$('.noHas').addClass('active').siblings('.has').removeClass('active')
......@@ -389,6 +397,7 @@ define(['zepto', 'medtap', 'mui', 'mui.picker'], function($, medtap, mui) { 
$('.input_item_isNext').val(res.content.followAnswer.answer.isNextVal||'')
$('#content_body_programme').val(res.content.followAnswer.answer.programme||'')
}
console.log(targetedTherapy.flag)
}
})
},
......
......@@ -95,7 +95,7 @@
<textarea name="" id="content_body_fill" cols="30" rows="3" placeholder="请输入" maxlength="300"></textarea>
</div>
  </div>
<div>
<div class="content_select_no">
  <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