(function($) { 'use strict'; var SideMenu = function(element, options) { this.options = $.extend({}, SideMenu.DEFAULTS, options); } SideMenu.DEFAULTS = { path: '../../public/libs/douyinsidemenu/', name: '', // 当前页面的名称,菜单中不需要再显示自己的链接 data: [ // {name: '彩铃融合包', icon: 'images/dy-list-rbt.png', url: '../../douyin/rbt15/index.html?fes=jiq&type=poly&sou='}, { name: '抖音彩铃包', icon: 'images/dy-list-rbt.png', url: '../../douyin/rbt15/index.html?fes=jiq&type=poly&sou=' }, { name: '头条流量包', icon: 'images/dy-list-tt.png', url: '../../douyin/poly/index9.html?fes=jh9&type=poly&sou=' }, // { name: '头条流量包', icon: 'images/dy-list-tt.png', url: '../../Tou/Dy/order20220131.html?fes=9om&type=poly&sou=' }, // { name: '头条流量包', icon: 'images/dy-list-tt.png', url: '../../Tou/Dy/order202109.html?fes=9om&type=poly&sou=' }, // { name: '抖音权益包', icon: 'images/dy-list-doubi.png', url: '../../douyin/poly/index20220424.html?fes=jh9&type=poly&sou=' }, { name: '抖音加油包', icon: 'images/icon20g1x.png', url: '../../douyin/30/index20220704.html?fes=jk8&type=poly&sou=' } ] } if (window.location.href.indexOf("Provincnawe") > 0) { SideMenu.DEFAULTS = { path: '../../public/libs/douyinsidemenu/', name: '', // 当前页面的名称,菜单中不需要再显示自己的链接 data: [ { name: '抖音彩铃包', icon: 'images/dy-list-rbt.png', url: 'https://800.wo.cn/orderchannel/douyin/rbt15/channel.html?fes=jj7&type=poly&sou=ub&Provincnawe' }, { name: '头条流量包', icon: 'images/dy-list-tt.png', url: 'https://800.wo.cn/orderchannel/douyin/poly/index9.html?fes=jh9&type=poly&sou=26&Provincnawe' }, { name: '抖音加油包', icon: 'images/icon20g1x.png', url: 'https://800.wo.cn/orderchannel/douyin/30/index20220704.html?fes=jk8&type=poly&sou=26&Provincnawe' } ] } } if (window.location.href.indexOf("ProvincesThree") > 0) { SideMenu.DEFAULTS = { path: '../../public/libs/douyinsidemenu/', name: '', // 当前页面的名称,菜单中不需要再显示自己的链接 data: [ { name: '头条流量包', icon: 'images/dy-list-tt.png', url: 'https://800.wo.cn/orderchannel/douyin/poly/index9cd.html?fes=jkk&sou=n2&type=poly&ProvincesThree' }, { name: '抖音权益包', icon: 'images/dy-list-doubi.png', url: 'https://800.wo.cn/orderchannel/douyin/poly/index15cd.html?fes=jkj&sou=n2&type=poly&ProvincesThree' }, // {name: '头条流量包', icon: 'images/dy-list-tt.png', url: '../../douyin/poly/index9.html?fes=jh9&sou='}, { name: '彩铃融合包', icon: 'images/dy-list-rbt.png', url: 'https://800.wo.cn/orderchannel/douyin/rbt/indexcd.html?fes=jki&sou=n2&type=poly&ProvincesThreey' } ] } } if (window.location.href.indexOf("ProvincesTwo") > 0) { SideMenu.DEFAULTS = { path: '../../public/libs/douyinsidemenu/', name: '', // 当前页面的名称,菜单中不需要再显示自己的链接 data: [ { name: '头条流量包', icon: 'images/dy-list-tt.png', url: 'https://800.wo.cn/orderchannel/douyin/poly/index9cd.html?fes=jkk&sou=n3&type=poly&ProvincesTwo' }, { name: '抖音彩铃包', icon: 'images/dy-list-rbt.png', url: 'https://800.wo.cn/orderchannel/douyin/rbt15/channelcd.html?fes=jkl&sou=n3&type=poly&ProvincesTwo' }, // { name: '头条流量包', icon: 'images/dy-list-tt.png', url: '../../Tou/Dy/order202107.html?fes=9om&type=poly&sou=' }, // { name: '抖音权益包', icon: 'images/dy-list-doubi.png', url: '../../douyin/poly/index15.html?fes=jh9&type=poly&sou=' } ] } } SideMenu.prototype = { init: function() { var $container = $('
'); var $head = $('
'); var $body = $('
'); for (var i = 0; i < this.options.data.length; i++) { var data = this.options.data; var $row = null; if (this.options.name == data[i].name) { $row = $('
' + data[i].name + '
') } else { $row = $('
' + data[i].name + '
') } $row.on('click', function(event) { var sou = getQueryString('sou') window.location.replace(data[$(event.target).data('i')].url + sou + '&t=' + new Date().getTime()) }) $body.append($row); } $container.find('.icon').on('click', function(event) { if (!$container.hasClass('showSelector')) { $container.addClass('showSelector'); } event.stopPropagation(); }) $container.on('click', function(event) { if ($container.hasClass('showSelector')) { if (window.location.href.indexOf("ProvincesTwo") > 0) { $(".showSelector").css("height", "1.67rem"); } $container.removeClass('showSelector'); } else { $container.addClass('showSelector'); if (window.location.href.indexOf("ProvincesTwo") > 0) { $(".showSelector").css("height", "2.76rem"); } } event.stopPropagation(); }); $container.append($head).append($body).appendTo('body'); }, } $.fn.sideMenu = function(options) { return this.each(function() { var sideMenu = new SideMenu(this, options); sideMenu.init(); }) }; function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } })(jQuery)