Commit 595b9cfe by hanpeng

-mark -20200109

parent e12c7de4
...@@ -41,6 +41,9 @@ define(['zepto', 'medtap'], function($, medtap) { ...@@ -41,6 +41,9 @@ define(['zepto', 'medtap'], function($, medtap) {
//alert(detail.doctorId) //alert(detail.doctorId)
$('.service_type').html(detail.payDesc); $('.service_type').html(detail.payDesc);
$('.service_doctor').html(imgConsult.doctorName); $('.service_doctor').html(imgConsult.doctorName);
$('.service_doctor').unbind.bind('click',function(){
medtap.pushWindow('https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_push_doctor/pages/doctorHomePage.html?doctorId=' + imgConsult.doctorId + '&wechatId=' + detail.wechatId)
})
$('.service_price').html(detail.payFee + '元'); $('.service_price').html(detail.payFee + '元');
var sex = ''; var sex = '';
if (imgConsult.sex == 'M') { if (imgConsult.sex == 'M') {
...@@ -87,6 +90,8 @@ define(['zepto', 'medtap'], function($, medtap) { ...@@ -87,6 +90,8 @@ define(['zepto', 'medtap'], function($, medtap) {
} else { } else {
$('.pay_box').hide(); $('.pay_box').hide();
} }
} }
} }
}) })
......
define(['zepto','medtap'],function($,medtap){ define(['zepto', 'medtap'], function($, medtap) {
var imgConsult = { var imgConsult = {
doctorId:medtap.getRequest('doctorId'), doctorId: medtap.getRequest('doctorId'),
doctorName:'', doctorName: '',
pmdOrderSn:medtap.getRequest('pmdOrderSn'), pmdOrderSn: medtap.getRequest('pmdOrderSn'),
localIds: [], localIds: [],
serverId: "", serverId: "",
imgList: [], imgList: [],
emrId:'', emrId: '',
payFee:'', payFee: '',
isPmd:false, isPmd: false,
wxLungToken:localStorage.wxLungToken, wxLungToken: localStorage.wxLungToken,
init:function(){ init: function() {
imgConsult.getDoctorDetail(); imgConsult.getDoctorDetail();
imgConsult.bindEve(); imgConsult.bindEve();
imgConsult.getWechatTicket(); imgConsult.getWechatTicket();
imgConsult.getPatient(); imgConsult.getPatient();
imgConsult.confirmImgConsult(); imgConsult.confirmImgConsult();
$('textarea').on('blur',function(){ $('textarea').on('blur', function() {
window.scrollTo(0, document.documentElement.clientHeight); window.scrollTo(0, document.documentElement.clientHeight);
}); });
}, },
bindEve:function(){ bindEve: function() {
$('.btn_icon').unbind().bind('click',function(){ $('.btn_icon').unbind().bind('click', function() {
$(this).toggleClass('btnSelect'); $(this).toggleClass('btnSelect');
if ($(this).hasClass('btnSelect')) { if ($(this).hasClass('btnSelect')) {
$(this).attr('select', 'yes'); $(this).attr('select', 'yes');
...@@ -29,97 +29,98 @@ define(['zepto','medtap'],function($,medtap){ ...@@ -29,97 +29,98 @@ define(['zepto','medtap'],function($,medtap){
$(this).attr('select', 'no'); $(this).attr('select', 'no');
} }
}); });
$('.consult_agreement').unbind().bind('click',function(){ $('.consult_agreement').unbind().bind('click', function() {
medtap.pushWindow('https://review-formal.iplusmed.com/App/dev/FF499211739FD801DOCTOR/AppHtml/DoctorServiceLicense.html') medtap.pushWindow(
'https://review-formal.iplusmed.com/App/dev/FF499211739FD801DOCTOR/AppHtml/DoctorServiceLicense.html')
}) })
$('.submit_order').unbind().bind('click',function(){ $('.submit_order').unbind().bind('click', function() {
var flag = $('.btn_icon').attr('select'); var flag = $('.btn_icon').attr('select');
var result = imgConsult.checkValue(); var result = imgConsult.checkValue();
if(result == true){ if (result == true) {
if(flag == 'yes'){ if (flag == 'yes') {
if(imgConsult.pmdOrderSn == '' || imgConsult.pmdOrderSn == 'undefined'){ if (imgConsult.pmdOrderSn == '' || imgConsult.pmdOrderSn == 'undefined') {
imgConsult.createImgConsult(); imgConsult.createImgConsult();
}else{ } else {
if(imgConsult.isPmd == true && imgConsult.payFee == '0'){ if (imgConsult.isPmd == true && imgConsult.payFee == '0') {
imgConsult.freeOrder(); imgConsult.freeOrder();
}else{ } else {
//imgConsult.createImgConsult(); //imgConsult.createImgConsult();
} }
} }
}else{ } else {
medtap.toast({ medtap.toast({
message:'<p style="text-align:center">请阅读并同意<br/>《医生咨询服务订单协议》</p>', message: '<p style="text-align:center">请阅读并同意<br/>《医生咨询服务订单协议》</p>',
time:1500 time: 1500
}) })
} }
} }
}) })
}, },
getDoctorDetail:function(){ getDoctorDetail: function() {
medtap.loading(1); medtap.loading(1);
medtap.submitAjax({ medtap.submitAjax({
url:'https://testdevgw.medtap.cn/doctor/getDoctorDetail', url: 'https://testdevgw.medtap.cn/doctor/getDoctorDetail',
type:'get', type: 'get',
async:false, async: false,
data:{ data: {
doctorId:imgConsult.doctorId doctorId: imgConsult.doctorId
}, },
success:function(res){ success: function(res) {
medtap.loading(0); medtap.loading(0);
if(res.success == true){ if (res.success == true) {
var doctorInfo = res.content.doctorItem; var doctorInfo = res.content.doctorItem;
var str = doctorInfo.hasOwnProperty('technologyProfessional') ? doctorInfo.technologyProfessional.value : ''; var str = doctorInfo.hasOwnProperty('technologyProfessional') ? doctorInfo.technologyProfessional.value :
'';
$('.doctor_name').html(doctorInfo.doctorName + "(" + str + ")"); $('.doctor_name').html(doctorInfo.doctorName + "(" + str + ")");
imgConsult.doctorName = doctorInfo.doctorName; imgConsult.doctorName = doctorInfo.doctorName;
$('.img_consult_price').html(doctorInfo.hasOwnProperty('imageConsultPrice') ? doctorInfo.imageConsultPrice + ' / 次' : ''); $('.img_consult_price').html(doctorInfo.hasOwnProperty('imageConsultPrice') ? doctorInfo.imageConsultPrice +
' / 次' : '');
} }
} }
}) })
}, },
getPatient:function(){ getPatient: function() {
medtap.loading(1); medtap.loading(1);
medtap.submitAjax({ medtap.submitAjax({
url:'https://testdevgw.medtap.cn/user/patientEMR/listPatientEMR', url: 'https://testdevgw.medtap.cn/user/patientEMR/listPatientEMR',
type:'post', type: 'post',
async:false, async: false,
contentType: 'application/json', contentType: 'application/json',
data:{ data: {
pageNum:1, pageNum: 1,
pageSize:10, pageSize: 10,
condition:{ condition: {
} }
}, },
success:function(res){ success: function(res) {
medtap.loading(0); medtap.loading(0);
if(res.success == true){ if (res.success == true) {
var patientList = res.content.list; var patientList = res.content.list;
var sex = ''; var sex = '';
var age = ''; var age = '';
var city = ''; var city = '';
for(var i = 0;i < patientList.length;i++){ for (var i = 0; i < patientList.length; i++) {
if(patientList[i].defaultFlg == true){
$('.service_patient').html(patientList[i].patientName); $('.service_patient').html(patientList[i].patientName);
imgConsult.emrId = patientList[i].emrId; imgConsult.emrId = patientList[i].emrId;
$('.patient_name').text(patientList[i].patientName); $('.patient_name').text(patientList[i].patientName);
if(patientList[i].sex == 'M'){ if (patientList[i].sex == 'M') {
sex = '男'; sex = '男';
}else if(patientList[i].sex == 'F'){ } else if (patientList[i].sex == 'F') {
sex = '女'; sex = '女';
} }
age = patientList[i].age; age = patientList[i].age;
city = patientList[i].hasOwnProperty('areaItem') ? patientList[i].areaItem.fullName : ''; city = patientList[i].hasOwnProperty('areaItem') ? patientList[i].areaItem.fullName : '';
$('.patient_sex_age_city').text('(' + sex +' ' + age +'岁 ' + city + ')'); $('.patient_sex_age_city').text('(' + sex + ' ' + age + '岁 ' + city + ')');
$('.diseaseDiagnosis').text('疾病诊断:' + patientList[i].diseaseDiagnosisName); $('.diseaseDiagnosis').text('疾病诊断:' + patientList[i].diseaseDiagnosisName);
$('.pathologyType').text('病理类型:' + patientList[i].pathologyTypeName) $('.pathologyType').text('病理类型:' + patientList[i].pathologyTypeName)
} }
} }
} }
}
}) })
}, },
createImgConsult:function(){ createImgConsult: function() {
var urls = [], var urls = [],
picUrl = ""; picUrl = "";
[].forEach.call($('#ImgUp .image_files_img'), function(item) { [].forEach.call($('#ImgUp .image_files_img'), function(item) {
...@@ -128,27 +129,30 @@ define(['zepto','medtap'],function($,medtap){ ...@@ -128,27 +129,30 @@ define(['zepto','medtap'],function($,medtap){
var picUrl = urls.join(','); var picUrl = urls.join(',');
medtap.loading(1); medtap.loading(1);
medtap.submitAjax({ medtap.submitAjax({
url:'https://testdevgw.medtap.cn/trade/imageConsultOrder/submitOrder', url: 'https://testdevgw.medtap.cn/trade/imageConsultOrder/submitOrder',
type:'post', type: 'post',
async: false, async: false,
contentType: 'application/json', contentType: 'application/json',
data:{ data: {
emrId:imgConsult.emrId, emrId: imgConsult.emrId,
doctorId:imgConsult.doctorId, doctorId: imgConsult.doctorId,
describe:$('#disease_detail').val() || '', describe: $('#disease_detail').val() || '',
describePic:picUrl, describePic: picUrl,
expectationHelp:$('#expectation_help_detail').val() || '' expectationHelp: $('#expectation_help_detail').val() || ''
}, },
success:function(res){ success: function(res) {
medtap.loading(0); medtap.loading(0);
if(res.success == true){ if (res.success == true) {
var orderDetail = res.content.order; var orderDetail = res.content.order;
medtap.pushWindow('https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_wxPay/wxPay.html?orderType=imgConsult&orderId=' + orderDetail.orderSn + '&wxLungToken=' + imgConsult.wxLungToken + '&wechatId=' + medtap.getRequest('wechatId')); medtap.pushWindow(
'https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_wxPay/wxPay.html?orderType=imgConsult&orderId=' +
orderDetail.orderSn + '&wxLungToken=' + imgConsult.wxLungToken + '&wechatId=' + medtap.getRequest(
'wechatId'));
} }
} }
}) })
}, },
freeOrder:function(){ freeOrder: function() {
var urls = [], var urls = [],
picUrl = ""; picUrl = "";
[].forEach.call($('#ImgUp .image_files_img'), function(item) { [].forEach.call($('#ImgUp .image_files_img'), function(item) {
...@@ -157,52 +161,53 @@ define(['zepto','medtap'],function($,medtap){ ...@@ -157,52 +161,53 @@ define(['zepto','medtap'],function($,medtap){
var picUrl = urls.join(','); var picUrl = urls.join(',');
medtap.loading(1); medtap.loading(1);
medtap.submitAjax({ medtap.submitAjax({
url:'https://testdevgw.medtap.cn/trade/imageConsultOrder/submitOrderByPmd', url: 'https://testdevgw.medtap.cn/trade/imageConsultOrder/submitOrderByPmd',
type:'post', type: 'post',
async: false, async: false,
contentType: 'application/json', contentType: 'application/json',
data:{ data: {
emrId:imgConsult.emrId, emrId: imgConsult.emrId,
doctorId:imgConsult.doctorId, doctorId: imgConsult.doctorId,
pmdOrderSn:medtap.getRequest('pmdOrderSn'), pmdOrderSn: medtap.getRequest('pmdOrderSn'),
describe:$('#disease_detail').val() || '', describe: $('#disease_detail').val() || '',
describePic:picUrl, describePic: picUrl,
expectationHelp:$('#expectation_help_detail').val() || '' expectationHelp: $('#expectation_help_detail').val() || ''
}, },
success:function(res){ success: function(res) {
medtap.loading(0); medtap.loading(0);
if(res.success == true){ if (res.success == true) {
var orderDetail = res.content.order; var orderDetail = res.content.order;
setTimeout(function(){ setTimeout(function() {
medtap.pushWindow('pages/success.html?id=' + orderDetail.orderSn + '&wechatId=' + medtap.getRequest('wechatId')); medtap.pushWindow('pages/success.html?id=' + orderDetail.orderSn + '&wechatId=' + medtap.getRequest(
},1000); 'wechatId'));
}, 1000);
} }
} }
}) })
}, },
confirmImgConsult:function(){ confirmImgConsult: function() {
medtap.loading(1); medtap.loading(1);
medtap.submitAjax({ medtap.submitAjax({
url:'https://testdevgw.medtap.cn/trade/imageConsultOrder/confirmOrder', url: 'https://testdevgw.medtap.cn/trade/imageConsultOrder/confirmOrder',
type:'post', type: 'post',
async: false, async: false,
contentType: 'application/json', contentType: 'application/json',
data:{ data: {
emrId:imgConsult.emrId, emrId: imgConsult.emrId,
doctorId:imgConsult.doctorId, doctorId: imgConsult.doctorId,
pmdOrderSn:medtap.getRequest('pmdOrderSn') pmdOrderSn: medtap.getRequest('pmdOrderSn')
}, },
success:function(res){ success: function(res) {
medtap.loading(0); medtap.loading(0);
if(res.success == true){ if (res.success == true) {
var result = res.content.result; var result = res.content.result;
imgConsult.isPmd = result.isPmd; imgConsult.isPmd = result.isPmd;
imgConsult.payFee = result.payFee; imgConsult.payFee = result.payFee;
$('.img_consult_price').html(result.hasOwnProperty('totalFee') ? result.totalFee + '元 / 次' : ''); $('.img_consult_price').html(result.hasOwnProperty('totalFee') ? result.totalFee + '元 / 次' : '');
if(result.isPmd == true && result.payFee == '0'){ if (result.isPmd == true && result.payFee == '0') {
$('.free_tip').show(); $('.free_tip').show();
$('.needPay').hide(); $('.needPay').hide();
}else{ } else {
$('.free_tip').hide(); $('.free_tip').hide();
$('.needPay').show(); $('.needPay').show();
} }
...@@ -297,9 +302,9 @@ define(['zepto','medtap'],function($,medtap){ ...@@ -297,9 +302,9 @@ define(['zepto','medtap'],function($,medtap){
url: 'https://testdevgw.medtap.cn/common/uploadWechatFile', url: 'https://testdevgw.medtap.cn/common/uploadWechatFile',
type: 'POST', type: 'POST',
async: false, async: false,
headers:{ headers: {
'apptype':'wechat_lung', 'apptype': 'wechat_lung',
'user-os':'wechat' 'user-os': 'wechat'
}, },
data: { data: {
bizType: "3", bizType: "3",
...@@ -322,33 +327,33 @@ define(['zepto','medtap'],function($,medtap){ ...@@ -322,33 +327,33 @@ define(['zepto','medtap'],function($,medtap){
}) })
}, },
checkValue:function(){ checkValue: function() {
var flag = false; var flag = false;
if(!$('#disease_detail').val()){ if (!$('#disease_detail').val()) {
medtap.toast({ medtap.toast({
message:'请输入疾病描述', message: '请输入疾病描述',
time:1500 time: 1500
}) })
flag = false; flag = false;
}else if($('#disease_detail').val().length < 10){ } else if ($('#disease_detail').val().length < 10) {
medtap.toast({ medtap.toast({
message:'疾病描述不可少于10个字', message: '疾病描述不可少于10个字',
time:1500 time: 1500
}) })
flag = false; flag = false;
}else if(!$('#expectation_help_detail').val()){ } else if (!$('#expectation_help_detail').val()) {
medtap.toast({ medtap.toast({
message:'请输入您想要咨询的内容', message: '请输入您想要咨询的内容',
time:1500 time: 1500
}) })
flag = false; flag = false;
}else if($('#expectation_help_detail').val().length < 5 || $('#expectation_help_detail').val().length > 20){ } else if ($('#expectation_help_detail').val().length < 5 || $('#expectation_help_detail').val().length > 20) {
medtap.toast({ medtap.toast({
message:'咨询内容只能输入5-20字', message: '咨询内容只能输入5-20字',
time:1500 time: 1500
}) })
flag = false; flag = false;
}else{ } else {
flag = true; flag = true;
} }
......
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