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