/** * Created by xiaofeng on 2017/8/9. */ csrfToken = $('meta[name=csrf-token]').prop('content'); function ReturnInfo(info) { if (info != null) { var strmsg = ''; if (typeof info == 'string') { return info; } $.each(info, function (kk, vv) { strmsg += vv[0] + '
'; }) if (typeof strmsg == 'string') { return strmsg; } } } var objUrl = {}; //获取get参数 var url = window.location.href; function getParams(url) { var theRequest = new Object(); if (!url) url = location.href; if (url.indexOf("?") !== -1) { var str = url.substr(url.indexOf("?") + 1) + "&"; var strs = str.split("&"); for (var i = 0; i < strs.length - 1; i++) { var key = strs[i].substring(0, strs[i].indexOf("=")); var val = strs[i].substring(strs[i].indexOf("=") + 1); theRequest[key] = val; } } return theRequest; } var params = getParams(url); //获取get请求的参数 if (!$.isEmptyObject(params)) { $.each(params, function (key, val) { if (key == 'city') feng_cityTel = val; objUrl[key] = val; }) } var feng_cityTel; $('.y_call').click(function () { var y_call = $('.lphomeV2_head_tel a').attr('href'); if (typeof y_call === 'string' && y_call != '') { return window.location.href = y_call; } $.ajax({ url: '/json/telrand', dataType: "json", type: 'POST', data: {city: feng_cityTel}, success: function (data) { if (data.code == 200) { return window.location.href = 'tel:' + data.data.tel; } }, error: function () { } }); }) $(function () { $('.y_lpleft').on('click', function () { history.back(-1); }) })