![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
小程序
weixin_41201496
这个作者很懒,什么都没留下…
展开
-
scroll-view适配屏幕高度
微信小程序scroll-view适配屏幕高度原创 2023-07-02 01:04:30 · 165 阅读 · 0 评论 -
小程序获取手机号
小程序获取用户手机号原创 2022-10-13 16:56:34 · 88 阅读 · 0 评论 -
php--tp6小程序授权登录
小程序授权登录原创 2020-02-26 17:43:03 · 1082 阅读 · 0 评论 -
小程序获取二维码中的参数
小程序获取二维码中的参数原创 2022-10-13 15:10:55 · 390 阅读 · 0 评论 -
小程序几种弹窗
小程序几种弹窗原创 2022-10-12 20:19:25 · 416 阅读 · 0 评论 -
小程序保存图片到本地
//res是通过后台获取的图片链接wx.getImageInfo({ //获取图片信息 src:res.data.data, success:function(ress){ wx.saveImageToPhotosAlbum({//执行保存 filePath:ress.path, success(resa) { wx.showToast({ title: '下载成功', icon: 'none', //原创 2021-09-25 15:46:52 · 79 阅读 · 0 评论 -
微信小程序动态配置navigationBarTitleText
在app.js中 onLaunch() { // 展示本地存储能力 this.setBarTitle() //进入小程序调取后台数据 }, setBarTitle:function(){ wx.request({ url: this.globalData.url+'shop/index', data:{ shop_id:this.globalData.shop_id }, success:function(r原创 2021-09-16 13:29:46 · 611 阅读 · 0 评论 -
小程序倒计时
直接调用函数,传入结束时间的时间戳即可在页面直接输出以下值countDownDay 天countDownHour 时countDownMinute 分countDownSecond 秒count_down: function (time) { var timestamp = Date.parse(new Date()); timestamp = timestamp / 1000; console.log(timestamp,time) var totalSec原创 2021-08-17 03:45:31 · 131 阅读 · 0 评论 -
小程序长按保存图片
<image mode="widthFix" bindlongtap="longPressSaveImg" data-url="{{data}}" class="img" src="{{data}}"></image>只需复制代码即可longPressSaveImg (e) { let that = this let url = e.currentTarget.dataset.url; console.log(url); if (!wx.save原创 2021-08-15 15:30:24 · 156 阅读 · 0 评论 -
小程序打开外部导航
daohang:function(){ let loc = JSON.parse(this.data.shop_info.loc) wx.openLocation({ longitude: Number(loc.longitude), latitude: Number(loc.latitude), name: this.data.shop_info.name, }) },原创 2021-04-04 16:26:35 · 188 阅读 · 0 评论 -
小程序拨打电话
wx.makePhoneCall({ phoneNumber: this.data.shop_info.phone, })原创 2021-04-04 16:24:27 · 88 阅读 · 0 评论 -
生成小程序二维码
小程序生成二维码原创 2021-03-11 15:59:30 · 180 阅读 · 0 评论 -
富文本内容在小程序端自适应手机屏幕
formatRichText:function(html){ let newContent= html.replace(/<img[^>]*>/gi,function(match,capture){ match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, ''); match = match.replace(/width="[^"]+"/gi, '').repla原创 2020-12-28 20:03:23 · 530 阅读 · 1 评论 -
微信小程序分享
页面代码 <button open-type='share' class="fenxiangitem"> <image class="imgs" src="../../img/weixin.png"></image> <view>微信</view> </button >js代码 onShareAppMessage: function () { let that = this return原创 2020-11-30 13:14:22 · 481 阅读 · 0 评论 -
微信小程序二维数组分组
// data二维数组// name 按该字段的值分组fenzu(data,name){ let that = this let arr = [] for(var i=0;i<data.length;i++){ arr.push(data[i].address) } let arrs = that.quchong(arr) let datas = [] for(var i=0;i<arrs.length;i++){原创 2020-09-14 18:06:42 · 1256 阅读 · 0 评论 -
微信小程序数组去重
quchong(arr){ console.log(arr) var tempArr = []; //返回的值 var indexArr= []; //返回的索引 for (var i = 0; i < arr.length; i++) { if (tempArr.indexOf(arr[i]) == -1) { tempArr.push(arr[i]); indexArr.push(i) }原创 2020-09-14 17:34:13 · 3034 阅读 · 1 评论 -
在tp5框架中调用支付宝小程序生成二维码alipay.mobile.public.qrcode.create接口
官方文档下载支付宝sdk后解压放到extend目录下在public/index.php中定义常量define('ALI_PATH',__DIR__.'/../extend/alipay/aop/');创建控制器并写入代码require ALI_PATH . 'AopClient.php';require ALI_PATH . 'request/AlipayOpenAppQrcodeC...原创 2020-04-21 23:18:18 · 1429 阅读 · 0 评论 -
微信小程序通过后台接口实现地址三级联动
页面代码<view class="citys"> <picker class="select" mode="multiSelector" range="{{provincearr}}" bindcolumnchange="getcity"> <text class="select-text">{{province}},{{city}},{{area...原创 2020-04-17 18:00:54 · 1071 阅读 · 1 评论 -
商城侧边栏分类代码,实现局部垂直滚动
wxml代码<scroll-view scroll-y="true" class="fenlei" style="height:{{windowHeight}}rpx;"> <block wx:key=""> <view class="fenlei-item fenlei-this">分类1</view> </block>...原创 2020-04-10 17:29:49 · 312 阅读 · 0 评论 -
自定义小程序滚动条样式
/* 滚动条样式 */::-webkit-scrollbar { width: 4rpx; /*滚动条的宽度*/ height: 4rpx; color:#ffffff;}/*定义滚动条轨道 内阴影+圆角*/::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);...原创 2020-04-10 17:18:43 · 3104 阅读 · 0 评论