- 小程序picker组件 mode = ragion省市区的json数据怎么能获取到?
picker mode=ragion的省市区json数据找了好多都没有办法找到相同,腾讯地图、支付宝、百度上搜的,都和小程序picker里数据有一些区别,官方能不能直接把json给我们发一下?
2020-08-08 - image组件 show-menu-by-longpress
<image class="er" src="../img/er.jpg" show-menu-by-longpress='1'></image> 图片长按识别,发送给朋友和保存本地失效 vivo nex和vivo y67都无效
2020-01-19 - 小程序录音
- 当前 Bug 的表现(可附上截图) 快速点击时,不触发catch:touchend,还有catch:touchcancel,,以至于,不能停止录音 - 预期表现 像安卓一样,即使快速点击,也能触发catch:touchend,还有catch:touchcancel,,,,实现,不到一秒钟录音,弹出提示框 - 复现路径 - 提供一个最简复现 Demo [代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"modal modal-record"[代码] [代码]bind:tap[代码][代码]=[代码][代码]"toggleRecordModal"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"modal-body"[代码] [代码]catch:tap[代码][代码]=[代码][代码]"toggleWithoutAction"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]text[代码] [代码]class[代码][代码]=[代码][代码]"desc"[代码][代码]>{{ RecordDesc[recordStatus] }}</[代码][代码]text[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码][代码] [代码][代码]class[代码][代码]=[代码][代码]"dot"[代码][代码] [代码][代码]catch:touchstart[代码][代码]=[代码][代码]"handleRecording"[代码][代码] [代码][代码]catch:touchmove[代码][代码]=[代码][代码]"handleRecordingMove"[代码][代码] [代码][代码]catch:touchend[代码][代码]=[代码][代码]"handleRecordingCancel"[代码][代码] [代码][代码]catch:touchcancel[代码][代码]=[代码][代码]"handleRecordingCancel"[代码][代码] [代码][代码]catchtap[代码][代码]=[代码][代码]'dianji'[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]image[代码] [代码]class[代码][代码]=[代码][代码]"icon-mic"[代码] [代码]src[代码][代码]=[代码][代码]"../../img/mic@2x.png"[代码][代码]/>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码]</[代码][代码]view[代码][代码]>[代码][代码]Page({[代码][代码] [代码][代码]data: {[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]onLoad: [代码][代码]function[代码] [代码]() { [代码] [代码] [代码][代码]},[代码][代码] [代码][代码]onShow:[代码][代码]function[代码][代码](){[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]toggleWithoutAction(e) {[代码][代码] [代码][代码]// 阻止 tap 冒泡[代码][代码] [代码][代码]},[代码][代码] [代码][代码]asd: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]console.log([代码][代码]"123"[代码][代码])[代码][代码] [代码][代码]},[代码][代码] [代码][代码]toggleRecordModal() {[代码][代码] [代码][代码]console.log([代码][代码]"wrap"[代码][代码])[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]handleRecordingMove(e) {[代码][代码] [代码][代码]var[代码] [代码]touches = e.touches[0];[代码][代码] [代码][代码]var[代码] [代码]changedTouches = [代码][代码]this[代码][代码].data.changedTouches;[代码][代码] [代码][代码]if[代码] [代码](!changedTouches) {[代码][代码] [代码][代码]return[代码][代码];[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]handleRecording(e) {[代码][代码] [代码][代码]console.log([代码][代码]"1"[代码][代码])[代码][代码] [代码][代码]let me = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]this[代码][代码].data.changedTouches = e.touches[0];[代码] [代码] [代码][代码]let recorderManager = wx.getRecorderManager();[代码][代码] [代码][代码]recorderManager.onStart(() => {[代码][代码] [代码][代码]console.log([代码][代码]"开始录音..."[代码][代码]);[代码][代码] [代码][代码]me.setData({[代码][代码] [代码][代码]num: 0[代码][代码] [代码][代码]})[代码][代码] [代码][代码]me.data.setInter = setInterval([代码][代码] [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]var[代码] [代码]numVal = me.data.num + 1;[代码][代码] [代码][代码]me.setData({ num: numVal });[代码][代码] [代码][代码]console.log([代码][代码]'setInterval=='[代码] [代码]+ me.data.num);[代码][代码] [代码][代码]}[代码][代码] [代码][代码], 1000);[代码][代码] [代码][代码]});[代码][代码] [代码][代码]recorderManager.start({[代码][代码] [代码][代码]format: [代码][代码]"mp3"[代码][代码] [代码][代码]});[代码][代码] [代码][代码]// 超时[代码][代码] [代码][代码]setTimeout([代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]me.handleRecordingCancel();[代码][代码] [代码][代码]}, 100000);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]handleRecordingCancel() {[代码][代码] [代码][代码]// 向上滑动状态停止:取消录音发放[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码] [代码] [代码][代码]let recorderManager = wx.getRecorderManager();[代码][代码] [代码][代码]recorderManager.onStop((res) => {[代码][代码] [代码][代码]console.log([代码][代码]"结束录音..."[代码][代码], res);[代码][代码] [代码][代码]clearInterval(that.data.setInter)[代码] [代码] [代码][代码]// 上传[代码][代码] [代码][代码]var[代码] [代码]mediaDuration = that.data.num[代码][代码] [代码][代码]if[代码] [代码](mediaDuration < 1) {[代码][代码] [代码][代码]// mediaDuration = 1[代码][代码] [代码][代码]wx.showModal({[代码][代码] [代码][代码]title: [代码][代码]'录音不能少于1s'[代码][代码],[代码][代码] [代码][代码]confirmText: [代码][代码]'OK'[代码][代码],[代码][代码] [代码][代码]showCancel: [代码][代码]false[代码][代码] [代码][代码]})[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]this[代码][代码].uploadRecord(res.tempFilePath);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]});[代码][代码] [代码][代码]// 停止录音[代码][代码] [代码][代码]recorderManager.stop();[代码][代码] [代码][代码]},[代码][代码] [代码][代码]uploadRecord(tempFilePath) {[代码][代码] [代码][代码]console.log(tempFilePath)[代码][代码] [代码][代码]}[代码][代码]})[代码]
2018-11-08