作者 刘晓艳

测试

... ... @@ -132,7 +132,6 @@
</div>
</div>
<!--录音弹窗-->
<div class="mask_box first" hidden>
<div class="popup_box">
... ... @@ -783,68 +782,68 @@
}
})
</script>
<script type="text/javascript">
var times = "60";//倒计时总秒数量
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 + '');
$('#second_test').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)
// myTimer(intDiff);
countDown(times);
localStorage.setItem("times",times)
})
</script>
<!--<script type="text/javascript">-->
<!--var times = "60";//倒计时总秒数量-->
<!--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 + '');-->
<!--$('#second_test').html('<text></text>' + second + '');-->
<!--//-->
<!--// console.log(day + "天:" + hour + "小时:" + minute + "分钟:" + second + "秒");-->
<!--times&#45;&#45;;-->
<!--}, 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)-->
<!--// myTimer(intDiff);-->
<!--countDown(times);-->
<!--localStorage.setItem("times",times)-->
<!--})-->
<!--</script>-->
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -293,60 +293,60 @@
<!--录音弹窗-->
<div class="mask_box first" hidden="" style="display: none;">
<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>
<strong id="hour_show">00 :</strong>
<strong id="minute_show">00 :</strong>
<strong id="second_show">00</strong>
</div>
<div class="popup_info">还可以录制 <span id="second_test"><text></text>00</span></div>
<div class="popup_info">还可以录制 <span>5</span></div>
</div>
<div class="popup_btn_box">
<div class="popup_item start " style="display: none;">
<img class="popup_icon" src="/themes/simpleboot3/public/assets/images/eicon09@2x.png" alt="">
<div class="popup_item start ">
<img class="popup_icon" src="../images/eicon09@2x.png" alt="">
<div>开始</div>
</div>
<div class="popup_item pause" hidden="" style="display: none;">
<img class="popup_icon" src="/themes/simpleboot3/public/assets/images/eicon13@2x.png" alt="">
<div class="popup_item pause" hidden>
<img class="popup_icon" src="../images/eicon13@2x.png" alt="">
<div>暂停</div>
</div>
<div class="popup_item stop" hidden="" style="display: block;">
<img class="popup_icon" src="/themes/simpleboot3/public/assets/images/eicon14@2x.png" alt="">
<div class="popup_item stop" hidden>
<img class="popup_icon" src="../images/eicon14@2x.png" alt="">
<div>已停止</div>
</div>
<div class="popup_center play start" style="display: none;">
<img class="" src="/themes/simpleboot3/public/assets/images/eicon11@2x.png" alt="">
<div class="popup_center play start">
<img class="" src="../images/eicon11@2x.png" alt="">
</div>
<div class="popup_center stopping" hidden="" style="display: block;">
<img class="" src="/themes/simpleboot3/public/assets/images/eicon12@2x.png" alt="">
<div class="popup_center stopping" hidden>
<img class="" src="../images/eicon12@2x.png" alt="">
</div>
<div class="popup_item next_step" style="display: block;">
<img class="popup_icon" src="/themes/simpleboot3/public/assets/images/eicon10@2x.png" alt="">
<div class="popup_item next_step">
<img class="popup_icon" src="../images/eicon10@2x.png" alt="">
<div>下一步</div>
</div>
</div>
</div>
</div>
<!---->
<div class="mask_box second" hidden="" style="display: none;">
<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 class="popup_info">时长:4分58秒</div>
</div>
<div class="popup_btn_box">
<div class="large_icon rerecord">
<img class="popup_icon " src="/themes/simpleboot3/public/assets/images/eicon15@2x.png" alt="">
<img class="popup_icon " src="../images/eicon15@2x.png" alt="">
<div>重新录制</div>
</div>
<div class="large_icon submit_voice">
<img class="popup_icon" src="/themes/simpleboot3/public/assets/images/eicon16@2x.png" alt="">
<img class="popup_icon" src="../images/eicon16@2x.png" alt="">
<div>我要发送</div>
</div>
</div>
... ... @@ -358,6 +358,581 @@
<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 type="application/javascript">
//文本框显示字数
wx.config({$sdk});
$(".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([
<volist name='platment' id='vo'>
{label: '{$vo.name}', value: {$vo.id}},
</volist>
], {
onChange: function (res) {
$('.expert_value').val('')
$('.expert_value').data('data-id','')
},
onConfirm: function (res) {
$('.inquiry_value').val(res[0].label)
$('.inquiry_value').data('data-id',res[0].value)
}
}
)
})
// 疾病分类下拉
$('.expert').click(function () {
var doctor = new Array()
var platment_id = $('.inquiry_value').data('data-id');
if (!platment_id) {
alert('请先选择疾病分类!');
return;
}
$.ajax({
url: '{:url('getExportByPlatment')}',
data: {
platment_id: platment_id
},
type: 'POST',
success: function (res) {
console.log(res);
for (key in res.data) {
var info = new Object();
info.label = res.data[key].user_login;
info.value = res.data[key].id;
doctor[key] = info
}
console.log(doctor);
var doctor1 = new Array();
weui.picker(doctor, {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('.expert_value').val(res[0].label)
$('.expert_value').data('data-id', res[0].value)
}
}
)
}
})
})
// 性别分类
$('.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)
}
}
)
})
var title_id = ''
//语音模块
// $('.icon-tianxie').hide()
// $('.voice_first').hide()
// $('.voice_second').hide()
$('.voice_third').hide()
$('.icon_cancle').hide()
//点击
$('.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 = "60";//倒计时总秒数量
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 + '');
$('#second_test').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)
// myTimer(intDiff);
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();
// 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(){
$(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();
})
//暂停
$('.pause').click(function () {
$('.pause').hide()
$('.start').show()
$('.stopping').hide()
})
//停止录音
$('.stopping').click(function () {
$('.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 () {
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 () {
voiceBox.find('.voice_first').hide().siblings('.voice_third').show()
$('.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);
// }
// });
// }
// }
// })
//重新录制
$('.rerecord').click(function () {
$('.first').show()
$('.second').hide()
$('.stop').hide()
$('.stopping').hide()
$('.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) {
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];
if (url) {
src = url.createObjectURL(file);
} 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);
});
});
//提交按钮
// $('.submit').click(function () {
// $('.box').show().delay(2000).hide(2)
// })
//我要转诊表单判断
$('.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>
<script>
//文本框显示字数
$(".area").on("input propertychange", function () {
... ...