随笔分类 -  微信小程序 功能函数

摘要:data: { list:[], cards: { cardname: "", cardtitle: "", cardtel: "", cardcomp: "", degsin: '', remarks:''} }, // 名字赋值 changCardsFn(e) { let key = e.currentTarget.dataset.key; this.data.cards[key] = e.d 阅读全文
posted @ 2019-12-17 15:48 ThisCall 阅读(541) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-12-03 16:53 ThisCall 阅读(128) 评论(0) 推荐(0)
摘要:index.js Page({ /** * 页面的初始数据 */ data: { hour: '', min: '', second: '', m_second: '', endDate2:'2018-11-30 18:00:00' }, /** * 生命周期函数--监听页面加载 */ onLoad: fun... 阅读全文
posted @ 2019-11-28 11:46 ThisCall 阅读(728) 评论(0) 推荐(0)
摘要:A页面 B页面 阅读全文
posted @ 2019-11-25 10:06 ThisCall 阅读(295) 评论(0) 推荐(0)
摘要:let pages = getCurrentPages();// 获取页面栈 let current = pages[pages.length - 1]; // 当前页面 let url = current.route //当前页面url let options = current.options //如果要获取url中所带的参数可以查看options l... 阅读全文
posted @ 2019-10-25 09:56 ThisCall 阅读(382) 评论(0) 推荐(0)
摘要://进入的第二个页面 var pages = getCurrentPages(); var currentPage = pages[pages.length - 2];//当前页 console.log(currentPage.route) if (pages.length > 1) { //说明有 阅读全文
posted @ 2019-02-22 16:10 ThisCall 阅读(350) 评论(0) 推荐(0)
摘要:let chestr = `{"specials.${e.currentTarget.dataset.chekey}.enable":${e.detail.value}}`; console.log(chestr) this.setData(JSON.parse(chestr)) let chest 阅读全文
posted @ 2018-10-12 14:49 ThisCall 阅读(1135) 评论(0) 推荐(0)
摘要:picArr=['sdfasfasf.jpg','sdafasfdsaf.jpg'] //下载内容 xiazaiTupian: function (picArr,index) { let that=this; index=index||0; console.log(picArr[index]) wx 阅读全文
posted @ 2018-09-13 11:06 ThisCall 阅读(951) 评论(0) 推荐(0)
摘要:生命周期函数 onLoad: 页面加载 一个页面只会调用一次。 接收页面参数可以获取wx.navigateTo和wx.redirectTo及中的 query。 onShow: 页面显示 每次打开页面都会调用一次。 onReady: 页面初次渲染完成 一个页面只会调用一次,代表页面已经准备妥当,可以和 阅读全文
posted @ 2018-07-26 17:18 ThisCall 阅读(184) 评论(0) 推荐(0)
摘要:// 预览图片 yulanFn: function (e) { var arr = []; var that = this; //获取当前图片的下表 var indexw = e.currentTarget.dataset.indexw; var index = e.currentTarget.da 阅读全文
posted @ 2018-04-08 11:10 ThisCall 阅读(167) 评论(0) 推荐(0)
摘要:setTimeout(function () { let query = wx.createSelectorQuery(); query.select('#haha').boundingClientRect() query.exec(function (res) { console.log(res[ 阅读全文
posted @ 2018-04-02 14:45 ThisCall 阅读(162) 评论(0) 推荐(0)
摘要:ffn: function () { let nnn = this.data.nnn nnn += 1; this.setData({ nnn: nnn }); if (nnn > 10) { wx.vibrateLong() } }, var timer = setInterval(this.ff 阅读全文
posted @ 2018-03-19 08:34 ThisCall 阅读(520) 评论(0) 推荐(0)
摘要:shiFN:function(e){ // touchstart // touchend let that=this; let n=0; // 判断是开始还是结束的参数 let textTure = e.type; that.setData({ textTure: textTure }) if (t 阅读全文
posted @ 2018-01-22 13:18 ThisCall 阅读(473) 评论(0) 推荐(0)
摘要:GetDistance:function(lat1, lng1, lat2, lng2){ // console.log(lat1) var radLat1 = lat1 * Math.PI / 180.0; var radLat2 = lat2 * Math.PI / 180.0; var a = 阅读全文
posted @ 2018-01-20 10:00 ThisCall 阅读(889) 评论(0) 推荐(0)
摘要:let lovetime = setInterval(function () { let str = '(' + n + ')' + '重新获取' that.setData({ getText2: str }) if (n <= 0) { that.setData({ loveChange: tru 阅读全文
posted @ 2018-01-03 13:45 ThisCall 阅读(733) 评论(0) 推荐(0)
摘要:// 登录 wx.login({ success: res => { var code = res.code; //返回code // console.log(code) // 小程序appid // wxd751fc845c90fbd8 // 3df95e167161ab74e09ea54eda4 阅读全文
posted @ 2017-12-27 08:47 ThisCall 阅读(374) 评论(0) 推荐(0)
摘要:var str = 'abcadeacf'; var str1 = str.replace('a', 'o'); alert(str1); // 打印结果: obcadeacf var str2 = str.replace(/a/g, 'o'); alert(str2); //打印结果: obcod 阅读全文
posted @ 2017-12-13 10:53 ThisCall 阅读(28876) 评论(0) 推荐(0)
摘要:<view class="list"> <form bindsubmit="formSubmit"> <view class="item-addr flexa" bindtap="translate"> <view>所在城市:</view> <view style='color:#666' wx:i 阅读全文
posted @ 2017-12-10 20:47 ThisCall 阅读(11102) 评论(0) 推荐(0)
摘要:<view class='hong-contant'> <form bindsubmit="teformSubmit"> <view class='contant-teamwork'> <view class='teamwork-inputs'> <view class='inputs-box fl 阅读全文
posted @ 2017-12-08 16:55 ThisCall 阅读(802) 评论(0) 推荐(0)
摘要:<view class="hong-container"> <!-- 1头部选照片 --> <view class='hong-top'> <view class='top-box flex'> <view class='top-only'> <view class='only-pic'> <vie 阅读全文
posted @ 2017-12-08 16:20 ThisCall 阅读(278) 评论(0) 推荐(0)