邮件数据查询 - 微信小程序
// js代码 data: { mailNumber: '', // 邮件编号 images: [], // 保存的图片列表 describe:'', date:'', startDate: '', endDate: '', searchData: [] // 存储查找到的数据 },
search: async function () { wx.cloud.callFunction({ name: 'searchData', data: { mailNumber: this.data.mailNumber, startDate:this.data.startDate, endDate: this.data.endDate }, success: res => { const searchData = res.result; if (searchData.error) { wx.showToast({ title: '未找到相关数据', icon: 'none' }); } else { this.setData({ searchData: searchData.searchData, images: searchData.images, describe: searchData.describe, date: searchData.date }); } }, fail: err => { console.error(err); } }); }
// wxml代码
// wxss代码 .container { display: flex; flex-direction: column; align-items: center; padding: 20rpx; }
.search-bar { display: flex; flex-direction: row; align-items: center; margin-bottom: 20rpx; }
.input { flex: 1; padding: 10rpx; border: 1rpx solid #ccc; border-radius: 4rpx; }
.date-picker { display: flex; flex-direction: row; align-items: center; margin-left: 20rpx; }
.picker { display: flex; flex-direction: row; align-items: center; padding: 5rpx; border: 1rpx solid #ccc; border-radius: 4rpx; }
.picker-text { margin-right: 5rpx; }
.picker-icon { font-size: 14rpx; color: #999; }
.divider { width: 1rpx; height: 20rpx; background-color: #ccc; margin: 0 10rpx; }
.search-btn { padding: 10rpx 20rpx; background-color: #007aff; color: #fff; border-radius: 4rpx; }
.result-container { display: flex; flex-direction: column; align-items: center; }
.table-header { display: flex; flex-direction: row; align-items: center; margin-bottom: 10rpx; font-weight: bold; }
.table-cell { flex: 1; padding: 10rpx; border: 1rpx solid #ccc; text-align: center; }
.table-row { display: flex; flex-direction: row; align-items: center; margin-bottom: 10rpx; }
.thumbnail { width: 80rpx; height: 80rpx; margin: 5rpx; }
.table-body { height: 300rpx; border: 1rpx solid #ccc; border-radius: 4rpx; padding: 5rpx; margin-bottom: 20rpx; overflow-x: hidden;
原文地址: https://www.cveoy.top/t/topic/pTMh 著作权归作者所有。请勿转载和采集!