随笔分类 -  UniApp

摘要:page code <template> <view class="container" style="background-color: #F6F6F6;"> <u-navbar back-icon-color="#fff" :is-back="false" title-color="#fff" 阅读全文
posted @ 2025-01-01 23:16 温柔的风 阅读(21) 评论(0) 推荐(0) 编辑
摘要:定义一个全局的socket类,放在util目录下 //定义一个socket类 class WebSocket { constructor(url) { this.url = url this.time=null; } //建立连接 connet() { let _this = this; uni.c 阅读全文
posted @ 2024-11-24 23:14 温柔的风 阅读(384) 评论(0) 推荐(0) 编辑
摘要:UNI-APP 打包app权限配置 里面涉及到 定位, NFC, 相册, 语音, 指纹, 人脸等 权限 名称 描述 android.permission.ACCESS_CHECKIN_PROPERTIES 访问登记属性 读取或写入登记check-in数据库属性表的权限 android.permiss 阅读全文
posted @ 2023-06-09 12:12 温柔的风 阅读(1475) 评论(0) 推荐(0) 编辑
摘要:// 判断有没有存储权限 qxcz(){ var _this = this plus.android.requestPermissions(['android.permission.WRITE_EXTERNAL_STORAGE'], function(e) { if (e.deniedAlways. 阅读全文
posted @ 2023-06-09 12:11 温柔的风 阅读(716) 评论(0) 推荐(0) 编辑
摘要://代码 // 普通语音电话 audio.onclick = function () { // 导入Activity、Intent类 var Intent = plus.android.importClass("android.content.Intent"); var Uri = plus.and 阅读全文
posted @ 2023-05-30 21:06 温柔的风 阅读(201) 评论(0) 推荐(0) 编辑
摘要:子组件 <template> <view class="hb-comment"> testcontent </view> </template> <script> export default { name: 'question-comment’, //名字 data() { return { } 阅读全文
posted @ 2022-02-05 12:28 温柔的风 阅读(960) 评论(0) 推荐(0) 编辑
摘要:一、rpx转px // 100 为 100rpx的值 var px = uni.upx2px(100); 二、px转rpx // 200 为 px 的值,后面的两个 100 为计算比例使用 var rpx = 200/(uni.upx2px(100)/100); // 验证上面rpx的值 var p 阅读全文
posted @ 2022-01-17 17:52 温柔的风 阅读(3380) 评论(0) 推荐(1) 编辑
摘要:一、改导航文字 uni.setNavigationBarTitle({ title: 'xx' }); 二、改tabbar文字 uni.setTabBarItem({ index: 0, text: 'xx' }); 阅读全文
posted @ 2022-01-11 21:36 温柔的风 阅读(546) 评论(0) 推荐(0) 编辑
摘要:一、标签跳转 官方链接:https://uniapp.dcloud.io/component/navigator <navigator url="navigate/navigate?title=navigate" hover-class="navigator-hover"> <button type 阅读全文
posted @ 2022-01-06 22:05 温柔的风 阅读(4798) 评论(0) 推荐(0) 编辑
摘要:字符串转数组 let string = "12345,56789" string.split(',') // ['12345','56789'] 数组转字符串 let array = ["123","456"] array.join(",") // "'123','456'" 数组元素删除 let 阅读全文
posted @ 2021-12-26 21:49 温柔的风 阅读(4380) 评论(0) 推荐(0) 编辑
摘要:报错 Access to XMLHttpRequest at 'http://www.localtest.com/api/api/v1/job/getPositionList' from origin 'http://localhost:8080' has been blocked by CORS 阅读全文
posted @ 2021-12-26 16:02 温柔的风 阅读(468) 评论(0) 推荐(0) 编辑
摘要:图例 <view class="pt10 flex alcenter"> <view class="ft16 ftw500 text-info">手机号</view> <input class="ml40" maxlength="11" :value="phone" type="text" plac 阅读全文
posted @ 2021-12-17 14:41 温柔的风 阅读(3941) 评论(0) 推荐(0) 编辑
摘要:一、首先命令行新建.gitignore文件 touch .gitignore 二、编辑复制粘贴以下 node_modules/ .project unpackage/ .DS_Store 也可以直接使用uni-app的hello-uniapp模板中的.gitignore文件 注意:如果之前就已经提交 阅读全文
posted @ 2021-06-28 16:04 温柔的风 阅读(2258) 评论(0) 推荐(1) 编辑
该文被密码保护。
posted @ 2021-05-30 11:00 温柔的风 阅读(217) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2021-05-15 22:12 温柔的风 阅读(123) 评论(0) 推荐(0) 编辑
摘要:假设子组件里有这么一个方法 methods:{ showDiv(){ this.release = true; } } 在父组件引用子组件时绑定 <unio2o-release-message-alert ref="unio2oReleaseMessageAlert" ></unio2o-relea 阅读全文
posted @ 2021-03-12 21:28 温柔的风 阅读(1813) 评论(0) 推荐(0) 编辑
摘要:假设父组件里有这么一个方法 methods{ async getMessageList(message_category_id){ console.log(message_category_id) } } 在父组件引用子组件时绑定该方法 <unio2o-category-child-list v-o 阅读全文
posted @ 2021-03-11 11:22 温柔的风 阅读(1582) 评论(0) 推荐(0) 编辑
摘要:onLoad(){ this.setAreaList(); }, methods: { async setAreaList(){ //这里使用异步关键字 let area = await this.areaCache(); //这里使用了await 会等待areaCache这个方法返回数据后才会去执 阅读全文
posted @ 2021-03-06 21:09 温柔的风 阅读(7644) 评论(0) 推荐(1) 编辑
摘要:条件编译是用特殊的注释作为标记,在编译时根据这些特殊的注释,将注释里面的代码编译到不同平台。 写法:以 #ifdef 或 #ifndef 加 %PLATFORM% 开头,以 #endif 结尾。 1 #ifdef:if defined 仅在某平台存在2 #ifndef:if not defined 阅读全文
posted @ 2021-02-07 22:01 温柔的风 阅读(5472) 评论(0) 推荐(0) 编辑
摘要:文章目录 保留当前页面,跳转到应用内的某个页面 关闭当前页面,跳转到应用内的某个页面 关闭所有页面,打开到应用内的某个页面 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 关闭当前页面,返回上一页面或多级页面 窗口动画 关键点 跳转到 tabBar 页面只能使用 switchTab 阅读全文
posted @ 2021-02-04 22:59 温柔的风 阅读(1537) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示