作者 刘晓艳

测试

@@ -248,7 +248,7 @@ @@ -248,7 +248,7 @@
248 } 248 }
249 ) 249 )
250 }) 250 })
251 - // 疾病分类下拉 251 + // 问诊专家下拉
252 $('.expert').click(function () { 252 $('.expert').click(function () {
253 var doctor = new Array() 253 var doctor = new Array()
254 var platment_id = $('.inquiry_value').data('data-id'); 254 var platment_id = $('.inquiry_value').data('data-id');
@@ -561,7 +561,6 @@ @@ -561,7 +561,6 @@
561 $('.submit_voice').click(function () { 561 $('.submit_voice').click(function () {
562 voiceBox.find('.voice_first').hide().siblings('.voice_third').show() 562 voiceBox.find('.voice_first').hide().siblings('.voice_third').show()
563 $('.second').hide() 563 $('.second').hide()
564 -  
565 }) 564 })
566 565
567 //重新录制 566 //重新录制
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 <div class="hint_info">提示:您可以选择推荐专家,平台会为您匹配对应专家;您也可以 40 <div class="hint_info">提示:您可以选择推荐专家,平台会为您匹配对应专家;您也可以
41 选择其他专家。 41 选择其他专家。
42 </div> 42 </div>
43 - <div class="info_item " > 43 + <div class="info_item ">
44 <div class="title" data-id="1"> 44 <div class="title" data-id="1">
45 <text>病人主述</text> 45 <text>病人主述</text>
46 <!--<text class="info_tab_box">--> 46 <!--<text class="info_tab_box">-->
@@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
53 <p class="text_num"><span class="text-count">0</span>/1000</p> 53 <p class="text_num"><span class="text-count">0</span>/1000</p>
54 </div> 54 </div>
55 <div class="voice_module" video-id="1"> 55 <div class="voice_module" video-id="1">
56 - <div class="voice_box voice_third" > 56 + <div class="voice_box voice_third">
57 <div class="voice_item"> 57 <div class="voice_item">
58 <text class="iconfont icon-luyin voice_icon"></text> 58 <text class="iconfont icon-luyin voice_icon"></text>
59 <text class="voice_font luyin">点击图标可播放 时长:10秒</text> 59 <text class="voice_font luyin">点击图标可播放 时长:10秒</text>
@@ -64,10 +64,10 @@ @@ -64,10 +64,10 @@
64 </div> 64 </div>
65 </div> 65 </div>
66 <!--<div class="voice_box voice_second" >--> 66 <!--<div class="voice_box voice_second" >-->
67 - <!--<div class="voice_item">-->  
68 - <!--<text class="iconfont icon-luying_ongoing voice_icon"></text>-->  
69 - <!--<text class="voice_font luying_ongoing">正在播放 10秒/60秒</text>-->  
70 - <!--</div>--> 67 + <!--<div class="voice_item">-->
  68 + <!--<text class="iconfont icon-luying_ongoing voice_icon"></text>-->
  69 + <!--<text class="voice_font luying_ongoing">正在播放 10秒/60秒</text>-->
  70 + <!--</div>-->
71 <!--</div>--> 71 <!--</div>-->
72 <div class="voice_list"> 72 <div class="voice_list">
73 <div class="voice_box voice_first"> 73 <div class="voice_box voice_first">
@@ -104,10 +104,10 @@ @@ -104,10 +104,10 @@
104 </div> 104 </div>
105 </div> 105 </div>
106 <!--<div class="voice_box voice_second">--> 106 <!--<div class="voice_box voice_second">-->
107 - <!--<div class="voice_item">-->  
108 - <!--<text class="iconfont icon-luying_ongoing voice_icon"></text>-->  
109 - <!--<text class="voice_font luying_ongoing">正在播放 10秒/60秒</text>-->  
110 - <!--</div>--> 107 + <!--<div class="voice_item">-->
  108 + <!--<text class="iconfont icon-luying_ongoing voice_icon"></text>-->
  109 + <!--<text class="voice_font luying_ongoing">正在播放 10秒/60秒</text>-->
  110 + <!--</div>-->
111 <!--</div>--> 111 <!--</div>-->
112 <div class="voice_list"> 112 <div class="voice_list">
113 <div class="voice_box voice_first"> 113 <div class="voice_box voice_first">
@@ -174,7 +174,7 @@ @@ -174,7 +174,7 @@
174 <img class="" src="__TMPL__/public/assets/images/eicon12@2x.png" alt=""> 174 <img class="" src="__TMPL__/public/assets/images/eicon12@2x.png" alt="">
175 </div> 175 </div>
176 <div class="popup_item next_step"> 176 <div class="popup_item next_step">
177 - <img class="popup_icon" src="__TMPL__/public/assets/images/eicon10@2x.png" alt=""> 177 + <img class="popup_icon" src="__TMPL__/public/assets/images/eicon10@2x.png" alt="">
178 <div>下一步</div> 178 <div>下一步</div>
179 </div> 179 </div>
180 </div> 180 </div>
@@ -194,8 +194,8 @@ @@ -194,8 +194,8 @@
194 <img class="popup_icon " src="__TMPL__/public/assets/images/eicon15@2x.png" alt=""> 194 <img class="popup_icon " src="__TMPL__/public/assets/images/eicon15@2x.png" alt="">
195 <div>重新录制</div> 195 <div>重新录制</div>
196 </div> 196 </div>
197 - <div class="large_icon">  
198 - <img class="popup_icon upload" src="__TMPL__/public/assets/images/eicon16@2x.png" alt=""> 197 + <div class="large_icon submit_voice">
  198 + <img class="popup_icon " src="__TMPL__/public/assets/images/eicon16@2x.png" alt="">
199 <div>我要发送</div> 199 <div>我要发送</div>
200 </div> 200 </div>
201 </div> 201 </div>
@@ -229,26 +229,32 @@ @@ -229,26 +229,32 @@
229 $this.val(_val.substring(0, 1000)); 229 $this.val(_val.substring(0, 1000));
230 } 230 }
231 count = 1000 - $this.val().length; 231 count = 1000 - $this.val().length;
232 - $(".text-count").text(count); 232 + $(this).siblings(".text_num").children('.text-count').text(count);
233 }); 233 });
234 234
235 // 疾病分类下拉 235 // 疾病分类下拉
236 $('.inquiry_type').click(function () { 236 $('.inquiry_type').click(function () {
237 weui.picker([ 237 weui.picker([
238 - <volist name='platment' id='vo'>  
239 - {label: '{$vo.name}', value: {$vo.id}},  
240 - </volist>  
241 - ], {  
242 - onChange: function (res) {  
243 - $('.expert_value').val('')  
244 - $('.expert_value').data('data-id','')  
245 - },  
246 - onConfirm: function (res) {  
247 - $('.inquiry_value').val(res[0].label)  
248 - $('.inquiry_value').data('data-id',res[0].value)  
249 - } 238 + < volist
  239 + name = 'platment'
  240 + id = 'vo' >
  241 + {label: '{$vo.name}', value: {$vo.id}
  242 + },
  243 + <
  244 + /volist>
  245 + ],
  246 + {
  247 + onChange: function (res) {
  248 + $('.expert_value').val('')
  249 + $('.expert_value').data('data-id', '')
250 } 250 }
251 - ) 251 + ,
  252 + onConfirm: function (res) {
  253 + $('.inquiry_value').val(res[0].label)
  254 + $('.inquiry_value').data('data-id', res[0].value)
  255 + }
  256 + }
  257 + )
252 }) 258 })
253 // 疾病分类下拉 259 // 疾病分类下拉
254 $('.expert').click(function () { 260 $('.expert').click(function () {
@@ -331,26 +337,17 @@ @@ -331,26 +337,17 @@
331 //点击 337 //点击
332 $('.title').click(function () { 338 $('.title').click(function () {
333 title_id = $(this).attr("data-id"); 339 title_id = $(this).attr("data-id");
334 -  
335 - // 第一步点击语音按钮  
336 if ($(this).children(".voice_btn").css("display") == "inline") { 340 if ($(this).children(".voice_btn").css("display") == "inline") {
337 $(this).children(".voice_btn").css("display", "none"); 341 $(this).children(".voice_btn").css("display", "none");
338 $(this).children(".icon-tianxie").css("display", "inline") 342 $(this).children(".icon-tianxie").css("display", "inline")
339 $(this).parents('.info_item').children('.textarea_box').hide() 343 $(this).parents('.info_item').children('.textarea_box').hide()
340 - $(this).parents('.info_item').children('.voice_module').children('.voice_box').show()  
341 - $(this).parents('.info_item').children('.voice_module').children('.videoitem').show() 344 + $(this).parents('.info_item').find('.voice_first').show()
342 } else if ($(this).children(".icon-tianxie").css("display") == "inline") { 345 } else if ($(this).children(".icon-tianxie").css("display") == "inline") {
343 - $(this).children(".voice_btn").css("display","inline");  
344 - $(this).children(".icon-tianxie").css("display","none") 346 + $(this).children(".voice_btn").css("display", "inline");
  347 + $(this).children(".icon-tianxie").css("display", "none")
345 $(this).parents('.info_item').children('.textarea_box').show() 348 $(this).parents('.info_item').children('.textarea_box').show()
346 - $(this).parents('.info_item').children('.voice_module').children('.voice_box').hide()  
347 - $(this).parents('.info_item').children('.voice_module').children('.videoitem').hide() 349 + $(this).parents('.info_item').find('.voice_first').hide()
348 } 350 }
349 - // $(this).next().show();  
350 - // $('.textarea_box').hide()  
351 - // $('.voice_btn').hide()  
352 - // $('.icon-tianxie').show()  
353 - // $('.voice_first').show()  
354 }) 351 })
355 352
356 //点击正在播放按钮 353 //点击正在播放按钮
@@ -363,40 +360,117 @@ @@ -363,40 +360,117 @@
363 $(videolist[i]).children('.voice_second').hide() 360 $(videolist[i]).children('.voice_second').hide()
364 $(videolist[i]).children('.voice_third').show(); 361 $(videolist[i]).children('.voice_third').show();
365 } 362 }
366 - } 363 + }
  364 + })
  365 +
  366 +
  367 + //倒计时
  368 + var times = "60";//倒计时总秒数量
  369 + var time = "";
  370 +
  371 + function countDown(times) {
  372 + var timer = null;
  373 + timer = setInterval(function () {
  374 + var day = 0,
  375 + hour = 0,
  376 + minute = 0,
  377 + second = 0;//时间默认值
  378 + if (times > 0) {
  379 + day = Math.floor(times / (60 * 60 * 24));
  380 + hour = Math.floor(times / (60 * 60)) - (day * 24);
  381 + minute = Math.floor(times / 60) - (day * 24 * 60) - (hour * 60);
  382 + second = Math.floor(times) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
  383 + }
  384 + if (day <= 9) day = '0' + day;
  385 + if (hour <= 9) hour = '0' + hour;
  386 + if (minute <= 9) minute = '0' + minute;
  387 + if (second <= 9) second = '0' + second;
  388 +
  389 + $('#hour_show').html('<text id="h"></text>' + hour + ':');
  390 + $('#minute_show').html('<text></text>' + minute + ':');
  391 + $('#second_show').html('<text></text>' + second + '');
  392 + $('#second_test').html('<text></text>' + second + '');
  393 +
  394 + //
  395 + // console.log(day + "天:" + hour + "小时:" + minute + "分钟:" + second + "秒");
  396 + times--;
  397 +
  398 + }, 1000);
  399 + $('.pause').click(function () {
  400 + // timer(intDiff);
  401 + clearInterval(timer);
  402 + localStorage.setItem("times", times)
  403 + })
  404 + $('.stop').click(function () {
  405 + clearInterval(timer);
  406 + times = 0;
  407 + })
  408 + $('.stopping').click(function () {
  409 + clearInterval(timer);
  410 + localStorage.clear()
  411 + })
  412 + }
  413 +
  414 + $('.start').click(function () {
  415 + time = localStorage.getItem("times")
  416 + if (time == null) {
  417 + times = parseInt(60)
  418 + } else {
  419 + times = time;
  420 + }
  421 + console.log(time)
  422 + // myTimer(intDiff);
  423 + countDown(times);
  424 + localStorage.setItem("times", times)
367 }) 425 })
368 426
369 //添加一条新语音 427 //添加一条新语音
370 - var num=0  
371 - $('.add_voice').click(function () {  
372 - num=num+1 428 + var num = 0;
  429 + $('.voice_module').on('click', '.add_voice', function () {
  430 + times=60
  431 + // clearInterval(timer);
  432 + var day = 0,
  433 + hour = 0,
  434 + minute = 0,
  435 + second = 0;//时间默认值
  436 + if (day <= 9) day = '0' + day;
  437 + if (hour <= 9) hour = '0' + hour;
  438 + if (minute <= 9) minute = '0' + minute;
  439 + if (second <= 9) second = '0' + second;
  440 +
  441 + $('#hour_show').html('<text id="h"></text>' + hour + ':');
  442 + $('#minute_show').html('<text></text>' + minute + ':');
  443 + $('#second_show').html('<text></text>' + second + '');
  444 +
  445 +
  446 + num = num + 1
373 var parent = $(this).parents('.voice_module') 447 var parent = $(this).parents('.voice_module')
374 - var html='<div class="videoitem" voiceitemid="'+num+'">\n' +  
375 - '<div class="voice_list">\n' +  
376 - ' <div class="voice_box voice_first" voiceid="'+num+'">\n' +  
377 - ' <div class="voice_item">\n' +  
378 - ' <text class="iconfont icon-huatong mike voice_icon"></text>\n' +  
379 - ' <text class="voice_font huatong">点击图标开始语音语音最长60秒</text>\n' +  
380 - ' </div>\n' +  
381 - ' <div class="voice_btn_box">\n' +  
382 - ' <text class="iconfont icon-quxiao icon_cancle cancle_voice"></text>\n' +  
383 - ' </div>\n' +  
384 - ' </div>\n' +  
385 - ' </div>\n' +  
386 - '\n' +  
387 - '\n' +  
388 - ' <div class="voice_box voice_third" style="display:none">\n' +  
389 - ' <div class="voice_item">\n' +  
390 - ' <text class="iconfont icon-luyin voice_icon"></text>\n' +  
391 - ' <text class="voice_font luyin">点击图标可播放 时长:10秒</text>\n' +  
392 - ' </div>\n' +  
393 - ' <div class="voice_btn_box">\n' +  
394 - ' <text class="iconfont icon-quxiao icon_cancle cancle_voice"></text>\n' +  
395 - ' </div>\n' +  
396 - ' </div>\n' + 448 + var html = '<div class="voice_list" voiceitemid="'+num+'">\n' +
  449 + '<div class="voice_box voice_third" style="display: none;">\n' +
  450 + ' <div class="voice_item">\n' +
  451 + ' <text class="iconfont icon-luyin voice_icon"></text>\n' +
  452 + ' <text class="voice_font luyin">点击图标可播放 时长:10秒</text>\n' +
  453 + ' </div>\n' +
  454 + ' <div class="voice_btn_box">\n' +
  455 + ' <text class="iconfont icon-quxiao cancle_voice"></text>\n' +
  456 + // ' <text class="iconfont icon-tianjia add_voice"></text>\n' +
  457 + ' </div>\n' +
  458 + ' </div>\n' +
  459 + ' <div class="voice_box voice_first">\n' +
  460 + ' <div class="voice_item">\n' +
  461 + ' <text class="iconfont icon-huatong mike voice_icon"></text>\n' +
  462 + ' <text class="voice_font huatong">点击图标开始语音语音最长60秒</text>\n' +
  463 + ' </div>\n' +
  464 + ' <div class="voice_btn_box">\n' +
  465 + ' <text class="iconfont icon-quxiao icon_cancle cancle_voice"></text>\n' +
  466 + ' </div>\n' +
  467 + ' </div>\n' +
397 '</div>' 468 '</div>'
  469 +
  470 +
398 // parent.append($('.voice_list').html()); 471 // parent.append($('.voice_list').html());
399 parent.append(html) 472 parent.append(html)
  473 +
400 }) 474 })
401 475
402 //删除语音 476 //删除语音
@@ -404,45 +478,55 @@ @@ -404,45 +478,55 @@
404 $(this).parents('.voice_third').remove() 478 $(this).parents('.voice_third').remove()
405 }); 479 });
406 480
407 - $(".voice_module").on("click",".cancle_voice",function(){  
408 - $(this).parents(".voice_list").remove(); 481 + $(".voice_module").on("click", ".cancle_voice", function () {
  482 + $(this).parents(".voice_list").remove();
409 $(this).parents(".voice_third").remove(); 483 $(this).parents(".voice_third").remove();
410 484
411 }) 485 })
412 486
413 //第二步开始 487 //第二步开始
414 - var vioceid="" 488 + var vioceid = ""
  489 +
  490 +
  491 +
415 //显示弹窗 492 //显示弹窗
416 - $(document).on("click", ".mike",function () { 493 + var voiceBox;
  494 + $(document).on("click", ".mike", function () {
417 $('.first').show() 495 $('.first').show()
418 $('.play').show() 496 $('.play').show()
  497 + $('.start').show()
419 $('.stopping').hide() 498 $('.stopping').hide()
420 - vioceid=$(this).parents(".voice_first").attr("voiceid");  
421 -  
422 - //点击试听  
423 - $('.audition').click(function () {  
424 - wx.onVoicePlayEnd({  
425 - success: function (res) {  
426 - var localId = res.localId; // 返回音频的本地ID  
427 - }  
428 - });  
429 -  
430 - wx.playVoice({  
431 - localId:localId //需要播放的音频的本地ID,由stopRecord接口获得  
432 - });  
433 -  
434 - var videolist = $(".videoitem");  
435 - for (var i = 0; i < videolist.length; i++) {  
436 - var videoid = $(videolist[i]).attr("voiceitemid");  
437 - if (videoid == vioceid) {  
438 - $(videolist[i]).children(".voice_list").hide();  
439 - $(videolist[i]).children(".voice_third").show();  
440 - }  
441 - } 499 + $('.stop').hide()
  500 + $('.next_step').hide();
  501 + // videoid=$(this).parents(".voice_module").attr("video-id")
  502 +
  503 + // $(this).parents(".voice_first").hide();
  504 + // $(this).parents(".voice_first").siblings(".voice_third").show()
  505 + //
  506 + // // vioceid=$(this).parents(".voice_first").attr("voiceid");
  507 + //
  508 +
  509 + voiceBox = $(this).parents('.voice_list');
  510 +
  511 + // console.log(voiceBox)
  512 + // $('.submit_voice').attr('videoid')
  513 + //
  514 + // var videolist = $(".voice_module");
  515 + // console.log(videolist)
  516 + // for (var i = 0; i < videolist.length; i++) {
  517 + // if (videoid == title_id) {
  518 + // $(videolist[i]).children(".voice_list").children(".voice_list").hide();
  519 + // $(videolist[i]).children(".voice_list").children(".voice_third").show();
  520 + // }
  521 + // }
442 522
443 - })  
444 }); 523 });
445 524
  525 + //删除语音
  526 + $(".voice_module").on("click",".cancle_voice",function(){
  527 + $(this).parents(".voice_box").remove();
  528 + })
  529 +
446 //开始录音 530 //开始录音
447 var localId 531 var localId
448 $('.start').click(function () { 532 $('.start').click(function () {
@@ -471,7 +555,7 @@ @@ -471,7 +555,7 @@
471 $('.pause').hide() 555 $('.pause').hide()
472 wx.stopRecord({ 556 wx.stopRecord({
473 success: function (res) { 557 success: function (res) {
474 - localId = res.localId; 558 + localId = res.localId;
475 } 559 }
476 }); 560 });
477 }) 561 })
@@ -491,7 +575,7 @@ @@ -491,7 +575,7 @@
491 } 575 }
492 }); 576 });
493 wx.playVoice({ 577 wx.playVoice({
494 - localId:localId //需要播放的音频的本地ID,由stopRecord接口获得 578 + localId: localId //需要播放的音频的本地ID,由stopRecord接口获得
495 }); 579 });
496 580
497 var videolist = $(".voice_module"); 581 var videolist = $(".voice_module");
@@ -508,42 +592,48 @@ @@ -508,42 +592,48 @@
508 592
509 593
510 //列表中点击试听 594 //列表中点击试听
511 - $('.voice_third').click(  
512 - function () {  
513 - var tryId=$(this).attr('try-id');  
514 - wx.playVoice({  
515 - localId:tryId  
516 - });  
517 - }  
518 - )  
519 -  
520 - //确认音频  
521 - $('.upload').click(function () {  
522 - var videolist = $(".voice_module");  
523 - for (var i = 0; i < videolist.length; i++) {  
524 - var videoid = $(videolist[i]).attr("video-id");  
525 - if (videoid == title_id) {  
526 - $('.second').hide()  
527 - $(videolist[i]).show();  
528 - $(videolist[i]).children('.voice_list').hide()  
529 - $(videolist[i]).children('.voice_third').show();  
530 - /*上面放上 音频id和本地地址*/  
531 - $(videolist[i]).children('.voice_third').attr('try-id',localId);  
532 - $(videolist[i]).children('.voice_third').data('data-try',localId);  
533 - $(videolist[i]).children('.voice_third').attr('id','audio'+videoid);  
534 - wx.uploadVoice({  
535 - localId: localId, // 需要上传的音频的本地ID,由stopRecord接口获得  
536 - isShowProgressTips: 1, // 默认为1,显示进度提示  
537 - success: function (res) {  
538 - var serverId = res.serverId; // 返回音频的服务器端ID  
539 - $(videolist[i]).children('.voice_third').attr('server-id',serverId);  
540 - $(videolist[i]).children('.voice_third').data('data-server',serverId);  
541 - }  
542 - });  
543 - } 595 + $('.voice_third').click(
  596 + function () {
  597 + var tryId = $(this).attr('try-id');
  598 + wx.playVoice({
  599 + localId: tryId
  600 + });
544 } 601 }
  602 + )
  603 +
  604 + //我要发送
  605 + $('.submit_voice').click(function () {
  606 + voiceBox.find('.voice_first').hide().siblings('.voice_third').show()
  607 + $('.second').hide()
545 }) 608 })
546 609
  610 + //确认音频
  611 + // $('.upload').click(function () {
  612 + // var videolist = $(".voice_module");
  613 + // for (var i = 0; i < videolist.length; i++) {
  614 + // var videoid = $(videolist[i]).attr("video-id");
  615 + // if (videoid == title_id) {
  616 + // $('.second').hide()
  617 + // $(videolist[i]).show();
  618 + // $(videolist[i]).children('.voice_list').hide()
  619 + // $(videolist[i]).children('.voice_third').show();
  620 + // /*上面放上 音频id和本地地址*/
  621 + // $(videolist[i]).children('.voice_third').attr('try-id', localId);
  622 + // $(videolist[i]).children('.voice_third').data('data-try', localId);
  623 + // $(videolist[i]).children('.voice_third').attr('id', 'audio' + videoid);
  624 + // wx.uploadVoice({
  625 + // localId: localId, // 需要上传的音频的本地ID,由stopRecord接口获得
  626 + // isShowProgressTips: 1, // 默认为1,显示进度提示
  627 + // success: function (res) {
  628 + // var serverId = res.serverId; // 返回音频的服务器端ID
  629 + // $(videolist[i]).children('.voice_third').attr('server-id', serverId);
  630 + // $(videolist[i]).children('.voice_third').data('data-server', serverId);
  631 + // }
  632 + // });
  633 + // }
  634 + // }
  635 + // })
  636 +
547 //重新录制 637 //重新录制
548 $('.rerecord').click(function () { 638 $('.rerecord').click(function () {
549 $('.first').show() 639 $('.first').show()
@@ -728,68 +818,69 @@ @@ -728,68 +818,69 @@
728 } 818 }
729 }) 819 })
730 </script> 820 </script>
731 -<script type="text/javascript">  
732 - var times = "60";//倒计时总秒数量  
733 - var time="";  
734 - function countDown(times) {  
735 - var timer = null;  
736 - timer = setInterval(function () {  
737 - var day = 0,  
738 - hour = 0,  
739 - minute = 0,  
740 - second = 0;//时间默认值  
741 - if (times > 0) {  
742 - day = Math.floor(times / (60 * 60 * 24));  
743 - hour = Math.floor(times / (60 * 60)) - (day * 24);  
744 - minute = Math.floor(times / 60) - (day * 24 * 60) - (hour * 60);  
745 - second = Math.floor(times) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);  
746 - }  
747 - if (day <= 9) day = '0' + day;  
748 - if (hour <= 9) hour = '0' + hour;  
749 - if (minute <= 9) minute = '0' + minute;  
750 - if (second <= 9) second = '0' + second;  
751 -  
752 - $('#hour_show').html('<text id="h"></text>' + hour + ':');  
753 - $('#minute_show').html('<text></text>' + minute + ':');  
754 - $('#second_show').html('<text></text>' + second + '');  
755 - $('#second_test').html('<text></text>' + second + '');  
756 -  
757 - //  
758 - // console.log(day + "天:" + hour + "小时:" + minute + "分钟:" + second + "秒");  
759 - times--;  
760 -  
761 - }, 1000);  
762 - // if (times <= 0) {  
763 - // clearInterval(timer);  
764 - // }  
765 -  
766 - $('.pause').click(function () {  
767 - // timer(intDiff);  
768 - clearInterval(timer);  
769 - localStorage.setItem("times",times)  
770 - })  
771 - $('.stop').click(function () {  
772 - clearInterval(timer);  
773 - times=0;  
774 - })  
775 - $('.stopping').click(function () {  
776 - clearInterval(timer);  
777 - localStorage.clear()  
778 - })  
779 - }  
780 -  
781 - $('.start').click(function () {  
782 - time=localStorage.getItem("times")  
783 - if(time==null){  
784 - times = parseInt(60)  
785 - }else{  
786 - times=time;  
787 - }  
788 - console.log(time)  
789 - // myTimer(intDiff);  
790 - countDown(times);  
791 - localStorage.setItem("times",times)  
792 - })  
793 -</script> 821 +<!--<script type="text/javascript">-->
  822 + <!--var times = "60";//倒计时总秒数量-->
  823 + <!--var time = "";-->
  824 +
  825 + <!--function countDown(times) {-->
  826 + <!--var timer = null;-->
  827 + <!--timer = setInterval(function () {-->
  828 + <!--var day = 0,-->
  829 + <!--hour = 0,-->
  830 + <!--minute = 0,-->
  831 + <!--second = 0;//时间默认值-->
  832 + <!--if (times > 0) {-->
  833 + <!--day = Math.floor(times / (60 * 60 * 24));-->
  834 + <!--hour = Math.floor(times / (60 * 60)) - (day * 24);-->
  835 + <!--minute = Math.floor(times / 60) - (day * 24 * 60) - (hour * 60);-->
  836 + <!--second = Math.floor(times) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);-->
  837 + <!--}-->
  838 + <!--if (day <= 9) day = '0' + day;-->
  839 + <!--if (hour <= 9) hour = '0' + hour;-->
  840 + <!--if (minute <= 9) minute = '0' + minute;-->
  841 + <!--if (second <= 9) second = '0' + second;-->
  842 +
  843 + <!--$('#hour_show').html('<text id="h"></text>' + hour + ':');-->
  844 + <!--$('#minute_show').html('<text></text>' + minute + ':');-->
  845 + <!--$('#second_show').html('<text></text>' + second + '');-->
  846 + <!--$('#second_test').html('<text></text>' + second + '');-->
  847 +
  848 + <!--//-->
  849 + <!--// console.log(day + "天:" + hour + "小时:" + minute + "分钟:" + second + "秒");-->
  850 + <!--times&#45;&#45;;-->
  851 +
  852 + <!--}, 1000);-->
  853 + <!--// if (times <= 0) {-->
  854 + <!--// clearInterval(timer);-->
  855 + <!--// }-->
  856 +
  857 + <!--$('.pause').click(function () {-->
  858 + <!--// timer(intDiff);-->
  859 + <!--clearInterval(timer);-->
  860 + <!--localStorage.setItem("times", times)-->
  861 + <!--})-->
  862 + <!--$('.stop').click(function () {-->
  863 + <!--clearInterval(timer);-->
  864 + <!--times = 0;-->
  865 + <!--})-->
  866 + <!--$('.stopping').click(function () {-->
  867 + <!--clearInterval(timer);-->
  868 + <!--localStorage.clear()-->
  869 + <!--})-->
  870 + <!--}-->
  871 +
  872 + <!--$('.start').click(function () {-->
  873 + <!--time = localStorage.getItem("times")-->
  874 + <!--if (time == null) {-->
  875 + <!--times = parseInt(60)-->
  876 + <!--} else {-->
  877 + <!--times = time;-->
  878 + <!--}-->
  879 + <!--console.log(time)-->
  880 + <!--// myTimer(intDiff);-->
  881 + <!--countDown(times);-->
  882 + <!--localStorage.setItem("times", times)-->
  883 + <!--})-->
  884 +<!--</script>-->
794 </body> 885 </body>
795 </html> 886 </html>