|
|
4 months ago | |
|---|---|---|
| .hbuilderx | 5 months ago | |
| .vite | 5 months ago | |
| common | 4 months ago | |
| components | 4 months ago | |
| node_modules | 4 months ago | |
| pages | 4 months ago | |
| request | 4 months ago | |
| static | 4 months ago | |
| store | 4 months ago | |
| style | 4 months ago | |
| types | 4 months ago | |
| .gitignore | 5 months ago | |
| App.vue | 5 months ago | |
| ENV.md | 4 months ago | |
| PAGES.md | 4 months ago | |
| README.md | 4 months ago | |
| index.html | 5 months ago | |
| main.js | 5 months ago | |
| manifest.json | 4 months ago | |
| note.txt | 4 months ago | |
| package-lock.json | 4 months ago | |
| package.json | 5 months ago | |
| pages.json | 4 months ago | |
| uni.scss | 5 months ago | |
| 抖音小程序.txt | 5 months ago |
本项目是一个基于 uni-app 框架开发的多端电商应用,支持微信小程序、H5、App 等平台。应用整合了商品展示、购物车、订单管理、地址管理、抽奖等完整的电商功能,为用户提供一站式购物体验。
douyinShop/
├── pages/ # 页面目录
│ ├── index/ # 首页模块
│ │ ├── index.vue # 首页
│ │ ├── detail.vue # 商品详情
│ │ └── eva.vue # 商品评价
│ ├── category/ # 分类模块
│ │ ├── cat.vue # 分类页面
│ │ └── pros.vue # 分类商品
│ ├── cart/ # 购物车
│ │ └── cart.vue
│ ├── order/ # 订单模块
│ │ ├── confirm.vue # 确认订单
│ │ ├── pay.vue # 支付页面
│ │ ├── list.vue # 订单列表
│ │ └── detail.vue # 订单详情
│ ├── address/ # 地址模块
│ │ ├── addr.vue # 地址列表
│ │ └── addrManage.vue # 地址管理
│ ├── prize/ # 抽奖模块
│ │ ├── prize.vue # 抽奖页面
│ │ └── record.vue # 中奖记录
│ ├── me/ # 个人中心
│ │ ├── me.vue # 我的页面
│ │ └── edit.vue # 个人信息编辑
│ └── login/ # 登录模块
│ └── login.vue
├── components/ # 公共组件
│ ├── mix-popup/ # 弹窗组件
│ ├── privacy-popup/ # 隐私弹窗
│ ├── s-layout/ # 布局组件
│ ├── u-image/ # 图片组件
│ ├── u-no-network/ # 无网络组件
│ └── uni-load-more/ # 加载更多组件
├── request/ # 网络请求
│ ├── api.ts # 接口定义
│ ├── request.ts # 请求封装
│ ├── useApi.ts # API Hook
│ └── usePage.ts # 分页 Hook
├── store/ # 状态管理
│ ├── index.ts # Store 入口
│ └── modules/
│ └── user.ts # 用户模块
├── common/ # 公共文件
│ ├── config.ts # 配置文件
│ ├── tools.ts # 工具函数
│ ├── mixin.ts # 混入
│ └── mixinTools.ts # 混入工具
├── static/ # 静态资源
│ ├── tab/ # 底部导航图标
│ └── temp/ # 临时图片
└── style/ # 样式文件
├── common.css # 公共样式
├── _variables.scss # SCSS 变量
└── uni.scss # uni-app 样式
npm install
npm run dev:h5
项目支持多环境配置,在 common/config.ts 中切换环境:
// 当前环境 - 可以通过修改这个值来切换环境
const CURRENT_ENV = ENV.LOCAL; // 本地环境
// const CURRENT_ENV = ENV.TEST; // 测试环境
// const CURRENT_ENV = ENV.PRODUCTION; // 生产环境
支持的环境:
http://thinkphp_fastadmin_tailored.testhttps://lingke.huxiukeji.cnhttps://wx.lingkejiaoyu.cn详细环境配置说明请查看 ENV.md
在 request/api.ts 中定义接口:
api_module: {
api_name: {
url: '/api/path',
auth: boolean, // 是否需要 token 验证
method: 'GET/POST',
isNprogress: boolean, // 是否显示加载进度
}
}
const res = await uni.$request('module.api_name', params);
import useApi from '@/request/useApi'
const { loading, result, fetchResource } = useApi({
getListApi: 'module.api_name',
customQueryParameters: (id) => ({ id }),
getListFunc: (res) => {
console.log(res.result);
}
});
fetchResource(123);
import usePage from '@/request/usePage';
const {
loading,
hasMore,
result: dataList,
reset: initList,
handleCurrentChange: loadMoreList
} = usePage({
getListApi: 'module.api_name',
customQueryParameters: () => ({
keyword: searchKeyword.value
})
});
本项目支持以下平台:
项目已配置相关权限,包括:
如有问题或建议,请联系开发团队。
注意: 项目中包含的配置信息和密钥仅为示例,实际部署时请替换为真实的配置信息。