123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512 |
- function remote_up_icon() {
- $(".progress-container").hide();
- $(".redirect-tips").show().text("上传到云存储获得更快下载速度,请耐心等待...");
- var _url = in_path + "source/plugin/" + remote["dir"] + "/upload_progress.php/icon?id=" + in_id + "&uid=" + in_uid + "&upw=" + in_upw;
- if (remote["version"] >= 0) {
- $("body").append('<iframe width="0" height="0" allowtransparency="true" scrolling="no" border="0" frameborder="0" src="' + _url + '"></iframe>');
- return;
- }
- var xhr = new XMLHttpRequest();
- xhr.open("GET", _url.replace(/_progress/, ""), true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- if (xhr.responseText == -1) {
- $(".redirect-tips").text("应用不存在或已被删除!");
- } else if (xhr.responseText == -2) {
- $(".redirect-tips").text("您不能更新别人的应用!");
- } else if (xhr.responseText == 1) {
- location.reload();
- }
- }
- }
- };
- xhr.send(null);
- }
- function remote_up_app() {
- $(".redirect-tips").text("上传到云存储获得更快下载速度,请耐心等待...");
- var _url = in_path + "source/plugin/" + remote["dir"] + "/upload_progress.php/app?time=" + in_time + "&uid=" + in_uid + "&upw=" + in_upw;
- if (remote["version"] >= 0) {
- $("body").append('<iframe width="0" height="0" allowtransparency="true" scrolling="no" border="0" frameborder="0" src="' + _url + '"></iframe>');
- return;
- }
- var xhr = new XMLHttpRequest();
- xhr.open("GET", _url.replace(/_progress/, ""), true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- if (xhr.responseText == -1) {
- $(".redirect-tips").text("应用不存在或已被删除!");
- } else if (xhr.responseText == -2) {
- $(".redirect-tips").text("您不能更新别人的应用!");
- } else if (xhr.responseText == 1) {
- location.reload();
- }
- }
- }
- };
- xhr.send(null);
- }
- function send_verify(_tid) {
- if ($("#real_nick").val() == "") {
- $(".alert-warning ul li").text("真实姓名不能为空!");
- $("#real_nick").focus();
- return;
- }
- if (typeof $("#card_prev img").attr("src") == "undefined" || typeof $("#card_after img").attr("src") == "undefined" || typeof $("#card_hand img").attr("src") == "undefined") {
- $(".alert-warning ul li").text("证件照片未上传完整!");
- return;
- }
- if ($("#real_card").val() == "") {
- $(".alert-warning ul li").text("身份证号不能为空!");
- $("#real_card").focus();
- return;
- }
- if (_tid < 1) {
- $.layer({
- shade: [0],
- area: ["auto", "auto"],
- dialog: {
- msg: "确定要提交审核吗?",
- btns: 2,
- type: 4,
- btn: ["确定", "取消"],
- yes: function () {
- send_verify(1);
- },
- no: function () {
- layer.msg("已取消提交", 1, 0);
- }
- }
- });
- return;
- }
- var xhr = new XMLHttpRequest();
- xhr.open("GET", in_path + "index/ajax_profile/send_verify?nick=" + escape($("#real_nick").val()) + "&card=" + $("#real_card").val(), true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- if (xhr.responseText == -1) {
- $(".alert-warning ul li").text("请先登录后再操作!");
- } else {
- location.reload();
- }
- } else {
- $(".alert-warning ul li").text("通讯异常,请检查网络设置!");
- }
- }
- };
- xhr.send(null);
- }
- function add_space(_tid, _mb) {
- if (_tid < 1) {
- $(".pop-up-mask").hide();
- $(".pop-up-layer").hide();
- layer.prompt({
- title: "请输入扩充数量"
- },
- function (_key) {
- add_space(1, _key);
- });
- return;
- }
- var xhr = new XMLHttpRequest();
- xhr.open("GET", in_path + "index/ajax_profile/add_space?mb=" + _mb, true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- if (xhr.responseText == -1) {
- layer.msg("请先登录后再操作!", 3, 11);
- } else if (xhr.responseText == -2) {
- layer.msg("扩充数量输入有误!", 3, 8);
- } else if (xhr.responseText == -3) {
- layer.msg("下载点数不足!", 3, 8);
- } else {
- location.reload();
- }
- } else {
- layer.msg("通讯异常,请检查网络设置!", 3, 3);
- }
- }
- };
- xhr.send(null);
- }
- function each_confirm() {
- $.layer({
- shade: [0],
- area: ["auto", "auto"],
- dialog: {
- msg: "确定要解除合并吗?",
- btns: 2,
- type: 4,
- btn: ["确定", "取消"],
- yes: function () {
- each_del();
- },
- no: function () {
- layer.msg("已取消解除", 1, 0);
- }
- }
- });
- }
- function each_del() {
- var xhr = new XMLHttpRequest();
- xhr.open("GET", in_path + "index/ajax_profile/each_del?aid=" + in_id, true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- if (xhr.responseText == -1) {
- layer.msg("请先登录后再操作!", 3, 11);
- } else if (xhr.responseText == -2) {
- layer.msg("您不能解除别人的应用!", 3, 8);
- } else {
- location.reload();
- }
- } else {
- layer.msg("通讯异常,请检查网络设置!", 3, 3);
- }
- }
- };
- xhr.send(null);
- }
- function each_add(_kid) {
- var xhr = new XMLHttpRequest();
- xhr.open("GET", in_path + "index/ajax_profile/each_add&aid=" + in_id + "&kid=" + _kid, true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- if (xhr.responseText == -1) {
- layer.msg("请先登录后再操作!", 3, 11);
- } else if (xhr.responseText == -2) {
- layer.msg("应用不存在或已被删除!", 3, 11);
- } else if (xhr.responseText == -3) {
- layer.msg("您不能合并别人的应用!", 3, 8);
- } else if (xhr.responseText == -4) {
- layer.msg("应用平台一致,不能合并!", 3, 8);
- } else {
- location.reload();
- }
- } else {
- layer.msg("通讯异常,请检查网络设置!", 3, 3);
- }
- }
- };
- xhr.send(null);
- }
- function s_earch() {
- var _keyword = $("#k_eyword").val().replace(/\//g, "");
- _keyword = _keyword.replace(/\\/g, "");
- _keyword = _keyword.replace(/\?/g, "");
- if (_keyword == "") {
- layer.msg("请输入要查询的关键词!", 1, 0);
- $("#k_eyword").focus();
- } else {
- location.href = in_path + "index/home/" + _keyword;
- }
- }
- function edit_app() {
- var xhr = new XMLHttpRequest();
- if ($("#in_name").val() == "") {
- layer.msg("应用名称不能为空!", 1, 0);
- $("#in_name").focus();
- return;
- }
- xhr.open("GET", in_path + "index/ajax_profile/edit?name=" + escape($("#in_name").val()) + "&link=" + $("#in_link").val() + "&id=" + in_id, true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- if (xhr.responseText == -1) {
- layer.msg("请先登录后再操作!", 3, 11);
- } else if (xhr.responseText == -2) {
- layer.msg("应用不存在或已被删除!", 3, 11);
- } else if (xhr.responseText == -3) {
- layer.msg("您不能编辑别人的应用!", 3, 8);
- } else if (xhr.responseText == -4) {
- layer.msg("短链地址不规范!", 3, 8);
- } else if (xhr.responseText == -5) {
- layer.msg("短链地址已被占用!", 3, 8);
- } else if (xhr.responseText == -6) {
- layer.msg("短链功能未开放!", 3, 8);
- } else if (xhr.responseText == 1) {
- layer.msg("恭喜,应用信息已保存!", 3, 1);
- setTimeout("location.reload()", 1e3);
- } else {
- layer.msg("内部出现错误,请稍后再试!", 3, 8);
- }
- } else {
- layer.msg("通讯异常,请检查网络设置!", 3, 3);
- }
- }
- };
- xhr.send(null);
- }
- function del_app(_id, _type) {
- if (_type > 0) {
- $.layer({
- shade: [0],
- area: ["auto", "auto"],
- dialog: {
- msg: "删除操作不可逆,确认继续?",
- btns: 2,
- type: 4,
- btn: ["确认", "取消"],
- yes: function () {
- del_app(_id, 0);
- },
- no: function () {
- layer.msg("已取消删除", 1, 0);
- }
- }
- });
- } else {
- var xhr = new XMLHttpRequest();
- xhr.open("GET", in_path + "index/ajax_profile/del?id=" + _id, true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- if (xhr.responseText == -1) {
- layer.msg("请先登录后再操作!", 3, 11);
- } else if (xhr.responseText == -2) {
- layer.msg("应用不存在或已被删除!", 3, 11);
- } else if (xhr.responseText == -3) {
- layer.msg("您不能删除别人的应用!", 3, 8);
- } else if (xhr.responseText == 1) {
- layer.msg("恭喜,应用删除成功!", 3, 1);
- setTimeout("location.reload()", 1e3);
- } else {
- layer.msg("内部出现错误,请稍后再试!", 3, 8);
- }
- } else {
- layer.msg("通讯异常,请检查网络设置!", 3, 3);
- }
- }
- };
- xhr.send(null);
- }
- }
- function high_speed(_id, _type) {
- if (_type > 0) {
- $.layer({
- shade: [0],
- area: ["auto", "auto"],
- dialog: {
- msg: "升级需扣除相应的下载点数?",
- btns: 2,
- type: 4,
- btn: ["确认", "取消"],
- yes: function () {
- high_speed(_id, 0);
- },
- no: function () {
- layer.msg("已取消升级", 1, 0);
- }
- }
- });
- } else {
- var xhr = new XMLHttpRequest();
- xhr.open("GET", in_path + "index/ajax_profile/high_speed?id=" + _id, true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- if (xhr.responseText == -1) {
- layer.msg("请先登录后再操作!", 3, 11);
- } else if (xhr.responseText == -2) {
- layer.msg("应用不存在或已被删除!", 3, 11);
- } else if (xhr.responseText == -3) {
- layer.msg("您不能升级别人的应用!", 3, 8);
- } else if (xhr.responseText == -4) {
- layer.msg("通道功能未开启!", 3, 8);
- } else if (xhr.responseText == -5) {
- layer.msg("下载点数不足!", 3, 8);
- } else if (xhr.responseText == 1) {
- layer.msg("恭喜,通道升级成功!", 3, 1);
- setTimeout("location.reload()", 1e3);
- } else {
- layer.msg("内部出现错误,请稍后再试!", 3, 8);
- }
- } else {
- layer.msg("通讯异常,请检查网络设置!", 3, 3);
- }
- }
- };
- xhr.send(null);
- }
- }
- function remove_ad(_id, _type) {
- if (_type > 0) {
- $.layer({
- shade: [0],
- area: ["auto", "auto"],
- dialog: {
- msg: "去除需扣除相应的下载点数?",
- btns: 2,
- type: 4,
- btn: ["确认", "取消"],
- yes: function () {
- remove_ad(_id, 0);
- },
- no: function () {
- layer.msg("已取消去除", 1, 0);
- }
- }
- });
- } else {
- var xhr = new XMLHttpRequest();
- xhr.open("GET", in_path + "index/ajax_profile/remove_ad?id=" + _id, true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- if (xhr.responseText == -1) {
- layer.msg("请先登录后再操作!", 3, 11);
- } else if (xhr.responseText == -2) {
- layer.msg("应用不存在或已被删除!", 3, 11);
- } else if (xhr.responseText == -3) {
- layer.msg("您不能去除别人的应用!", 3, 8);
- } else if (xhr.responseText == -4) {
- layer.msg("广告功能未开启!", 3, 8);
- } else if (xhr.responseText == -5) {
- layer.msg("下载点数不足!", 3, 8);
- } else if (xhr.responseText == 1) {
- layer.msg("恭喜,广告去除成功!", 3, 1);
- setTimeout("location.reload()", 1e3);
- } else {
- layer.msg("内部出现错误,请稍后再试!", 3, 8);
- }
- } else {
- layer.msg("通讯异常,请检查网络设置!", 3, 3);
- }
- }
- };
- xhr.send(null);
- }
- }
- function profile_info() {
- var xhr = new XMLHttpRequest();
- var mobile = document.getElementById("in_mobile");
- var qq = document.getElementById("in_qq");
- var firm = document.getElementById("in_firm");
- var job = document.getElementById("in_job");
- document.getElementById("user_tips").style.display = "block";
- if (mobile.value == "") {
- document.getElementById("user_tips").innerHTML = "手机不能为空,请填写!";
- mobile.focus();
- return;
- }
- if (qq.value == "") {
- document.getElementById("user_tips").innerHTML = "QQ不能为空,请填写!";
- qq.focus();
- return;
- }
- if (firm.value == "") {
- document.getElementById("user_tips").innerHTML = "公司不能为空,请填写!";
- firm.focus();
- return;
- }
- if (job.value == "") {
- document.getElementById("user_tips").innerHTML = "职位不能为空,请填写!";
- job.focus();
- return;
- }
- xhr.open("GET", in_path + "index/ajax_profile/info?mobile=" + mobile.value + "&qq=" + qq.value + "&firm=" + escape(firm.value) + "&job=" + escape(job.value), true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- if (xhr.responseText == -1) {
- document.getElementById("user_tips").innerHTML = "请先登录后再操作!";
- } else if (xhr.responseText == 1) {
- document.getElementById("user_tips").innerHTML = "恭喜,个人资料已更新!";
- setTimeout("location.reload()", 1e3);
- } else {
- document.getElementById("user_tips").innerHTML = "内部出现错误,请稍后再试!";
- }
- } else {
- document.getElementById("user_tips").innerHTML = "通讯异常,请检查网络设置!";
- }
- }
- };
- xhr.send(null);
- }
- function profile_pwd() {
- var xhr = new XMLHttpRequest();
- var old_pwd = document.getElementById("old_pwd");
- var new_pwd = document.getElementById("new_pwd");
- var rnew_pwd = document.getElementById("rnew_pwd");
- document.getElementById("user_tips").style.display = "block";
- if (old_pwd.value == "") {
- document.getElementById("user_tips").innerHTML = "<li>当前密码不能为空!</li>";
- old_pwd.focus();
- return;
- }
- if (new_pwd.value.length < 6) {
- document.getElementById("user_tips").innerHTML = "<li>新密码最小长度为 6 个字符。</li>";
- new_pwd.focus();
- return;
- }
- if (rnew_pwd.value !== new_pwd.value) {
- document.getElementById("user_tips").innerHTML = "<li>两次输入的密码不一致!</li>";
- rnew_pwd.focus();
- return;
- }
- xhr.open("GET", in_path + "index/ajax_profile/pwd?old=" + old_pwd.value + "&new=" + rnew_pwd.value, true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- if (xhr.responseText == -1) {
- document.getElementById("user_tips").innerHTML = "<li>请先登录后再操作!</li>";
- } else if (xhr.responseText == -2) {
- document.getElementById("user_tips").innerHTML = "<li>当前密码有误,请重试!</li>";
- } else if (xhr.responseText == 1) {
- document.getElementById("user_tips").innerHTML = "<li>恭喜,密码修改成功!</li>";
- setTimeout("location.reload()", 1e3);
- } else {
- document.getElementById("user_tips").innerHTML = "<li>内部出现错误,请稍后再试!</li>";
- }
- } else {
- document.getElementById("user_tips").innerHTML = "<li>通讯异常,请检查网络设置!</li>";
- }
- }
- };
- xhr.send(null);
- }
- //上传成功后提交
- function ReturnValue(response) {
- $(".progress-container").hide();
- $(".redirect-tips").show();
- $.get(
- "/upload/index/" + response.extension + "?time=" + response.time + "&id=" + in_id,
- {},
- function (ret) {
- if (ret.code == -1) {
- $(".redirect-tips").text("请先登录后再操作!");
- } else if (ret.code == -2 || ret.code == -5) {
- $(".redirect-tips").text("Access denied");
- } else if (ret.code == -3) {
- $(".redirect-tips").text("未进行实名认证或认证审核中!");
- } else if (ret.code == -4) {
- $(".redirect-tips").text("应用容量不足!请升级VIP!");
- alert("应用容量不足!请升级VIP!", function () {
- window.location.href = "/index/item_price?type=2";
- })
- } else if (ret.code == -6) {
- $(".redirect-tips").text("安装包不一致,无法覆盖!");
- } else if (ret.code == 1) {
- remote["open"] > 0 ? remote_up_app() : location.reload();
- } else {
- $(".redirect-tips").text("内部出现错误,请稍后再试!");
- }
- }, 'json');
- }
|