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