From a156aa256050d3ee1d9204a9fab1d0072bbfbe12 Mon Sep 17 00:00:00 2001 From: liuxiaoyan <lxy@bronet.cn> Date: Thu, 10 Jan 2019 10:17:50 +0800 Subject: [PATCH] 测试 --- public/themes/simpleboot3/portal/inquiry/index.html | 3 +-- public/themes/simpleboot3/user/index/inquiry.html | 475 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 2 files changed, 284 insertions(+), 194 deletions(-) diff --git a/public/themes/simpleboot3/portal/inquiry/index.html b/public/themes/simpleboot3/portal/inquiry/index.html index 029bcc9..93351af 100644 --- a/public/themes/simpleboot3/portal/inquiry/index.html +++ b/public/themes/simpleboot3/portal/inquiry/index.html @@ -248,7 +248,7 @@ } ) }) - // 疾病分类下拉 + // 问诊专家下拉 $('.expert').click(function () { var doctor = new Array() var platment_id = $('.inquiry_value').data('data-id'); @@ -561,7 +561,6 @@ $('.submit_voice').click(function () { voiceBox.find('.voice_first').hide().siblings('.voice_third').show() $('.second').hide() - }) //重新录制 diff --git a/public/themes/simpleboot3/user/index/inquiry.html b/public/themes/simpleboot3/user/index/inquiry.html index 7fc7c81..b35c1d5 100644 --- a/public/themes/simpleboot3/user/index/inquiry.html +++ b/public/themes/simpleboot3/user/index/inquiry.html @@ -40,7 +40,7 @@ <div class="hint_info">提示:您可以选择推荐专家,平台会为您匹配对应专家;您也可以 选择其他专家。 </div> - <div class="info_item " > + <div class="info_item "> <div class="title" data-id="1"> <text>病人主述</text> <!--<text class="info_tab_box">--> @@ -53,7 +53,7 @@ <p class="text_num"><span class="text-count">0</span>/1000</p> </div> <div class="voice_module" video-id="1"> - <div class="voice_box voice_third" > + <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> @@ -64,10 +64,10 @@ </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 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_list"> <div class="voice_box voice_first"> @@ -104,10 +104,10 @@ </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 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_list"> <div class="voice_box voice_first"> @@ -174,7 +174,7 @@ <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=""> + <img class="popup_icon" src="__TMPL__/public/assets/images/eicon10@2x.png" alt=""> <div>下一步</div> </div> </div> @@ -194,8 +194,8 @@ <img class="popup_icon " src="__TMPL__/public/assets/images/eicon15@2x.png" alt=""> <div>重新录制</div> </div> - <div class="large_icon"> - <img class="popup_icon upload" src="__TMPL__/public/assets/images/eicon16@2x.png" alt=""> + <div class="large_icon submit_voice"> + <img class="popup_icon " src="__TMPL__/public/assets/images/eicon16@2x.png" alt=""> <div>我要发送</div> </div> </div> @@ -229,26 +229,32 @@ $this.val(_val.substring(0, 1000)); } count = 1000 - $this.val().length; - $(".text-count").text(count); + $(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) - } + < 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 () { @@ -331,26 +337,17 @@ //点击 $('.title').click(function () { title_id = $(this).attr("data-id"); - - // 第一步点击语音按钮 if ($(this).children(".voice_btn").css("display") == "inline") { $(this).children(".voice_btn").css("display", "none"); $(this).children(".icon-tianxie").css("display", "inline") $(this).parents('.info_item').children('.textarea_box').hide() - $(this).parents('.info_item').children('.voice_module').children('.voice_box').show() - $(this).parents('.info_item').children('.voice_module').children('.videoitem').show() + $(this).parents('.info_item').find('.voice_first').show() } else if ($(this).children(".icon-tianxie").css("display") == "inline") { - $(this).children(".voice_btn").css("display","inline"); - $(this).children(".icon-tianxie").css("display","none") + $(this).children(".voice_btn").css("display", "inline"); + $(this).children(".icon-tianxie").css("display", "none") $(this).parents('.info_item').children('.textarea_box').show() - $(this).parents('.info_item').children('.voice_module').children('.voice_box').hide() - $(this).parents('.info_item').children('.voice_module').children('.videoitem').hide() + $(this).parents('.info_item').find('.voice_first').hide() } - // $(this).next().show(); - // $('.textarea_box').hide() - // $('.voice_btn').hide() - // $('.icon-tianxie').show() - // $('.voice_first').show() }) //点击正在播放按钮 @@ -363,40 +360,117 @@ $(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); + $('.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 - $('.add_voice').click(function () { - num=num+1 + 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="videoitem" voiceitemid="'+num+'">\n' + - '<div class="voice_list">\n' + - ' <div class="voice_box voice_first" voiceid="'+num+'">\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>\n' + - '\n' + - '\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 icon_cancle cancle_voice"></text>\n' + - ' </div>\n' + - ' </div>\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' + + ' </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) + }) //删除语音 @@ -404,45 +478,55 @@ $(this).parents('.voice_third').remove() }); - $(".voice_module").on("click",".cancle_voice",function(){ - $(this).parents(".voice_list").remove(); + $(".voice_module").on("click", ".cancle_voice", function () { + $(this).parents(".voice_list").remove(); $(this).parents(".voice_third").remove(); }) //第二步开始 - var vioceid="" + var vioceid = "" + + + //显示弹窗 - $(document).on("click", ".mike",function () { + var voiceBox; + $(document).on("click", ".mike", function () { $('.first').show() $('.play').show() + $('.start').show() $('.stopping').hide() - vioceid=$(this).parents(".voice_first").attr("voiceid"); - - //点击试听 - $('.audition').click(function () { - wx.onVoicePlayEnd({ - success: function (res) { - var localId = res.localId; // 返回音频的本地ID - } - }); - - wx.playVoice({ - localId:localId //需要播放的音频的本地ID,由stopRecord接口获得 - }); - - var videolist = $(".videoitem"); - for (var i = 0; i < videolist.length; i++) { - var videoid = $(videolist[i]).attr("voiceitemid"); - if (videoid == vioceid) { - $(videolist[i]).children(".voice_list").hide(); - $(videolist[i]).children(".voice_third").show(); - } - } + $('.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 () { @@ -471,7 +555,7 @@ $('.pause').hide() wx.stopRecord({ success: function (res) { - localId = res.localId; + localId = res.localId; } }); }) @@ -491,7 +575,7 @@ } }); wx.playVoice({ - localId:localId //需要播放的音频的本地ID,由stopRecord接口获得 + localId: localId //需要播放的音频的本地ID,由stopRecord接口获得 }); var videolist = $(".voice_module"); @@ -508,42 +592,48 @@ //列表中点击试听 - $('.voice_third').click( - function () { - var tryId=$(this).attr('try-id'); - wx.playVoice({ - localId:tryId - }); - } - ) - - //确认音频 - $('.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); - } - }); - } + $('.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() @@ -728,68 +818,69 @@ } }) </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--;--> + + <!--}, 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 -- libgit2 0.24.0