微信小程序页面迁移校验之前 P5任务处理之前

This commit is contained in:
Neo
2026-03-09 01:19:21 +08:00
parent 263bf96035
commit 6e20987d2f
1112 changed files with 153824 additions and 219694 deletions

View File

@@ -0,0 +1,45 @@
// MVP 全链路验证页面
// 从后端 API 读取 test."xcx-test" 表 ti 列第一行并显示
import { API_BASE } from "../../utils/config"
Page({
data: {
tiValue: "加载中...",
error: "",
loading: true,
},
onLoad() {
this.fetchData()
},
fetchData() {
this.setData({ loading: true, error: "" })
wx.request({
url: `${API_BASE}/api/xcx-test`,
method: "GET",
success: (res) => {
if (res.statusCode === 200 && res.data) {
const data = res.data as { ti: string }
this.setData({
tiValue: data.ti,
loading: false,
})
} else {
this.setData({
error: `请求失败: ${res.statusCode}`,
loading: false,
})
}
},
fail: (err) => {
this.setData({
error: `网络错误: ${err.errMsg}`,
loading: false,
})
},
})
},
})