refactor(app): 移除分类和详情模块,新增云开发测试页

- 从项目中删除分类页及相关代码和样式文件
- 从项目中删除详情页及相关代码和样式文件
- 首页简化为欢迎界面并添加跳转云开发测试页入口
- 更新自定义底部栏移除分类入口
- 更新app.js初始化云开发环境
- 修改app.json移除分类页面配置
- 调整首页样式和交互,提高简洁度
- 配置云函数目录路径cloudfunctionRoot为cloudfunctions/
This commit is contained in:
2025-12-05 15:58:08 +08:00
parent 854c4f5449
commit 8fc4630bb5
22 changed files with 514 additions and 950 deletions

View File

@@ -1,98 +1,20 @@
<!--pages/index/index.wxml-->
<view class="container">
<!-- 搜索栏 -->
<view class="search-bar">
<van-search
value="{{ searchValue }}"
placeholder="搜索信息"
shape="round"
bind:search="onSearch"
bind:change="onSearchChange"
/>
<view class="welcome-section">
<text class="welcome-title">信息服务小程序</text>
<text class="welcome-subtitle">基于微信云开发</text>
</view>
<!-- 轮播图 -->
<view class="banner-section" wx:if="{{ bannerList.length > 0 }}">
<swiper
class="banner-swiper"
indicator-dots
autoplay
circular
interval="3000"
>
<swiper-item wx:for="{{ bannerList }}" wx:key="id">
<image class="banner-image" src="{{ item.image }}" mode="aspectFill" />
</swiper-item>
</swiper>
</view>
<!-- 分类入口 -->
<view class="category-section card">
<view class="category-grid">
<view
class="category-item"
wx:for="{{ categoryList }}"
wx:key="id"
data-id="{{ item.id }}"
data-name="{{ item.name }}"
bindtap="onCategoryTap"
<view class="menu-section">
<van-cell-group>
<van-cell
title="云开发测试"
label="测试云函数、云数据库、云存储"
is-link
bindtap="goCloudTest"
>
<view class="category-icon">
<van-icon name="apps-o" size="48rpx" color="#1890ff" />
</view>
<text class="category-name">{{ item.name }}</text>
</view>
</view>
</view>
<!-- 信息列表 -->
<view class="info-section">
<view class="section-header">
<text class="section-title">最新资讯</text>
</view>
<view class="info-list">
<view
class="info-item card"
wx:for="{{ infoList }}"
wx:key="id"
data-id="{{ item.id }}"
bindtap="onInfoTap"
>
<view class="info-content">
<view class="info-text">
<text class="info-title ellipsis-2">{{ item.title }}</text>
<text class="info-summary ellipsis-2">{{ item.summary }}</text>
<view class="info-meta">
<van-tag plain type="primary" size="medium">{{ item.category }}</van-tag>
<text class="info-time">{{ item.timeText }}</text>
<text class="info-views">{{ item.views }}阅读</text>
</view>
</view>
<van-image
wx:if="{{ item.image }}"
class="info-image"
width="180rpx"
height="120rpx"
fit="cover"
radius="8rpx"
src="{{ item.image }}"
/>
</view>
</view>
</view>
<!-- 加载状态 -->
<view class="loading-section" wx:if="{{ loading }}">
<van-loading size="24px">加载中...</van-loading>
</view>
<!-- 没有更多 -->
<view class="no-more" wx:if="{{ !hasMore && infoList.length > 0 }}">
<text>— 没有更多了 —</text>
</view>
<!-- 空状态 -->
<van-empty wx:if="{{ !loading && infoList.length === 0 }}" description="暂无信息" />
<van-icon slot="icon" name="code-o" size="40rpx" color="#1890ff" style="margin-right: 20rpx;" />
</van-cell>
</van-cell-group>
</view>
</view>