From bd6aae97c760e5c5693b6088b73f8a69a6f1ad55 Mon Sep 17 00:00:00 2001 From: Junling Bu Date: Mon, 12 Aug 2019 11:03:37 +0800 Subject: [PATCH 01/17] =?UTF-8?q?chore:=20=E9=87=87=E7=94=A8=E5=8D=95?= =?UTF-8?q?=E4=B8=80=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=EF=BC=8C=E5=88=99?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E8=AE=BE=E7=BD=AEprofiles.active=E4=B8=BAnon?= =?UTF-8?q?e=EF=BC=8C=E5=90=A6=E5=88=99=E4=BC=9A=E8=A2=ABall=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E7=9A=84=E5=86=85=E7=BD=AEapplication=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9A=84profiles.active=E6=89=80=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E8=BF=9B=E8=80=8C=E5=AF=BC=E8=87=B4=E4=B8=80=E4=BA=9B=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E7=9A=84=E5=8A=A0=E8=BD=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/litemall/application.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/deploy/litemall/application.yml b/deploy/litemall/application.yml index cf216d00..3bea1873 100644 --- a/deploy/litemall/application.yml +++ b/deploy/litemall/application.yml @@ -1,4 +1,6 @@ spring: + profiles: + active: none message: encoding: UTF-8 datasource: @@ -138,4 +140,10 @@ litemall: secretId: 111111 secretKey: xxxxxx region: xxxxxx - bucketName: xxxxxx \ No newline at end of file + bucketName: xxxxxx + # 七牛云对象存储配置信息 + qiniu: + endpoint: http://pd5cb6ulu.bkt.clouddn.com + accessKey: 111111 + secretKey: xxxxxx + bucketName: litemall \ No newline at end of file From 116664d7cb7805e1b358f065a491a35a75f0aeea Mon Sep 17 00:00:00 2001 From: 1037621594 <1037621594@qq.com> Date: Mon, 12 Aug 2019 11:07:51 +0800 Subject: [PATCH 02/17] Update index.vue (#250) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了商品分类无法切换的bug --- litemall-vue/src/views/items/category/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litemall-vue/src/views/items/category/index.vue b/litemall-vue/src/views/items/category/index.vue index 6edd32d4..e4aba0e4 100644 --- a/litemall-vue/src/views/items/category/index.vue +++ b/litemall-vue/src/views/items/category/index.vue @@ -64,7 +64,7 @@ export default { handleTabClick(index) { this.categoryId = this.navList[index].id; this.$router.replace({ - name: 'list', + name: 'category', query: { itemClass: this.categoryId } }); this.init(); From 5e0be5738e4615840f43d2d86a17284668f07e67 Mon Sep 17 00:00:00 2001 From: Junling Bu Date: Mon, 12 Aug 2019 12:57:13 +0800 Subject: [PATCH 03/17] =?UTF-8?q?chore:=20=E6=97=A5=E5=BF=97=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E6=A1=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/project.md | 25 ++++++++----------- .../src/main/resources/logback-spring.xml | 2 +- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/doc/project.md b/doc/project.md index 21e22f4e..12928e26 100644 --- a/doc/project.md +++ b/doc/project.md @@ -460,24 +460,21 @@ flush privilege #### 1.4.5.1 日志配置 -如果开发者启动litemall-all模块,则需要配置该模块的`application.yml`文件 +如果开发者启动litemall-all模块,则需要配置该模块的`logback-spring.xml`文件 ``` -logging: - level: - root: ERROR - org.springframework: ERROR - org.mybatis: ERROR - org.linlinjava.litemall.core: ERROR - org.linlinjava.litemall.db: ERROR - org.linlinjava.litemall.admin: ERROR - org.linlinjava.litemall.wx: ERROR - org.linlinjava.litemall: ERROR + + + + + + ``` -具体如何配置,请自行学习Spring Boot的日志配置。 +具体如何配置,请自行学习Spring Boot的日志配置和logback日志配置。 `org.linlinjava.litemall.core`定义litemall-core模块的日志级别 -`org.linlinjava.litemall.db`定义litemall-core模块的日志级别 +`org.linlinjava.litemall.db`定义litemall-db模块的日志级别 `org.linlinjava.litemall.wx`定义litemall-wx-api模块的日志级别 `org.linlinjava.litemall.admin`定义litemall-admin-api模块的日志级别 `org.linlinjava.litemall`而定义litemall所有后端模块的日志级别 @@ -487,7 +484,7 @@ logging: 注意: > 如果开发者独立启动litemall-wx-api模块,那么则需要配置litemall-wx-api模块的 -> `application.yml`文件来设置日志 +> 日志配置方式。 #### 1.4.5.2 数据库连接配置 diff --git a/litemall-all/src/main/resources/logback-spring.xml b/litemall-all/src/main/resources/logback-spring.xml index e7e9e3c5..2041212d 100644 --- a/litemall-all/src/main/resources/logback-spring.xml +++ b/litemall-all/src/main/resources/logback-spring.xml @@ -51,7 +51,7 @@ From 62f400a15cc42724f27fe7404613e415a3e094f9 Mon Sep 17 00:00:00 2001 From: Junling Bu Date: Mon, 12 Aug 2019 21:21:23 +0800 Subject: [PATCH 04/17] fix[litemall-vue]: #245 --- litemall-vue/src/views/order/tabbar-cart.vue | 37 +++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/litemall-vue/src/views/order/tabbar-cart.vue b/litemall-vue/src/views/order/tabbar-cart.vue index 4c0610e4..e30889e3 100755 --- a/litemall-vue/src/views/order/tabbar-cart.vue +++ b/litemall-vue/src/views/order/tabbar-cart.vue @@ -37,7 +37,7 @@ label="总计" @submit="cartSubmit" > - 全选 + 全选 @@ -57,25 +57,16 @@ export default { checkedAll: false, isSubmit: false, checkedGoods: [], - AllGoods: [], - allCheckedStatus: false, - goods: [], - count: 0 + allGoods: [], + goods: [] }; }, - - activated() { - this.checkedAll = false; - this.isEditor = false; - this.isSubmit = false; - }, created() { this.init(); }, computed: { submitBarText() { - const count = this.count; - return this.isEditor ? '删除' : `结算${count ? `(${count})` : ''}`; + return this.isEditor ? '删除' : '结算'; }, totalPrice() { return this.goods.reduce( @@ -102,9 +93,8 @@ export default { init() { cartList().then(res => { this.goods = res.data.data.cartList; - this.AllGoods = this.getAllList(); + this.allGoods = this.getAllList(); this.checkedGoods = this.getCheckedList(this.goods); - this.count = this.checkedGoods.length; }); }, getAllList() { @@ -149,10 +139,10 @@ export default { } }, setCheckAll(val) { - if (this.checkedGoods.length === this.AllGoods.length) { + if (this.checkedGoods.length === this.allGoods.length) { this.checkedGoods = []; } else { - this.checkedGoods = this.AllGoods; + this.checkedGoods = this.allGoods; } }, deleteCart(o) { @@ -175,19 +165,25 @@ export default { }); let delProductIds = []; - _.each(_.difference(this.AllGoods, index), v => { + _.each(_.difference(this.allGoods, index), v => { let productId = _.find(this.goods, result => { return result.id === v; }).productId; delProductIds.push(productId); }); - //没选中的不掉接口 if (delProductIds.length > 0) { cartChecked({productIds: delProductIds, isChecked: 0}); } if (addProductIds.length > 0) { cartChecked({productIds: addProductIds, isChecked: 1}); } + + if(index.length === this.allGoods.length){ + this.checkedAll = true + } + else{ + this.checkedAll = false + } }, deleteNext(o) { let productIds = []; @@ -199,9 +195,8 @@ export default { cartDelete({productIds: productIds}).then(res => { this.goods = res.data.data.cartList; - this.AllGoods = this.getAllList(); + this.allGoods = this.getAllList(); this.checkedGoods = this.getCheckedList(this.goods); - this.count = this.checkedGoods.length; }); } }, From b8dde20724a9f781062135f5690c2f60ac95ca76 Mon Sep 17 00:00:00 2001 From: 1037621594 <1037621594@qq.com> Date: Thu, 15 Aug 2019 09:07:42 +0800 Subject: [PATCH 05/17] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=8E=BB=E6=94=AF=E4=BB=98=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=20(#252)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update index.vue 修复了商品分类无法切换的bug * Update index.vue 阻止冒泡事件,修复了点击去支付后跳转到支付页面又执行上层列表点击事件跳到订单详情页面 --- litemall-vue/src/views/user/order-list/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litemall-vue/src/views/user/order-list/index.vue b/litemall-vue/src/views/user/order-list/index.vue index 1274fef8..3b1fe275 100644 --- a/litemall-vue/src/views/user/order-list/index.vue +++ b/litemall-vue/src/views/user/order-list/index.vue @@ -42,7 +42,7 @@ 去支付 + @click.stop="toPay(el.id)">去支付 Date: Thu, 15 Aug 2019 22:56:05 +0800 Subject: [PATCH 06/17] chore: #253 --- litemall-admin/src/views/user/address.vue | 2 +- .../main/java/org/linlinjava/litemall/db/util/OrderUtil.java | 2 +- .../org/linlinjava/litemall/wx/web/WxAddressController.java | 2 +- .../java/org/linlinjava/litemall/wx/web/WxCartController.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/litemall-admin/src/views/user/address.vue b/litemall-admin/src/views/user/address.vue index bf14143c..a9060b86 100644 --- a/litemall-admin/src/views/user/address.vue +++ b/litemall-admin/src/views/user/address.vue @@ -86,7 +86,7 @@ export default { handleDownload() { this.downloadLoading = true import('@/vendor/Export2Excel').then(excel => { - const tHeader = ['地址ID', '用户ID', '收获人', '手机号', '省', '市', '区', '地址', '是否默认'] + const tHeader = ['地址ID', '用户ID', '收货人', '手机号', '省', '市', '区', '地址', '是否默认'] const filterVal = ['id', 'userId', 'name', 'tel', 'province', 'city', 'county', 'addressDetail', 'isDefault'] excel.export_json_to_excel2(tHeader, this.list, filterVal, '用户地址信息') this.downloadLoading = false diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/util/OrderUtil.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/util/OrderUtil.java index 325bc8a4..9abb7cfd 100644 --- a/litemall-db/src/main/java/org/linlinjava/litemall/db/util/OrderUtil.java +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/util/OrderUtil.java @@ -11,7 +11,7 @@ import java.util.List; * 101 订单生成,未支付;102,下单未支付用户取消;103,下单未支付超期系统自动取消 * 201 支付完成,商家未发货;202,订单生产,已付款未发货,用户申请退款;203,管理员执行退款操作,确认退款成功; * 301 商家发货,用户未确认; - * 401 用户确认收货,订单结束; 402 用户没有确认收货,但是快递反馈已收获后,超过一定时间,系统自动确认收货,订单结束。 + * 401 用户确认收货,订单结束; 402 用户没有确认收货,但是快递反馈已收货后,超过一定时间,系统自动确认收货,订单结束。 * * 当101用户未付款时,此时用户可以进行的操作是取消或者付款 * 当201支付完成而商家未发货时,此时用户可以退款 diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAddressController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAddressController.java index 5d1a1576..ef75816a 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAddressController.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAddressController.java @@ -134,7 +134,7 @@ public class WxAddressController extends GetRegionService { } if (address.getIsDefault()) { - // 重置其他收获地址的默认选项 + // 重置其他收货地址的默认选项 addressService.resetDefault(userId); } diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java index 9251b87d..a0ec4120 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java @@ -395,7 +395,7 @@ public class WxCartController { LitemallAddress checkedAddress = null; if (addressId == null || addressId.equals(0)) { checkedAddress = addressService.findDefault(userId); - // 如果仍然没有地址,则是没有收获地址 + // 如果仍然没有地址,则是没有收货地址 // 返回一个空的地址id=0,这样前端则会提醒添加地址 if (checkedAddress == null) { checkedAddress = new LitemallAddress(); From 6a46f95b51505965d74a8137bbe655b2922bfeed Mon Sep 17 00:00:00 2001 From: Junling Bu Date: Thu, 15 Aug 2019 22:56:35 +0800 Subject: [PATCH 07/17] =?UTF-8?q?chore:=20=E4=BD=BF=E7=94=A8.gitkeep?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=A9=BA=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/db/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 deploy/db/.gitkeep diff --git a/deploy/db/.gitkeep b/deploy/db/.gitkeep new file mode 100644 index 00000000..e69de29b From 2b9610c155c40bed3b454658d6f5a68f13b294a3 Mon Sep 17 00:00:00 2001 From: 1037621594 <1037621594@qq.com> Date: Thu, 15 Aug 2019 22:58:33 +0800 Subject: [PATCH 08/17] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=B4=AD=E7=89=A9?= =?UTF-8?q?=E8=BD=A6=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E7=9A=84api=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80=20(#255)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update index.vue 修复了商品分类无法切换的bug * Update index.vue 阻止冒泡事件,修复了点击去支付后跳转到支付页面又执行上层列表点击事件跳到订单详情页面 * Update api.js 修正CartUpdate为url地址而不是函数名 --- litemall-vue/src/api/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litemall-vue/src/api/api.js b/litemall-vue/src/api/api.js index 893953ff..6959fefd 100644 --- a/litemall-vue/src/api/api.js +++ b/litemall-vue/src/api/api.js @@ -161,7 +161,7 @@ export function cartFastAdd(data) { const CartUpdate='wx/cart/update'; // 更新购物车的商品 export function cartUpdate(data) { return request({ - url: cartUpdate, + url: CartUpdate, method: 'post', data }) @@ -437,4 +437,4 @@ export function getList(api, query) { }) } -export const REFUND_LIST = ''; \ No newline at end of file +export const REFUND_LIST = ''; From e56f52adaaa03fdc8267a886b2fc4d98336dce68 Mon Sep 17 00:00:00 2001 From: 1037621594 <1037621594@qq.com> Date: Fri, 16 Aug 2019 16:19:23 +0800 Subject: [PATCH 09/17] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E8=AE=A2=E5=8D=95=E6=8E=A5=E5=8F=A3=20(#256)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update index.vue 修复了商品分类无法切换的bug * Update index.vue 阻止冒泡事件,修复了点击去支付后跳转到支付页面又执行上层列表点击事件跳到订单详情页面 * Update api.js 修正CartUpdate为url地址而不是函数名 * Update index.vue 去掉了订单列表按钮所有冒泡事件,修正了取消订单调用取消订单接口,而不是删除接口 --- litemall-vue/src/views/user/order-list/index.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/litemall-vue/src/views/user/order-list/index.vue b/litemall-vue/src/views/user/order-list/index.vue index 3b1fe275..03aa929b 100644 --- a/litemall-vue/src/views/user/order-list/index.vue +++ b/litemall-vue/src/views/user/order-list/index.vue @@ -38,7 +38,7 @@ class="footer_btn"> 取消订单 + @click.stop="cancelOrder(el.id)">取消订单 退款 + @click.stop="refundOrder(el.id)">退款 确认收货 + @click.stop="confirmOrder(el.id)">确认收货 删除订单 + @click.stop="delOrder(el.id)">删除订单 去评价 + @click.stop="commentOrder(el.id)">去评价 @@ -131,7 +131,7 @@ export default { this.$dialog .confirm({ message: '确定要取消该订单吗?' }) .then(() => { - orderDelete({ orderId: id }).then(() => { + orderCancel({ orderId: id }).then(() => { this.init(); this.$toast('已取消该订单'); }); From 3ad47b5ba15e9a4d95f8aa07a505f12eaa278a2a Mon Sep 17 00:00:00 2001 From: staney <2948909+staneychan@users.noreply.github.com> Date: Tue, 20 Aug 2019 23:38:33 +0800 Subject: [PATCH 10/17] Update index.wxml (#257) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改: 在没有专题精选时隐藏此栏目 --- litemall-wx/pages/index/index.wxml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litemall-wx/pages/index/index.wxml b/litemall-wx/pages/index/index.wxml index 41245e71..00cfddfd 100644 --- a/litemall-wx/pages/index/index.wxml +++ b/litemall-wx/pages/index/index.wxml @@ -147,7 +147,7 @@ - + From b17b7b6482aedb22e581c6656b69189a11db4fcb Mon Sep 17 00:00:00 2001 From: Farahani Date: Wed, 18 Sep 2019 21:39:27 +0800 Subject: [PATCH 11/17] =?UTF-8?q?feat[litemall-admin]=20=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E6=96=B0=E5=A2=9E=E6=89=93=E5=8D=B0=20(#274)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- litemall-admin/src/main.js | 4 + litemall-admin/src/utils/print.js | 135 ++++++++++++++++++++++++ litemall-admin/src/views/mall/order.vue | 121 +++++++++++---------- 3 files changed, 204 insertions(+), 56 deletions(-) create mode 100644 litemall-admin/src/utils/print.js diff --git a/litemall-admin/src/main.js b/litemall-admin/src/main.js index de688815..155cfbfa 100644 --- a/litemall-admin/src/main.js +++ b/litemall-admin/src/main.js @@ -20,6 +20,10 @@ import * as filters from './filters' // global filters import permission from '@/directive/permission/index.js' // 权限判断指令 +import Print from '@/utils/print' // 打印 + +Vue.use(Print) + Vue.use(Element, { size: Cookies.get('size') || 'medium' // set element-ui default size }) diff --git a/litemall-admin/src/utils/print.js b/litemall-admin/src/utils/print.js new file mode 100644 index 00000000..3f1dc822 --- /dev/null +++ b/litemall-admin/src/utils/print.js @@ -0,0 +1,135 @@ +// 打印类属性、方法定义 +/* eslint-disable */ +const Print = function (dom, options) { + if (!(this instanceof Print)) return new Print(dom, options); + + this.options = this.extend({ + 'noPrint': '.no-print' + }, options); + + if ((typeof dom) === "string") { + this.dom = document.querySelector(dom); + } else { + this.isDOM(dom) + this.dom = this.isDOM(dom) ? dom : dom.$el; + } + + this.init(); +}; +Print.prototype = { + init: function () { + var content = this.getStyle() + this.getHtml(); + this.writeIframe(content); + }, + extend: function (obj, obj2) { + for (var k in obj2) { + obj[k] = obj2[k]; + } + return obj; + }, + + getStyle: function () { + var str = "", + styles = document.querySelectorAll('style,link'); + for (var i = 0; i < styles.length; i++) { + str += styles[i].outerHTML; + } + str += ""; + + return str; + }, + + getHtml: function () { + var inputs = document.querySelectorAll('input'); + var textareas = document.querySelectorAll('textarea'); + var selects = document.querySelectorAll('select'); + + for (var k = 0; k < inputs.length; k++) { + if (inputs[k].type == "checkbox" || inputs[k].type == "radio") { + if (inputs[k].checked == true) { + inputs[k].setAttribute('checked', "checked") + } else { + inputs[k].removeAttribute('checked') + } + } else if (inputs[k].type == "text") { + inputs[k].setAttribute('value', inputs[k].value) + } else { + inputs[k].setAttribute('value', inputs[k].value) + } + } + + for (var k2 = 0; k2 < textareas.length; k2++) { + if (textareas[k2].type == 'textarea') { + textareas[k2].innerHTML = textareas[k2].value + } + } + + for (var k3 = 0; k3 < selects.length; k3++) { + if (selects[k3].type == 'select-one') { + var child = selects[k3].children; + for (var i in child) { + if (child[i].tagName == 'OPTION') { + if (child[i].selected == true) { + child[i].setAttribute('selected', "selected") + } else { + child[i].removeAttribute('selected') + } + } + } + } + } + + return this.dom.outerHTML; + }, + + writeIframe: function (content) { + var w, doc, iframe = document.createElement('iframe'), + f = document.body.appendChild(iframe); + iframe.id = "myIframe"; + //iframe.style = "position:absolute;width:0;height:0;top:-10px;left:-10px;"; + iframe.setAttribute('style', 'position:absolute;width:0;height:0;top:-10px;left:-10px;'); + w = f.contentWindow || f.contentDocument; + doc = f.contentDocument || f.contentWindow.document; + doc.open(); + doc.write(content); + doc.close(); + var _this = this + iframe.onload = function(){ + _this.toPrint(w); + setTimeout(function () { + document.body.removeChild(iframe) + }, 100) + } + }, + + toPrint: function (frameWindow) { + try { + setTimeout(function () { + frameWindow.focus(); + try { + if (!frameWindow.document.execCommand('print', false, null)) { + frameWindow.print(); + } + } catch (e) { + frameWindow.print(); + } + frameWindow.close(); + }, 10); + } catch (err) { + console.log('err', err); + } + }, + isDOM: (typeof HTMLElement === 'object') ? + function (obj) { + return obj instanceof HTMLElement; + } : + function (obj) { + return obj && typeof obj === 'object' && obj.nodeType === 1 && typeof obj.nodeName === 'string'; + } +}; +const MyPlugin = {} +MyPlugin.install = function (Vue, options) { + // 4. 添加实例方法 + Vue.prototype.$print = Print +} +export default MyPlugin diff --git a/litemall-admin/src/views/mall/order.vue b/litemall-admin/src/views/mall/order.vue index b15a8248..116210ee 100644 --- a/litemall-admin/src/views/mall/order.vue +++ b/litemall-admin/src/views/mall/order.vue @@ -48,61 +48,66 @@ - - - - {{ orderDetail.order.orderSn }} - - - {{ orderDetail.order.orderStatus | orderStatusFilter }} - - - {{ orderDetail.user.nickname }} - - - {{ orderDetail.order.message }} - - - (收货人){{ orderDetail.order.consignee }} - (手机号){{ orderDetail.order.mobile }} - (地址){{ orderDetail.order.address }} - - - - - - - - - - - - - - - - (实际费用){{ orderDetail.order.actualPrice }}元 = - (商品总价){{ orderDetail.order.goodsPrice }}元 + - (快递费用){{ orderDetail.order.freightPrice }}元 - - (优惠减免){{ orderDetail.order.couponPrice }}元 - - (积分减免){{ orderDetail.order.integralPrice }}元 - - - - (支付渠道)微信支付 - (支付时间){{ orderDetail.order.payTime }} - - - (快递公司){{ orderDetail.order.shipChannel }} - (快递单号){{ orderDetail.order.shipSn }} - (发货时间){{ orderDetail.order.shipTime }} - - - (确认收货时间){{ orderDetail.order.confirmTime }} - - +
+ + + {{ orderDetail.order.orderSn }} + + + {{ orderDetail.order.orderStatus | orderStatusFilter }} + + + {{ orderDetail.user.nickname }} + + + {{ orderDetail.order.message }} + + + (收货人){{ orderDetail.order.consignee }} + (手机号){{ orderDetail.order.mobile }} + (地址){{ orderDetail.order.address }} + + + + + + + + + + + + + + + + (实际费用){{ orderDetail.order.actualPrice }}元 = + (商品总价){{ orderDetail.order.goodsPrice }}元 + + (快递费用){{ orderDetail.order.freightPrice }}元 - + (优惠减免){{ orderDetail.order.couponPrice }}元 - + (积分减免){{ orderDetail.order.integralPrice }}元 + + + + (支付渠道)微信支付 + (支付时间){{ orderDetail.order.payTime }} + + + (快递公司){{ orderDetail.order.shipChannel }} + (快递单号){{ orderDetail.order.shipSn }} + (发货时间){{ orderDetail.order.shipTime }} + + + (确认收货时间){{ orderDetail.order.confirmTime }} + + +
+ + 取 消 + 打 印 +
@@ -138,7 +143,7 @@