Commit 595b9cfe by hanpeng

-mark -20200109

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