|

- var infoData = {
- "uin": 3434180272,
- "is_famous": false,
- "famous_custom_homepage": false,
- "nickname": "゛Cramps",
- "emoji": "",
- "spacename": "Cramps的空间",
- "desc": "",
- "signature": "",
- "avatar": "",
- "sex_type": 0,
- "sex": "1",
- "animalsign_type": 0,
- "constellation_type": 0,
- "constellation": 9,
- "age_type": 0,
- "age": 21,
- "islunar": "0",
- "birthday_type": 0,
- "birthyear": 1999,
- "birthday": "1999-01-07",
- "bloodtype": "2",
- "address_type": 0,
- "country": "——",
- "province": "——",
- "city": "——",
- "home_type": 0,
- "hco": "——",
- "hp": "——",
- "hc": "——",
- "marriage": "0",
- "career": "",
- "company": "",
- "cco": "——",
- "cp": "——",
- "cc": "——",
- "cb": "",
- "mailname": "",
- "mailcellphone": "",
- "mailaddr": "",
- "qzworkexp": [],
- "qzeduexp": [],
- "ptimestamp": 1517474161,
- "lover": ""
- }
- var MB_HASH= {
- "nickname": 1,
- "emoji": 2097152,
- "sex": 2,
- "birthday": 4,
- "isfullage": 8,
- "address": 16,
- "marriage": 32,
- "bloodtype": 64,
- "home": 128,
- "career": 256,
- "company": 512,
- "caddress": 1024,
- "spacename": 2048,
- "desc": 4096,
- "signature": 8192,
- "interest": 16384,
- "avatar": 32768,
- "islunar": 65536,
- "lover": 131072
- }
- function getModifyBitmap(new_data) {
- var mb = 0
- , address = false
- , homes = false
- , caddress = false;
- for (var i in new_data) {
- if (typeof new_data[i] == "string") {
- while (new_data[i].indexOf("\r") != -1) {
- new_data[i] = new_data[i].replace("\r", "");
- }
- }
- if (infoData[i] != new_data[i].toString()) {
- if (i == "province" || (i == "city" || i == "country")) {
- if (!address) {
- address = true;
- mb += MB_HASH["address"];
- }
- } else {
- if (i == "hp" || (i == "hc" || i == "hco")) {
- if (!homes) {
- homes = true;
- mb += MB_HASH["home"];
- }
- } else {
- if (i == "cc" || (i == "cp" || (i == "cb" || i == "cco"))) {
- if (!caddress) {
- caddress = true;
- mb += MB_HASH["caddress"];
- }
- } else {
- if (i == "lover") {
- var a = infoData["marriage"]
- , b = new_data["marriage"];
- if ((b == 2 || (b == 4 || b == 5)) && (a != 2 && (a != 4 && a != 5) || a == b)) {
- mb += MB_HASH[i];
- }
- } else {
- mb += MB_HASH[i];
- }
- }
- }
- }
- }
- }
- return mb;
- }
复制代码
直接调用getModifyBitmap(new_data)new_data里传入最新的个人资料
- {"nickname": "゛Cramps","emoji": "","sex": "1","birthday": "1999-01-07","province": "——","city": "——","country": "——","marriage": "0","bloodtype": "1","hp": "——","hc": "——","hco": "——","career": "","company": "","cp": "——","cc": "——","cb": "","cco": "——","lover": "","islunar": "0"}
复制代码 自己改一下就行了。
infoData,MB_HASH都需要自己改一下,改成自己的资料。直接用我的是不行的。
|
|