PageSourceSearch

http://www.nicebox.cn/js/mobile/comm/share.js

js nicebox.cn collected 2026-10-08 03:17:42 UTC 5,438 bytes, 163 lines download raw bytes

1/**
2 * 公用弹窗方法
3 * @param msg 提示内容
4 * @param type 状态 1.警告 2.错误 3.成功 4.操作
5 */
6function tipFunc(msg='',type='1',left_btn='',right_btn='',left_url='',right_url='') {
7    if($('body').find('#show_tip').length >= 1)return;
8    msg = msg != '' ? msg : '你的账户暂无密码,为了你的账号安全请设置账号,密码';
9    var type_msg = '警告提示';
10    var tip_btn  = '';
11    var img_src  = '/images/mobile/comm/warming_icon.png';
12    switch (type) {
13        case '2':
14        case 2:
15            type_msg = '错误提示';
16            img_src  = '/images/mobile/comm/error_icon.png';
17            break;
18        case '3':
19        case 3:
20            type_msg = '成功提示';
21            img_src  = '/images/mobile/comm/success_icon.png';
22            break;
23        case '4':
24        case 4:
25            type_msg = '操作提示';
26            if(left_btn && right_btn) {
27                tip_btn  = '<a href="'+left_url+'">'+left_btn+'</a>\n<a class="mainBgColor" href="'+right_url+'">'+right_btn+'</a>';
28            }
29            break;
30        case '5':
31        case 5:
32            type_msg = '操作确认';
33            if(right_btn) {
34                tip_btn  = '<a href="javaScript:" onclick="closeTip(this)">取消</a>\n<a class="mainBgColor" onclick="'+right_btn+'()" href="javaScript:" >确定</a>';
35            }
36            break;
37    }
38    var html = '<div id="show_tip" class="dialog">\
39    <div class="relative">\
40        <div>\
41            <div class="box">\
42                <div><img src="'+img_src+'" alt="'+type_msg+'"/></div>\
43                <p>'+msg+'</p>\
44                <div class="tip_btn">\
45                    '+tip_btn+'</div>\
46            </div>\
47            <div class="close" onclick="closeTip(this)"><img src="/images/mobile/comm/close.png" alt="关闭警告窗"/></div>\
48        </div>\
49    </div>\
50</div>';
51    $('body').append(html);
52    $('#show_tip').show();
53}
54//微信扫描
55function show_wx_qrcode() {
56    if($('body').find('#wx_qrcode').length >= 1)return;
57    var html = '<div id="wx_qrcode" class="dialog">\
58        <div class="relative">\
59            <div class="img_box">\
60                <img src="/images/top_wechat.jpg" alt=""/>\
61                <p>请使用微信扫描二维码即可登录用户控制中心</p>\
62                <div class="close" onclick="closeTip(this)"><img src="/images/mobile/comm/close.png" alt="关闭二维码窗口"/></div>\
63            </div>\
64        </div>\
65    </div>';
66    $('body').append(html);
67}
68
69function closeTip(obj){
70    if( $(obj).parents('.dialog').length > 0){
71        $(obj).parents('.dialog').remove();
72    }
73}
74
75// 购买页下拉效果箭头
76function change_show(obj,e) {
77    if($(obj).find('.select_list').is(':hidden')) {
78        $(obj).find('.select_list').show();
79        $(obj).find('i').addClass('down');
80        $(obj).parents('.item').siblings().find('.select').find('.select_list').hide();
81        $(obj).parents('.item').siblings().find('.select').children('i').removeClass('down');
82    }else{
83        $(obj).find('.select_list').hide();
84        $(obj).find('i').removeClass('down');
85    }
86    if ( e && e.stopPropagation ){
87        e.stopPropagation();
88    }else{
89        window.event.cancelBubble = true;   //IE取消冒泡
90        return false;
91    }
92}
93// 点击空白隐藏购买页下拉
94$('body,html').click(function(){
95    $('.select_list').hide();
96    $('.section li .select i').removeClass('down');
97});
98
99$(window).scroll(function(){
100    // 返回顶部
101    if ($(window).scrollTop() > 200){
102        $("#go_top").show();
103    }else{
104        $("#go_top").hide();
105    }
106});
107$('#go_top').click(function(){
108    $('body,html').animate({scrollTop:0},1000);
109    return false;
110});
111
112//产品购买按钮跳转
113//speriod => 区别套餐还是单独宝盒
114//pid => 产品id
115//xcxid => 微信小程序
116//bdxcxid => 百度小程序
117//bookid => 行业预约
118//model => 单独宝盒类型
119function box_go_link(speriod,pid,xcxid,bdxcxid=0,bookid=0,model="") {
120    var str = '';
121    if(xcxid) str += '&xcxid='+xcxid;
122    if(bdxcxid) str += '&bdxcxid='+bdxcxid;
123    if(bookid) str += '&bookid='+bookid;
124    var location_string = '';
125    if(speriod) {  //套餐
126        location_string="/special/order.php?speriod="+speriod+'&spid='+pid+str;
127    }else{   //单独宝盒
128        location_string="/design/boxorder.php?model="+model+'&pid='+pid+str;
129    }
130    hasLoginAjaxGet (location_string);
131}
132
133/**
134 * ajax请求 location 跳转
135 * @param string|obj locationStr 跳转链接或者form对象
136 * @param int  locationStr 类型
137 */
138function hasLoginAjaxGet (locationStr='',type = '1') {
139    $.ajax({
140        url  : '/special/ajaxs/product.ajax.php',
141        type : 'get',
142        data : {
143            'act' : 'hasLogin'
144        },
145        dataType : 'json',
146        success  : function (msg) {
147            if (msg.code == 1) {
148                switch (type) {
149                    case '1':
150                        location.href = locationStr;
151                        break;
152                    case '2':
153                        locationStr.submit();
154                        break;
155                }
156
157            } else {
158                window.open("/user/login.php","_blank");
159                return false;
160            }
161        }
162    });
163}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.