123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
-
-
-
- <div id="to-top" class="to-top" title="返回顶部">
- <img src="https://oss.zc10000.com/static/images/totop.png" alt="">
- </div>
- </body>
- <script>
-
- layui.use(function(){
-
- var layer = layui.layer
- ,laypage = layui.laypage
- ,laydate = layui.laydate
- ,table = layui.table
- ,carousel = layui.carousel
- ,upload = layui.upload
- ,element = layui.element
- ,slider = layui.slider
- ,dropdown = layui.dropdown
- ,$ = layui.$;
-
- carousel.render({
- elem: '#banner'
- ,arrow: 'always'
- });
-
-
- $(document).on('scroll', function() {
- var $pageScrollTop = $(this).scrollTop()
- if ($pageScrollTop > 200) {
- $('#to-top').show()
- } else {
- $('#to-top').hide()
- }
- })
-
- $('#to-top').on('click', function() {
- $('html, body').stop().animate({
- scrollTop: 0
- })
- });
-
-
-
- $(".open_shangqiao").click(function(event) {
- if ($('#aff-im-root .embed-icon-default').length > 0) {
- $('#aff-im-root .embed-icon-default').click();
- }
- });
-
-
- $('.no_open').click(function(event) {
- layer.msg("该功能暂未开放");
- });
-
-
- $(document).ready(function() {
- $("#div1Link1").click(function() {
- $("html, body").animate({
- scrollTop: $("#divcon1").offset().top }, {duration: 500,easing: "swing"});
- return false;
- });
- $("#div1Link2").click(function() {
- $("html, body").animate({
- scrollTop: $("#divcon2").offset().top }, {duration: 500,easing: "swing"});
- return false;
- });
- $("#div1Link3").click(function() {
- $("html, body").animate({
- scrollTop: $("#divcon3").offset().top }, {duration: 500,easing: "swing"});
- return false;
- });
- $("#div1Link4").click(function() {
- $("html, body").animate({
- scrollTop: $("#divcon4").offset().top }, {duration: 500,easing: "swing"});
- return false;
- });
- $("#div1Link5").click(function() {
- $("html, body").animate({
- scrollTop: $("#divcon5").offset().top }, {duration: 500,easing: "swing"});
- return false;
- });
- });
-
-
- $('.list-s-11-content .top .tab-a').on('click',function (){
- var index = $(this).index();
- console.log(index);
- if(index === 2){
- var ins = 2;
- }
- if(index === 3){
- var ins = 1;
- }
- if(index === 4){
- var ins = 0;
- }
- $('.list-s-11-content .center .box_1').hide();
- $('.list-s-11-content .center .box_1:eq('+ins+')').show();
-
- $('.list-s-11-content .bottom .box-bot-1').hide();
- $('.list-s-11-content .bottom .box-bot-1:eq('+ins+')').show();
-
-
- $('.list-s-11-content .top a').removeClass('tab-a-active');
- $(this).addClass('tab-a-active');
- });
-
-
- function downFile(title,url){
- const filePath = url;
- const fileExt = filePath.substr(filePath.lastIndexOf('.') + 1);
- var title = title + '.' + fileExt;
-
-
- const fileStream = streamSaver.createWriteStream(title);
-
-
-
- fetch(url).then(res => {
- const readableStream = res.body
- if (window.WritableStream && readableStream.pipeTo) {
- return readableStream.pipeTo(fileStream)
- .then(() => console.log('完成写入'))
- }
-
-
- window.writer = fileStream.getWriter()
- const reader = res.body.getReader()
- const pump = () => reader.read()
- .then(res => res.done
- ? writer.close()
- : writer.write(res.value).then(pump)
- )
- pump()
- });
- }
-
-
- $('#down_btn').click(function (){
- layer.msg('正在处理');
- var aid = $(this).attr('aid');
- var title = $(this).attr('title');
- $.ajax({
- type: "POST",
- url: '/api/Ajax/get_user_download',
- data: {del_id:0,_ajax:1,aid:aid},
- dataType: 'json',
- success: function (data) {
- layer.closeAll();
- if(parseInt(data.code) == 1){
- layer.msg(data.msg, {icon: 1});
-
-
-
- downFile(title,data.data.down);
- }else{
-
- layer.confirm(data.msg, {icon: 3}, function(){
- if(data.url != ''){
- window.open('https://www.zc10000.com/?m=user&c=Users&a=login', '_blank');
- }else{
- layer.closeAll();
- }
- }, function(){
-
- });
- }
- },
- error:function(e){
- layer.closeAll();
- layer.alert(e.responseText, {icon: 5});
- }
- });
- return false;
- });
-
-
- $('#like_btn').click(function (){
- layer.msg('正在处理');
- var aid = $(this).attr('aid');
- var title = $(this).attr('title');
- $.ajax({
- type: "POST",
- url: '/api/Ajax/get_user_like',
- data: {del_id:0,_ajax:1,aid:aid},
- dataType: 'json',
- success: function (data) {
- layer.closeAll();
- if(parseInt(data.code) == 1){
- layer.msg(data.msg, {icon: 1});
-
-
-
-
- $("#likecount").html(data.data.likecount);
-
- if(data.data.type == 1 || data.data.type == '1'){
- console.log('1111');
-
- $('.btn-e').addClass('btn-e-active');
- }else{
- $('.btn-e').removeClass('btn-e-active');
- }
- }else{
-
- layer.confirm(data.msg, {icon: 3}, function(){
- if(data.url != ''){
- window.open('https://www.zc10000.com/?m=user&c=Users&a=login', '_blank');
- }else{
- layer.closeAll();
- }
- }, function(){
-
- });
- }
- },
- error:function(e){
- layer.closeAll();
- layer.alert(e.responseText, {icon: 5});
- }
- });
- return false;
- });
-
-
- $('#collect_btn').click(function (){
- layer.msg('正在处理');
- var aid = $(this).attr('aid');
- var title = $(this).attr('title');
- $.ajax({
- type: "POST",
- url: '/api/Ajax/get_user_collect',
- data: {del_id:0,_ajax:1,aid:aid},
- dataType: 'json',
- success: function (data) {
- layer.closeAll();
- if(parseInt(data.code) == 1){
- layer.msg(data.msg, {icon: 1});
-
-
-
-
- $("#collection").html(data.data.collection);
-
- if(data.data.type == 1 || data.data.type == '1'){
- console.log('1111');
-
- $('.btn-d').addClass('btn-e-active');
- }else{
- $('.btn-d').removeClass('btn-e-active');
- }
- }else{
-
- layer.confirm(data.msg, {icon: 3}, function(){
- if(data.url != ''){
- window.open('https://www.zc10000.com/?m=user&c=Users&a=login', '_blank');
- }else{
- layer.closeAll();
- }
- }, function(){
-
- });
- }
- },
- error:function(e){
- layer.closeAll();
- layer.alert(e.responseText, {icon: 5});
- }
- });
- return false;
- });
-
-
- $('#share_btn').on('click',function (){
- $('#share-box').toggle();
- if ($(this).hasClass('btn-e-active')) {
-
- $('.btn-c').removeClass('btn-e-active');
- } else {
-
- $('.btn-c').addClass('btn-e-active');
- }
- });
- });
- </script>
- </html>
|