diff --git a/pages/memorial/addMemorial.vue b/pages/memorial/addMemorial.vue index 2ab65e9..d63e4ac 100644 --- a/pages/memorial/addMemorial.vue +++ b/pages/memorial/addMemorial.vue @@ -84,10 +84,42 @@ - - - {{ item.mac }} - {{ item.sn }} + + + + 未绑定牌位的设备列表 + + {{ winB_Pagination.total }} + + + + + + 📱 + 暂无未绑定设备 + 请先扫码添加设备 + + + + + + + SN:{{ item.sn || "未知SN" }} + + 点击选择 + + + MAC:{{ item.mac || "未知MAC" }} + MAC:{{ item.code || "未知code" }} + + + @@ -111,7 +143,7 @@ export default { createPagination({ fetchData: getMemorialList, mode: "loadMore", // 或 "pager" - pageSize: 5, + pageSize: 2, autoLoad: false, // 手动触发时设为 false }), ], @@ -464,6 +496,37 @@ export default { return true; }, + + // 选择设备 + selectDevice(item) { + console.log("选择设备:", item); + + // 将设备信息填充到顶部设备信息中 + this.deviceInfo = { + sn: item.sn || "", + mac: item.mac || "", + code: item.code || "", + id: item.id || "", + }; + + // 如果设备有编号,也填充到表单中 + if (item.code) { + this.formData.code = item.code; + } + + // 显示成功提示 + uni.showToast({ + title: "设备信息已填充", + icon: "success", + duration: 1500, + }); + + // 滚动到顶部 + uni.pageScrollTo({ + scrollTop: 0, + duration: 300, + }); + }, }, }; @@ -487,6 +550,20 @@ export default { margin-bottom: 20rpx; padding-left: 10rpx; border-left: 6rpx solid #4a90e2; + display: flex; + align-items: center; + justify-content: space-between; +} + +.count-badge { + background: #4a90e2; + color: #fff; + font-size: 20rpx; + padding: 4rpx 12rpx; + border-radius: 20rpx; + min-width: 32rpx; + text-align: center; + line-height: 1.2; } .scan-section { @@ -502,11 +579,12 @@ export default { } .scan-btn { + padding: 30rpx; display: flex; flex-direction: column; align-items: center; justify-content: center; - height: 200rpx; + //height: 200rpx; border: 3rpx dashed #4a90e2; border-radius: 16rpx; background: #f8fbff; @@ -703,4 +781,154 @@ export default { } } } + +// 设备列表样式 +.device-list-section { + background: #fff; + border-radius: 16rpx; + padding: 30rpx; + margin: 30rpx 0; + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1); +} + +.empty-state { + text-align: center; + padding: 60rpx 20rpx; + color: #999; +} + +.empty-icon { + font-size: 80rpx; + margin-bottom: 20rpx; +} + +.empty-text { + font-size: 28rpx; + color: #666; + margin-bottom: 10rpx; +} + +.empty-tip { + font-size: 24rpx; + color: #999; +} + +.device-list { + // 设备列表容器 +} + +.device-item { + background: #f8f9fa; + border: 2rpx solid #e9ecef; + border-radius: 12rpx; + padding: 20rpx; + margin-bottom: 20rpx; + transition: all 0.3s ease; + cursor: pointer; + + &:last-child { + margin-bottom: 0; + } + + &:hover { + border-color: #4a90e2; + background: #f0f7ff; + transform: translateY(-2rpx); + box-shadow: 0 6rpx 20rpx rgba(74, 144, 226, 0.15); + } + + &:active { + transform: translateY(0); + box-shadow: 0 2rpx 8rpx rgba(74, 144, 226, 0.2); + } +} + +.device-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 15rpx; +} + +.device-sn { + font-size: 28rpx; + font-weight: bold; + color: #333; + background: #e3f2fd; + padding: 6rpx 12rpx; + border-radius: 6rpx; + border-left: 4rpx solid #4a90e2; +} + +.select-hint { + font-size: 22rpx; + color: #4a90e2; + background: #e8f4ff; + padding: 4rpx 8rpx; + border-radius: 4rpx; +} + +.device-info { + margin-bottom: 15rpx; +} + +.info-row { + display: flex; + align-items: center; + margin-bottom: 8rpx; + + &:last-child { + margin-bottom: 0; + } +} + +.info-label { + font-size: 24rpx; + color: #666; + width: 120rpx; + flex-shrink: 0; +} + +.info-value { + font-size: 24rpx; + color: #333; + font-weight: 500; + flex: 1; + background: #fff; + padding: 4rpx 8rpx; + border-radius: 4rpx; + border-left: 3rpx solid #4a90e2; + word-break: break-all; +} + +.device-actions { + display: flex; + justify-content: flex-end; +} + +.action-btn { + padding: 8rpx 16rpx; + border-radius: 6rpx; + font-size: 24rpx; + transition: all 0.3s ease; +} + +.select-btn { + background: #4a90e2; + color: #fff; + + &:hover { + background: #357abd; + transform: scale(1.05); + } + + &:active { + transform: scale(0.95); + } +} + +.btn-text { + font-size: 24rpx; + font-weight: 500; +}