...
|
...
|
@@ -276,6 +276,427 @@ |
|
|
<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>
|
|
|
//文本框显示字数
|
|
|
$(".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([
|
|
|
{label: '一类', value: 0},
|
|
|
{label: '二类', value: 1}
|
|
|
], {
|
|
|
onChange: function (res) {
|
|
|
console.log(res)
|
|
|
},
|
|
|
onConfirm: function (res) {
|
|
|
$('.inquiry_value').val(res[0].label)
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
})
|
|
|
// 疾病分类下拉
|
|
|
$('.expert').click(function () {
|
|
|
weui.picker([
|
|
|
{label: '王医生', value: 0},
|
|
|
{label: '刘易斯', value: 1}
|
|
|
], {
|
|
|
onChange: function (res) {
|
|
|
console.log(res)
|
|
|
},
|
|
|
onConfirm: function (res) {
|
|
|
$('.expert_value').val(res[0].label)
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
})
|
|
|
// 性别分类
|
|
|
$('.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)
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
})
|
|
|
//就诊时间
|
|
|
$('#showDatePicker').on('click', function () {
|
|
|
weui.datePicker({
|
|
|
start: 2019,
|
|
|
end: new Date().getFullYear(),
|
|
|
onChange: function (result) {
|
|
|
console.log(result);
|
|
|
},
|
|
|
onConfirm: function (result) {
|
|
|
console.log(result[0].label+' - '+result[1].label+' - '+result[2].label)
|
|
|
$('.time_value').val(result[0].value+' - '+result[1].value+' - '+result[2].value)
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//语音模块
|
|
|
// $('.icon-tianxie').hide()
|
|
|
// $('.voice_first').hide()
|
|
|
// $('.voice_second').hide()
|
|
|
$('.voice_third').hide()
|
|
|
$('.icon_cancle').hide()
|
|
|
// $('.voice_module').hide()
|
|
|
|
|
|
var title_id = ''
|
|
|
|
|
|
//点击
|
|
|
$('.info_item').on('click','.title',function () {
|
|
|
$(this).parent().toggleClass('voice')
|
|
|
|
|
|
// 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').find('.voice_first').show()
|
|
|
// $(this).parents('.info_item').find('.voice_module').show()
|
|
|
// // if($(this).children(".voice_third").css("display") == "inline"){
|
|
|
// // $(this).parents('.info_item').children('.textarea_box').hide()
|
|
|
// // }
|
|
|
// } else if ($(this).children(".icon-tianxie").css("display") == "inline") {
|
|
|
// $(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').find('.voice_first').hide()
|
|
|
// // if($(this).children(".voice_third").css("display") == "inline"){
|
|
|
// // $(this).parents('.info_item').children('.textarea_box').hide()
|
|
|
// // }
|
|
|
// }
|
|
|
})
|
|
|
|
|
|
|
|
|
//点击正在播放按钮
|
|
|
$('.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 = "";//倒计时总秒数量
|
|
|
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 + '');
|
|
|
|
|
|
//
|
|
|
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)
|
|
|
countDown(times);
|
|
|
localStorage.setItem("times", times)
|
|
|
})
|
|
|
|
|
|
|
|
|
//添加一条新语音
|
|
|
var num = 0;
|
|
|
$('.voice_module').on('click', '.add_voice', function () {
|
|
|
// $('.voice_module').append($('.voice_list').html());
|
|
|
// $('.voice_list .voice_first').show()
|
|
|
// $('.add_icon').show()
|
|
|
|
|
|
|
|
|
// var parent = $(this).parents('.voice_module')
|
|
|
// parent.append($('.temp_list').clone());
|
|
|
|
|
|
|
|
|
// 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]).append($('.voice_list').html());
|
|
|
// $(videolist[i]).children('.voice_list .voice_first').show();
|
|
|
// $('.icon_cancle').show()
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
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();
|
|
|
})
|
|
|
|
|
|
//开始录音
|
|
|
$('.start').click(function () {
|
|
|
$('.start').hide()
|
|
|
$('.play').hide()
|
|
|
$('.pause').show()
|
|
|
$('.stopping').show()
|
|
|
$('.next_step').hide()
|
|
|
})
|
|
|
|
|
|
//暂停
|
|
|
$('.pause').click(function () {
|
|
|
$('.pause').hide()
|
|
|
$('.start').show()
|
|
|
$('.stopping').hide()
|
|
|
|
|
|
})
|
|
|
|
|
|
//停止录音
|
|
|
$('.stopping').click(function () {
|
|
|
$('.next_step').show()
|
|
|
$('.stop').show()
|
|
|
$('.pause').hide()
|
|
|
})
|
|
|
|
|
|
//下一步
|
|
|
$('.next_step').click(function () {
|
|
|
$('.first').hide()
|
|
|
$('.second').show()
|
|
|
})
|
|
|
|
|
|
//点击试听
|
|
|
$('.audition').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();
|
|
|
// }
|
|
|
// }
|
|
|
})
|
|
|
|
|
|
|
|
|
//我要发送
|
|
|
$('.submit_voice').click(function () {
|
|
|
|
|
|
// var videolist = $(".voice_module");
|
|
|
// console.log(videolist,videolist.length)
|
|
|
// for (var i = 0; i<videolist.length; i++) {
|
|
|
// videoid = $(videolist[i]).attr("video-id");
|
|
|
// if (videoid == title_id) {
|
|
|
// $('.second').hide()
|
|
|
// $(videolist[i]).children(".voice_list").children('.voice_first').hide()
|
|
|
// $(videolist[i]).children(".voice_list").children('.voice_third').show();
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
|
|
|
voiceBox.find('.voice_first').hide().siblings('.voice_third').show()
|
|
|
$('.second').hide()
|
|
|
|
|
|
})
|
|
|
|
|
|
//重新录制
|
|
|
$('.rerecord').click(function () {
|
|
|
$('.first').show()
|
|
|
$('.second').hide()
|
|
|
$('.stop').hide()
|
|
|
$('.stopping').hide()
|
|
|
$('.start').show()
|
|
|
$('.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) {
|
|
|
// console.log(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];
|
|
|
console.log(url.createObjectURL(file))
|
|
|
|
|
|
if (url) {
|
|
|
src = url.createObjectURL(file);
|
|
|
// var
|
|
|
} 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);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
</body>
|
|
|
</html> |
|
|
\ No newline at end of file |
...
|
...
|
|