const app = getApp() Page({ data: { title: '', content1: '', content2: '', content3: '', content4: '', content5: '', loaddisplay: true, arr: [], display: '', indicatorDots: true, autoplay: true, interval: 5000, duration: 2000, userInfo: {}, hasUserInfo: false, canIUse: wx.canIUse('button.open-type.getUserInfo') }, //事件处理函数 bindViewTap: function() { wx.navigateTo({ url: '../logs/logs' }) }, onLoad: function() { var that = this var listarrayObj = {} var listarray = [] wx.request({ url: app.globalData.url + '/getWXCustomerCoupons', method: 'get', data: { cm_phone: app.globalData.userphone }, success: function(res) { for (var i = 0; i < res.data.length; i++) { listarrayObj.cp_amount = res.data[i].cp_amount listarrayObj.cp_enddate = res.data[i].cp_enddate listarrayObj.cp_startdate = res.data[i].cp_startdate var date = new Date(res.data[i].cp_enddate); var year = date.getFullYear(); var month = ("0" + (date.getMonth() + 1)).slice(-2); var strDate = ("0" + (date.getDate())).slice(-2); listarrayObj.cp_enddate_show = year + '年' + month + '月' + strDate + '日' listarray.push(listarrayObj) } that.setData({ arr: listarray, loaddisplay: 'none' }) }, fail() { app.timeOut() } }) let _this = this; _this.setData({ navH: app.globalData.navHeight }) }, // hrefCl: function(e) { // wx.navigateTo({ // url: '/pages/consultant/consultant' // }) // }, // hrefPm: function(e) { // wx.navigateTo({ // url: '/pages/promotion/promotion' // }) // }, // hrefEq: function(e) { // wx.navigateTo({ // url: '/pages/equipment/equipment' // }) // }, descshow: function(e) { this.setData({ title: '优惠券使用说明', display: "block", content1: '1.同一用户使用同等金额面值抵用券时,可累计一次性抵减使用;', content2: '2.抵金券部分不兑换现金、不找零、不开具发票;', content3: '3.本优惠限上海地区使用,不与其他优惠活动同享;', content4: '4.抵金券有效期' + e.currentTarget.dataset.start + ' - ' + e.currentTarget.dataset.end + ';', content5: '5.咨询电话 400-0022-699 或15216830978' }) }, deschide: function(e) { this.setData({ display: 'none' }) } })