作者 杨育虎

转诊待答语音调试

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<title>转诊模块</title>
<script src="__TMPL__/public/assets/js/fontsize.js"></script>
<link rel="stylesheet" href="__TMPL__/public/assets/css/init.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/swiper-3.4.2.min.css">
<link rel="stylesheet" href="http://at.alicdn.com/t/font_793738_tlxymah92x.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/weui.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/myweui.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/referralModule.css">
</head>
<body STYLE="background: #F5F6FA">
<div class="container">
<div class="tab_content_box top">
<div class="tab_info">转诊基本信息</div>
<div class="tab_content">
<div class="content_item">
<div class="tab_title">临床表现</div>
<div class="tab_textarea">
<textarea readonly>临床表现内容临床表现内容临床表现内容</textarea>
</div>
</div>
<div class="content_item">
<div class="tab_title">已做检查</div>
<div class="tab_textarea">
<textarea>已做检查内容已做检查内容已做检查内容</textarea>
</div>
</div>
<div class="content_item">
<div class="tab_title">已用药物</div>
<div class="tab_textarea">
<textarea readonly>xx药物、xx药物、xx药物</textarea>
</div>
</div>
<div class="content_item">
<div class="tab_title">当前困惑</div>
<div class="tab_textarea">
<textarea readonly>当前困惑内容当前困惑内容当前困惑内容</textarea>
</div>
</div>
<div class="content_item">
<div class="tab_title">咨询时间</div>
<div>2018.08.30 18:00:00</div>
</div>
</div>
</div>
<div class="tab_content_box">
<div class="tab_info">转诊基本信息</div>
<div class="user_info_box">
<div class="head_box"><img src="../images/chead@2x.png" alt=""></div>
<div>
<div>姓名:赵梓明</div>
<div>电话:13626495215</div>
<div>医院:中心医院.</div>
<div>科室:急诊室</div>
</div>
</div>
</div>
<div class="tab_content_box">
<div class="tab_info">
<text class="tab_title">若您对转诊信息不明确,请点击发起提问</text>
<text class="iconfont icon-icon02 add_problem"></text>
</div>
</div>
<!--提问内容部分-->
<div class="tab_content_box info_item">
<div class="tab_info inquiry_content title">
<text>提问</text>
<text class="iconfont icon-huatong voice_btn"></text>
<text class="iconfont icon-tianxie"></text>
</div>
<div class="textarea_content">
<textarea class="area" type="text" placeholder="请输入" maxlength="1000"></textarea>
<p class="text_num num_box"><span class="text-count">0</span>/1000</p>
</div>
<div class="voice_module agree_box" 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>
</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_first" voiceid="1">
<div class="voice_item">
<text class="iconfont icon-huatong mike voice_icon"></text>
<text class="voice_font huatong">点击图标开始语音语音最长60秒</text>
</div>
<div class="voice_btn_box">
<text class="iconfont icon-quxiao icon_cancle"></text>
</div>
</div>
</div>
</div>
</div>
<!--转诊意见内容部分-->
<div class="tab_content_box info_item">
<div class="tab_info inquiry_content title">
<text>转诊意见</text>
<text class="iconfont icon-huatong voice_btn"></text>
<text class="iconfont icon-tianxie"></text>
</div>
<div class="textarea_content">
<textarea class="area" type="text" placeholder="请输入" maxlength="1000"></textarea>
<p class="text_num num_box"><span class="text-count">0</span>/1000</p>
</div>
<div class="voice_module agree_box" 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>
</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_first" voiceid="1">
<div class="voice_item">
<text class="iconfont icon-huatong mike voice_icon"></text>
<text class="voice_font huatong">点击图标开始语音语音最长60秒</text>
</div>
<div class="voice_btn_box">
<text class="iconfont icon-quxiao icon_cancle"></text>
</div>
</div>
</div>
</div>
</div>
<!--专家提问显示内容-->
<div class="tab_content_box">
<div class="tab_info">
<text>专家提问</text>
</div>
<div class="user_info_box">
专家提问内容专家提问内容专家提问内容专家提问内容
专家提问内容专家提问内容专家提问内容专家提问内容
专家提问内容专家提问内容
</div>
</div>
<!--回复专家的内容-->
<div class="tab_content_box">
<div class="tab_info">
<text>回答</text>
</div>
<div class="user_info_box">
用户回复专家提问的内容回复专家提问的内容回复专家
提问回复专家提问的内容回复专家提问的内容回复专家
提问回复专家提问的内容的内容的内容
</div>
</div>
<!--同意转诊须填表单-->
<div class="tab_content_box">
<div class="tab_content">
<div class="content_item">
<div class="tab_title">接诊信息(同意转诊时需要填写此表单)</div>
<div class="info_box">
<div class="info_item">
<div class="title">接诊医院</div>
<div class="info_input"><input type="text" placeholder="请填写接诊医院"></div>
</div>
<div class="info_item">
<div class="title">转诊专家</div>
<div class="info_input"><input type="text" placeholder="请填写接诊医院"></div>
</div>
<div class="info_item">
<div class="title">接诊地点</div>
<div class="info_input"><input type="text" placeholder="请填写接诊医院"></div>
</div>
<div class="info_item" id="showDatePicker">
<div class="title">就诊时间</div>
<div class="info_input"><input class="time_value" type="text" placeholder="请填写接诊医院">
<text class="iconfont icon-xiala"></text>
</div>
</div>
</div>
</div>
</div>
</div>
<!--确认回复按钮-->
<div class="agree_btn submit">确认回复</div>
<!---->
<div class="bottom_box">
<div class="agree_btn">同意</div>
<div class="bottom_btn">驳回</div>
</div>
</div>
<div class="mask_box" hidden>
<div class="referral_popup_box">
<div>确认驳回</div>
<div class="referral_info">确定驳回转诊吗?</div>
<div class="referral_btn_box">
<div class="btn cancel_btn">取消</div>
<div class="btn confirm_btn">确认</div>
</div>
</div>
</div>
<!--录音弹窗-->
<div class="mask_box first" hidden>
<div class="popup_box">
<div class="popup_title">录制语音</div>
<div class="popup_time">
<div class="time-item">
<!--<span id="day_show">0天</span>-->
<strong id="hour_show">
<text id="h"></text>
00:</strong>
<strong id="minute_show">
<text></text>
01:</strong>
<strong id="second_show">
<text></text>
00</strong>
</div>
<div class="popup_info">还可以录制 <span id="second_test">5</span></div>
</div>
<div class="popup_btn_box">
<div class="popup_item start">
<img class="popup_icon" src="__TMPL__/public/assets/images/eicon09@2x.png" alt="">
<div>开始</div>
</div>
<div class="popup_item pause" hidden>
<img class="popup_icon" src="__TMPL__/public/assets/images/eicon13@2x.png" alt="">
<div>暂停</div>
</div>
<div class="popup_item stop" hidden>
<img class="popup_icon" src="__TMPL__/public/assets/images/eicon14@2x.png" alt="">
<div>已停止</div>
</div>
<div class="popup_center play start">
<img class="" src="__TMPL__/public/assets/images/eicon11@2x.png" alt="">
</div>
<div class="popup_center stopping" hidden>
<img class="" src="__TMPL__/public/assets/images/eicon12@2x.png" alt="">
</div>
<div class="popup_item next_step">
<img class="popup_icon" src="__TMPL__/public/assets/images/eicon10@2x.png" alt="">
<div>下一步</div>
</div>
</div>
</div>
</div>
<!---->
<div class="mask_box second" hidden>
<div class="popup_box">
<div class="popup_title">录制语音</div>
<div class="popup_time">
<div class="popup_btn audition">点击试听</div>
<!--<div class="popup_info">时长:4分58秒</div>-->
</div>
<div class="popup_btn_box">
<div class="large_icon rerecord">
<img class="popup_icon " src="__TMPL__/public/assets/images/eicon15@2x.png" alt="">
<div>重新录制</div>
</div>
<div class="large_icon submit_voice">
<img class="popup_icon upload" src="__TMPL__/public/assets/images/eicon16@2x.png" alt="">
<div>我要发送</div>
</div>
</div>
</div>
</div>
<script src="__TMPL__/public/assets/js/jquery-2.1.0.js"></script>
<script src="__TMPL__/public/assets/js/weui.js"></script>
<script src="__TMPL__/public/assets/js/myweui.js"></script>
<!--<script src="__TMPL__/public/assets/js/referral.js"></script>-->
<script>
//文本框显示字数
$(".area").on("input propertychange", function () {
var $this = $(this),
_val = $this.val(),
count = "";
if (_val.length > 1000) {
$this.val(_val.substring(0, 1000));
}
count = 1000 - $this.val().length;
$(this).siblings(".text_num").children('.text-count').text(count);
});
// 疾病分类下拉
$('.inquiry_type').click(function () {
weui.picker([
{label: '一类', value: 0},
{label: '二类', value: 1}
], {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('.inquiry_value').val(res[0].label)
}
}
)
})
// 疾病分类下拉
$('.expert').click(function () {
weui.picker([
{label: '王医生', value: 0},
{label: '刘易斯', value: 1}
], {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('.expert_value').val(res[0].label)
}
}
)
})
// 性别分类
$('.sex_type').click(function () {
weui.picker([
{label: '男', value: 0},
{label: '女', value: 1}
], {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('.sex_value').val(res[0].label)
}
}
)
})
// 性别分类
$('.unit_type').click(function () {
weui.picker([
{label: '国企', value: 0},
{label: '私企', value: 1}
], {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('.unit_value').val(res[0].label)
}
}
)
})
//就诊时间
$('#showDatePicker').on('click', function () {
weui.datePicker({
start: 2019,
end: new Date().getFullYear(),
onChange: function (result) {
console.log(result);
},
onConfirm: function (result) {
console.log(result[0].label+' - '+result[1].label+' - '+result[2].label)
$('.time_value').val(result[0].value+' - '+result[1].value+' - '+result[2].value)
}
});
});
//语音模块
// $('.icon-tianxie').hide()
// $('.voice_first').hide()
// $('.voice_second').hide()
$('.voice_third').hide()
$('.icon_cancle').hide()
// $('.voice_module').hide()
var title_id = ''
//点击
$('.info_item').on('click','.title',function () {
$(this).parent().toggleClass('voice')
})
//点击正在播放按钮
$('.icon-luying_ongoing').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) {
$(videolist[i]).show();
$(videolist[i]).children('.voice_second').hide()
$(videolist[i]).children('.voice_third').show();
}
}
})
var times = "";//倒计时总秒数量
var time = "";
function countDown(times) {
var timer = null;
timer = setInterval(function () {
var day = 0,
hour = 0,
minute = 0,
second = 0;//时间默认值
if (times > 0) {
day = Math.floor(times / (60 * 60 * 24));
hour = Math.floor(times / (60 * 60)) - (day * 24);
minute = Math.floor(times / 60) - (day * 24 * 60) - (hour * 60);
second = Math.floor(times) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
}
if (day <= 9) day = '0' + day;
if (hour <= 9) hour = '0' + hour;
if (minute <= 9) minute = '0' + minute;
if (second <= 9) second = '0' + second;
$('#hour_show').html('<text id="h"></text>' + hour + ':');
$('#minute_show').html('<text></text>' + minute + ':');
$('#second_show').html('<text></text>' + second + '');
//
console.log(day + "天:" + hour + "小时:" + minute + "分钟:" + second + "秒");
times--;
}, 1000);
// if (times <= 0) {
// clearInterval(timer);
// }
$('.pause').click(function () {
// timer(intDiff);
clearInterval(timer);
localStorage.setItem("times", times)
})
$('.stop').click(function () {
clearInterval(timer);
times = 0;
})
$('.stopping').click(function () {
clearInterval(timer);
localStorage.clear()
})
}
$('.start').click(function () {
time = localStorage.getItem("times")
if (time == null) {
times = parseInt(60)
} else {
times = time;
}
console.log(time)
countDown(times);
localStorage.setItem("times", times)
})
//添加一条新语音
var num = 0;
$('.voice_module').on('click', '.add_voice', function () {
times=60
// clearInterval(timer);
var day = 0,
hour = 0,
minute = 0,
second = 0;//时间默认值
if (day <= 9) day = '0' + day;
if (hour <= 9) hour = '0' + hour;
if (minute <= 9) minute = '0' + minute;
if (second <= 9) second = '0' + second;
$('#hour_show').html('<text id="h"></text>' + hour + ':');
$('#minute_show').html('<text></text>' + minute + ':');
$('#second_show').html('<text></text>' + second + '');
num = num + 1
var parent = $(this).parents('.voice_module')
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' +
' </div>\n' +
' <div class="voice_btn_box">\n' +
' <text class="iconfont icon-quxiao cancle_voice"></text>\n' +
// ' <text class="iconfont icon-tianjia add_voice"></text>\n' +
' </div>\n' +
' </div>\n' +
' <div class="voice_box voice_first">\n' +
' <div class="voice_item">\n' +
' <text class="iconfont icon-huatong mike voice_icon"></text>\n' +
' <text class="voice_font huatong">点击图标开始语音语音最长60秒</text>\n' +
' </div>\n' +
' <div class="voice_btn_box">\n' +
' <text class="iconfont icon-quxiao icon_cancle cancle_voice"></text>\n' +
' </div>\n' +
' </div>\n' +
'</div>'
// parent.append($('.voice_list').html());
parent.append(html)
})
//显示弹窗
var videoid=''
//生命全局唯一 音频
var voiceBox;
$(document).on("click", ".mike", function () {
$('.first').show()
$('.play').show()
$('.start').show()
$('.stopping').hide()
$('.stop').hide()
$('.next_step').hide();
voiceBox = $(this).parents('.voice_list');
});
//删除语音
$(".voice_module").on("click",".cancle_voice",function(){
$(this).parents(".voice_box").remove();
})
//开始录音
$('.start').click(function () {
$('.start').hide()
$('.play').hide()
$('.pause').show()
$('.stopping').show()
$('.next_step').hide()
})
//暂停
$('.pause').click(function () {
$('.pause').hide()
$('.start').show()
$('.stopping').hide()
})
//停止录音
$('.stopping').click(function () {
$('.next_step').show()
$('.stop').show()
$('.pause').hide()
})
//下一步
$('.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();
// }
// }
})
//我要发送
$('.submit_voice').click(function () {
voiceBox.find('.voice_first').hide().siblings('.voice_third').show()
$('.second').hide()
})
//重新录制
$('.rerecord').click(function () {
$('.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>',
$gallery = $("#gallery"), $galleryImg = $("#galleryImg"),
$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;
}
$uploaderFiles.append($(tmpl.replace('#url#', src)));
}
});
$uploaderFiles.on("click", "li", function () {
$galleryImg.attr("style", this.getAttribute("style"));
$gallery.fadeIn(100);
});
$gallery.on("click", function () {
$gallery.fadeOut(100);
});
});
</script>
</body>
</html>
\ No newline at end of file