找回密码
 免费注册

QQ登录

只需一步,快速开始

搜索
查看: 5|回复: 0

应用管理平台之反馈系统演示.

[复制链接]

应用管理平台之反馈系统演示.

[复制链接]

幼儿园


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

QQ

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

xk***

幼儿园


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

QQ

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

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

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

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

×
测试账号:000000

账号密码:123456
复制代码直接运行测试

应用管理平台之反馈系统演示.

应用管理平台之反馈系统演示.

应用管理平台之反馈系统演示.

应用管理平台之反馈系统演示.

应用管理平台之反馈系统演示.

应用管理平台之反馈系统演示.

  1. --应用管理平台 · 反馈提交工具演示
  2. --https://app.jishiben.site/
  3. --账号:000000
  4. --密码:123456
  5. require "import"
  6. import "android.os.*"
  7. import "android.widget.*"
  8. import "android.view.*"
  9. import "android.widget.ImageView"
  10. import "android.webkit.WebView"
  11. import "android.graphics.Color"
  12. import "android.widget.ScrollView"
  13. import "android.widget.LinearLayout"
  14. import "android.widget.Button"
  15. import "android.widget.EditText"
  16. import "android.widget.TextView"
  17. import "android.view.View"
  18. import "android.view.WindowManager"
  19. import "android.graphics.Color"

  20. local window = this.getWindow()
  21. window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
  22. window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
  23. window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
  24. window.setStatusBarColor(Color.TRANSPARENT)
  25. local 状态栏高度 = this.getResources().getDimensionPixelSize(luajava.bindClass("com.android.internal.R$dimen")().status_bar_height)
  26. local 标题栏布局 = {
  27.   LinearLayout,
  28.   orientation = "horizontal",
  29.   layout_width = "fill",
  30.   layout_height = "56dp",
  31.   layout_marginTop = 状态栏高度,
  32.   gravity = "left|center",
  33.   {
  34.     TextView,
  35.     layout_marginLeft = "4%w",
  36.     layout_weight = "1",
  37.     text = "反馈提交",
  38.     textSize = "18sp",
  39.     textColor = "#ffffff",
  40.     singleLine = true,
  41.   },
  42.   {
  43.     ImageView,
  44.     layout_width = "56dp",
  45.     layout_height = "56dp",
  46.     padding = "16dp",
  47.     src = "https://yuju.99k右上角图标pk.top:81/pan/1447/1000159669.jpg",
  48.    -- src = "hcon.png", -- 请确保项目中有该图片或替换为其他图标
  49.   },
  50. }

  51. -- 主布局
  52. local layout = {
  53.   LinearLayout,
  54.   orientation = "vertical",
  55.   layout_width = "fill",
  56.   layout_height = "fill",
  57.   {
  58.     LinearLayout,
  59.     orientation = "vertical",
  60.     layout_width = "fill",
  61.     layout_height = "wrap",
  62.     background = "#ff2196f3",
  63.     elevation = "4dp",
  64.     标题栏布局,
  65.   },
  66.   {
  67.     ScrollView,
  68.     layout_width = "fill",
  69.     layout_height = "fill",
  70.     overScrollMode = View.OVER_SCROLL_NEVER,
  71.     verticalScrollBarEnabled = false,
  72.     {
  73.       LinearLayout,
  74.       orientation = "vertical",
  75.       layout_width = "fill",
  76.       layout_height = "fill",
  77.       padding = "16dp",
  78.       {
  79.         TextView,
  80.         text = "请输入您的反馈内容:",
  81.         textSize = "16sp",
  82.         textColor = "#333333",
  83.         layout_marginBottom = "8dp",
  84.       },
  85.       {
  86.         EditText,
  87.         id = "输入",
  88.         layout_width = "fill",
  89.         layout_height = "wrap",
  90.         hint = "在此输入反馈内容...",
  91.         textSize = "15sp",
  92.         singleLine = false,
  93.         minHeight = "100dp",
  94.         background = "#f5f5f5",
  95.         padding = "12dp",
  96.       },
  97.       {
  98.         Button,
  99.         id = "按钮",
  100.         text = "提交反馈",
  101.         layout_width = "fill",
  102.         layout_height = "wrap",
  103.         layout_marginTop = "16dp",
  104.         background = "#ff2196f3",
  105.         textColor = "#ffffff",
  106.         textSize = "16sp",
  107.         onClick = function()
  108.           -- 防抖:防止快速连点
  109.           if 按钮.isEnabled == false then return end
  110.           按钮.setEnabled(false)
  111.           按钮.text = "提交中..."

  112.           local content = 输入.text
  113.           if content == "" then
  114.             print("反馈内容不能为空")
  115.             按钮.setEnabled(true)
  116.             按钮.text = "提交反馈"
  117.             return
  118.           end

  119.           -- URL 编码函数
  120.           local function url_标识(str)
  121.             if not str then return "" end
  122.             str = string.gsub(str, "([^%w%-_%.~])", function(c)
  123.               return string.format("%%%02X", string.byte(c))
  124.             end)
  125.             return str
  126.           end

  127.           -- 固定参数(可根据需要改为用户输入)
  128.           local app_id = "test_9710"
  129.           local app_key = "3d1d9d570158c491"
  130.           local email = "your@email.com" -- 可增加输入框让用户填写
  131.           local base_url = "https://app.jishiben.site/"  --提交地址
  132.           local query = string.format(
  133.           "action=submit_feedback&app_id=%s&app_key=%s&email=%s&content=%s",  --拼接提交地址
  134.           url_标识(app_id),
  135.           url_标识(app_key),
  136.           url_标识(email),
  137.           url_标识(content)
  138.           )
  139.           local full_url = base_url .. "?" .. query
  140.           -- 发送请求
  141.           Http.get(full_url, nil, "utf8", nil, function(网页状态, 取内容)
  142.             按钮.setEnabled(true)
  143.             按钮.text = "提交反馈"

  144.             if 网页状态 == 200 and 取内容 then
  145.               -- 解析 JSON 中的 msg 内容
  146.               local msg = 取内容:match([["msg": "(.-)",]])
  147.               if msg then
  148.                 print( msg)
  149.                 if msg == "反馈已提交" then
  150.                   输入.text = "" -- 清空输入框
  151.                 end
  152.                else
  153.                 print(取内容)
  154.               end
  155.              else
  156.               print("请求失败,请检查网络")
  157.             end
  158.           end)
  159.         end,
  160.       },
  161.     },
  162.   },
  163. }

  164. activity.setContentView(loadlayout(layout))
复制代码



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

本版积分规则

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

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

快速回复