|
// ========================================================================== 请求数据
|
// 导购后台 请求地址
|
function gethttp ()
|
{
|
var hcj = "http://api.haicaojie.com/hcj"; // 海草街
|
var flq = "http://api.flqapp.com/fanli"; // 返利券
|
var h122 = "http://192.168.1.122:8080/fanli"; // 辉哥电脑
|
var h200 = "http://192.168.1.200:8088/fanli"; // 喻健电脑服务器
|
var h253 = "http://192.168.1.253:8080/fanli"; // 公司253电脑
|
var myhttp = "http://134.175.68.214/fanli"; // 外网IP测试
|
return h253;
|
}
|
|
|
// ========================================================================== 项目
|
// 项目根目录
|
function getHostPath ()
|
{
|
// 相对于IP域名过后的,如果是直接域名下,那么就该填"/"
|
var IP = "/";
|
var hostPath = "/flqAdmin/";
|
return hostPath;
|
}
|
|
// ========================================================================== 数组操作
|
// 元素上移
|
function upRecord (arr, $index) { if($index == 0) { return; } swapItems(arr, $index, $index - 1); }
|
// 元素下移
|
function downRecord (arr, $index) { if($index == arr.length - 1) { return; } swapItems(arr, $index, $index + 1); }
|
// 交换数组元素
|
function swapItems (arr, index1, index2) { arr[index1] = arr.splice(index2, 1, arr[index1])[0]; return arr; }
|
// 数组查重方法
|
function unique(arr)
|
{
|
// 新建数组
|
var result = new Array();
|
var obj = {};
|
// 将传递数组依次加入新数组
|
for(var i=0; i < arr.length; i++)
|
{
|
if(!obj[arr[i].auctionId])
|
{
|
result.push(arr[i]);
|
obj[arr[i].auctionId] = true;
|
}
|
}
|
// 返回新数组
|
return result;
|
}
|