买家信用
卖家信用
记录0
日志0
相册1
听众0
收听0
精华3
阅读权限10
在线时间8 小时
注册时间2026-7-18
最后登录2026-9-8
幼儿园
- UID
- 144
- 主题
- 10
- 回帖
- 0
金币- 0 枚
银币- 42 枚
铜币- 46 枚
下载币- 75 枚
- 在线时间
- 8 小时

  
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?免费注册
×
测试账号:000000
账号密码:123456
复制代码直接运行测试
应用管理平台之反馈系统演示.
应用管理平台之反馈系统演示.
应用管理平台之反馈系统演示.
- --应用管理平台 · 反馈提交工具演示
- --https://app.jishiben.site/
- --账号:000000
- --密码:123456
- require "import"
- import "android.os.*"
- import "android.widget.*"
- import "android.view.*"
- import "android.widget.ImageView"
- import "android.webkit.WebView"
- import "android.graphics.Color"
- import "android.widget.ScrollView"
- import "android.widget.LinearLayout"
- import "android.widget.Button"
- import "android.widget.EditText"
- import "android.widget.TextView"
- import "android.view.View"
- import "android.view.WindowManager"
- import "android.graphics.Color"
- local window = this.getWindow()
- window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
- window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
- window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
- window.setStatusBarColor(Color.TRANSPARENT)
- local 状态栏高度 = this.getResources().getDimensionPixelSize(luajava.bindClass("com.android.internal.R$dimen")().status_bar_height)
- local 标题栏布局 = {
- LinearLayout,
- orientation = "horizontal",
- layout_width = "fill",
- layout_height = "56dp",
- layout_marginTop = 状态栏高度,
- gravity = "left|center",
- {
- TextView,
- layout_marginLeft = "4%w",
- layout_weight = "1",
- text = "反馈提交",
- textSize = "18sp",
- textColor = "#ffffff",
- singleLine = true,
- },
- {
- ImageView,
- layout_width = "56dp",
- layout_height = "56dp",
- padding = "16dp",
- src = "https://yuju.99k右上角图标pk.top:81/pan/1447/1000159669.jpg",
- -- src = "hcon.png", -- 请确保项目中有该图片或替换为其他图标
- },
- }
- -- 主布局
- local layout = {
- LinearLayout,
- orientation = "vertical",
- layout_width = "fill",
- layout_height = "fill",
- {
- LinearLayout,
- orientation = "vertical",
- layout_width = "fill",
- layout_height = "wrap",
- background = "#ff2196f3",
- elevation = "4dp",
- 标题栏布局,
- },
- {
- ScrollView,
- layout_width = "fill",
- layout_height = "fill",
- overScrollMode = View.OVER_SCROLL_NEVER,
- verticalScrollBarEnabled = false,
- {
- LinearLayout,
- orientation = "vertical",
- layout_width = "fill",
- layout_height = "fill",
- padding = "16dp",
- {
- TextView,
- text = "请输入您的反馈内容:",
- textSize = "16sp",
- textColor = "#333333",
- layout_marginBottom = "8dp",
- },
- {
- EditText,
- id = "输入",
- layout_width = "fill",
- layout_height = "wrap",
- hint = "在此输入反馈内容...",
- textSize = "15sp",
- singleLine = false,
- minHeight = "100dp",
- background = "#f5f5f5",
- padding = "12dp",
- },
- {
- Button,
- id = "按钮",
- text = "提交反馈",
- layout_width = "fill",
- layout_height = "wrap",
- layout_marginTop = "16dp",
- background = "#ff2196f3",
- textColor = "#ffffff",
- textSize = "16sp",
- onClick = function()
- -- 防抖:防止快速连点
- if 按钮.isEnabled == false then return end
- 按钮.setEnabled(false)
- 按钮.text = "提交中..."
- local content = 输入.text
- if content == "" then
- print("反馈内容不能为空")
- 按钮.setEnabled(true)
- 按钮.text = "提交反馈"
- return
- end
- -- URL 编码函数
- local function url_标识(str)
- if not str then return "" end
- str = string.gsub(str, "([^%w%-_%.~])", function(c)
- return string.format("%%%02X", string.byte(c))
- end)
- return str
- end
- -- 固定参数(可根据需要改为用户输入)
- local app_id = "test_9710"
- local app_key = "3d1d9d570158c491"
- local email = "your@email.com" -- 可增加输入框让用户填写
- local base_url = "https://app.jishiben.site/" --提交地址
- local query = string.format(
- "action=submit_feedback&app_id=%s&app_key=%s&email=%s&content=%s", --拼接提交地址
- url_标识(app_id),
- url_标识(app_key),
- url_标识(email),
- url_标识(content)
- )
- local full_url = base_url .. "?" .. query
- -- 发送请求
- Http.get(full_url, nil, "utf8", nil, function(网页状态, 取内容)
- 按钮.setEnabled(true)
- 按钮.text = "提交反馈"
- if 网页状态 == 200 and 取内容 then
- -- 解析 JSON 中的 msg 内容
- local msg = 取内容:match([["msg": "(.-)",]])
- if msg then
- print( msg)
- if msg == "反馈已提交" then
- 输入.text = "" -- 清空输入框
- end
- else
- print(取内容)
- end
- else
- print("请求失败,请检查网络")
- end
- end)
- end,
- },
- },
- },
- }
- activity.setContentView(loadlayout(layout))
复制代码
|
- 本论坛所有用户发布内容仅代表其个人观点,不代表论坛立场。
- 论坛管理方不对内容的真实性、准确性及合法性承担责任。
- 用户发布原创内容版权归原作者所有,未经许可禁止转载或商用。
- 严禁发布侵权、违法、违规信息,违规者将承担全部法律责任。
- 论坛有权在必要时修改本声明,修改后继续使用视为同意。
- 如发现侵权内容,请通过官方渠道投诉,我们将在48小时内处理。
|