From 9f26478244294ba6d0b878092ea13cc5c74f2e82 Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Wed, 12 Feb 2025 14:39:02 +0800
Subject: [PATCH] refactor(mall): 优化订单商品名称的显示格式
---
src/main/resources/templates/febs/views/modules/order/orderList.html | 60 +++++++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 47 insertions(+), 13 deletions(-)
diff --git a/src/main/resources/templates/febs/views/modules/order/orderList.html b/src/main/resources/templates/febs/views/modules/order/orderList.html
index ee8d91e..c8c8b7c 100644
--- a/src/main/resources/templates/febs/views/modules/order/orderList.html
+++ b/src/main/resources/templates/febs/views/modules/order/orderList.html
@@ -132,7 +132,7 @@
<!-- 表格操作栏 end -->
<script data-th-inline="none" type="text/javascript">
// 引入组件并初始化
- layui.use([ 'jquery', 'form', 'table', 'febs', 'formSelects', 'upload','laydate'], function () {
+ layui.use([ 'jquery', 'form', 'table', 'febs', 'formSelects', 'upload','laydate', 'layer'], function () {
var $ = layui.jquery,
febs = layui.febs,
form = layui.form,
@@ -146,6 +146,7 @@
sortObject = {field: 'orderTime', type: 'desc'},
formSelects = layui.formSelects,
laydate = layui.laydate,
+ layer = layui.layer, // 新增此行
tableIns;
let currPageOrder = 1;//首先默认值为1,防止出错
@@ -357,7 +358,8 @@
});
}
if (layEvent === 'deliverPdfGoods') {
- febs.modal.confirm('一键发货', '确认一键发货?', function () {
+ febs.modal.confirm('一键发货', '确认一键发货?', function (index) {
+ layer.close(index);
deliverPdfGoods(data.id);
});
}
@@ -384,7 +386,9 @@
});
function cancelDeliver(id) {
+ var loadIndex = layer.load(1); // 显示加载中
febs.get(ctx + 'admin/order/cancelDeliver/' + id, null, function (data) {
+ layer.close(loadIndex);
febs.alert.success(data.message);
$query.click();
});
@@ -398,38 +402,68 @@
}
function deliverPdfGoods(id) {
+ var loadIndex = layer.load(1); // 显示加载中
febs.get(ctx + 'admin/order/deliverPdfGoods/' + id, null, function (e) {
+ layer.close(loadIndex);
+ $query.click();
if (e.code == 200) {
- // 创建弹层容器
const content = `
<div style="position:relative;min-height:500px">
- <div id="pdfContainer" style="margin:20px auto;max-width:800px"></div>
- <div class="layui-form" style="text-align:center;margin-top:20px">
- <button class="layui-btn layui-btn-normal" onclick="printPdf()">打印</button>
- </div>
+ <div id="pdfContainer" style="margin:20px auto;max-width:800px"></div>
+ <div class="layui-form" style="text-align:center;margin-top:20px">
+ <button class="layui-btn layui-btn-normal" onclick="printPdf()">打印</button>
+ </div>
</div>
- `;
-
- // 显示弹层
+ `;
const index = layer.open({
type: 1,
title: "电子面单",
content: content,
area: ['90%', '90%'],
success: function() {
- // 渲染PDF
renderPdf(e.data.pdfStream);
}
});
- // 存储当前PDF数据
window.currentPDF = e.data.pdfStream;
} else {
febs.alert.warn(e.message);
}
});
- $query.click();
}
+ // function deliverPdfGoods(id) {
+ // febs.get(ctx + 'admin/order/deliverPdfGoods/' + id, null, function (e) {
+ // if (e.code == 200) {
+ // // 创建弹层容器
+ // const content = `
+ // <div style="position:relative;min-height:500px">
+ // <div id="pdfContainer" style="margin:20px auto;max-width:800px"></div>
+ // <div class="layui-form" style="text-align:center;margin-top:20px">
+ // <button class="layui-btn layui-btn-normal" onclick="printPdf()">打印</button>
+ // </div>
+ // </div>
+ // `;
+ //
+ // // 显示弹层
+ // const index = layer.open({
+ // type: 1,
+ // title: "电子面单",
+ // content: content,
+ // area: ['90%', '90%'],
+ // success: function() {
+ // // 渲染PDF
+ // renderPdf(e.data.pdfStream);
+ // }
+ // });
+ // // 存储当前PDF数据
+ // window.currentPDF = e.data.pdfStream;
+ // } else {
+ // febs.alert.warn(e.message);
+ // }
+ // });
+ // $query.click();
+ // }
+
// PDF渲染函数
function renderPdf(base64Data) {
// 清理容器
--
Gitblit v1.9.1