{/n/'search/': /'async function () {//n const startDate = this.data.startDate;//n const endDate = this.data.endDate;//n//n // 判断是否为空//n if (!startDate || !endDate) {//n wx.showToast({//n title: '请选择起始日期和结束日期',//n icon: 'none'//n });//n return;//n }//n//n // 判断起始日期是否大于结束日期//n const start = new Date(startDate);//n const end = new Date(endDate);//n if (start.getTime() > end.getTime()) {//n wx.showToast({//n title: '起始日期不能大于结束日期',//n icon: 'none'//n });//n return;//n }//n//n wx.cloud.callFunction({//n name: 'searchData',//n data: {//n mailNumber: this.data.mailNumber,//n startDate: startDate,//n endDate: endDate//n },//n success: res => {//n const searchData = res.result;//n if (searchData.error) {//n wx.showToast({//n title: '未找到相关数据',//n icon: 'none'//n });//n } else {//n this.setData({//n searchData: searchData.searchData,//n mailNumber: searchData.mailNumber,//n images: searchData.images,//n describe: searchData.describe,//n date: searchData.date//n });//n }//n },//n fail: err => {//n console.error(err);//n }//n });//n},/n/'bindStartDateChange/': /'function (e) {//n this.setData({//n startDate: e.detail.value//n })//n},/n/'bindEndDateChange/': /'function (e) {//n this.setData({//n endDate: e.detail.value//n })//n},/

微信小程序搜索功能优化 - 限制日期选择

原文地址: https://www.cveoy.top/t/topic/pWB1 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录