随笔分类 -  uniapp

摘要:uniapp获取位置时显示getLocation:fail the api need to be declared in the requiredPrivateInfos field in app.json/ext.json 解决方式:1.manifest.json文件 "mp-weixin" 中添 阅读全文
posted @ 2023-08-07 17:19 干红 阅读(1649) 评论(0) 推荐(0) 编辑
摘要:超简单 wx.requestPayment({ timeStamp: zhifu.timeStamp,//需要的参数,由后端返回 nonceStr: zhifu.nonceStr,//需要的参数,由后端返回 package: zhifu.prepayId,//需要的参数,由后端返回 signType 阅读全文
posted @ 2023-08-03 15:36 干红 阅读(311) 评论(0) 推荐(0) 编辑
摘要:事件中写入: copydata:要复制的数据 uni.setClipboardData({ data: copydata, success: function() { //调用方法成功 console.log('success'); } }) 阅读全文
posted @ 2023-08-03 15:33 干红 阅读(105) 评论(0) 推荐(0) 编辑
摘要:methods: { changeRelation() { uni.showActionSheet({ itemList:['妻子','丈夫','妈妈','爸爸','爷爷','奶奶','儿子','女儿','兄弟姐妹','亲戚','同学','同事','朋友','长辈','其他'], success: 阅读全文
posted @ 2023-08-03 15:31 干红 阅读(236) 评论(0) 推荐(0) 编辑
摘要:// uni.getUserProfile({ // desc:"获取个人信息", // success: (res) => { // this.userList = res.userInfo; // console.log(res.userInfo) // } // }) 阅读全文
posted @ 2023-08-03 15:31 干红 阅读(49) 评论(0) 推荐(0) 编辑
摘要:1.使用 <rich-text class="textcontent" :nodes="content"> </rich-text> 使用类名可以直接修改文字样式 2.图片样式,使用正则添加类名 textcontent.value = data.content.replace(/\<img/gi, 阅读全文
posted @ 2022-11-18 09:52 干红 阅读(1269) 评论(0) 推荐(0) 编辑
摘要:var mynavData = JSON.stringify(that.navData); // 这里转换成 字符串 uni.navigateTo({ url:'./nav?index='+mynavData }) //新页面接收后:onLoad(options) { var data = JSON 阅读全文
posted @ 2022-11-14 16:32 干红 阅读(65) 评论(0) 推荐(0) 编辑
摘要:<button open-type="share" v-bind:data-student="item" class="share"> 分享 </button> 指定按钮的类型open-type="share" 分享需要的信息要使用v-bind:data-student传递,这里student是自己 阅读全文
posted @ 2022-11-14 10:48 干红 阅读(607) 评论(0) 推荐(0) 编辑
摘要:uni.makePhoneCall({ phoneNumber:'123456789', success:function(){ console.log('成功'); }, fail() { console.log('拨打失败'); } }) 阅读全文
posted @ 2022-11-08 17:06 干红 阅读(357) 评论(0) 推荐(0) 编辑
摘要:uni.openLocation({ latitude: 28.135568855795345,//纬度 longitude:106.0402866322937,//经度 name: "四渡赤水博物馆", address: "四川省泸州市古蔺县太平镇" }); 阅读全文
posted @ 2022-11-08 17:04 干红 阅读(71) 评论(0) 推荐(0) 编辑
摘要:// 计算两组经纬度之间距离const GetDistance=( lat1, lng1, lat2, lng2)=>{ var radLat1 = lat1*Math.PI / 180.0; var radLat2 = lat2*Math.PI / 180.0; var a = radLat1 - 阅读全文
posted @ 2022-11-08 17:03 干红 阅读(1410) 评论(0) 推荐(0) 编辑
摘要:uni.getLocation({ type: 'wgs84', geocode:true,//设置该参数为true可直接获取经纬度及城市信息 success: function (res) { num.value=parseInt(GetDistance(res.latitude,res.long 阅读全文
posted @ 2022-11-08 17:03 干红 阅读(275) 评论(0) 推荐(0) 编辑
摘要:1.mode="aspectFill" 保持图片宽高比例不变 用法 <image class="image" lazy-load :src="item.image" mode="aspectFill"></image> lazy-load 懒加载 阅读全文
posted @ 2022-11-03 16:05 干红 阅读(25) 评论(0) 推荐(0) 编辑

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