作者 杨育虎
1 个管道 的构建 通过 耗费 1 秒

转诊待答语音调试

@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <head> 3 <head>
4 <meta charset="UTF-8"> 4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no"> 5 <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
6 - <title>诊待答</title> 6 + <title>诊待答</title>
7 <script src="__TMPL__/public/assets/js/fontsize.js"></script> 7 <script src="__TMPL__/public/assets/js/fontsize.js"></script>
8 <link rel="stylesheet" href="__TMPL__/public/assets/css/init.css"> 8 <link rel="stylesheet" href="__TMPL__/public/assets/css/init.css">
9 <link rel="stylesheet" href="__TMPL__/public/assets/css/swiper-3.4.2.min.css"> 9 <link rel="stylesheet" href="__TMPL__/public/assets/css/swiper-3.4.2.min.css">
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
15 .voice_box{ 15 .voice_box{
16 width: 100%; 16 width: 100%;
17 } 17 }
  18 + .question_yes,.question_yes1{display: none;}
18 </style> 19 </style>
19 </head> 20 </head>
20 <body STYLE="background: #F5F6FA"> 21 <body STYLE="background: #F5F6FA">
@@ -23,10 +24,10 @@ @@ -23,10 +24,10 @@
23 <div class="tab_info">转诊基本信息</div> 24 <div class="tab_info">转诊基本信息</div>
24 <div class="tab_content"> 25 <div class="tab_content">
25 <div class="content_item"> 26 <div class="content_item">
26 - <div class="tab_title">病人主述</div>  
27 - <eq name="info.patient.type" value="1"> 27 + <div class="tab_title">临床表现</div>
  28 + <eq name="info.clinical.type" value="1">
28 <div class="voice_box" > 29 <div class="voice_box" >
29 - <foreach name="info.patient.dir" item="item"> 30 + <foreach name="info.clinical.dir" item="item">
30 <div class="voice_item"> 31 <div class="voice_item">
31 <text class="iconfont icon-luyin voice_icon voice_play" data-url="{$item}"></text> 32 <text class="iconfont icon-luyin voice_icon voice_play" data-url="{$item}"></text>
32 <text class="iconfont icon-luying_ongoing voice_icon voice_puse"></text> 33 <text class="iconfont icon-luying_ongoing voice_icon voice_puse"></text>
@@ -36,15 +37,34 @@ @@ -36,15 +37,34 @@
36 </div> 37 </div>
37 <else/> 38 <else/>
38 <div class="tab_textarea"> 39 <div class="tab_textarea">
39 - <textarea readonly>{$info.patient.content}</textarea> 40 + <textarea readonly>{$info.clinical.content}</textarea>
  41 + </div>
  42 + </eq>
  43 + </div>
  44 +
  45 + <div class="content_item">
  46 + <div class="tab_title">已做检查</div>
  47 + <eq name="info.inspected.type" value="1">
  48 + <div class="voice_box" >
  49 + <foreach name="info.inspected.dir" item="item">
  50 + <div class="voice_item">
  51 + <text class="iconfont icon-luyin voice_icon voice_play" data-url="{$item}"></text>
  52 + <text class="iconfont icon-luying_ongoing voice_icon voice_puse"></text>
  53 + <text class="voice_font">点击图标开始播放</text>
  54 + </div>
  55 + </foreach>
  56 + </div>
  57 + <else/>
  58 + <div class="tab_textarea">
  59 + <textarea readonly>{$info.inspected.content}</textarea>
40 </div> 60 </div>
41 </eq> 61 </eq>
42 </div> 62 </div>
43 <div class="content_item"> 63 <div class="content_item">
44 - <div class="tab_title">初步诊断</div>  
45 - <eq name="info.diagnose.type" value="1"> 64 + <div class="tab_title">已用药物</div>
  65 + <eq name="info.used_drugs.type" value="1">
46 <div class="voice_box" > 66 <div class="voice_box" >
47 - <foreach name="info.diagnose.dir" item="item"> 67 + <foreach name="info.used_drugs.dir" item="item">
48 <div class="voice_item"> 68 <div class="voice_item">
49 <text class="iconfont icon-luyin voice_icon voice_play" data-url="{$item}"></text> 69 <text class="iconfont icon-luyin voice_icon voice_play" data-url="{$item}"></text>
50 <text class="iconfont icon-luying_ongoing voice_icon voice_puse"></text> 70 <text class="iconfont icon-luying_ongoing voice_icon voice_puse"></text>
@@ -54,7 +74,7 @@ @@ -54,7 +74,7 @@
54 </div> 74 </div>
55 <else/> 75 <else/>
56 <div class="tab_textarea"> 76 <div class="tab_textarea">
57 - <textarea readonly>{$info.diagnose.content}</textarea> 77 + <textarea readonly>{$info.used_drugs.content}</textarea>
58 </div> 78 </div>
59 </eq> 79 </eq>
60 </div> 80 </div>
@@ -84,7 +104,7 @@ @@ -84,7 +104,7 @@
84 </div> 104 </div>
85 </div> 105 </div>
86 <div class="tab_content_box"> 106 <div class="tab_content_box">
87 - <div class="tab_info">问诊人基本信息</div> 107 + <div class="tab_info">转诊基本信息</div>
88 <div class="user_info_box title_info" style="justify-content: normal"> 108 <div class="user_info_box title_info" style="justify-content: normal">
89 <div class="head_box"><img src="{$info.avatar}" alt=""></div> 109 <div class="head_box"><img src="{$info.avatar}" alt=""></div>
90 <div> 110 <div>
@@ -95,15 +115,17 @@ @@ -95,15 +115,17 @@
95 </div> 115 </div>
96 </div> 116 </div>
97 </div> 117 </div>
98 - <div class="tab_content_box">  
99 - <div class="tab_info title_info">  
100 - <text class="tab_title">若您对转诊信息不明确,请点击发起提问</text>  
101 - <text class="iconfont icon-icon02 add_problem"></text> 118 + <empty name="info.reply">
  119 + <div class="tab_content_box">
  120 + <div class="tab_info title_info" id="is_have_question" data-id="1">
  121 + <text class="tab_title">若您对转诊信息不明确,请点击发起提问</text>
  122 + <text class="iconfont icon-icon02 add_problem"></text>
  123 + </div>
102 </div> 124 </div>
103 - </div> 125 + </empty>
104 126
105 <!--提问内容部分--> 127 <!--提问内容部分-->
106 - <div class="tab_content_box info_item"> 128 + <div class="tab_content_box info_item question_yes">
107 <div class="tab_info inquiry_content title"> 129 <div class="tab_info inquiry_content title">
108 <text>提问</text> 130 <text>提问</text>
109 <text class="iconfont icon-huatong voice_btn"></text> 131 <text class="iconfont icon-huatong voice_btn"></text>
@@ -118,7 +140,7 @@ @@ -118,7 +140,7 @@
118 <div class="voice_box voice_third"> 140 <div class="voice_box voice_third">
119 <div class="voice_item"> 141 <div class="voice_item">
120 <text class="iconfont icon-luyin voice_icon"></text> 142 <text class="iconfont icon-luyin voice_icon"></text>
121 - <text class="voice_font luyin">点击图标可播放 时长:10</text> 143 + <text class="voice_font luyin">点击图标可播放 时长:<span class="timeLength">0</span></text>
122 </div> 144 </div>
123 <div class="voice_btn_box"> 145 <div class="voice_btn_box">
124 <text class="iconfont icon-quxiao cancle_voice"></text> 146 <text class="iconfont icon-quxiao cancle_voice"></text>
@@ -139,29 +161,29 @@ @@ -139,29 +161,29 @@
139 </div> 161 </div>
140 162
141 <!--转诊意见内容部分--> 163 <!--转诊意见内容部分-->
142 - <div class="tab_content_box info_item"> 164 + <div class="tab_content_box info_item question_no">
143 <div class="tab_info inquiry_content title"> 165 <div class="tab_info inquiry_content title">
144 <text>转诊意见</text> 166 <text>转诊意见</text>
145 - <text class="iconfont icon-huatong voice_btn"></text> 167 + <text class="iconfont icon-huatong voice_btn voice_btn2"></text>
146 <text class="iconfont icon-tianxie"></text> 168 <text class="iconfont icon-tianxie"></text>
147 </div> 169 </div>
148 <div class="textarea_content"> 170 <div class="textarea_content">
149 - <textarea class="area" type="text" placeholder="请输入" maxlength="1000"></textarea> 171 + <textarea class="area textarea2" type="text" placeholder="请输入" maxlength="1000"></textarea>
150 <p class="text_num num_box"><span class="text-count">0</span>/1000</p> 172 <p class="text_num num_box"><span class="text-count">0</span>/1000</p>
151 </div> 173 </div>
152 - <div class="voice_module agree_box" video-id="1">  
153 - <div class="voice_list" voiceitemid="1"> 174 + <div id="voice_module2" class="voice_module agree_box" video-id="2">
  175 + <div class="voice_list" voiceitemid="2">
154 <div class="voice_box voice_third"> 176 <div class="voice_box voice_third">
155 <div class="voice_item"> 177 <div class="voice_item">
156 <text class="iconfont icon-luyin voice_icon"></text> 178 <text class="iconfont icon-luyin voice_icon"></text>
157 - <text class="voice_font luyin">点击图标可播放 时长:10</text> 179 + <text class="voice_font luyin">点击图标可播放 时长:<span class="timeLength">0</span></text>
158 </div> 180 </div>
159 <div class="voice_btn_box"> 181 <div class="voice_btn_box">
160 <text class="iconfont icon-quxiao cancle_voice"></text> 182 <text class="iconfont icon-quxiao cancle_voice"></text>
161 <text class="iconfont icon-tianjia add_voice"></text> 183 <text class="iconfont icon-tianjia add_voice"></text>
162 </div> 184 </div>
163 </div> 185 </div>
164 - <div class="voice_box voice_first" voiceid="1"> 186 + <div class="voice_box voice_first" voiceid="2">
165 <div class="voice_item"> 187 <div class="voice_item">
166 <text class="iconfont icon-huatong mike voice_icon"></text> 188 <text class="iconfont icon-huatong mike voice_icon"></text>
167 <text class="voice_font huatong">点击图标开始语音语音最长60秒</text> 189 <text class="voice_font huatong">点击图标开始语音语音最长60秒</text>
@@ -174,32 +196,30 @@ @@ -174,32 +196,30 @@
174 </div> 196 </div>
175 </div> 197 </div>
176 198
177 -  
178 - <!--专家提问显示内容-->  
179 - <div class="tab_content_box">  
180 - <div class="tab_info">  
181 - <text>专家提问</text>  
182 - </div>  
183 - <div class="user_info_box">  
184 - 专家提问内容专家提问内容专家提问内容专家提问内容  
185 - 专家提问内容专家提问内容专家提问内容专家提问内容  
186 - 专家提问内容专家提问内容  
187 - </div>  
188 - </div>  
189 - <!--回复专家的内容-->  
190 - <div class="tab_content_box">  
191 - <div class="tab_info">  
192 - <text>回答</text> 199 + <notempty name="info.reply">
  200 + <!--专家提问显示内容-->
  201 + <div class="tab_content_box">
  202 + <div class="tab_info">
  203 + <text>专家提问</text>
  204 + </div>
  205 + <div class="user_info_box">
  206 + {$info.reply}
  207 + </div>
193 </div> 208 </div>
194 - <div class="user_info_box">  
195 - 用户回复专家提问的内容回复专家提问的内容回复专家  
196 - 提问回复专家提问的内容回复专家提问的内容回复专家  
197 - 提问回复专家提问的内容的内容的内容 209 + <!--回复专家的内容-->
  210 + <div class="tab_content_box">
  211 + <div class="tab_info">
  212 + <text>回答</text>
  213 + </div>
  214 + <div class="user_info_box">
  215 + {$info.problem_again|default='尚未回答'}
  216 + </div>
198 </div> 217 </div>
199 - </div> 218 + </notempty>
  219 +
200 220
201 <!--同意转诊须填表单--> 221 <!--同意转诊须填表单-->
202 - <div class="tab_content_box"> 222 + <div class="tab_content_box question_no">
203 <div class="tab_content"> 223 <div class="tab_content">
204 <div class="content_item"> 224 <div class="content_item">
205 <div class="tab_title">接诊信息(同意转诊时需要填写此表单)</div> 225 <div class="tab_title">接诊信息(同意转诊时需要填写此表单)</div>
@@ -226,12 +246,11 @@ @@ -226,12 +246,11 @@
226 </div> 246 </div>
227 </div> 247 </div>
228 </div> 248 </div>
229 -  
230 - 249 +
231 <!--确认回复按钮--> 250 <!--确认回复按钮-->
232 - <div class="agree_btn submit">确认回复</div> 251 + <div class="agree_btn submit question_yes1">确认回复</div>
233 <!----> 252 <!---->
234 - <div class="bottom_box"> 253 + <div class="bottom_box question_no">
235 <div class="agree_btn">同意</div> 254 <div class="agree_btn">同意</div>
236 <div class="bottom_btn">驳回</div> 255 <div class="bottom_btn">驳回</div>
237 </div> 256 </div>
@@ -317,9 +336,10 @@ @@ -317,9 +336,10 @@
317 <script src="__TMPL__/public/assets/js/jquery-2.1.0.js"></script> 336 <script src="__TMPL__/public/assets/js/jquery-2.1.0.js"></script>
318 <script src="__TMPL__/public/assets/js/weui.js"></script> 337 <script src="__TMPL__/public/assets/js/weui.js"></script>
319 <script src="__TMPL__/public/assets/js/myweui.js"></script> 338 <script src="__TMPL__/public/assets/js/myweui.js"></script>
  339 +<script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
320 <!--<script src="__TMPL__/public/assets/js/referral.js"></script>--> 340 <!--<script src="__TMPL__/public/assets/js/referral.js"></script>-->
321 <script> 341 <script>
322 - 342 + wx.config({$sdk});
323 //文本框显示字数 343 //文本框显示字数
324 $(".area").on("input propertychange", function () { 344 $(".area").on("input propertychange", function () {
325 345
@@ -333,99 +353,11 @@ @@ -333,99 +353,11 @@
333 $(this).siblings(".text_num").children('.text-count').text(count); 353 $(this).siblings(".text_num").children('.text-count').text(count);
334 }); 354 });
335 355
336 - // 疾病分类下拉  
337 - $('.inquiry_type').click(function () {  
338 - weui.picker([  
339 - {label: '一类', value: 0},  
340 - {label: '二类', value: 1}  
341 - ], {  
342 - onChange: function (res) {  
343 - console.log(res)  
344 - },  
345 - onConfirm: function (res) {  
346 - $('.inquiry_value').val(res[0].label)  
347 - }  
348 - }  
349 - )  
350 - })  
351 - // 疾病分类下拉  
352 - $('.expert').click(function () {  
353 - weui.picker([  
354 - {label: '王医生', value: 0},  
355 - {label: '刘易斯', value: 1}  
356 - ], {  
357 - onChange: function (res) {  
358 - console.log(res)  
359 - },  
360 - onConfirm: function (res) {  
361 - $('.expert_value').val(res[0].label)  
362 - }  
363 - }  
364 - )  
365 - })  
366 - // 性别分类  
367 - $('.sex_type').click(function () {  
368 - weui.picker([  
369 - {label: '男', value: 0},  
370 - {label: '女', value: 1}  
371 - ], {  
372 - onChange: function (res) {  
373 - console.log(res)  
374 - },  
375 - onConfirm: function (res) {  
376 - $('.sex_value').val(res[0].label)  
377 - }  
378 - }  
379 - )  
380 - })  
381 - // 性别分类  
382 - $('.unit_type').click(function () {  
383 - weui.picker([  
384 - {label: '国企', value: 0},  
385 - {label: '私企', value: 1}  
386 - ], {  
387 - onChange: function (res) {  
388 - console.log(res)  
389 - },  
390 - onConfirm: function (res) {  
391 - $('.unit_value').val(res[0].label)  
392 - }  
393 - }  
394 - )  
395 - })  
396 - //就诊时间  
397 - $('#showDatePicker').on('click', function () {  
398 - weui.datePicker({  
399 - start: 2019,  
400 - end: new Date().getFullYear(),  
401 - onChange: function (result) {  
402 - console.log(result);  
403 - },  
404 - onConfirm: function (result) {  
405 - console.log(result[0].label+' - '+result[1].label+' - '+result[2].label)  
406 - $('.time_value').val(result[0].value+' - '+result[1].value+' - '+result[2].value)  
407 - }  
408 - });  
409 - });  
410 -  
411 -  
412 -  
413 - //语音模块  
414 - // $('.icon-tianxie').hide()  
415 - // $('.voice_first').hide()  
416 - // $('.voice_second').hide()  
417 - $('.voice_third').hide()  
418 - $('.icon_cancle').hide()  
419 - // $('.voice_module').hide()  
420 -  
421 - var title_id = ''  
422 -  
423 //点击 356 //点击
424 $('.info_item').on('click','.title',function () { 357 $('.info_item').on('click','.title',function () {
425 $(this).parent().toggleClass('voice') 358 $(this).parent().toggleClass('voice')
426 }) 359 })
427 360
428 -  
429 //点击正在播放按钮 361 //点击正在播放按钮
430 $('.icon-luying_ongoing').click(function () { 362 $('.icon-luying_ongoing').click(function () {
431 var videolist = $(".voice_module"); 363 var videolist = $(".voice_module");
@@ -439,10 +371,10 @@ @@ -439,10 +371,10 @@
439 } 371 }
440 }) 372 })
441 373
442 -  
443 - var times = "";//倒计时总秒数量  
444 - var time = "";  
445 - 374 + //倒计时
  375 + var times = "60";//倒计时总秒数量
  376 + var time="";
  377 + var timeLength=0;
446 function countDown(times) { 378 function countDown(times) {
447 var timer = null; 379 var timer = null;
448 timer = setInterval(function () { 380 timer = setInterval(function () {
@@ -464,9 +396,10 @@ @@ -464,9 +396,10 @@
464 $('#hour_show').html('<text id="h"></text>' + hour + ':'); 396 $('#hour_show').html('<text id="h"></text>' + hour + ':');
465 $('#minute_show').html('<text></text>' + minute + ':'); 397 $('#minute_show').html('<text></text>' + minute + ':');
466 $('#second_show').html('<text></text>' + second + ''); 398 $('#second_show').html('<text></text>' + second + '');
  399 + $('#second_test').html('<text></text>' + second + '');
467 400
468 // 401 //
469 - console.log(day + "天:" + hour + "小时:" + minute + "分钟:" + second + "秒"); 402 + // console.log(day + "天:" + hour + "小时:" + minute + "分钟:" + second + "秒");
470 times--; 403 times--;
471 404
472 }, 1000); 405 }, 1000);
@@ -477,31 +410,32 @@ @@ -477,31 +410,32 @@
477 $('.pause').click(function () { 410 $('.pause').click(function () {
478 // timer(intDiff); 411 // timer(intDiff);
479 clearInterval(timer); 412 clearInterval(timer);
480 - localStorage.setItem("times", times) 413 + localStorage.setItem("times",times)
481 }) 414 })
482 $('.stop').click(function () { 415 $('.stop').click(function () {
483 clearInterval(timer); 416 clearInterval(timer);
484 - times = 0; 417 + times=0;
485 }) 418 })
486 $('.stopping').click(function () { 419 $('.stopping').click(function () {
487 clearInterval(timer); 420 clearInterval(timer);
  421 + timeLength=60-times;
  422 + console.log('录音时长:'+timeLength);
488 localStorage.clear() 423 localStorage.clear()
489 }) 424 })
490 } 425 }
491 -  
492 $('.start').click(function () { 426 $('.start').click(function () {
493 - time = localStorage.getItem("times")  
494 - if (time == null) { 427 + time=localStorage.getItem("times")
  428 + if(time==null){
495 times = parseInt(60) 429 times = parseInt(60)
496 - } else {  
497 - times = time; 430 + }else{
  431 + times=time;
498 } 432 }
499 console.log(time) 433 console.log(time)
  434 + // myTimer(intDiff);
500 countDown(times); 435 countDown(times);
501 - localStorage.setItem("times", times) 436 + localStorage.setItem("times",times)
502 }) 437 })
503 438
504 -  
505 //添加一条新语音 439 //添加一条新语音
506 var num = 1; 440 var num = 1;
507 $('.voice_module').on('click', '.add_voice', function () { 441 $('.voice_module').on('click', '.add_voice', function () {
@@ -544,6 +478,9 @@ @@ -544,6 +478,9 @@
544 ' </div>\n' + 478 ' </div>\n' +
545 ' </div>\n' + 479 ' </div>\n' +
546 '</div>' 480 '</div>'
  481 +
  482 +
  483 + // parent.append($('.voice_list').html());
547 parent.append(html) 484 parent.append(html)
548 485
549 }) 486 })
@@ -589,12 +526,16 @@ @@ -589,12 +526,16 @@
589 }) 526 })
590 527
591 //开始录音 528 //开始录音
  529 + var localId;
592 $('.start').click(function () { 530 $('.start').click(function () {
593 $('.start').hide() 531 $('.start').hide()
  532 + $('.stop').hide()
594 $('.play').hide() 533 $('.play').hide()
595 $('.pause').show() 534 $('.pause').show()
596 $('.stopping').show() 535 $('.stopping').show()
597 $('.next_step').hide() 536 $('.next_step').hide()
  537 + /*微信开始录音*/
  538 + wx.startRecord();
598 }) 539 })
599 540
600 //暂停 541 //暂停
@@ -602,61 +543,134 @@ @@ -602,61 +543,134 @@
602 $('.pause').hide() 543 $('.pause').hide()
603 $('.start').show() 544 $('.start').show()
604 $('.stopping').hide() 545 $('.stopping').hide()
605 - })  
606 546
607 - //播放语音  
608 - $('.voice_puse').hide()  
609 - //var mySound = new Audio('http://suzhou.w.bronet.cn/upload/admin/20181217/a22c54f3354951b1d612569a126480a5.mp3');  
610 - $('.voice_play').click(function () {  
611 - var url=$(this).data('url');  
612 - var mySound = new Audio(url);  
613 - mySound.play();  
614 - $(this).hide()  
615 - $(this).siblings('.voice_puse').show()  
616 -  
617 - $('.voice_puse').click(function () {  
618 - mySound.pause();  
619 - $(this).hide()  
620 - $(this).siblings('.voice_play').show()  
621 - })  
622 }) 547 })
623 548
624 -  
625 -  
626 //停止录音 549 //停止录音
627 $('.stopping').click(function () { 550 $('.stopping').click(function () {
628 $('.next_step').show() 551 $('.next_step').show()
629 $('.stop').show() 552 $('.stop').show()
630 $('.pause').hide() 553 $('.pause').hide()
  554 + wx.stopRecord({
  555 + success: function (res) {
  556 + localId = res.localId;
  557 + }
  558 +
  559 + });
631 }) 560 })
632 561
633 //下一步 562 //下一步
634 $('.next_step').click(function () { 563 $('.next_step').click(function () {
635 $('.first').hide() 564 $('.first').hide()
636 $('.second').show() 565 $('.second').show()
  566 +
637 }) 567 })
638 568
639 //点击试听 569 //点击试听
640 $('.audition').click(function () { 570 $('.audition').click(function () {
  571 + wx.onVoicePlayEnd({
  572 + success: function (res) {
  573 + var localId = res.localId; // 返回音频的本地ID
  574 + }
  575 + });
  576 + wx.playVoice({
  577 + localId:localId //需要播放的音频的本地ID,由stopRecord接口获得
  578 + });
641 579
  580 + var videolist = $(".voice_module");
  581 + for (var i = 0; i < videolist.length; i++) {
  582 + var videoid = $(videolist[i]).attr("video-id");
  583 + if (videoid == title_id) {
  584 + $('.second').hide()
  585 + $(videolist[i]).show();
  586 + $(videolist[i]).children('.voice_list').hide()
  587 + $(videolist[i]).children('.voice_third').show();
  588 + }
  589 + }
642 }) 590 })
643 591
  592 + // 列表中点击试听
  593 + $('.voice_third').click(
  594 + function () {
  595 + var tryId=$(this).attr('try-id');
  596 + wx.playVoice({
  597 + localId:tryId
  598 + });
  599 + }
  600 + )
  601 +
  602 + //就诊时间
  603 + $('#showDatePicker').on('click', function () {
  604 + weui.datePicker({
  605 + start: 2019,
  606 + end: new Date().getFullYear(),
  607 + onChange: function (result) {
  608 + console.log(result);
  609 + },
  610 + onConfirm: function (result) {
  611 + console.log(result[0].label+' - '+result[1].label+' - '+result[2].label)
  612 + $('.time_value').val(result[0].value+' - '+result[1].value+' - '+result[2].value)
  613 + }
  614 + });
  615 + });
  616 +
  617 + //语音模块
  618 + $('.voice_third').hide()
  619 + $('.icon_cancle').hide()
  620 +
  621 + var title_id = ''
644 622
645 //我要发送 623 //我要发送
646 $('.submit_voice').click(function () { 624 $('.submit_voice').click(function () {
647 voiceBox.find('.voice_first').hide().siblings('.voice_third').show() 625 voiceBox.find('.voice_first').hide().siblings('.voice_third').show()
  626 + wx.uploadVoice({localId: localId, // 需要上传的音频的本地ID,由stopRecord接口获得
  627 + isShowProgressTips: 1, // 默认为1,显示进度提示
  628 + success: function (res) {
  629 + voiceBox.find('.voice_first').hide().siblings('.voice_third').attr('data-serverid',res.serverId);
  630 + }
  631 + });
  632 + voiceBox.find('.voice_first').hide().siblings('.voice_third').attr('data-try',localId);
  633 + voiceBox.find('.voice_first').hide().siblings('.voice_third').attr('data-time',timeLength);
  634 + voiceBox.find('.timeLength').html(timeLength);
648 $('.second').hide() 635 $('.second').hide()
  636 + })
649 637
  638 + //确认音频
  639 + $('.upload').click(function () {
  640 + var videolist = $(".voice_module");
  641 + for (var i = 0; i < videolist.length; i++) {
  642 + var videoid = $(videolist[i]).attr("video-id");
  643 + if (videoid == title_id) {
  644 + $('.second').hide()
  645 + $(videolist[i]).show();
  646 + $(videolist[i]).children('.voice_list').hide()
  647 + $(videolist[i]).children('.voice_third').show();
  648 + /*上面放上 音频id和本地地址*/
  649 + $(videolist[i]).children('.voice_third').attr('try-id',localId);
  650 + $(videolist[i]).children('.voice_third').data('data-try',localId);
  651 + $(videolist[i]).children('.voice_third').attr('id','audio'+videoid);
  652 + wx.uploadVoice({
  653 + localId: localId, // 需要上传的音频的本地ID,由stopRecord接口获得
  654 + isShowProgressTips: 1, // 默认为1,显示进度提示
  655 + success: function (res) {
  656 + var serverId = res.serverId; // 返回音频的服务器端ID
  657 + $(videolist[i]).children('.voice_third').attr('server-id',serverId);
  658 + $(videolist[i]).children('.voice_third').data('data-server',serverId);
  659 + localId='';
  660 + }
  661 + });
  662 + }
  663 + }
650 }) 664 })
651 665
652 //重新录制 666 //重新录制
653 $('.rerecord').click(function () { 667 $('.rerecord').click(function () {
  668 + $('#second_test').html(60);
654 $('.first').show() 669 $('.first').show()
655 $('.second').hide() 670 $('.second').hide()
656 $('.stop').hide() 671 $('.stop').hide()
657 $('.stopping').hide() 672 $('.stopping').hide()
658 $('.start').show() 673 $('.start').show()
659 - $('.start').show()  
660 }) 674 })
661 675
662 //上传图片 676 //上传图片
@@ -692,6 +706,21 @@ @@ -692,6 +706,21 @@
692 }); 706 });
693 }); 707 });
694 708
  709 + $('#is_have_question').click(function () {
  710 + var data=$(this).attr('data-id');
  711 + if(data==1){
  712 + $('.question_yes').show();
  713 + $('.question_yes1').css('display','flex');
  714 + $('.question_no').hide();
  715 + $(this).attr('data-id',2);
  716 + }else{
  717 + $('.question_yes').hide();
  718 + $('.question_yes1').hide();
  719 + $('.question_no').show();
  720 + $(this).attr('data-id',1);
  721 + }
  722 + })
  723 +
695 </script> 724 </script>
696 </body> 725 </body>
697 </html> 726 </html>