|
@@ -0,0 +1,414 @@
|
|
|
+<!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="/jyapp/vipsubscribe/js/rem.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+ <link rel="stylesheet" href="/jyapp/vipsubscribe/css/weui.min.css?v={{Msg "seo" "version"}}">
|
|
|
+ <link rel="stylesheet" type="text/css" href="/jyapp/vipsubscribe/css/base.css?v={{Msg "seo" "version"}}"/>
|
|
|
+ <link rel="stylesheet" type="text/css" href="/jyapp/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}"/>
|
|
|
+ <link rel="stylesheet" href="/jyapp/vipsubscribe/css/choose_industry.css?v={{Msg "seo" "version"}}">
|
|
|
+ <link rel="stylesheet" type="text/css" href="/jyapp/css/layout.css?v={{Msg "seo" "version"}}"/>
|
|
|
+ <link rel="stylesheet" type="text/css" href="/jyapp/css/font.css?v={{Msg "seo" "version"}}"/>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<div class="app-layout-header">
|
|
|
+ <span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
|
|
|
+ 行业选择
|
|
|
+</div>
|
|
|
+<div class="app-layout-content-b">
|
|
|
+ <main class="choose_industry main">
|
|
|
+ <p class="optional_count"> 可选择行业数量: <em class="count"></em> / <span class="total"></span></p>
|
|
|
+ <div class="result" style="display: block;">
|
|
|
+ <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" style="display:none">
|
|
|
+ <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>
|
|
|
+ </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>
|
|
|
+ </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>
|
|
|
+ <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>
|
|
|
+ </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>
|
|
|
+ <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>
|
|
|
+ </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>
|
|
|
+ </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>
|
|
|
+ </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>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li class="list_item" id="P">
|
|
|
+ <div class="item_label">P</div>
|
|
|
+ <div class="item_industry_list">
|
|
|
+ <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>
|
|
|
+ </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>
|
|
|
+ </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>
|
|
|
+ <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>
|
|
|
+ </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>
|
|
|
+ </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>
|
|
|
+ </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>
|
|
|
+ </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>
|
|
|
+ <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:;">F</a>
|
|
|
+ <a href="javascript:;">G</a>
|
|
|
+ <a href="javascript:;">H</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:;">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:;">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="btns">
|
|
|
+ <button class="reset-btn" id="cancel">取消</button>
|
|
|
+ <button disabled class="save-btn" id="enter">确认修改</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </main>
|
|
|
+</div>
|
|
|
+<script src="/jyapp/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+<script src="/jyapp/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+<script src="/jyapp/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+<script src="/jyapp/js/common.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+<script>
|
|
|
+ //加载数据
|
|
|
+ var EditIndustry = {
|
|
|
+ reqData: {},
|
|
|
+ selectlast: [],
|
|
|
+ init: function () {
|
|
|
+ this.getData();
|
|
|
+ this.showData();//初始化页面展示
|
|
|
+ this.initClick();//初始化点击事件
|
|
|
+ },
|
|
|
+ getData: function () {
|
|
|
+ //加载数据
|
|
|
+ $DoPost("/subscribepay/editSub/getSubBuyMsg", {}, function (r) {
|
|
|
+ if (r.success) {
|
|
|
+ EditIndustry.reqData = r.data;
|
|
|
+ }
|
|
|
+ }, false)
|
|
|
+ if (this.reqData.industry.length == 0 && this.reqData.buyset.buyerclasscount == -1) {
|
|
|
+ this.reqData.industry = ["全部行业"]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ showData: function () {
|
|
|
+ this.selectlast = this.reqData.industry;
|
|
|
+
|
|
|
+ $('.result .result_name').html(this.reqData.industry.join('、'));
|
|
|
+
|
|
|
+ $('.industry_item').each(function () {
|
|
|
+ let text = $(this).text();
|
|
|
+ EditIndustry.reqData.industry.forEach(v => {
|
|
|
+ if (v.trim() == text.trim()) {
|
|
|
+ $(this).addClass('active')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+
|
|
|
+ if (this.reqData.buyset.buyerclasscount != -1) { //非全部行业 展示数量
|
|
|
+ $('.total').html(this.reqData.buyset.buyerclasscount);
|
|
|
+ $('.count').html(this.reqData.industry.length);
|
|
|
+ if (this.reqData.industry.length >= this.reqData.buyset[2]) {
|
|
|
+ $('.industry_item:not(.active)').attr('disabled', true);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $("#all").css("display", "");
|
|
|
+ $(".optional_count").css("display", "none");
|
|
|
+ }
|
|
|
+ EditIndustry.findSelectedIndustry(true);
|
|
|
+ },
|
|
|
+ initClick: function () {
|
|
|
+ // 点击导航跳转
|
|
|
+ $("body").on('click', '.slide a', function () {
|
|
|
+ var s = $(this).html()
|
|
|
+ if (s == '#') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ document.querySelector('#' + s).scrollIntoView({block: 'center'});
|
|
|
+ })
|
|
|
+ // 每个button的点击事件
|
|
|
+ $('.select-area-box .list').on('click', 'button', function (e) {
|
|
|
+ if ($(this).text() == "全部行业") {
|
|
|
+ if ($(this).hasClass('active')) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (EditIndustry.reqData.buyset.buyerclasscount != -1) { //购买不是全部行业 不能点击
|
|
|
+ EditIndustry.showTip(`<span style="white-space: nowrap;">您只购买了${EditIndustry.reqData.buyset.buyerclasscount}个行业,如需更多请升级<span></p>`);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ $('.select-area-box .list button').removeClass('active');
|
|
|
+ $('#all button').addClass('active');
|
|
|
+ $('#enter').removeAttr('disabled');
|
|
|
+ } else {
|
|
|
+ $(this).toggleClass('active')
|
|
|
+ if ($(".industry_item.active").length == 0) {//如果没有行业被选中 则选中全部行业
|
|
|
+ if (EditIndustry.reqData.buyset.buyerclasscount == -1) {
|
|
|
+ $('#all button').addClass('active');
|
|
|
+ } else {
|
|
|
+ $('#enter').attr('disabled', 'disabled');//选择空不能提交
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $('#all button').removeClass('active');
|
|
|
+ $('#enter').removeAttr('disabled');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ EditIndustry.findSelectedIndustry(false);
|
|
|
+ })
|
|
|
+ // 取消按钮事件 返回上一页
|
|
|
+ $('#cancel').click(function () {
|
|
|
+ window.history.go(-1);
|
|
|
+ })
|
|
|
+ // 确定修改事件
|
|
|
+ $('#enter').click(function () {
|
|
|
+ $("#enter").attr("disabled", "disabled");
|
|
|
+ //更新对象
|
|
|
+ if (EditIndustry.reqData.buyset.buyerclasscount == -1 && EditIndustry.reqData.industry[0] == "全部行业") {
|
|
|
+ EditIndustry.reqData.industry = [];
|
|
|
+ }
|
|
|
+ console.log("final select ", EditIndustry.reqData)
|
|
|
+ $DoPost("/subscribepay/editSub/submit", {
|
|
|
+ "type": "industry",
|
|
|
+ "value": JSON.stringify(EditIndustry.reqData.industry)
|
|
|
+ }, function (r) {
|
|
|
+ if (r.success) {
|
|
|
+ window.location.replace('/jyapp/vipsubscribe/submitEditSubFinish');
|
|
|
+ }
|
|
|
+ }, false)
|
|
|
+ $("#enter").removeAttr("disabled");
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showTip: function (msg) {
|
|
|
+ weui.toast(msg, {
|
|
|
+ duration: 2000,
|
|
|
+ className: 'custom-toast',
|
|
|
+ });
|
|
|
+ },
|
|
|
+ findSelectedIndustry: function (isInit) {
|
|
|
+ var buttons = $('.select-area-box .list button')
|
|
|
+ // 找到已选择的数组(有active类的数组)
|
|
|
+ var selectedArr = []
|
|
|
+ buttons.each(function () {
|
|
|
+ if ($(this).hasClass('active')) {
|
|
|
+ selectedArr.push($(this).text())
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (selectedArr.length == $('.select-area-box .list button').length - 1) {//选中了全部行业
|
|
|
+ $('#all button').trigger('click');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var selectCount = selectedArr.length
|
|
|
+ $('.count').html(selectCount);
|
|
|
+ // 显示隐藏优惠tips
|
|
|
+ if (selectedArr.length >= EditIndustry.reqData.buyset.buyerclasscount && EditIndustry.reqData.buyset.buyerclasscount != -1) {
|
|
|
+ if (!isInit) {
|
|
|
+ EditIndustry.showTip(`<span style="white-space: nowrap;">您只购买了${EditIndustry.reqData.buyset.buyerclasscount}个行业,如需更多请升级<span></p>`);
|
|
|
+ }
|
|
|
+ $('.industry_item:not(.active)').attr('disabled', 'disabled');
|
|
|
+ } else {
|
|
|
+ $('.industry_item:not(.active)').removeAttr('disabled')
|
|
|
+ }
|
|
|
+ this.reqData.industry = selectedArr;
|
|
|
+ var selectedStr = selectedArr.join('、')
|
|
|
+ $('.result .result_name').text(selectedStr)
|
|
|
+ if (this.noChange(this.reqData.industry, EditIndustry.selectlast) || this.reqData.industry.length == 0) {
|
|
|
+ $('#enter').attr('disabled', 'disabled');
|
|
|
+ } else {
|
|
|
+ $('#enter').removeAttr('disabled');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ noChange: function (arr1, arr2) {
|
|
|
+ return JSON.stringify(arr1.sort()) === JSON.stringify(arr2.sort());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $(function () {
|
|
|
+ EditIndustry.init();
|
|
|
+ })
|
|
|
+
|
|
|
+</script>
|
|
|
+</body>
|
|
|
+</html>
|