作者 杨育虎

我要转诊

... ... @@ -425,7 +425,7 @@ class IndexController extends HomeBaseController
}
}
$insert['photos']=implode(',',$photos);
$insert['report']=implode(',',$photos);
$insert['addtime']=time();
$insert['delete_time']=0;
$model=new InquiryModel();
... ... @@ -462,11 +462,8 @@ class IndexController extends HomeBaseController
$name=date('YmdHis',time()).rand(1000,9999);
$file=$name.'.amr';
$data=$temporary->download($mediaId,"$dir", "$file");
Log::info('download');
Log::info($data);
$filePath=$dir.$file;
Log::info('filePath');
Log::info($filePath);
$result=$this->upChange($filePath,$name);
if($result['err']==0){
return $result['data'];
... ... @@ -514,7 +511,6 @@ class IndexController extends HomeBaseController
$dir=ROOT_PATH.'public/'.'upload/friend'.'/';
$name=date('YmdHis',time()).rand(1000,9999).'.jpg';
$data=$temporary->download($mediaId,"$dir", "$name");
cache('photosdata',$data);
$filePath=$dir.$name;
$result=$this->uploadToQiniu($filePath,$name);
if($result['err']===0){
... ... @@ -532,7 +528,6 @@ class IndexController extends HomeBaseController
* @return array
*/
protected function uploadToQiniu($filePath,$save_name,$policy=null){
Log::info('111');
$plugin=Db::name('plugin')->field('config')->where(['name'=>'Qiniu'])->find();
$config=json_decode($plugin['config'],true);
... ... @@ -540,7 +535,7 @@ class IndexController extends HomeBaseController
$key =$save_name;
require_once VENDOR_PATH . 'qiniu/php-sdk/autoload.php';
Log::info('222');
// 需要填写你的 Access Key 和 Secret Key
$accessKey = $config['accessKey'];
$secretKey = $config['secretKey'];
... ... @@ -553,8 +548,7 @@ class IndexController extends HomeBaseController
$uploadMgr = new UploadManager();
// 调用 UploadManager 的 putFile 方法进行文件的上传
list($ret, $err) = $uploadMgr->putFile($token, $key, $filePath);
Log::info('ret');
Log::info($ret);
if ($err !== null) {
return ["err"=>1,"msg"=>$err,"data"=>""];
} else {
... ... @@ -609,6 +603,35 @@ class IndexController extends HomeBaseController
}
/**
* 转诊提交
*/
public function transferPost(){
$data=input();
$insert['user_id']=cmf_get_current_user_id();
$insert['expert_id']=$data['expert_id'];
//病人主诉判断是音频还是文字
$insert['patient']=$this->getSaveContent($data,'patient');
$insert['problem']=$this->getSaveContent($data,'problem');
$insert['diagnose']=$this->getSaveContent($data,'diagnose');
$photos=[];
if(!empty($data['photos'])){
$photosMedia=explode(',',$data['photos']);
foreach ($photosMedia as $k=>$v){
if(!empty($v)){
$photos[]=$this->upload_wx_pic_mul($v);
}
}
}
$insert['report']=implode(',',$photos);
$insert['addtime']=time();
$insert['delete_time']=0;
$model=new InquiryModel();
$model->adminAdd($insert);
$this->success('','',$insert);
}
/**
* 我要进修
*/
public function engage(){
... ...
<?php
// +----------------------------------------------------------------------
// | bronet [ 以客户为中心 以奋斗者为本 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.bronet.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Powerless < wzxaini9@gmail.com>
// +----------------------------------------------------------------------
namespace app\user\model;
use app\portal\model\PortalPostModel;
use think\Db;
use think\Model;
class TransferModel extends Model
{
protected $type = [
'clinical' => 'array',
'inspected' => 'array',
'diagnose' => 'array',
'used_drugs' => 'array',
'problem' => 'array'
];
/**
* 后台管理添加
* @param array $data 数据
* @return $this
*/
public function adminAdd($data){
$this->allowField(true)->data($data, true)->isUpdate(false)->save();
return $this;
}
/**
* 后台管理编辑
* @param array $data 数据
* @return $this
*/
public function adminEdit($data){
$this->allowField(true)->isUpdate(true)->data($data, true)->save();
return $this;
}
}
... ...
... ... @@ -544,7 +544,6 @@
//开始录音
var localId;
var timeLength;
$('.start').click(function () {
$('.start').hide()
$('.stop').hide()
... ... @@ -672,7 +671,6 @@
})
//上传图片
//上传图片
$(function () {
var tmpl = '<li class="weui-uploader__file" style="background-image:url(#url#)"></li>',
$gallery = $("#gallery"), $galleryImg = $("#galleryImg"),
... ... @@ -839,18 +837,6 @@
}
}
alert(JSON.stringify({
ill_id:ill_id,
expert_id:expert_id,
patient:tell,
patient_type:tell_type,
diagnose:diagnose,
diagnose_type:diagnose_type,
problem:puzzled,
problem_type:puzzled_type,
photos:serverIds
}));
/*提交后台*/
$.ajax({
url:"{:url('inqueryPost')}",
... ... @@ -877,149 +863,6 @@
})
})
//我要转诊表单判断
$('.referral_btn').click(function () {
var user_name = $('#user_name').val()
var user_sex = $('#user_sex').val()
var user_age = $('#user_age').val()
var user_address = $('#user_address').val()
var disease_type = $('#disease_type').val()
var expert = $('#expert').val()
var behavior = $('#behavior').val()
var examination = $('#examination').val()
var diagnosis = $('#diagnosis').val()
var drugs = $('#drugs').val()
var confused = $('#confused').val()
if (user_name == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('姓名不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (user_sex == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('性别不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (user_age == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('年龄不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (user_address == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('地址不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (disease_type == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('疾病种类不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (expert == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('转诊专家不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (behavior == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('临床表现不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (examination == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('已做检查不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (diagnosis == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('目前诊断不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (drugs == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('已用药物不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (confused == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('当前困惑不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else {
$('.box').show().delay(2000).hide(2)
}
})
//我要进修表单判断
$('.train_btn').click(function () {
var unit = $('#unit').val()
var user_name = $('#user_name').val()
var profession = $('#profession').val()
var duration = $('#duration').val()
var level = $('#level').val()
var card_num = $('#card_num').val()
var id_card = $('#id_card').val()
var nation = $('#nation').val()
var school = $('#school').val()
var principal = $('#principal').val()
var phone_num = $('#phone_num').val()
var unit_address = $('#unit_address').val()
var job_title = $('#job_title').val()
var need_info = $('#need_info').val()
if (unit == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('单位不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (user_name == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('姓名不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (profession == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('进修专业不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (duration == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('进修时长不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (level == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('文化程度不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (card_num == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('医师资格证号不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (id_card == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('身份证号不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (nation == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('民族不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (school == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('毕业学校不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (principal == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('科室负责人不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (phone_num == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('科室电话不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (unit_address == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('单位地址不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (job_title == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('当前职称不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (need_info == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('进修要求不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else {
$('.box').show().delay(2000).hide(2)
}
})
</script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -67,20 +67,20 @@
<div class="info_item">
<div class="title" data-id="1">
<text>临床表现</text>
<text class="iconfont icon-huatong voice_btn"></text>
<text class="iconfont icon-huatong voice_btn voice_btn1"></text>
<text class="iconfont icon-tianxie"></text>
</div>
<div class="textarea_box">
<textarea class="area" type="text" placeholder="请输入临床表现" maxlength="1000"
<textarea class="area textarea1" type="text" placeholder="请输入临床表现" maxlength="1000"
id="behavior"></textarea>
<p class="text_num"><span class="text-count">0</span>/1000</p>
</div>
<div class="voice_module" video-id="1">
<div id="voice_module1" class="voice_module" video-id="1">
<div class="voice_list" voiceitemid="1">
<div class="voice_box voice_third">
<div class="voice_item">
<text class="iconfont icon-luyin voice_icon"></text>
<text class="voice_font luyin">点击图标可播放 时长:10</text>
<text class="voice_font luyin">点击图标可播放 时长:<span class="timeLength">0</span></text>
</div>
<div class="voice_btn_box">
<text class="iconfont icon-quxiao cancle_voice"></text>
... ... @@ -103,32 +103,27 @@
<div class="info_item">
<div class="title" data-id="2">
<text>已做检查</text>
<text class="iconfont icon-huatong voice_btn"></text>
<text class="iconfont icon-huatong voice_btn voice_btn2"></text>
<text class="iconfont icon-tianxie"></text>
</div>
<div class="textarea_box">
<textarea class="area" type="text" placeholder="请输入你已做的检查 " maxlength="1000"
<textarea class="area textarea2" type="text" placeholder="请输入你已做的检查" maxlength="1000"
id="examination"></textarea>
<p class="text_num"><span class="text-count">0</span>/1000</p>
</div>
<div class="voice_module" video-id="2">
<div id="voice_module2" class="voice_module" video-id="2">
<div class="voice_list" voiceitemid="2">
<div class="voice_box voice_third">
<div class="voice_item">
<text class="iconfont icon-luyin voice_icon"></text>
<text class="voice_font luyin">点击图标可播放 时长:10</text>
<text class="voice_font luyin">点击图标可播放 时长:<span class="timeLength">0</span></text>
</div>
<div class="voice_btn_box">
<text class="iconfont icon-quxiao cancle_voice"></text>
<text class="iconfont icon-tianjia add_voice"></text>
</div>
</div>
<!--<div class="voice_box voice_second">-->
<!--<div class="voice_item">-->
<!--<text class="iconfont icon-luying_ongoing voice_icon"></text>-->
<!--<text class="voice_font luying_ongoing">正在播放 10秒/60秒</text>-->
<!--</div>-->
<!--</div>-->
<div class="voice_box voice_first">
<div class="voice_item">
<text class="iconfont icon-huatong mike voice_icon"></text>
... ... @@ -144,32 +139,27 @@
<div class="info_item">
<div class="title" data-id="3">
<text>目前诊断</text>
<text class="iconfont icon-huatong voice_btn"></text>
<text class="iconfont icon-huatong voice_btn voice_btn3"></text>
<text class="iconfont icon-tianxie"></text>
</div>
<div class="textarea_box">
<textarea class="area" type="text" placeholder="请输入目前诊断" maxlength="1000"
<textarea class="area textarea3" type="text" placeholder="请输入目前诊断" maxlength="1000"
id="diagnosis"></textarea>
<p class="text_num"><span class="text-count">0</span>/1000</p>
</div>
<div class="voice_module" video-id="3">
<div class="voice_list" voiceitemid="2">
<div id="voice_module3" class="voice_module" video-id="3">
<div class="voice_list" voiceitemid="3">
<div class="voice_box voice_third">
<div class="voice_item">
<text class="iconfont icon-luyin voice_icon"></text>
<text class="voice_font luyin">点击图标可播放 时长:10</text>
<text class="voice_font luyin">点击图标可播放 时长:<span class="timeLength">0</span></text>
</div>
<div class="voice_btn_box">
<text class="iconfont icon-quxiao cancle_voice"></text>
<text class="iconfont icon-tianjia add_voice"></text>
</div>
</div>
<!--<div class="voice_box voice_second">-->
<!--<div class="voice_item">-->
<!--<text class="iconfont icon-luying_ongoing voice_icon"></text>-->
<!--<text class="voice_font luying_ongoing">正在播放 10秒/60秒</text>-->
<!--</div>-->
<!--</div>-->
<div class="voice_box voice_first">
<div class="voice_item">
<text class="iconfont icon-huatong mike voice_icon"></text>
... ... @@ -185,31 +175,26 @@
<div class="info_item">
<div class="title" data-id="4">
<text>已用药物</text>
<text class="iconfont icon-huatong voice_btn"></text>
<text class="iconfont icon-huatong voice_btn voice_btn4"></text>
<text class="iconfont icon-tianxie"></text>
</div>
<div class="textarea_box">
<textarea class="area" type="text" placeholder="请输入已用药物" maxlength="1000" id="drugs"></textarea>
<textarea class="area textarea4" type="text" placeholder="请输入已用药物" maxlength="1000" id="drugs"></textarea>
<p class="text_num"><span class="text-count">0</span>/1000</p>
</div>
<div class="voice_module" video-id="4">
<div class="voice_list" voiceitemid="2">
<div id="voice_module4" class="voice_module" video-id="4">
<div class="voice_list" voiceitemid="4">
<div class="voice_box voice_third">
<div class="voice_item">
<text class="iconfont icon-luyin voice_icon"></text>
<text class="voice_font luyin">点击图标可播放 时长:10</text>
<text class="voice_font luyin">点击图标可播放 时长:<span class="timeLength">0</span></text>
</div>
<div class="voice_btn_box">
<text class="iconfont icon-quxiao cancle_voice"></text>
<text class="iconfont icon-tianjia add_voice"></text>
</div>
</div>
<!--<div class="voice_box voice_second">-->
<!--<div class="voice_item">-->
<!--<text class="iconfont icon-luying_ongoing voice_icon"></text>-->
<!--<text class="voice_font luying_ongoing">正在播放 10秒/60秒</text>-->
<!--</div>-->
<!--</div>-->
<div class="voice_box voice_first">
<div class="voice_item">
<text class="iconfont icon-huatong mike voice_icon"></text>
... ... @@ -225,32 +210,27 @@
<div class="info_item">
<div class="title" data-id="5">
<text>当前困惑</text>
<text class="iconfont icon-huatong voice_btn"></text>
<text class="iconfont icon-huatong voice_btn voice_btn5"></text>
<text class="iconfont icon-tianxie"></text>
</div>
<div class="textarea_box">
<textarea class="area" type="text" placeholder="请输入你的困惑" maxlength="1000"
<textarea class="area textarea5" type="text" placeholder="请输入你的困惑" maxlength="1000"
id="confused"></textarea>
<p class="text_num"><span class="text-count">0</span>/1000</p>
</div>
<div class="voice_module" video-id="5">
<div class="voice_list" voiceitemid="2">
<div id="voice_module5" class="voice_module" video-id="5">
<div class="voice_list" voiceitemid="5">
<div class="voice_box voice_third">
<div class="voice_item">
<text class="iconfont icon-luyin voice_icon"></text>
<text class="voice_font luyin">点击图标可播放 时长:10</text>
<text class="voice_font luyin">点击图标可播放 时长:<span class="timeLength">0</span></text>
</div>
<div class="voice_btn_box">
<text class="iconfont icon-quxiao cancle_voice"></text>
<text class="iconfont icon-tianjia add_voice"></text>
</div>
</div>
<!--<div class="voice_box voice_second">-->
<!--<div class="voice_item">-->
<!--<text class="iconfont icon-luying_ongoing voice_icon"></text>-->
<!--<text class="voice_font luying_ongoing">正在播放 10秒/60秒</text>-->
<!--</div>-->
<!--</div>-->
<div class="voice_box voice_first">
<div class="voice_item">
<text class="iconfont icon-huatong mike voice_icon"></text>
... ... @@ -267,14 +247,14 @@
</div>
<div>
<div class="weui-uploader__hd">
<p class="title">报告单(最多上传30张)</p>
<p class="title">报告单(最多上传9张)</p>
</div>
<div class="weui-uploader__bd">
<ul class="weui-uploader__files" id="uploaderFiles">
</ul>
<div class="weui-uploader__input-box">
<input id="uploaderInput" class="weui-uploader__input" type="file" accept="image/*"
multiple/>
<div class="weui-uploader__input-box addpic">
<!--<input id="uploaderInput" class="weui-uploader__input" type="file" accept="image/*"-->
<!--multiple/>-->
</div>
</div>
</div>
... ... @@ -288,8 +268,8 @@
<!--弹窗-->
<div class="box" hidden>
<div class="public_popup_box">
<text>您已签到成功!</text>
<text>恭喜您获得10个积分</text>
<text>提交成功!</text>
<text>等待专家回复</text>
</div>
</div>
... ... @@ -367,6 +347,7 @@
<!--<script src="__TMPL__/public/assets/js/referral.js"></script>-->
<script>
var serverIds = '';
//文本框显示字数
$(".area").on("input propertychange", function () {
... ... @@ -466,11 +447,10 @@
//点击
$('.info_item').on('click', '.title', function () {
$('.info_item').on('click','.title',function () {
$(this).parent().toggleClass('voice')
})
//点击正在播放按钮
$('.icon-luying_ongoing').click(function () {
var videolist = $(".voice_module");
... ... @@ -484,10 +464,10 @@
}
})
var times = "";//倒计时总秒数量
var time = "";
//倒计时
var times = "60";//倒计时总秒数量
var time="";
var timeLength=0;
function countDown(times) {
var timer = null;
timer = setInterval(function () {
... ... @@ -509,9 +489,10 @@
$('#hour_show').html('<text id="h"></text>' + hour + ':');
$('#minute_show').html('<text></text>' + minute + ':');
$('#second_show').html('<text></text>' + second + '');
$('#second_test').html('<text></text>' + second + '');
//
console.log(day + "天:" + hour + "小时:" + minute + "分钟:" + second + "秒");
// console.log(day + "天:" + hour + "小时:" + minute + "分钟:" + second + "秒");
times--;
}, 1000);
... ... @@ -522,56 +503,36 @@
$('.pause').click(function () {
// timer(intDiff);
clearInterval(timer);
localStorage.setItem("times", times)
localStorage.setItem("times",times)
})
$('.stop').click(function () {
clearInterval(timer);
times = 0;
times=0;
})
$('.stopping').click(function () {
clearInterval(timer);
timeLength=60-times;
console.log('录音时长:'+timeLength);
localStorage.clear()
})
}
$('.start').click(function () {
time = localStorage.getItem("times")
if (time == null) {
time=localStorage.getItem("times")
if(time==null){
times = parseInt(60)
} else {
times = time;
}else{
times=time;
}
console.log(time)
// myTimer(intDiff);
countDown(times);
localStorage.setItem("times", times)
localStorage.setItem("times",times)
})
//添加一条新语音
var num = 0;
var num = 1;
$('.voice_module').on('click', '.add_voice', function () {
// $('.voice_module').append($('.voice_list').html());
// $('.voice_list .voice_first').show()
// $('.add_icon').show()
// var parent = $(this).parents('.voice_module')
// parent.append($('.temp_list').clone());
// var videolist = $(".voice_module");
// for (var i = 0; i < videolist.length; i++) {
//
// var videoid = $(videolist[i]).attr("video-id");
// if (videoid == title_id) {
// $(videolist[i]).show();
// $(videolist[i]).append($('.voice_list').html());
// $(videolist[i]).children('.voice_list .voice_first').show();
// $('.icon_cancle').show()
// }
// }
times = 60
times=60
// clearInterval(timer);
var day = 0,
hour = 0,
... ... @@ -585,15 +546,15 @@
$('#hour_show').html('<text id="h"></text>' + hour + ':');
$('#minute_show').html('<text></text>' + minute + ':');
$('#second_show').html('<text></text>' + second + '');
$('#second_test').html(60);
num = num + 1
var parent = $(this).parents('.voice_module')
var html = '<div class="voice_list" voiceitemid="' + num + '">\n' +
var html = '<div class="voice_list" voiceitemid="'+num+'">\n' +
'<div class="voice_box voice_third" style="display: none;">\n' +
' <div class="voice_item">\n' +
' <text class="iconfont icon-luyin voice_icon"></text>\n' +
' <text class="voice_font luyin">点击图标可播放 时长:10秒</text>\n' +
' <text class="voice_font luyin">点击图标可播放 时长:<span class="timeLength">0</span>秒</text>\n' +
' </div>\n' +
' <div class="voice_btn_box">\n' +
' <text class="iconfont icon-quxiao cancle_voice"></text>\n' +
... ... @@ -618,7 +579,7 @@
})
//显示弹窗
var videoid = ''
var videoid=''
//生命全局唯一 音频
var voiceBox;
$(document).on("click", ".mike", function () {
... ... @@ -628,23 +589,48 @@
$('.stopping').hide()
$('.stop').hide()
$('.next_step').hide();
// videoid=$(this).parents(".voice_module").attr("video-id")
// $(this).parents(".voice_first").hide();
// $(this).parents(".voice_first").siblings(".voice_third").show()
//
// // vioceid=$(this).parents(".voice_first").attr("voiceid");
//
voiceBox = $(this).parents('.voice_list');
// console.log(voiceBox)
// $('.submit_voice').attr('videoid')
//
// var videolist = $(".voice_module");
// console.log(videolist)
// for (var i = 0; i < videolist.length; i++) {
// if (videoid == title_id) {
// $(videolist[i]).children(".voice_list").children(".voice_list").hide();
// $(videolist[i]).children(".voice_list").children(".voice_third").show();
// }
// }
});
//删除语音
$(".voice_module").on("click", ".cancle_voice", function () {
$(".voice_module").on("click",".cancle_voice",function(){
$(this).parents(".voice_box").remove();
})
//开始录音
var localId;
$('.start').click(function () {
$('.start').hide()
$('.stop').hide()
$('.play').hide()
$('.pause').show()
$('.stopping').show()
$('.next_step').hide()
/*微信开始录音*/
wx.startRecord();
})
//暂停
... ... @@ -660,58 +646,108 @@
$('.next_step').show()
$('.stop').show()
$('.pause').hide()
wx.stopRecord({
success: function (res) {
localId = res.localId;
}
});
})
//下一步
$('.next_step').click(function () {
$('.first').hide()
$('.second').show()
})
//点击试听
$('.audition').click(function () {
// var videolist = $(".voice_module");
// for (var i = 0; i < videolist.length; i++) {
// var videoid = $(videolist[i]).attr("video-id");
// if (videoid == title_id) {
// $('.second').hide()
// $(videolist[i]).show();
// $(videolist[i]).children('.voice_list').hide()
// $(videolist[i]).children('.voice_third').show();
// }
// }
wx.onVoicePlayEnd({
success: function (res) {
var localId = res.localId; // 返回音频的本地ID
}
});
wx.playVoice({
localId:localId //需要播放的音频的本地ID,由stopRecord接口获得
});
var videolist = $(".voice_module");
for (var i = 0; i < videolist.length; i++) {
var videoid = $(videolist[i]).attr("video-id");
if (videoid == title_id) {
$('.second').hide()
$(videolist[i]).show();
$(videolist[i]).children('.voice_list').hide()
$(videolist[i]).children('.voice_third').show();
}
}
})
// 列表中点击试听
$('.voice_third').click(
function () {
var tryId=$(this).attr('try-id');
wx.playVoice({
localId:tryId
});
}
)
//我要发送
$('.submit_voice').click(function () {
// var videolist = $(".voice_module");
// console.log(videolist,videolist.length)
// for (var i = 0; i<videolist.length; i++) {
// videoid = $(videolist[i]).attr("video-id");
// if (videoid == title_id) {
// $('.second').hide()
// $(videolist[i]).children(".voice_list").children('.voice_first').hide()
// $(videolist[i]).children(".voice_list").children('.voice_third').show();
// }
// }
voiceBox.find('.voice_first').hide().siblings('.voice_third').show()
wx.uploadVoice({localId: localId, // 需要上传的音频的本地ID,由stopRecord接口获得
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function (res) {
voiceBox.find('.voice_first').hide().siblings('.voice_third').attr('data-serverid',res.serverId);
}
});
voiceBox.find('.voice_first').hide().siblings('.voice_third').attr('data-try',localId);
voiceBox.find('.voice_first').hide().siblings('.voice_third').attr('data-time',timeLength);
voiceBox.find('.timeLength').html(timeLength);
$('.second').hide()
})
//确认音频
$('.upload').click(function () {
var videolist = $(".voice_module");
for (var i = 0; i < videolist.length; i++) {
var videoid = $(videolist[i]).attr("video-id");
if (videoid == title_id) {
$('.second').hide()
$(videolist[i]).show();
$(videolist[i]).children('.voice_list').hide()
$(videolist[i]).children('.voice_third').show();
/*上面放上 音频id和本地地址*/
$(videolist[i]).children('.voice_third').attr('try-id',localId);
$(videolist[i]).children('.voice_third').data('data-try',localId);
$(videolist[i]).children('.voice_third').attr('id','audio'+videoid);
wx.uploadVoice({
localId: localId, // 需要上传的音频的本地ID,由stopRecord接口获得
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function (res) {
var serverId = res.serverId; // 返回音频的服务器端ID
$(videolist[i]).children('.voice_third').attr('server-id',serverId);
$(videolist[i]).children('.voice_third').data('data-server',serverId);
localId='';
}
});
}
}
})
//重新录制
$('.rerecord').click(function () {
$('#second_test').html(60);
$('.first').show()
$('.second').hide()
$('.stop').hide()
$('.stopping').hide()
$('.start').show()
$('.start').show()
})
//上传图片
$(function () {
var tmpl = '<li class="weui-uploader__file" style="background-image:url(#url#)"></li>',
... ... @@ -719,17 +755,13 @@
$uploaderInput = $("#uploaderInput"),
$uploaderFiles = $("#uploaderFiles")
;
$uploaderInput.on("change", function (e) {
// console.log(e)
var src, url = window.URL || window.webkitURL || window.mozURL, files = e.target.files;
for (var i = 0, len = files.length; i < len; ++i) {
var file = files[i];
console.log(url.createObjectURL(file))
if (url) {
src = url.createObjectURL(file);
// var
} else {
src = e.target.result;
}
... ... @@ -745,10 +777,255 @@
});
});
//上传图片
$('.addpic').on('click', function (res) {
var length = $('.length').length;
if (length >= 9) {
weui.toast('不能上传了')
$('#addpic').hide();
return false;
}
wx.chooseImage({
count: 9 - length, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
console.log(res.localIds);
for (var i = 0; i < res.localIds.length; i++) {
// $('.addpic').before('<img style="width:100px;height:100px;" class="length" src="'+res.localIds[i]+'"/>')
$('.addpic').before('<li class="weui-uploader__file length" src="' + res.localIds[i] + '" style="background-image:url(' + res.localIds[i] + ')"></li>')
}
uploadImages(res.localIds)// 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
}
});
})
function uploadImages(localIds) {
var localId = localIds.pop();
wx.uploadImage({
localId: localId,
isShowProgressTips: 1,
success: function (res) {
var serverId = res.serverId; // 返回图片的服务器端ID
console.log(serverId);
serverIds += serverId + ',';
if (localIds.length > 0) {
uploadImages(localIds);
}
},
fail: function (res) {
$modal.toast(JSON.stringify(res));
}
});
}
//提交按钮
// $('.submit').click(function () {
// $('.box').show().delay(2000).hide(2)
// })
$('.submit').click(function () {
var user_name = $('#user_name').val();
var user_sex = $('#user_sex').val();
var user_age = $('#user_age').val();
var user_address = $('#user_address').val();
if (user_name == '') {
$('.form_popup_box').show();
$('.form_popup_box').text('姓名不能为空');
$('.form_popup_box').delay(1000).hide(0);
return false;
} else if (user_sex == '') {
$('.form_popup_box').show();
$('.form_popup_box').text('性别不能为空');
$('.form_popup_box').delay(1000).hide(0);
return false;
} else if (user_age == '') {
$('.form_popup_box').show();
$('.form_popup_box').text('年龄不能为空');
$('.form_popup_box').delay(1000).hide(0);
return false;
} else if (user_address == '') {
$('.form_popup_box').show();
$('.form_popup_box').text('地址不能为空');
$('.form_popup_box').delay(1000).hide(0);
return false;
}
/*获取疾病分类*/
var ill_id=$('.inquiry_value').data('data-id');
if(!ill_id){
weui.toast('疾病分类不能为空!');
return;
}
/*获取问诊专家*/
var expert_id=$('.expert_value').data('data-id');
if(!expert_id){
weui.toast('问诊专家不能为空!');
return;
}
/*获取病人主诉*/
var display1=$('.voice_btn1').css('display');
//console.log(display1);
if (display1=='none'){
var clinical='';
/*判断发送类型*/
var clinical_type='1';
$('#voice_module1 .voice_third').each(function () {
/*拼接信息*/
var voiceId1=$(this).attr('data-serverid');
if (voiceId1!=undefined){
if (clinical==''){
clinical=voiceId1;
}else{
clinical+=','+voiceId1;
}
}
})
}else{
var clinical=$('.textarea1').val();
var clinical_type='2';
if (!clinical){
weui.toast('临床表现不能为空!');
return;
}
}
/*获取病人主诉*/
var display2=$('.voice_btn2').css('display');
//console.log(display1);
if (display2=='none'){
var inspected='';
/*判断发送类型*/
var inspected_type='1';
$('#voice_module2 .voice_third').each(function () {
/*拼接信息*/
var voiceId1=$(this).attr('data-serverid');
if (voiceId1!=undefined){
if (inspected==''){
inspected=voiceId1;
}else{
inspected+=','+voiceId1;
}
}
})
}else{
var inspected=$('.textarea1').val();
var inspected_type='2';
if (!inspected){
weui.toast('已做检查不能为空!')
return;
}
}
/*获取目前诊断*/
var display3=$('.voice_btn3').css('display');
if (display3=='none'){
var diagnose_type='1';
var diagnose='';
$('#voice_module3 .voice_third').each(function () {
var voiceId1=$(this).attr('data-serverid');
console.log(voiceId1);
if (voiceId1!=undefined){
if (diagnose==''){
diagnose=voiceId1;
}else{
diagnose+=','+voiceId1;
}
}
})
}else{
var diagnose=$('.textarea3').val();
var diagnose_type='2';
if (!diagnose){
weui.toast('目前诊断不能为空!')
return;
}
}
/*获取已用药物*/
var display4=$('.voice_btn4').css('display');
if (display4=='none'){
var used_drugs_type='1';
var used_drugs='';
$('#voice_module4 .voice_third').each(function () {
var voiceId1=$(this).attr('data-serverid');
console.log(voiceId1);
if (voiceId1!=undefined){
if (used_drugs==''){
used_drugs=voiceId1;
}else{
used_drugs+=','+voiceId1;
}
}
})
}else{
var used_drugs=$('.textarea3').val();
var used_drugs_type='2';
if (!used_drugs){
weui.toast('已用药物不能为空!')
return;
}
}
/*获取你的困惑*/
var display5=$('.voice_btn2').css('display');
//console.log(display2);
if (display5=='none'){
var problem_type='1';
var problem='';
$('#voice_module5 .voice_third').each(function () {
var voiceId1=$(this).attr('data-serverid');
console.log(voiceId1);
if (voiceId1!=undefined){
if (problem==''){
problem=voiceId1;
}else{
problem+=','+voiceId1;
}
}
})
}else{
var problem=$('.textarea5').val();
var problem_type='5';
if (!problem){
weui.toast('当前困惑不能为空!')
return;
}
}
/*提交后台*/
$.ajax({
url:"{:url('transferPost')}",
type:'POST',
data:{
name:user_name,
sex:user_sex,
age:user_age,
address:user_address,
ill_id:ill_id,
expert_id:expert_id,
clinical:clinical,
clinical_type:clinical_type,
inspected:inspected,
inspected_type:inspected_type,
diagnose:diagnose,
diagnose_type:diagnose_type,
used_drugs:used_drugs,
used_drugs_type:used_drugs_type,
problem:problem,
problem_type:problem_type,
photos:serverIds
},
success:function (res) {
console.log(res);
alert(res);
$('.box').show().delay(2000).hide(2)
},
error:function (res) {
alert(res);
}
})
})
//我要转诊表单判断
$('.referral_btn').click(function () {
... ... @@ -813,84 +1090,6 @@
}
})
//我要进修表单判断
$('.train_btn').click(function () {
var unit = $('#unit').val()
var user_name = $('#user_name').val()
var profession = $('#profession').val()
var duration = $('#duration').val()
var level = $('#level').val()
var card_num = $('#card_num').val()
var id_card = $('#id_card').val()
var nation = $('#nation').val()
var school = $('#school').val()
var principal = $('#principal').val()
var phone_num = $('#phone_num').val()
var unit_address = $('#unit_address').val()
var job_title = $('#job_title').val()
var need_info = $('#need_info').val()
if (unit == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('单位不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (user_name == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('姓名不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (profession == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('进修专业不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (duration == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('进修时长不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (level == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('文化程度不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (card_num == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('医师资格证号不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (id_card == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('身份证号不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (nation == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('民族不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (school == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('毕业学校不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (principal == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('科室负责人不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (phone_num == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('科室电话不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (unit_address == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('单位地址不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (job_title == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('当前职称不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (need_info == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('进修要求不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else {
$('.box').show().delay(2000).hide(2)
}
})
</script>
</body>
</html>
\ No newline at end of file
... ...