123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- (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 = $('<div class="sideMenu moreProduct"></div>');
- var $head = $('<div class="head"><div class="icon"></div></div>');
- var $body = $('<div class="body"></div>');
- 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 = $('<div class="row row-select" data-i="' + i + '"><div class="current"></div><div class="icon"><img src="' +
- this.options.path + data[i].icon + '" alt=""></div>' + data[i].name + '</div>')
- } else {
- $row = $('<div class="row" data-i="' + i + '"><div class="icon"><img src="' +
- this.options.path + data[i].icon + '" alt=""></div>' + data[i].name + '</div>')
- }
- $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)
|