huaxia/js/huaxia.js

871 lines
24 KiB
JavaScript
Raw Normal View History

2021-09-23 10:47:14 +00:00
function goToPage(e) {
2021-09-16 08:14:56 +00:00
let homeUrl = window.location.href.indexOf('index.html');
2021-09-23 10:47:14 +00:00
switch (e) {
2021-09-16 08:14:56 +00:00
case 1:
2021-09-23 10:47:14 +00:00
console.log('关于我们');
if (homeUrl > -1) {
location.href = 'htmls/aboutUs/aboutUs.html'
} else {
location.href = '../../htmls/aboutUs/aboutUs.html'
}
2021-09-16 08:14:56 +00:00
break;
case 2:
2021-09-23 10:47:14 +00:00
console.log('购物车');
if (homeUrl > -1) {
location.href = 'htmls/logshoppingcar/shopcar.html';
} else {
location.href = '../../htmls/logshoppingcar/shopcar.html';
}
2021-09-16 08:14:56 +00:00
break;
case 3:
2021-09-23 10:47:14 +00:00
console.log('联系我们');
if (homeUrl > -1) {
location.href = 'htmls/contactUs/contactUs.html'
} else {
location.href = '../../htmls/contactUs/contactUs.html'
}
2021-09-16 08:14:56 +00:00
break;
case 4:
2021-09-23 10:47:14 +00:00
// 登录注册
if (homeUrl > -1) {
location.href = 'htmls/logshoppingcar/login.html';
} else {
location.href = '../../htmls/logshoppingcar/login.html';
}
2021-09-16 08:14:56 +00:00
break;
}
2021-09-23 10:47:14 +00:00
2021-09-16 08:14:56 +00:00
}
2021-09-23 10:47:14 +00:00
$(function () {
2021-09-10 09:58:15 +00:00
let reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
2021-09-23 10:47:14 +00:00
$('#submitLY').click(function () {
2021-09-10 09:58:15 +00:00
let name = $('input[name="username"]').val();
let phone = $('input[name="userphone"]').val();
let content = $('input[name="usercontent"]').val();
2021-09-23 10:47:14 +00:00
if (!name) {
2021-09-16 08:14:56 +00:00
console.log('请输入联系人');
2021-09-23 10:47:14 +00:00
} else if (!reg_tel.test(phone)) {
2021-09-10 09:58:15 +00:00
console.log('请输入正确的联系电话');
2021-09-23 10:47:14 +00:00
} else if (!content) {
2021-09-10 09:58:15 +00:00
console.log('请输入联系说明');
} else {
console.log('提交成功');
}
})
2021-09-14 10:05:53 +00:00
// 首页更多事件
var list = $(".sy-more")
2021-09-23 10:47:14 +00:00
$('.sy-more').on('click', function () {
var index = list.index(this); //获取下标
// console.log(index,list.length);
if (index == 0) location.href = 'htmls/artNetwork/exhibition.html'
if (index == 1) location.href = 'htmls/artNetwork/realTimeInfo.html'
if (index == 2) location.href = 'htmls/artNetwork/shoppingMall.html'
if (index == 3) location.href = 'htmls/artNetwork/artist.html'
// if(index==4) location.href = 'htmls/artNetwork/login.html'
if (index == 5) location.href = 'htmls/artNetwork/train.html'
// if(index==6) location.href = 'htmls/artNetwork/train.html'
2021-09-14 10:05:53 +00:00
})
2021-09-09 10:08:53 +00:00
let headH = $('#huaxia-head').height()
2021-09-23 10:47:14 +00:00
$(window).resize(function () { //监听窗口大小的改变
2021-09-09 10:08:53 +00:00
// console.log($(window).width());
})
2021-09-23 10:47:14 +00:00
$('.logo').on('click', function () { //logo图标点击事件
2021-09-03 10:22:26 +00:00
location.href = 'index.html'
})
2021-09-07 09:34:59 +00:00
// 一级导航
2021-09-23 10:47:14 +00:00
$('.dao-box li div').mouseover(function () { //导航悬浮事件
$(this).css("cursor", "pointer")
2021-09-03 10:22:26 +00:00
})
2021-09-23 10:47:14 +00:00
$('.dao-box li div').click(function () { //导航点击事件
2021-09-03 10:22:26 +00:00
$('.dao-box li div').removeClass('cq-dao-active')
$('.dao-box li div div').addClass("dn");
$('.dao-box li span').addClass("dn");
$(this).find(".xiahx").removeClass('dn')
$(this).next(".redD").removeClass('dn')
$(this).addClass('cq-dao-active')
})
2021-09-07 09:34:59 +00:00
// 二级导航
2021-09-14 10:05:53 +00:00
// $('.zx-nav li a').click(function(){
// $('.zx-nav li a').removeClass('zx-nav-title')
// $('.zx-nav li div').removeClass('zx-nav-active')
// $(this).addClass('zx-nav-title')
// $(this).next("div").addClass('zx-nav-active')
// })
2021-09-23 10:47:14 +00:00
$('.zx-nav li').click(function () {
2021-09-14 10:05:53 +00:00
let jgTwoIndex = $(this).index()
$('.zx-nav li span').removeClass('zx-nav-title')
2021-09-07 09:34:59 +00:00
$('.zx-nav li div').removeClass('zx-nav-active')
2021-09-14 10:05:53 +00:00
$(this).find('span').addClass('zx-nav-title')
$(this).find("div").addClass('zx-nav-active')
2021-09-16 08:14:56 +00:00
let urlIndex = window.location.href.indexOf('mechanismBooksDetail.html')
2021-09-23 10:47:14 +00:00
if (urlIndex > -1 && $(this).find('span').text() != '书刊杂志') {
$('#jg-detail').css('display', 'none')
2021-09-16 08:14:56 +00:00
} else {
2021-09-23 10:47:14 +00:00
$('#jg-detail').css('display', '')
2021-09-16 08:14:56 +00:00
}
2021-09-14 10:05:53 +00:00
changeJG()
2021-09-23 10:47:14 +00:00
if (jgTwoIndex == 0) $('#jgjj-box').css('display', '')
if (jgTwoIndex == 1) $('#jgcy-box').css('display', '')
if (jgTwoIndex == 2) $('#jgzh-box').css('display', '')
if (jgTwoIndex == 3) $('#jgysp-box').css('display', '')
if (jgTwoIndex == 4) $('#jgsk-box').css('display', '')
if (jgTwoIndex == 5) $('#jgxw-box').css('display', '')
})
$('.px-nav li a').click(function () { //培训页二级导航
2021-09-08 09:55:15 +00:00
$('.px-nav li a').removeClass('zx-nav-title')
$('.px-nav li div').removeClass('zx-nav-active')
$(this).addClass('zx-nav-title')
$(this).next("div").addClass('zx-nav-active')
})
2021-09-07 09:34:59 +00:00
//三级导航
2021-09-23 10:47:14 +00:00
$('.szx-nav li a').click(function () {
2021-09-07 09:34:59 +00:00
$('.szx-nav li a').removeClass('zx-nav-title')
$('.szx-nav li div').removeClass('zx-nav-active')
$(this).addClass('zx-nav-title')
$(this).next("div").addClass('zx-nav-active')
})
// 资讯页面
// 信息动态、新闻公告切换
2021-09-23 10:47:14 +00:00
$('#zx-xg').click(function () {
if (!$(this).find('.xx-one').hasClass('zx-xx')) {
2021-09-07 09:34:59 +00:00
$(this).find('.xx-one').addClass('zx-xx');
$(this).find('.xx-one').removeClass('zx-gg');
$(this).find('.gg-one').addClass('zx-gg');
$(this).find('.gg-one').removeClass('zx-xx');
} else {
$(this).find('.gg-one').removeClass('zx-gg');
$(this).find('.gg-one').addClass('zx-xx');
$(this).find('.xx-one').removeClass('zx-xx');
$(this).find('.xx-one').addClass('zx-gg');
}
})
// 机构详情的立即关注
2021-09-23 10:47:14 +00:00
$('#follow').click(function () {
if ($(this).text() == '立即关注') {
2021-09-07 09:34:59 +00:00
$(this).text('已关注')
$(this).removeClass('borr')
$(this).addClass('borf')
} else {
$(this).text('立即关注')
$(this).removeClass('borf')
$(this).addClass('borr')
}
})
2021-09-08 09:55:15 +00:00
// 培训课堂介绍、课堂视频、在线直播切换事件
2021-09-23 10:47:14 +00:00
$('#px-item div').click(function () {
2021-09-08 09:55:15 +00:00
$('#px-item div').removeClass('zx-xx')
$('#px-item div').addClass('zx-gg')
$(this).addClass('zx-xx')
$(this).removeClass('zx-gg')
2021-09-23 10:47:14 +00:00
let pxIndex = $(this).index() //0代表课堂介绍、1代表课堂视频、2代表在线直播
switch (pxIndex) {
2021-09-08 09:55:15 +00:00
case 0:
2021-09-23 10:47:14 +00:00
$('#pxsp-list').css('display', 'none')
$('#pxzb-list').css('display', 'none')
$('#px-list').css('display', '')
2021-09-08 09:55:15 +00:00
break;
case 1:
2021-09-23 10:47:14 +00:00
$('#px-list').css('display', 'none')
$('#pxzb-list').css('display', 'none')
$('#pxsp-list').css('display', '')
2021-09-08 09:55:15 +00:00
break;
case 2:
2021-09-23 10:47:14 +00:00
$('#px-list').css('display', 'none')
$('#pxsp-list').css('display', 'none')
$('#pxzb-list').css('display', '')
2021-09-22 07:58:42 +00:00
break;
}
})
// 培训课堂介绍、课堂视频、在线直播切换事件
2021-09-23 10:47:14 +00:00
$('#zl-item div').click(function () {
2021-09-22 07:58:42 +00:00
$('#zl-item div').removeClass('zx-xx')
$('#zl-item div').addClass('zx-gg')
$(this).addClass('zx-xx')
$(this).removeClass('zx-gg')
2021-09-23 10:47:14 +00:00
let pxIndex = $(this).index() //0代表课堂介绍、1代表课堂视频、2代表在线直播
$('#zling').css('display', 'none')
$('#zlwill').css('display', 'none')
$('#zled').css('display', 'none')
$('#zlDetail').css('display', 'none')
switch (pxIndex) {
2021-09-22 07:58:42 +00:00
case 0:
2021-09-23 10:47:14 +00:00
$('#zling').css('display', '')
2021-09-22 07:58:42 +00:00
break;
case 1:
2021-09-23 10:47:14 +00:00
$('#zlwill').css('display', '')
2021-09-22 07:58:42 +00:00
break;
case 2:
2021-09-23 10:47:14 +00:00
$('#zled').css('display', '')
2021-09-08 09:55:15 +00:00
break;
}
})
2021-09-07 09:34:59 +00:00
// let childer = document.querySelectorAll('.ysj .ya-item-box').length
// if(childer==5) {
// $('.ysj').css({"justify-content":"space-between","marginRight":0})
// $('.ysj .ya-item-box').css({"marginRight":0})
// }
2021-09-23 10:47:14 +00:00
checkPMShop() //拍卖所有商品事件
2021-09-16 08:14:56 +00:00
let zhTop = 0
2021-09-23 10:47:14 +00:00
$(window).scroll(function () {
if (($(window).height() + $(window).scrollTop() + 0) >= $(document).height()) {
if (zhTop == 0) zhTop = $(window).scrollTop() / 2
2021-09-22 07:58:42 +00:00
// $('.zx-more').css('display','flex')
// setTimeout(function(){
// $('.zx-more').css('display','none')
// window.scrollBy(0,-10);
// },1500)
2021-09-16 08:14:56 +00:00
// checkPMShop()
2021-09-23 10:47:14 +00:00
}
2021-09-07 09:34:59 +00:00
});
2021-09-23 10:47:14 +00:00
ysEJ() //艺术家二级分类
2021-09-09 10:08:53 +00:00
// 艺术家二级分类切换事件
2021-09-23 10:47:14 +00:00
$('#ys-cate li').click(function () {
2021-09-09 10:08:53 +00:00
$('#ys-cate li a').removeClass('zx-nav-title')
$('#ys-cate li div').removeClass('zx-nav-active')
$(this).find('a').addClass('zx-nav-title')
$(this).find('div').addClass('zx-nav-active')
})
// 艺术家二级切换
2021-09-23 10:47:14 +00:00
$('#ys-nav li').click(function () {
2021-09-09 10:08:53 +00:00
let ysIndex = $(this).index()
2021-09-23 10:47:14 +00:00
switch (ysIndex) {
2021-09-09 10:08:53 +00:00
case 0:
2021-09-23 10:47:14 +00:00
$('#ysj-jj').css('display', '')
$('#ysj-zp').css('display', 'none')
$('#ysj-ft').css('display', 'none')
$('#ysj-sk').css('display', 'none')
2021-09-09 10:08:53 +00:00
break;
case 1:
2021-09-23 10:47:14 +00:00
$('#ysj-zp').css('display', '')
$('#ysj-jj').css('display', 'none')
$('#ysj-ft').css('display', 'none')
$('#ysj-sk').css('display', 'none')
2021-09-09 10:08:53 +00:00
break;
case 2:
2021-09-23 10:47:14 +00:00
$('#ysj-ft').css('display', '')
$('#ysj-zp').css('display', 'none')
$('#ysj-jj').css('display', 'none')
$('#ysj-sk').css('display', 'none')
2021-09-09 10:08:53 +00:00
break;
case 3:
2021-09-23 10:47:14 +00:00
$('#ysj-sk').css('display', '')
$('#ysj-zp').css('display', 'none')
$('#ysj-ft').css('display', 'none')
$('#ysj-jj').css('display', 'none')
2021-09-09 10:08:53 +00:00
break;
}
})
2021-09-13 10:09:41 +00:00
// 商品购买时的加
2021-09-23 10:47:14 +00:00
$('.addNum').click(function () {
2021-09-13 10:09:41 +00:00
let dnum = $('#numVal').val()
dnum++
$('#numVal').val(dnum)
})
// 商品购买时的减
2021-09-23 10:47:14 +00:00
$('.delNum').click(function () {
2021-09-13 10:09:41 +00:00
let dnum = $('#numVal').val()
2021-09-23 10:47:14 +00:00
if (dnum > 1) {
2021-09-13 10:09:41 +00:00
dnum--
$('#numVal').val(dnum)
}
})
// 商城的更多事件
2021-09-23 10:47:14 +00:00
$('#rem-more,#sh-more,#cq-more,#jf-more').click(function () {
2021-09-16 08:14:56 +00:00
location.href = "shopMore.html"
2021-09-13 10:09:41 +00:00
})
// 调起兑换弹框
2021-09-23 10:47:14 +00:00
$('#duih').click(function () {
2021-09-13 10:09:41 +00:00
$('#isTank').fadeIn()
2021-09-23 10:47:14 +00:00
$('#duik').css('display', '')
2021-09-13 10:09:41 +00:00
})
// 关闭弹框
2021-09-23 10:47:14 +00:00
$('.close-q').click(function () {
2021-09-14 10:05:53 +00:00
closeTK()
2021-09-13 10:09:41 +00:00
})
// 立即兑换提交事件
2021-09-23 10:47:14 +00:00
$('#sumitdh').click(function () {
$('#duik').css('display', 'none')
$('#success_fail').css('display', '')
2021-09-13 10:09:41 +00:00
let isFlag = true
2021-09-23 10:47:14 +00:00
if (isFlag) {
$('#successk').css('display', '')
} else $('#failk').css('display', '')
2021-09-13 10:09:41 +00:00
})
// 去购物
2021-09-23 10:47:14 +00:00
$('.goShop').click(function () {
2021-09-16 08:14:56 +00:00
location.href = "pointsMall.html"
2021-09-13 10:09:41 +00:00
})
// 调起投稿界面
2021-09-23 10:47:14 +00:00
$('#toug').click(function () {
2021-09-13 10:09:41 +00:00
$('#isTank').fadeIn()
2021-09-23 10:47:14 +00:00
$('#duik').css('display', '')
$('#success_fail').css('display', 'none')
2021-09-13 10:09:41 +00:00
})
// 去展览
2021-09-23 10:47:14 +00:00
$('.goZhanl').click(function () {
2021-09-13 10:09:41 +00:00
location.href = `exhibition.html`
})
// 继续投票
2021-09-23 10:47:14 +00:00
$('.continueTP').click(function () {
2021-09-13 10:09:41 +00:00
console.log('继续投票');
})
2021-09-14 10:05:53 +00:00
// 图片选择
2021-09-23 10:47:14 +00:00
$('#inputImg').change(function () {
$filePath = URL.createObjectURL(this.files[0]);
$('#upImg').attr('src', $filePath);
$('#fileBox').css('display', 'none')
$('#upImg').css('display', 'inline')
$("#inputImg+#uptxt").val(`${this.files[0].name}`)
})
//图片选择页面复用
$('.inputImg').change(function (e) {
$filePath = URL.createObjectURL(this.files[0]);
$(e.target).next().attr('src', $filePath);
$('.fileBox').css('display', 'none')
$(e.target).next().css('display', 'inline')
2021-09-22 07:31:56 +00:00
console.log($(e.target).next().attr("class"));
2021-09-23 10:47:14 +00:00
if ($(e.target).next().attr("class") != "upImg") {
$(".uptoux").attr('src', $filePath);
$(".tyjgzx_topimgtx").css("display", "block")
2021-09-18 03:38:27 +00:00
}
2021-09-14 10:05:53 +00:00
})
// 立即投稿
2021-09-23 10:47:14 +00:00
$('#submitTG').click(function () {
2021-09-14 10:05:53 +00:00
closeTK()
})
2021-09-14 10:18:33 +00:00
// 去选择地址页面
2021-09-23 10:47:14 +00:00
$('.goChooseDZ').on('click', function () {
2021-09-14 10:18:33 +00:00
location.href = ''
})
2021-09-07 09:34:59 +00:00
// 监听页面滚动条变化
2021-09-23 10:47:14 +00:00
$(window).scroll(function () {
2021-09-07 09:34:59 +00:00
// 获取滚动条距离顶部的距离
let s = $(window).scrollTop();
2021-09-23 10:47:14 +00:00
if (s > 1000) {
2021-09-07 09:34:59 +00:00
$('#gotoTop').fadeIn(100);
} else {
$('#gotoTop').fadeOut(200);
}
})
2021-09-23 10:47:14 +00:00
$('.search_img').on('click', function () {
$('#previewImg').css('display', 'flex')
2021-09-22 07:58:42 +00:00
})
2021-09-23 10:47:14 +00:00
$('#previewImg').on('click', function () {
$(this).css('display', 'none')
2021-09-22 07:58:42 +00:00
})
2021-09-23 10:47:14 +00:00
$('#previewImg .closeImg').on('click', function () {
$('#previewImg').css('display', 'none')
2021-09-22 07:58:42 +00:00
})
2021-09-24 10:12:41 +00:00
//展览详情作品搜索点击事件
2021-09-27 07:05:00 +00:00
$('.zpsearch-box img').on('click', function () {
2021-09-22 07:58:42 +00:00
console.log('作品搜索');
})
2021-09-24 10:12:41 +00:00
//功能按钮事件
2021-09-27 07:05:00 +00:00
$('.gongn').on('click', function () {
2021-09-24 10:12:41 +00:00
$(this).toggleClass('trans90')
$('.cell-nav').toggleClass('dn')
$('.cell-input').addClass('dn')
})
//关闭功能弹框
2021-09-27 07:05:00 +00:00
$('.cell-nav').on('click', function () {
2021-09-24 10:12:41 +00:00
$('.gongn').toggleClass('trans90')
$('.cell-nav').toggleClass('dn')
$('.cell-input').addClass('dn')
})
//功能按钮事件
2021-09-27 07:05:00 +00:00
$('.shous').on('click', function () {
2021-09-24 10:12:41 +00:00
$("input[name='keyWord']").val('')
$('.cell-input').toggleClass('dn')
$('.gongn').removeClass('trans90')
$('.cell-nav').addClass('dn')
})
//功能按钮事件
2021-09-27 07:05:00 +00:00
$('.cell-input').on('click', function () {
2021-09-24 10:12:41 +00:00
$("input[name='keyWord']").val('')
$(this).addClass('dn')
})
// 阻止事件冒泡
2021-09-27 07:05:00 +00:00
$('input[name="keyWord"]').on("click", function (event) {
2021-09-24 10:12:41 +00:00
event.stopPropagation()
})
2021-09-07 09:34:59 +00:00
})
2021-09-23 10:47:14 +00:00
2021-09-24 10:12:41 +00:00
function searchKey(e) { //导航关键词搜索
2021-09-27 07:05:00 +00:00
if (e.key == 'Enter') {
2021-09-24 10:12:41 +00:00
console.log('导航关键词搜索');
$('.cell-input').toggleClass('dn')
}
}
2021-09-27 07:05:00 +00:00
2021-09-23 10:47:14 +00:00
function searchZP() { //展览详情作品搜索事件
2021-09-22 07:58:42 +00:00
console.log('作品搜索');
}
2021-09-23 10:47:14 +00:00
function changeJG() {
$('#jgjj-box').css('display', 'none')
$('#jgcy-box').css('display', 'none')
$('#jgzh-box').css('display', 'none')
$('#jgysp-box').css('display', 'none')
$('#jgsk-box').css('display', 'none')
$('#jgxw-box').css('display', 'none')
2021-09-14 10:05:53 +00:00
}
2021-09-23 10:47:14 +00:00
function closeTK() { //关闭弹框
2021-09-14 10:05:53 +00:00
$('#isTank').fadeOut()
2021-09-23 10:47:14 +00:00
$('#failk').css('display', 'none')
$('#success_fail').css('display', 'none')
$('#successk').css('display', 'none')
$('#duik').css('display', 'none')
2021-09-14 10:05:53 +00:00
// 重置我要投稿
2021-09-23 10:47:14 +00:00
$('#upImg').attr('src', '')
$('#fileBox').css('display', 'flex')
$('#upImg').css('display', 'none')
2021-09-14 10:05:53 +00:00
$('#cicun').val('')
$('#name').val('')
}
2021-09-23 10:47:14 +00:00
function checkPMShop() { //拍卖全部商品事件
2021-09-08 09:55:15 +00:00
let pmdHtml = '';
2021-09-23 10:47:14 +00:00
let pmdData = [{
imgSrc: '../../img/public/jg-dy-01.png',
title: '艺术清酒--得寓(酒标作品)Delight Sake',
time: 'RMB 1,500'
},
{
imgSrc: '../../img/public/jg-dy-02.png',
title: '艺术清酒--得寓(酒标作品)',
time: 'RMB 1,500'
},
{
imgSrc: '../../img/public/jg-dy-03.png',
title: '艺术清酒--得寓(酒标作品)Delight Sake',
time: 'RMB 1,500'
},
{
imgSrc: '../../img/public/jg-dy-04.png',
title: '艺术清酒--得寓(酒标作品)',
time: 'RMB 1,500'
},
{
imgSrc: '../../img/public/jg-dy-05.png',
title: '艺术清酒--得寓(酒标作品)',
time: 'RMB 1,500'
},
{
imgSrc: '../../img/public/jg-dy-06.png',
title: '艺术清酒--得寓(酒标作品)',
time: 'RMB 1,500'
},
{
imgSrc: '../../img/public/jg-dy-07.png',
title: '艺术清酒--得寓(酒标作品)',
time: 'RMB 1,500'
},
{
imgSrc: '../../img/public/jg-dy-08.png',
title: '艺术清酒--得寓(酒标作品)',
time: 'RMB 1,500'
},
2021-09-08 09:55:15 +00:00
]
2021-09-23 10:47:14 +00:00
$.each(pmdData, function (commentIndex, comment) {
pmdHtml += `<div class="dfc w25 m-s30" onclick="goPMSDetail(${commentIndex})">
2021-09-08 09:55:15 +00:00
<img class="w90" src="${comment.imgSrc}" alt="图标丢失" title="${comment.title}" >
<div class="font-18 fb m-s20 w90 clips1">${comment.title}</div>
<div class="font-13 m-s10 w90 clips1">起拍价<span class="colcb">${comment.time}</span></div>
</div>`
});
2021-09-23 10:47:14 +00:00
$('#pmd-list').prepend(pmdHtml);
$('#pmd-list img').mouseover(function () { //导航悬浮事件
$(this).css({
"cursor": "pointer"
})
$(this).nextAll('div').css('color', '#CB1919')
2021-09-08 09:55:15 +00:00
})
2021-09-23 10:47:14 +00:00
$('#pmd-list img').mouseout(function () { //导航悬浮事件
$(this).nextAll('div').css('color', '#000000')
2021-09-08 09:55:15 +00:00
})
}
2021-09-23 10:47:14 +00:00
function goPMSDetail(e) { //查看资讯详情
2021-09-08 09:55:15 +00:00
location.href = `auctionShopDetail.html?id=${e}`
}
2021-09-23 10:47:14 +00:00
function ysEJ() { //艺术家页面二级分类
2021-09-09 10:08:53 +00:00
let yspHtml = '';
2021-09-23 10:47:14 +00:00
let yspData = ['全部', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
$.each(yspData, function (commentIndex, comment) {
if (commentIndex == 0) {
yspHtml += `<li><a href="javascript:;" class="zx-nav-title">${comment}</a><div class="zx-nav-active"></div></li>`
} else yspHtml += `<li><a href="javascript:;">${comment}</a><div></div></li>`
2021-09-09 10:08:53 +00:00
});
$('#ys-cate').prepend(yspHtml);
}
2021-09-23 10:47:14 +00:00
function checkYSZZList() { //查询艺术家杂志列表
2021-09-09 10:08:53 +00:00
let ysjzzHtml = '';
2021-09-23 10:47:14 +00:00
let ysjzzData = [{
imgSrc: '',
title: '',
time: ''
},
{
imgSrc: '../../img/public/jg-sk-02.png',
title: '新中国美术家系列—曹辉作品集',
time: '2021.07.09 - 2021.07.19'
},
{
imgSrc: '../../img/public/jg-sk-03.png',
title: '新中国美术家系列—曹辉作品集',
time: '2021.07.09 - 2021.07.19'
},
{
imgSrc: '../../img/public/jg-sk-04.png',
title: '新中国美术家系列—曹辉作品集',
time: '2021.07.09 - 2021.07.19'
},
2021-09-09 10:08:53 +00:00
]
2021-09-23 10:47:14 +00:00
$.each(ysjzzData, function (commentIndex, comment) {
ysjzzHtml += `<div class="dfc w25 m-s30" onclick="goysjSKDetail(${commentIndex})">
2021-09-09 10:08:53 +00:00
<img class="w90" src="${comment.imgSrc}" alt="图标丢失" title="${comment.title}" >
<div class="font-18 fb m-s20 w90 clips1">${comment.title}</div>
<div class="font-13 m-s10 w90 clips1">出版时间${comment.time}</div>
</div>`
});
2021-09-23 10:47:14 +00:00
$('#ysjzz-list img').mouseover(function () { //内容悬浮事件
$(this).css({
"cursor": "pointer"
})
$(this).nextAll('div').css('color', '#CB1919')
2021-09-09 10:08:53 +00:00
})
2021-09-23 10:47:14 +00:00
$('#ysjzz-list img').mouseout(function () { //内容悬浮事件
$(this).nextAll('div').css('color', '#000000')
2021-09-09 10:08:53 +00:00
})
}
2021-09-23 10:47:14 +00:00
function goysjSKDetail(e) { //查看书刊详情
2021-09-09 10:08:53 +00:00
location.href = `artistSKDetail.html?id=${e}`
}
2021-09-23 10:47:14 +00:00
function toup(e) { //投票调起弹框
2021-09-13 10:09:41 +00:00
$('#isTank').fadeIn()
2021-09-23 10:47:14 +00:00
$('#duik').css('display', 'none')
$('#success_fail').css('display', '')
$('#successk').css('display', '')
2021-09-13 10:09:41 +00:00
}
2021-09-06 09:56:27 +00:00
// 回到顶部
2021-09-23 10:47:14 +00:00
function pageScroll() {
window.scrollBy(0, -100);
scrolldelay = setTimeout('pageScroll()', 0);
var sTop = document.documentElement.scrollTop + document.body.scrollTop;
if (sTop == 0) clearTimeout(scrolldelay);
}
$(".tyjgzx_sc").on("click", () => {
if ($(event.target).attr("data-in") == 1) {
$($(".tyjgzx_sccon")[1]).css("display", "none")
$($(".tyjgzx_sccon")[0]).css("display", "flex")
$($(".tyjgzx_sc")[0]).addClass("tyjgzx_yhd");
$($(".tyjgzx_sc")[1]).removeClass("tyjgzx_yhd");
} else {
$($(".tyjgzx_sccon")[0]).css("display", "none")
$($(".tyjgzx_sccon")[1]).css("display", "flex")
$($(".tyjgzx_sc")[1]).addClass("tyjgzx_yhd");
$($(".tyjgzx_sc")[0]).removeClass("tyjgzx_yhd");
}
})
function tyList(data, navIf = true) {
if (navIf) {
$(".tyjgzx_lititnoe").addClass("tyjgzx_litittwo");
$(".tyjgzx_lititnoe").removeClass("tyjgzx_lititnoe");
$($(".tyjgzx_leftcon")[data - 1]).addClass("tyjgzx_lititnoe");
$($(".tyjgzx_leftcon")[data - 1]).removeClass("tyjgzx_litittwo");
}
$(".tyjgzx_ris").css("display", "none")
for (let index = 0; index < $(".tyjgzx_ris").length; index++) {
2021-09-27 07:05:00 +00:00
console.log($($(".tyjgzx_ris")[index]).attr("data-in") == data);
2021-09-23 10:47:14 +00:00
if ($($(".tyjgzx_ris")[index]).attr("data-in") == data) {
2021-09-27 07:05:00 +00:00
console.log();
2021-09-23 10:47:14 +00:00
$($(".tyjgzx_ris")[index]).css("display", "block")
$([index]).css("display", "block")
}
}
$(".tygrzx_lititnoe").addClass("tygrzx_litittwo");
$(".tygrzx_lititnoe").removeClass("tygrzx_lititnoe");
$($(".tygrzx_leftcon")[data - 1]).addClass("tygrzx_lititnoe");
$($(".tygrzx_leftcon")[data - 1]).removeClass("tygrzx_litittwo");
$(".tygrzx_ris").css("display", "none")
for (let index = 0; index < $(".tygrzx_ris").length; index++) {
if ($($(".tygrzx_ris")[index]).attr("data-in") == data) {
$($(".tygrzx_ris")[index]).css("display", "block")
$([index]).css("display", "block")
}
}
}
// 菜单事件
$(".naliu").on("click", () => {
$(".tyjgzx_left").css("left", "5%")
})
$(".tyjgzx_caidan").on("click", () => {
$(".tyjgzx_left").css("left", "-65PX")
})
// 添加按钮
$(".tyjgzx_newsBulletin").on("click", (e) => {
e.preventDefault()
tyList(3)
})
$(".tyjgzx_exhibitionSubmit").on("click", (e) => {
e.preventDefault()
tyList(4)
})
$(".tyjgzx_submissionArtwork").on("click", (e) => {
e.preventDefault()
tyList(5)
})
$(".tyjgzx_submitBooks").on("click", (e) => {
e.preventDefault()
tyList(6)
})
$(".tyjgzx_submissionInformation").on("click", (e) => {
e.preventDefault()
tyList(7)
})
$(".tyjgzx_MemberSubmittingBody").on("click", (e) => {
e.preventDefault()
tyList(8)
})
// 全选
$(".tyjgzx_selected").on("click", (e) => {
if ($(e.target).prop("checked")) {
$(e.target).prop("checked", true);
} else {
$(e.target).prop("checked", false);
}
})
$('p').parent()
$(".tyjgzx_selectAll").on("click", (e) => {
if ($(e.target).prop("checked")) {
$(e.target).parent().parent().parent().next().find(".tyjgzx_selected").prop("checked", true);
$(e.target).prop("checked", true);
} else {
$(e.target).parent().parent().parent().next().find(".tyjgzx_selected").prop("checked", false);
$(e.target).prop("checked", false);
}
})
//个人中心
// 弹窗点击
// 收货地址弹窗
function shippingAddress(params) {
if (params) {
$(".tygrzx_shclick").css("display", "flex")
} else {
$(".tygrzx_shclick").css("display", "none")
}
}
$(".tygrzx_addressEditing").on("click", () => {
shippingAddress(true)
})
$(".tygrzx_cz").on("click", () => {
shippingAddress(true)
})
$(".tygrzx_shgb").on("click", () => {
shippingAddress(false)
})
$(".tygrzx_saveAddress").on("click", () => {
shippingAddress(false)
})
//申请售后
function applyAfterSales(params) {
if (params) {
$(".tygrzx_sqshclick").css("display", "flex")
} else {
$(".tygrzx_sqshclick").css("display", "none")
}
}
$(".tygrzx_fterSubmission").on("clicl", () => {
applyAfterSales(false)
})
$(".tygrzx_sqtc").on("click", () => {
applyAfterSales(true)
})
$(".tygrzx_shtcgb").on("click", () => {
applyAfterSales(false)
})
//售后结果弹窗
function afterResults(params) {
if (params) {
$(".tygrzx_sqjgclick").css("display", "flex")
} else {
$(".tygrzx_sqjgclick").css("display", "none")
}
}
$(".tygrzx_sqjgtc").on("click", () => {
afterResults(true)
})
$(".tygrzx_shjggb").on("click", () => {
afterResults(false)
})
// 签到弹窗
$(".tygrzx_qdaoclick").on("click", () => {
signPrompt(true)
})
$(".tygrzx_qdgban").on("click", () => {
signPrompt(false)
})
$(".signImmediately").on("click", () => {
signPrompt(false)
})
function signPrompt(params) {
if (params) {
$(".tygrzx_qdao").css("display", "flex")
} else {
$(".tygrzx_qdao").css("display", "none")
}
}
// 优惠切换
$(".yhdj").on("click", (e) => {
if ($(e.target).attr("data-in") == 1) {
$($(".tygrzx_tp")[1]).css("display", "none")
$($(".tygrzx_tp")[0]).css("display", "flex")
$($(".yhdj")[0]).addClass("tygrzx_yhd");
$($(".yhdj")[1]).removeClass("tygrzx_yhd");
} else {
$($(".tygrzx_tp")[0]).css("display", "none")
$($(".tygrzx_tp")[1]).css("display", "flex")
$($(".yhdj")[1]).addClass("tygrzx_yhd");
$($(".yhdj")[0]).removeClass("tygrzx_yhd");
}
})
// 我的关注
$(".tygrzx_ysnav").on("click", (e) => {
if ($(e.target).attr("data-in") == 1) {
$($(".tygrzx_yscon")[1]).css("display", "none")
$($(".tygrzx_yscon")[0]).css("display", "flex")
$($(".tygrzx_ysnav")[0]).addClass("tygrzx_yhd");
$($(".tygrzx_ysnav")[1]).removeClass("tygrzx_yhd");
} else {
$($(".tygrzx_yscon")[0]).css("display", "none")
$($(".tygrzx_yscon")[1]).css("display", "flex")
$($(".tygrzx_ysnav")[1]).addClass("tygrzx_yhd");
$($(".tygrzx_ysnav")[0]).removeClass("tygrzx_yhd");
}
})
$(".tygrzx_sc").on("click", (e) => {
if ($(e.target).attr("data-in") == 1) {
$($(".tygrzx_sccon")[1]).css("display", "none")
$($(".tygrzx_sccon")[0]).css("display", "flex")
$($(".tygrzx_sc")[0]).addClass("tygrzx_yhd");
$($(".tygrzx_sc")[1]).removeClass("tygrzx_yhd");
} else {
$($(".tygrzx_sccon")[0]).css("display", "none")
$($(".tygrzx_sccon")[1]).css("display", "flex")
$($(".tygrzx_sc")[1]).addClass("tygrzx_yhd");
$($(".tygrzx_sc")[0]).removeClass("tygrzx_yhd");
}
})
// 主题内容切换
// 菜单事件
$(".naliu").on("click", () => {
$(".tygrzx_left").css("left", "5%")
})
$(".tygrzx_caidan").on("click", () => {
$(".tygrzx_left").css("left", "-65PX")
})
// 删除提示
$(".tygrzx_scsc").on("click", () => {
DeletePromptve(true)
})
$(".tygrzx_movesc").on("click", () => {
DeletePromptve(false)
})
function DeletePromptve(data) {
if (data) {
$(".tygrzx_move").css("display", "flex")
} else {
$(".tygrzx_move").css("display", "none")
}
}
$(".tygrzx_ysqxgz").on("click", (e) => {
e.preventDefault()
2021-09-27 07:05:00 +00:00
})
function getScrollTop() {
var scroll_top = 0;
if (document.documentElement && document.documentElement.scrollTop) {
scroll_top = document.documentElement.scrollTop;
} else if (document.body) {
scroll_top = document.body.scrollTop;
}
return scroll_top;
}
document.addEventListener("scroll", myFunction);
function myFunction() {
console.log(getScrollTop());
if (getScrollTop() > 125) {
$(".pod").css("position", "fixed")
$(".pod").addClass("dtip")
} else if (getScrollTop() < 125) {
$(".pod").css("position", "relative")
$(".pod").removeClass("dtip")
}
}