微信小程序页面迁移校验之前 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,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "MVP验证"
}

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,
})
},
})
},
})

View File

@@ -0,0 +1,19 @@
<!--MVP 全链路验证页面-->
<view class="container">
<view class="title">小程序 MVP 验证</view>
<view class="desc">数据来源: test_zqyy_app → test."xcx-test" → ti</view>
<view class="result" wx:if="{{!error}}">
<text class="value">{{tiValue}}</text>
</view>
<view class="error" wx:if="{{error}}">
<text>{{error}}</text>
</view>
<view class="retry" bindtap="fetchData">
<text>点击刷新</text>
</view>
</view>
<dev-fab />

View File

@@ -0,0 +1,48 @@
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
padding: 40rpx;
}
.title {
font-size: 36rpx;
font-weight: bold;
margin-bottom: 20rpx;
}
.desc {
font-size: 24rpx;
color: #999;
margin-bottom: 60rpx;
}
.result {
background: #f0f9ff;
border: 2rpx solid #0ea5e9;
border-radius: 16rpx;
padding: 40rpx 80rpx;
margin-bottom: 40rpx;
}
.value {
font-size: 48rpx;
font-weight: bold;
color: #0369a1;
}
.error {
color: #dc2626;
font-size: 28rpx;
margin-bottom: 40rpx;
}
.retry {
padding: 20rpx 40rpx;
background: #0ea5e9;
color: #fff;
border-radius: 8rpx;
font-size: 28rpx;
}