找回密码
 免费注册

QQ登录

只需一步,快速开始

搜索
查看: 3|回复: 0

应用管理平台之查询QQ昵称头像

[复制链接]

应用管理平台之查询QQ昵称头像

[复制链接]

幼儿园


UID
144
主题
10
回帖
0
金币
0 枚
银币
42 枚
铜币
46 枚
下载币
75 枚
在线时间
8 小时

QQ

最佳新人活跃会员热心会员

xk***

幼儿园


UID
144
主题
10
回帖
0
金币
0 枚
银币
42 枚
铜币
46 枚
下载币
75 枚
在线时间
8 小时

QQ

最佳新人活跃会员热心会员

昨天 23:45 | 显示全部楼层 |阅读模式 来自 湖南

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?免费注册

×

代码复制就能用,接口为测试用,随时停
想要稳定自己注册

应用管理平台之查询QQ昵称头像

应用管理平台之查询QQ昵称头像


  1. --[[测试账号000000
  2. 账号123456密码]]
  3. require "import"
  4. import "android.widget.*"
  5. import "android.view.*"
  6. import "android.graphics.*"
  7. import "android.os.Build"
  8. import "com.androlua.Http"
  9. import "cjson"

  10. local window = activity.getWindow()
  11. window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
  12. local decorView = window.getDecorView()
  13. local flags = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + View.SYSTEM_UI_FLAG_LAYOUT_STABLE
  14. if Build.VERSION.SDK_INT >= 23 then
  15.   flags = flags + View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
  16. end
  17. decorView.setSystemUiVisibility(flags)
  18. window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
  19. window.setStatusBarColor(Color.TRANSPARENT)

  20. local layout = {
  21.   LinearLayout,
  22.   orientation = "vertical",
  23.   layout_width = "fill",
  24.   layout_height = "fill",
  25.   padding = "60dp",
  26.   gravity="top|center";
  27.   background = "#FFFFFFFF",
  28.   {
  29.     EditText,
  30.     id = "输入",
  31.     layout_width = "fill",
  32.     layout_height = "wrap",
  33.     hint = "请输入 QQ 号",
  34.     inputType = 2,
  35.     singleLine = true,
  36.   },
  37.   {
  38.     Button,
  39.     id = "按钮",
  40.     layout_width = "fill",
  41.     layout_height = "wrap",
  42.     text = "查询",
  43.     layout_marginTop = "12dp",
  44.   },
  45.   {
  46.     LinearLayout,
  47.     orientation = "horizontal",
  48.     layout_width = "fill",
  49.     layout_height = "wrap",
  50.     layout_marginTop = "24dp",
  51.     gravity = "center",
  52.     {
  53.       id = "头像",
  54.       CircleImageView,
  55.       layout_width = "80dp",
  56.       layout_height = "80dp",
  57.     },
  58.     {
  59.       TextView,
  60.       id = "昵称",
  61.       layout_width = "wrap",
  62.       layout_height = "wrap",
  63.       textSize = "18sp",
  64.       layout_marginLeft = "16dp",
  65.     },
  66.   },
  67. }

  68. activity.setContentView(loadlayout(layout))
  69. 头像.setScaleType(ImageView.ScaleType.CENTER_CROP)

  70. 按钮.onClick = function()
  71.   local qq = 输入.getText().toString()
  72.   if qq == "" then
  73.     昵称.setText("请输入 QQ 号")
  74.     return
  75.   end

  76.   local url = "https://app.jishiben.site/?key=3d1d9d570158c491&qq=" .. qq
  77.   Http.get(url, nil, "UTF-8", nil, function(code, content)
  78.     if code == 200 and content then
  79.       local ok, data = pcall(cjson.decode, content)
  80.       if ok and data and data.code == 0 then
  81.         local nickname = data.data.nickname or "未知昵称"
  82.         local avatar = data.data.avatar or ""
  83.         activity.runOnUiThread(function()
  84.           昵称.setText(nickname)
  85.           if avatar ~= "" then
  86.             local bmp = loadbitmap(avatar)
  87.             if bmp then
  88.               头像.setImageBitmap(bmp)
  89.             else
  90.               头像.setImageDrawable(nil)
  91.             end
  92.           else
  93.             头像.setImageDrawable(nil)
  94.           end
  95.         end)
  96.       else
  97.         local errMsg = (data and data.msg) or "数据解析失败"
  98.         activity.runOnUiThread(function()
  99.           昵称.setText("查询失败")
  100.           头像.setImageDrawable(nil)
  101.         end)
  102.       end
  103.     else
  104.       activity.runOnUiThread(function()
  105.         昵称.setText("网络请求失败")
  106.         头像.setImageDrawable(nil)
  107.       end)
  108.     end
  109.   end)
  110. end
复制代码


楼主热帖

相关帖子

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

Archiver|小黑屋|FusionApp论坛 | |网站地图|网站地图
ANK V1.1.8 正式版支持 | 本站服务器位于中国香港,无需办理内地 ICP 备案,运营遵守香港地区相关法律规定。

GMT+8, 2026-9-9 04:31

快速回复