$(function () {
//璋冩暣瀛椾綋澶у皬
$('.fontsize i').click(function () {
var thisEle = $('#zoomcon').css('font-size')
//parseFloat鐨勭浜屼釜鍙傛暟琛ㄧず杞寲鐨勮繘鍒讹紝10灏辫〃绀鸿浆涓?0杩涘埗
var textFontSize = parseFloat(thisEle, 10)
var unit = thisEle.slice(-2) //鑾峰彇鍗曚綅
var cName = $(this).attr('class')
if (cName == 'l' && textFontSize < 30) {
textFontSize += 2
} else if (cName == 's' && textFontSize > 12) {
textFontSize -= 2
} else if (cName == 'm') {
textFontSize = 16
}
//璁剧疆zoomcon鐨勫瓧浣撳ぇ灏
$('#zoomcon').css('font-size', textFontSize + unit)
$('#zoomcon')
.find('*')
.css('font-size', textFontSize + unit)
})
//澶勭悊鏂囩珷椤佃鏁板櫒
$.ajax({
type: 'POST', //鐢≒OST鏂瑰紡浼犺緭
dataType: 'JSON', //鏁版嵁鏍煎紡:JSON
url: '/szinf/getCmsMCount/?mid=' + manuscriptId,
success: function (data) {
var jsonobj = data
$('#xxtj').html(jsonobj.count)
},
})
//鐩稿叧绋夸欢
$.ajax({
type: 'POST', //鐢≒OST鏂瑰紡浼犺緭
dataType: 'text', //鏁版嵁鏍煎紡:JSON
url: '/consultfront/getManuscript/?manuscript_id=' + manuscriptId,
beforeSend: LoadFunction, //鍔犺浇鎵ц鏂规硶
error: erryFunction, //閿欒鎵ц鏂规硶
success: succFunction, //鎴愬姛鎵ц鏂规硶
})
function LoadFunction() {
$('#relDocuments').html('
鍔犺浇涓?.. ')
}
function erryFunction() {
$('#relDocuments').html('鍔犺浇涓?.. ')
}
function succFunction(back) {
var jsonobj = eval('(' + back + ')')
$('#relDocuments').html('')
for (var i = 0; i < jsonobj.infolist.length; i++) {
$('#relDocuments').append('" + jsonobj.infolist[i].title + ' ')
}
if ($('.article-reldoc .infolist li').length > 0) {
$('.article-reldoc').fadeIn('fast')
}
}
/*
if($(".article-appendix ul li").length > 0){
$(".article-appendix").fadeIn('fast');
}
*/
if ($.trim($('.article-subtitle').text()) != '') {
$('.xxgkml-content .article-subtitle').show()
}
if ($.trim($('.article-attr .ly b').text()) == '') {
$('.article-attr .ly b').text(websiteName)
}
try {
$('.meta-data .OwnerDept span')
.not('.yjzt')
.each(function () {
if ($(this).find('font').text() != '') {
$(this).show()
}
})
} catch (e) {}
//涓€绾т富棰橈紱浜岀骇涓婚
if ($.trim($('.ejzt font').text()) == '') {
$('.yjzt').show()
}
})
//mp4鏍煎紡瑙嗛鍏煎鏂规硶锛
function convertMedia() {
if (!document.getElementById('zoomcon')) return
var mediaDom = document.getElementById('zoomcon').getElementsByTagName('embed')
var videoDom = document.createElement('video')
if (typeof videoDom.canPlayType != 'undefined' && mediaDom && mediaDom.length > 0) {
for (var i = 0; i < mediaDom.length; i++) {
var el = mediaDom[i]
var newMediaDom = document.createElement('video')
newMediaDom.setAttribute('controls', 'controls')
newMediaDom.setAttribute('preload', 'preload')
newMediaDom.setAttribute('src', el.getAttribute('flashvars').replace(/^vcastr_file=/, ''))
newMediaDom.setAttribute('width', '60%') // el.width
newMediaDom.setAttribute('height', 'auto') // el.height
var parentDom = el.parentNode
el.style.display = 'none'
parentDom.appendChild(newMediaDom)
//parentDom.removeChild(el) ;
}
var len = mediaDom.length
for (var i = 1; mediaDom.length > 0; i++) {
var parentDom = mediaDom[0].parentNode
parentDom.removeChild(mediaDom[0])
if (i >= len) {
break
}
}
}
}
convertMedia()
function closeWindow() {
window.close()
}
//鎴彇缃戝潃鍙傛暟
function QueryString(qs) {
var Ohref = location.href
Ohref = Ohref.replace('?', '?&').split('&')
var re = ''
for (i = 1; i < Ohref.length; i++) {
if (Ohref[i].indexOf(qs + '=') == 0) {
re = Ohref[i].replace(qs + '=', '')
}
}
return re
}
var type = QueryString('type')
if (type === 'older') {
$('body').addClass('older')
}
$(function () {
var channelName = location.pathname.split('/')[2]
var channelsArr = ['szyw', 'qxkx', 'bmdt']
if (channelsArr.indexOf(channelName) == -1 || $('#zoomcon').length == 0) return
var context = $('#zoomcon')
var text = $.trim(context.text())
if (text == '') return
$('head').append(' ')
$.getScript('/szsrmzf/xhtml/static/2023/js/plyr.js', function () {
$.ajax({
url: 'https://service.govwza.cn/api/services/Accessibility/TTS/fullTextMp3',
type: 'post',
contentType: 'application/json',
data: JSON.stringify({
appid: '3c28999baf2031b67bd890ee8f846e73',
mainversion: 4,
referer: encodeURIComponent(location.href),
domain: 'www.suzhou.gov.cn',
text: text,
timestamp: new Date().getTime(),
}),
}).then(function (res) {
if (!res.result || !plyr) return
var audioBaseUrl = 'https://service.govwza.cn'
var url = audioBaseUrl + res.result.path
var audioBox = $('')
context.prepend(audioBox)
plyr.setup('#audio', {
controls: ['play-large', 'play', 'progress', 'current-time', 'captions'],
})
})
})
})