diff --git a/README.md b/README.md index a90c9883..8af4d429 100644 --- a/README.md +++ b/README.md @@ -219,7 +219,13 @@ V 3.0.0 完成以下目标: 项目介绍:基于有赞 vant 组件库的移动商城。 项目参考:litemall项目的litemall-vue模块基于vant--mobile-mall项目开发。 + +## 推荐 + +1. [Flutter_Mall](https://github.com/youxinLu/mall) + 项目介绍:Flutter_Mall是一款Flutter开源在线商城应用程序。 + ## 问题 ![](doc/pic/qq2.png) diff --git a/deploy/db/.gitkeep b/deploy/db/.gitkeep new file mode 100644 index 00000000..e69de29b 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 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-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 @@