|
@@ -9,6 +9,25 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
+ <!-- Step 0: 是否需要规划师 -->
|
|
|
|
|
+ <view class="section" v-if="step === 0 && !viewMode">
|
|
|
|
|
+ <view class="section-title">👩🏫 是否需要规划师审核方案?</view>
|
|
|
|
|
+ <view class="hint-text">选择"需要"将进入规划师选择页面,由指定规划师为您审核和定制方案</view>
|
|
|
|
|
+ <view class="teacher-choice">
|
|
|
|
|
+ <view class="choice-card" :class="{ active: needTeacher }" @click="needTeacher = true">
|
|
|
|
|
+ <text class="choice-icon">👩🏫</text>
|
|
|
|
|
+ <text class="choice-label">需要规划师审核</text>
|
|
|
|
|
+ <text class="choice-desc">由专业规划师为您审核并定制方案</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="choice-card" :class="{ active: !needTeacher }" @click="needTeacher = false">
|
|
|
|
|
+ <text class="choice-icon">🤖</text>
|
|
|
|
|
+ <text class="choice-label">系统自动生成</text>
|
|
|
|
|
+ <text class="choice-desc">AI 自动出方案,直接生效</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <button class="btn-next full-btn" :disabled="loading" @click="goToStep1">{{ loading ? '加载中...' : '下一步' }}</button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
<!-- Step 1: 选人 + 提需求 -->
|
|
<!-- Step 1: 选人 + 提需求 -->
|
|
|
<view class="section" v-if="step === 1 && !viewMode">
|
|
<view class="section" v-if="step === 1 && !viewMode">
|
|
|
<view class="section-title-row">
|
|
<view class="section-title-row">
|
|
@@ -162,6 +181,7 @@ export default {
|
|
|
editing: false,
|
|
editing: false,
|
|
|
taskSubmitted: false,
|
|
taskSubmitted: false,
|
|
|
viewMode: false,
|
|
viewMode: false,
|
|
|
|
|
+ needTeacher: false,
|
|
|
planDetail: null,
|
|
planDetail: null,
|
|
|
planId: null
|
|
planId: null
|
|
|
}
|
|
}
|
|
@@ -173,7 +193,7 @@ export default {
|
|
|
allConfirmed: function() {
|
|
allConfirmed: function() {
|
|
|
return this.sections.nutrition.confirmed && this.sections.diet.confirmed && this.sections.exercise.confirmed
|
|
return this.sections.nutrition.confirmed && this.sections.diet.confirmed && this.sections.exercise.confirmed
|
|
|
},
|
|
},
|
|
|
- steps: function() { return ['选人', '总览', '营养', '饮食', '运动', '确认'] },
|
|
|
|
|
|
|
+ steps: function() { return ['规划师', '选人', '总览', '营养', '饮食', '运动', '确认'] },
|
|
|
sectionKeys: function() { return ['nutrition', 'diet', 'exercise'] },
|
|
sectionKeys: function() { return ['nutrition', 'diet', 'exercise'] },
|
|
|
sectionTitles: function() { return ['营养补充建议', '饮食建议', '运动计划'] },
|
|
sectionTitles: function() { return ['营养补充建议', '饮食建议', '运动计划'] },
|
|
|
sectionIcons: function() { return ['💊', '🍽️', '🏃'] },
|
|
sectionIcons: function() { return ['💊', '🍽️', '🏃'] },
|
|
@@ -327,6 +347,16 @@ export default {
|
|
|
self.step = 6
|
|
self.step = 6
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ goToStep1: function() {
|
|
|
|
|
+ var self = this
|
|
|
|
|
+ if (self.needTeacher) {
|
|
|
|
|
+ // 进入规划师选择页
|
|
|
|
|
+ var fid = uni.getStorageSync('familyId') || ''
|
|
|
|
|
+ uni.navigateTo({ url: '/pages/health/teacher-select?familyId=' + fid })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ self.step = 2
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
startEdit: function() {
|
|
startEdit: function() {
|
|
|
this.editing = true
|
|
this.editing = true
|
|
|
this.sectionFeedback = ''
|
|
this.sectionFeedback = ''
|
|
@@ -345,16 +375,21 @@ export default {
|
|
|
dimensions: 'body',
|
|
dimensions: 'body',
|
|
|
goal: self.userGoal.trim(),
|
|
goal: self.userGoal.trim(),
|
|
|
planContent: self.buildPlanContent(),
|
|
planContent: self.buildPlanContent(),
|
|
|
- planJson: planJson,
|
|
|
|
|
- status: 'confirmed'
|
|
|
|
|
|
|
+ planJson: planJson
|
|
|
|
|
+ }
|
|
|
|
|
+ // 根据是否选择规划师决定状态
|
|
|
|
|
+ if (self.needTeacher) {
|
|
|
|
|
+ var tid = uni.getStorageSync('healthPlan_teacherId')
|
|
|
|
|
+ if (tid) saveData.teacherId = parseInt(tid)
|
|
|
|
|
+ saveData.status = 'pending_review'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ saveData.status = 'published'
|
|
|
}
|
|
}
|
|
|
- saveData.status = 'pending_review'
|
|
|
|
|
saveHealthPlan(saveData).then(function(res) {
|
|
saveHealthPlan(saveData).then(function(res) {
|
|
|
self.loading = false
|
|
self.loading = false
|
|
|
if (res && res.code === 200) {
|
|
if (res && res.code === 200) {
|
|
|
- // 方案已提交审核,等待规划师发布
|
|
|
|
|
- uni.showToast({ title: '方案已提交,等待规划师审核发布', icon: 'none', duration: 2500 })
|
|
|
|
|
- setTimeout(function() { uni.navigateBack() }, 1500)
|
|
|
|
|
|
|
+ uni.showToast({ title: self.needTeacher ? '方案已提交审核' : '方案已生成', icon: 'none', duration: 2000 })
|
|
|
|
|
+ setTimeout(function() { uni.navigateBack() }, 1200)
|
|
|
self.taskSubmitted = true
|
|
self.taskSubmitted = true
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({ title: res && res.message ? res.message : '保存失败', icon: 'none' })
|
|
uni.showToast({ title: res && res.message ? res.message : '保存失败', icon: 'none' })
|
|
@@ -445,6 +480,13 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* 步骤条 */
|
|
/* 步骤条 */
|
|
|
|
|
+
|
|
|
|
|
+.teacher-choice { display: flex; gap: 20rpx; margin: 24rpx 0; }
|
|
|
|
|
+.choice-card { flex: 1; background: #fff; border-radius: 20rpx; padding: 32rpx 20rpx; text-align: center; border: 3rpx solid #E5E7EB; }
|
|
|
|
|
+.choice-card.active { border-color: #3B82F6; background: #EFF6FF; }
|
|
|
|
|
+.choice-icon { font-size: 64rpx; display: block; margin-bottom: 12rpx; }
|
|
|
|
|
+.choice-label { font-size: 30rpx; font-weight: bold; color: #333; display: block; }
|
|
|
|
|
+.choice-desc { font-size: 24rpx; color: #666; margin-top: 8rpx; display: block; }
|
|
|
.steps-bar {
|
|
.steps-bar {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|