This commit is contained in:
Your Name
2026-06-05 15:12:57 +08:00
parent c554e08f2e
commit a440702c07
12 changed files with 298 additions and 92 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import App from './App' import App from './App'
var baseUrl ='https://css.zhenyangtang.com.cn/'; var baseUrl ='https://admin.zhenyangtang.com.cn/';
function joinApiUrl(base, path) { function joinApiUrl(base, path) {
const b = String(base || '').replace(/\/+$/, '') const b = String(base || '').replace(/\/+$/, '')
@@ -66,8 +66,8 @@ function onImageError() {
left: 50%; left: 50%;
top: 50%; top: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
width: 58%; width: 75%;
height: 58%; height: 75%;
z-index: 2; z-index: 2;
} }
+2 -1
View File
@@ -32,7 +32,8 @@ export function warmUpFoodImgs(foods) {
const list = Array.isArray(foods) ? foods : [] const list = Array.isArray(foods) ? foods : []
list.forEach((f) => { list.forEach((f) => {
const icon = typeof f === 'string' ? f : f?.icon const icon = typeof f === 'string' ? f : f?.icon
const url = getFoodImgUrl(icon) // 优先预热自定义图片素材,缺省回退 emoji PNG
const url = (typeof f === 'object' && f?.img) ? f.img : getFoodImgUrl(icon)
if (!url) return if (!url) return
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
try { try {
+18 -4
View File
@@ -58,7 +58,12 @@ const FOOD_TIP_OVERRIDE = {
apple: '带皮整果,升糖较慢', apple: '带皮整果,升糖较慢',
milk: '低糖,含蛋白,适量喝好', milk: '低糖,含蛋白,适量喝好',
fish: '优质蛋白,升糖低', fish: '优质蛋白,升糖低',
beef: '蛋白为主,升糖低' beef: '蛋白为主,升糖低',
milkOats: '燕麦加奶,升糖中等,选无糖燕麦更好',
grainMantou: '杂粮做的,比白馒头稳,仍要控量',
riceNoodleSoup: '米粉升糖快,汤粉要少吃',
friedNoodles: '油多又是精面,升糖快',
centuryEggCongee: '白粥熬得软烂,升糖很快,糖友要少喝'
} }
/** 含糖等级通用科普文案 */ /** 含糖等级通用科普文案 */
@@ -76,6 +81,9 @@ export function getFoodTip(food) {
return GI_TIP_DEFAULT[food.gi] || '' return GI_TIP_DEFAULT[food.gi] || ''
} }
/** 自定义图片素材目录(腾讯云 COS,优先使用真实图片而非 emoji) */
const GAMES_IMG_BASE = 'https://gz-1349751149.cos.ap-guangzhou.myqcloud.com/games'
const RAW_FOODS = [ const RAW_FOODS = [
// 低 GI // 低 GI
{ key: 'lettuce', icon: '🥬', name: '生菜', gi: 'low', val: -3, color: '#8BC34A' }, { key: 'lettuce', icon: '🥬', name: '生菜', gi: 'low', val: -3, color: '#8BC34A' },
@@ -120,6 +128,8 @@ const RAW_FOODS = [
{ key: 'coffee', icon: '☕', name: '咖啡', gi: 'mid', val: 2, color: '#6F4E37' }, { key: 'coffee', icon: '☕', name: '咖啡', gi: 'mid', val: 2, color: '#6F4E37' },
{ key: 'corn', icon: '🌽', name: '玉米', gi: 'mid', val: 5, color: '#F9C513' }, { key: 'corn', icon: '🌽', name: '玉米', gi: 'mid', val: 5, color: '#F9C513' },
{ key: 'udon', icon: '🍲', name: '乌冬面', gi: 'mid', val: 5, color: '#D9B88F' }, { key: 'udon', icon: '🍲', name: '乌冬面', gi: 'mid', val: 5, color: '#D9B88F' },
{ key: 'milkOats', icon: '🥣', name: '奶冲麦片', gi: 'mid', val: 6, color: '#E8D9B5', img: `${GAMES_IMG_BASE}/%E5%A5%B6%E5%86%B2%E9%BA%A6%E7%89%87.png` },
{ key: 'grainMantou', icon: '🫓', name: '杂粮馒头', gi: 'mid', val: 5, color: '#C8A878', img: `${GAMES_IMG_BASE}/%E6%9D%82%E7%B2%AE%E9%A6%92%E5%A4%B4.png` },
// 高 GI // 高 GI
{ key: 'whiteRice', icon: '🍚', name: '白米饭', gi: 'high', val: 18, color: '#E0E0E0' }, { key: 'whiteRice', icon: '🍚', name: '白米饭', gi: 'high', val: 18, color: '#E0E0E0' },
@@ -136,7 +146,10 @@ const RAW_FOODS = [
{ key: 'maltose', icon: '🍬', name: '麦芽糖', gi: 'high', val: 24, color: '#FFA726' }, { key: 'maltose', icon: '🍬', name: '麦芽糖', gi: 'high', val: 24, color: '#FFA726' },
{ key: 'soda', icon: '🥤', name: '汽水', gi: 'high', val: 25, color: '#C62828' }, { key: 'soda', icon: '🥤', name: '汽水', gi: 'high', val: 25, color: '#C62828' },
{ key: 'orangeJuice', icon: '🧃', name: '柳橙汁', gi: 'high', val: 22, color: '#FF9F1C' }, { key: 'orangeJuice', icon: '🧃', name: '柳橙汁', gi: 'high', val: 22, color: '#FF9F1C' },
{ key: 'stickyRice', icon: '🍡', name: '糯米饭', gi: 'high', val: 19, color: '#F2A7B8' } { key: 'stickyRice', icon: '🍡', name: '糯米饭', gi: 'high', val: 19, color: '#F2A7B8' },
{ key: 'riceNoodleSoup', icon: '🍜', name: '汤粉', gi: 'high', val: 16, color: '#E8C9A0', img: `${GAMES_IMG_BASE}/%E6%B1%A4%E7%B2%89.png` },
{ key: 'friedNoodles', icon: '🍝', name: '炒面', gi: 'high', val: 18, color: '#C8843C', img: `${GAMES_IMG_BASE}/%E7%82%92%E9%9D%A2.png` },
{ key: 'centuryEggCongee', icon: '🥣', name: '皮蛋瘦肉粥', gi: 'high', val: 15, color: '#D9CBB0', img: `${GAMES_IMG_BASE}/%E7%9A%AE%E8%9B%8B%E7%98%A6%E8%82%89%E7%B2%A5.png` }
] ]
export const FOOD_LIBRARY = RAW_FOODS.map((f, i) => { export const FOOD_LIBRARY = RAW_FOODS.map((f, i) => {
@@ -149,7 +162,8 @@ export const FOOD_LIBRARY = RAW_FOODS.map((f, i) => {
clearVal, clearVal,
giLabel: GI_LABEL[f.gi], giLabel: GI_LABEL[f.gi],
get img() { get img() {
return getFoodImgUrl(f.icon) // 优先使用自定义图片素材,缺省回退到 emoji PNG
return f.img || getFoodImgUrl(f.icon)
} }
} }
}) })
@@ -170,6 +184,6 @@ export function cloneFoodType(food) {
giLabel: food.giLabel, giLabel: food.giLabel,
val: food.val, val: food.val,
color: food.color, color: food.color,
img: getFoodImgUrl(food.icon) img: food.img || getFoodImgUrl(food.icon)
} }
} }
+10
View File
@@ -2,6 +2,14 @@
* 关卡配置:面向 45+ 的认知练习,节奏放慢、无失败惩罚。 * 关卡配置:面向 45+ 的认知练习,节奏放慢、无失败惩罚。
* 每组目标只比上一组略增,步数充裕(仅展示,不会因耗尽判负)。 * 每组目标只比上一组略增,步数充裕(仅展示,不会因耗尽判负)。
*/ */
/**
* 指定关卡固定食材(按 key)。未配置的关卡走随机抽取逻辑。
* 第一关固定为这 5 种带真实图片素材的食物。
*/
const FIXED_LEVEL_FOODS = {
1: ['milkOats', 'grainMantou', 'riceNoodleSoup', 'friedNoodles', 'centuryEggCongee']
}
export function getLevelConfig(levelId) { export function getLevelConfig(levelId) {
const lv = Math.max(1, Math.min(999, Number(levelId) || 1)) const lv = Math.max(1, Math.min(999, Number(levelId) || 1))
const tier = Math.floor((lv - 1) / 5) const tier = Math.floor((lv - 1) / 5)
@@ -14,6 +22,8 @@ export function getLevelConfig(levelId) {
goalTargets: [6 + tier, 8 + tier], goalTargets: [6 + tier, 8 + tier],
scoreTarget: 2000 + lv * 300, scoreTarget: 2000 + lv * 300,
startGlucose: 50, startGlucose: 50,
// 固定食材(可选):存在时本关只用这些食物
foods: FIXED_LEVEL_FOODS[lv] || null,
boosters: { boosters: {
insulin: 3, insulin: 3,
fiber: 1, fiber: 1,
+36 -8
View File
@@ -158,29 +158,37 @@
<view class="gg-main" :style="mainStyle"> <view class="gg-main" :style="mainStyle">
<!-- 仅展示上次消除的食物与含糖量 --> <!-- 仅展示上次消除的食物与含糖量 -->
<view v-if="gamePhase === 'playing'" class="gg-hud-last-food"> <view v-if="gamePhase === 'playing'" class="gg-hud-last-food">
<view class="gg-hud-last-food-head">
<text class="gg-hud-last-food-kicker">上次消除</text> <text class="gg-hud-last-food-kicker">上次消除</text>
<view
v-if="lastClearedFood"
class="gg-hud-last-food-chip"
:class="'is-' + lastClearedFood.gi"
>
<text class="gg-hud-last-food-chip-dot"></text>
<text class="gg-hud-last-food-chip-text">{{ lastClearedFood.giShort }}</text>
</view>
</view>
<view <view
v-if="lastClearedFood" v-if="lastClearedFood"
class="gg-hud-last-food-card" class="gg-hud-last-food-card"
:class="'is-' + lastClearedFood.gi" :class="'is-' + lastClearedFood.gi"
> >
<view class="gg-hud-last-food-icon"> <view class="gg-hud-last-food-icon" :class="'is-' + lastClearedFood.gi">
<FoodTileIcon :food="lastClearedFood.food" size="goal" /> <FoodTileIcon :food="lastClearedFood.food" size="goal" />
</view> </view>
<view class="gg-hud-last-food-body"> <view class="gg-hud-last-food-body">
<text class="gg-hud-last-food-name">{{ lastClearedFood.name }}</text> <text class="gg-hud-last-food-name">{{ lastClearedFood.name }}</text>
<view class="gg-hud-last-food-sugar-row"> <view class="gg-hud-last-food-sugar-row">
<text class="gg-hud-last-food-sugar-label">含糖量</text> <view class="gg-hud-last-food-gi" :class="'is-' + lastClearedFood.gi">
<text <text class="gg-hud-last-food-gi-text">含糖 {{ lastClearedFood.giShort }}</text>
class="gg-hud-last-food-gi" </view>
:class="'is-' + lastClearedFood.gi"
:style="{ backgroundColor: lastClearedFood.color }"
>{{ lastClearedFood.giShort }}</text>
<text class="gg-hud-last-food-sugar-hint">{{ lastClearedFood.eatHint }}</text> <text class="gg-hud-last-food-sugar-hint">{{ lastClearedFood.eatHint }}</text>
</view> </view>
</view> </view>
</view> </view>
<view v-else class="gg-hud-last-food-placeholder"> <view v-else class="gg-hud-last-food-placeholder">
<view class="gg-hud-last-food-placeholder-dot" aria-hidden="true"></view>
<text>三连消除后这里显示食物名称与含糖量</text> <text>三连消除后这里显示食物名称与含糖量</text>
</view> </view>
</view> </view>
@@ -290,6 +298,7 @@ import {
getClearVal, getClearVal,
getFoodTip, getFoodTip,
formatEatLabel, formatEatLabel,
getFoodByKey,
GI_SHORT, GI_SHORT,
GI_COLOR GI_COLOR
} from '../data/gameFoodLibrary.js' } from '../data/gameFoodLibrary.js'
@@ -365,6 +374,25 @@ function pickRandom(pool, n) {
* 低/中各若干 + 仅 1 种高糖;再从中挑 2 种作为收集目标。 * 低/中各若干 + 仅 1 种高糖;再从中挑 2 种作为收集目标。
*/ */
function selectSessionFoods() { function selectSessionFoods() {
// 固定食材关卡(如第一关):只用配置里的这些食物
const fixedKeys = levelConfig.value.foods
if (Array.isArray(fixedKeys) && fixedKeys.length) {
const fixed = fixedKeys.map((k) => getFoodByKey(k)).filter(Boolean)
const fixedHighs = fixed.filter((f) => f.gi === 'high')
const fixedHighPick = pickRandom(fixedHighs, 1)
sessionHighFood.value = fixedHighPick[0] ? cloneFoodType(fixedHighPick[0]) : null
activeFoods.value = fixed
warmUpFoodImgs(fixed)
const goalFoods = pickRandom(fixed, 2)
const fixedTargets = levelConfig.value.goalTargets || [10, 12]
goalDefs.value = goalFoods.map((f, i) => ({ key: f.key, food: cloneFoodType(f), target: fixedTargets[i] ?? 10 }))
rebuildGoals()
return
}
const lows = FOOD_LIBRARY.filter((f) => f.gi === 'low') const lows = FOOD_LIBRARY.filter((f) => f.gi === 'low')
const mids = FOOD_LIBRARY.filter((f) => f.gi === 'mid') const mids = FOOD_LIBRARY.filter((f) => f.gi === 'mid')
const highs = FOOD_LIBRARY.filter((f) => f.gi === 'high') const highs = FOOD_LIBRARY.filter((f) => f.gi === 'high')
@@ -554,7 +582,7 @@ const gridStyle = computed(() => {
} }
if (w > 0 && h > 0) { if (w > 0 && h > 0) {
style.width = `${w}px` style.width = `${w}px`
style.height = `${h}px` style.height = `${h+10}px`
} }
return style return style
}) })
+163 -52
View File
@@ -124,39 +124,122 @@
color: #64748b; color: #64748b;
} }
/* ===== 次:上次消除(名称 + 含糖量) ===== */ /* ===== 次:上次消除(名称 + 含糖量)GI 三色编码学习卡 ===== */
.game-page .gg-hud-last-food { .game-page .gg-hud-last-food {
flex-shrink: 0; flex-shrink: 0;
width: 100%; width: 100%;
max-width: 750rpx; max-width: 750rpx;
margin: 0 auto 14rpx; margin: 0 auto 14rpx;
padding: 16rpx 18rpx; padding: 16rpx 18rpx 18rpx;
border-radius: 22rpx; border-radius: 26rpx;
background: rgba(255, 255, 255, 0.88); background: rgba(255, 255, 255, 0.92);
border: 1rpx solid rgba(0, 108, 73, 0.1); border: 1rpx solid rgba(0, 108, 73, 0.1);
box-sizing: border-box; box-sizing: border-box;
box-shadow: 0 4rpx 16rpx rgba(0, 108, 73, 0.06); box-shadow: 0 6rpx 20rpx rgba(0, 108, 73, 0.07);
}
/* 头部:标题 + GI 状态胶囊 */
.game-page .gg-hud-last-food-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12rpx;
margin-bottom: 12rpx;
} }
.game-page .gg-hud-last-food-kicker { .game-page .gg-hud-last-food-kicker {
display: block;
font-size: 24rpx;
font-weight: 700;
color: #475569;
letter-spacing: 0.04em;
margin-bottom: 12rpx;
line-height: 1.3;
}
.game-page .gg-hud-last-food-card {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 16rpx; font-size: 24rpx;
padding: 14rpx 16rpx; font-weight: 800;
border-radius: 18rpx; color: #64748b;
letter-spacing: 0.08em;
line-height: 1.3;
padding-left: 16rpx;
position: relative;
}
.game-page .gg-hud-last-food-kicker::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 6rpx;
height: 24rpx;
border-radius: 3rpx;
background: #006c49;
}
/* 头部 GI 胶囊 */
.game-page .gg-hud-last-food-chip {
display: flex;
align-items: center;
gap: 8rpx;
padding: 5rpx 16rpx 5rpx 12rpx;
border-radius: 999rpx;
font-weight: 800;
line-height: 1;
border: 1rpx solid transparent;
}
.game-page .gg-hud-last-food-chip-dot {
width: 14rpx;
height: 14rpx;
border-radius: 50%;
flex-shrink: 0;
}
.game-page .gg-hud-last-food-chip-text {
font-size: 24rpx;
font-weight: 800;
}
.game-page .gg-hud-last-food-chip.is-low {
background: rgba(22, 163, 74, 0.12);
border-color: rgba(22, 163, 74, 0.22);
}
.game-page .gg-hud-last-food-chip.is-low .gg-hud-last-food-chip-dot { background: #16a34a; }
.game-page .gg-hud-last-food-chip.is-low .gg-hud-last-food-chip-text { color: #15803d; }
.game-page .gg-hud-last-food-chip.is-mid {
background: rgba(234, 88, 12, 0.12);
border-color: rgba(234, 88, 12, 0.22);
}
.game-page .gg-hud-last-food-chip.is-mid .gg-hud-last-food-chip-dot { background: #ea580c; }
.game-page .gg-hud-last-food-chip.is-mid .gg-hud-last-food-chip-text { color: #c2410c; }
.game-page .gg-hud-last-food-chip.is-high {
background: rgba(220, 38, 38, 0.12);
border-color: rgba(220, 38, 38, 0.24);
}
.game-page .gg-hud-last-food-chip.is-high .gg-hud-last-food-chip-dot { background: #dc2626; }
.game-page .gg-hud-last-food-chip.is-high .gg-hud-last-food-chip-text { color: #b91c1c; }
/* 主卡:左侧 GI 强调条 + 图标 + 文案 */
.game-page .gg-hud-last-food-card {
position: relative;
display: flex;
align-items: center;
gap: 18rpx;
padding: 16rpx 18rpx 16rpx 24rpx;
border-radius: 20rpx;
overflow: hidden;
background: #f8fafc; background: #f8fafc;
border: 1rpx solid rgba(0, 108, 73, 0.08); border: 1rpx solid rgba(15, 23, 42, 0.06);
animation: gg-last-food-in 0.22s ease-out; animation: gg-last-food-in 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
/* 左侧强调条(GI 三色) */
.game-page .gg-hud-last-food-card::before {
content: '';
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 8rpx;
border-radius: 8rpx;
background: #cbd5e1;
} }
@media (prefers-reduced-motion: reduce) { @media (prefers-reduced-motion: reduce) {
@@ -166,35 +249,44 @@
} }
.game-page .gg-hud-last-food-card.is-high { .game-page .gg-hud-last-food-card.is-high {
background: rgba(254, 242, 242, 0.9); background: linear-gradient(90deg, rgba(254, 226, 226, 0.85) 0%, rgba(254, 242, 242, 0.6) 60%);
border-color: rgba(220, 38, 38, 0.2); border-color: rgba(220, 38, 38, 0.18);
} }
.game-page .gg-hud-last-food-card.is-high::before { background: #dc2626; }
.game-page .gg-hud-last-food-card.is-mid { .game-page .gg-hud-last-food-card.is-mid {
background: rgba(255, 251, 235, 0.95); background: linear-gradient(90deg, rgba(255, 237, 213, 0.85) 0%, rgba(255, 251, 235, 0.6) 60%);
border-color: rgba(234, 88, 12, 0.18); border-color: rgba(234, 88, 12, 0.16);
} }
.game-page .gg-hud-last-food-card.is-mid::before { background: #ea580c; }
.game-page .gg-hud-last-food-card.is-low { .game-page .gg-hud-last-food-card.is-low {
background: rgba(240, 253, 244, 0.95); background: linear-gradient(90deg, rgba(220, 252, 231, 0.85) 0%, rgba(240, 253, 244, 0.6) 60%);
border-color: rgba(22, 163, 74, 0.15); border-color: rgba(22, 163, 74, 0.16);
} }
.game-page .gg-hud-last-food-card.is-low::before { background: #16a34a; }
/* 图标:白底 + GI 彩色描边环 */
.game-page .gg-hud-last-food-icon { .game-page .gg-hud-last-food-icon {
width: 72rpx; width: 80rpx;
height: 72rpx; height: 80rpx;
flex-shrink: 0; flex-shrink: 0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-radius: 16rpx; border-radius: 18rpx;
background: #fff; background: #fff;
box-shadow: 0 2rpx 8rpx rgba(15, 23, 42, 0.06); border: 2rpx solid rgba(15, 23, 42, 0.06);
box-shadow: 0 3rpx 10rpx rgba(15, 23, 42, 0.08);
} }
.game-page .gg-hud-last-food-icon.is-low { border-color: rgba(22, 163, 74, 0.35); }
.game-page .gg-hud-last-food-icon.is-mid { border-color: rgba(234, 88, 12, 0.35); }
.game-page .gg-hud-last-food-icon.is-high { border-color: rgba(220, 38, 38, 0.4); }
.game-page .gg-hud-last-food-icon .food-tile-icon--goal { .game-page .gg-hud-last-food-icon .food-tile-icon--goal {
width: 56rpx; width: 62rpx;
height: 56rpx; height: 62rpx;
} }
.game-page .gg-hud-last-food-body { .game-page .gg-hud-last-food-body {
@@ -206,10 +298,10 @@
} }
.game-page .gg-hud-last-food-name { .game-page .gg-hud-last-food-name {
font-size: 34rpx; font-size: 36rpx;
font-weight: 800; font-weight: 900;
color: #0f172a; color: #0f172a;
line-height: 1.25; line-height: 1.2;
word-break: break-all; word-break: break-all;
} }
@@ -217,42 +309,61 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
gap: 8rpx 12rpx; gap: 8rpx 14rpx;
} }
.game-page .gg-hud-last-food-sugar-label { /* 含糖等级徽标:GI 三色实底 + 白字(保证对比度) */
font-size: 26rpx; .game-page .gg-hud-last-food-gi {
font-weight: 700; display: inline-flex;
color: #475569; align-items: center;
padding: 5rpx 16rpx;
border-radius: 999rpx;
line-height: 1.3; line-height: 1.3;
} }
.game-page .gg-hud-last-food-gi { .game-page .gg-hud-last-food-gi-text {
font-size: 26rpx; font-size: 26rpx;
font-weight: 800; font-weight: 800;
color: #fff; color: #fff;
padding: 4rpx 14rpx; letter-spacing: 0.02em;
border-radius: 8rpx;
line-height: 1.3;
} }
.game-page .gg-hud-last-food-gi.is-low { background: #16a34a; box-shadow: 0 2rpx 8rpx rgba(22, 163, 74, 0.3); }
.game-page .gg-hud-last-food-gi.is-mid { background: #ea580c; box-shadow: 0 2rpx 8rpx rgba(234, 88, 12, 0.3); }
.game-page .gg-hud-last-food-gi.is-high { background: #dc2626; box-shadow: 0 2rpx 8rpx rgba(220, 38, 38, 0.32); }
.game-page .gg-hud-last-food-sugar-hint { .game-page .gg-hud-last-food-sugar-hint {
font-size: 26rpx; font-size: 26rpx;
font-weight: 700; font-weight: 700;
color: #334155; color: #475569;
line-height: 1.35; line-height: 1.35;
} }
.game-page .gg-hud-last-food-card.is-high .gg-hud-last-food-sugar-hint { .game-page .gg-hud-last-food-card.is-high .gg-hud-last-food-sugar-hint { color: #b91c1c; }
color: #991b1b; .game-page .gg-hud-last-food-card.is-mid .gg-hud-last-food-sugar-hint { color: #c2410c; }
.game-page .gg-hud-last-food-card.is-low .gg-hud-last-food-sugar-hint { color: #15803d; }
/* 空态占位 */
.game-page .gg-hud-last-food-placeholder {
display: flex;
align-items: center;
gap: 12rpx;
padding: 18rpx 16rpx;
border-radius: 20rpx;
background: #f8fafc;
border: 1rpx dashed rgba(15, 23, 42, 0.12);
} }
.game-page .gg-hud-last-food-placeholder { .game-page .gg-hud-last-food-placeholder-dot {
padding: 12rpx 4rpx; width: 16rpx;
height: 16rpx;
border-radius: 50%;
flex-shrink: 0;
background: #cbd5e1;
} }
.game-page .gg-hud-last-food-placeholder text { .game-page .gg-hud-last-food-placeholder text {
font-size: 28rpx; font-size: 27rpx;
font-weight: 600; font-weight: 600;
color: #94a3b8; color: #94a3b8;
line-height: 1.45; line-height: 1.45;
@@ -435,7 +546,7 @@
justify-content: flex-start; justify-content: flex-start;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
padding: 8rpx 16rpx 0; padding: 8rpx 1rpx 0;
} }
/* gg-hint-banner 已移除,提示直接显示在棋盘食物上 */ /* gg-hint-banner 已移除,提示直接显示在棋盘食物上 */
@@ -772,7 +883,7 @@
} }
.game-page .gg-tile-gi.is-low { background: #16a34a; } .game-page .gg-tile-gi.is-low { background: #16a34a; }
.game-page .gg-tile-gi.is-mid { background: #ea580c; } .game-page .gg-tile-gi.is-mid { background: #e67e22; }
.game-page .gg-tile-gi.is-high { .game-page .gg-tile-gi.is-high {
background: #dc2626; background: #dc2626;
box-shadow: 0 2rpx 10rpx rgba(220, 38, 38, 0.45); box-shadow: 0 2rpx 10rpx rgba(220, 38, 38, 0.45);
@@ -559,7 +559,11 @@
<div class="rx-title">{{ prescriptionTabType === 'internal' ? '药房联' : SLIP_TITLE }}</div> <div class="rx-title">{{ prescriptionTabType === 'internal' ? '药房联' : SLIP_TITLE }}</div>
<div class="rx-notice"> <div class="rx-notice">
<span class="rx-notice-text"> <span class="rx-notice-text">
服药前请核对姓名电话医生等信息以及服法医嘱等要点 {{
prescriptionTabType === 'user'
? '服药前请核对姓名、电话、医生等信息以及医嘱等要点'
: '服药前请核对姓名、电话、医生等信息以及服法、医嘱等要点'
}}
</span> </span>
<span class="rx-notice-meta"> <span class="rx-notice-meta">
<span>日期{{ rxDateText }}</span> <span>日期{{ rxDateText }}</span>
@@ -678,22 +682,30 @@
</div> </div>
<div class="rx-text"> <div class="rx-text">
<p v-if="prescriptionTabType === 'internal' || savedAuxUsageText">主方服法{{ rxUsageText }}</p> <template v-if="prescriptionTabType === 'internal'">
<p v-if="savedAuxUsageText">主方服法{{ rxUsageText }}</p>
<p v-else>服法{{ rxUsageText }}</p> <p v-else>服法{{ rxUsageText }}</p>
<p v-if="savedAuxUsageText">{{ prescriptionTabType === 'user' ? '辅服法' : '辅方服法' }}{{ savedAuxUsageText }}</p> <p v-if="savedAuxUsageText">辅方服法{{ savedAuxUsageText }}</p>
</template>
<p v-if="rxAdviceText">医嘱{{ rxAdviceText }}</p> <p v-if="rxAdviceText">医嘱{{ rxAdviceText }}</p>
<p v-if="rxRemarkText">备注{{ rxRemarkText }}</p> <p v-if="prescriptionTabType === 'internal' && rxRemarkText">备注{{ rxRemarkText }}</p>
<p v-if="savedPrescription.dietary_taboo && savedPrescription.dietary_taboo.length"> <p v-if="savedPrescription.dietary_taboo && savedPrescription.dietary_taboo.length">
忌口{{ Array.isArray(savedPrescription.dietary_taboo) ? savedPrescription.dietary_taboo.join('') : savedPrescription.dietary_taboo }} 忌口{{ Array.isArray(savedPrescription.dietary_taboo) ? savedPrescription.dietary_taboo.join('') : savedPrescription.dietary_taboo }}
</p> </p>
<p v-if="rxPharmacyRemarkText" class="rx-text-warn">药房备注{{ rxPharmacyRemarkText }}</p> <p v-if="rxPharmacyRemarkText" class="rx-text-warn">药房备注{{ rxPharmacyRemarkText }}</p>
<p v-if="rxOutPelletText && savedPrescription.prescription_type !== '饮片'" class="rx-text-warn"> <p
v-if="prescriptionTabType === 'internal' && rxOutPelletText && savedPrescription.prescription_type !== '饮片'"
class="rx-text-warn"
>
出丸{{ rxOutPelletText }} 出丸{{ rxOutPelletText }}
</p> </p>
</div> </div>
<div class="rx-bottom"> <div class="rx-bottom">
<div class="rx-bot-row rx-bot-row-1"> <div
class="rx-bot-row rx-bot-row-1"
:class="{ 'rx-bot-row-1--user': prescriptionTabType === 'user' }"
>
<div class="rx-bot-cell rx-bot-stack rx-bot-doctor"> <div class="rx-bot-cell rx-bot-stack rx-bot-doctor">
<div class="rx-bot-label">医师</div> <div class="rx-bot-label">医师</div>
<div class="rx-bot-doctor-body"> <div class="rx-bot-doctor-body">
@@ -703,10 +715,12 @@
alt="医师签名" alt="医师签名"
class="rx-bot-sign-img" class="rx-bot-sign-img"
/> />
<div class="rx-bot-doctor-name">{{ savedPrescription.doctor_name || '—' }}</div> <div v-if="!savedPrescription.doctor_signature" class="rx-bot-doctor-name">
{{ savedPrescription.doctor_name || '' }}
</div> </div>
</div> </div>
<div class="rx-bot-cell rx-bot-meta"> </div>
<div v-if="prescriptionTabType === 'internal'" class="rx-bot-cell rx-bot-meta">
<span class="rx-bot-meta-key">类型:</span> <span class="rx-bot-meta-key">类型:</span>
<span class="rx-bot-meta-val">{{ rxTypeText }}</span> <span class="rx-bot-meta-val">{{ rxTypeText }}</span>
</div> </div>
@@ -714,7 +728,7 @@
<span class="rx-bot-meta-key">天数:</span> <span class="rx-bot-meta-key">天数:</span>
<span class="rx-bot-meta-val">{{ rxSlipMedicationDaysText }}</span> <span class="rx-bot-meta-val">{{ rxSlipMedicationDaysText }}</span>
</div> </div>
<div class="rx-bot-cell rx-bot-meta"> <div v-if="prescriptionTabType === 'internal'" class="rx-bot-cell rx-bot-meta">
<span class="rx-bot-meta-key">剂量:</span> <span class="rx-bot-meta-key">剂量:</span>
<span class="rx-bot-meta-val">{{ rxPerDoseAmount }}</span> <span class="rx-bot-meta-val">{{ rxPerDoseAmount }}</span>
</div> </div>
@@ -2970,6 +2984,10 @@ defineExpose({
min-height: 70px; min-height: 70px;
} }
.rx-bot-row-1--user {
grid-template-columns: 1.4fr 0.6fr;
}
.rx-hospital-row { .rx-hospital-row {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -458,7 +458,9 @@
alt="医师签名" alt="医师签名"
class="rx-bot-sign-img" class="rx-bot-sign-img"
/> />
<div class="rx-bot-doctor-name">{{ slipView.doctor_name || '—' }}</div> <div v-if="!slipView.doctor_signature" class="rx-bot-doctor-name">
{{ slipView.doctor_name || '' }}
</div>
</div> </div>
</div> </div>
<div class="rx-bot-cell rx-bot-meta"> <div class="rx-bot-cell rx-bot-meta">
@@ -2513,7 +2513,11 @@
<div class="rx-title">{{ prescriptionTabType === 'internal' ? '药房联' : SLIP_TITLE }}</div> <div class="rx-title">{{ prescriptionTabType === 'internal' ? '药房联' : SLIP_TITLE }}</div>
<div class="rx-notice"> <div class="rx-notice">
<span class="rx-notice-text"> <span class="rx-notice-text">
服药前请核对姓名电话医生等信息以及服法医嘱等要点 {{
prescriptionTabType === 'user'
? '服药前请核对姓名、电话、医生等信息以及医嘱等要点'
: '服药前请核对姓名、电话、医生等信息以及服法、医嘱等要点'
}}
</span> </span>
<div class="rx-notice-meta"> <div class="rx-notice-meta">
<div class="rx-meta-item"> <div class="rx-meta-item">
@@ -2637,21 +2641,29 @@
</div> </div>
<div class="rx-text"> <div class="rx-text">
<p v-if="prescriptionTabType === 'internal' || rxAuxUsageText">主服法{{ rxUsageText }}</p> <template v-if="prescriptionTabType === 'internal'">
<p v-if="rxAuxUsageText">主服法{{ rxUsageText }}</p>
<p v-else>服法{{ rxUsageText }}</p> <p v-else>服法{{ rxUsageText }}</p>
<p v-if="rxAuxUsageText">辅服法{{ rxAuxUsageText }}</p> <p v-if="rxAuxUsageText">辅服法{{ rxAuxUsageText }}</p>
</template>
<p v-if="rxAdviceText">医嘱{{ rxAdviceText }}</p> <p v-if="rxAdviceText">医嘱{{ rxAdviceText }}</p>
<p v-if="rxRemarkText">备注{{ rxRemarkText }}</p> <p v-if="prescriptionTabType === 'internal' && rxRemarkText">备注{{ rxRemarkText }}</p>
<p v-if="rxPharmacyRemarkText" class="rx-text-warn"> <p v-if="rxPharmacyRemarkText" class="rx-text-warn">
药房备注{{ rxPharmacyRemarkText }} 药房备注{{ rxPharmacyRemarkText }}
</p> </p>
<p v-if="rxOutPelletText && prescriptionViewData?.prescription_type !== '饮片'" class="rx-text-warn"> <p
v-if="prescriptionTabType === 'internal' && rxOutPelletText && prescriptionViewData?.prescription_type !== '饮片'"
class="rx-text-warn"
>
出丸{{ rxOutPelletText }} 出丸{{ rxOutPelletText }}
</p> </p>
</div> </div>
<div class="rx-bottom"> <div class="rx-bottom">
<div class="rx-bot-row rx-bot-row-1"> <div
class="rx-bot-row rx-bot-row-1"
:class="{ 'rx-bot-row-1--user': prescriptionTabType === 'user' }"
>
<div class="rx-bot-cell rx-bot-doctor"> <div class="rx-bot-cell rx-bot-doctor">
<div class="rx-bot-label rx-bot-label--doctor">医师</div> <div class="rx-bot-label rx-bot-label--doctor">医师</div>
<div class="rx-bot-doctor-body"> <div class="rx-bot-doctor-body">
@@ -2661,11 +2673,14 @@
alt="医师签名" alt="医师签名"
class="rx-bot-sign-img" class="rx-bot-sign-img"
/> />
<!-- <span class="rx-bot-doctor-name">{{ prescriptionViewData.doctor_name || '—' }}</span> --> <span
v-if="!prescriptionViewData.doctor_signature"
class="rx-bot-doctor-name"
>{{ prescriptionViewData.doctor_name || '—' }}</span>
</div> </div>
</div> </div>
<div class="rx-bot-cell rx-bot-meta"> <div v-if="prescriptionTabType === 'internal'" class="rx-bot-cell rx-bot-meta">
<span class="rx-bot-meta-key">类型:</span> <span class="rx-bot-meta-key">类型:</span>
<span class="rx-bot-meta-val">{{ rxTypeText }}</span> <span class="rx-bot-meta-val">{{ rxTypeText }}</span>
</div> </div>
@@ -2679,7 +2694,7 @@
: '—' : '—'
}} </span> }} </span>
</div> </div>
<div class="rx-bot-cell rx-bot-meta"> <div v-if="prescriptionTabType === 'internal'" class="rx-bot-cell rx-bot-meta">
<span class="rx-bot-meta-key">剂量:</span> <span class="rx-bot-meta-key">剂量:</span>
<span class="rx-bot-meta-val">{{ rxPerDoseAmount }}</span> <span class="rx-bot-meta-val">{{ rxPerDoseAmount }}</span>
</div> </div>
@@ -7109,6 +7124,10 @@ async function downloadPrescriptionSlipPdf() {
min-height: 70px; min-height: 70px;
} }
.rx-bot-row-1--user {
grid-template-columns: 1.6fr 0.6fr;
}
.rx-bot-row-2 { .rx-bot-row-2 {
grid-template-columns: repeat(6, 1fr); grid-template-columns: repeat(6, 1fr);
} }
@@ -2300,7 +2300,10 @@
alt="医师签名" alt="医师签名"
class="rx-bot-sign-img" class="rx-bot-sign-img"
/> />
<!-- <span class="rx-bot-doctor-name">{{ prescriptionViewData.doctor_name || '—' }}</span> --> <span
v-if="!prescriptionViewData.doctor_signature"
class="rx-bot-doctor-name"
>{{ prescriptionViewData.doctor_name || '—' }}</span>
</div> </div>
</div> </div>
+1 -1
View File
@@ -1262,7 +1262,7 @@ const handleSubmit = async () => {
} }
const handleViewCase = (row: any) => { const handleViewCase = (row: any) => {
prescriptionRef.value?.openById(row.id, { slipType: 'user', hideCaseRecord: true }) prescriptionRef.value?.openById(row.id, { slipType: 'user' })
} }
// 开方:传入当前诊单数据,包含详细病历(深拷贝避免响应式引用) // 开方:传入当前诊单数据,包含详细病历(深拷贝避免响应式引用)