修改小程序

This commit is contained in:
2025-10-17 17:29:11 +08:00
parent 434fa135d1
commit 212dffd0da
227 changed files with 12887 additions and 45341 deletions

View File

@@ -1,213 +0,0 @@
# 政府端小程序架构说明
## 整体架构
```
┌─────────────────────────────────────────────────────────────┐
│ 政府端小程序架构 │
├─────────────────────────────────────────────────────────────┤
│ 前端层 (Vue.js + uni-app) │
│ ┌─────────────┬─────────────┬─────────────┬─────────────┐ │
│ │ 首页组件 │ 登录组件 │ 看板组件 │ 管理组件 │ │
│ │ Home.vue │ Login.vue │ Dashboard.vue│Supervision.vue│ │
│ └─────────────┴─────────────┴─────────────┴─────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ 服务层 (API Services) │
│ ┌─────────────┬─────────────┬─────────────┬─────────────┐ │
│ │ 认证服务 │ 看板服务 │ 监管服务 │ 审批服务 │ │
│ │authService │dashboardSvc │supervisionSvc│approvalSvc │ │
│ └─────────────┴─────────────┴─────────────┴─────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ 工具层 (Utils) │
│ ┌─────────────┬─────────────┬─────────────┬─────────────┐ │
│ │ 认证工具 │ 请求工具 │ 路由守卫 │ 状态管理 │ │
│ │ auth.js │ request.js │ router │ pinia │ │
│ └─────────────┴─────────────┴─────────────┴─────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ 后端API (Government Backend) │
│ ┌─────────────┬─────────────┬─────────────┬─────────────┐ │
│ │ 认证接口 │ 看板接口 │ 监管接口 │ 审批接口 │ │
│ │ /api/auth │/api/visual │/api/superv │/api/approval│ │
│ └─────────────┴─────────────┴─────────────┴─────────────┘ │
└─────────────────────────────────────────────────────────────┘
```
## 组件架构
### 1. 页面组件 (Pages)
```
pages/
├── index/
│ └── index.vue # 首页
├── login/
│ └── login.vue # 登录页
├── dashboard/
│ └── dashboard.vue # 数据看板
├── supervision/
│ └── supervision.vue # 监管管理
├── approval/
│ └── approval.vue # 审批管理
├── personnel/
│ └── personnel.vue # 人员管理
├── epidemic/
│ └── epidemic.vue # 疫情监控
├── service/
│ └── service.vue # 服务管理
├── warehouse/
│ └── warehouse.vue # 仓库管理
└── profile/
└── profile.vue # 个人中心
```
### 2. 业务组件 (Components)
```
components/
├── Home.vue # 首页组件
├── Login.vue # 登录组件
├── Dashboard.vue # 数据看板组件
├── Supervision.vue # 监管管理组件
├── Approval.vue # 审批管理组件
├── Personnel.vue # 人员管理组件
├── Epidemic.vue # 疫情监控组件
├── Service.vue # 服务管理组件
├── Warehouse.vue # 仓库管理组件
└── Profile.vue # 个人中心组件
```
### 3. 服务层 (Services)
```
services/
├── authService.js # 认证服务
├── dashboardService.js # 看板服务
├── supervisionService.js # 监管服务
├── approvalService.js # 审批服务
├── personnelService.js # 人员服务
├── epidemicService.js # 疫情服务
├── serviceService.js # 服务管理
└── warehouseService.js # 仓库服务
```
### 4. 工具层 (Utils)
```
utils/
├── auth.js # 认证工具
└── request.js # 请求工具
```
## 数据流架构
### 1. 用户认证流程
```
用户输入 → Login组件 → authService → 后端API → 返回Token → 存储到本地 → 路由跳转
```
### 2. 数据获取流程
```
组件挂载 → 调用Service → request工具 → 后端API → 数据处理 → 更新组件状态
```
### 3. 状态管理流程
```
用户操作 → 组件事件 → 调用API → 更新数据 → 重新渲染 → 用户反馈
```
## 技术栈架构
### 前端技术栈
- **框架**: Vue 2.6 + uni-app
- **状态管理**: Pinia
- **路由**: Vue Router
- **HTTP**: Axios
- **样式**: Sass/SCSS
- **构建**: Vue CLI + Vite
### 后端技术栈
- **框架**: Express.js
- **数据库**: MySQL (可选)
- **认证**: JWT
- **端口**: 5352
## 功能模块架构
### 1. 认证模块
- 用户登录
- Token管理
- 权限控制
- 路由守卫
### 2. 数据看板模块
- 统计卡片
- 图表展示
- 实时数据
- 预警信息
### 3. 管理模块
- 监管管理
- 审批管理
- 人员管理
- 疫情监控
- 服务管理
- 仓库管理
### 4. 个人中心模块
- 用户信息
- 设置管理
- 退出登录
## 部署架构
### 开发环境
```
本地开发 → H5预览 → 微信开发者工具 → 真机调试
```
### 生产环境
```
代码构建 → 服务器部署 → 域名配置 → 小程序发布
```
## 安全架构
### 1. 前端安全
- Token认证
- 路由守卫
- 输入验证
- XSS防护
### 2. 后端安全
- JWT认证
- CORS配置
- 请求验证
- 错误处理
## 性能优化
### 1. 前端优化
- 组件懒加载
- 图片压缩
- 代码分割
- 缓存策略
### 2. 网络优化
- 请求合并
- 数据缓存
- 错误重试
- 超时处理
## 扩展性设计
### 1. 组件扩展
- 模块化设计
- 可复用组件
- 配置化开发
- 主题定制
### 2. 功能扩展
- 插件机制
- 模块热插拔
- API版本管理
- 数据迁移
## 总结
政府端小程序采用现代化的前端架构,具有良好的可维护性、可扩展性和用户体验。通过模块化设计和组件化开发,实现了功能的快速迭代和团队协作开发。

View File

@@ -1,219 +0,0 @@
# 政府端小程序完成报告
## 项目概述
基于养殖端小程序和政府端后端代码成功创建了一个功能完整的政府端微信小程序。该项目采用Vue.js + uni-app技术栈提供全面的政府管理功能。
## 完成情况
### ✅ 已完成功能
#### 1. 项目基础架构
- [x] 完整的Vue 2.6 + uni-app项目结构
- [x] 多端支持微信小程序、H5、App
- [x] 响应式设计和移动端优化
- [x] 模块化组件设计
- [x] 完整的路由配置
#### 2. 用户认证系统
- [x] 登录页面(用户名/密码)
- [x] 用户信息管理
- [x] Token认证机制
- [x] 路由守卫和权限控制
- [x] 退出登录功能
#### 3. 核心功能模块
- [x] **数据看板** - 统计卡片、图表展示、实时数据
- [x] **监管管理** - 记录管理、搜索筛选、状态跟踪
- [x] **审批管理** - 审批流程、状态管理、操作记录
- [x] **人员管理** - 人员信息、部门管理、联系方式
- [x] **疫情监控** - 疫情数据、预警系统、风险等级
- [x] **服务管理** - 服务项目、状态管理、分类管理
- [x] **仓库管理** - 仓库信息、容量管理、管理员信息
- [x] **个人中心** - 用户设置、头像编辑、系统配置
#### 4. 技术特性
- [x] 完整的API服务层
- [x] 统一的请求处理
- [x] 错误处理和用户提示
- [x] 加载状态管理
- [x] 下拉刷新功能
- [x] 搜索和筛选功能
## 项目结构
```
government-mini-program/
├── src/
│ ├── components/ # 9个核心业务组件
│ ├── pages/ # 9个页面文件
│ ├── services/ # 8个API服务文件
│ ├── utils/ # 2个工具类文件
│ ├── styles/ # 样式文件
│ ├── router/ # 路由配置
│ ├── App.vue # 根组件
│ └── main.js # 入口文件
├── public/ # 静态资源
├── static/ # 小程序静态资源
├── 配置文件 # 项目配置文件
├── 启动脚本 # 开发环境启动脚本
└── 文档 # 完整的项目文档
```
## 技术实现
### 前端技术栈
- **框架**: Vue 2.6 + uni-app
- **状态管理**: Pinia
- **路由**: Vue Router
- **HTTP请求**: Axios
- **样式**: Sass/SCSS
- **构建工具**: Vue CLI + Vite
### 后端集成
- **API基础地址**: http://localhost:5352/api
- **认证方式**: JWT Token
- **数据格式**: JSON
- **错误处理**: 统一错误码
## 功能特色
### 1. 用户体验
- 现代化的UI设计
- 流畅的交互体验
- 响应式布局
- 移动端优化
### 2. 功能完整性
- 8个核心功能模块
- 完整的CRUD操作
- 搜索和筛选功能
- 状态管理
### 3. 技术先进性
- 组件化开发
- 模块化架构
- 可维护性强
- 扩展性好
## 文件统计
### 代码文件
- **Vue组件**: 18个
- **JavaScript文件**: 10个
- **样式文件**: 3个
- **配置文件**: 8个
- **文档文件**: 5个
### 代码行数
- **总代码行数**: 约3000行
- **Vue组件**: 约2000行
- **JavaScript**: 约800行
- **样式**: 约200行
## 部署说明
### 开发环境
```bash
# 1. 安装依赖
npm install
# 2. 启动后端服务
cd ../government-backend
npm start
# 3. 启动前端服务
cd ../government-mini-program
npm run dev:h5
```
### 生产环境
```bash
# 1. 构建H5版本
npm run build:h5
# 2. 构建微信小程序
npm run build:mp-weixin
```
## 使用指南
### 1. 快速开始
1. 确保Node.js 16.20.2+已安装
2. 启动后端服务端口5352
3. 进入项目目录执行 `npm install`
4. 执行 `npm run dev:h5` 启动开发服务器
5. 访问 http://localhost:8080
### 2. 默认登录
- 用户名: admin
- 密码: 123456
### 3. 功能导航
- 首页: 数据概览和快捷功能
- 数据看板: 统计图表和数据分析
- 监管管理: 监管记录和检查管理
- 审批管理: 审批流程和状态跟踪
- 人员管理: 工作人员信息管理
- 疫情监控: 疫情数据和预警
- 服务管理: 政府服务项目管理
- 仓库管理: 物资仓库管理
- 个人中心: 用户设置和个人信息
## 项目优势
### 1. 完整性
- 功能模块完整
- 代码结构清晰
- 文档齐全
- 可直接使用
### 2. 可维护性
- 模块化设计
- 组件化开发
- 代码规范
- 注释完整
### 3. 可扩展性
- 易于添加新功能
- 支持多端发布
- 配置灵活
- 架构合理
### 4. 用户体验
- 界面美观
- 操作流畅
- 响应迅速
- 交互友好
## 后续建议
### 1. 功能扩展
- 添加更多数据可视化图表
- 实现消息推送功能
- 添加文件上传和下载
- 集成地图定位功能
### 2. 性能优化
- 实现虚拟滚动
- 添加图片懒加载
- 优化网络请求
- 实现离线缓存
### 3. 用户体验
- 添加暗黑模式
- 实现多语言支持
- 添加手势操作
- 优化动画效果
## 总结
政府端小程序项目已成功完成,具备以下特点:
1. **功能完整**: 包含8个核心功能模块满足政府管理需求
2. **技术先进**: 采用现代化前端技术栈,代码质量高
3. **易于使用**: 提供完整的文档和启动脚本
4. **可扩展**: 模块化设计,易于维护和扩展
5. **生产就绪**: 可直接用于生产环境
项目已准备好进行测试、部署和使用。所有核心功能都已实现,代码结构清晰,文档完整,可以立即投入使用。

View File

@@ -1,252 +0,0 @@
# 政府端小程序项目总结
## 项目概述
基于养殖端小程序和政府端后端代码,成功创建了一个完整的政府端微信小程序,提供全面的政府管理功能。
## 已完成功能
### 1. 基础架构
- ✅ 完整的Vue 2.6 + uni-app项目结构
- ✅ 响应式设计支持多端发布微信小程序、H5、App
- ✅ 模块化组件设计,易于维护和扩展
- ✅ 完整的路由配置和页面管理
### 2. 用户认证系统
- ✅ 登录页面(用户名/密码登录)
- ✅ 用户信息管理
- ✅ Token认证机制
- ✅ 路由守卫和权限控制
### 3. 核心功能模块
#### 数据看板 (Dashboard)
- ✅ 数据概览卡片展示
- ✅ 统计图表区域
- ✅ 监管统计信息
- ✅ 最近活动列表
#### 监管管理 (Supervision)
- ✅ 监管记录列表
- ✅ 搜索和筛选功能
- ✅ 新增/编辑/删除监管记录
- ✅ 状态管理(待处理、进行中、已完成、已逾期)
#### 审批管理 (Approval)
- ✅ 审批记录列表
- ✅ 审批通过/拒绝功能
- ✅ 审批状态跟踪
- ✅ 申请人信息管理
#### 人员管理 (Personnel)
- ✅ 人员信息列表
- ✅ 头像和基本信息展示
- ✅ 部门角色管理
- ✅ 联系方式管理
#### 疫情监控 (Epidemic)
- ✅ 疫情预警系统
- ✅ 疫情数据统计
- ✅ 疫情记录管理
- ✅ 风险等级显示
#### 服务管理 (Service)
- ✅ 服务项目列表
- ✅ 服务状态管理
- ✅ 服务分类管理
- ✅ 服务描述和详情
#### 仓库管理 (Warehouse)
- ✅ 仓库信息管理
- ✅ 容量和位置信息
- ✅ 管理员信息
- ✅ 仓库状态跟踪
#### 个人中心 (Profile)
- ✅ 用户信息展示
- ✅ 头像编辑功能
- ✅ 设置菜单
- ✅ 退出登录功能
### 4. 技术特性
- ✅ 完整的API服务层
- ✅ 统一的请求处理
- ✅ 错误处理和用户提示
- ✅ 加载状态管理
- ✅ 下拉刷新功能
## 项目结构
```
government-mini-program/
├── src/
│ ├── components/ # 核心组件
│ │ ├── Home.vue # 首页
│ │ ├── Login.vue # 登录
│ │ ├── Dashboard.vue # 数据看板
│ │ ├── Supervision.vue # 监管管理
│ │ ├── Approval.vue # 审批管理
│ │ ├── Personnel.vue # 人员管理
│ │ ├── Epidemic.vue # 疫情监控
│ │ ├── Service.vue # 服务管理
│ │ ├── Warehouse.vue # 仓库管理
│ │ └── Profile.vue # 个人中心
│ ├── pages/ # 页面文件
│ ├── services/ # API服务
│ │ ├── authService.js
│ │ ├── dashboardService.js
│ │ ├── supervisionService.js
│ │ ├── approvalService.js
│ │ ├── personnelService.js
│ │ ├── epidemicService.js
│ │ ├── serviceService.js
│ │ └── warehouseService.js
│ ├── utils/ # 工具类
│ │ ├── auth.js # 认证工具
│ │ └── request.js # 请求工具
│ ├── styles/ # 样式文件
│ │ ├── variables.scss # 变量
│ │ └── mixins.scss # 混入
│ ├── router/ # 路由配置
│ ├── App.vue # 根组件
│ └── main.js # 入口文件
├── public/ # 静态资源
├── static/ # 小程序静态资源
├── package.json # 项目配置
├── pages.json # 页面配置
├── manifest.json # 应用配置
├── vue.config.js # Vue配置
├── vite.config.js # Vite配置
├── start-dev.bat # Windows启动脚本
├── start-dev.sh # Linux/Mac启动脚本
└── README.md # 项目说明
```
## API接口集成
### 认证接口
- `POST /api/auth/login` - 用户登录
- `GET /api/auth/userinfo` - 获取用户信息
### 数据看板接口
- `GET /api/visualization/data` - 获取可视化数据
- `GET /api/supervision/stats` - 获取监管统计
- `GET /api/approval/stats` - 获取审批统计
- `GET /api/personnel/stats` - 获取人员统计
- `GET /api/epidemic/stats` - 获取疫情统计
- `GET /api/service/stats` - 获取服务统计
- `GET /api/warehouse/stats` - 获取仓库统计
### 管理功能接口
- 监管管理:`/api/supervision/*`
- 审批管理:`/api/approval/*`
- 人员管理:`/api/personnel/*`
- 疫情监控:`/api/epidemic/*`
- 服务管理:`/api/service/*`
- 仓库管理:`/api/warehouse/*`
## 使用说明
### 1. 环境准备
```bash
# 确保Node.js 16.20.2+已安装
node --version
# 确保后端服务运行在 http://localhost:5352
```
### 2. 安装和启动
```bash
# 进入项目目录
cd government-mini-program
# 安装依赖
npm install
# 启动开发服务器
npm run dev:h5
```
### 3. 微信小程序开发
```bash
# 构建微信小程序
npm run build:mp-weixin
# 使用微信开发者工具打开 dist/mp-weixin 目录
```
### 4. 默认登录信息
- 用户名admin
- 密码123456
## 特色功能
### 1. 响应式设计
- 适配不同屏幕尺寸
- 支持横屏和竖屏模式
- 优化的移动端交互体验
### 2. 模块化架构
- 组件化开发,易于维护
- 服务层分离,便于测试
- 统一的样式和主题管理
### 3. 用户体验优化
- 加载状态提示
- 错误处理和用户反馈
- 下拉刷新和上拉加载
- 搜索和筛选功能
### 4. 数据可视化
- 统计卡片展示
- 图表数据展示
- 实时数据更新
- 预警信息提示
## 技术栈
- **前端框架**: Vue 2.6 + uni-app
- **UI组件**: 自定义组件 + Vant Weapp
- **状态管理**: Pinia
- **路由管理**: Vue Router
- **HTTP请求**: Axios
- **样式预处理**: Sass/SCSS
- **构建工具**: Vue CLI + Vite
- **开发语言**: JavaScript ES6+
## 部署说明
### H5部署
1. 执行 `npm run build:h5`
2.`dist` 目录上传到服务器
3. 配置nginx或其他web服务器
### 微信小程序部署
1. 使用微信开发者工具打开项目
2. 配置小程序AppID
3. 点击上传,提交审核
4. 审核通过后发布
## 后续扩展建议
### 1. 功能扩展
- 添加更多数据可视化图表
- 实现消息推送功能
- 添加文件上传和下载
- 集成地图定位功能
### 2. 性能优化
- 实现虚拟滚动
- 添加图片懒加载
- 优化网络请求
- 实现离线缓存
### 3. 用户体验
- 添加暗黑模式
- 实现多语言支持
- 添加手势操作
- 优化动画效果
## 总结
政府端小程序已成功创建,具备完整的政府管理功能,包括数据看板、监管管理、审批管理、人员管理、疫情监控、服务管理和仓库管理等核心模块。项目采用现代化的前端技术栈,具有良好的可维护性和扩展性,可以直接用于生产环境。

View File

@@ -1,138 +0,0 @@
# 政府端小程序快速开始指南
## 🚀 快速启动
### 1. 环境检查
确保您的开发环境满足以下要求:
- Node.js 16.20.2 或更高版本
- npm 8.0.0 或更高版本
- 微信开发者工具(用于小程序开发)
### 2. 后端服务
确保政府端后端服务正在运行:
```bash
# 在 government-backend 目录下
npm start
# 服务将在 http://localhost:5352 启动
```
### 3. 启动小程序
```bash
# 进入项目目录
cd government-mini-program
# 安装依赖
npm install
# 启动H5开发服务器
npm run dev:h5
```
### 4. 访问应用
打开浏览器访问http://localhost:8080
## 🔑 登录信息
使用以下默认账号登录:
- **用户名**: admin
- **密码**: 123456
## 📱 功能导航
### 主要功能模块
1. **首页** - 数据概览和快捷功能
2. **数据看板** - 统计图表和数据分析
3. **监管管理** - 监管记录和检查管理
4. **审批管理** - 审批流程和状态跟踪
5. **人员管理** - 工作人员信息管理
6. **疫情监控** - 疫情数据和预警
7. **服务管理** - 政府服务项目管理
8. **仓库管理** - 物资仓库管理
9. **个人中心** - 用户设置和个人信息
### 快捷操作
- **搜索**: 在列表页面使用搜索框快速查找
- **筛选**: 点击筛选按钮进行条件筛选
- **新增**: 点击右上角"+"按钮添加新记录
- **编辑**: 点击列表项的编辑按钮
- **删除**: 点击列表项的删除按钮
## 🛠️ 开发模式
### H5开发
```bash
npm run dev:h5
```
- 支持热重载
- 自动打开浏览器
- 支持移动端调试
### 微信小程序开发
```bash
# 构建小程序
npm run build:mp-weixin
# 使用微信开发者工具打开 dist/mp-weixin 目录
```
### 生产构建
```bash
# H5生产构建
npm run build:h5
# 微信小程序生产构建
npm run build:mp-weixin
```
## 🔧 配置说明
### API配置
`src/utils/request.js` 中配置API基础地址
```javascript
const BASE_URL = process.env.NODE_ENV === 'development'
? 'http://localhost:5352/api'
: 'https://your-domain.com/api'
```
### 微信小程序配置
`manifest.json` 中配置小程序信息:
```json
{
"mp-weixin": {
"appid": "your-wechat-appid",
"setting": {
"urlCheck": false
}
}
}
```
## 📋 常见问题
### Q: 无法连接到后端服务
A: 确保后端服务正在运行检查端口5352是否被占用
### Q: 登录失败
A: 检查用户名密码是否正确,确保后端认证接口正常
### Q: 页面显示异常
A: 检查浏览器控制台错误信息,确保所有依赖已正确安装
### Q: 微信小程序无法预览
A: 确保已配置正确的AppID检查网络连接
## 🎯 下一步
1. **自定义配置**: 根据实际需求修改API地址和配置
2. **添加功能**: 在现有基础上扩展新的功能模块
3. **样式调整**: 根据设计稿调整UI样式和布局
4. **数据对接**: 连接真实的后端API接口
5. **测试部署**: 进行功能测试和生产环境部署
## 📞 技术支持
如有问题,请参考:
- 项目README.md文件
- 项目PROJECT_SUMMARY.md文件
- 微信小程序官方文档
- Vue.js官方文档

View File

@@ -1,197 +1,157 @@
# 政府端小程序
# 政府端微信小程序
基于Vue.js和uni-app开发的政府管理系统微信小程序提供完整的政府监管、审批、人员管理等功能。
## 项目简介
这是一个基于微信小程序开发的政府端管理系统,主要用于政府部门的养殖户管理和相关业务处理。
## 功能特性
### 核心功能
- **数据看板**: 实时展示各类统计数据和分析图表
- **监管管理**: 监管记录管理、检查任务分配、结果跟踪
- **审批管理**: 各类申请审批流程管理
- **人员管理**: 政府工作人员信息管理
- **疫情监控**: 疫情数据监控和预警
- **服务管理**: 政府服务项目管理
- **仓库管理**: 物资仓库管理
### 🏠 首页
- **智能硬件设备管理**
- 项圈仓库
- 耳标仓库
- 脚环仓库
- 主机仓库
### 技术特性
- 基于Vue 2.6 + uni-app框架
- 支持微信小程序、H5、App多端发布
- 响应式设计,适配各种屏幕尺寸
- 模块化组件设计,易于维护和扩展
- 完整的API接口集成
- 用户认证和权限管理
- **其它功能模块**
- 牲畜身份认证
- 无纸化检疫
- 检疫证查询
- 金融保险监管
- 屠宰场监管
- 检疫站监管
- 无纸化防疫
- 防疫站监管
### 👥 养殖户管理
- 养殖户信息列表
- 搜索功能(按姓名、手机号)
- 添加/编辑/删除养殖户
- 分页加载
- 下拉刷新
### 👤 我的
- 个人信息展示
- 系统设置
- 帮助中心
- 关于我们
- 退出登录
## 技术栈
- **框架**:微信小程序原生开发
- **语言**JavaScript、WXML、WXSS
- **工具**:微信开发者工具
## 项目结构
```
government-mini-program/
├── src/
│ ├── components/ # 组件目录
├── Home.vue # 首页组件
├── Login.vue # 登录组件
│ ├── Dashboard.vue # 数据看板
│ │ ├── Supervision.vue # 监管管理
│ │ ├── Approval.vue # 审批管理
│ │ ├── Personnel.vue # 人员管理
│ │ ── Epidemic.vue # 疫情监控
│ ├── Service.vue # 服务管理
│ │ ├── Warehouse.vue # 仓库管理
│ │ ── Profile.vue # 个人中心
│ ├── pages/ # 页面目录
├── services/ # API服务
── utils/ # 工具类
├── styles/ # 样式文件
│ ├── router/ # 路由配置
├── App.vue # 根组件
└── main.js # 入口文件
├── public/ # 静态资源
├── package.json # 项目配置
├── pages.json # 页面配置
── manifest.json # 应用配置
└── vue.config.js # Vue配置
├── app.js # 小程序入口文件
├── app.json # 全局配置
├── app.wxss # 全局样式
├── pages/ # 页面目录
│ ├── index/ # 首页
│ │ ├── index.js
│ │ ├── index.json
│ │ ├── index.wxml
│ │ ── index.wxss
│ ├── farmer/ # 养殖户管理
│ │ ├── farmer.js
│ │ ── farmer.json
│ ├── farmer.wxml
│ └── farmer.wxss
── profile/ # 我的
├── profile.js
├── profile.json
├── profile.wxml
└── profile.wxss
├── images/ # 图片资源
├── sitemap.json # 站点地图
├── project.config.json # 项目配置
── package.json # 包管理文件
```
## 开发环境
## 快速开始
### 环境要求
- Node.js 16.20.2+
- npm 8.0.0+
- 微信开发者工具
### 1. 环境准备
- 安装微信开发者工具
- 注册微信小程序账号
### 安装依赖
```bash
npm install
```
### 2. 导入项目
1. 打开微信开发者工具
2. 选择"导入项目"
3. 选择项目根目录
4. 填写AppID测试可使用测试号
5. 点击"确定"
### 开发模式
```bash
# H5开发
npm run dev:h5
### 3. 运行项目
- 在微信开发者工具中点击"编译"
- 在模拟器中查看效果
- 使用真机调试测试实际效果
# 微信小程序开发
npm run dev:mp-weixin
```
## 设计说明
### 构建生产版本
```bash
# H5构建
npm run build:h5
### 视觉设计
- **主色调**:绿色 (#4CAF50)
- **背景色**:浅灰色 (#f5f5f5)
- **卡片样式**:圆角、阴影效果
- **图标设计**:圆形背景、彩色配色
# 微信小程序构建
npm run build:mp-weixin
```
### 布局特点
- **顶部导航**:绿色背景,白色文字
- **功能区域**:卡片式布局,网格排列
- **底部导航**3个标签页图标+文字
- **响应式**:适配不同屏幕尺寸
## API接口
## 开发说明
### 认证接口
- `POST /api/auth/login` - 用户登录
- `GET /api/auth/userinfo` - 获取用户信息
### 页面配置
每个页面包含4个文件
- `.js` - 页面逻辑
- `.json` - 页面配置
- `.wxml` - 页面结构
- `.wxss` - 页面样式
### 数据看板接口
- `GET /api/visualization/data` - 获取可视化数据
- `GET /api/supervision/stats` - 获取监管统计
- `GET /api/approval/stats` - 获取审批统计
### 数据管理
- 使用Page的data属性管理页面数据
- 通过setData方法更新数据
- 支持下拉刷新和上拉加载
### 监管管理接口
- `GET /api/supervision/list` - 获取监管列表
- `POST /api/supervision` - 创建监管记录
- `PUT /api/supervision/:id` - 更新监管记录
- `DELETE /api/supervision/:id` - 删除监管记录
### 审批管理接口
- `GET /api/approval/list` - 获取审批列表
- `POST /api/approval` - 创建审批
- `POST /api/approval/:id/approve` - 审批通过
- `POST /api/approval/:id/reject` - 审批拒绝
### 人员管理接口
- `GET /api/personnel/list` - 获取人员列表
- `POST /api/personnel` - 创建人员
- `PUT /api/personnel/:id` - 更新人员
- `DELETE /api/personnel/:id` - 删除人员
### 疫情监控接口
- `GET /api/epidemic/list` - 获取疫情列表
- `POST /api/epidemic` - 创建疫情记录
- `GET /api/epidemic/stats` - 获取疫情统计
### 服务管理接口
- `GET /api/service/list` - 获取服务列表
- `POST /api/service` - 创建服务
- `PUT /api/service/:id` - 更新服务
- `DELETE /api/service/:id` - 删除服务
### 仓库管理接口
- `GET /api/warehouse/list` - 获取仓库列表
- `POST /api/warehouse` - 创建仓库
- `PUT /api/warehouse/:id` - 更新仓库
- `DELETE /api/warehouse/:id` - 删除仓库
## 配置说明
### 环境配置
在项目根目录创建 `.env` 文件(或复制 `config.env``.env`
```
# API基础地址
VUE_APP_API_BASE_URL=http://localhost:5352/api
# 应用配置
VUE_APP_TITLE=政府管理系统
VUE_APP_VERSION=1.0.0
```
### 微信小程序配置
`manifest.json` 中配置小程序信息:
```json
{
"mp-weixin": {
"appid": "your-wechat-appid",
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true
}
}
}
```
## 部署说明
### 微信小程序部署
1. 使用微信开发者工具打开项目
2. 配置小程序AppID
3. 点击上传,提交审核
4. 审核通过后发布
### H5部署
1. 执行 `npm run build:h5`
2.`dist` 目录上传到服务器
3. 配置nginx或其他web服务器
## 开发指南
### 添加新页面
1.`src/pages` 目录下创建页面文件夹
2.`pages.json` 中注册页面
3.`src/router/index.js` 中添加路由
### 添加新组件
1.`src/components` 目录下创建组件文件
2. 在需要使用的页面中导入并使用
### 添加新API
1.`src/services` 目录下创建服务文件
2.`src/utils/request.js` 中添加请求方法
3. 在组件中调用API
### 事件处理
- 使用bindtap绑定点击事件
- 使用catchtap阻止事件冒泡
- 支持表单输入和数据提交
## 注意事项
1. 确保后端API服务正常运行
2. 检查网络请求配置和跨域设置
3. 微信小程序需要配置合法域名
4. 生产环境需要配置HTTPS
1. **图标资源**:当前使用占位符图标,建议替换为实际设计图标
2. **API接口**:功能模块目前显示"开发中"提示需要对接实际后端API
3. **权限控制**:根据实际需求添加用户权限验证
4. **错误处理**:完善网络请求和异常情况的处理
5. **性能优化**:图片压缩、代码分包等优化措施
## 许可证
## 后续开发
MIT License
### 功能完善
- [ ] 对接后端API接口
- [ ] 添加用户登录认证
- [ ] 完善权限管理系统
- [ ] 添加数据统计功能
- [ ] 实现消息推送
### 体验优化
- [ ] 添加加载动画
- [ ] 优化页面切换效果
- [ ] 完善错误提示
- [ ] 添加操作反馈
- [ ] 支持暗色模式
## 联系方式
如有问题或建议,请联系开发团队。
---
**版本**v1.0.0
**更新时间**2024年1月

View File

@@ -10,12 +10,10 @@ App({
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
console.log('登录成功', res.code)
}
})
},
globalData: {
userInfo: null,
baseUrl: 'http://localhost:5352/api'
userInfo: null
}
})

View File

@@ -2,51 +2,46 @@
"pages": [
"pages/index/index",
"pages/login/login",
"pages/dashboard/dashboard",
"pages/supervision/supervision",
"pages/approval/approval",
"pages/personnel/personnel",
"pages/epidemic/epidemic",
"pages/service/service",
"pages/warehouse/warehouse",
"pages/profile/profile"
"pages/farmers/farmers",
"pages/profile/profile",
"pages/statistics/statistics",
"pages/farmer/farmer",
"pages/notification/notification",
"pages/farmer/add/add",
"pages/farmer/edit/edit",
"pages/farmer/detail/detail",
"pages/notification/detail/detail"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#1890ff",
"navigationBarTitleText": "政府管理系统",
"navigationBarBackgroundColor": "#2c5aa0",
"navigationBarTitleText": "政府监管端",
"navigationBarTextStyle": "white",
"backgroundColor": "#f6f6f6"
"backgroundColor": "#f5f5f5"
},
"tabBar": {
"color": "#7A7E83",
"selectedColor": "#1890ff",
"borderStyle": "black",
"color": "#999999",
"selectedColor": "#7CB342",
"backgroundColor": "#ffffff",
"borderStyle": "black",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "images/home.png",
"selectedIconPath": "images/home-active.png",
"text": "首页"
"selectedIconPath": "images/home-active.png"
},
{
"pagePath": "pages/dashboard/dashboard",
"iconPath": "images/dashboard.png",
"selectedIconPath": "images/dashboard-active.png",
"text": "看板"
},
{
"pagePath": "pages/supervision/supervision",
"iconPath": "images/supervision.png",
"selectedIconPath": "images/supervision-active.png",
"text": "监管"
"pagePath": "pages/farmers/farmers",
"text": "养殖户",
"iconPath": "images/farmer.png",
"selectedIconPath": "images/farmer-active.png"
},
{
"pagePath": "pages/profile/profile",
"text": "我的",
"iconPath": "images/profile.png",
"selectedIconPath": "images/profile-active.png",
"text": "我的"
"selectedIconPath": "images/profile-active.png"
}
]
},
@@ -54,6 +49,5 @@
"request": 10000,
"downloadFile": 10000
},
"debug": true,
"sitemapLocation": "sitemap.json"
"debug": true
}

View File

@@ -11,147 +11,29 @@
/* 全局样式 */
page {
background-color: #f6f6f6;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
/* 通用类 */
.card {
background: #fff;
border-radius: 16rpx;
padding: 30rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
}
.title {
font-size: 32rpx;
font-weight: 600;
color: #333;
margin-bottom: 20rpx;
}
.subtitle {
font-size: 28rpx;
font-weight: 500;
color: #666;
margin-bottom: 16rpx;
}
.text {
font-size: 26rpx;
color: #999;
line-height: 1.5;
background-color: #f5f5f5;
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', SimSun, sans-serif;
}
/* 通用按钮样式 */
.btn {
display: inline-block;
padding: 20rpx 40rpx;
border-radius: 8rpx;
text-align: center;
font-size: 28rpx;
border: none;
transition: all 0.3s;
padding: 20rpx 40rpx;
}
.btn.primary {
background: #1890ff;
color: #fff;
/* 卡片样式 */
.card {
background-color: #ffffff;
border-radius: 12rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
margin: 20rpx;
padding: 30rpx;
}
.btn.success {
background: #52c41a;
color: #fff;
}
.btn.warning {
background: #faad14;
color: #fff;
}
.btn.danger {
background: #ff4d4f;
color: #fff;
}
.flex {
display: flex;
}
.flex.center {
align-items: center;
justify-content: center;
}
.flex.between {
justify-content: space-between;
}
.flex.around {
justify-content: space-around;
}
.flex.column {
flex-direction: column;
}
/* 加载状态 */
.loading {
display: flex;
align-items: center;
justify-content: center;
padding: 40rpx;
color: #999;
}
/* 空状态 */
.empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 80rpx 40rpx;
color: #999;
}
.empty-icon {
font-size: 80rpx;
margin-bottom: 20rpx;
}
.empty-text {
font-size: 28rpx;
}
/* 列表项 */
.list-item {
display: flex;
align-items: center;
padding: 30rpx 20rpx;
background: #fff;
border-bottom: 1rpx solid #f0f0f0;
}
.list-item:last-child {
border-bottom: none;
}
.item-content {
flex: 1;
}
.item-title {
font-size: 30rpx;
color: #333;
margin-bottom: 8rpx;
}
.item-desc {
font-size: 24rpx;
color: #999;
}
.item-arrow {
font-size: 24rpx;
color: #ccc;
/* 分割线样式 */
.divider {
height: 2rpx;
background-color: #e0e0e0;
margin: 20rpx 0;
}

View File

@@ -1,19 +0,0 @@
# API基础地址
VUE_APP_API_BASE_URL=http://localhost:5352/api
# 应用配置
VUE_APP_TITLE=政府管理系统
VUE_APP_VERSION=1.0.0
VUE_APP_DESCRIPTION=政府管理系统微信小程序
# 微信小程序配置
VUE_APP_WECHAT_APPID=wx1b9c7cd2d0e0bfd3
# 开发环境配置
NODE_ENV=development
# 端口配置
PORT=8080
# 代理配置
VUE_APP_PROXY_TARGET=http://localhost:5352

View File

@@ -0,0 +1,68 @@
// API配置文件
const config = {
// 后端服务器配置
baseURL: 'https://ad.ningmuyun.com/api',
// 请求超时时间
timeout: 10000,
// API端点配置
endpoints: {
// 认证相关
auth: {
login: '/government/auth/login',
logout: '/auth/logout',
userInfo: '/auth/userinfo'
},
// 养殖户管理
farmer: {
list: '/government/farmers',
create: '/government/farmers',
update: '/government/farmers',
delete: '/government/farmers',
detail: '/government/farmers',
resetPassword: '/government/farmers/{id}/reset-password',
farmTypes: '/government/farm-types',
animalTypes: '/government/animal-types'
},
// 数据统计
statistics: {
dataCenter: '/government/data-center',
marketPrice: '/government/market-price'
},
// 系统管理
system: {
health: '/health'
},
// 设备管理
device: {
warnings: '/device-warning',
smartCollars: '/government/collars',
smartEarmarks: '/smart-earmark',
smartHosts: '/smart-host'
},
// 疫情管理
epidemic: {
records: '/epidemic-record',
activities: '/epidemic-activity',
vaccines: '/vaccine'
},
// 监管任务
supervision: {
tasks: '/supervision'
},
// 审批流程
approval: {
processes: '/approval-process'
}
}
};
module.exports = config;

View File

@@ -1,22 +0,0 @@
# 环境配置示例文件
# 复制此文件为 .env 并修改相应配置
# API基础地址
VUE_APP_API_BASE_URL=http://localhost:5352/api
# 应用配置
VUE_APP_TITLE=政府管理系统
VUE_APP_VERSION=1.0.0
VUE_APP_DESCRIPTION=政府管理系统微信小程序
# 微信小程序配置
VUE_APP_WECHAT_APPID=your-wechat-appid-here
# 开发环境配置
NODE_ENV=development
# 端口配置
PORT=8080
# 代理配置
VUE_APP_PROXY_TARGET=http://localhost:5352

View File

@@ -0,0 +1 @@
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==

View File

@@ -0,0 +1 @@
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==

View File

@@ -0,0 +1 @@
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==

View File

@@ -0,0 +1 @@
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==

View File

@@ -0,0 +1 @@
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==

View File

@@ -0,0 +1 @@
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==

View File

@@ -0,0 +1 @@
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==

View File

@@ -0,0 +1 @@
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==

View File

@@ -0,0 +1 @@
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==

View File

@@ -0,0 +1 @@
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==

View File

@@ -0,0 +1 @@
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==

View File

@@ -0,0 +1 @@
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==

View File

@@ -0,0 +1 @@
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==

View File

@@ -0,0 +1 @@
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==

View File

@@ -1,80 +0,0 @@
{
"name": "政府端小程序",
"appid": "wx1b9c7cd2d0e0bfd3",
"description": "政府管理系统微信小程序",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
"mp-weixin": {
"appid": "wx1b9c7cd2d0e0bfd3",
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true
},
"usingComponents": true,
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于政府监管和地图展示"
}
},
"optimization": {
"subPackages": true
}
},
"vueVersion": "2",
"splashscreen": {
"alwaysShowBeforeRender": true,
"autoclose": false,
"waiting": true
},
"app-plus": {
"usingComponents": true,
"nvueStyle": "flex",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"autoclose": false,
"waiting": true,
"delay": 0
},
"modules": {},
"distribute": {
"android": {
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>"
]
},
"ios": {}
}
},
"quickapp": {},
"h5": {
"router": {
"mode": "hash"
},
"optimization": {
"treeShaking": {
"enable": true
}
}
}
}

View File

@@ -1,392 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322045, function(require, module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.onNavigationBarSearchInputClicked = exports.onNavigationBarSearchInputConfirmed = exports.onNavigationBarSearchInputChanged = exports.onBackPress = exports.onNavigationBarButtonTap = exports.onTabItemTap = exports.onResize = exports.onPageScroll = exports.onAddToFavorites = exports.onShareTimeline = exports.onShareAppMessage = exports.onReachBottom = exports.onPullDownRefresh = exports.onUnload = exports.onReady = exports.onLoad = exports.onInit = exports.onUniNViewMessage = exports.onThemeChange = exports.onUnhandledRejection = exports.onPageNotFound = exports.onError = exports.onLaunch = exports.onHide = exports.onShow = exports.initUtsPackageName = exports.initUtsClassName = exports.initUtsIndexClassName = exports.initUtsProxyFunction = exports.initUtsProxyClass = void 0;
var composition_api_1 = require("@vue/composition-api");
var app = require("./app");
var mp = require("./mp");
var uts_1 = require("./uts");
Object.defineProperty(exports, "initUtsProxyClass", { enumerable: true, get: function () { return uts_1.initUtsProxyClass; } });
Object.defineProperty(exports, "initUtsProxyFunction", { enumerable: true, get: function () { return uts_1.initUtsProxyFunction; } });
Object.defineProperty(exports, "initUtsIndexClassName", { enumerable: true, get: function () { return uts_1.initUtsIndexClassName; } });
Object.defineProperty(exports, "initUtsClassName", { enumerable: true, get: function () { return uts_1.initUtsClassName; } });
Object.defineProperty(exports, "initUtsPackageName", { enumerable: true, get: function () { return uts_1.initUtsPackageName; } });
var lifecycles = [];
var createLifeCycle = function (lifecycle) {
lifecycles.push(lifecycle);
var fn = (0, composition_api_1.createLifeCycle)(lifecycle);
return function (callback, target) {
return fn(callback, target);
};
};
if (typeof plus === 'object') {
app.init();
}
else if (typeof window === 'object' && 'document' in window) {
}
else {
mp.init(lifecycles);
}
exports.onShow = createLifeCycle('onShow');
exports.onHide = createLifeCycle('onHide');
exports.onLaunch = createLifeCycle('onLaunch');
exports.onError = createLifeCycle('onError');
exports.onPageNotFound = createLifeCycle('onPageNotFound');
exports.onUnhandledRejection = createLifeCycle('onUnhandledRejection');
exports.onThemeChange = createLifeCycle('onThemeChange');
exports.onUniNViewMessage = createLifeCycle('onUniNViewMessage');
exports.onInit = createLifeCycle('onInit');
exports.onLoad = createLifeCycle('onLoad');
exports.onReady = createLifeCycle('onReady');
exports.onUnload = createLifeCycle('onUnload');
exports.onPullDownRefresh = createLifeCycle('onPullDownRefresh');
exports.onReachBottom = createLifeCycle('onReachBottom');
exports.onShareAppMessage = createLifeCycle('onShareAppMessage');
exports.onShareTimeline = createLifeCycle('onShareTimeline');
exports.onAddToFavorites = createLifeCycle('onAddToFavorites');
exports.onPageScroll = createLifeCycle('onPageScroll');
exports.onResize = createLifeCycle('onResize');
exports.onTabItemTap = createLifeCycle('onTabItemTap');
exports.onNavigationBarButtonTap = createLifeCycle('onNavigationBarButtonTap');
exports.onBackPress = createLifeCycle('onBackPress');
exports.onNavigationBarSearchInputChanged = createLifeCycle('onNavigationBarSearchInputChanged');
exports.onNavigationBarSearchInputConfirmed = createLifeCycle('onNavigationBarSearchInputConfirmed');
exports.onNavigationBarSearchInputClicked = createLifeCycle('onNavigationBarSearchInputClicked');
}, function(modId) {var map = {"./app":1758268322046,"./mp":1758268322047,"./uts":1758268322048}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322046, function(require, module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.init = void 0;
var Vue = require("vue");
function init() {
var vueConstructor = (Vue.default ? Vue.default : Vue);
var defaultMergeHook = vueConstructor.config.optionMergeStrategies.mounted;
var onReadyFn;
vueConstructor.config.optionMergeStrategies.mounted = function Le(parentVal, childVal) {
var res = defaultMergeHook.call(this, parentVal, childVal);
if (Array.isArray(res)) {
var index = void 0;
if (onReadyFn) {
index = res.indexOf(onReadyFn);
}
else {
index = res.findIndex(function (fn) { return fn.toString().includes('onReady'); });
onReadyFn = res[index];
}
if (index !== -1) {
res.splice(index, 1);
res.push(onReadyFn);
}
}
return res;
};
}
exports.init = init;
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322047, function(require, module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.init = void 0;
var vue_1 = require("vue");
function updateLifeCycle(lifecycles, setupLifecycles, fn) {
if (fn) {
if (fn.lifecycles) {
fn.lifecycles.forEach(function (item) {
if (!setupLifecycles.includes(item)) {
setupLifecycles.push(item);
}
});
}
else {
var fnString_1 = fn.toString();
lifecycles.forEach(function (item) {
if (!setupLifecycles.includes(item) && (new RegExp("\\b(".concat(item, ")\\b"))).test(fnString_1)) {
setupLifecycles.push(item);
}
});
}
}
}
function init(lifecycles) {
var setup = vue_1.default.config.optionMergeStrategies.setup;
var extend = vue_1.default.extend;
vue_1.default.extend = function () {
var extendedVue = extend.apply(this, arguments);
var newOptions = extendedVue.options;
var setup = newOptions.setup;
if (setup && setup.lifecycles) {
setup.lifecycles.forEach(function (item) {
newOptions[item] = newOptions[item] || [function noop() { }];
});
}
return extendedVue;
};
Object.defineProperty(vue_1.default.config.optionMergeStrategies, 'setup', {
set: function (fn) {
setup = fn;
},
get: function () {
return function (to, from) {
if (typeof setup === 'function') {
var newSetup = setup.apply(this, arguments);
newSetup.lifecycles = newSetup.lifecycles || [];
updateLifeCycle(lifecycles, newSetup.lifecycles, from);
updateLifeCycle(lifecycles, newSetup.lifecycles, to);
return newSetup;
}
};
}
});
}
exports.init = init;
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322048, function(require, module, exports) {
exports.__esModule = true;
exports.initUtsClassName = exports.initUtsIndexClassName = exports.initUtsPackageName = exports.initUtsProxyClass = exports.initUtsProxyFunction = exports.normalizeArg = void 0;
var utils_1 = require("./utils");
var callbackId = 1;
var proxy;
var callbacks = {};
function normalizeArg(arg) {
if (typeof arg === 'function') {
// 查找该函数是否已缓存
var oldId = Object.keys(callbacks).find(function (id) { return callbacks[id] === arg; });
var id = oldId ? parseInt(oldId) : callbackId++;
callbacks[id] = arg;
return id;
}
else if ((0, utils_1.isPlainObject)(arg)) {
Object.keys(arg).forEach(function (name) {
;
arg[name] = normalizeArg(arg[name]);
});
}
return arg;
}
exports.normalizeArg = normalizeArg;
function initUtsInstanceMethod(async, opts, instanceId) {
return initProxyFunction(async, opts, instanceId);
}
function getProxy() {
if (!proxy) {
proxy = uni.requireNativePlugin('UTS-Proxy');
}
return proxy;
}
function resolveSyncResult(res) {
if (res.errMsg) {
throw new Error(res.errMsg);
}
return res.params;
}
function invokePropGetter(args) {
if (args.errMsg) {
throw new Error(args.errMsg);
}
delete args.errMsg;
return resolveSyncResult(getProxy().invokeSync(args, function () { }));
}
function initProxyFunction(async, _a, instanceId) {
var pkg = _a.package, cls = _a["class"], propOrMethod = _a.name, method = _a.method, companion = _a.companion, methodParams = _a.params, errMsg = _a.errMsg;
var invokeCallback = function (_a) {
var id = _a.id, name = _a.name, params = _a.params, keepAlive = _a.keepAlive;
var callback = callbacks[id];
if (callback) {
callback.apply(void 0, params);
if (!keepAlive) {
delete callbacks[id];
}
}
else {
console.error("".concat(pkg).concat(cls, ".").concat(propOrMethod, " ").concat(name, " is not found"));
}
};
var baseArgs = instanceId
? { id: instanceId, name: propOrMethod, method: methodParams }
: {
package: pkg,
"class": cls,
name: method || propOrMethod,
companion: companion,
method: methodParams
};
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (errMsg) {
throw new Error(errMsg);
}
var invokeArgs = (0, utils_1.extend)({}, baseArgs, {
params: args.map(function (arg) { return normalizeArg(arg); })
});
if (async) {
return new Promise(function (resolve, reject) {
getProxy().invokeAsync(invokeArgs, function (res) {
if (res.type !== 'return') {
invokeCallback(res);
}
else {
if (res.errMsg) {
reject(res.errMsg);
}
else {
resolve(res.params);
}
}
});
});
}
return resolveSyncResult(getProxy().invokeSync(invokeArgs, invokeCallback));
};
}
function initUtsStaticMethod(async, opts) {
if (opts.main && !opts.method) {
if (typeof plus !== 'undefined' && plus.os.name === 'iOS') {
opts.method = 's_' + opts.name;
}
}
return initProxyFunction(async, opts, 0);
}
exports.initUtsProxyFunction = initUtsStaticMethod;
function initUtsProxyClass(_a) {
var pkg = _a.package, cls = _a["class"], constructorParams = _a.constructor.params, methods = _a.methods, props = _a.props, staticProps = _a.staticProps, staticMethods = _a.staticMethods, errMsg = _a.errMsg;
var baseOptions = {
package: pkg,
"class": cls,
errMsg: errMsg
};
var ProxyClass = /** @class */ (function () {
function UtsClass() {
var params = [];
for (var _i = 0; _i < arguments.length; _i++) {
params[_i] = arguments[_i];
}
if (errMsg) {
throw new Error(errMsg);
}
var target = {};
// 初始化实例 ID
var instanceId = initProxyFunction(false, (0, utils_1.extend)({ name: 'constructor', params: constructorParams }, baseOptions), 0).apply(null, params);
if (!instanceId) {
throw new Error("new ".concat(cls, " is failed"));
}
return new Proxy(this, {
get: function (_, name) {
if (!target[name]) {
//实例方法
if ((0, utils_1.hasOwn)(methods, name)) {
var _a = methods[name], async = _a.async, params_1 = _a.params;
target[name] = initUtsInstanceMethod(!!async, (0, utils_1.extend)({
name: name,
params: params_1
}, baseOptions), instanceId);
}
else if (props.includes(name)) {
// 实例属性
return invokePropGetter({
id: instanceId,
name: name,
errMsg: errMsg
});
}
}
return target[name];
}
});
}
return UtsClass;
}());
var staticMethodCache = {};
return new Proxy(ProxyClass, {
get: function (target, name, receiver) {
if ((0, utils_1.hasOwn)(staticMethods, name)) {
if (!staticMethodCache[name]) {
var _a = staticMethods[name], async = _a.async, params = _a.params;
// 静态方法
staticMethodCache[name] = initUtsStaticMethod(!!async, (0, utils_1.extend)({ name: name, companion: true, params: params }, baseOptions));
}
return staticMethodCache[name];
}
if (staticProps.includes(name)) {
// 静态属性
return invokePropGetter((0, utils_1.extend)({ name: name, companion: true }, baseOptions));
}
return Reflect.get(target, name, receiver);
}
});
}
exports.initUtsProxyClass = initUtsProxyClass;
function initUtsPackageName(name, is_uni_modules) {
if (typeof plus !== 'undefined' && plus.os.name === 'Android') {
return 'uts.sdk.' + (is_uni_modules ? 'modules.' : '') + name;
}
return '';
}
exports.initUtsPackageName = initUtsPackageName;
function initUtsIndexClassName(moduleName, is_uni_modules) {
if (typeof plus === 'undefined') {
return '';
}
return initUtsClassName(moduleName, plus.os.name === 'iOS' ? 'IndexSwift' : 'IndexKt', is_uni_modules);
}
exports.initUtsIndexClassName = initUtsIndexClassName;
function initUtsClassName(moduleName, className, is_uni_modules) {
if (typeof plus === 'undefined') {
return '';
}
if (plus.os.name === 'Android') {
return className;
}
if (plus.os.name === 'iOS') {
return ('UTSSDK' +
(is_uni_modules ? 'Modules' : '') +
(0, utils_1.capitalize)(moduleName) +
(0, utils_1.capitalize)(className));
}
return '';
}
exports.initUtsClassName = initUtsClassName;
}, function(modId) { var map = {"./utils":1758268322049}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322049, function(require, module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.capitalize = exports.isPlainObject = exports.hasOwn = exports.extend = void 0;
exports.extend = Object.assign;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var hasOwn = function (val, key) { return hasOwnProperty.call(val, key); };
exports.hasOwn = hasOwn;
var objectToString = Object.prototype.toString;
var toTypeString = function (value) {
return objectToString.call(value);
};
var isPlainObject = function (val) {
return toTypeString(val) === '[object Object]';
};
exports.isPlainObject = isPlainObject;
var cacheStringFunction = function (fn) {
var cache = Object.create(null);
return (function (str) {
var hit = cache[str];
return hit || (cache[str] = fn(str));
});
};
exports.capitalize = cacheStringFunction(function (str) { return str.charAt(0).toUpperCase() + str.slice(1); });
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322045);
})()
//miniprogram-npm-outsideDeps=["@vue/composition-api","vue"]
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,411 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322053, function(require, module, exports) {
module.exports =
{
parallel : require('./parallel.js'),
serial : require('./serial.js'),
serialOrdered : require('./serialOrdered.js')
};
}, function(modId) {var map = {"./parallel.js":1758268322054,"./serial.js":1758268322061,"./serialOrdered.js":1758268322062}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322054, function(require, module, exports) {
var iterate = require('./lib/iterate.js')
, initState = require('./lib/state.js')
, terminator = require('./lib/terminator.js')
;
// Public API
module.exports = parallel;
/**
* Runs iterator over provided array elements in parallel
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {function} callback - invoked when all elements processed
* @returns {function} - jobs terminator
*/
function parallel(list, iterator, callback)
{
var state = initState(list);
while (state.index < (state['keyedList'] || list).length)
{
iterate(list, iterator, state, function(error, result)
{
if (error)
{
callback(error, result);
return;
}
// looks like it's the last one
if (Object.keys(state.jobs).length === 0)
{
callback(null, state.results);
return;
}
});
state.index++;
}
return terminator.bind(state, callback);
}
}, function(modId) { var map = {"./lib/iterate.js":1758268322055,"./lib/state.js":1758268322059,"./lib/terminator.js":1758268322060}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322055, function(require, module, exports) {
var async = require('./async.js')
, abort = require('./abort.js')
;
// API
module.exports = iterate;
/**
* Iterates over each job object
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {object} state - current job status
* @param {function} callback - invoked when all elements processed
*/
function iterate(list, iterator, state, callback)
{
// store current index
var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;
state.jobs[key] = runJob(iterator, key, list[key], function(error, output)
{
// don't repeat yourself
// skip secondary callbacks
if (!(key in state.jobs))
{
return;
}
// clean up jobs
delete state.jobs[key];
if (error)
{
// don't process rest of the results
// stop still active jobs
// and reset the list
abort(state);
}
else
{
state.results[key] = output;
}
// return salvaged results
callback(error, state.results);
});
}
/**
* Runs iterator over provided job element
*
* @param {function} iterator - iterator to invoke
* @param {string|number} key - key/index of the element in the list of jobs
* @param {mixed} item - job description
* @param {function} callback - invoked after iterator is done with the job
* @returns {function|mixed} - job abort function or something else
*/
function runJob(iterator, key, item, callback)
{
var aborter;
// allow shortcut if iterator expects only two arguments
if (iterator.length == 2)
{
aborter = iterator(item, async(callback));
}
// otherwise go with full three arguments
else
{
aborter = iterator(item, key, async(callback));
}
return aborter;
}
}, function(modId) { var map = {"./async.js":1758268322056,"./abort.js":1758268322058}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322056, function(require, module, exports) {
var defer = require('./defer.js');
// API
module.exports = async;
/**
* Runs provided callback asynchronously
* even if callback itself is not
*
* @param {function} callback - callback to invoke
* @returns {function} - augmented callback
*/
function async(callback)
{
var isAsync = false;
// check if async happened
defer(function() { isAsync = true; });
return function async_callback(err, result)
{
if (isAsync)
{
callback(err, result);
}
else
{
defer(function nextTick_callback()
{
callback(err, result);
});
}
};
}
}, function(modId) { var map = {"./defer.js":1758268322057}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322057, function(require, module, exports) {
module.exports = defer;
/**
* Runs provided function on next iteration of the event loop
*
* @param {function} fn - function to run
*/
function defer(fn)
{
var nextTick = typeof setImmediate == 'function'
? setImmediate
: (
typeof process == 'object' && typeof process.nextTick == 'function'
? process.nextTick
: null
);
if (nextTick)
{
nextTick(fn);
}
else
{
setTimeout(fn, 0);
}
}
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322058, function(require, module, exports) {
// API
module.exports = abort;
/**
* Aborts leftover active jobs
*
* @param {object} state - current state object
*/
function abort(state)
{
Object.keys(state.jobs).forEach(clean.bind(state));
// reset leftover jobs
state.jobs = {};
}
/**
* Cleans up leftover job by invoking abort function for the provided job id
*
* @this state
* @param {string|number} key - job id to abort
*/
function clean(key)
{
if (typeof this.jobs[key] == 'function')
{
this.jobs[key]();
}
}
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322059, function(require, module, exports) {
// API
module.exports = state;
/**
* Creates initial state object
* for iteration over list
*
* @param {array|object} list - list to iterate over
* @param {function|null} sortMethod - function to use for keys sort,
* or `null` to keep them as is
* @returns {object} - initial state object
*/
function state(list, sortMethod)
{
var isNamedList = !Array.isArray(list)
, initState =
{
index : 0,
keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
jobs : {},
results : isNamedList ? {} : [],
size : isNamedList ? Object.keys(list).length : list.length
}
;
if (sortMethod)
{
// sort array keys based on it's values
// sort object's keys just on own merit
initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)
{
return sortMethod(list[a], list[b]);
});
}
return initState;
}
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322060, function(require, module, exports) {
var abort = require('./abort.js')
, async = require('./async.js')
;
// API
module.exports = terminator;
/**
* Terminates jobs in the attached state context
*
* @this AsyncKitState#
* @param {function} callback - final callback to invoke after termination
*/
function terminator(callback)
{
if (!Object.keys(this.jobs).length)
{
return;
}
// fast forward iteration index
this.index = this.size;
// abort jobs
abort(this);
// send back results we have so far
async(callback)(null, this.results);
}
}, function(modId) { var map = {"./abort.js":1758268322058,"./async.js":1758268322056}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322061, function(require, module, exports) {
var serialOrdered = require('./serialOrdered.js');
// Public API
module.exports = serial;
/**
* Runs iterator over provided array elements in series
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {function} callback - invoked when all elements processed
* @returns {function} - jobs terminator
*/
function serial(list, iterator, callback)
{
return serialOrdered(list, iterator, null, callback);
}
}, function(modId) { var map = {"./serialOrdered.js":1758268322062}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322062, function(require, module, exports) {
var iterate = require('./lib/iterate.js')
, initState = require('./lib/state.js')
, terminator = require('./lib/terminator.js')
;
// Public API
module.exports = serialOrdered;
// sorting helpers
module.exports.ascending = ascending;
module.exports.descending = descending;
/**
* Runs iterator over provided sorted array elements in series
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {function} sortMethod - custom sort function
* @param {function} callback - invoked when all elements processed
* @returns {function} - jobs terminator
*/
function serialOrdered(list, iterator, sortMethod, callback)
{
var state = initState(list, sortMethod);
iterate(list, iterator, state, function iteratorHandler(error, result)
{
if (error)
{
callback(error, result);
return;
}
state.index++;
// are we there yet?
if (state.index < (state['keyedList'] || list).length)
{
iterate(list, iterator, state, iteratorHandler);
return;
}
// done here
callback(null, state.results);
});
return terminator.bind(state, callback);
}
/*
* -- Sort methods
*/
/**
* sort helper to sort array elements in ascending order
*
* @param {mixed} a - an item to compare
* @param {mixed} b - an item to compare
* @returns {number} - comparison result
*/
function ascending(a, b)
{
return a < b ? -1 : a > b ? 1 : 0;
}
/**
* sort helper to sort array elements in descending order
*
* @param {mixed} a - an item to compare
* @param {mixed} b - an item to compare
* @returns {number} - comparison result
*/
function descending(a, b)
{
return -1 * ascending(a, b);
}
}, function(modId) { var map = {"./lib/iterate.js":1758268322055,"./lib/state.js":1758268322059,"./lib/terminator.js":1758268322060}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322053);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,62 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322096, function(require, module, exports) {
var bind = require('function-bind');
var $TypeError = require('es-errors/type');
var $call = require('./functionCall');
var $actualApply = require('./actualApply');
/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
module.exports = function callBindBasic(args) {
if (args.length < 1 || typeof args[0] !== 'function') {
throw new $TypeError('a function is required');
}
return $actualApply(bind, $call, args);
};
}, function(modId) {var map = {"./functionCall":1758268322097,"./actualApply":1758268322098}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322097, function(require, module, exports) {
/** @type {import('./functionCall')} */
module.exports = Function.prototype.call;
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322098, function(require, module, exports) {
var bind = require('function-bind');
var $apply = require('./functionApply');
var $call = require('./functionCall');
var $reflectApply = require('./reflectApply');
/** @type {import('./actualApply')} */
module.exports = $reflectApply || bind.call($call, $apply);
}, function(modId) { var map = {"./functionApply":1758268322099,"./functionCall":1758268322097,"./reflectApply":1758268322100}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322099, function(require, module, exports) {
/** @type {import('./functionApply')} */
module.exports = Function.prototype.apply;
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322100, function(require, module, exports) {
/** @type {import('./reflectApply')} */
module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322096);
})()
//miniprogram-npm-outsideDeps=["function-bind","es-errors/type"]
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["index.js","functionCall.js","actualApply.js","functionApply.js","reflectApply.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;ACFA,ADGA;ACFA,ADGA;ACFA,ADGA;AELA,ADGA,ADGA;AELA,ADGA,ADGA;AELA,AFMA;AELA,ACHA,AHSA;AELA,ACHA,AHSA;AELA,ACHA,AHSA;AELA,ACHA,AHSA,AIZA;AFOA,ACHA,AHSA,AIZA;AFOA,AFMA,AIZA;AFOA,AFMA,AIZA;AFOA,AENA","file":"index.js","sourcesContent":["\n\nvar bind = require('function-bind');\nvar $TypeError = require('es-errors/type');\n\nvar $call = require('./functionCall');\nvar $actualApply = require('./actualApply');\n\n/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */\nmodule.exports = function callBindBasic(args) {\n\tif (args.length < 1 || typeof args[0] !== 'function') {\n\t\tthrow new $TypeError('a function is required');\n\t}\n\treturn $actualApply(bind, $call, args);\n};\n","\n\n/** @type {import('./functionCall')} */\nmodule.exports = Function.prototype.call;\n","\n\nvar bind = require('function-bind');\n\nvar $apply = require('./functionApply');\nvar $call = require('./functionCall');\nvar $reflectApply = require('./reflectApply');\n\n/** @type {import('./actualApply')} */\nmodule.exports = $reflectApply || bind.call($call, $apply);\n","\n\n/** @type {import('./functionApply')} */\nmodule.exports = Function.prototype.apply;\n","\n\n/** @type {import('./reflectApply')} */\nmodule.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;\n"]}

View File

@@ -1,221 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322101, function(require, module, exports) {
var util = require('util');
var Stream = require('stream').Stream;
var DelayedStream = require('delayed-stream');
module.exports = CombinedStream;
function CombinedStream() {
this.writable = false;
this.readable = true;
this.dataSize = 0;
this.maxDataSize = 2 * 1024 * 1024;
this.pauseStreams = true;
this._released = false;
this._streams = [];
this._currentStream = null;
this._insideLoop = false;
this._pendingNext = false;
}
util.inherits(CombinedStream, Stream);
CombinedStream.create = function(options) {
var combinedStream = new this();
options = options || {};
for (var option in options) {
combinedStream[option] = options[option];
}
return combinedStream;
};
CombinedStream.isStreamLike = function(stream) {
return (typeof stream !== 'function')
&& (typeof stream !== 'string')
&& (typeof stream !== 'boolean')
&& (typeof stream !== 'number')
&& (!Buffer.isBuffer(stream));
};
CombinedStream.prototype.append = function(stream) {
var isStreamLike = CombinedStream.isStreamLike(stream);
if (isStreamLike) {
if (!(stream instanceof DelayedStream)) {
var newStream = DelayedStream.create(stream, {
maxDataSize: Infinity,
pauseStream: this.pauseStreams,
});
stream.on('data', this._checkDataSize.bind(this));
stream = newStream;
}
this._handleErrors(stream);
if (this.pauseStreams) {
stream.pause();
}
}
this._streams.push(stream);
return this;
};
CombinedStream.prototype.pipe = function(dest, options) {
Stream.prototype.pipe.call(this, dest, options);
this.resume();
return dest;
};
CombinedStream.prototype._getNext = function() {
this._currentStream = null;
if (this._insideLoop) {
this._pendingNext = true;
return; // defer call
}
this._insideLoop = true;
try {
do {
this._pendingNext = false;
this._realGetNext();
} while (this._pendingNext);
} finally {
this._insideLoop = false;
}
};
CombinedStream.prototype._realGetNext = function() {
var stream = this._streams.shift();
if (typeof stream == 'undefined') {
this.end();
return;
}
if (typeof stream !== 'function') {
this._pipeNext(stream);
return;
}
var getStream = stream;
getStream(function(stream) {
var isStreamLike = CombinedStream.isStreamLike(stream);
if (isStreamLike) {
stream.on('data', this._checkDataSize.bind(this));
this._handleErrors(stream);
}
this._pipeNext(stream);
}.bind(this));
};
CombinedStream.prototype._pipeNext = function(stream) {
this._currentStream = stream;
var isStreamLike = CombinedStream.isStreamLike(stream);
if (isStreamLike) {
stream.on('end', this._getNext.bind(this));
stream.pipe(this, {end: false});
return;
}
var value = stream;
this.write(value);
this._getNext();
};
CombinedStream.prototype._handleErrors = function(stream) {
var self = this;
stream.on('error', function(err) {
self._emitError(err);
});
};
CombinedStream.prototype.write = function(data) {
this.emit('data', data);
};
CombinedStream.prototype.pause = function() {
if (!this.pauseStreams) {
return;
}
if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();
this.emit('pause');
};
CombinedStream.prototype.resume = function() {
if (!this._released) {
this._released = true;
this.writable = true;
this._getNext();
}
if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();
this.emit('resume');
};
CombinedStream.prototype.end = function() {
this._reset();
this.emit('end');
};
CombinedStream.prototype.destroy = function() {
this._reset();
this.emit('close');
};
CombinedStream.prototype._reset = function() {
this.writable = false;
this._streams = [];
this._currentStream = null;
};
CombinedStream.prototype._checkDataSize = function() {
this._updateDataSize();
if (this.dataSize <= this.maxDataSize) {
return;
}
var message =
'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';
this._emitError(new Error(message));
};
CombinedStream.prototype._updateDataSize = function() {
this.dataSize = 0;
var self = this;
this._streams.forEach(function(stream) {
if (!stream.dataSize) {
return;
}
self.dataSize += stream.dataSize;
});
if (this._currentStream && this._currentStream.dataSize) {
this.dataSize += this._currentStream.dataSize;
}
};
CombinedStream.prototype._emitError = function(err) {
this._reset();
this.emit('error', err);
};
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322101);
})()
//miniprogram-npm-outsideDeps=["util","stream","delayed-stream"]
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,120 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322103, function(require, module, exports) {
var Stream = require('stream').Stream;
var util = require('util');
module.exports = DelayedStream;
function DelayedStream() {
this.source = null;
this.dataSize = 0;
this.maxDataSize = 1024 * 1024;
this.pauseStream = true;
this._maxDataSizeExceeded = false;
this._released = false;
this._bufferedEvents = [];
}
util.inherits(DelayedStream, Stream);
DelayedStream.create = function(source, options) {
var delayedStream = new this();
options = options || {};
for (var option in options) {
delayedStream[option] = options[option];
}
delayedStream.source = source;
var realEmit = source.emit;
source.emit = function() {
delayedStream._handleEmit(arguments);
return realEmit.apply(source, arguments);
};
source.on('error', function() {});
if (delayedStream.pauseStream) {
source.pause();
}
return delayedStream;
};
Object.defineProperty(DelayedStream.prototype, 'readable', {
configurable: true,
enumerable: true,
get: function() {
return this.source.readable;
}
});
DelayedStream.prototype.setEncoding = function() {
return this.source.setEncoding.apply(this.source, arguments);
};
DelayedStream.prototype.resume = function() {
if (!this._released) {
this.release();
}
this.source.resume();
};
DelayedStream.prototype.pause = function() {
this.source.pause();
};
DelayedStream.prototype.release = function() {
this._released = true;
this._bufferedEvents.forEach(function(args) {
this.emit.apply(this, args);
}.bind(this));
this._bufferedEvents = [];
};
DelayedStream.prototype.pipe = function() {
var r = Stream.prototype.pipe.apply(this, arguments);
this.resume();
return r;
};
DelayedStream.prototype._handleEmit = function(args) {
if (this._released) {
this.emit.apply(this, args);
return;
}
if (args[0] === 'data') {
this.dataSize += args[1].length;
this._checkIfMaxDataSizeExceeded();
}
this._bufferedEvents.push(args);
};
DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
if (this._maxDataSizeExceeded) {
return;
}
if (this.dataSize <= this.maxDataSize) {
return;
}
this._maxDataSizeExceeded = true;
var message =
'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
this.emit('error', new Error(message));
};
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322103);
})()
//miniprogram-npm-outsideDeps=["stream","util"]
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["delayed_stream.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["var Stream = require('stream').Stream;\nvar util = require('util');\n\nmodule.exports = DelayedStream;\nfunction DelayedStream() {\n this.source = null;\n this.dataSize = 0;\n this.maxDataSize = 1024 * 1024;\n this.pauseStream = true;\n\n this._maxDataSizeExceeded = false;\n this._released = false;\n this._bufferedEvents = [];\n}\nutil.inherits(DelayedStream, Stream);\n\nDelayedStream.create = function(source, options) {\n var delayedStream = new this();\n\n options = options || {};\n for (var option in options) {\n delayedStream[option] = options[option];\n }\n\n delayedStream.source = source;\n\n var realEmit = source.emit;\n source.emit = function() {\n delayedStream._handleEmit(arguments);\n return realEmit.apply(source, arguments);\n };\n\n source.on('error', function() {});\n if (delayedStream.pauseStream) {\n source.pause();\n }\n\n return delayedStream;\n};\n\nObject.defineProperty(DelayedStream.prototype, 'readable', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this.source.readable;\n }\n});\n\nDelayedStream.prototype.setEncoding = function() {\n return this.source.setEncoding.apply(this.source, arguments);\n};\n\nDelayedStream.prototype.resume = function() {\n if (!this._released) {\n this.release();\n }\n\n this.source.resume();\n};\n\nDelayedStream.prototype.pause = function() {\n this.source.pause();\n};\n\nDelayedStream.prototype.release = function() {\n this._released = true;\n\n this._bufferedEvents.forEach(function(args) {\n this.emit.apply(this, args);\n }.bind(this));\n this._bufferedEvents = [];\n};\n\nDelayedStream.prototype.pipe = function() {\n var r = Stream.prototype.pipe.apply(this, arguments);\n this.resume();\n return r;\n};\n\nDelayedStream.prototype._handleEmit = function(args) {\n if (this._released) {\n this.emit.apply(this, args);\n return;\n }\n\n if (args[0] === 'data') {\n this.dataSize += args[1].length;\n this._checkIfMaxDataSizeExceeded();\n }\n\n this._bufferedEvents.push(args);\n};\n\nDelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {\n if (this._maxDataSizeExceeded) {\n return;\n }\n\n if (this.dataSize <= this.maxDataSize) {\n return;\n }\n\n this._maxDataSizeExceeded = true;\n var message =\n 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'\n this.emit('error', new Error(message));\n};\n"]}

View File

@@ -1,27 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322104, function(require, module, exports) {
/** @type {import('.')} */
var $defineProperty = Object.defineProperty || false;
if ($defineProperty) {
try {
$defineProperty({}, 'a', { value: 1 });
} catch (e) {
// IE 8 has a broken defineProperty
$defineProperty = false;
}
}
module.exports = $defineProperty;
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322104);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["\n\n/** @type {import('.')} */\nvar $defineProperty = Object.defineProperty || false;\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = false;\n\t}\n}\n\nmodule.exports = $defineProperty;\n"]}

View File

@@ -1,17 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322105, function(require, module, exports) {
/** @type {import('.')} */
module.exports = Error;
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322105);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["\n\n/** @type {import('.')} */\nmodule.exports = Error;\n"]}

View File

@@ -1,17 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322106, function(require, module, exports) {
/** @type {import('.')} */
module.exports = Object;
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322106);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["\n\n/** @type {import('.')} */\nmodule.exports = Object;\n"]}

View File

@@ -1,48 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322107, function(require, module, exports) {
var GetIntrinsic = require('get-intrinsic');
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
var hasToStringTag = require('has-tostringtag/shams')();
var hasOwn = require('hasown');
var $TypeError = require('es-errors/type');
var toStringTag = hasToStringTag ? Symbol.toStringTag : null;
/** @type {import('.')} */
module.exports = function setToStringTag(object, value) {
var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force;
var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable;
if (
(typeof overrideIfSet !== 'undefined' && typeof overrideIfSet !== 'boolean')
|| (typeof nonConfigurable !== 'undefined' && typeof nonConfigurable !== 'boolean')
) {
throw new $TypeError('if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans');
}
if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) {
if ($defineProperty) {
$defineProperty(object, toStringTag, {
configurable: !nonConfigurable,
enumerable: false,
value: value,
writable: false
});
} else {
object[toStringTag] = value; // eslint-disable-line no-param-reassign
}
}
};
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322107);
})()
//miniprogram-npm-outsideDeps=["get-intrinsic","has-tostringtag/shams","hasown","es-errors/type"]
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar hasOwn = require('hasown');\nvar $TypeError = require('es-errors/type');\n\nvar toStringTag = hasToStringTag ? Symbol.toStringTag : null;\n\n/** @type {import('.')} */\nmodule.exports = function setToStringTag(object, value) {\n\tvar overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force;\n\tvar nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable;\n\tif (\n\t\t(typeof overrideIfSet !== 'undefined' && typeof overrideIfSet !== 'boolean')\n\t\t|| (typeof nonConfigurable !== 'undefined' && typeof nonConfigurable !== 'boolean')\n\t) {\n\t\tthrow new $TypeError('if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans');\n\t}\n\tif (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) {\n\t\tif ($defineProperty) {\n\t\t\t$defineProperty(object, toStringTag, {\n\t\t\t\tconfigurable: !nonConfigurable,\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: value,\n\t\t\t\twritable: false\n\t\t\t});\n\t\t} else {\n\t\t\tobject[toStringTag] = value; // eslint-disable-line no-param-reassign\n\t\t}\n\t}\n};\n"]}

View File

@@ -1,725 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322108, function(require, module, exports) {
var url = require("url");
var URL = url.URL;
var http = require("http");
var https = require("https");
var Writable = require("stream").Writable;
var assert = require("assert");
var debug = require("./debug");
// Preventive platform detection
// istanbul ignore next
(function detectUnsupportedEnvironment() {
var looksLikeNode = typeof process !== "undefined";
var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
var looksLikeV8 = isFunction(Error.captureStackTrace);
if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
console.warn("The follow-redirects package should be excluded from browser builds.");
}
}());
// Whether to use the native URL object or the legacy url module
var useNativeURL = false;
try {
assert(new URL(""));
}
catch (error) {
useNativeURL = error.code === "ERR_INVALID_URL";
}
// URL fields to preserve in copy operations
var preservedUrlFields = [
"auth",
"host",
"hostname",
"href",
"path",
"pathname",
"port",
"protocol",
"query",
"search",
"hash",
];
// Create handlers that pass events from native requests
var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
var eventHandlers = Object.create(null);
events.forEach(function (event) {
eventHandlers[event] = function (arg1, arg2, arg3) {
this._redirectable.emit(event, arg1, arg2, arg3);
};
});
// Error types with codes
var InvalidUrlError = createErrorType(
"ERR_INVALID_URL",
"Invalid URL",
TypeError
);
var RedirectionError = createErrorType(
"ERR_FR_REDIRECTION_FAILURE",
"Redirected request failed"
);
var TooManyRedirectsError = createErrorType(
"ERR_FR_TOO_MANY_REDIRECTS",
"Maximum number of redirects exceeded",
RedirectionError
);
var MaxBodyLengthExceededError = createErrorType(
"ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
"Request body larger than maxBodyLength limit"
);
var WriteAfterEndError = createErrorType(
"ERR_STREAM_WRITE_AFTER_END",
"write after end"
);
// istanbul ignore next
var destroy = Writable.prototype.destroy || noop;
// An HTTP(S) request that can be redirected
function RedirectableRequest(options, responseCallback) {
// Initialize the request
Writable.call(this);
this._sanitizeOptions(options);
this._options = options;
this._ended = false;
this._ending = false;
this._redirectCount = 0;
this._redirects = [];
this._requestBodyLength = 0;
this._requestBodyBuffers = [];
// Attach a callback if passed
if (responseCallback) {
this.on("response", responseCallback);
}
// React to responses of native requests
var self = this;
this._onNativeResponse = function (response) {
try {
self._processResponse(response);
}
catch (cause) {
self.emit("error", cause instanceof RedirectionError ?
cause : new RedirectionError({ cause: cause }));
}
};
// Perform the first request
this._performRequest();
}
RedirectableRequest.prototype = Object.create(Writable.prototype);
RedirectableRequest.prototype.abort = function () {
destroyRequest(this._currentRequest);
this._currentRequest.abort();
this.emit("abort");
};
RedirectableRequest.prototype.destroy = function (error) {
destroyRequest(this._currentRequest, error);
destroy.call(this, error);
return this;
};
// Writes buffered data to the current native request
RedirectableRequest.prototype.write = function (data, encoding, callback) {
// Writing is not allowed if end has been called
if (this._ending) {
throw new WriteAfterEndError();
}
// Validate input and shift parameters if necessary
if (!isString(data) && !isBuffer(data)) {
throw new TypeError("data should be a string, Buffer or Uint8Array");
}
if (isFunction(encoding)) {
callback = encoding;
encoding = null;
}
// Ignore empty buffers, since writing them doesn't invoke the callback
// https://github.com/nodejs/node/issues/22066
if (data.length === 0) {
if (callback) {
callback();
}
return;
}
// Only write when we don't exceed the maximum body length
if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
this._requestBodyLength += data.length;
this._requestBodyBuffers.push({ data: data, encoding: encoding });
this._currentRequest.write(data, encoding, callback);
}
// Error when we exceed the maximum body length
else {
this.emit("error", new MaxBodyLengthExceededError());
this.abort();
}
};
// Ends the current native request
RedirectableRequest.prototype.end = function (data, encoding, callback) {
// Shift parameters if necessary
if (isFunction(data)) {
callback = data;
data = encoding = null;
}
else if (isFunction(encoding)) {
callback = encoding;
encoding = null;
}
// Write data if needed and end
if (!data) {
this._ended = this._ending = true;
this._currentRequest.end(null, null, callback);
}
else {
var self = this;
var currentRequest = this._currentRequest;
this.write(data, encoding, function () {
self._ended = true;
currentRequest.end(null, null, callback);
});
this._ending = true;
}
};
// Sets a header value on the current native request
RedirectableRequest.prototype.setHeader = function (name, value) {
this._options.headers[name] = value;
this._currentRequest.setHeader(name, value);
};
// Clears a header value on the current native request
RedirectableRequest.prototype.removeHeader = function (name) {
delete this._options.headers[name];
this._currentRequest.removeHeader(name);
};
// Global timeout for all underlying requests
RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
var self = this;
// Destroys the socket on timeout
function destroyOnTimeout(socket) {
socket.setTimeout(msecs);
socket.removeListener("timeout", socket.destroy);
socket.addListener("timeout", socket.destroy);
}
// Sets up a timer to trigger a timeout event
function startTimer(socket) {
if (self._timeout) {
clearTimeout(self._timeout);
}
self._timeout = setTimeout(function () {
self.emit("timeout");
clearTimer();
}, msecs);
destroyOnTimeout(socket);
}
// Stops a timeout from triggering
function clearTimer() {
// Clear the timeout
if (self._timeout) {
clearTimeout(self._timeout);
self._timeout = null;
}
// Clean up all attached listeners
self.removeListener("abort", clearTimer);
self.removeListener("error", clearTimer);
self.removeListener("response", clearTimer);
self.removeListener("close", clearTimer);
if (callback) {
self.removeListener("timeout", callback);
}
if (!self.socket) {
self._currentRequest.removeListener("socket", startTimer);
}
}
// Attach callback if passed
if (callback) {
this.on("timeout", callback);
}
// Start the timer if or when the socket is opened
if (this.socket) {
startTimer(this.socket);
}
else {
this._currentRequest.once("socket", startTimer);
}
// Clean up on events
this.on("socket", destroyOnTimeout);
this.on("abort", clearTimer);
this.on("error", clearTimer);
this.on("response", clearTimer);
this.on("close", clearTimer);
return this;
};
// Proxy all other public ClientRequest methods
[
"flushHeaders", "getHeader",
"setNoDelay", "setSocketKeepAlive",
].forEach(function (method) {
RedirectableRequest.prototype[method] = function (a, b) {
return this._currentRequest[method](a, b);
};
});
// Proxy all public ClientRequest properties
["aborted", "connection", "socket"].forEach(function (property) {
Object.defineProperty(RedirectableRequest.prototype, property, {
get: function () { return this._currentRequest[property]; },
});
});
RedirectableRequest.prototype._sanitizeOptions = function (options) {
// Ensure headers are always present
if (!options.headers) {
options.headers = {};
}
// Since http.request treats host as an alias of hostname,
// but the url module interprets host as hostname plus port,
// eliminate the host property to avoid confusion.
if (options.host) {
// Use hostname if set, because it has precedence
if (!options.hostname) {
options.hostname = options.host;
}
delete options.host;
}
// Complete the URL object when necessary
if (!options.pathname && options.path) {
var searchPos = options.path.indexOf("?");
if (searchPos < 0) {
options.pathname = options.path;
}
else {
options.pathname = options.path.substring(0, searchPos);
options.search = options.path.substring(searchPos);
}
}
};
// Executes the next native request (initial or redirect)
RedirectableRequest.prototype._performRequest = function () {
// Load the native protocol
var protocol = this._options.protocol;
var nativeProtocol = this._options.nativeProtocols[protocol];
if (!nativeProtocol) {
throw new TypeError("Unsupported protocol " + protocol);
}
// If specified, use the agent corresponding to the protocol
// (HTTP and HTTPS use different types of agents)
if (this._options.agents) {
var scheme = protocol.slice(0, -1);
this._options.agent = this._options.agents[scheme];
}
// Create the native request and set up its event handlers
var request = this._currentRequest =
nativeProtocol.request(this._options, this._onNativeResponse);
request._redirectable = this;
for (var event of events) {
request.on(event, eventHandlers[event]);
}
// RFC7230§5.3.1: When making a request directly to an origin server, […]
// a client MUST send only the absolute path […] as the request-target.
this._currentUrl = /^\//.test(this._options.path) ?
url.format(this._options) :
// When making a request to a proxy, […]
// a client MUST send the target URI in absolute-form […].
this._options.path;
// End a redirected request
// (The first request must be ended explicitly with RedirectableRequest#end)
if (this._isRedirect) {
// Write the request entity and end
var i = 0;
var self = this;
var buffers = this._requestBodyBuffers;
(function writeNext(error) {
// Only write if this request has not been redirected yet
// istanbul ignore else
if (request === self._currentRequest) {
// Report any write errors
// istanbul ignore if
if (error) {
self.emit("error", error);
}
// Write the next buffer if there are still left
else if (i < buffers.length) {
var buffer = buffers[i++];
// istanbul ignore else
if (!request.finished) {
request.write(buffer.data, buffer.encoding, writeNext);
}
}
// End the request if `end` has been called on us
else if (self._ended) {
request.end();
}
}
}());
}
};
// Processes a response from the current native request
RedirectableRequest.prototype._processResponse = function (response) {
// Store the redirected response
var statusCode = response.statusCode;
if (this._options.trackRedirects) {
this._redirects.push({
url: this._currentUrl,
headers: response.headers,
statusCode: statusCode,
});
}
// RFC7231§6.4: The 3xx (Redirection) class of status code indicates
// that further action needs to be taken by the user agent in order to
// fulfill the request. If a Location header field is provided,
// the user agent MAY automatically redirect its request to the URI
// referenced by the Location field value,
// even if the specific status code is not understood.
// If the response is not a redirect; return it as-is
var location = response.headers.location;
if (!location || this._options.followRedirects === false ||
statusCode < 300 || statusCode >= 400) {
response.responseUrl = this._currentUrl;
response.redirects = this._redirects;
this.emit("response", response);
// Clean up
this._requestBodyBuffers = [];
return;
}
// The response is a redirect, so abort the current request
destroyRequest(this._currentRequest);
// Discard the remainder of the response to avoid waiting for data
response.destroy();
// RFC7231§6.4: A client SHOULD detect and intervene
// in cyclical redirections (i.e., "infinite" redirection loops).
if (++this._redirectCount > this._options.maxRedirects) {
throw new TooManyRedirectsError();
}
// Store the request headers if applicable
var requestHeaders;
var beforeRedirect = this._options.beforeRedirect;
if (beforeRedirect) {
requestHeaders = Object.assign({
// The Host header was set by nativeProtocol.request
Host: response.req.getHeader("host"),
}, this._options.headers);
}
// RFC7231§6.4: Automatic redirection needs to done with
// care for methods not known to be safe, […]
// RFC7231§6.4.23: For historical reasons, a user agent MAY change
// the request method from POST to GET for the subsequent request.
var method = this._options.method;
if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
// RFC7231§6.4.4: The 303 (See Other) status code indicates that
// the server is redirecting the user agent to a different resource […]
// A user agent can perform a retrieval request targeting that URI
// (a GET or HEAD request if using HTTP) […]
(statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
this._options.method = "GET";
// Drop a possible entity and headers related to it
this._requestBodyBuffers = [];
removeMatchingHeaders(/^content-/i, this._options.headers);
}
// Drop the Host header, as the redirect might lead to a different host
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
// If the redirect is relative, carry over the host of the last request
var currentUrlParts = parseUrl(this._currentUrl);
var currentHost = currentHostHeader || currentUrlParts.host;
var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
url.format(Object.assign(currentUrlParts, { host: currentHost }));
// Create the redirected request
var redirectUrl = resolveUrl(location, currentUrl);
debug("redirecting to", redirectUrl.href);
this._isRedirect = true;
spreadUrlObject(redirectUrl, this._options);
// Drop confidential headers when redirecting to a less secure protocol
// or to a different domain that is not a superdomain
if (redirectUrl.protocol !== currentUrlParts.protocol &&
redirectUrl.protocol !== "https:" ||
redirectUrl.host !== currentHost &&
!isSubdomain(redirectUrl.host, currentHost)) {
removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
}
// Evaluate the beforeRedirect callback
if (isFunction(beforeRedirect)) {
var responseDetails = {
headers: response.headers,
statusCode: statusCode,
};
var requestDetails = {
url: currentUrl,
method: method,
headers: requestHeaders,
};
beforeRedirect(this._options, responseDetails, requestDetails);
this._sanitizeOptions(this._options);
}
// Perform the redirected request
this._performRequest();
};
// Wraps the key/value object of protocols with redirect functionality
function wrap(protocols) {
// Default settings
var exports = {
maxRedirects: 21,
maxBodyLength: 10 * 1024 * 1024,
};
// Wrap each protocol
var nativeProtocols = {};
Object.keys(protocols).forEach(function (scheme) {
var protocol = scheme + ":";
var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
// Executes a request, following redirects
function request(input, options, callback) {
// Parse parameters, ensuring that input is an object
if (isURL(input)) {
input = spreadUrlObject(input);
}
else if (isString(input)) {
input = spreadUrlObject(parseUrl(input));
}
else {
callback = options;
options = validateUrl(input);
input = { protocol: protocol };
}
if (isFunction(options)) {
callback = options;
options = null;
}
// Set defaults
options = Object.assign({
maxRedirects: exports.maxRedirects,
maxBodyLength: exports.maxBodyLength,
}, input, options);
options.nativeProtocols = nativeProtocols;
if (!isString(options.host) && !isString(options.hostname)) {
options.hostname = "::1";
}
assert.equal(options.protocol, protocol, "protocol mismatch");
debug("options", options);
return new RedirectableRequest(options, callback);
}
// Executes a GET request, following redirects
function get(input, options, callback) {
var wrappedRequest = wrappedProtocol.request(input, options, callback);
wrappedRequest.end();
return wrappedRequest;
}
// Expose the properties on the wrapped protocol
Object.defineProperties(wrappedProtocol, {
request: { value: request, configurable: true, enumerable: true, writable: true },
get: { value: get, configurable: true, enumerable: true, writable: true },
});
});
return exports;
}
function noop() { /* empty */ }
function parseUrl(input) {
var parsed;
// istanbul ignore else
if (useNativeURL) {
parsed = new URL(input);
}
else {
// Ensure the URL is valid and absolute
parsed = validateUrl(url.parse(input));
if (!isString(parsed.protocol)) {
throw new InvalidUrlError({ input });
}
}
return parsed;
}
function resolveUrl(relative, base) {
// istanbul ignore next
return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative));
}
function validateUrl(input) {
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
throw new InvalidUrlError({ input: input.href || input });
}
if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
throw new InvalidUrlError({ input: input.href || input });
}
return input;
}
function spreadUrlObject(urlObject, target) {
var spread = target || {};
for (var key of preservedUrlFields) {
spread[key] = urlObject[key];
}
// Fix IPv6 hostname
if (spread.hostname.startsWith("[")) {
spread.hostname = spread.hostname.slice(1, -1);
}
// Ensure port is a number
if (spread.port !== "") {
spread.port = Number(spread.port);
}
// Concatenate path
spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
return spread;
}
function removeMatchingHeaders(regex, headers) {
var lastValue;
for (var header in headers) {
if (regex.test(header)) {
lastValue = headers[header];
delete headers[header];
}
}
return (lastValue === null || typeof lastValue === "undefined") ?
undefined : String(lastValue).trim();
}
function createErrorType(code, message, baseClass) {
// Create constructor
function CustomError(properties) {
// istanbul ignore else
if (isFunction(Error.captureStackTrace)) {
Error.captureStackTrace(this, this.constructor);
}
Object.assign(this, properties || {});
this.code = code;
this.message = this.cause ? message + ": " + this.cause.message : message;
}
// Attach constructor and set default properties
CustomError.prototype = new (baseClass || Error)();
Object.defineProperties(CustomError.prototype, {
constructor: {
value: CustomError,
enumerable: false,
},
name: {
value: "Error [" + code + "]",
enumerable: false,
},
});
return CustomError;
}
function destroyRequest(request, error) {
for (var event of events) {
request.removeListener(event, eventHandlers[event]);
}
request.on("error", noop);
request.destroy(error);
}
function isSubdomain(subdomain, domain) {
assert(isString(subdomain) && isString(domain));
var dot = subdomain.length - domain.length - 1;
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
}
function isString(value) {
return typeof value === "string" || value instanceof String;
}
function isFunction(value) {
return typeof value === "function";
}
function isBuffer(value) {
return typeof value === "object" && ("length" in value);
}
function isURL(value) {
return URL && value instanceof URL;
}
// Exports
module.exports = wrap({ http: http, https: https });
module.exports.wrap = wrap;
}, function(modId) {var map = {"http":1758268322109,"https":1758268322110,"./debug":1758268322111}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322109, function(require, module, exports) {
module.exports = require("./").http;
}, function(modId) { var map = {"./":1758268322108}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322110, function(require, module, exports) {
module.exports = require("./").https;
}, function(modId) { var map = {"./":1758268322108}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322111, function(require, module, exports) {
var debug;
module.exports = function () {
if (!debug) {
try {
/* eslint global-require: off */
debug = require("debug")("follow-redirects");
}
catch (error) { /* */ }
if (typeof debug !== "function") {
debug = function () { /* */ };
}
}
debug.apply(null, arguments);
};
}, function(modId) { var map = {"debug":1758268322111}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322108);
})()
//miniprogram-npm-outsideDeps=["url","stream","assert"]
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,520 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322112, function(require, module, exports) {
var CombinedStream = require('combined-stream');
var util = require('util');
var path = require('path');
var http = require('http');
var https = require('https');
var parseUrl = require('url').parse;
var fs = require('fs');
var Stream = require('stream').Stream;
var crypto = require('crypto');
var mime = require('mime-types');
var asynckit = require('asynckit');
var setToStringTag = require('es-set-tostringtag');
var hasOwn = require('hasown');
var populate = require('./populate.js');
/**
* Create readable "multipart/form-data" streams.
* Can be used to submit forms
* and file uploads to other web applications.
*
* @constructor
* @param {object} options - Properties to be added/overriden for FormData and CombinedStream
*/
function FormData(options) {
if (!(this instanceof FormData)) {
return new FormData(options);
}
this._overheadLength = 0;
this._valueLength = 0;
this._valuesToMeasure = [];
CombinedStream.call(this);
options = options || {}; // eslint-disable-line no-param-reassign
for (var option in options) { // eslint-disable-line no-restricted-syntax
this[option] = options[option];
}
}
// make it a Stream
util.inherits(FormData, CombinedStream);
FormData.LINE_BREAK = '\r\n';
FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
FormData.prototype.append = function (field, value, options) {
options = options || {}; // eslint-disable-line no-param-reassign
// allow filename as single option
if (typeof options === 'string') {
options = { filename: options }; // eslint-disable-line no-param-reassign
}
var append = CombinedStream.prototype.append.bind(this);
// all that streamy business can't handle numbers
if (typeof value === 'number' || value == null) {
value = String(value); // eslint-disable-line no-param-reassign
}
// https://github.com/felixge/node-form-data/issues/38
if (Array.isArray(value)) {
/*
* Please convert your array into string
* the way web server expects it
*/
this._error(new Error('Arrays are not supported.'));
return;
}
var header = this._multiPartHeader(field, value, options);
var footer = this._multiPartFooter();
append(header);
append(value);
append(footer);
// pass along options.knownLength
this._trackLength(header, value, options);
};
FormData.prototype._trackLength = function (header, value, options) {
var valueLength = 0;
/*
* used w/ getLengthSync(), when length is known.
* e.g. for streaming directly from a remote server,
* w/ a known file a size, and not wanting to wait for
* incoming file to finish to get its size.
*/
if (options.knownLength != null) {
valueLength += Number(options.knownLength);
} else if (Buffer.isBuffer(value)) {
valueLength = value.length;
} else if (typeof value === 'string') {
valueLength = Buffer.byteLength(value);
}
this._valueLength += valueLength;
// @check why add CRLF? does this account for custom/multiple CRLFs?
this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length;
// empty or either doesn't have path or not an http response or not a stream
if (!value || (!value.path && !(value.readable && hasOwn(value, 'httpVersion')) && !(value instanceof Stream))) {
return;
}
// no need to bother with the length
if (!options.knownLength) {
this._valuesToMeasure.push(value);
}
};
FormData.prototype._lengthRetriever = function (value, callback) {
if (hasOwn(value, 'fd')) {
// take read range into a account
// `end` = Infinity > read file till the end
//
// TODO: Looks like there is bug in Node fs.createReadStream
// it doesn't respect `end` options without `start` options
// Fix it when node fixes it.
// https://github.com/joyent/node/issues/7819
if (value.end != undefined && value.end != Infinity && value.start != undefined) {
// when end specified
// no need to calculate range
// inclusive, starts with 0
callback(null, value.end + 1 - (value.start ? value.start : 0)); // eslint-disable-line callback-return
// not that fast snoopy
} else {
// still need to fetch file size from fs
fs.stat(value.path, function (err, stat) {
if (err) {
callback(err);
return;
}
// update final size based on the range options
var fileSize = stat.size - (value.start ? value.start : 0);
callback(null, fileSize);
});
}
// or http response
} else if (hasOwn(value, 'httpVersion')) {
callback(null, Number(value.headers['content-length'])); // eslint-disable-line callback-return
// or request stream http://github.com/mikeal/request
} else if (hasOwn(value, 'httpModule')) {
// wait till response come back
value.on('response', function (response) {
value.pause();
callback(null, Number(response.headers['content-length']));
});
value.resume();
// something else
} else {
callback('Unknown stream'); // eslint-disable-line callback-return
}
};
FormData.prototype._multiPartHeader = function (field, value, options) {
/*
* custom header specified (as string)?
* it becomes responsible for boundary
* (e.g. to handle extra CRLFs on .NET servers)
*/
if (typeof options.header === 'string') {
return options.header;
}
var contentDisposition = this._getContentDisposition(value, options);
var contentType = this._getContentType(value, options);
var contents = '';
var headers = {
// add custom disposition as third element or keep it two elements if not
'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
// if no content type. allow it to be empty array
'Content-Type': [].concat(contentType || [])
};
// allow custom headers.
if (typeof options.header === 'object') {
populate(headers, options.header);
}
var header;
for (var prop in headers) { // eslint-disable-line no-restricted-syntax
if (hasOwn(headers, prop)) {
header = headers[prop];
// skip nullish headers.
if (header == null) {
continue; // eslint-disable-line no-restricted-syntax, no-continue
}
// convert all headers to arrays.
if (!Array.isArray(header)) {
header = [header];
}
// add non-empty headers.
if (header.length) {
contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
}
}
}
return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
};
FormData.prototype._getContentDisposition = function (value, options) { // eslint-disable-line consistent-return
var filename;
if (typeof options.filepath === 'string') {
// custom filepath for relative paths
filename = path.normalize(options.filepath).replace(/\\/g, '/');
} else if (options.filename || (value && (value.name || value.path))) {
/*
* custom filename take precedence
* formidable and the browser add a name property
* fs- and request- streams have path property
*/
filename = path.basename(options.filename || (value && (value.name || value.path)));
} else if (value && value.readable && hasOwn(value, 'httpVersion')) {
// or try http response
filename = path.basename(value.client._httpMessage.path || '');
}
if (filename) {
return 'filename="' + filename + '"';
}
};
FormData.prototype._getContentType = function (value, options) {
// use custom content-type above all
var contentType = options.contentType;
// or try `name` from formidable, browser
if (!contentType && value && value.name) {
contentType = mime.lookup(value.name);
}
// or try `path` from fs-, request- streams
if (!contentType && value && value.path) {
contentType = mime.lookup(value.path);
}
// or if it's http-reponse
if (!contentType && value && value.readable && hasOwn(value, 'httpVersion')) {
contentType = value.headers['content-type'];
}
// or guess it from the filepath or filename
if (!contentType && (options.filepath || options.filename)) {
contentType = mime.lookup(options.filepath || options.filename);
}
// fallback to the default content type if `value` is not simple value
if (!contentType && value && typeof value === 'object') {
contentType = FormData.DEFAULT_CONTENT_TYPE;
}
return contentType;
};
FormData.prototype._multiPartFooter = function () {
return function (next) {
var footer = FormData.LINE_BREAK;
var lastPart = this._streams.length === 0;
if (lastPart) {
footer += this._lastBoundary();
}
next(footer);
}.bind(this);
};
FormData.prototype._lastBoundary = function () {
return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
};
FormData.prototype.getHeaders = function (userHeaders) {
var header;
var formHeaders = {
'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
};
for (header in userHeaders) { // eslint-disable-line no-restricted-syntax
if (hasOwn(userHeaders, header)) {
formHeaders[header.toLowerCase()] = userHeaders[header];
}
}
return formHeaders;
};
FormData.prototype.setBoundary = function (boundary) {
if (typeof boundary !== 'string') {
throw new TypeError('FormData boundary must be a string');
}
this._boundary = boundary;
};
FormData.prototype.getBoundary = function () {
if (!this._boundary) {
this._generateBoundary();
}
return this._boundary;
};
FormData.prototype.getBuffer = function () {
var dataBuffer = new Buffer.alloc(0); // eslint-disable-line new-cap
var boundary = this.getBoundary();
// Create the form content. Add Line breaks to the end of data.
for (var i = 0, len = this._streams.length; i < len; i++) {
if (typeof this._streams[i] !== 'function') {
// Add content to the buffer.
if (Buffer.isBuffer(this._streams[i])) {
dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]);
} else {
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]);
}
// Add break after content.
if (typeof this._streams[i] !== 'string' || this._streams[i].substring(2, boundary.length + 2) !== boundary) {
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData.LINE_BREAK)]);
}
}
}
// Add the footer and return the Buffer object.
return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
};
FormData.prototype._generateBoundary = function () {
// This generates a 50 character boundary similar to those used by Firefox.
// They are optimized for boyer-moore parsing.
this._boundary = '--------------------------' + crypto.randomBytes(12).toString('hex');
};
// Note: getLengthSync DOESN'T calculate streams length
// As workaround one can calculate file size manually and add it as knownLength option
FormData.prototype.getLengthSync = function () {
var knownLength = this._overheadLength + this._valueLength;
// Don't get confused, there are 3 "internal" streams for each keyval pair so it basically checks if there is any value added to the form
if (this._streams.length) {
knownLength += this._lastBoundary().length;
}
// https://github.com/form-data/form-data/issues/40
if (!this.hasKnownLength()) {
/*
* Some async length retrievers are present
* therefore synchronous length calculation is false.
* Please use getLength(callback) to get proper length
*/
this._error(new Error('Cannot calculate proper length in synchronous way.'));
}
return knownLength;
};
// Public API to check if length of added values is known
// https://github.com/form-data/form-data/issues/196
// https://github.com/form-data/form-data/issues/262
FormData.prototype.hasKnownLength = function () {
var hasKnownLength = true;
if (this._valuesToMeasure.length) {
hasKnownLength = false;
}
return hasKnownLength;
};
FormData.prototype.getLength = function (cb) {
var knownLength = this._overheadLength + this._valueLength;
if (this._streams.length) {
knownLength += this._lastBoundary().length;
}
if (!this._valuesToMeasure.length) {
process.nextTick(cb.bind(this, null, knownLength));
return;
}
asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function (err, values) {
if (err) {
cb(err);
return;
}
values.forEach(function (length) {
knownLength += length;
});
cb(null, knownLength);
});
};
FormData.prototype.submit = function (params, cb) {
var request;
var options;
var defaults = { method: 'post' };
// parse provided url if it's string or treat it as options object
if (typeof params === 'string') {
params = parseUrl(params); // eslint-disable-line no-param-reassign
/* eslint sort-keys: 0 */
options = populate({
port: params.port,
path: params.pathname,
host: params.hostname,
protocol: params.protocol
}, defaults);
} else { // use custom params
options = populate(params, defaults);
// if no port provided use default one
if (!options.port) {
options.port = options.protocol === 'https:' ? 443 : 80;
}
}
// put that good code in getHeaders to some use
options.headers = this.getHeaders(params.headers);
// https if specified, fallback to http in any other case
if (options.protocol === 'https:') {
request = https.request(options);
} else {
request = http.request(options);
}
// get content length and fire away
this.getLength(function (err, length) {
if (err && err !== 'Unknown stream') {
this._error(err);
return;
}
// add content length
if (length) {
request.setHeader('Content-Length', length);
}
this.pipe(request);
if (cb) {
var onResponse;
var callback = function (error, responce) {
request.removeListener('error', callback);
request.removeListener('response', onResponse);
return cb.call(this, error, responce); // eslint-disable-line no-invalid-this
};
onResponse = callback.bind(this, null);
request.on('error', callback);
request.on('response', onResponse);
}
}.bind(this));
return request;
};
FormData.prototype._error = function (err) {
if (!this.error) {
this.error = err;
this.pause();
this.emit('error', err);
}
};
FormData.prototype.toString = function () {
return '[object FormData]';
};
setToStringTag(FormData, 'FormData');
// Public API
module.exports = FormData;
}, function(modId) {var map = {"./populate.js":1758268322113}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322113, function(require, module, exports) {
// populates missing values
module.exports = function (dst, src) {
Object.keys(src).forEach(function (prop) {
dst[prop] = dst[prop] || src[prop]; // eslint-disable-line no-param-reassign
});
return dst;
};
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322112);
})()
//miniprogram-npm-outsideDeps=["combined-stream","util","path","http","https","url","fs","stream","crypto","mime-types","asynckit","es-set-tostringtag","hasown"]
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,105 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322114, function(require, module, exports) {
var implementation = require('./implementation');
module.exports = Function.prototype.bind || implementation;
}, function(modId) {var map = {"./implementation":1758268322115}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322115, function(require, module, exports) {
/* eslint no-invalid-this: 1 */
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
var toStr = Object.prototype.toString;
var max = Math.max;
var funcType = '[object Function]';
var concatty = function concatty(a, b) {
var arr = [];
for (var i = 0; i < a.length; i += 1) {
arr[i] = a[i];
}
for (var j = 0; j < b.length; j += 1) {
arr[j + a.length] = b[j];
}
return arr;
};
var slicy = function slicy(arrLike, offset) {
var arr = [];
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
arr[j] = arrLike[i];
}
return arr;
};
var joiny = function (arr, joiner) {
var str = '';
for (var i = 0; i < arr.length; i += 1) {
str += arr[i];
if (i + 1 < arr.length) {
str += joiner;
}
}
return str;
};
module.exports = function bind(that) {
var target = this;
if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
throw new TypeError(ERROR_MESSAGE + target);
}
var args = slicy(arguments, 1);
var bound;
var binder = function () {
if (this instanceof bound) {
var result = target.apply(
this,
concatty(args, arguments)
);
if (Object(result) === result) {
return result;
}
return this;
}
return target.apply(
that,
concatty(args, arguments)
);
};
var boundLength = max(0, target.length - args.length);
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
boundArgs[i] = '$' + i;
}
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
if (target.prototype) {
var Empty = function Empty() {};
Empty.prototype = target.prototype;
bound.prototype = new Empty();
Empty.prototype = null;
}
return bound;
};
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322114);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["index.js","implementation.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;ACFA,ADGA;ACFA,ADGA;ACFA,ADGA;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n"]}

View File

@@ -1,391 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322116, function(require, module, exports) {
var undefined;
var $Object = require('es-object-atoms');
var $Error = require('es-errors');
var $EvalError = require('es-errors/eval');
var $RangeError = require('es-errors/range');
var $ReferenceError = require('es-errors/ref');
var $SyntaxError = require('es-errors/syntax');
var $TypeError = require('es-errors/type');
var $URIError = require('es-errors/uri');
var abs = require('math-intrinsics/abs');
var floor = require('math-intrinsics/floor');
var max = require('math-intrinsics/max');
var min = require('math-intrinsics/min');
var pow = require('math-intrinsics/pow');
var round = require('math-intrinsics/round');
var sign = require('math-intrinsics/sign');
var $Function = Function;
// eslint-disable-next-line consistent-return
var getEvalledConstructor = function (expressionSyntax) {
try {
return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
} catch (e) {}
};
var $gOPD = require('gopd');
var $defineProperty = require('es-define-property');
var throwTypeError = function () {
throw new $TypeError();
};
var ThrowTypeError = $gOPD
? (function () {
try {
// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
arguments.callee; // IE 8 does not throw here
return throwTypeError;
} catch (calleeThrows) {
try {
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
return $gOPD(arguments, 'callee').get;
} catch (gOPDthrows) {
return throwTypeError;
}
}
}())
: throwTypeError;
var hasSymbols = require('has-symbols')();
var getProto = require('get-proto');
var $ObjectGPO = require('get-proto/Object.getPrototypeOf');
var $ReflectGPO = require('get-proto/Reflect.getPrototypeOf');
var $apply = require('call-bind-apply-helpers/functionApply');
var $call = require('call-bind-apply-helpers/functionCall');
var needsEval = {};
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
var INTRINSICS = {
__proto__: null,
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
'%Array%': Array,
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
'%AsyncFromSyncIteratorPrototype%': undefined,
'%AsyncFunction%': needsEval,
'%AsyncGenerator%': needsEval,
'%AsyncGeneratorFunction%': needsEval,
'%AsyncIteratorPrototype%': needsEval,
'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
'%Boolean%': Boolean,
'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
'%Date%': Date,
'%decodeURI%': decodeURI,
'%decodeURIComponent%': decodeURIComponent,
'%encodeURI%': encodeURI,
'%encodeURIComponent%': encodeURIComponent,
'%Error%': $Error,
'%eval%': eval, // eslint-disable-line no-eval
'%EvalError%': $EvalError,
'%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array,
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
'%Function%': $Function,
'%GeneratorFunction%': needsEval,
'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
'%isFinite%': isFinite,
'%isNaN%': isNaN,
'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
'%JSON%': typeof JSON === 'object' ? JSON : undefined,
'%Map%': typeof Map === 'undefined' ? undefined : Map,
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
'%Math%': Math,
'%Number%': Number,
'%Object%': $Object,
'%Object.getOwnPropertyDescriptor%': $gOPD,
'%parseFloat%': parseFloat,
'%parseInt%': parseInt,
'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
'%RangeError%': $RangeError,
'%ReferenceError%': $ReferenceError,
'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
'%RegExp%': RegExp,
'%Set%': typeof Set === 'undefined' ? undefined : Set,
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
'%String%': String,
'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
'%Symbol%': hasSymbols ? Symbol : undefined,
'%SyntaxError%': $SyntaxError,
'%ThrowTypeError%': ThrowTypeError,
'%TypedArray%': TypedArray,
'%TypeError%': $TypeError,
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
'%URIError%': $URIError,
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
'%Function.prototype.call%': $call,
'%Function.prototype.apply%': $apply,
'%Object.defineProperty%': $defineProperty,
'%Object.getPrototypeOf%': $ObjectGPO,
'%Math.abs%': abs,
'%Math.floor%': floor,
'%Math.max%': max,
'%Math.min%': min,
'%Math.pow%': pow,
'%Math.round%': round,
'%Math.sign%': sign,
'%Reflect.getPrototypeOf%': $ReflectGPO
};
if (getProto) {
try {
null.error; // eslint-disable-line no-unused-expressions
} catch (e) {
// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
var errorProto = getProto(getProto(e));
INTRINSICS['%Error.prototype%'] = errorProto;
}
}
var doEval = function doEval(name) {
var value;
if (name === '%AsyncFunction%') {
value = getEvalledConstructor('async function () {}');
} else if (name === '%GeneratorFunction%') {
value = getEvalledConstructor('function* () {}');
} else if (name === '%AsyncGeneratorFunction%') {
value = getEvalledConstructor('async function* () {}');
} else if (name === '%AsyncGenerator%') {
var fn = doEval('%AsyncGeneratorFunction%');
if (fn) {
value = fn.prototype;
}
} else if (name === '%AsyncIteratorPrototype%') {
var gen = doEval('%AsyncGenerator%');
if (gen && getProto) {
value = getProto(gen.prototype);
}
}
INTRINSICS[name] = value;
return value;
};
var LEGACY_ALIASES = {
__proto__: null,
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
'%ArrayPrototype%': ['Array', 'prototype'],
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
'%ArrayProto_values%': ['Array', 'prototype', 'values'],
'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
'%BooleanPrototype%': ['Boolean', 'prototype'],
'%DataViewPrototype%': ['DataView', 'prototype'],
'%DatePrototype%': ['Date', 'prototype'],
'%ErrorPrototype%': ['Error', 'prototype'],
'%EvalErrorPrototype%': ['EvalError', 'prototype'],
'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
'%FunctionPrototype%': ['Function', 'prototype'],
'%Generator%': ['GeneratorFunction', 'prototype'],
'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
'%JSONParse%': ['JSON', 'parse'],
'%JSONStringify%': ['JSON', 'stringify'],
'%MapPrototype%': ['Map', 'prototype'],
'%NumberPrototype%': ['Number', 'prototype'],
'%ObjectPrototype%': ['Object', 'prototype'],
'%ObjProto_toString%': ['Object', 'prototype', 'toString'],
'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
'%PromisePrototype%': ['Promise', 'prototype'],
'%PromiseProto_then%': ['Promise', 'prototype', 'then'],
'%Promise_all%': ['Promise', 'all'],
'%Promise_reject%': ['Promise', 'reject'],
'%Promise_resolve%': ['Promise', 'resolve'],
'%RangeErrorPrototype%': ['RangeError', 'prototype'],
'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
'%RegExpPrototype%': ['RegExp', 'prototype'],
'%SetPrototype%': ['Set', 'prototype'],
'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
'%StringPrototype%': ['String', 'prototype'],
'%SymbolPrototype%': ['Symbol', 'prototype'],
'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
'%TypedArrayPrototype%': ['TypedArray', 'prototype'],
'%TypeErrorPrototype%': ['TypeError', 'prototype'],
'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
'%URIErrorPrototype%': ['URIError', 'prototype'],
'%WeakMapPrototype%': ['WeakMap', 'prototype'],
'%WeakSetPrototype%': ['WeakSet', 'prototype']
};
var bind = require('function-bind');
var hasOwn = require('hasown');
var $concat = bind.call($call, Array.prototype.concat);
var $spliceApply = bind.call($apply, Array.prototype.splice);
var $replace = bind.call($call, String.prototype.replace);
var $strSlice = bind.call($call, String.prototype.slice);
var $exec = bind.call($call, RegExp.prototype.exec);
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
var stringToPath = function stringToPath(string) {
var first = $strSlice(string, 0, 1);
var last = $strSlice(string, -1);
if (first === '%' && last !== '%') {
throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
} else if (last === '%' && first !== '%') {
throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
}
var result = [];
$replace(string, rePropName, function (match, number, quote, subString) {
result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
});
return result;
};
/* end adaptation */
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
var intrinsicName = name;
var alias;
if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
alias = LEGACY_ALIASES[intrinsicName];
intrinsicName = '%' + alias[0] + '%';
}
if (hasOwn(INTRINSICS, intrinsicName)) {
var value = INTRINSICS[intrinsicName];
if (value === needsEval) {
value = doEval(intrinsicName);
}
if (typeof value === 'undefined' && !allowMissing) {
throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
}
return {
alias: alias,
name: intrinsicName,
value: value
};
}
throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
};
module.exports = function GetIntrinsic(name, allowMissing) {
if (typeof name !== 'string' || name.length === 0) {
throw new $TypeError('intrinsic name must be a non-empty string');
}
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
throw new $TypeError('"allowMissing" argument must be a boolean');
}
if ($exec(/^%?[^%]*%?$/, name) === null) {
throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
}
var parts = stringToPath(name);
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
var intrinsicRealName = intrinsic.name;
var value = intrinsic.value;
var skipFurtherCaching = false;
var alias = intrinsic.alias;
if (alias) {
intrinsicBaseName = alias[0];
$spliceApply(parts, $concat([0, 1], alias));
}
for (var i = 1, isOwn = true; i < parts.length; i += 1) {
var part = parts[i];
var first = $strSlice(part, 0, 1);
var last = $strSlice(part, -1);
if (
(
(first === '"' || first === "'" || first === '`')
|| (last === '"' || last === "'" || last === '`')
)
&& first !== last
) {
throw new $SyntaxError('property names with quotes must have matching quotes');
}
if (part === 'constructor' || !isOwn) {
skipFurtherCaching = true;
}
intrinsicBaseName += '.' + part;
intrinsicRealName = '%' + intrinsicBaseName + '%';
if (hasOwn(INTRINSICS, intrinsicRealName)) {
value = INTRINSICS[intrinsicRealName];
} else if (value != null) {
if (!(part in value)) {
if (!allowMissing) {
throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
}
return void undefined;
}
if ($gOPD && (i + 1) >= parts.length) {
var desc = $gOPD(value, part);
isOwn = !!desc;
// By convention, when a data property is converted to an accessor
// property to emulate a data property that does not suffer from
// the override mistake, that accessor's getter is marked with
// an `originalValue` property. Here, when we detect this, we
// uphold the illusion by pretending to see that original data
// property, i.e., returning the value rather than the getter
// itself.
if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
value = desc.get;
} else {
value = value[part];
}
} else {
isOwn = hasOwn(value, part);
value = value[part];
}
if (isOwn && !skipFurtherCaching) {
INTRINSICS[intrinsicRealName] = value;
}
}
}
return value;
};
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322116);
})()
//miniprogram-npm-outsideDeps=["es-object-atoms","es-errors","es-errors/eval","es-errors/range","es-errors/ref","es-errors/syntax","es-errors/type","es-errors/uri","math-intrinsics/abs","math-intrinsics/floor","math-intrinsics/max","math-intrinsics/min","math-intrinsics/pow","math-intrinsics/round","math-intrinsics/sign","gopd","es-define-property","has-symbols","get-proto","get-proto/Object.getPrototypeOf","get-proto/Reflect.getPrototypeOf","call-bind-apply-helpers/functionApply","call-bind-apply-helpers/functionCall","function-bind","hasown"]
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,56 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322117, function(require, module, exports) {
var reflectGetProto = require('./Reflect.getPrototypeOf');
var originalGetProto = require('./Object.getPrototypeOf');
var getDunderProto = require('dunder-proto/get');
/** @type {import('.')} */
module.exports = reflectGetProto
? function getProto(O) {
// @ts-expect-error TS can't narrow inside a closure, for some reason
return reflectGetProto(O);
}
: originalGetProto
? function getProto(O) {
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
throw new TypeError('getProto: not an object');
}
// @ts-expect-error TS can't narrow inside a closure, for some reason
return originalGetProto(O);
}
: getDunderProto
? function getProto(O) {
// @ts-expect-error TS can't narrow inside a closure, for some reason
return getDunderProto(O);
}
: null;
}, function(modId) {var map = {"./Reflect.getPrototypeOf":1758268322118,"./Object.getPrototypeOf":1758268322119}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322118, function(require, module, exports) {
/** @type {import('./Reflect.getPrototypeOf')} */
module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322119, function(require, module, exports) {
var $Object = require('es-object-atoms');
/** @type {import('./Object.getPrototypeOf')} */
module.exports = $Object.getPrototypeOf || null;
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322117);
})()
//miniprogram-npm-outsideDeps=["dunder-proto/get","es-object-atoms"]
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["index.js","Reflect.getPrototypeOf.js","Object.getPrototypeOf.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;ACFA,ADGA;ACFA,ADGA;ACFA,ADGA;AELA,ADGA,ADGA;AELA,ADGA,ADGA;AELA,AFMA;AELA,AFMA;AELA,AFMA;AELA,AFMA;AELA,AFMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["\n\nvar reflectGetProto = require('./Reflect.getPrototypeOf');\nvar originalGetProto = require('./Object.getPrototypeOf');\n\nvar getDunderProto = require('dunder-proto/get');\n\n/** @type {import('.')} */\nmodule.exports = reflectGetProto\n\t? function getProto(O) {\n\t\t// @ts-expect-error TS can't narrow inside a closure, for some reason\n\t\treturn reflectGetProto(O);\n\t}\n\t: originalGetProto\n\t\t? function getProto(O) {\n\t\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\t\tthrow new TypeError('getProto: not an object');\n\t\t\t}\n\t\t\t// @ts-expect-error TS can't narrow inside a closure, for some reason\n\t\t\treturn originalGetProto(O);\n\t\t}\n\t\t: getDunderProto\n\t\t\t? function getProto(O) {\n\t\t\t\t// @ts-expect-error TS can't narrow inside a closure, for some reason\n\t\t\t\treturn getDunderProto(O);\n\t\t\t}\n\t\t\t: null;\n","\n\n/** @type {import('./Reflect.getPrototypeOf')} */\nmodule.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;\n","\n\nvar $Object = require('es-object-atoms');\n\n/** @type {import('./Object.getPrototypeOf')} */\nmodule.exports = $Object.getPrototypeOf || null;\n"]}

View File

@@ -1,35 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322120, function(require, module, exports) {
/** @type {import('.')} */
var $gOPD = require('./gOPD');
if ($gOPD) {
try {
$gOPD([], 'length');
} catch (e) {
// IE 8 has a broken gOPD
$gOPD = null;
}
}
module.exports = $gOPD;
}, function(modId) {var map = {"./gOPD":1758268322121}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322121, function(require, module, exports) {
/** @type {import('./gOPD')} */
module.exports = Object.getOwnPropertyDescriptor;
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322120);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["index.js","gOPD.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;ACFA,ADGA;ACFA,ADGA;ACFA,ADGA;ACFA,ADGA;ACFA,ADGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["\n\n/** @type {import('.')} */\nvar $gOPD = require('./gOPD');\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","\n\n/** @type {import('./gOPD')} */\nmodule.exports = Object.getOwnPropertyDescriptor;\n"]}

View File

@@ -1,75 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322122, function(require, module, exports) {
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
var hasSymbolSham = require('./shams');
/** @type {import('.')} */
module.exports = function hasNativeSymbols() {
if (typeof origSymbol !== 'function') { return false; }
if (typeof Symbol !== 'function') { return false; }
if (typeof origSymbol('foo') !== 'symbol') { return false; }
if (typeof Symbol('bar') !== 'symbol') { return false; }
return hasSymbolSham();
};
}, function(modId) {var map = {"./shams":1758268322123}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1758268322123, function(require, module, exports) {
/** @type {import('./shams')} */
/* eslint complexity: [2, 18], max-statements: [2, 33] */
module.exports = function hasSymbols() {
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
if (typeof Symbol.iterator === 'symbol') { return true; }
/** @type {{ [k in symbol]?: unknown }} */
var obj = {};
var sym = Symbol('test');
var symObj = Object(sym);
if (typeof sym === 'string') { return false; }
if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
// temp disabled per https://github.com/ljharb/object.assign/issues/17
// if (sym instanceof Symbol) { return false; }
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
// if (!(symObj instanceof Symbol)) { return false; }
// if (typeof Symbol.prototype.toString !== 'function') { return false; }
// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
var symVal = 42;
obj[sym] = symVal;
for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
var syms = Object.getOwnPropertySymbols(obj);
if (syms.length !== 1 || syms[0] !== sym) { return false; }
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
if (typeof Object.getOwnPropertyDescriptor === 'function') {
// eslint-disable-next-line no-extra-parens
var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));
if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
}
return true;
};
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322122);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["index.js","shams.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\n/** @type {import('.')} */\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","\n\n/** @type {import('./shams')} */\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\t/** @type {{ [k in symbol]?: unknown }} */\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\t// eslint-disable-next-line no-extra-parens\n\t\tvar descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n"]}

View File

@@ -1,21 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322124, function(require, module, exports) {
var hasSymbols = require('has-symbols');
/** @type {import('.')} */
module.exports = function hasToStringTag() {
return hasSymbols() && typeof Symbol.toStringTag === 'symbol';
};
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322124);
})()
//miniprogram-npm-outsideDeps=["has-symbols"]
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["\n\nvar hasSymbols = require('has-symbols');\n\n/** @type {import('.')} */\nmodule.exports = function hasToStringTag() {\n\treturn hasSymbols() && typeof Symbol.toStringTag === 'symbol';\n};\n"]}

View File

@@ -1,21 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322125, function(require, module, exports) {
var call = Function.prototype.call;
var $hasOwn = Object.prototype.hasOwnProperty;
var bind = require('function-bind');
/** @type {import('.')} */
module.exports = bind.call(call, $hasOwn);
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322125);
})()
//miniprogram-npm-outsideDeps=["function-bind"]
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.hasOwnProperty;\nvar bind = require('function-bind');\n\n/** @type {import('.')} */\nmodule.exports = bind.call(call, $hasOwn);\n"]}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,201 +0,0 @@
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1758268322128, function(require, module, exports) {
/*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
/**
* Module dependencies.
* @private
*/
var db = require('mime-db')
var extname = require('path').extname
/**
* Module variables.
* @private
*/
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/
var TEXT_TYPE_REGEXP = /^text\//i
/**
* Module exports.
* @public
*/
exports.charset = charset
exports.charsets = { lookup: charset }
exports.contentType = contentType
exports.extension = extension
exports.extensions = Object.create(null)
exports.lookup = lookup
exports.types = Object.create(null)
// Populate the extensions/types maps
populateMaps(exports.extensions, exports.types)
/**
* Get the default charset for a MIME type.
*
* @param {string} type
* @return {boolean|string}
*/
function charset (type) {
if (!type || typeof type !== 'string') {
return false
}
// TODO: use media-typer
var match = EXTRACT_TYPE_REGEXP.exec(type)
var mime = match && db[match[1].toLowerCase()]
if (mime && mime.charset) {
return mime.charset
}
// default text/* to utf-8
if (match && TEXT_TYPE_REGEXP.test(match[1])) {
return 'UTF-8'
}
return false
}
/**
* Create a full Content-Type header given a MIME type or extension.
*
* @param {string} str
* @return {boolean|string}
*/
function contentType (str) {
// TODO: should this even be in this module?
if (!str || typeof str !== 'string') {
return false
}
var mime = str.indexOf('/') === -1
? exports.lookup(str)
: str
if (!mime) {
return false
}
// TODO: use content-type or other module
if (mime.indexOf('charset') === -1) {
var charset = exports.charset(mime)
if (charset) mime += '; charset=' + charset.toLowerCase()
}
return mime
}
/**
* Get the default extension for a MIME type.
*
* @param {string} type
* @return {boolean|string}
*/
function extension (type) {
if (!type || typeof type !== 'string') {
return false
}
// TODO: use media-typer
var match = EXTRACT_TYPE_REGEXP.exec(type)
// get extensions
var exts = match && exports.extensions[match[1].toLowerCase()]
if (!exts || !exts.length) {
return false
}
return exts[0]
}
/**
* Lookup the MIME type for a file path/extension.
*
* @param {string} path
* @return {boolean|string}
*/
function lookup (path) {
if (!path || typeof path !== 'string') {
return false
}
// get the extension ("ext" or ".ext" or full path)
var extension = extname('x.' + path)
.toLowerCase()
.substr(1)
if (!extension) {
return false
}
return exports.types[extension] || false
}
/**
* Populate the extensions and types maps.
* @private
*/
function populateMaps (extensions, types) {
// source preference (least -> most)
var preference = ['nginx', 'apache', undefined, 'iana']
Object.keys(db).forEach(function forEachMimeType (type) {
var mime = db[type]
var exts = mime.extensions
if (!exts || !exts.length) {
return
}
// mime -> extensions
extensions[type] = exts
// extension -> mime
for (var i = 0; i < exts.length; i++) {
var extension = exts[i]
if (types[extension]) {
var from = preference.indexOf(db[types[extension]].source)
var to = preference.indexOf(mime.source)
if (types[extension] !== 'application/octet-stream' &&
(from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {
// skip the remapping
continue
}
}
// set the extension -> mime
types[extension] = type
}
})
}
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1758268322128);
})()
//miniprogram-npm-outsideDeps=["mime-db","path"]
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["/*!\n * mime-types\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar db = require('mime-db')\nvar extname = require('path').extname\n\n/**\n * Module variables.\n * @private\n */\n\nvar EXTRACT_TYPE_REGEXP = /^\\s*([^;\\s]*)(?:;|\\s|$)/\nvar TEXT_TYPE_REGEXP = /^text\\//i\n\n/**\n * Module exports.\n * @public\n */\n\nexports.charset = charset\nexports.charsets = { lookup: charset }\nexports.contentType = contentType\nexports.extension = extension\nexports.extensions = Object.create(null)\nexports.lookup = lookup\nexports.types = Object.create(null)\n\n// Populate the extensions/types maps\npopulateMaps(exports.extensions, exports.types)\n\n/**\n * Get the default charset for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction charset (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n var mime = match && db[match[1].toLowerCase()]\n\n if (mime && mime.charset) {\n return mime.charset\n }\n\n // default text/* to utf-8\n if (match && TEXT_TYPE_REGEXP.test(match[1])) {\n return 'UTF-8'\n }\n\n return false\n}\n\n/**\n * Create a full Content-Type header given a MIME type or extension.\n *\n * @param {string} str\n * @return {boolean|string}\n */\n\nfunction contentType (str) {\n // TODO: should this even be in this module?\n if (!str || typeof str !== 'string') {\n return false\n }\n\n var mime = str.indexOf('/') === -1\n ? exports.lookup(str)\n : str\n\n if (!mime) {\n return false\n }\n\n // TODO: use content-type or other module\n if (mime.indexOf('charset') === -1) {\n var charset = exports.charset(mime)\n if (charset) mime += '; charset=' + charset.toLowerCase()\n }\n\n return mime\n}\n\n/**\n * Get the default extension for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction extension (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n\n // get extensions\n var exts = match && exports.extensions[match[1].toLowerCase()]\n\n if (!exts || !exts.length) {\n return false\n }\n\n return exts[0]\n}\n\n/**\n * Lookup the MIME type for a file path/extension.\n *\n * @param {string} path\n * @return {boolean|string}\n */\n\nfunction lookup (path) {\n if (!path || typeof path !== 'string') {\n return false\n }\n\n // get the extension (\"ext\" or \".ext\" or full path)\n var extension = extname('x.' + path)\n .toLowerCase()\n .substr(1)\n\n if (!extension) {\n return false\n }\n\n return exports.types[extension] || false\n}\n\n/**\n * Populate the extensions and types maps.\n * @private\n */\n\nfunction populateMaps (extensions, types) {\n // source preference (least -> most)\n var preference = ['nginx', 'apache', undefined, 'iana']\n\n Object.keys(db).forEach(function forEachMimeType (type) {\n var mime = db[type]\n var exts = mime.extensions\n\n if (!exts || !exts.length) {\n return\n }\n\n // mime -> extensions\n extensions[type] = exts\n\n // extension -> mime\n for (var i = 0; i < exts.length; i++) {\n var extension = exts[i]\n\n if (types[extension]) {\n var from = preference.indexOf(db[types[extension]].source)\n var to = preference.indexOf(mime.source)\n\n if (types[extension] !== 'application/octet-stream' &&\n (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {\n // skip the remapping\n continue\n }\n }\n\n // set the extension -> mime\n types[extension] = type\n }\n })\n}\n"]}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -1,43 +1,19 @@
{
"name": "government-mini-program",
"version": "1.0.0",
"description": "政府端微信小程序 - 基于Vue.js和Node.js 16.20.2",
"main": "main.js",
"description": "政府端微信小程序",
"main": "app.js",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"dev:h5": "vue-cli-service serve --mode development",
"build:h5": "vue-cli-service build --mode production",
"dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch",
"build:mp-weixin": "cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build"
"dev": "微信开发者工具",
"build": "微信开发者工具构建"
},
"dependencies": {
"@dcloudio/uni-app": "^2.0.2-alpha-4080120250905001",
"@vue/composition-api": "^1.4.0",
"axios": "^0.27.2",
"dayjs": "^1.11.0",
"vue": "^2.6.14",
"vue-router": "^3.6.5",
"vuex": "^3.6.2"
},
"devDependencies": {
"@dcloudio/uni-cli-i18n": "^2.0.2-4070620250821001",
"@dcloudio/uni-cli-shared": "^2.0.2-alpha-4080120250905001",
"@dcloudio/uni-h5": "^2.0.2-alpha-4080120250905001",
"@dcloudio/uni-mp-weixin": "^2.0.2-alpha-4080120250905001",
"@dcloudio/vue-cli-plugin-uni": "^2.0.2-4070620250821001",
"@vant/weapp": "^1.11.7",
"@vue/cli-service": "^5.0.8",
"cross-env": "^7.0.3",
"eslint": "^8.45.0",
"eslint-plugin-vue": "^9.15.0",
"sass": "^1.92.1",
"sass-loader": "^16.0.5",
"typescript": "^5.1.0",
"vue-template-compiler": "^2.6.14"
},
"engines": {
"node": "16.20.2",
"npm": ">=8.0.0"
}
}
"keywords": [
"微信小程序",
"政府管理",
"养殖户管理"
],
"author": "政府管理系统开发团队",
"license": "MIT",
"dependencies": {},
"devDependencies": {}
}

View File

@@ -1,145 +0,0 @@
{
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "政府管理",
"enablePullDownRefresh": true,
"backgroundColor": "#f6f6f6"
}
},
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录",
"navigationStyle": "custom",
"disableScroll": true
}
},
{
"path": "pages/dashboard/dashboard",
"style": {
"navigationBarTitleText": "数据看板",
"enablePullDownRefresh": true,
"backgroundColor": "#f6f6f6"
}
},
{
"path": "pages/supervision/supervision",
"style": {
"navigationBarTitleText": "监管管理",
"enablePullDownRefresh": true,
"backgroundColor": "#f6f6f6"
}
},
{
"path": "pages/approval/approval",
"style": {
"navigationBarTitleText": "审批管理",
"enablePullDownRefresh": true,
"backgroundColor": "#f6f6f6"
}
},
{
"path": "pages/personnel/personnel",
"style": {
"navigationBarTitleText": "人员管理",
"enablePullDownRefresh": true,
"backgroundColor": "#f6f6f6"
}
},
{
"path": "pages/epidemic/epidemic",
"style": {
"navigationBarTitleText": "疫情监控",
"enablePullDownRefresh": true,
"backgroundColor": "#f6f6f6"
}
},
{
"path": "pages/service/service",
"style": {
"navigationBarTitleText": "服务管理",
"enablePullDownRefresh": true,
"backgroundColor": "#f6f6f6"
}
},
{
"path": "pages/warehouse/warehouse",
"style": {
"navigationBarTitleText": "仓库管理",
"enablePullDownRefresh": true,
"backgroundColor": "#f6f6f6"
}
},
{
"path": "pages/profile/profile",
"style": {
"navigationBarTitleText": "个人中心",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
}
],
"tabBar": {
"color": "#7A7E83",
"selectedColor": "#1890ff",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/index/index",
"iconPath": "static/tabbar/home.png",
"selectedIconPath": "static/tabbar/home-active.png",
"text": "首页"
},
{
"pagePath": "pages/dashboard/dashboard",
"iconPath": "static/tabbar/dashboard.png",
"selectedIconPath": "static/tabbar/dashboard-active.png",
"text": "看板"
},
{
"pagePath": "pages/supervision/supervision",
"iconPath": "static/tabbar/supervision.png",
"selectedIconPath": "static/tabbar/supervision-active.png",
"text": "监管"
},
{
"pagePath": "pages/profile/profile",
"iconPath": "static/tabbar/profile.png",
"selectedIconPath": "static/tabbar/profile-active.png",
"text": "我的"
}
]
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "政府管理系统",
"navigationBarBackgroundColor": "#ffffff",
"backgroundColor": "#f6f6f6",
"app-plus": {
"background": "#efeff4"
}
},
"easycom": {
"autoscan": true,
"custom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue",
"^van-(.*)": "@vant/weapp/dist/$1/index"
}
},
"condition": {
"current": 0,
"list": [
{
"name": "数据看板",
"path": "pages/dashboard/dashboard"
},
{
"name": "监管管理",
"path": "pages/supervision/supervision"
}
]
}
}

View File

@@ -1,42 +0,0 @@
// pages/approval/approval.js
Page({
data: {
searchKeyword: '',
loading: false,
approvalList: []
},
onLoad() {
this.loadApprovalData()
},
loadApprovalData() {
// 模拟数据
this.setData({
approvalList: [
{
id: 1,
title: '养殖许可证申请',
description: '张三申请养殖许可证',
applicant: '张三',
createTime: '2024-01-15 09:00',
status: 'pending',
statusText: '待审批'
}
]
})
},
onSearchInput(e) {
this.setData({
searchKeyword: e.detail.value
})
},
handleAdd() {
wx.showToast({
title: '新增功能待实现',
icon: 'none'
})
}
})

View File

@@ -1,3 +0,0 @@
{
"usingComponents": {}
}

View File

@@ -1,58 +0,0 @@
<!--pages/approval/approval.wxml-->
<view class="approval-container">
<!-- 搜索栏 -->
<view class="search-section">
<view class="search-bar">
<input
value="{{searchKeyword}}"
type="text"
placeholder="搜索审批记录..."
class="search-input"
bindinput="onSearchInput"
/>
<view class="search-icon">🔍</view>
</view>
</view>
<!-- 审批列表 -->
<view class="approval-list">
<view class="list-header">
<view class="list-title">审批管理</view>
<view class="add-btn" bindtap="handleAdd">
<text class="add-text">新增</text>
<view class="add-icon">+</view>
</view>
</view>
<view wx:if="{{loading}}" class="loading">
<text class="loading-text">加载中...</text>
</view>
<view wx:elif="{{approvalList.length === 0}}" class="empty">
<view class="empty-icon">📋</view>
<view class="empty-text">暂无审批记录</view>
</view>
<view wx:else class="list-content">
<view
wx:for="{{approvalList}}"
wx:key="id"
class="approval-item"
>
<view class="item-header">
<view class="item-title">{{item.title}}</view>
<view class="item-status {{item.status}}">
{{item.statusText}}
</view>
</view>
<view class="item-content">
<view class="item-desc">{{item.description}}</view>
<view class="item-meta">
<view class="item-applicant">申请人: {{item.applicant}}</view>
<view class="item-time">{{item.createTime}}</view>
</view>
</view>
</view>
</view>
</view>
</view>

View File

@@ -1,159 +0,0 @@
/* pages/approval/approval.wxss */
.approval-container {
min-height: 100vh;
background: #f6f6f6;
}
.search-section {
padding: 20rpx;
background: #fff;
margin-bottom: 20rpx;
}
.search-bar {
position: relative;
}
.search-input {
width: 100%;
height: 72rpx;
background: #f8f9fa;
border: none;
border-radius: 36rpx;
padding: 0 60rpx 0 30rpx;
font-size: 28rpx;
color: #333;
}
.search-icon {
position: absolute;
right: 30rpx;
top: 50%;
transform: translateY(-50%);
font-size: 28rpx;
color: #999;
}
.approval-list {
background: #fff;
margin: 0 20rpx;
border-radius: 16rpx;
overflow: hidden;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
}
.list-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.list-title {
font-size: 32rpx;
font-weight: 600;
color: #333;
}
.add-btn {
display: flex;
align-items: center;
padding: 16rpx 24rpx;
background: #1890ff;
border-radius: 24rpx;
color: #fff;
}
.add-text {
font-size: 24rpx;
margin-right: 8rpx;
}
.add-icon {
font-size: 24rpx;
font-weight: 600;
}
.loading,
.empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 80rpx;
color: #999;
}
.loading-text,
.empty-text {
font-size: 28rpx;
}
.empty-icon {
font-size: 80rpx;
margin-bottom: 20rpx;
}
.list-content {
space-y: 0;
}
.approval-item {
padding: 30rpx;
border-bottom: 1rpx solid #f0f0f0;
transition: background 0.3s;
}
.approval-item:last-child {
border-bottom: none;
}
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
}
.item-title {
font-size: 30rpx;
font-weight: 600;
color: #333;
flex: 1;
}
.item-status {
font-size: 20rpx;
padding: 8rpx 16rpx;
border-radius: 20rpx;
font-weight: 500;
}
.item-status.pending {
background: #fff7e6;
color: #faad14;
}
.item-content {
margin-bottom: 20rpx;
}
.item-desc {
font-size: 26rpx;
color: #666;
margin-bottom: 12rpx;
line-height: 1.5;
}
.item-meta {
display: flex;
justify-content: space-between;
align-items: center;
}
.item-applicant,
.item-time {
font-size: 22rpx;
color: #999;
}

View File

@@ -1,137 +0,0 @@
// pages/dashboard/dashboard.js
const dashboardService = require('../../services/dashboardService.js')
Page({
data: {
overviewCards: [
{
key: 'supervision',
icon: '🔍',
label: '监管记录',
value: '0',
trend: 'up',
trendText: '+0%',
type: 'primary'
},
{
key: 'approval',
icon: '✅',
label: '待审批',
value: '0',
trend: 'up',
trendText: '+0%',
type: 'success'
},
{
key: 'personnel',
icon: '👥',
label: '人员总数',
value: '0',
trend: 'up',
trendText: '+0%',
type: 'warning'
},
{
key: 'epidemic',
icon: '🦠',
label: '疫情预警',
value: '0',
trend: 'down',
trendText: '-0%',
type: 'danger'
}
],
supervisionStats: [
{ key: 'total', name: '总监管数', desc: '累计监管记录', value: '0' },
{ key: 'today', name: '今日监管', desc: '今日新增记录', value: '0' },
{ key: 'pending', name: '待处理', desc: '待处理事项', value: '0' },
{ key: 'completed', name: '已完成', desc: '已完成事项', value: '0' }
],
recentActivities: [
{
id: 1,
icon: '🔍',
title: '监管检查',
desc: '完成养殖场A的例行检查',
time: '2小时前',
status: 'success',
statusText: '已完成'
},
{
id: 2,
icon: '✅',
title: '审批通过',
desc: '通过养殖许可证申请',
time: '4小时前',
status: 'success',
statusText: '已通过'
},
{
id: 3,
icon: '⏳',
title: '待审批',
desc: '养殖场B的扩建申请',
time: '6小时前',
status: 'pending',
statusText: '待处理'
}
]
},
onLoad() {
this.loadDashboardData()
},
onPullDownRefresh() {
this.loadDashboardData()
setTimeout(() => {
wx.stopPullDownRefresh()
}, 1000)
},
async loadDashboardData() {
try {
// 加载统计数据
const [stats, supervisionStats] = await Promise.all([
dashboardService.getStats(),
dashboardService.getSupervisionStats()
])
if (stats) {
this.updateOverviewCards(stats)
}
if (supervisionStats) {
this.updateSupervisionStats(supervisionStats)
}
} catch (error) {
console.error('加载看板数据失败:', error)
wx.showToast({
title: '加载数据失败',
icon: 'error'
})
}
},
updateOverviewCards(data) {
const overviewCards = this.data.overviewCards.map(card => {
const newValue = data[card.key] || card.value
return {
...card,
value: newValue
}
})
this.setData({ overviewCards })
},
updateSupervisionStats(data) {
const supervisionStats = this.data.supervisionStats.map(stat => {
const newValue = data[stat.key] || stat.value
return {
...stat,
value: newValue
}
})
this.setData({ supervisionStats })
}
})

View File

@@ -1,3 +0,0 @@
{
"usingComponents": {}
}

View File

@@ -1,71 +0,0 @@
<!--pages/dashboard/dashboard.wxml-->
<view class="dashboard-container">
<!-- 数据概览卡片 -->
<view class="overview-cards">
<view
wx:for="{{overviewCards}}"
wx:key="key"
class="overview-card {{item.type}}"
>
<view class="card-icon">{{item.icon}}</view>
<view class="card-content">
<view class="card-value">{{item.value}}</view>
<view class="card-label">{{item.label}}</view>
<view class="card-trend {{item.trend}}">
{{item.trendText}}
</view>
</view>
</view>
</view>
<!-- 图表区域 -->
<view class="charts-section">
<view class="section-title">数据图表</view>
<view class="chart-container">
<view class="chart-placeholder">
<view class="chart-icon">📊</view>
<view class="chart-text">图表数据加载中...</view>
</view>
</view>
</view>
<!-- 监管统计 -->
<view class="supervision-stats">
<view class="section-title">监管统计</view>
<view class="stats-list">
<view
wx:for="{{supervisionStats}}"
wx:key="key"
class="stat-item"
>
<view class="stat-info">
<view class="stat-name">{{item.name}}</view>
<view class="stat-desc">{{item.desc}}</view>
</view>
<view class="stat-value">{{item.value}}</view>
</view>
</view>
</view>
<!-- 最近活动 -->
<view class="recent-activities">
<view class="section-title">最近活动</view>
<view class="activity-list">
<view
wx:for="{{recentActivities}}"
wx:key="id"
class="activity-item"
>
<view class="activity-icon">{{item.icon}}</view>
<view class="activity-content">
<view class="activity-title">{{item.title}}</view>
<view class="activity-desc">{{item.desc}}</view>
<view class="activity-time">{{item.time}}</view>
</view>
<view class="activity-status {{item.status}}">
{{item.statusText}}
</view>
</view>
</view>
</view>
</view>

View File

@@ -1,210 +0,0 @@
/* pages/dashboard/dashboard.wxss */
.dashboard-container {
min-height: 100vh;
background: #f6f6f6;
padding: 20rpx;
}
.overview-cards {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20rpx;
margin-bottom: 30rpx;
}
.overview-card {
background: #fff;
border-radius: 16rpx;
padding: 30rpx;
display: flex;
align-items: center;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
}
.overview-card.primary {
border-left: 8rpx solid #1890ff;
}
.overview-card.success {
border-left: 8rpx solid #52c41a;
}
.overview-card.warning {
border-left: 8rpx solid #faad14;
}
.overview-card.danger {
border-left: 8rpx solid #ff4d4f;
}
.card-icon {
font-size: 48rpx;
margin-right: 20rpx;
}
.card-content {
flex: 1;
}
.card-value {
font-size: 36rpx;
font-weight: 600;
color: #333;
margin-bottom: 8rpx;
}
.card-label {
font-size: 24rpx;
color: #666;
margin-bottom: 8rpx;
}
.card-trend {
font-size: 20rpx;
font-weight: 500;
}
.card-trend.up {
color: #52c41a;
}
.card-trend.down {
color: #ff4d4f;
}
.charts-section,
.supervision-stats,
.recent-activities {
background: #fff;
border-radius: 16rpx;
padding: 30rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
}
.section-title {
font-size: 32rpx;
font-weight: 600;
color: #333;
margin-bottom: 30rpx;
}
.chart-container {
height: 400rpx;
background: #f8f9fa;
border-radius: 12rpx;
display: flex;
align-items: center;
justify-content: center;
}
.chart-placeholder {
text-align: center;
}
.chart-icon {
font-size: 80rpx;
margin-bottom: 20rpx;
}
.chart-text {
font-size: 28rpx;
color: #999;
}
.stats-list {
space-y: 20rpx;
}
.stat-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 0;
border-bottom: 1rpx solid #f0f0f0;
}
.stat-item:last-child {
border-bottom: none;
}
.stat-info {
flex: 1;
}
.stat-name {
font-size: 28rpx;
color: #333;
margin-bottom: 8rpx;
}
.stat-desc {
font-size: 24rpx;
color: #999;
}
.stat-value {
font-size: 32rpx;
font-weight: 600;
color: #1890ff;
}
.activity-list {
space-y: 20rpx;
}
.activity-item {
display: flex;
align-items: center;
padding: 20rpx 0;
border-bottom: 1rpx solid #f0f0f0;
}
.activity-item:last-child {
border-bottom: none;
}
.activity-icon {
font-size: 32rpx;
margin-right: 20rpx;
width: 60rpx;
text-align: center;
}
.activity-content {
flex: 1;
}
.activity-title {
font-size: 28rpx;
color: #333;
margin-bottom: 8rpx;
}
.activity-desc {
font-size: 24rpx;
color: #666;
margin-bottom: 8rpx;
}
.activity-time {
font-size: 20rpx;
color: #999;
}
.activity-status {
font-size: 20rpx;
padding: 8rpx 16rpx;
border-radius: 20rpx;
font-weight: 500;
}
.activity-status.success {
background: #f6ffed;
color: #52c41a;
}
.activity-status.pending {
background: #fff7e6;
color: #faad14;
}

View File

@@ -1,42 +0,0 @@
// pages/epidemic/epidemic.js
Page({
data: {
searchKeyword: '',
loading: false,
epidemicList: []
},
onLoad() {
this.loadEpidemicData()
},
loadEpidemicData() {
// 模拟数据
this.setData({
epidemicList: [
{
id: 1,
title: '疫情预警',
description: '发现疑似疫情情况',
location: '宁夏银川市',
level: 'high',
levelText: '高风险',
createTime: '2024-01-15 14:30'
}
]
})
},
onSearchInput(e) {
this.setData({
searchKeyword: e.detail.value
})
},
handleAdd() {
wx.showToast({
title: '新增功能待实现',
icon: 'none'
})
}
})

View File

@@ -1,3 +0,0 @@
{
"usingComponents": {}
}

View File

@@ -1,58 +0,0 @@
<!--pages/epidemic/epidemic.wxml-->
<view class="epidemic-container">
<!-- 搜索栏 -->
<view class="search-section">
<view class="search-bar">
<input
value="{{searchKeyword}}"
type="text"
placeholder="搜索疫情记录..."
class="search-input"
bindinput="onSearchInput"
/>
<view class="search-icon">🔍</view>
</view>
</view>
<!-- 疫情列表 -->
<view class="epidemic-list">
<view class="list-header">
<view class="list-title">疫情监控</view>
<view class="add-btn" bindtap="handleAdd">
<text class="add-text">新增</text>
<view class="add-icon">+</view>
</view>
</view>
<view wx:if="{{loading}}" class="loading">
<text class="loading-text">加载中...</text>
</view>
<view wx:elif="{{epidemicList.length === 0}}" class="empty">
<view class="empty-icon">🦠</view>
<view class="empty-text">暂无疫情记录</view>
</view>
<view wx:else class="list-content">
<view
wx:for="{{epidemicList}}"
wx:key="id"
class="epidemic-item"
>
<view class="item-header">
<view class="item-title">{{item.title}}</view>
<view class="item-level {{item.level}}">
{{item.levelText}}
</view>
</view>
<view class="item-content">
<view class="item-desc">{{item.description}}</view>
<view class="item-meta">
<view class="item-location">📍 {{item.location}}</view>
<view class="item-time">{{item.createTime}}</view>
</view>
</view>
</view>
</view>
</view>
</view>

View File

@@ -1,169 +0,0 @@
/* pages/epidemic/epidemic.wxss */
.epidemic-container {
min-height: 100vh;
background: #f6f6f6;
}
.search-section {
padding: 20rpx;
background: #fff;
margin-bottom: 20rpx;
}
.search-bar {
position: relative;
}
.search-input {
width: 100%;
height: 72rpx;
background: #f8f9fa;
border: none;
border-radius: 36rpx;
padding: 0 60rpx 0 30rpx;
font-size: 28rpx;
color: #333;
}
.search-icon {
position: absolute;
right: 30rpx;
top: 50%;
transform: translateY(-50%);
font-size: 28rpx;
color: #999;
}
.epidemic-list {
background: #fff;
margin: 0 20rpx;
border-radius: 16rpx;
overflow: hidden;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
}
.list-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.list-title {
font-size: 32rpx;
font-weight: 600;
color: #333;
}
.add-btn {
display: flex;
align-items: center;
padding: 16rpx 24rpx;
background: #1890ff;
border-radius: 24rpx;
color: #fff;
}
.add-text {
font-size: 24rpx;
margin-right: 8rpx;
}
.add-icon {
font-size: 24rpx;
font-weight: 600;
}
.loading,
.empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 80rpx;
color: #999;
}
.loading-text,
.empty-text {
font-size: 28rpx;
}
.empty-icon {
font-size: 80rpx;
margin-bottom: 20rpx;
}
.list-content {
space-y: 0;
}
.epidemic-item {
padding: 30rpx;
border-bottom: 1rpx solid #f0f0f0;
transition: background 0.3s;
}
.epidemic-item:last-child {
border-bottom: none;
}
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
}
.item-title {
font-size: 30rpx;
font-weight: 600;
color: #333;
flex: 1;
}
.item-level {
font-size: 20rpx;
padding: 8rpx 16rpx;
border-radius: 20rpx;
font-weight: 500;
}
.item-level.high {
background: #fff2f0;
color: #ff4d4f;
}
.item-level.medium {
background: #fff7e6;
color: #faad14;
}
.item-level.low {
background: #f6ffed;
color: #52c41a;
}
.item-content {
margin-bottom: 20rpx;
}
.item-desc {
font-size: 26rpx;
color: #666;
margin-bottom: 12rpx;
line-height: 1.5;
}
.item-meta {
display: flex;
justify-content: space-between;
align-items: center;
}
.item-location,
.item-time {
font-size: 22rpx;
color: #999;
}

View File

@@ -0,0 +1,273 @@
// pages/farmer/add/add.js
Page({
data: {
statusBarHeight: 0,
// 表单数据
formData: {
name: '',
phone: '',
idCard: '',
area: '',
farmName: '',
farmAddress: '',
animalCount: '',
animalType: '',
email: '',
emergencyContact: '',
emergencyPhone: '',
remark: ''
},
// 选择器数据
areaList: [
{ id: 1, name: '银川市' },
{ id: 2, name: '石嘴山市' },
{ id: 3, name: '吴忠市' },
{ id: 4, name: '固原市' },
{ id: 5, name: '中卫市' }
],
areaIndex: -1,
animalTypeList: [
{ id: 1, name: '牛' },
{ id: 2, name: '羊' },
{ id: 3, name: '猪' },
{ id: 4, name: '鸡' },
{ id: 5, name: '其他' }
],
animalTypeIndex: -1,
// 提交状态
isSubmitting: false,
canSubmit: false
},
onLoad(options) {
// 获取状态栏高度
const systemInfo = wx.getSystemInfoSync();
this.setData({
statusBarHeight: systemInfo.statusBarHeight
});
// 检查登录状态
this.checkLoginStatus();
},
// 检查登录状态
checkLoginStatus() {
const token = wx.getStorageSync('token');
if (!token) {
wx.redirectTo({
url: '/pages/login/login'
});
return;
}
},
// 输入框变化处理
onInputChange(e) {
const { field } = e.currentTarget.dataset;
const { value } = e.detail;
this.setData({
[`formData.${field}`]: value
}, () => {
this.validateForm();
});
},
// 区域选择
onAreaChange(e) {
const index = e.detail.value;
const area = this.data.areaList[index];
this.setData({
areaIndex: index,
'formData.area': area ? area.name : ''
}, () => {
this.validateForm();
});
},
// 养殖类型选择
onAnimalTypeChange(e) {
const index = e.detail.value;
const animalType = this.data.animalTypeList[index];
this.setData({
animalTypeIndex: index,
'formData.animalType': animalType ? animalType.name : ''
}, () => {
this.validateForm();
});
},
// 表单验证
validateForm() {
const { formData } = this.data;
// 必填字段验证
const requiredFields = ['name', 'phone', 'area', 'farmName'];
const isValid = requiredFields.every(field => {
return formData[field] && formData[field].trim() !== '';
});
// 手机号格式验证
const phoneRegex = /^1[3-9]\d{9}$/;
const isPhoneValid = phoneRegex.test(formData.phone);
// 身份证号验证(如果填写了)
let isIdCardValid = true;
if (formData.idCard) {
const idCardRegex = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
isIdCardValid = idCardRegex.test(formData.idCard);
}
// 邮箱验证(如果填写了)
let isEmailValid = true;
if (formData.email) {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
isEmailValid = emailRegex.test(formData.email);
}
this.setData({
canSubmit: isValid && isPhoneValid && isIdCardValid && isEmailValid
});
},
// 取消操作
onCancel() {
// 检查是否有未保存的数据
const hasData = Object.values(this.data.formData).some(value => value && value.trim() !== '');
if (hasData) {
wx.showModal({
title: '提示',
content: '确定要放弃当前编辑的内容吗?',
success: (res) => {
if (res.confirm) {
wx.navigateBack();
}
}
});
} else {
wx.navigateBack();
}
},
// 提交表单
async onSubmit() {
if (!this.data.canSubmit || this.data.isSubmitting) {
return;
}
// 最终验证
if (!this.validateFormData()) {
return;
}
this.setData({ isSubmitting: true });
try {
// 模拟API调用
await this.submitFarmerData();
wx.showToast({
title: '添加成功',
icon: 'success'
});
// 延迟返回,让用户看到成功提示
setTimeout(() => {
wx.navigateBack();
}, 1500);
} catch (error) {
console.error('添加养殖户失败:', error);
wx.showToast({
title: '添加失败,请重试',
icon: 'none'
});
} finally {
this.setData({ isSubmitting: false });
}
},
// 验证表单数据
validateFormData() {
const { formData } = this.data;
if (!formData.name.trim()) {
wx.showToast({ title: '请输入姓名', icon: 'none' });
return false;
}
if (!formData.phone.trim()) {
wx.showToast({ title: '请输入手机号', icon: 'none' });
return false;
}
const phoneRegex = /^1[3-9]\d{9}$/;
if (!phoneRegex.test(formData.phone)) {
wx.showToast({ title: '手机号格式不正确', icon: 'none' });
return false;
}
if (!formData.area.trim()) {
wx.showToast({ title: '请选择所属区域', icon: 'none' });
return false;
}
if (!formData.farmName.trim()) {
wx.showToast({ title: '请输入养殖场名称', icon: 'none' });
return false;
}
// 身份证号验证
if (formData.idCard && formData.idCard.trim()) {
const idCardRegex = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if (!idCardRegex.test(formData.idCard)) {
wx.showToast({ title: '身份证号格式不正确', icon: 'none' });
return false;
}
}
// 邮箱验证
if (formData.email && formData.email.trim()) {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailRegex.test(formData.email)) {
wx.showToast({ title: '邮箱格式不正确', icon: 'none' });
return false;
}
}
// 紧急联系电话验证
if (formData.emergencyPhone && formData.emergencyPhone.trim()) {
if (!phoneRegex.test(formData.emergencyPhone)) {
wx.showToast({ title: '紧急联系电话格式不正确', icon: 'none' });
return false;
}
}
return true;
},
// 提交养殖户数据
submitFarmerData() {
return new Promise((resolve, reject) => {
// 模拟API请求
setTimeout(() => {
// 模拟成功/失败
const success = Math.random() > 0.1; // 90%成功率
if (success) {
console.log('提交的数据:', this.data.formData);
resolve();
} else {
reject(new Error('网络错误'));
}
}, 2000);
});
}
});

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "添加养殖户",
"navigationStyle": "custom",
"backgroundColor": "#4CAF50",
"backgroundTextStyle": "light"
}

Some files were not shown because too many files have changed in this diff Show More