在准备环境前提交次全部更改。

This commit is contained in:
Neo
2026-02-19 08:35:13 +08:00
parent ded6dfb9d8
commit 4eac07da47
1387 changed files with 6107191 additions and 33002 deletions

View File

@@ -1,5 +1,6 @@
{
"pages": [
"pages/mvp/mvp",
"pages/index/index",
"pages/logs/logs"
],

View File

@@ -0,0 +1,66 @@
// pages/logs/logs.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {
}
}

View File

@@ -0,0 +1,21 @@
// logs.ts
// const util = require('../../utils/util.js')
import { formatTime } from '../../utils/util'
Component({
data: {
logs: [],
},
lifetimes: {
attached() {
this.setData({
logs: (wx.getStorageSync('logs') || []).map((log: string) => {
return {
date: formatTime(new Date(log)),
timeStamp: log
}
}),
})
}
},
})

View File

@@ -0,0 +1,6 @@
<!--logs.wxml-->
<scroll-view class="scrollarea" scroll-y type="list">
<block wx:for="{{logs}}" wx:key="timeStamp" wx:for-item="log">
<view class="log-item">{{index + 1}}. {{log.date}}</view>
</block>
</scroll-view>

View File

@@ -0,0 +1,16 @@
page {
height: 100vh;
display: flex;
flex-direction: column;
}
.scrollarea {
flex: 1;
overflow-y: hidden;
}
.log-item {
margin-top: 20rpx;
text-align: center;
}
.log-item:last-child {
padding-bottom: env(safe-area-inset-bottom);
}

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,17 @@
<!--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>

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;
}

View File

@@ -0,0 +1,26 @@
/**
* 环境配置
*
* 根据小程序运行环境自动切换 API 地址:
* - develop开发版→ 本机
* - trial体验版→ 测试环境
* - release正式版→ 正式环境
*/
function getApiBase(): string {
const accountInfo = wx.getAccountInfoSync()
const envVersion = accountInfo.miniProgram.envVersion
switch (envVersion) {
case "develop":
return "http://127.0.0.1:8000"
case "trial":
return "https://api.langlangzhuoqiu.cn"
case "release":
return "https://api.langlangzhuoqiu.cn"
default:
return "https://api.langlangzhuoqiu.cn"
}
}
export const API_BASE = getApiBase()

View File

@@ -1,6 +1,6 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "XCX",
"projectname": "NeoZQYY",
"setting": {
"compileHotReLoad": true,
"urlCheck": true,