Sprint 6: report review workflow, CI/K8s, and client tabs.
Add coach review APIs, pose calibration thresholds, Gitea CI, Kubernetes skeleton, H5 practice page, and mini program tab bar. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
const api = require('../../utils/api')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
goal: '',
|
||||
exerciseName: '',
|
||||
planId: null,
|
||||
score: 82,
|
||||
status: '准备就绪',
|
||||
},
|
||||
onShow() {
|
||||
this.loadPlan()
|
||||
},
|
||||
async loadPlan() {
|
||||
try {
|
||||
const children = await api.listChildren()
|
||||
const child = (children.list || [])[0]
|
||||
if (!child) return
|
||||
const plans = await api.request(`/api/training/plans?childId=${child.id}`)
|
||||
const plan = (plans.list || [])[0]
|
||||
if (!plan) return
|
||||
this.setData({
|
||||
planId: plan.id,
|
||||
goal: plan.detail.goal,
|
||||
exerciseName: (plan.detail.exercises[0] || {}).name || '训练动作',
|
||||
})
|
||||
} catch (err) {
|
||||
this.setData({ status: err.message || '加载失败' })
|
||||
}
|
||||
},
|
||||
async submit() {
|
||||
if (!this.data.planId) return
|
||||
this.setData({ status: '提交打卡…' })
|
||||
try {
|
||||
await api.request(`/api/training/plans/${this.data.planId}/records`, {
|
||||
method: 'POST',
|
||||
data: {
|
||||
exerciseId: 1,
|
||||
completed: true,
|
||||
score: this.data.score,
|
||||
durationSeconds: 300,
|
||||
note: '小程序跟练打卡',
|
||||
},
|
||||
})
|
||||
this.setData({ status: '打卡成功 ✓' })
|
||||
} catch (err) {
|
||||
this.setData({ status: err.message || '打卡失败' })
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "训练跟练"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<view class="card">
|
||||
<view>训练计划</view>
|
||||
<view class="muted">{{goal}}</view>
|
||||
<view>{{exerciseName}}</view>
|
||||
<view class="muted">{{status}}</view>
|
||||
<button class="btn-primary" bindtap="submit">提交跟练打卡</button>
|
||||
</view>
|
||||
Reference in New Issue
Block a user