# uniApp_puls **Repository Path**: zhangbohanking/uni-app_puls ## Basic Information - **Project Name**: uniApp_puls - **Description**: 此项目包含了 vite typescript vue3 uview 相关配置已配完 开箱即用 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 1 - **Created**: 2022-08-16 - **Last Updated**: 2024-07-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # uniApp_puls ## 介绍 此项目内置了 **uniapp**/**vue3**/**pinia**/**typescript**/**vite**/**sass**/**uview-plus**等模块 **uni:**[https://uniapp.dcloud.net.cn/](https://uniapp.dcloud.net.cn/) **vue3:**[https://cn.vuejs.org/](https://cn.vuejs.org/) **pinia:**[https://pinia.web3doc.top/](https://pinia.web3doc.top/) **typescript:**[https://www.tslang.cn/](https://www.tslang.cn/) **vite:**[https://vitejs.cn/](https://vitejs.cn/) **sass:**[https://www.sass.hk/](https://www.sass.hk/) **uview:**[https://uiadmin.net/uview-plus/](https://uiadmin.net/uview-plus/) ### 运行 ``` npm run dev ``` ### 测试 ``` npm run test ``` ### 打包 ``` npm run build ``` ### 多平台 ``` 根目录 package.json 查看更多.... ``` ### updata 基座 ``` npx @dcloudio/uvm ``` ### updata uview-plus ``` npm update uview-plus ``` ## 配置 ### 项目配置介绍 **在 src 下的 appConfig.json 中配置项目基本资料** | 名称 | 释义 | | -------- | ------------------------------------------------------------------------- | | name | 项目名称 | | logo | 项目logi路径 | | wxAppId | 微信appid | | urls | 请求接口域名 ***production*** 打包 ***test*** 测试 ***development*** 开发 | | imageUrl | 网络图片域名 ***production*** 打包 ***test*** 测试 ***development*** 开发 | ### 网络 #### apis 目录 | 文件 | 释义 | | ---------- | -------------------------------------------------------------------------------------- | | apis.js | 定义接口路径 | | config.js | 根据环境自动化处理接口域名及图片域名 | | http.js | 请求类型配置 **get** **post** **put** **delete** | | request.js | 请求封装文件 可在此处配置 **token** **失败处理** **接口返回状态** **最大请求时间....** | ### vite.config.ts **跨域配置在此** ### 内置方法 common 目录 #### func.js | 方法 | 说明 | 参数 | 返回值 | | ---------- | ---------------------- | -------------------------------------------------------------------------------------- | -------------- | | sliceStr | 标题处理 | **(text:string, len:number, type:number)** (文字,长度,true/false:是否展示“...”占位符) | string | | dTime | 倒计时计算 | **(time:string)** (年月日) | 秒 number | | toast | 提示 | **(data:string, type:number)** (文字,1success/2loading/none) | 无 | | logs | 自定义log | **(data:string,index:number)** (文字,1成功/2失败/3警告/4...) | 无 | | copy | 深拷贝 | **(data)** (参数) | 参数 | | copyData | 设置剪切板 | **(data:string)** (数字文字) | 无 | | noNull | 判断是否为空 | **(data)** (参数) | true/false | | wipeOutn | 去空 | **(data:string)** (文字) | 文字 | | navto | 跳转 | **(data:string, type:string, time:number)** (路径,'clear',延时秒) | 无 | | onBreak | 去空 | **(page:number, data, delay:number)** (层级,缓存参数,延时)缓存参数key为**backData** | 无 | | seeImgArr | 查看图片 | **(data, index = 0)** (图片路径/图片数组,图片展示下标) | 无 | | strPhone | 抓取手机号 | **(data:string)** (文字) | 手机号 | | rulseCode | 验证账号是否数字或字母 | **(data:string)** (文字) | true/false | | rulsePhone | 验证手机号 | **(data:number)** (文字) | true/false | | seeType | 类型判断 | **(data)** (参数) | 类型 | | arrDelete | 数组删除 | **(data:[ ],indexList:[ ])** (数组,要删除的下表) | 数组 | | navheight | 获取顶部高度 | 无 | 顶部高度 | | Format | 时间转化 | **(date,fmt = 'yyyy-MM-dd HH:mm:ss')** (时间,格式) | 格式处理的时间 | ### pinia 文件 store目录 #### index ### 公共样式 setCss 目录 **以下样式全局生效** | 文件 | 释义 | | ----------------- | ------------ | | clearDefault.scss | 清理样式 | | display-flex.scss | 弹性布局样式 | | public.scss | 公用样式 | ### 样式mixin **以下样式全局生效** | 名称 | 释义 | | ------ | ---------------------------------------------------------------------------------- | | boxs() | 盒子 **(width:100%,heigth:100%,borr:false)** (宽,高,边框宽度) | | fz() | 字体 **(fz, color:false, lineh:false, tc:false)** (大小,颜色,行高,居中) |