# thorui-template **Repository Path**: laomao233/thorui-template ## Basic Information - **Project Name**: thorui-template - **Description**: 整合thorui 库,自定义方法,更轻量的uniapp模板 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2020-12-29 - **Last Updated**: 2022-07-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # thorui-使用说明 thorui文档地址:(https://thorui.cn/doc/docs/introduce.html) 1.接口请求: 服务器路径配置在 '/api/constant.js' 内 'baseUrl'手动配置,如有别的全局变量也可在 constant.js 内配置 接口请求封装于 '/api/httpRequest.js' 内,具体说明请看 httpRequest.js 内注释 例子: this.tui.request("/Home/GetStatus", "GET", postData, false, true, type == 1 ? false : true).then((res) => { if (res.code == 100) { this.result = `${type == 1 ?"带":"无"}loading请求成功!返回值为 ${JSON.stringify(res)}` } else { this.result = `${type == 1 ? "带" : "无"}loading请求失败! ${JSON.stringify(res)}` } }).catch((res) => { this.result = `${type == 1 ? "带" : "无"}loading请求失败! ${JSON.stringify(res)}` }) 2.通用函数: 通用函数封装于 '/utils/common.js' 内,可根据需求自定义添加修改函数,减少代码量 3.混入(mixins): 目前封装了常用的计算手机屏幕高度来自适应自定义titleBar和手机验证码发送的交互,具体详情请看'/mixins/'下js文件具体注释 例子: import sendCode from "@/mixins/sendCode" script export default { mixin:[sendCode], onLoad(){ this.sendTextCode() } } script 4.关于封装的样式: 为减少代码量,本人对常用样式进行了封装,文件位于'/style/total.scss','/style/theme.scss'两个文件 theme.scss主要放整个项目的全局主题色调,也可以称之为项目的色卡 total.scss主要是对常用的样式进行了封装 列如:1、flex布局:t-flex 2、margin,padding的样式:t-margin-10(缩写 t-m-10) 或 t-margin-top-10(缩写 t-m-t-10) 3、只显示 x 行,剩余部分替换为 '...' :t-show-x-line (x <=4,x可以自己修改大小,具体请到total.scss内修改) 具体全部封装的样式,请看total.scss 5.关于ucharts2.0: ucharts2.0目前已经整合到该项目,位于:uni_modules内 ,具体使用请参考官网(https://demo.ucharts.cn/#/)在线生成 整合不易请多支持 ![](https://files.catbox.moe/sm6jp8.jpg) ![](https://files.catbox.moe/g6jdxy.jpg)