소스 검색

代码修改

yeshijie 7 년 전
부모
커밋
136113968e
1개의 변경된 파일115개의 추가작업 그리고 7개의 파일을 삭제
  1. 115 7
      patient-co-service/wlyy_service/src/main/webapp/prescription_consulting/js/prescription_consulting_info.js

+ 115 - 7
patient-co-service/wlyy_service/src/main/webapp/prescription_consulting/js/prescription_consulting_info.js

@ -4,9 +4,12 @@ var request = GetRequest(),
    dialroll,
    page = 1,
    prepend =  false; 
//var server = "http://192.168.131.24:8081/";
var imgUrlDomain = "http://10.95.22.10:8011/";//正式
//var server = "http://192.168.131.24:8081/";//本地
//var server = "http://172.19.103.88:8011/wlyy_service/";//测试
var server = "http://10.95.22.10:8011/wlyy_service/";//正式
// var imgUrlDomain = "http://172.19.103.54/";//测试
$(function(){
    dialroll = iscrollAssist.newVerScrollForPull($('.pull-iscroll-wrap'), pulldownAction, null);
@ -17,6 +20,7 @@ $(function(){
    $("#talkwrap").height(totH);
    
    getLogList();
    bindEvents();
})
function getLogList(){
@ -115,7 +119,7 @@ function addReply(msgObj, member, prepend){
    }
    
    var temp = '<dt style="height: auto; text-align: center;">'+
        '<a><img src="' + p + '" class="c-images-cycle" /></a></dt>' +
        '<a><img src="' + getImgUrl(p) + '" class="c-images-cycle" /></a></dt>' +
        '<div class="c-content"><span class="c-f12 name">' + member.name + '</span>'
    
    switch(parseInt(msgType)) {
@ -133,7 +137,7 @@ function addReply(msgObj, member, prepend){
                '</dd></dl>';
            break;
        case 2://图片
            temp += '<dd class="word-bread wb-img"><img width="100" height="100" src="'+ content +'" /></dd></dl>';
            temp += '<dd class="word-bread wb-img"><img width="100" height="100" src="'+ getImgUrl(content) +'" /></dd></dl>';
            break;
        case 3://语音
            var rec = JSON.parse(content);
@ -146,16 +150,16 @@ function addReply(msgObj, member, prepend){
        case 12://视频
            var videoInfo = content.split(",");
            var shichang = formatSeconds(videoInfo[2]);//时长
            if(type == 1){
                temp += '<dd class="preview-video" data-video="'+videoInfo[1]+'">'+
                        '<img class="video-img-left" src="'+videoInfo[0]+'">'+
            if(member.is_patient == 0){
                temp += '<dd class="preview-video" data-video="'+getImgUrl(videoInfo[1])+'">'+
                        '<img class="video-img-left" src="'+getImgUrl(videoInfo[0])+'">'+
                        '<img class="bofang-icon-left" src="images/bofang_icon.png">'+
                        '<img class="jianjiao-icon-left" src="images/zuoshanjiao_bg.png">'+
                        '<span class="shichang-time-left">'+shichang+'</span>'+
                    '</dd>';
            }else{
                temp += '<dd class="preview-video" data-video="'+videoInfo[1]+'">'+
                        '<img class="video-img-right" src="'+videoInfo[0]+'">'+
                temp += '<dd class="preview-video" data-video="'+getImgUrl(videoInfo[1])+'">'+
                        '<img class="video-img-right" src="'+getImgUrl(videoInfo[0])+'">'+
                        '<img class="bofang-icon-right" src="images/bofang_icon.png">'+
                        '<img class="jianjiao-icon-right" src="images/youshanjiao_bg.png">'+
                        '<span class="shichang-time-right">'+shichang+'</span>'+
@ -185,6 +189,47 @@ function addReply(msgObj, member, prepend){
    
}
function bindEvents(){
    $(".talk-box").on('click', '.audio', function(){
        dialog({
            contentType:'tipsbox', 
            skin:'bk-popup' ,
            bottom:true,
            content:'暂不支持多媒体内容播放'
        }).show();
//      if($playingDom){
//          aud.pause();
//          //aud.stop();
//          $playingDom.removeClass('active');
//          if($playingDom[0] == this){
//              $playingDom = null;
//              return;
//          }
//      }
//      $playingDom = $(this);
//      $playingDom.addClass('active');
//      var ser = JSON.parse($(this).attr('data-audio'));
//      aud.src = getImgUrl(ser.path);
//      aud.load();
//      aud.play();
    })
    //播放视频
    .on('click','.preview-video',function() {
        dialog({
            contentType:'tipsbox', 
            skin:'bk-popup' ,
            bottom:true,
            content:'暂不支持多媒体内容播放'
        }).show();
//          $(document.body).find('video').remove();
//          var url = $(this).attr('data-video');
//          var html = '<video style="display: none;"  controls preload="auto" width="1" height="1" src="'+url+'" ></video>';
//          $(document.body).append(html);
//          var video = $(document.body).find('video')[0];
//          video.play();
    });
}
function queryFailed(res){
    d.close();
   
@ -213,6 +258,48 @@ function GetRequest() {
   return theRequest;
}
//毫秒转换成时分秒
function formatSeconds(value){
    var theTime = parseInt(value/1000);// 秒
    var theTime1 = 0;// 分
    var theTime2 = 0;// 小时
    if(theTime > 60) {
        theTime1 = parseInt(theTime/60);
        theTime = parseInt(theTime%60);
            if(theTime1 > 60) {
                theTime2 = parseInt(theTime1/60);
                theTime1 = parseInt(theTime1%60);
            }
    }
    var result = ""+parseInt(theTime);//秒
    if(parseInt(theTime)<=9){
        result = "0"+parseInt(theTime);//秒
    }
    if(theTime1 > 0) {//分
        if(parseInt(theTime1)>9){
            result = ""+parseInt(theTime1)+":"+result;
        }else{
            result = "0"+parseInt(theTime1)+":"+result;
        }
    }
    if(theTime2 > 0) {//小时
        if(parseInt(theTime2)>9){
            result = ""+parseInt(theTime2)+":"+result;
        }else{
            result = "0"+parseInt(theTime2)+":"+result;
        }
    }
    var resResult = "";
    if(result.split(":").length==1){//秒
        resResult = "00:"+result;
    }else if(result.split(":").length==2){//分
        resResult = "00:"+result;
    }else{//时
        resResult = result;
    }
    return resResult;
}
Date.prototype.Format = function(formatStr)   
{   
    var str = formatStr;   
@ -238,4 +325,25 @@ Date.prototype.Format = function(formatStr)
    str=str.replace(/s|S/g,this.getSeconds());   
  
    return str;   
}
/*
 * 获取图片路径方法修改
 */
function getImgUrl(str){
    if(typeof str != 'string'){
        return "";
    }
    if(str.length == 0){
        return "";
    }else{
        if(str.indexOf("../")>-1){
            //访问本地路径
            return str;
        }else if((str.indexOf("http://")>-1) || (str.indexOf("https://")>-1)){
            return str;
        }else{
            //服务器上的图片路径
            return imgUrlDomain + str;
        }
    }
}