|
@@ -0,0 +1,464 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html>
|
|
|
+ <head>
|
|
|
+ <meta charset="utf-8">
|
|
|
+ <title>行业选择</title>
|
|
|
+ <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
|
|
+ <meta name="apple-mobile-web-app-capable" content="yes">
|
|
|
+ <meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
|
+ <script src="/vipsubscribe/js/rem.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+ <link rel="stylesheet" href="/vipsubscribe/css/weui.min.css?v={{Msg "seo" "version"}}">
|
|
|
+ <link rel="stylesheet" type="text/css" href="/vipsubscribe/css/base.css?v={{Msg "seo" "version"}}" />
|
|
|
+ <link rel="stylesheet" type="text/css" href="/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />
|
|
|
+ <link rel="stylesheet" href="/vipsubscribe/css/choose_industry.css?v={{Msg "seo" "version"}}">
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+ <main class="choose_industry main">
|
|
|
+ <div class="result">
|
|
|
+ <span class="label">已选择:</span>
|
|
|
+ <span class="result_name">全部行业</span>
|
|
|
+ </div>
|
|
|
+ <div class="form">
|
|
|
+ <div class="select-area-box">
|
|
|
+ <ul class="list">
|
|
|
+ <li class="list_item" id="all">
|
|
|
+ <div class="item_label"></div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">全部行业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="A">
|
|
|
+ <div class="item_label">A</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">安监</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="B">
|
|
|
+ <div class="item_label">B</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">保监</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="C">
|
|
|
+ <div class="item_label">C</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">财政</button>
|
|
|
+ <button class="industry_item">出版广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="D">
|
|
|
+ <div class="item_label">D</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="E">
|
|
|
+ <div class="item_label">E</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="F">
|
|
|
+ <div class="item_label">F</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="G">
|
|
|
+ <div class="item_label">G</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="H">
|
|
|
+ <div class="item_label">H</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="I">
|
|
|
+ <div class="item_label">I</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="J">
|
|
|
+ <div class="item_label">J</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="K">
|
|
|
+ <div class="item_label">K</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="L">
|
|
|
+ <div class="item_label">L</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="M">
|
|
|
+ <div class="item_label">M</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="N">
|
|
|
+ <div class="item_label">N</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="O">
|
|
|
+ <div class="item_label">O</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="P">
|
|
|
+ <div class="item_label">P</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="Q">
|
|
|
+ <div class="item_label">Q</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="R">
|
|
|
+ <div class="item_label">R</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="S">
|
|
|
+ <div class="item_label">S</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="T">
|
|
|
+ <div class="item_label">T</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="U">
|
|
|
+ <div class="item_label">U</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="V">
|
|
|
+ <div class="item_label">V</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="W">
|
|
|
+ <div class="item_label">W</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="X">
|
|
|
+ <div class="item_label">X</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="Y">
|
|
|
+ <div class="item_label">Y</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="Z">
|
|
|
+ <div class="item_label">Z</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <button class="industry_item">电力</button>
|
|
|
+ <button class="industry_item">广电</button>
|
|
|
+ <button class="industry_item">传媒</button>
|
|
|
+ <button class="industry_item">城管</button>
|
|
|
+ <button class="industry_item">采矿业</button>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="slide">
|
|
|
+ <a href="javascript:;">#</a>
|
|
|
+ <a href="javascript:;">A</a>
|
|
|
+ <a href="javascript:;">B</a>
|
|
|
+ <a href="javascript:;">C</a>
|
|
|
+ <a href="javascript:;">D</a>
|
|
|
+ <a href="javascript:;">E</a>
|
|
|
+ <a href="javascript:;">F</a>
|
|
|
+ <a href="javascript:;">G</a>
|
|
|
+ <a href="javascript:;">H</a>
|
|
|
+ <a href="javascript:;">I</a>
|
|
|
+ <a href="javascript:;">J</a>
|
|
|
+ <a href="javascript:;">K</a>
|
|
|
+ <a href="javascript:;">L</a>
|
|
|
+ <a href="javascript:;">M</a>
|
|
|
+ <a href="javascript:;">N</a>
|
|
|
+ <a href="javascript:;">O</a>
|
|
|
+ <a href="javascript:;">P</a>
|
|
|
+ <a href="javascript:;">Q</a>
|
|
|
+ <a href="javascript:;">R</a>
|
|
|
+ <a href="javascript:;">S</a>
|
|
|
+ <a href="javascript:;">T</a>
|
|
|
+ <a href="javascript:;">U</a>
|
|
|
+ <a href="javascript:;">V</a>
|
|
|
+ <a href="javascript:;">W</a>
|
|
|
+ <a href="javascript:;">X</a>
|
|
|
+ <a href="javascript:;">Y</a>
|
|
|
+ <a href="javascript:;">Z</a>
|
|
|
+ </div>
|
|
|
+ <!-- <div class="bottom_button">
|
|
|
+ <button class="reset-btn left_btn" disabled>重置</button>
|
|
|
+ <button class="save-btn right_btn" disabled>确认</button>
|
|
|
+ </div> -->
|
|
|
+ <div class="tips_btn">
|
|
|
+ <div class="tips_discount">
|
|
|
+ <div class="tips_d_money" style="display: block">¥38</div>
|
|
|
+ <div class="tips_d_text">已选择4个行业,建议购买“全部行业”更划算哦~</div>
|
|
|
+ </div>
|
|
|
+ <div class="btns">
|
|
|
+ <button class="reset-btn">重置</button>
|
|
|
+ <button class="save-btn">确认</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </main>
|
|
|
+ <script src="/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+ <script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+ <script src="/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+ <script>
|
|
|
+ // 点击导航跳转
|
|
|
+ $("body").on('click','.slide a',function(){
|
|
|
+ var s = $(this).html()
|
|
|
+ if(s == '#'){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ document.querySelector('#' + s).scrollIntoView({block:'center'});
|
|
|
+ })
|
|
|
+ // 是否选中全国
|
|
|
+ function checkedAll(){
|
|
|
+ // 判断全部行业以外有没有被选中
|
|
|
+ $('.list_item:not(#all)').each(function () {
|
|
|
+ let isActive = $(this).children().children('button').hasClass('active')
|
|
|
+ if(!isActive){
|
|
|
+ $('#all').children().children('button').addClass('active')
|
|
|
+ }else{
|
|
|
+ $('#all').children().children('button').removeClass('active')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 在续订里,要保存已经选中的数组并置灰,按需要拼接上选中的行业数组
|
|
|
+
|
|
|
+ // button一共有以下几个操作属性
|
|
|
+ // 1. class中有active,表示当前被选中
|
|
|
+ // 2. button具有自定义属性disabled,此时button不能触发click事件,可以在续订中用来表示不可选的按钮
|
|
|
+
|
|
|
+ // var slideLetters = ['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']
|
|
|
+
|
|
|
+ // 参数: (用数据创建行业的DOM)
|
|
|
+ // letter: 为首字母,大写
|
|
|
+ // industryArr: 该首字母下的行业数组,默认为[]/
|
|
|
+ // 格式类似:disabled为true则按钮置灰,不能被点击
|
|
|
+ // [
|
|
|
+ // { name: '电力', disabled: true },
|
|
|
+ // { name: '采矿业', disabled: true }
|
|
|
+ // ]
|
|
|
+ function insertIndustryItem (letter, industryArr = []) {
|
|
|
+ if (!letter) return
|
|
|
+ var query = `#${letter[0].toUpperCase()} .item_industry_list`
|
|
|
+ var industryItemContainer = $(query)
|
|
|
+ var buttonArr = []
|
|
|
+
|
|
|
+ for (var i = 0; i < industryArr.length; i++) {
|
|
|
+ buttonArr.push(`<button class="industry_item" ${industryArr[i].disabled ? 'disabled': ''}>${industryArr[i].name}</button>`)
|
|
|
+ }
|
|
|
+ industryItemContainer.html(buttonArr.join(''))
|
|
|
+ }
|
|
|
+ // 例子
|
|
|
+ var insertArr = [
|
|
|
+ { name: '医疗1', disabled: true },
|
|
|
+ { name: '医疗2', disabled: false },
|
|
|
+ { name: '医疗3', disabled: true }
|
|
|
+ ]
|
|
|
+ insertIndustryItem('E', insertArr)
|
|
|
+
|
|
|
+
|
|
|
+ // 选中行业在已选择提示中显示
|
|
|
+ var selectedIndustryArr = null
|
|
|
+ function findSelectedIndustry () {
|
|
|
+ var buttons = $('.select-area-box .list button')
|
|
|
+ // 找到已选择的数组(有active类的数组)
|
|
|
+ var selectedArr = []
|
|
|
+ buttons.each(function(){
|
|
|
+ if ($(this).hasClass('active')) {
|
|
|
+ selectedArr.push($(this).text())
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // 显示隐藏优惠tips
|
|
|
+ if (selectedArr.length >= 4) {
|
|
|
+ $('.tips_btn .tips_d_text').slideDown()
|
|
|
+ } else {
|
|
|
+ $('.tips_btn .tips_d_text').slideUp()
|
|
|
+ }
|
|
|
+
|
|
|
+ selectedIndustryArr = selectedArr
|
|
|
+
|
|
|
+ var selectedStr = selectedArr.join('、')
|
|
|
+ $('.result .result_name').text(selectedStr)
|
|
|
+
|
|
|
+ if (selectedArr.length === 0) {
|
|
|
+ var allButton = $('#all button')
|
|
|
+ allButton.trigger('click')
|
|
|
+ $('.result .result_name').text(allButton.text())
|
|
|
+ }
|
|
|
+ if (selectedArr.length === buttons.length - 1) {
|
|
|
+ // 除全部行业外所有按钮都被选中了
|
|
|
+ $('#all button').trigger('click')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ findDisabledIndustry()
|
|
|
+ // 找disabled的button函数
|
|
|
+ var disabledIndustryArr = null
|
|
|
+ function findDisabledIndustry () {
|
|
|
+ var $disabledButton = $('.select-area-box .list button:disabled')
|
|
|
+ var arr = []
|
|
|
+ $disabledButton.each(function (index, dom) {
|
|
|
+ arr.push($(dom).text())
|
|
|
+ })
|
|
|
+ disabledIndustryArr = arr
|
|
|
+ }
|
|
|
+ checkedAll()
|
|
|
+ // 每个button的点击事件
|
|
|
+ $('.select-area-box .list').on('click', 'button', function (e) {
|
|
|
+ $('.tips_btn .btns button').removeAttr('disabled')
|
|
|
+
|
|
|
+ $(this).toggleClass('active')
|
|
|
+ // 如果点击全部行业,则其他所有按钮都取消active
|
|
|
+ if ($(this).parents('li')[0].id === 'all') {
|
|
|
+ $('.select-area-box .list button').removeClass('active')
|
|
|
+ $('#all button').addClass('active')
|
|
|
+ } else {
|
|
|
+ $('#all button').removeClass('active')
|
|
|
+ }
|
|
|
+
|
|
|
+ findSelectedIndustry()
|
|
|
+ })
|
|
|
+
|
|
|
+ // 重置按钮事件
|
|
|
+ $('.reset-btn').on('click', function () {
|
|
|
+ $('.tips_btn .btns button').attr('disabled', true)
|
|
|
+ $('.choose_industry .result').slideUp(200)
|
|
|
+ $('.select-area-box .list button').removeClass('active');
|
|
|
+ $('.tips_d_text').hide(200)
|
|
|
+ })
|
|
|
+ // 确认按钮事件
|
|
|
+ $('.save-btn').on('click', function () {
|
|
|
+ console.log(selectedIndustryArr)
|
|
|
+ })
|
|
|
+ </script>
|
|
|
+ </body>
|
|
|
+</html>
|