- 这种主动的消息推送怎么做的,别人回复我也会推送
[图片] 如题,这种就像消息提醒一样的怎么做到的
2017-11-01 - 新版开发工具bug 模拟器导航栏标题字体总是黑色,丑...
如图[图片]
2017-09-08 - 内嵌循环的form 表单提交 牵涉到name相同的组件提交问题
相同name的值为什么不是保存成数组而是拿最新的值呢,或者说有更好的解决方案么 ? 如下图的需求:[图片]
2017-08-08 - 以下是编辑框页面的代码,编辑完跳转后Storage不知何故被清空
[代码]var[代码] [代码]app = getApp();[代码][代码]Page({[代码][代码] [代码][代码]data:{[代码][代码] [代码][代码]txtInit:[代码][代码]""[代码][代码],[代码][代码] [代码][代码]tIndex:[代码][代码]null[代码][代码],[代码][代码] [代码][代码]txt:[代码][代码]""[代码][代码],[代码][代码] [代码][代码]borderWidth: app.globalData.borderWidth,[代码][代码] [代码][代码]},[代码][代码] [代码][代码]gettxt: [代码][代码]function[代码][代码](e){[代码][代码] [代码][代码]// console.log(e.detail.value);[代码][代码] [代码][代码]let that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]let txts = e.detail.value.replace(/\s+/g, [代码][代码]" "[代码][代码]);[代码][代码] [代码][代码]wx.setStorageSync([代码][代码]'temptxt'[代码][代码], txts);[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]txt: txts[代码][代码] [代码][代码]});[代码][代码] [代码][代码]},[代码][代码] [代码][代码]confirmtxt: [代码][代码]function[代码][代码](){[代码][代码] [代码][代码]// let that = this;[代码][代码] [代码][代码]// if(wx.getStorageSync('temptxt') != ""){[代码] [代码] [代码][代码]// };[代码][代码] [代码][代码]// var temptxt = that.data.txt || that.data.txtInit;[代码][代码] [代码][代码]// console.log(temptxt);[代码][代码] [代码][代码]// let txtObjStr = JSON.stringify({ t_index: that.data.tIndex, cnt: that.data.txt });[代码][代码] [代码][代码]// console.log(JSON.stringify({ t_index: that.data.tIndex, cnt: that.data.txt }))[代码][代码] [代码][代码]// if(temptxt != " " && temptxt != ""){[代码][代码] [代码][代码]// console.log(temptxt);[代码][代码] [代码][代码]// wx.setStorage({[代码][代码] [代码][代码]// key: 'temptxt',[代码][代码] [代码][代码]// data: { t_index: that.data.tIndex, cnt: that.data.txt },[代码][代码] [代码][代码]// });[代码][代码] [代码][代码]// if(that.data.tIndex != undefined){[代码][代码] [代码][代码]// wx.setStorageSync('temptxt', txtObjStr);[代码][代码] [代码][代码]// }else{[代码][代码] [代码][代码]// wx.setStorageSync('temptxt', {t_index: that.data.tIndex, cnt: that.data.txt});[代码][代码] [代码][代码]// }[代码][代码] [代码][代码]wx.switchTab({[代码][代码] [代码][代码]url: [代码][代码]'../index/index'[代码][代码],[代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](res){[代码][代码] [代码][代码]// success[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码][代码](res) {[代码][代码] [代码][代码]// fail[代码][代码] [代码][代码]app.warn([代码][代码]"跳转失败"[代码][代码]);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]// }else{[代码][代码] [代码][代码]// app.warn("你并未输入有效文字信息!");[代码][代码] [代码][代码]// };[代码][代码] [代码][代码]},[代码][代码] [代码][代码]onLoad:[代码][代码]function[代码][代码](options){[代码][代码] [代码][代码]// 生命周期函数--监听页面加载[代码][代码] [代码][代码]// console.log(options);[代码][代码] [代码][代码]wx.setStorageSync([代码][代码]'temptxt'[代码][代码], [代码][代码]""[代码][代码]);[代码][代码] [代码][代码]wx.setStorageSync([代码][代码]'tIndex'[代码][代码], options.tIndex);[代码][代码] [代码][代码]console.log(options.txt);[代码][代码] [代码][代码]console.log(options.tIndex);[代码][代码] [代码][代码]if[代码][代码](options.txt != [代码][代码]"undefined"[代码] [代码]&& options.tIndex !== [代码][代码]"undefined"[代码][代码]){[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]tIndex: options.tIndex,[代码][代码] [代码][代码]txtInit: options.txt,[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},[代码][代码]})[代码][图片]
2017-05-15 - 为动态生成的元素(多个)绑定相同动画的问题
如题,该怎么实现呢,就像列表项,事先并不知道有多少项(如果知道个人认为可以用笨方法传参数绑),比如多个一级菜单后加个小箭头,点开时小箭头有动画,菜单展开,希望有个过渡,但动画都是一样的,如何点的时候只有当前点击的执行动画
2017-05-05 - wx.saveFile保存文件失败是什么情况
[代码]startRecord: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]// wx.showToast({[代码][代码] [代码][代码]// title: '已开始录音',[代码][代码] [代码][代码]// icon: 'success',[代码][代码] [代码][代码]// duration: 2000[代码][代码] [代码][代码]// })[代码][代码] [代码][代码]wx.startRecord({[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]tempFilePath = res.tempFilePath;[代码][代码] [代码][代码]wx.saveFile({[代码][代码] [代码][代码]tempFilePath: tempFilePath,[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]// success[代码][代码] [代码][代码]savedFilePath = res.savedFilePath;[代码][代码] [代码][代码]var[代码] [代码]info_v = [代码][代码]new[代码] [代码]Info();[代码][代码] [代码][代码]info_v.path = savedFilePath;[代码][代码] [代码][代码]info_v.mode = [代码][代码]"voice"[代码][代码];[代码][代码] [代码][代码]info_v.time = util.formatTime([代码][代码]new[代码] [代码]Date());[代码][代码] [代码][代码]// info_v.getSize();[代码][代码] [代码][代码]wx.getSavedFileInfo({[代码][代码] [代码][代码]filePath: savedFilePath,[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]// success[代码][代码] [代码][代码]info_v.size = (res.size / 1024).toFixed(2) + [代码][代码]"Kb"[代码][代码];[代码][代码] [代码][代码]console.log(info_v);[代码][代码] [代码][代码]infos.push(info_v);[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]arr_info: infos,[代码][代码] [代码][代码]})[代码][代码] [代码][代码]console.log(infos);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]// fail[代码][代码] [代码][代码]},[代码][代码] [代码][代码]})[代码][代码] [代码][代码]// info_v.size = getSize.getS(savedFilePath);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]// fail[代码][代码] [代码][代码]console.log([代码][代码]"fail"[代码][代码])[代码][代码] [代码][代码]},[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]//录音失败[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]stopRecord: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]// wx.hideToast();[代码][代码] [代码][代码]wx.stopRecord();[代码][代码] [代码][代码]},[代码]在模拟器上可以正常保存,在ios手机则输出命令行:fail,之前保存图片也有类似问题,换临时路径规避了,可这个就郁闷了
2017-02-20