--应用管理平台 · 反馈提交工具演示
--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))资源密码:yghy
本站资源,均来自网络,版权归原作者,所有资源和文章仅限用于学习和研究目的。
不得用于商业或非法用途,否则,一切责任由该用户承担!
您必须在下载后的24个小时之内,从您的电脑&手机中彻底删除下载的资源
资源失效,举报投诉,建议意见等,都可以来反馈。综合反馈