- ios小程序左侧默认的向右滑动返回上一页,也有可能是退出小程序,这个怎么禁止某个页面禁止滑动返回呢?
目前看小程序还是什么软件在ios上都有一个侧滑向右滑动返回页面上一页的问题,想要禁止这个向右滑动退出小程序或者是返回上一页的问题
2020-05-06 - 我想要查看已经上传的服务类目的上传的图片如何查看呀?
在后台只能看到服务类目审核情况,但是看不到我审核时提交的文件[图片]
2020-04-24 - 文本框获取焦点会出现重影,怎么处理呀?
其他手机都会有闪动的问题,但是在vivo x21会出现比较明显的重影[图片]红框的位置,获取焦点的时候就会这样,这个有什么解决方案吗
2020-03-23 - wx.getRecorderManager录音的问题?
wx.getRecorderManager录音上传之后在手机熄屏之后再次打开就进入了recorderManager.onError()中,然后就不再进行录音了
2020-03-19 - 小程序实现横向跑马灯在vivo x21A这个手机型号上较为卡顿,不流畅较为明显,代码如下?
<view class="marquee_container " style="background:{{broadcast_arr.back_color}};font-size:32rpx;"> <view class='marquee_text' style='--marqueeWidth--:{{-broadcast_arr.width_mal}}px;--speed--:{{broadcast_arr.time}}s;width:{{broadcast_arr.width_mal}}px;'> <block wx:for="{{data}}"> <view style='color:{{broadcast_arr.text_color}};margin-left:{{index!=0?item.starspos*2:0}}rpx;' class=""> {{item.img}} </view> </block> </view> </view> wxss @keyframes around { from { margin-left: 100%; } to { margin-left: var(--marqueeWidth--); } } .marquee_container { /* background-color: #0099FF; */ padding: 12rpx 0; position: relative; width: 100%; height: 50rpx; } .marquee_text { display: flex; white-space: nowrap; animation-name: around; animation-duration: var(--speed--); animation-iteration-count: infinite; animation-timing-function: linear; line-height: 50rpx; } .marquee_tit { height: 50rpx; line-height: 50rpx; position: absolute; padding-left: 22rpx; } // pages/index2/index2.js Page({ /** * 页面的初始数据 */ data: { data: [ { img: "惠便利自提店铺优惠多多惠便利自提店铺优惠多多惠便利自提店铺优惠多多惠便利自提店铺优惠多多惠", linkurl: "", linkname: "", starspos: 0, back_color: "gold" }, { img: "江龙:每日惠自提店铺特价啦~店铺特价啦~店铺特价啦~", linkurl: "", linkname: "", starspos: 0, //间距 back_color: "#000000" }, { img: "啦啦啦啦啦啦啦啦啦啦~啦啦啦啦啦~啦啦啦啦啦~", linkurl: "", linkname: "", starspos: 0, //间距 back_colors: "red" } , { img: "哈哈哈哈~", linkurl: "", linkname: "", starspos: 0, //间距 back_colors: "red" } ], broadcast_arr: { speed: 2.8, //滚动速度,每秒2.8个字 font_size: "16", //字体大小(px) text_color: "#ffffff", //字体颜色 back_color: "#269e9e", //背景色 } }, /** * 生命周期函数--监听页面加载 */ onLoad: function(options) { let ititdata = this.data.data, assist = this.data.broadcast_arr, this_width = 0, spacing = 0, speed = (this.data.broadcast_arr.speed * this.data.broadcast_arr.font_size); //m每秒行走的距离 for (let i in ititdata) { ititdata[i].starspos = wx.getSystemInfoSync().windowWidth; //以取屏幕宽度为间距 this_width += ititdata[i].img.length * this.data.broadcast_arr.font_size; if (i != ititdata.length - 1) { spacing += ititdata[i].starspos } } let total_length = this_width + spacing;//总长 assist.time = total_length / speed; /**滚动时间*/ assist.width_mal = total_length; this.setData({ broadcast_arr: assist, data: ititdata }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function() { }, /** * 生命周期函数--监听页面显示 */ onShow: function() { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function() { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function() { }, /** * 用户点击右上角分享 */ onShareAppMessage: function() { } })
2020-03-05 - 小程序支持引入翼支付吗?
现在公司项目有个需求,在小程序支付的时候希望有微信支付和翼支付两个选择,这个怎么处理呀?
2020-03-02 - input框有没有让键盘只显示英文和数字的属性呀?
目前有一个输入车牌号的需求,想要键盘只能是英文和数字的切换,有什么方法吗?看了input框带的属性,并没有这种方法
2020-02-22 - cavas绘制图片在真机上不显示?
在线上的小程序绘制图片不显示,之前体验版本打开调试之后绘制图片页面就会出现图片?也使用了 wx.getImageInfo({}) 将后台返回的线上网址进行了转换,可是在线上就是不展示, onReady: function() { wx.showLoading({ title: '加载中...', mask: true }) let that = this util.request(['accessSystem', 'getScanDrive'], [{ id: Number(wx.getStorageSync('driverId')) }], res => { console.log(res, '查看二维码信息') wx.getImageInfo({ // 根据头像地址下载头像并存为临时路径 src: res, success: res1 => { wx.hideLoading() console.log(res1.path, '查看临时存的路径图片') that.setData({ // code: 'data:image/png;base64,' + res code: res1.path }) console.log(that.data.code, '查看数据情况') // 生命周期函数--监听页面初次渲染完成 var ctx = wx.createCanvasContext('canvas') // 设置背景 ctx.setFillStyle('#ffffff') ctx.fillRect(0, 0, 343, 212) // logo ctx.drawImage(this.data.logo, 0, 0, 343, 212) // logo下线条 ctx.setStrokeStyle("rgba(0,0,0,.1)") ctx.setLineWidth(0.3) ctx.moveTo(0, 49) ctx.lineTo(300, 49) ctx.stroke() // 所在城市 ctx.setFontSize(11) ctx.setFillStyle("#fff") textHandle(this.data.title, 20, 38, 170, 18); // 商品介绍 ctx.setFontSize(10) ctx.setFillStyle("#424752") textHandle(this.data.text, 10, 201, 170, 15); var dimension = ctx.measureText(this.data.text) console.log(dimension.width) ctx.drawImage(this.data.textImg, dimension.width + 12, 191, 26, 12); ctx.setFontSize(10) ctx.setFillStyle("#424752") textHandle(this.data.conpanyName, dimension.width + 40, 201, 170, 15); var dimension1 = ctx.measureText(this.data.conpanyName).width ctx.drawImage(this.data.textImgLast, dimension.width + dimension1 + 46, 191, 46, 12); ctx.drawImage(this.data.code, 230, 40, 80, 80); function textHandle(text, numX, numY, textWidth, lineHeight) { var chr = text.split(""); // 将一个字符串分割成字符串数组 var temp = ""; var row = []; for (var a = 0; a < chr.length; a++) { if (ctx.measureText(temp).width < textWidth) { temp += chr[a]; } else { a--; // 添加a--,防止字符丢失 row.push(temp); temp = ""; } } row.push(temp); // 如果数组长度大于2 则截取前两个 if (row.length > 2) { var rowCut = row.slice(0, 2); var rowPart = rowCut[1]; var test = ""; var empty = []; for (var a = 0; a < rowPart.length; a++) { if (ctx.measureText(test).width < textWidth - 10) { test += rowPart[a]; } else { break; } } empty.push(test); var group = empty[0] + "..."; // 这里只显示两行,超出的用...展示 rowCut.splice(1, 1, group); row = rowCut; } for (var b = 0; b < row.length; b++) { ctx.fillText(row[b], numX, numY + b * lineHeight); } } // 完成 ctx.draw() } }) }) },
2020-02-22 - 你好请问能一个页面同时调用多个cavas吗?
现在有个需求是需要生成多张一样的图片就是图片上的二维码不同
2020-02-20 - 关于获取位置的信息,我不想用户点击弹框才能获取位置,想直接获取到用户的位置?
我不想进入小程序还有位置授权这个弹框,能直接获取到位置吗[图片]我不想有这个授权的操作
2020-02-19