diff --git a/buyer/config/index.js b/buyer/config/index.js index 2189ed6d..a7463abb 100644 --- a/buyer/config/index.js +++ b/buyer/config/index.js @@ -21,7 +21,7 @@ module.exports = { }, // Various Dev Server settings - host: '0.0.0.0', // can be overwritten by process.env.HOST + host: 'localhost', // can be overwritten by process.env.HOST port: 10000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: false, errorOverlay: true, diff --git a/buyer/src/pages/GoodsList.vue b/buyer/src/pages/GoodsList.vue index 31f2b9c3..55fbb20c 100644 --- a/buyer/src/pages/GoodsList.vue +++ b/buyer/src/pages/GoodsList.vue @@ -49,27 +49,27 @@ class="goods-show-info" v-for="(item, index) in goodsList" :key="index" - @click="goGoodsDetail(item.id, item.goodsId)" + @click="goGoodsDetail(item.id, item.content.goodsId)" >
- +
{{ - item.price | unitPrice("¥") + item.content.price | unitPrice("¥") }}
- {{ item.goodsName }} + {{ item.content.goodsName }}
- 已有{{ item.commentNum || 0 }}{{ item.content.commentNum || 0 }}人评价
- 自营{{ item.storeName }} + 自营{{ item.content.storeName }}
diff --git a/buyer/vue.config.js b/buyer/vue.config.js index 078d9a0b..4a80058b 100644 --- a/buyer/vue.config.js +++ b/buyer/vue.config.js @@ -1,9 +1,3 @@ -/* - * @Author: LMR - * @Date: 2020-08-11 10:53:53 - * @Last Modified by: LMR - * @Last Modified time: 2020-08-11 11:26:19 - */ // 关闭eslint module.exports = { diff --git a/manager/package.json b/manager/package.json index 41910b3f..282a442f 100644 --- a/manager/package.json +++ b/manager/package.json @@ -12,42 +12,25 @@ "dependencies": { "@amap/amap-jsapi-loader": "0.0.7", "@antv/g2": "^4.1.12", - "apexcharts": "^3.26.0", "axios": "^0.21.1", "core-js": "^3.6.5", - "countup.js": "^2.0.4", - "date-fns": "^1.30.1", "dplayer": "^1.26.0", - "gitalk": "^1.6.2", - "html2canvas": "^1.0.0-rc.5", - "iview-area": "^1.6.0", "js-cookie": "^2.2.1", "node-sass": "^4.14.1", - "pinyin": "^2.9.0", - "print-js": "^1.0.63", - "qrcodejs2": "0.0.2", "sass-loader": "^8.0.2", "sockjs-client": "^1.4.0", - "stompjs": "^2.3.3", "swiper": "^6.3.5", "uuid": "^8.3.2", "view-design": "^4.2.0", "vue": "^2.6.10", - "vue-apexcharts": "^1.5.1", - "vue-awesome": "^4.0.2", "vue-awesome-swiper": "^4.1.1", - "vue-clipboard2": "^0.3.0", - "vue-cropper": "^0.4.9", "vue-i18n": "^8.15.1", "vue-json-excel": "^0.3.0", - "vue-json-pretty": "^1.4.1", - "vue-lazyload": "^1.3.3", "vue-qr": "^2.3.0", "vue-router": "^3.1.3", "vuedraggable": "^2.23.2", "vuex": "^3.4.0", "wangeditor": "^4.7.5", - "xlsx": "^0.16.2", "xss": "^1.0.7" }, "devDependencies": { @@ -61,6 +44,7 @@ "less-loader": "^6.2.0", "style-loader": "^2.0.0", "style-resources-loader": "^1.3.2", + "uglifyjs-webpack-plugin": "^2.2.0", "vue-cli-plugin-style-resources-loader": "^0.1.4", "vue-template-compiler": "^2.6.10" } diff --git a/manager/public/index.html b/manager/public/index.html index 076d2228..0644d4d7 100644 --- a/manager/public/index.html +++ b/manager/public/index.html @@ -1,107 +1,86 @@ - - - - - - - lili admin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
+ .half-circle-spinner { + width: 35px; + height: 35px; + border-radius: 100%; + position: relative; + } + + .half-circle-spinner .circle { + content: ""; + position: absolute; + width: 100%; + height: 100%; + border-radius: 100%; + border: calc(35px / 10) solid transparent; + } + + .half-circle-spinner .circle.circle-1 { + border-top-color: #5cadff; + animation: half-circle-spinner-animation 1s infinite; + } + + .half-circle-spinner .circle.circle-2 { + border-bottom-color: #5cadff; + animation: half-circle-spinner-animation 1s infinite alternate; + } + + @keyframes half-circle-spinner-animation { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } + } + + + + + <% for(var js of htmlWebpackPlugin.options.cdn.js) { %> + + <% } %> + +
+
+
+
+
+
+

正在加载资源...

-

正在加载资源...

-
- - - + diff --git a/manager/src/assets/aliyun.png b/manager/src/assets/aliyun.png index fed475ce..c45d9a2d 100644 Binary files a/manager/src/assets/aliyun.png and b/manager/src/assets/aliyun.png differ diff --git a/manager/src/assets/background.png b/manager/src/assets/background.png index b828f919..89c970ca 100644 Binary files a/manager/src/assets/background.png and b/manager/src/assets/background.png differ diff --git a/manager/src/assets/background.svg b/manager/src/assets/background.svg deleted file mode 100644 index 89c25976..00000000 --- a/manager/src/assets/background.svg +++ /dev/null @@ -1,69 +0,0 @@ - - - - Group 21 - Created with Sketch. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/manager/src/assets/dada.png b/manager/src/assets/dada.png deleted file mode 100644 index 0a2ae027..00000000 Binary files a/manager/src/assets/dada.png and /dev/null differ diff --git a/manager/src/assets/dashboard/console.png b/manager/src/assets/dashboard/console.png deleted file mode 100644 index 4eec7618..00000000 Binary files a/manager/src/assets/dashboard/console.png and /dev/null differ diff --git a/manager/src/assets/dashboard/department.png b/manager/src/assets/dashboard/department.png deleted file mode 100644 index 52d61492..00000000 Binary files a/manager/src/assets/dashboard/department.png and /dev/null differ diff --git a/manager/src/assets/dashboard/fee.png b/manager/src/assets/dashboard/fee.png deleted file mode 100644 index 37be6b08..00000000 Binary files a/manager/src/assets/dashboard/fee.png and /dev/null differ diff --git a/manager/src/assets/dashboard/user.png b/manager/src/assets/dashboard/user.png deleted file mode 100644 index 36e977bc..00000000 Binary files a/manager/src/assets/dashboard/user.png and /dev/null differ diff --git a/manager/src/assets/decorate/delete.png b/manager/src/assets/decorate/delete.png deleted file mode 100644 index eff5bc3f..00000000 Binary files a/manager/src/assets/decorate/delete.png and /dev/null differ diff --git a/manager/src/assets/decorate/edit.png b/manager/src/assets/decorate/edit.png deleted file mode 100644 index 9d639a9f..00000000 Binary files a/manager/src/assets/decorate/edit.png and /dev/null differ diff --git a/manager/src/assets/decorate/phone.png b/manager/src/assets/decorate/phone.png deleted file mode 100644 index 9bab6a44..00000000 Binary files a/manager/src/assets/decorate/phone.png and /dev/null differ diff --git a/manager/src/assets/decorate/poplarGoods.png b/manager/src/assets/decorate/poplarGoods.png deleted file mode 100644 index b3b2a7ab..00000000 Binary files a/manager/src/assets/decorate/poplarGoods.png and /dev/null differ diff --git a/manager/src/assets/empty.png b/manager/src/assets/empty.png index 0dcc8194..cc1ae9f6 100644 Binary files a/manager/src/assets/empty.png and b/manager/src/assets/empty.png differ diff --git a/manager/src/assets/emptyImg.png b/manager/src/assets/emptyImg.png index a98baa98..9c4f50f8 100644 Binary files a/manager/src/assets/emptyImg.png and b/manager/src/assets/emptyImg.png differ diff --git a/manager/src/assets/iPhoneX_model.png b/manager/src/assets/iPhoneX_model.png index bca24f1e..1db47b00 100644 Binary files a/manager/src/assets/iPhoneX_model.png and b/manager/src/assets/iPhoneX_model.png differ diff --git a/manager/src/assets/icon.png b/manager/src/assets/icon.png index e2656e39..fa7da0e5 100644 Binary files a/manager/src/assets/icon.png and b/manager/src/assets/icon.png differ diff --git a/manager/src/assets/img-error.png b/manager/src/assets/img-error.png index dada769a..1aa48d85 100644 Binary files a/manager/src/assets/img-error.png and b/manager/src/assets/img-error.png differ diff --git a/manager/src/assets/loading.gif b/manager/src/assets/loading.gif deleted file mode 100644 index cc66fd30..00000000 Binary files a/manager/src/assets/loading.gif and /dev/null differ diff --git a/manager/src/assets/loading2.gif b/manager/src/assets/loading2.gif deleted file mode 100644 index 2a07a208..00000000 Binary files a/manager/src/assets/loading2.gif and /dev/null differ diff --git a/manager/src/assets/loading3.gif b/manager/src/assets/loading3.gif deleted file mode 100644 index f1d2d763..00000000 Binary files a/manager/src/assets/loading3.gif and /dev/null differ diff --git a/manager/src/assets/logo.png b/manager/src/assets/logo.png index 4ee26429..2e1feb36 100644 Binary files a/manager/src/assets/logo.png and b/manager/src/assets/logo.png differ diff --git a/manager/src/assets/logo1.png b/manager/src/assets/logo1.png deleted file mode 100644 index 6fba9abe..00000000 Binary files a/manager/src/assets/logo1.png and /dev/null differ diff --git a/manager/src/assets/nav/1.jpg b/manager/src/assets/nav/1.jpg index de03b9f6..a978a951 100644 Binary files a/manager/src/assets/nav/1.jpg and b/manager/src/assets/nav/1.jpg differ diff --git a/manager/src/assets/nav/4.jpg b/manager/src/assets/nav/4.jpg index 64083220..e2b23e98 100644 Binary files a/manager/src/assets/nav/4.jpg and b/manager/src/assets/nav/4.jpg differ diff --git a/manager/src/assets/nav/decorate.png b/manager/src/assets/nav/decorate.png index 7701d18a..675eb8c6 100644 Binary files a/manager/src/assets/nav/decorate.png and b/manager/src/assets/nav/decorate.png differ diff --git a/manager/src/assets/nav/decorate1.png b/manager/src/assets/nav/decorate1.png index 3bc10858..57277747 100644 Binary files a/manager/src/assets/nav/decorate1.png and b/manager/src/assets/nav/decorate1.png differ diff --git a/manager/src/assets/nav/decorate10.jpeg b/manager/src/assets/nav/decorate10.jpeg index 5e67c4d6..1fb43c9d 100644 Binary files a/manager/src/assets/nav/decorate10.jpeg and b/manager/src/assets/nav/decorate10.jpeg differ diff --git a/manager/src/assets/nav/decorate4.jpeg b/manager/src/assets/nav/decorate4.jpeg index 37c66a6b..387b8d0f 100644 Binary files a/manager/src/assets/nav/decorate4.jpeg and b/manager/src/assets/nav/decorate4.jpeg differ diff --git a/manager/src/assets/nav/decorate7.jpeg b/manager/src/assets/nav/decorate7.jpeg index 6a7b819f..5e333e30 100644 Binary files a/manager/src/assets/nav/decorate7.jpeg and b/manager/src/assets/nav/decorate7.jpeg differ diff --git a/manager/src/assets/nav/decorate8.png b/manager/src/assets/nav/decorate8.png index 6ee46fc2..75ecb1f9 100644 Binary files a/manager/src/assets/nav/decorate8.png and b/manager/src/assets/nav/decorate8.png differ diff --git a/manager/src/assets/nav/decorate9.png b/manager/src/assets/nav/decorate9.png index 958e3645..36a6e1ca 100644 Binary files a/manager/src/assets/nav/decorate9.png and b/manager/src/assets/nav/decorate9.png differ diff --git a/manager/src/assets/nav/nav_showimg1.jpg b/manager/src/assets/nav/nav_showimg1.jpg index f13f536e..450a66ec 100644 Binary files a/manager/src/assets/nav/nav_showimg1.jpg and b/manager/src/assets/nav/nav_showimg1.jpg differ diff --git a/manager/src/assets/nav/nav_showimg2.jpg b/manager/src/assets/nav/nav_showimg2.jpg index 9def75e0..99ed9c63 100644 Binary files a/manager/src/assets/nav/nav_showimg2.jpg and b/manager/src/assets/nav/nav_showimg2.jpg differ diff --git a/manager/src/libs/excel.js b/manager/src/libs/excel.js deleted file mode 100644 index 4acb2791..00000000 --- a/manager/src/libs/excel.js +++ /dev/null @@ -1,102 +0,0 @@ -import XLSX from 'xlsx'; - -function auto_width(ws, data){ - /*set worksheet max width per col*/ - const colWidth = data.map(row => row.map(val => { - /*if null/undefined*/ - if (val == null) { - return {'wch': 10}; - } - /*if chinese*/ - else if (val.toString().charCodeAt(0) > 255) { - return {'wch': val.toString().length * 2}; - } else { - return {'wch': val.toString().length}; - } - })) - /*start in the first row*/ - let result = colWidth[0]; - for (let i = 1; i < colWidth.length; i++) { - for (let j = 0; j < colWidth[i].length; j++) { - if (result[j]['wch'] < colWidth[i][j]['wch']) { - result[j]['wch'] = colWidth[i][j]['wch']; - } - } - } - ws['!cols'] = result; -} - -function json_to_array(key, jsonData){ - return jsonData.map(v => key.map(j => { return v[j] })); -} - -// fix data,return string -function fixdata(data) { - let o = '' - let l = 0 - const w = 10240 - for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w))) - o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w))) - return o -} - -// get head from excel file,return array -function get_header_row(sheet) { - const headers = [] - const range = XLSX.utils.decode_range(sheet['!ref']) - let C - const R = range.s.r /* start in the first row */ - for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */ - var cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })] /* find the cell in the first row */ - var hdr = 'UNKNOWN ' + C // <-- replace with your desired default - if (cell && cell.t) hdr = XLSX.utils.format_cell(cell) - headers.push(hdr) - } - return headers -} - -export const export_table_to_excel= (id, filename) => { - const table = document.getElementById(id); - const wb = XLSX.utils.table_to_book(table); - XLSX.writeFile(wb, filename); -} - -export const export_json_to_excel = ({data, key, title, filename, autoWidth}) => { - const wb = XLSX.utils.book_new(); - data.unshift(title); - const ws = XLSX.utils.json_to_sheet(data, {header: key, skipHeader: true}); - if(autoWidth){ - const arr = json_to_array(key, data); - auto_width(ws, arr); - } - XLSX.utils.book_append_sheet(wb, ws, filename); - XLSX.writeFile(wb, filename + '.xlsx'); -} - -export const export_array_to_excel = ({key, data, title, filename, autoWidth}) => { - const wb = XLSX.utils.book_new(); - const arr = json_to_array(key, data); - arr.unshift(title); - const ws = XLSX.utils.aoa_to_sheet(arr); - if(autoWidth){ - auto_width(ws, arr); - } - XLSX.utils.book_append_sheet(wb, ws, filename); - XLSX.writeFile(wb, filename + '.xlsx'); -} - -export const read = (data, type) => { - const workbook = XLSX.read(data, { type: type }); - const firstSheetName = workbook.SheetNames[0]; - const worksheet = workbook.Sheets[firstSheetName]; - const header = get_header_row(worksheet); - const results = XLSX.utils.sheet_to_json(worksheet); - return {header, results}; -} - -export default { - export_table_to_excel, - export_array_to_excel, - export_json_to_excel, - read -} diff --git a/manager/src/main.js b/manager/src/main.js index 1843f474..1a89101b 100644 --- a/manager/src/main.js +++ b/manager/src/main.js @@ -15,7 +15,6 @@ import vueQr from 'vue-qr' import { getRequest, postRequest, putRequest, deleteRequest, importRequest, uploadFileRequest } from '@/libs/axios' import { setStore, getStore, removeStore } from '@/libs/storage' import util from '@/libs/util' -import VueLazyload from 'vue-lazyload' import * as filters from '@/utils/filters' // global filter import liliDialog from '@/views/lili-dialog' @@ -30,10 +29,7 @@ Vue.prototype.linkTo = function (goodsId, skuId) { // 跳转买家端商品 Vue.prototype.wapLinkTo = function (goodsId, skuId) { // app端二维码 return `${buyerUrlWap}/pages/product/goods?id=${skuId}&goodsId=${goodsId}` }; -Vue.use(VueLazyload, { - error: require('./assets/img-error.png'), - loading: require('./assets/loading2.gif') -}) + Vue.use(ViewUI, { i18n: (key, value) => i18n.t(key, value) }); diff --git a/manager/src/router/router.js b/manager/src/router/router.js index 548235a5..3a7d5d48 100644 --- a/manager/src/router/router.js +++ b/manager/src/router/router.js @@ -19,7 +19,7 @@ export const otherRouter = { children: [ { path: "home", - title: { i18n: "home" }, + title: '首页', name: "home_index", component: () => import("@/views/home/home.vue") }, diff --git a/manager/src/views/customWords/index.vue b/manager/src/views/customWords/index.vue index 25d11f1d..5856769a 100644 --- a/manager/src/views/customWords/index.vue +++ b/manager/src/views/customWords/index.vue @@ -11,7 +11,6 @@ :data="data" ref="table" sortable="custom" - @on-sort-change="changeSort" @on-selection-change="changeSelect" > diff --git a/manager/src/views/distribution/distributionCash.vue b/manager/src/views/distribution/distributionCash.vue index aa1afb95..f8c213e6 100644 --- a/manager/src/views/distribution/distributionCash.vue +++ b/manager/src/views/distribution/distributionCash.vue @@ -25,7 +25,7 @@ -
+ diff --git a/manager/src/views/distribution/distributionGoods.vue b/manager/src/views/distribution/distributionGoods.vue index 2f214fab..acd87626 100644 --- a/manager/src/views/distribution/distributionGoods.vue +++ b/manager/src/views/distribution/distributionGoods.vue @@ -1,22 +1,18 @@ diff --git a/manager/src/views/distribution/distributionOrder.vue b/manager/src/views/distribution/distributionOrder.vue index 06efbe74..5db18f42 100644 --- a/manager/src/views/distribution/distributionOrder.vue +++ b/manager/src/views/distribution/distributionOrder.vue @@ -69,10 +69,13 @@ } from "@/api/distribution"; import {orderStatusList} from './dataJson' import {getShopListData} from '@/api/shops' + import vueQr from 'vue-qr' export default { name: "distributionOrder", - components: {}, + components: { + "vue-qr":vueQr + }, data() { return { timeRange: [], // 范围时间 diff --git a/manager/src/views/distribution/distributionSetting.vue b/manager/src/views/distribution/distributionSetting.vue index ac577650..04dec74d 100644 --- a/manager/src/views/distribution/distributionSetting.vue +++ b/manager/src/views/distribution/distributionSetting.vue @@ -25,7 +25,6 @@ diff --git a/manager/src/views/lili-floor-renovation/wap/template/tpl_banner.vue b/manager/src/views/lili-floor-renovation/wap/template/tpl_banner.vue index 479b4f3e..e45bd27a 100644 --- a/manager/src/views/lili-floor-renovation/wap/template/tpl_banner.vue +++ b/manager/src/views/lili-floor-renovation/wap/template/tpl_banner.vue @@ -1,6 +1,6 @@ diff --git a/manager/src/views/my-components/lili/department-choose.vue b/manager/src/views/my-components/lili/department-choose.vue index ffc07bb1..412e4d73 100644 --- a/manager/src/views/my-components/lili/department-choose.vue +++ b/manager/src/views/my-components/lili/department-choose.vue @@ -3,7 +3,6 @@ import * as API_Order from "@/api/order"; - + import vueQr from 'vue-qr' export default { name: "orderList", + components: { + "vue-qr":vueQr + }, data() { return { loading: true, // 表单加载状态 diff --git a/manager/src/views/order/after-order/orderComplaint.vue b/manager/src/views/order/after-order/orderComplaint.vue index 93752bd1..ee67eb60 100644 --- a/manager/src/views/order/after-order/orderComplaint.vue +++ b/manager/src/views/order/after-order/orderComplaint.vue @@ -72,12 +72,11 @@ diff --git a/manager/src/views/promotion/kanjia/kanjiaActivityEditGoods.vue b/manager/src/views/promotion/kanjia/kanjiaActivityEditGoods.vue index 2444c560..69f01eb4 100644 --- a/manager/src/views/promotion/kanjia/kanjiaActivityEditGoods.vue +++ b/manager/src/views/promotion/kanjia/kanjiaActivityEditGoods.vue @@ -86,10 +86,7 @@
- +
@@ -99,13 +96,11 @@ editKanJiaActivityGoods, } from "@/api/promotion"; import {regular} from "@/utils"; - import skuSelect from "@/views/lili-dialog"; + export default { name: "editKanjiaActivityGoods", - components: { - skuSelect, - }, + watch: {}, data() { const checkSettlementPrice = (rule, value, callback) => { diff --git a/manager/src/views/promotion/kanjia/kanjiaActivityGoods.vue b/manager/src/views/promotion/kanjia/kanjiaActivityGoods.vue index a2c2db2e..ea06dbf7 100644 --- a/manager/src/views/promotion/kanjia/kanjiaActivityGoods.vue +++ b/manager/src/views/promotion/kanjia/kanjiaActivityGoods.vue @@ -4,7 +4,7 @@
- + - + +
@@ -25,7 +25,7 @@
+ @on-sort-change="changeSort"> @@ -48,279 +48,272 @@
{{ row.goodsSku.quantity }}
+ @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator + show-sizer> diff --git a/manager/src/views/promotion/live/live.vue b/manager/src/views/promotion/live/live.vue index 7fcdf4cc..35fa9596 100644 --- a/manager/src/views/promotion/live/live.vue +++ b/manager/src/views/promotion/live/live.vue @@ -23,7 +23,7 @@ export default { data() { return { // 查询数据的总数 - total: "", + total: 0, // 查询的form searchForm: { pageSize: 10, diff --git a/manager/src/views/promotion/pintuan/pintuan.vue b/manager/src/views/promotion/pintuan/pintuan.vue index c0867d7f..e1ac0e90 100644 --- a/manager/src/views/promotion/pintuan/pintuan.vue +++ b/manager/src/views/promotion/pintuan/pintuan.vue @@ -95,6 +95,7 @@ export default { name: "pintuan", data() { return { + selectDate:[], //选中的数据 loading: true, // 表单加载状态 searchForm: { // 搜索框初始化对象 diff --git a/manager/src/views/promotion/pintuan/pintuanGoods.vue b/manager/src/views/promotion/pintuan/pintuanGoods.vue index ba2c249b..9516e10f 100644 --- a/manager/src/views/promotion/pintuan/pintuanGoods.vue +++ b/manager/src/views/promotion/pintuan/pintuanGoods.vue @@ -16,8 +16,6 @@ :data="goodsData" ref="table" sortable="custom" - @on-sort-change="changeSort" - @on-selection-change="changeSelect" > diff --git a/manager/vue.config.js b/manager/vue.config.js index 3a8f6944..0dab49e7 100644 --- a/manager/vue.config.js +++ b/manager/vue.config.js @@ -1,10 +1,73 @@ const path = require("path"); const CompressionPlugin = require("compression-webpack-plugin"); - +const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); const resolve = dir => { return path.join(__dirname, dir); }; +/** + * 在项目开发的时候将生产环境以及开发环境进行判断 + * 将生产环境中的路径用cdn来进行优化处理 + * 将开发环境中替换为本地的内容,方便处理bug以及开启vueDev + * 我们可以根据环境变量进行相应的处理,只有在产品的时候,才让插件去自动注入相应的资源文件到html页面 + */ +const enableProduction = process.env.NODE_ENV === "production"; // 是否生产环境 +let externals = { + vue: "Vue", + axios: "axios", + "vue-router": "VueRouter", + vuex: "Vuex", + "view-design": "iview", + "vue-lazyload": "VueLazyload", + "js-cookie": "Cookies", + wangeditor: "wangEditor", + "sockjs-client": "SockJS", + vuedraggable: "vuedraggable", + "@antv/g2": "G2", + dplayer: "DPlayer" +}; + +// 使用CDN的内容 +let cdn = { + css: ["https://cdn.jsdelivr.net/npm/view-design@4.1.1/dist/styles/iview.css"], + js: [ + // vue must at first! + "https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js", + "https://cdn.jsdelivr.net/npm/vuex@3.1.2/dist/vuex.min.js", + "https://cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js", + "https://cdn.jsdelivr.net/npm/axios@0.19.0/dist/axios.min.js", + "https://cdn.jsdelivr.net/npm/view-design@4.1.1/dist/iview.min.js", + "https://cdn.jsdelivr.net/npm/vue-lazyload@1.3.3/vue-lazyload.min.js", + "https://cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js", + "https://cdn.jsdelivr.net/npm/dplayer@1.25.0/dist/DPlayer.min.js", + "https://cdn.jsdelivr.net/npm/wangeditor@latest/dist/wangEditor.min.js", + "https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js", + "https://cdn.jsdelivr.net/npm/vuedraggable@2.23.2/dist/vuedraggable.umd.min.js", + "https://gw.alipayobjects.com/os/lib/antv/g2/4.1.24/dist/g2.min.js" + ] +}; + +// 删除注释 +let jsPlugin = [ + new UglifyJsPlugin({ + uglifyOptions: { + // 删除注释 + output: { + comments: false + }, + compress: { + drop_console: true, // 删除所有调式带有console的 + drop_debugger: true, + pure_funcs: ["console.log"] // 删除console.log + } + } + }) +]; + +// 判断是否需要加载CDN,线上删除注释 +cdn = enableProduction ? cdn : { css: [], js: [] }; +externals = enableProduction ? externals : {}; +jsPlugin = enableProduction ? jsPlugin : []; module.exports = { css: { loaderOptions: { @@ -20,37 +83,13 @@ module.exports = { port: 10003 }, - chainWebpack: config => { - // @ 对应 src目录 - config.resolve.alias.set("@", resolve("src")); - }, - // 打包时不生成.map文件 避免看到源码 productionSourceMap: false, // 部署优化 configureWebpack: { // 使用CDN - externals: { - vue: "Vue", - "vue-i18n": "VueI18n", - axios: "axios", - "vue-router": "VueRouter", - vuex: "Vuex", - "view-design": "iview", - xlsx: "XLSX", - dplayer: "DPlayer", - "print-js": "printJS", - html2canvas: "html2canvas", - "vue-json-pretty": "VueJsonPretty", - "vue-lazyload": "VueLazyload", - gitalk: "Gitalk", - "js-cookie": "Cookies", - wangEditor: "wangEditor", - stompjs: "Stomp", - "sockjs-client": "SockJS", - vuedraggable: "vuedraggable" - }, + externals: externals, // GZIP压缩 plugins: [ new CompressionPlugin({ @@ -60,6 +99,7 @@ module.exports = { ], optimization: { runtimeChunk: "single", + minimizer: jsPlugin, splitChunks: { chunks: "all", maxInitialRequests: Infinity, @@ -81,6 +121,15 @@ module.exports = { } } }, + // 将cdn的资源挂载到插件上 + chainWebpack(config) { + // @ 对应 src目录 + config.resolve.alias.set("@", resolve("src")); + config.plugin("html").tap(args => { + args[0].cdn = cdn; + return args; + }); + }, pluginOptions: { "style-resources-loader": { diff --git a/seller/package.json b/seller/package.json index 362c9ad7..563d30f4 100644 --- a/seller/package.json +++ b/seller/package.json @@ -40,6 +40,7 @@ "less-loader": "^6.2.0", "style-loader": "^2.0.0", "style-resources-loader": "^1.3.2", + "uglifyjs-webpack-plugin": "^2.2.0", "view-design": "^4.6.1", "vue-cli-plugin-style-resources-loader": "^0.1.4", "vue-template-compiler": "^2.6.10" diff --git a/seller/src/config/index.js b/seller/src/config/index.js index 5b81c21c..177a5471 100644 --- a/seller/src/config/index.js +++ b/seller/src/config/index.js @@ -2,7 +2,8 @@ export default { /** * @description 配置显示在浏览器标签的title */ - title: "Lili电商", + title: "lilishop", + /** * @description token在Cookie中存储的天数,默认1天 */ @@ -14,6 +15,8 @@ export default { */ useI18n: true, + + /** * @description api请求基础路径 */ diff --git a/seller/src/libs/excel.js b/seller/src/libs/excel.js deleted file mode 100644 index 4acb2791..00000000 --- a/seller/src/libs/excel.js +++ /dev/null @@ -1,102 +0,0 @@ -import XLSX from 'xlsx'; - -function auto_width(ws, data){ - /*set worksheet max width per col*/ - const colWidth = data.map(row => row.map(val => { - /*if null/undefined*/ - if (val == null) { - return {'wch': 10}; - } - /*if chinese*/ - else if (val.toString().charCodeAt(0) > 255) { - return {'wch': val.toString().length * 2}; - } else { - return {'wch': val.toString().length}; - } - })) - /*start in the first row*/ - let result = colWidth[0]; - for (let i = 1; i < colWidth.length; i++) { - for (let j = 0; j < colWidth[i].length; j++) { - if (result[j]['wch'] < colWidth[i][j]['wch']) { - result[j]['wch'] = colWidth[i][j]['wch']; - } - } - } - ws['!cols'] = result; -} - -function json_to_array(key, jsonData){ - return jsonData.map(v => key.map(j => { return v[j] })); -} - -// fix data,return string -function fixdata(data) { - let o = '' - let l = 0 - const w = 10240 - for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w))) - o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w))) - return o -} - -// get head from excel file,return array -function get_header_row(sheet) { - const headers = [] - const range = XLSX.utils.decode_range(sheet['!ref']) - let C - const R = range.s.r /* start in the first row */ - for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */ - var cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })] /* find the cell in the first row */ - var hdr = 'UNKNOWN ' + C // <-- replace with your desired default - if (cell && cell.t) hdr = XLSX.utils.format_cell(cell) - headers.push(hdr) - } - return headers -} - -export const export_table_to_excel= (id, filename) => { - const table = document.getElementById(id); - const wb = XLSX.utils.table_to_book(table); - XLSX.writeFile(wb, filename); -} - -export const export_json_to_excel = ({data, key, title, filename, autoWidth}) => { - const wb = XLSX.utils.book_new(); - data.unshift(title); - const ws = XLSX.utils.json_to_sheet(data, {header: key, skipHeader: true}); - if(autoWidth){ - const arr = json_to_array(key, data); - auto_width(ws, arr); - } - XLSX.utils.book_append_sheet(wb, ws, filename); - XLSX.writeFile(wb, filename + '.xlsx'); -} - -export const export_array_to_excel = ({key, data, title, filename, autoWidth}) => { - const wb = XLSX.utils.book_new(); - const arr = json_to_array(key, data); - arr.unshift(title); - const ws = XLSX.utils.aoa_to_sheet(arr); - if(autoWidth){ - auto_width(ws, arr); - } - XLSX.utils.book_append_sheet(wb, ws, filename); - XLSX.writeFile(wb, filename + '.xlsx'); -} - -export const read = (data, type) => { - const workbook = XLSX.read(data, { type: type }); - const firstSheetName = workbook.SheetNames[0]; - const worksheet = workbook.Sheets[firstSheetName]; - const header = get_header_row(worksheet); - const results = XLSX.utils.sheet_to_json(worksheet); - return {header, results}; -} - -export default { - export_table_to_excel, - export_array_to_excel, - export_json_to_excel, - read -} diff --git a/seller/src/libs/util.js b/seller/src/libs/util.js index 8de25d1f..cf931c22 100644 --- a/seller/src/libs/util.js +++ b/seller/src/libs/util.js @@ -2,12 +2,13 @@ import lazyLoading from './lazyLoading.js'; import Cookies from "js-cookie"; import { result } from './routerJson.js'; +import config from '@/config/index' let util = { }; util.title = function (title) { - title = title || 'lili 商家后台'; + title = title || `${config.title} 商家后台`; window.document.title = title; }; diff --git a/seller/src/main.js b/seller/src/main.js index 99dc25c8..f7ec69e2 100644 --- a/seller/src/main.js +++ b/seller/src/main.js @@ -1,11 +1,8 @@ -// The Vue build version to load with the `import` command -// (runtime-only or standalone) has been set in webpack.base.conf with an alias. import Vue from "vue"; import ViewUI from "view-design"; import "./styles/theme.less"; import "core-js/stable"; -// import "regenerator-runtime/runtime"; import vueQr from "vue-qr"; import App from "./App"; diff --git a/seller/src/router/router.js b/seller/src/router/router.js index 41f99bb2..6e774975 100644 --- a/seller/src/router/router.js +++ b/seller/src/router/router.js @@ -1,11 +1,11 @@ import Main from "@/views/Main.vue"; - +import config from '@/config/index' // 不作为Main组件的子页面展示的页面单独写,如下 export const loginRouter = { path: "/login", name: "login", meta: { - title: "登录 - lili商家后台" + title: `登录 - ${config.title}商家后台` }, component: () => import("@/views/login.vue") }; diff --git a/seller/src/views/Main.vue b/seller/src/views/Main.vue index eeb0744c..d114954d 100644 --- a/seller/src/views/Main.vue +++ b/seller/src/views/Main.vue @@ -24,7 +24,7 @@ - 切换 + 修改密码 退出 diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue index 91ff8ed0..cddc5413 100644 --- a/seller/src/views/goods/goods-seller/goodsOperationSec.vue +++ b/seller/src/views/goods/goods-seller/goodsOperationSec.vue @@ -509,6 +509,7 @@ export default { isIndex: "", required: "", paramId: "", + sort: "" }; } this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[ @@ -519,6 +520,7 @@ export default { isIndex: params.isIndex, required: params.required, paramId: params.id, + sort: params.sort }; }, // 编辑sku图片 diff --git a/seller/src/views/lili-components/affix-time.vue b/seller/src/views/lili-components/affix-time.vue index 96587dcf..54461bb9 100644 --- a/seller/src/views/lili-components/affix-time.vue +++ b/seller/src/views/lili-components/affix-time.vue @@ -112,8 +112,16 @@ export default { item.storeId = this.storeId; this.month = ""; - if (item.searchType == "") { - item.searchType = "LAST_SEVEN"; + if (item.searchType == "") { + if ( + dateList.some((date) => { + return date.title == item.title; + }) + ) { + item.searchType = date.searchType; + } else { + item.searchType = "LAST_SEVEN"; + } } this.selectedWay = item; diff --git a/seller/src/views/statistics/order.vue b/seller/src/views/statistics/order.vue index 1a4a8f2d..b393f9d3 100644 --- a/seller/src/views/statistics/order.vue +++ b/seller/src/views/statistics/order.vue @@ -97,7 +97,7 @@
付款笔数 - {{overViewList.paymentsNum || 0 }} + {{overViewList.paymentOrderNum || 0 }}
diff --git a/seller/vue.config.js b/seller/vue.config.js index 8b832a94..b9993b60 100644 --- a/seller/vue.config.js +++ b/seller/vue.config.js @@ -1,6 +1,6 @@ const path = require("path"); const CompressionPlugin = require("compression-webpack-plugin"); - +const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); const resolve = dir => { return path.join(__dirname, dir); }; @@ -10,7 +10,7 @@ const resolve = dir => { * 将开发环境中替换为本地的内容,方便处理bug以及开启vueDev * 我们可以根据环境变量进行相应的处理,只有在产品的时候,才让插件去自动注入相应的资源文件到html页面 */ -const enableCDN = process.env.NODE_ENV === "production"; // 是否生产环境 +const enableProduction = process.env.NODE_ENV === "production"; // 是否生产环境 let externals = { vue: "Vue", @@ -23,8 +23,7 @@ let externals = { wangeditor: "wangEditor", "sockjs-client": "SockJS", vuedraggable: "vuedraggable", - "@antv/g2": "G2", - + "@antv/g2": "G2" }; // 使用CDN的内容 @@ -42,13 +41,30 @@ let cdn = { "https://cdn.jsdelivr.net/npm/wangeditor@latest/dist/wangEditor.min.js", "https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js", "https://cdn.jsdelivr.net/npm/vuedraggable@2.23.2/dist/vuedraggable.umd.min.js", - "https://gw.alipayobjects.com/os/lib/antv/g2/4.1.24/dist/g2.min.js", + "https://gw.alipayobjects.com/os/lib/antv/g2/4.1.24/dist/g2.min.js" ] }; +// 删除注释 +let jsPlugin = [ + new UglifyJsPlugin({ + uglifyOptions: { + // 删除注释 + output: { + comments: false + }, + compress: { + drop_console: true, // 删除所有调式带有console的 + drop_debugger: true, + pure_funcs: ["console.log"] // 删除console.log + } + } + }) +]; // 判断是否需要加载CDN -cdn = enableCDN ? cdn : { css: [], js: [] }; -externals = enableCDN ? externals : {}; +cdn = enableProduction ? cdn : { css: [], js: [] }; +externals = enableProduction ? externals : {}; +jsPlugin = enableProduction ? jsPlugin : []; module.exports = { css: { @@ -80,6 +96,7 @@ module.exports = { }) ], optimization: { + minimizer: jsPlugin, runtimeChunk: "single", splitChunks: { chunks: "all",