liujie
23 小时以前 384bce80449b17651937429038c4370dbce60e7b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<template>
    <view class="page">
        <!-- 分类药丸筛选栏 -->
        <view class="filter-bar">
            <view class="pill-group">
                <view
                    v-for="(code, index) in categoryList"
                    :key="code"
                    class="pill"
                    :class="{ 'pill--active': index === activeIndex }"
                    @tap="handleCategoryTap(index)"
                >
                    <text class="pill-text">{{ code }}</text>
                </view>
            </view>
            <!-- 药丸组滚动位置指示条(滑块随选中项移动) -->
            <view class="slider">
                <view class="slider-thumb" :style="{ marginLeft: sliderOffset }"></view>
            </view>
        </view>
 
        <!-- 产品名称 + 探索更多 -->
        <view class="product-bar">
            <view class="product-text">
                <text class="product-code">{{ currentCategory }}</text>
                <text class="product-name">{{ productName }}</text>
            </view>
            <view class="explore-btn" @tap="handleExploreMore">
                <text class="explore-btn-text">探索更多</text>
                <view class="explore-btn-arrow-wrap">
                    <view class="explore-btn-arrow"></view>
                </view>
            </view>
        </view>
 
        <!-- 健康方案卡片列表 -->
        <view class="plan-list">
            <view
                v-for="plan in planList"
                :key="plan.id"
                class="plan-card"
                @tap="handlePlanTap(plan)"
            >
                <!-- 方案图素材未入仓,暂以同色系渐变块占位,素材就绪后替换为 image -->
                <view class="plan-card-visual" :style="{ background: plan.background }"></view>
            </view>
        </view>
 
        <!-- 全局缺货订单提示(存在缺货订单时所有页面均弹出) -->
        <stock-order-toast />
    </view>
</template>
 
<script setup>
import { computed, ref } from 'vue'
import StockOrderToast from '@/components/stock-order-toast/stock-order-toast.vue'
 
/** 分类药丸:与设计稿一致的三档产品系列代号 */
const categoryList = ['G&METS-II', 'HBBLF-2', 'NEARCLC-II']
 
/** 当前选中的分类下标 */
const activeIndex = ref(0)
 
/** 产品主名(三档分类当前共用一个产品名,接口就绪后按分类拉取) */
const productName = '超分子基团复合肽'
 
/** 方案卡片:素材缺失,先以设计稿同色系渐变占位 */
const planList = [
    { id: 1, background: 'linear-gradient(135deg, #16336e 0%, #2b52b8 48%, #4a6fd0 100%)' },
    { id: 2, background: 'linear-gradient(135deg, #3a2d86 0%, #5b4bc0 50%, #7d6bd8 100%)' },
    { id: 3, background: 'linear-gradient(135deg, #c9dcf3 0%, #e6f0fb 52%, #f7fbff 100%)' }
]
 
/** 当前选中的分类代号 */
const currentCategory = computed(() => categoryList[activeIndex.value])
 
/** 指示条滑块偏移:轨道 28pt、滑块 10pt,共 3 档 → 每档步进 18rpx */
const sliderOffset = computed(() => `${activeIndex.value * 18}rpx`)
 
/** 切换分类药丸 */
const handleCategoryTap = (index) => {
    activeIndex.value = index
}
 
/** 探索更多:产品详情页尚未开发,先给出占位反馈 */
const handleExploreMore = () => {
    uni.showToast({ title: '敬请期待', icon: 'none' })
}
 
/** 方案卡片:详情页尚未开发,先给出占位反馈 */
const handlePlanTap = () => {
    uni.showToast({ title: '敬请期待', icon: 'none' })
}
</script>
 
<style scoped lang="scss">
.page {
    min-height: 100vh;
    background: #f8fafc;
}
 
/* ==================== 分类药丸筛选栏(375×44pt) ==================== */
 
.filter-bar {
    height: 88rpx;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32rpx;
    box-sizing: border-box;
}
 
.pill-group {
    display: flex;
    align-items: center;
    gap: 16rpx;
}
 
.pill {
    height: 56rpx;
    display: flex;
    align-items: center;
    padding: 0 28rpx;
    border-radius: 28rpx;
    background: #edf2f7;
}
 
.pill-text {
    font-size: 23rpx;
    font-weight: 600;
    line-height: 1;
    color: #475569;
}
 
.pill--active {
    background: #003e7e;
}
 
.pill--active .pill-text {
    font-weight: 700;
    color: #ffffff;
}
 
/* 滚动指示条:轨道 28×3pt,滑块 10×3pt */
.slider {
    flex-shrink: 0;
    width: 56rpx;
    height: 6rpx;
    margin-left: 16rpx;
    display: flex;
    align-items: center;
    border-radius: 3rpx;
    background: #e2e8f0;
}
 
.slider-thumb {
    width: 20rpx;
    height: 6rpx;
    border-radius: 3rpx;
    background: #c5a566;
}
 
/* ==================== 产品名称 + 探索更多(375×48pt) ==================== */
 
.product-bar {
    height: 96rpx;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32rpx;
    box-sizing: border-box;
}
 
.product-text {
    display: flex;
    flex-direction: column;
    gap: 4rpx;
}
 
.product-code {
    font-size: 22rpx;
    font-weight: 700;
    letter-spacing: 2.4rpx;
    line-height: 1;
    color: #003e7e;
}
 
.product-name {
    font-size: 35rpx;
    font-weight: 800;
    letter-spacing: -0.4rpx;
    line-height: 1.1;
    color: #0f172a;
}
 
/* 探索更多:绿色渐变胶囊按钮 */
.explore-btn {
    flex-shrink: 0;
    height: 64rpx;
    display: flex;
    align-items: center;
    gap: 12rpx;
    padding: 0 16rpx 0 28rpx;
    border-radius: 32rpx;
    background: linear-gradient(90deg, #82c236 0%, #639c1f 100%);
    box-shadow: 0 6rpx 16rpx rgba(106, 160, 39, 0.21);
}
 
.explore-btn-text {
    font-size: 24rpx;
    font-weight: 600;
    letter-spacing: 0.4rpx;
    line-height: 1;
    color: #ffffff;
}
 
.explore-btn-arrow-wrap {
    width: 36rpx;
    height: 36rpx;
    border-radius: 18rpx;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.16);
}
 
/* 箭头:lucide chevron-right 白色 */
.explore-btn-arrow {
    width: 22rpx;
    height: 22rpx;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% 100%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjRkZGRkZGIiBzdHJva2Utd2lkdGg9IjIuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJtOSAxOCA2LTYtNi02Ii8+PC9zdmc+');
}
 
/* ==================== 方案卡片列表(343×160pt / 张) ==================== */
 
.plan-list {
    display: flex;
    flex-direction: column;
    gap: 24rpx;
    padding: 8rpx 32rpx 32rpx;
    box-sizing: border-box;
}
 
.plan-card {
    width: 100%;
    height: 320rpx;
    overflow: hidden;
    border-radius: 28rpx;
    border: 1rpx solid rgba(226, 232, 240, 0.5);
    box-shadow: 0 8rpx 24rpx rgba(15, 23, 42, 0.04);
}
 
.plan-card-visual {
    width: 100%;
    height: 100%;
}
</style>