美化了样式

This commit is contained in:
2025-08-15 00:36:04 +08:00
parent 5fc1378051
commit 1b4d3e310b
63 changed files with 2735 additions and 2411 deletions

View File

@ -1,39 +1,38 @@
<view class="flex-col page">
<text class="self-center text">{{ courseType }}</text>
<image class="shrink-0 self-start image image_2" src="./image/line.png" />
<image class="shrink-0 self-end image image_3" src="./image/line.png" />
<!-- pages/course/searchCourses/searchCourses.wxml -->
<view class="page">
<view class="flex-col self-stretch list">
<!-- 遍历接口返回的 items 数组 -->
<view
class="flex-col list-item"
wx:for="{{courseList}}"
wx:for-item="item"
wx:for-index="index"
wx:key="id"
>
<view
class="flex-row items-center relative group"
bindtap="gotoCourseDetail"
data-id="{{item.id}}"
>
<!-- 课程封面 -->
<image
class="shrink-0 image_4"
src="{{ globalImgUrl + item.image}}"
mode="aspectFill"
/>
<view class="flex-col flex-1 ml-12">
<!-- 课程名称 -->
<text class="font">{{item.name}}</text>
<view class="flex-row justify-between items-baseline mt-17">
<!-- 卷后价格 -->
<text class="font_2">券后{{item.discountPrice}}元起</text>
<!-- 已有下单人数 -->
<text class="font_3">{{item.orderCount}}人学习</text>
</view>
<!-- 顶部搜索条(固定) -->
<view class="search-bar" hover-class="hover">
<image class="search-icon" src="./image/sousuo.png" mode="aspectFit"/>
<input
class="search-input"
placeholder="搜索更多好课"
placeholder-class="search-ph"
bindinput="onSearchInput"
confirm-type="search"
bindconfirm="onSearch"
/>
</view>
<!-- 搜索结果(独立滚动 & 隐藏滚动条) -->
<scroll-view scroll-y class="list no-scrollbar">
<block wx:for="{{courseList}}" wx:for-item="item" wx:key="item.id">
<view class="course-card" bindtap="gotoCourseDetail" data-id="{{item.id}}" hover-class="hover">
<image class="cover" src="{{ globalImgUrl + item.image }}" mode="aspectFill" lazy-load="true"/>
<view class="info">
<text class="title">{{item.name}}</text>
<view class="meta">
<text class="price-pill">券后{{item.discountPrice}}元起</text>
<text class="people">{{item.orderCount}}人学习</text>
</view>
</view>
</view>
</block>
<!-- 空状态(可选) -->
<view wx:if="{{!courseList || courseList.length === 0}}" class="empty">
<image class="empty-icon" src="./image/empty.png" mode="aspectFit"/>
<text class="empty-text">没找到相关课程,换个关键词试试~</text>
</view>
</scroll-view>
</view>