小米抢购(简单版v0.1)-登录并验证抢购权限,以及获取真实抢购地址
小米(简单版)-登录并验证抢购权限,以及获取真实抢购地址!
并不是复制到浏览器就行了的 还得传递所需要的参数 这里只是前部分 后面的自己发挥了


{
"stime": 1389672157,
"d22a51": 5,
"login": true,
"pmstart": false,
"status": {
"miphone": {
"hdstart": true,
"hdstop": false,
"hdurl": "?_a=20140114_phone&_op=choose&_s=fcea663b58",
"duration": null,
"reg": true
},
"mitv": {
"hdstart": true,
"hdstop": false,
"hdurl": "",
"duration": null,
"reg": false
}
}
}

说明:(抢购前1-2个钟才开放此链接,正式开始时才返回真实地址)
console.log([])
可用正则 也可以用json
"(allow|hdstart|hdurl)":("(.+?)"|(.+?))(,)
"hdstart":(?<hdstart>.+?,)
"hdurl":(?<hdurl>"(.+?)",)
json实体类:
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using xiaomi.xiaomiEntityJsonTypes; namespace xiaomi.xiaomiEntityJsonTypes
{
public class Miphone
{
public bool hdstart { get; set; }
public bool hdstop { get; set; }
public string hdurl { get; set; }
public object duration { get; set; }
public bool reg { get; set; }
} public class Mitv
{
public bool hdstart { get; set; }
public bool hdstop { get; set; }
public string hdurl { get; set; }
public object duration { get; set; }
public bool reg { get; set; }
} public class Status
{
public Miphone miphone { get; set; }
public Mitv mitv { get; set; }
} public class RootObject
{
public int stime { get; set; }
public int d22a51 { get; set; }
public bool login { get; set; }
public bool pmstart { get; set; }
public Status status { get; set; }
}
public class loginObject
{
public string passToken { get; set; }
public string ssecurity { get; set; }
public string desc { get; set; }
public long nonce { get; set; }
public string location { get; set; }
public int userId { get; set; }
public object captchaUrl { get; set; }
public string psecurity { get; set; }
public int code { get; set; }
}
抢购:
public void QiangGou()
{
try
{
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
//_=13896722773701389672369818
URL = "http://tc.hd.xiaomi.com/hdget?product=phone&_=" + ConvertDateTimeInt(DateTime.Now),
UserAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",
Host = "tc.hd.xiaomi.com",
CookieCollection = allCookie
};
HttpResult result = http.GetHtml(item);
string strJson = result.Html; if (strJson.Contains("hdcontrol"))
{
strJson = strJson.Replace("hdcontrol(", "").Replace(")", "");
txtHtml.Text = strJson;
RootObject xm = JsonConvert.DeserializeObject<RootObject>(strJson);
bool reg = xm.status.miphone.reg;
lblreg.Invoke(new Action(delegate() { lblreg.Text = reg.ToString(); }));
if (xm.status.miphone.hdstart)
{
string Hdurl = xm.status.miphone.hdurl;
if (!string.IsNullOrEmpty(Hdurl))
{
CookieCollection midataCookie = result.CookieCollection; if (midataCookie.Count == )
{
lblAllow.Invoke(new Action(delegate() { lblAllow.Text = "有链接无cookie"; }));
}
else
{
TimerStop();
btnStart.Invoke(new Action(delegate() { btnStart.Enabled = true; }));
btnStop.Invoke(new Action(delegate() { btnStop.Enabled = false; })); allCookie.Add(midataCookie);
lblAllow.Invoke(new Action(delegate() { lblAllow.Text = "有链接也有cookie"; })); string chooseurl = "http://t.hd.xiaomi.com/s/" + xm.status.miphone.hdurl.Replace("\u0026", "&");
txtUrl.Invoke(new Action(delegate() { txtUrl.Text = chooseurl; })); //带上cookie 进入抢购
//1.真实地址 返回 mi_dota
//2.GET请求真实地址 返回 location 继续验证 获取cookie 再次请求location
//3.解析页面重要四个hidden元素并带其中一个参数获取验证码
//4.POST四个参数 提交 ok
}
}
else
{
lblAllow.Invoke(new Action(delegate() { lblAllow.Text = "无链接"; }));
txtUrl.Invoke(new Action(delegate() { txtUrl.Text = ""; }));
}
}
else
{
lblAllow.Invoke(new Action(delegate() { lblAllow.Text = "还没开始"; }));
TimerStop();
btnStart.Invoke(new Action(delegate() { btnStart.Enabled = true; }));
btnStop.Invoke(new Action(delegate() { btnStop.Enabled = false; }));
}
}
else
{
lblAllow.Invoke(new Action(delegate() { lblAllow.Text = "尚未开放"; }));
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
登录:
allCookie = new CookieCollection();
string username = txtUserName.Text;
string password = txtPwd.Text;
//获取 Sign令牌
HttpItem itemSign = new HttpItem()
{
URL = "https://account.xiaomi.com/pass/serviceLogin",
ResultCookieType = ResultCookieType.CookieCollection,
CerPath = CerPath,
Host = "account.xiaomi.com",
UserAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",
ContentType = "application/x-www-form-urlencoded"
};
HttpHelper helperSign = new HttpHelper();
HttpResult resultSign = helperSign.GetHtml(itemSign);
string signHtml = resultSign.Html;
Cookie u = new Cookie() { Name = "userName", Value = Regex.Escape(username), Domain = ".xiaomi.com", Path = "/", Expires = DateTime.Now.AddDays() };
CookieCollection cookieSign = resultSign.CookieCollection;
cookieSign.Add(u);
allCookie.Add(cookieSign); string[] s = myhelper.GetRegexStrings(@"Component[(](.+?)""", signHtml);
string callback = HttpUtility.UrlEncode(s[].Replace("\"", ""));
string sid = HttpUtility.UrlEncode(s[].Replace("\"", ""));
string qs = HttpUtility.UrlEncode(s[].Replace("\"", ""));
string hidden = HttpUtility.UrlEncode(s[].Replace("\"", ""));
string sign = HttpUtility.UrlEncode(s[].Replace("\"", "")); string url = @"https://account.xiaomi.com/pass/static/v5login.html?inframe=true&onetimeEncode=true&callback=" + callback + "&sid=" + sid + "&qs=" + qs + "&sign=" + sign + "&hidden=" + hidden;
HttpItem itemv5login = new HttpItem()
{
URL = url,
Referer = "https://account.xiaomi.com/pass/serviceLogin",
ResultCookieType = ResultCookieType.CookieCollection,
CerPath = CerPath,
Host = "account.xiaomi.com",
UserAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",
ContentType = "application/x-www-form-urlencoded"
};
HttpHelper helperv5login = new HttpHelper();
HttpResult resultv5login = helperSign.GetHtml(itemv5login);
string v5loginHtml = resultv5login.Html; CookieCollection cookiev5login = resultv5login.CookieCollection; allCookie.Add(cookieSign); HttpItem itemPost = new HttpItem() //登陆Post
{
ResultCookieType = ResultCookieType.CookieCollection,
URL = "https://account.xiaomi.com/pass/serviceLoginAuth2",
Method = "POST",
CerPath = CerPath,
CookieCollection = allCookie,
// Cookie = cookies,
Referer = url,
Host = "account.xiaomi.com",
UserAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",
ContentType = "application/x-www-form-urlencoded",
Postdata = string.Format("user={0}&_json=true&pwd={1}&sid={2}&_sign={3}&callback={4}&qs={5}", username, password, sid, sign, callback, qs, hidden)
}; HttpHelper helperPost = new HttpHelper();
HttpResult resultPost = helperPost.GetHtml(itemPost); CookieCollection cookiePost = resultPost.CookieCollection;
if (cookiePost != null)
{
allCookie.Add(cookiePost);
} //跳转1 http://account.xiaomi.com/sts?sid=passport&followup
string html1 = resultPost.Html;
if (html1.Contains("小米帐户 - 登录"))
{
AppendText(username + "登陆失败\n"); return;
}
if (html1.Contains("温馨提示"))
{
AppendText("签名方法不对\n"); return;
} string json = html1.Replace("&&&START&&&", ""); loginObject loginjson = JsonConvert.DeserializeObject<loginObject>(json); if (string.IsNullOrEmpty(loginjson.location))
{
AppendText("出错\n"); return;
} HttpItem itemsts = new HttpItem()
{
URL = loginjson.location,
Referer = url,
ResultCookieType = ResultCookieType.CookieCollection,
CerPath = CerPath,
Host = "account.xiaomi.com",
UserAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",
ContentType = "application/x-www-form-urlencoded"
};
HttpHelper helpersts = new HttpHelper();
HttpResult resultsts = helpersts.GetHtml(itemsts);
string stsHtml = resultsts.Html;
CookieCollection cookiests = resultsts.CookieCollection;
if (cookiests != null)
{
allCookie.Add(cookiests);
}
string okurl = resultsts.Header["Location"]; if (okurl.Contains("userId"))
{
HttpItem item3 = new HttpItem()
{
ResultCookieType = ResultCookieType.CookieCollection,
URL = okurl,
Method = "GET",
// Cookie = cookies,
CookieCollection = allCookie,
Host = "account.xiaomi.com",
UserAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36"
};
HttpHelper helper3 = new HttpHelper();
HttpResult result3 = helper3.GetHtml(item3); CookieCollection c3 = result3.CookieCollection;
if (c3 != null)
{ allCookie.Add(c3); } // https://account.xiaomi.com/pass/userInfo?userId
string href4 = result3.Header["Location"];
HttpItem item4 = new HttpItem()
{
ResultCookieType = ResultCookieType.CookieCollection,
URL = href4,
Method = "GET", CookieCollection = allCookie,
CerPath = CerPath,
Host = "account.xiaomi.com",
UserAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" };
HttpHelper helper4 = new HttpHelper();
HttpResult result4 = helper3.GetHtml(item4); CookieCollection c4 = result4.CookieCollection;
if (c4 != null)
{ allCookie.Add(c4); } if (result4.Header["Location"] == null)
{
AppendText(username + "登陆成功");
StartIE(allCookie, "http://p.www.xiaomi.com/open/index.html");
} else
{
AppendText(username + "登陆失败");//http://account.xiaomi.com/ } }
private void btnCopy_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(txtUrl.Text))
{
Clipboard.SetDataObject(txtUrl.Text, true);
}
} protected void AppendText(string info)
{
txtInfo.Invoke((MethodInvoker)delegate
{
txtInfo.AppendText(info + Environment.NewLine); txtInfo.SelectionStart = txtInfo.Text.Length;
txtInfo.ScrollToCaret();
});
} /// <summary>
/// Cookie对象
/// </summary>
public class CookieItem
{
/// <summary>
/// 键
/// </summary>
public string Key { get; set; }
/// <summary>
/// 值
/// </summary>
public string Value { get; set; }
}
}
附:20140121 js
function forNum(e) {
return e < 10 ? "0" + e : e
}
function countdown(e, t) {
var n = (new Date(t)).getTime() / 1e3, r = n - e, i = parseInt(r % 60), s = parseInt(r / 60 % 60), o = parseInt(r / 3600 % 24), u = parseInt(r / 3600 / 24), a = [i.toString(), s.toString(), o.toString()];
if (r <= 0)
return ["00小时00分00秒", !0];
if (u > 0) {
window._timestr = u + "天" + forNum(a[2]) + "时" + forNum(a[1]) + "分" + forNum(a[0]) + "秒";
return [u + "<span>天</span>" + forNum(a[2]) + "<span>时</span>" + forNum(a[1]) + "<span>分</span>" + forNum(a[0]) + "<span>秒</span>", !1]
}
window._timestr = forNum(a[2]) + "时" + forNum(a[1]) + "分" + forNum(a[0]) + "秒";
return [forNum(a[2]) + "<span>时</span>" + forNum(a[1]) + "<span>分</span>" + forNum(a[0]) + "<span>秒</span>", !1]
}
function isApp() {
try {
if (!!WE)
return !0
} catch (e) {
}
return !1
}
function WebEventTrigger(e, t) {
try {
if (WE && WE.trigger) {
typeof t != "string" && (t = JSON.stringify(t));
return WE.trigger(e, t)
}
} catch (n) {
}
return !1
}
var qg, handle;
qg = {req: !0,config: {startDate: +(new Date("01/21/2014 11:59:59")),pmDate: +(new Date("01/21/2014 15:00:00")),localDate: +(new Date),shortDate: 0,shortDiff: 10,loginDate: 7200,ajax: {hdinfo: {timeout: 3e4,url: "http://tc.hd.xiaomi.com/hdinfo"},hdget: {timeout: 3e4,url: "http://tc.hd.xiaomi.com/hdget"}},url: {login: "http://m.xiaomi.com/mshopapi/index.php/v1/authorize/sso?client_id=180100031013&callback=" + encodeURIComponent(window.location.href),bbsurl: "http://bbs.xiaomi.cn/thread-9084600-1-1.html"},goods: {miphone: {name: "手机",pay: "http://tc.hd.xiaomi.com/check?_a=payment_check&_m=1",noyuyue: "http://p.www.xiaomi.com/m/opentip/phone/tip_NoRegister.html?_el=0&v=20140121",saledone: "http://p.www.xiaomi.com/m/opentip/phone/tip_SaledOverAll.html?_el=0&v=20140121",queryurl: "http://a.hd.xiaomi.com/register/check/a/28/m/1"},mitv: {name: "电视",pay: "http://tc.hd.xiaomi.com/check?_a=payment_check_tv&_m=1",noyuyue: "http://p.www.xiaomi.com/m/opentip/tv/tip_NoRegister.html?_pf=0&v=20140121",saledone: "http://p.www.xiaomi.com/m/opentip/tv/tip_SaledOverAll.html?_pf=0&v=20140121",queryurl: "http://a.hd.xiaomi.com/register/check/a/27/m/1"},mibox: {name: "盒子",pay: "http://tc.hd.xiaomi.com/check?_a=payment_check_box&_m=1",noyuyue: "http://p.www.xiaomi.com/m/opentip/box/tip_NoRegister.html?_el=0&v=20140121",saledone: "http://p.www.xiaomi.com/m/opentip/box/tip_SaledOverAll.html?_el=0&v=20140121",queryurl: "http://a.hd.xiaomi.com/register/check/a/18/m/1"},mipower: {name: "电源",pay: "http://tc.hd.xiaomi.com/check?_a=payment_check_power&_m=1",noyuyue: "http://p.www.xiaomi.com/m/opentip/power/tip_NoRegister.html?_zm=0&v=20140121",saledone: "http://p.www.xiaomi.com/m/opentip/power/tip_SaledOverAll.html?_zm=0&v=20140121",queryurl: "http://a.hd.xiaomi.com/register/check/a/30/m/1"}}},init: function() {
this.getInfo()
},statu: {user: {isLogin: !1,reg: {},buy: {},clearBuy: function() {
for (var e in qg.statu.user.buy)
qg.statu.user.buy[e] = !1
}},hd: {start: !1,pmStart: !1,loginTime: !1,end: {},allEnd: !1,fk: !1}},getInfo: function() {
var e = this;
$.ajax({url: e.config.ajax.hdinfo.url,dataType: "jsonp",jsonpCallback: "hdinfo",timeout: e.config.ajax.hdinfo.timeout,beforeSend: function() {
e.ajax.hdinfo.load();
e.req = !1
},error: function(t) {
if (e.ajax.notFound(t, !0))
return;
e.ajax.hdinfo.connect()
},success: function(t) {
e.req = !0;
e.ajax.hdinfo.success(t)
},complete: function() {
}})
},getDate: function() {
var e = this, t = {};
$.each(e.statu.user.buy, function(e, n) {
n && (t.product = e.replace("mi", ""))
});
if (!e.statu.hd.fk)
return;
t.fk = handle.fk.num;
$.ajax({url: e.config.ajax.hdget.url,dataType: "jsonp",data: t,jsonpCallback: "hdcontrol",timeout: e.config.ajax.hdget.timeout,beforeSend: function() {
e.ajax.hdget.load();
e.req = !1
},error: function(t) {
if (e.ajax.notFound(t, !1))
return;
e.ajax.hdget.connect()
},success: function(t) {
e.req = !0;
e.ajax.hdget.success(t)
},complete: function() {
}})
},ajax: {notFound: function(e, t) {
if (e.status === 404) {
qg.req = !0;
qg.statu.user.clearBuy();
handle.ajax.error.notFound(t);
return !0
}
return !1
},hdget: {load: function() {
qg.req && handle.ajax.hdget.load()
},connect: function(e) {
!e || e === "0" ? e = 2e3 : e = parseInt(e) * 1e3;
setTimeout(function() {
qg.getDate()
}, e)
},success: function(e) {
qg.getStatus.hd(e);
qg.process.hdget();
for (var t in qg.statu.user.buy)
if (qg.statu.user.buy[t] === !0) {
if (qg.statu.hd.end[t]) {
qg.statu.user.buy[t] = !1;
handle.ajax.hdget.saledover(t);
return
}
if (e.status[t].hdurl !== "") {
qg.statu.user.buy[t] = !1;
handle.ajax.hdget.success(e.status[t].hdurl)
} else {
handle.ajax.hdget.reload(e.d22a51);
qg.ajax.hdget.repull(e.d22a51)
}
}
},repull: function(e) {
qg.ajax.hdget.connect(e)
}},hdinfo: {load: function() {
qg.req && handle.ajax.hdinfo.load()
},connect: function() {
handle.ajax.error.timeout();
setTimeout(function() {
qg.getInfo()
}, 2e3)
},success: function(e) {
handle.ajax.hdinfo.success();
qg.config.currentDate = e.stime;
qg.config.shortDate = (qg.config.localDate - qg.config.currentDate * 1e3) / 1e3;
qg.getStatus.hd(e);
qg.getStatus.user(e);
qg.process.hdinfo()
}}},getStatus: {hd: function(e) {
var t = qg.config.startDate, n = qg.config.currentDate * 1e3;
n >= t && (qg.statu.hd.start = !0);
if (n > qg.config.pmDate || e.pmstart === !0)
qg.statu.hd.pmStart = !0;
for (var r in e.status)
e.status[r].hdstop === !1 && e.status[r].hdstart === !0 || e.status[r].hdstop === !1 && e.status[r].hdstart === !1 && qg.statu.hd.pmStart === !1 ? qg.statu.hd.end[r] = !1 : qg.statu.hd.end[r] = !0
},user: function(e) {
!$.cookie("userId") || (qg.statu.user.isLogin = !0);
for (var t in e.status) {
qg.statu.user.reg[t] = e.status[t].reg;
qg.statu.user.buy[t] = !1
}
},checkEnd: function(e) {
qg.statu.hd.allEnd = !0;
for (var t in qg.statu.hd.end)
qg.statu.hd.end[t] ? e(t) : qg.statu.hd.allEnd = !1
},loginTime: function() {
var e = qg.config.startDate, t = qg.config.currentDate * 1e3, n = e - qg.config.loginDate * 1e3;
t >= n && (qg.statu.hd.loginTime = !0)
}},countDown: function() {
var e = this, t = e.config.startDate, n = e.config.currentDate, r = t - e.config.loginDate * 1e3, i = setInterval(function() {
var e = countdown(n, t);
if (e[1]) {
clearInterval(i);
qg.statu.hd.start = !0;
qg.process.hdinfo()
} else {
if (n * 1e3 === r) {
qg.statu.hd.loginTime = !0;
qg.process.hdinfo()
}
n += 1;
if ((+(new Date) - n * 1e3) / 1e3 - qg.config.shortDate > qg.config.shortDiff) {
clearInterval(i);
location.reload()
}
}
handle.hdinfo.showTime(e[0])
}, 1e3)
},process: {hdget: function() {
qg.getStatus.checkEnd(function(e) {
handle.end.one(e)
});
if (qg.statu.hd.allEnd) {
handle.end.all();
return
}
},hdinfo: function() {
if (qg.statu.hd.start) {
handle.hdinfo.start();
qg.getStatus.checkEnd(function(e) {
handle.end.one(e)
});
if (qg.statu.hd.allEnd) {
handle.end.all();
return
}
if (!qg.statu.user.isLogin) {
handle.login.no();
handle.hdinfo.login();
return
}
for (var e in qg.statu.user.reg)
qg.statu.user.reg[e] && !qg.statu.hd.end[e] ? handle.hdinfo.reg.bind(e) : !qg.statu.user.reg[e] && !qg.statu.hd.end[e] && handle.hdinfo.reg.none(e)
} else
!qg.statu.hd.start && !qg.statu.hd.loginTime && handle.hdinfo.countdown();
qg.statu.hd.loginTime && !qg.statu.hd.start && (isApp() || handle.hdinfo.login());
qg.statu.hd.pmStart === !0 && $("#pmTip").hide()
}}};
handle = {dom: {pop: $("#pop"),mask: $("#mask"),loading: $("#loading"),time: $("#time"),btn1: $("#btn1"),btn2: $("#btn2"),btn3: $("#btn3"),btn4: $("#btn4"),btn5: $("#btn5"),btn6: $("#btn6"),btn7: $("#btn7")},hdinfo: {countdown: function() {
handle.hdinfo.showBtn.countdown();
qg.getStatus.loginTime();
qg.countDown()
},start: function() {
handle.dom.time.remove();
var e = [], t = '<a href="' + qg.config.url.bbsurl + '">查看活动详情 »</a>';
for (var n in qg.config.goods)
e.push('<a class="qgbtn" id="' + n + '" name="' + n + '" href="javascript:;">购买' + qg.config.goods[n].name + "</a>");
handle.dom.btn1.html(e[0]);
handle.dom.btn2.html(e[1]);
handle.dom.btn3.html(e[2]);
handle.dom.btn4.html(e[3]);
handle.dom.btn5.html(t)
},showTime: function(e) {
handle.dom.time.find("strong").html(e);
handle.dom.time.show().off("click").on("click", function() {
window.location.reload()
})
},showBtn: {countdown: function() {
var e = '<a href="' + qg.config.goods.miphone.queryurl + '">查询手机资格</a>', t = '<a href="' + qg.config.goods.mitv.queryurl + '">查询电视资格</a>', n = '<a href="' + qg.config.goods.mibox.queryurl + '">查询盒子资格</a>', r = '<a href="' + qg.config.goods.mipower.queryurl + '">查询电源资格</a>', i = '<a href="' + qg.config.url.bbsurl + '">查看活动详情 »</a>';
handle.dom.btn1.html(e);
handle.dom.btn2.html(t);
handle.dom.btn3.html(n);
handle.dom.btn4.html(r);
handle.dom.btn5.html(i)
}},reg: {bind: function(e) {
var t = e;
$("#" + t).off("click").on("click", function() {
qg.statu.user.clearBuy();
if (!!qg.req) {
var e = $(this).attr("name");
qg.statu.user.buy[e] = !0;
if (qg.statu.hd.fk)
qg.getDate();
else {
handle.fk.key(parseInt($.cookie("userId")) % 7356);
handle.fk.show();
handle.fk.bind()
}
}
return !1
})
},none: function(e) {
var t = e, n = qg.config.goods[e].noyuyue;
$("#" + t).off("click").on("click", function() {
window.location.href = n;
return !1
})
}},login: function() {
var e = qg.config.url.login, t = '<a class="error" href="' + e + '">为确保顺利购机,请提前登录 »</a>', n = '<a href="http://m.xiaomi.com/index.html#ac=account&op=index">您已登录 »</a>';
qg.statu.user.isLogin ? handle.dom.btn7.html(n).show() : handle.dom.btn6.html(t).slideDown()
}},ajax: {error: {timeout: function() {
$("#loading:visible") && handle.dom.loading.html("努力加载中...")
},notFound: function(e) {
$("#loading:visible") && handle.dom.loading.hide();
handle.ajax.error.showNotFound();
e ? $("#notFound").find("#nbtn").off("click").on("click", function() {
window.location.reload()
}) : $("#notFound").find("#nbtn").off("click").on("click", function() {
handle.dom.mask.hide();
handle.dom.pop.hide()
})
},showNotFound: function() {
handle.dom.mask.show();
handle.dom.pop.show().find(".pb").hide();
handle.dom.pop.find("#notFound").show()
}},hdinfo: {load: function() {
handle.ajax.hdinfo.showLoad()
},success: function() {
handle.ajax.hdinfo.hideLoad()
},showLoad: function() {
handle.dom.mask.show();
handle.dom.loading.show()
},hideLoad: function() {
if ($("#loading:visible")) {
handle.dom.mask.hide();
handle.dom.loading.hide().html("正在加载...")
}
}},hdget: {load: function() {
handle.dom.mask.show();
handle.dom.pop.show().find(".pb").hide();
handle.dom.pop.find("#hdgetLoad").show()
},reload: function(e) {
handle.dom.pop.find(".pb").hide();
handle.dom.pop.find("#hdgetReload").show().find("#t").html(e)
},success: function(e) {
handle.dom.mask.hide();
handle.dom.pop.hide();
var t = "http://t.hd.xiaomi.com/s/" + e + "&_m=1";
window.location.href = t
},saledover: function(e) {
var t = qg.config.goods[e].saledone;
handle.dom.mask.hide();
handle.dom.pop.hide();
window.location.href = t
}}},end: {all: function() {
},one: function(e) {
var t = qg.config.goods[e].name, n = qg.config.goods[e].pay;
$("#" + e).html("支付" + t).off("click").on("click", function() {
window.location.href = n
})
}},login: {no: function() {
$(".qgbtn").off("click").on("click", function() {
isApp() ? WebEventTrigger("login", null) : window.location.href = qg.config.url.login
})
}},fk: {num: "",pop: $("#fk"),cbtn: $("#fk #close"),vbtn: $("#vBtn"),vcode: $("#vCode"),vInput: $("#vInput"),vTips: $("#vTips"),key: function(e) {
var t = e.toString(), n = t.split(""), r = n.length;
if (n.length < 4)
for (var i = r, s = 4; i < s; i += 1)
n.unshift("0");
else
n = n.slice(r - 4);
this.num = n.join("")
},show: function() {
handle.dom.mask.show();
handle.dom.pop.show().find(".pb").hide();
this.vcode.html(this.num);
this.pop.show();
this.vInput.focus()
},bind: function() {
this.vbtn.off("click").on("click", function() {
var e = handle.fk.vInput.val();
handle.fk.vKey(e)
});
this.vInput.on("keypress", function() {
handle.fk.vTips.html("").hide()
});
this.cbtn.on("click", function() {
handle.dom.mask.hide();
handle.dom.pop.hide().find(".pb").hide();
handle.fk.vTips.hide()
})
},vKey: function(e) {
if (e === this.num) {
qg.statu.hd.fk = !0;
qg.getDate()
} else {
var t = '<p class="error">验证码有误,请重新填写</p>';
this.vTips.html(t).show();
this.vInput.val("").focus()
}
}}};
http://p.www.xiaomi.com/m/op/js/8d72jd7h/app-ck.js
《一》
已满人
《二》
未满
小米抢购(简单版v0.1)-登录并验证抢购权限,以及获取真实抢购地址的更多相关文章
- 抢小米软件html版(简单有效)
地球人都知道小米性价比高,大家都很期待,但是抢小米却是一件很头疼的事. 本来抢的人就多,还有一些大牛.黄牛使用软件来抢,人家有成百上千台电脑,开上几万个线程,很难抢过人家... 小菜分享一款简单的小米 ...
- SSO单点登录PHP简单版
前面做了一个新项目,需要用户资源可以需要共享.由于之前没有做过这样的东西,回家之后,立马网站百度"单点登录".帖子很多,甄别之后,这里列几篇认为比较有营养. http://blog ...
- 小米8 探索版 屏幕指纹版超简单卡刷开发版获取Root权限的教程
小米的手机不同手机型号通常情况下miui官网都提供两个不同的系统,分别是稳定版和开发版,稳定版没有提供ROOT超级权限管理,开发版中就开启了ROOT超级权限,在很多工作的时候我们需要使用的一些功能强大 ...
- JavaMail简单版实验测试
前言: 最近由于实现web商城的自动发送邮件功能的需求,故涉猎的邮箱协议的内部原理.现将简单版的Java Mail实例做个代码展示,并附上其中可能出现的bug贴出,方便感兴趣的读者进行测试! 1.载入 ...
- iOS开发UI篇—模仿ipad版QQ空间登录界面
iOS开发UI篇—模仿ipad版QQ空间登录界面 一.实现和步骤 1.一般ipad项目在命名的时候可以加一个HD,标明为高清版 2.设置项目的文件结构,分为home和login两个部分 3.登陆界面的 ...
- mySQL 5.7版 解决密码登录失败Access denied for user 'root'@'localhost' (us
mySQL 5.7版 解决密码登录失败Access denied for user 'root'@'localhost' (us 2016-03-05 ...
- 【小米3使用经验】小米3联通版 miui7.2.11稳定版刷机
1.我的手机是小米3联通版的,买来后为了配合公司的手机开发,将Android系统升级到4.4.4版本,MiUi为默认版本. 前段时间可能不小心开启了自动升级,结果Android系统升级到6.0.1版本 ...
- 全栈前端入门必看 koa2+mysql+vue+vant 构建简单版移动端博客
koa2+mysql+vue+vant 构建简单版移动端博客 具体内容展示 开始正文 github地址 <br/> 觉得对你有帮助的话,可以star一下^_^必须安装:<br/> ...
- Java实现简单版SVM
Java实现简单版SVM 近期的图像分类工作要用到latent svm,为了更加深入了解svm,自己动手实现一个简单版的. 之所以说是简单版,由于没实用到拉格朗日,对偶,核函数等等.而 ...
随机推荐
- CSS:文字不在图片中间
平时用的text-align属性比较多,相比较而言vertical-align则用的比较少. 当文字和图片布局在一起时,文字不能对齐到图片的中间,向这样: HTML: <div><i ...
- View基础知识
一.View基础知识 View 是Android中所有控件的基类,是一种界面层的控件的一种抽象,代表了一个控件 1.View的位置参数 View的四个属性:top(左上角纵坐标) left(左 ...
- c#内部类的使用
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threa ...
- mac java环境变量设置
Mac下添加java环境变量 方法一:全局配置 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #临时提权 sudo su #输入密码 vi /et ...
- android surfaceView 黑屏
最近在做一个viewpager + fragment 切换的页面, 其中一个fragment 打开摄像头,需要surfaceView,但是当切换到这个fragment的前一个个时,这个fragment ...
- android 开发项目笔记1
1.xml文件中@string/name @+id/name @id/name 的用法与区别: @string/name 一般长用于从别的资源中获取键值对 @+id/name 为控件指定名 ...
- Cannot instantiate the type AppiumDriver
I have added following jars in my projects build path: java-client-2.0.0 from http://appium.io/downl ...
- ADO.Net读取器获取数据库数据
string str = Configuration.ConfigurationManager.AppSettings[str].ToString(); string sql = "sele ...
- JAVA算法
一.归并排序 归并排序 (merge sort) 是一类与插入排序.交换排序.选择排序不同的另一种排序方法.归并的含义是将两个或两个以上的有序表合并成一个新的有序表.归并排序有多路归并排序.两路归并 ...
- IntelliJ IDEA中如何显示和关闭----工具栏,目录栏,(转)
工具栏:就是上面有个好多的快捷按钮的那个栏,比如撤销,上传,下载设置,扳手按钮,等等. 目录栏,就是刚刚装的时候,这个会显示,但是不知道怎么关闭,但是这个又没什么用. 如图: 就是对应的几个按钮,自己 ...