diff --git a/buyer/src/components/map/index.vue b/buyer/src/components/map/index.vue index 1c5b9467..13365bd6 100644 --- a/buyer/src/components/map/index.vue +++ b/buyer/src/components/map/index.vue @@ -31,6 +31,7 @@ <% } %> + diff --git a/manager/src/api/index.js b/manager/src/api/index.js index 976c3cd0..91b0f394 100644 --- a/manager/src/api/index.js +++ b/manager/src/api/index.js @@ -10,9 +10,9 @@ import { postRequestWithNoForm, managerUrl } from "@/libs/axios"; -import config from "@/config"; -let commonUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.common : config.api_prod.common) + +let commonUrl = (process.env.NODE_ENV === 'development' ? BASE.API_DEV.common : BASE.API_PROD.common) // 文件上传接口 export const uploadFile = commonUrl+ "/common/upload/file"; diff --git a/manager/src/config/index.js b/manager/src/config/index.js index a27badcf..a35d0cc8 100644 --- a/manager/src/config/index.js +++ b/manager/src/config/index.js @@ -2,7 +2,7 @@ export default { /** * @description 配置显示在浏览器标签的title */ - title: "Lili电商", + title: "lilishop", /** * @description token在Cookie中存储的天数,默认1天 */ @@ -16,26 +16,14 @@ export default { /** * @description api请求基础路径 */ - api_dev: { - common: "https://common-api.pickmall.cn", - buyer: "https://buyer-api.pickmall.cn", - seller: "https://store-api.pickmall.cn", - manager: "https://admin-api.pickmall.cn" - // common: 'http://192.168.0.100:8890', - // buyer: 'http://192.168.0.100:8888', - // seller: 'http://192.168.0.100:8889', - // manager: 'http://192.168.0.100:8887' - }, - api_prod: { - common: "https://common-api.pickmall.cn", - buyer: "https://buyer-api.pickmall.cn", - seller: "https://store-api.pickmall.cn", - manager: "https://admin-api.pickmall.cn" - }, - /** - * @description api请求基础路径前缀 + /** + * @description 高德web端申请的api key */ - baseUrlPrefix: "/manager", + aMapKey: "b440952723253aa9fe483e698057bf7d", + /** + * @description 官网地址 + */ + website: "https://www.pickmall.cn", /** * @description 需要加载的插件 */ diff --git a/manager/src/libs/axios.js b/manager/src/libs/axios.js index fbfbbbb2..9a97047d 100644 --- a/manager/src/libs/axios.js +++ b/manager/src/libs/axios.js @@ -1,31 +1,36 @@ import axios from "axios"; -import config from "@/config"; -import {getStore, setStore} from "./storage.js"; -import {router} from "../router/index"; -import {Message} from "view-design"; +import { getStore, setStore } from "./storage.js"; +import { router } from "../router/index"; +import { Message } from "view-design"; import Cookies from "js-cookie"; -import {handleRefreshToken} from "../api/index" +import { handleRefreshToken } from "../api/index"; // 统一请求路径前缀 -export const commonUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.common : config.api_prod.common); -export const managerUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.manager : config.api_prod.manager) + config.baseUrlPrefix; +export const commonUrl = + process.env.NODE_ENV === "development" + ? BASE.API_DEV.common + : BASE.API_PROD.common; +export const managerUrl = + (process.env.NODE_ENV === "development" + ? BASE.API_DEV.manager + : BASE.API_PROD.manager) + BASE.PREFIX; const service = axios.create({ timeout: 8000, baseURL: managerUrl -}) +}); var isRefreshToken = 0; -const refreshToken = getTokenDebounce() +const refreshToken = getTokenDebounce(); service.interceptors.request.use( config => { - if (config.method == 'get') { + if (config.method == "get") { config.params = { _t: Date.parse(new Date()) / 1000, ...config.params - } + }; } - const uuid = getStore('uuid'); - config.headers['uuid'] = uuid; + const uuid = getStore("uuid"); + config.headers["uuid"] = uuid; return config; }, err => { @@ -36,7 +41,7 @@ service.interceptors.request.use( // http response 拦截器 service.interceptors.response.use( - (response) => { + response => { const data = response.data; // 根据返回的code值来做不同的处理(和后端约定) if (!data.success && data.message) { @@ -76,7 +81,7 @@ service.interceptors.response.use( return data; } }, - async (error) => { + async error => { // 返回状态码不为200时候的错误处理 if (error.response) { if (error.response.status === 401) { @@ -85,80 +90,79 @@ service.interceptors.response.use( // 避免刷新token报错 } else if (error.response.status === 403) { isRefreshToken++; - if(isRefreshToken === 1) { + if (isRefreshToken === 1) { const getTokenRes = await refreshToken(); - if (getTokenRes === 'success') { // 刷新token + if (getTokenRes === "success") { + // 刷新token if (isRefreshToken === 1) { - error.response.config.headers.accessToken = getStore('accessToken') - return service(error.response.config) + error.response.config.headers.accessToken = getStore( + "accessToken" + ); + return service(error.response.config); } else { - router.go(0) + router.go(0); } } else { Cookies.set("userInfoManager", ""); - router.push('/login') + router.push("/login"); } - isRefreshToken = 0 + isRefreshToken = 0; } - } else { // 其他错误处理 console.log(error.response.data); - Message.error(error.response.data.message) + Message.error(error.response.data.message); } } /* router.push("/login") */ return Promise.resolve(error); } -) - +); // 防抖闭包来一波 function getTokenDebounce() { - let lock = false - let success = false - return function () { + let lock = false; + let success = false; + return function() { if (!lock) { - lock = true + lock = true; let oldRefreshToken = getStore("refreshToken"); - handleRefreshToken(oldRefreshToken).then(res => { - if (res.success) { - let { - accessToken, - refreshToken - } = res.result; - setStore("accessToken", accessToken); - setStore("refreshToken", refreshToken); + handleRefreshToken(oldRefreshToken) + .then(res => { + if (res.success) { + let { accessToken, refreshToken } = res.result; + setStore("accessToken", accessToken); + setStore("refreshToken", refreshToken); - success = true - lock = false - } else { - success = false - lock = false - router.push('/login') - } - }).catch((err) => { - success = false - lock = false - }) + success = true; + lock = false; + } else { + success = false; + lock = false; + router.push("/login"); + } + }) + .catch(err => { + success = false; + lock = false; + }); } return new Promise(resolve => { // 一直看lock,直到请求失败或者成功 const timer = setInterval(() => { if (!lock) { - clearInterval(timer) + clearInterval(timer); if (success) { - resolve('success') + resolve("success"); } else { - resolve('fail') + resolve("fail"); } } - }, 500) // 轮询时间间隔 - }) - } + }, 500); // 轮询时间间隔 + }); + }; } - export const getRequest = (url, params) => { let accessToken = getStore("accessToken"); return service({ @@ -180,19 +184,19 @@ export const postRequest = (url, params, headers) => { transformRequest: headers ? undefined : [ - function (data) { - let ret = ""; - for (let it in data) { - ret += - encodeURIComponent(it) + - "=" + - encodeURIComponent(data[it]) + - "&"; + function(data) { + let ret = ""; + for (let it in data) { + ret += + encodeURIComponent(it) + + "=" + + encodeURIComponent(data[it]) + + "&"; + } + ret = ret.substring(0, ret.length - 1); + return ret; } - ret = ret.substring(0, ret.length - 1); - return ret; - } - ], + ], headers: { "Content-Type": "application/x-www-form-urlencoded", accessToken: accessToken, @@ -238,19 +242,19 @@ export const putRequest = (url, params, headers) => { transformRequest: headers ? undefined : [ - function (data) { - let ret = ""; - for (let it in data) { - ret += - encodeURIComponent(it) + - "=" + - encodeURIComponent(data[it]) + - "&"; + function(data) { + let ret = ""; + for (let it in data) { + ret += + encodeURIComponent(it) + + "=" + + encodeURIComponent(data[it]) + + "&"; + } + ret = ret.substring(0, ret.length - 1); + return ret; } - ret = ret.substring(0, ret.length - 1); - return ret; - } - ], + ], headers: { "Content-Type": "application/x-www-form-urlencoded", accessToken: accessToken, @@ -321,7 +325,6 @@ export const getRequestWithNoToken = (url, params) => { }); }; - /** * 无需token验证的请求 避免旧token过期导致请求失败 * @param {*} url @@ -334,4 +337,3 @@ export const postRequestWithNoToken = (url, params) => { params: params }); }; - diff --git a/manager/src/libs/util.js b/manager/src/libs/util.js index 31154b09..142e9f1a 100644 --- a/manager/src/libs/util.js +++ b/manager/src/libs/util.js @@ -1,21 +1,16 @@ -import axios from 'axios'; -import { - getCurrentPermissionList -} from '@/api/index'; -import lazyLoading from './lazyLoading.js'; -import router from '@/router/index'; +import { getCurrentPermissionList } from "@/api/index"; +import lazyLoading from "./lazyLoading.js"; + import Cookies from "js-cookie"; -let util = { +let util = {}; -}; - -util.title = function (title) { - title = title || 'lili 运营后台'; +util.title = function(title) { + title = title || "运营后台"; window.document.title = title; }; // 判断元素是否存在于数组中 -util.oneOf = function (ele, targetArr) { +util.oneOf = function(ele, targetArr) { if (targetArr.indexOf(ele) >= 0) { return true; } else { @@ -24,7 +19,7 @@ util.oneOf = function (ele, targetArr) { }; // 打开新的页面 -util.openNewPage = function (vm, name, argu, query) { +util.openNewPage = function(vm, name, argu, query) { if (!vm.$store) { return; } @@ -33,8 +28,9 @@ util.openNewPage = function (vm, name, argu, query) { let i = 0; let tagHasOpened = false; while (i < openedPageLen) { - if (name == pageOpenedList[i].name) { // 页面已经打开 - vm.$store.commit('pageOpenedList', { + if (name == pageOpenedList[i].name) { + // 页面已经打开 + vm.$store.commit("pageOpenedList", { index: i, argu: argu, query: query @@ -45,7 +41,7 @@ util.openNewPage = function (vm, name, argu, query) { i++; } if (!tagHasOpened) { - let tag = vm.$store.state.app.tagsList.filter((item) => { + let tag = vm.$store.state.app.tagsList.filter(item => { if (item.children) { return name == item.children[0].name; } else { @@ -61,17 +57,21 @@ util.openNewPage = function (vm, name, argu, query) { if (query) { tag.query = query; } - vm.$store.commit('increateTag', tag); + vm.$store.commit("increateTag", tag); } } }; -util.toDefaultPage = function (routers, name, route, next) { +util.toDefaultPage = function(routers, name, route, next) { let len = routers.length; let i = 0; let notHandle = true; while (i < len) { - if (routers[i].name == name && routers[i].children && routers[i].redirect == undefined) { + if ( + routers[i].name == name && + routers[i].children && + routers[i].redirect == undefined + ) { route.replace({ name: routers[i].children[0].name }); @@ -86,21 +86,24 @@ util.toDefaultPage = function (routers, name, route, next) { } }; -util.initRouter = function (vm) { // 初始化路由 +util.initRouter = function(vm) { + // 初始化路由 const constRoutes = []; const otherRoutes = []; // 404路由需要和动态路由一起加载 - const otherRouter = [{ - path: '/*', - name: 'error-404', - meta: { - title: '404-页面不存在' - }, - frontRoute: 'error-page/404' - }]; + const otherRouter = [ + { + path: "/*", + name: "error-404", + meta: { + title: "404-页面不存在" + }, + frontRoute: "error-page/404" + } + ]; // 判断用户是否登录 - let userInfo = Cookies.get('userInfoManager') + let userInfo = Cookies.get("userInfoManager"); if (!userInfo) { // 未登录 return; @@ -114,13 +117,13 @@ util.initRouter = function (vm) { // 初始化路由 // 格式化数据,设置 空children 为 null for (let i = 0; i < menuData.length; i++) { - let t = menuData[i].children + let t = menuData[i].children; for (let k = 0; k < t.length; k++) { let tt = t[k].children; for (let z = 0; z < tt.length; z++) { - tt[z].children = null + tt[z].children = null; // 给所有三级路由添加字段,显示一级菜单name,方便点击页签时的选中筛选 - tt[z].firstRouterName = menuData[i].name + tt[z].firstRouterName = menuData[i].name; } } } @@ -131,20 +134,23 @@ util.initRouter = function (vm) { // 初始化路由 util.initAllMenuData(constRoutes, menuData); util.initRouterNode(otherRoutes, otherRouter); // 添加所有主界面路由 - vm.$store.commit('updateAppRouter', constRoutes.filter(item => item.children.length > 0)); + vm.$store.commit( + "updateAppRouter", + constRoutes.filter(item => item.children.length > 0) + ); // 添加全局路由 - vm.$store.commit('updateDefaultRouter', otherRoutes); + vm.$store.commit("updateDefaultRouter", otherRoutes); // 添加菜单路由 util.initMenuData(vm, menuData); // 缓存数据 修改加载标识 - window.localStorage.setItem('menuData', JSON.stringify(menuData)); - vm.$store.commit('setAdded', true); + window.localStorage.setItem("menuData", JSON.stringify(menuData)); + vm.$store.commit("setAdded", true); }); } else { // 读取缓存数据 - let data = window.localStorage.getItem('menuData'); + let data = window.localStorage.getItem("menuData"); if (!data) { - vm.$store.commit('setAdded', false); + vm.$store.commit("setAdded", false); return; } let menuData = JSON.parse(data); @@ -154,21 +160,20 @@ util.initRouter = function (vm) { // 初始化路由 }; // 添加所有顶部导航栏下的菜单路由 -util.initAllMenuData = function (constRoutes, data) { - +util.initAllMenuData = function(constRoutes, data) { let allMenuData = []; data.forEach(e => { if (e.level == 0) { e.children.forEach(item => { allMenuData.push(item); - }) + }); } - }) + }); util.initRouterNode(constRoutes, allMenuData); -} +}; // 生成菜单格式数据 -util.initMenuData = function (vm, data) { +util.initMenuData = function(vm, data) { const menuRoutes = []; let menuData = data; // 顶部菜单 @@ -177,29 +182,29 @@ util.initMenuData = function (vm, data) { let nav = { name: e.name, title: e.title - } + }; navList.push(nav); - }) + }); if (navList.length < 1) { return; } // 存入vuex - vm.$store.commit('setNavList', navList); - let currNav = window.localStorage.getItem('currNav') + vm.$store.commit("setNavList", navList); + let currNav = window.localStorage.getItem("currNav"); if (currNav) { // 读取缓存title for (var item of navList) { if (item.name == currNav) { - vm.$store.commit('setCurrNavTitle', item.title); + vm.$store.commit("setCurrNavTitle", item.title); break; } } } else { // 默认第一个 currNav = navList[0].name; - vm.$store.commit('setCurrNavTitle', navList[0].title); + vm.$store.commit("setCurrNavTitle", navList[0].title); } - vm.$store.commit('setCurrNav', currNav); + vm.$store.commit("setCurrNav", currNav); for (let item of menuData) { if (item.name == currNav) { // 过滤 @@ -209,21 +214,25 @@ util.initMenuData = function (vm, data) { } util.initRouterNode(menuRoutes, menuData); // 刷新界面菜单 - vm.$store.commit('updateMenulist', menuRoutes.filter(item => item.children.length > 0)); + vm.$store.commit( + "updateMenulist", + menuRoutes.filter(item => item.children.length > 0) + ); let tagsList = []; - vm.$store.state.app.routers.map((item) => { + vm.$store.state.app.routers.map(item => { if (item.children.length <= 1) { tagsList.push(item.children[0]); } else { tagsList.push(...item.children); } }); - vm.$store.commit('setTagsList', tagsList); + vm.$store.commit("setTagsList", tagsList); }; // 生成路由节点 -util.initRouterNode = function (routers, data) { // data为所有子菜单数据 +util.initRouterNode = function(routers, data) { + // data为所有子菜单数据 for (let item of data) { let menu = Object.assign({}, item); @@ -237,8 +246,8 @@ util.initRouterNode = function (routers, data) { // data为所有子菜单数据 let meta = {}; // 给页面添加标题、父级菜单name(方便左侧菜单选中) - meta.title = menu.title ? menu.title + " - lilishop 运营后台" : null; - meta.firstRouterName = item.firstRouterName + meta.title = menu.title ? menu.title + " - 运营后台" : null; + meta.firstRouterName = item.firstRouterName; menu.meta = meta; routers.push(menu); diff --git a/manager/src/locale/lang/en-US.js b/manager/src/locale/lang/en-US.js index eaaff0a1..146297a8 100644 --- a/manager/src/locale/lang/en-US.js +++ b/manager/src/locale/lang/en-US.js @@ -1,5 +1,7 @@ + +import config from '@/config/index' export default { - lili: 'lili', + lili: config.title, usernameLogin: 'UsernameLogin', mobileLogin: 'MobileLogin', autoLogin: 'Auto Login', diff --git a/manager/src/locale/lang/zh-CN.js b/manager/src/locale/lang/zh-CN.js index 968673b1..1abc9eb8 100644 --- a/manager/src/locale/lang/zh-CN.js +++ b/manager/src/locale/lang/zh-CN.js @@ -1,5 +1,6 @@ +import config from '@/config/index' export default { - lili: 'lili', + lili: config.title, usernameLogin: '账户密码登录', mobileLogin: '手机号登录', autoLogin: '自动登录', diff --git a/manager/src/main.js b/manager/src/main.js index 1a89101b..cd54c5b1 100644 --- a/manager/src/main.js +++ b/manager/src/main.js @@ -11,7 +11,7 @@ import App from './App' import { router } from './router/index' import store from './store' import i18n from '@/locale' -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' @@ -21,13 +21,13 @@ import liliDialog from '@/views/lili-dialog' import {md5} from '@/utils/md5.js'; Vue.config.devtools = true; Vue.config.productionTip = false -const buyerUrlPC = 'https://pc-b2b2c.pickmall.cn' // 跳转买家端地址 pc端 -const buyerUrlWap = 'https://m-b2b2c.pickmall.cn' // 跳转买家端地址 wap端 +const PC_URL = BASE.PC_URL; // 跳转买家端地址 pc端 +const WAP_URL = BASE.WAP_URL; // 跳转买家端地址 wap端 Vue.prototype.linkTo = function (goodsId, skuId) { // 跳转买家端商品 - window.open(`${buyerUrlPC}/goodsDetail?skuId=${skuId}&goodsId=${goodsId}`, '_blank') + window.open(`${PC_URL}/goodsDetail?skuId=${skuId}&goodsId=${goodsId}`, '_blank') }; Vue.prototype.wapLinkTo = function (goodsId, skuId) { // app端二维码 - return `${buyerUrlWap}/pages/product/goods?id=${skuId}&goodsId=${goodsId}` + return `${WAP_URL}/pages/product/goods?id=${skuId}&goodsId=${goodsId}` }; Vue.use(ViewUI, { @@ -35,7 +35,7 @@ Vue.use(ViewUI, { }); Vue.component('liliDialog',liliDialog) -Vue.component(vueQr) + diff --git a/manager/src/router/router.js b/manager/src/router/router.js index 3a7d5d48..1f5bf787 100644 --- a/manager/src/router/router.js +++ b/manager/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/manager/src/styles/common.scss b/manager/src/styles/common.scss index c2816e89..b0b7b0eb 100644 --- a/manager/src/styles/common.scss +++ b/manager/src/styles/common.scss @@ -1,4 +1,3 @@ -$theme_color: #804ed1; //自动移滚动条样式 @@ -89,113 +88,15 @@ ul,li{ text-overflow:ellipsis; white-space: nowrap; } - -/* - * @Author: LMR - * @Date: 2020-08-14 11:04:12 - * @Last Modified by: LMR - * @Last Modified time: 2020-08-18 14:21:41 - */ - // 主题颜色 -// 明亮主题颜色 -$primary_color: #2d8cf0; -$primary_light_color: #0f1011; -$primary_dark_color: #2b85e4; -$success_color: #19be6b; -$warning_color: #ff9900; -$error_color: #ed3f14; -$handle-btn-color: #438cde; - -$theme_color: #ed3f14; -.theme_color{ - color: #ed3f14 !important; +$success_color: #68cabe; +$warning_color: #fa6419; +$error_color: #ff3c2a; +$theme_color: #FF5C58; +.theme_color { + color: $theme_color !important; } -$border_color: #dddee1; -$title_color: #8c8c8c; -$light_title_color: #1c2438; -$light_content_color: #495060; -$light_sub_color: #80848f; -$light_background_color: #f8f8f9; -$light_white_background_color: #fff; -// 暗黑主题颜色 -$dark_background_color: #141414; -$dark_sub_background_color: #1d1d1d; //稍微浅一点的 -$dark_content_color: #d5d5d5; +$bg_color: #f1f6fa; -/***** 封装一些方法可用于 黑暗主题 ,明亮主题 *****/ - -// 背景颜色 -@mixin background_color($color) { - /*通过该函数设置字体颜色,后期方便统一管理;*/ - background-color: $color; - transition: 0.35s; - [data-theme="dark"] & { - background-color: $dark_background_color; - } - [data-theme="light"] & { - background-color: $light_background_color; - } -} -// 辅助背景颜色 -@mixin sub_background_color($color) { - /*通过该函数设置字体颜色,后期方便统一管理;*/ - background-color: $color; - transition: 0.35s; - [data-theme="dark"] & { - background-color: $dark_sub_background_color; - } - [data-theme="light"] & { - background-color: $light_background_color; - } -} - -@mixin white_background_color() { - /*通过该函数设置字体颜色,后期方便统一管理;*/ - background-color: $light_white_background_color; - transition: 0.35s; - [data-theme="dark"] & { - background-color: $dark_sub_background_color; - } - [data-theme="light"] & { - background-color: $light_white_background_color; - } -} - -// 正文颜色 -@mixin content_color($color) { - /*通过该函数设置字体颜色,后期方便统一管理;*/ - color: $color; - [data-theme="dark"] & { - color: $dark_content_color; - } - [data-theme="light"] & { - color: $light_content_color; - } -} - -// 辅助颜色 -@mixin sub_color($color) { - /*通过该函数设置字体颜色,后期方便统一管理;*/ - color: $color; - [data-theme="dark"] & { - color: $dark_content_color; - } - [data-theme="light"] & { - color: $light_sub_color; - } -} - -// 标题颜色 -@mixin title_color($color) { - /*通过该函数设置字体颜色,后期方便统一管理;*/ - color: $color; - [data-theme="dark"] & { - color: $dark_content_color; - } - [data-theme="light"] & { - color: $light_title_color; - } -} @import "./table-common.scss"; \ No newline at end of file diff --git a/manager/src/styles/theme.less b/manager/src/styles/theme.less index 3bd68682..8533f81d 100644 --- a/manager/src/styles/theme.less +++ b/manager/src/styles/theme.less @@ -1,13 +1,16 @@ @import "~view-design/src/styles/index.less"; // iview 自定义样式 -@primary-color: #ed3f14; - +@primary-color: #ff5c58; +@info-color: #fa6419; +@success-color: #68cabe; +@error-color: #ff3c2a; @table-thead-bg: #f8f8f9; @table-td-stripe-bg: #f8f8f9; @table-td-hover-bg: #ededed; @table-td-highlight-bg: #ededed; @font-size-base: 12px; + .ivu-drawer, .drawer, .ivu-drawer-wrap { diff --git a/manager/src/views/distribution/distributionGoods.vue b/manager/src/views/distribution/distributionGoods.vue index acd87626..ffcea359 100644 --- a/manager/src/views/distribution/distributionGoods.vue +++ b/manager/src/views/distribution/distributionGoods.vue @@ -74,7 +74,7 @@ export default { render: (h, params) => { return h("img", { attrs: { - src: params.row.thumbnail, + src: params.row.thumbnail || '', alt: "加载图片失败", }, style: { diff --git a/manager/src/views/goods/goods-manage/brand.vue b/manager/src/views/goods/goods-manage/brand.vue index dfdd859e..8c91f298 100644 --- a/manager/src/views/goods/goods-manage/brand.vue +++ b/manager/src/views/goods/goods-manage/brand.vue @@ -85,7 +85,7 @@ export default { render: (h, params) => { return h("img", { attrs: { - src: params.row.logo, + src: params.row.logo || '', alt: "加载图片失败", }, style: { diff --git a/manager/src/views/home/home.scss b/manager/src/views/home/home.scss index a4ed760a..9d87f1dd 100644 --- a/manager/src/views/home/home.scss +++ b/manager/src/views/home/home.scss @@ -90,8 +90,7 @@ h4 { color: #ffaa71; } } -.count-list { -} + .flow-list { height: 330px; diff --git a/manager/src/views/lili-floor-renovation/modelConfig.js b/manager/src/views/lili-floor-renovation/modelConfig.js index 21987144..7b500904 100644 --- a/manager/src/views/lili-floor-renovation/modelConfig.js +++ b/manager/src/views/lili-floor-renovation/modelConfig.js @@ -615,7 +615,7 @@ export const modelData = [{ icon: 'md-image', options: { list: [{ - name: 'LILI生鲜', + name: '生鲜', describe: "年货带回家 满199减60", img: require('@/assets/nav/decorate8.png'), url: '', @@ -624,8 +624,8 @@ export const modelData = [{ size: '170*170' }, { - name: 'LILI众筹', - describe: "备孕有孕检测仪", + name: '众筹', + describe: "年货带回家", img: require('@/assets/nav/decorate9.png'), url: '', fromColor: "#325bb4", @@ -633,7 +633,7 @@ export const modelData = [{ size: '170*170' }, { - name: 'LILI生鲜', + name: '生鲜', describe: "年货带回家 满199减60", img: require('@/assets/nav/decorate8.png'), url: '', @@ -642,7 +642,7 @@ export const modelData = [{ size: '170*170' }, { - name: 'LILI众筹', + name: '众筹', describe: "备孕有孕检测仪", img: require('@/assets/nav/decorate9.png'), url: '', @@ -651,7 +651,7 @@ export const modelData = [{ size: '170*170' }, { - name: 'LILI生鲜', + name: '生鲜', describe: "年货带回家 满199减60", img: require('@/assets/nav/decorate8.png'), url: '', @@ -660,7 +660,7 @@ export const modelData = [{ size: '170*170' }, { - name: 'LILI众筹', + name: '众筹', describe: "备孕有孕检测仪", img: require('@/assets/nav/decorate9.png'), url: '', diff --git a/manager/src/views/lili-floor-renovation/modelList/carousel.vue b/manager/src/views/lili-floor-renovation/modelList/carousel.vue index e7c22a80..970f57e9 100644 --- a/manager/src/views/lili-floor-renovation/modelList/carousel.vue +++ b/manager/src/views/lili-floor-renovation/modelList/carousel.vue @@ -22,7 +22,7 @@
-
Hi,{{ userInfo.nickName || "欢迎来到LiLi Shop" | secrecyMobile }}
+
Hi,{{ userInfo.nickName || "欢迎来到管理后台" | secrecyMobile }}
@@ -263,7 +263,7 @@ export default { margin-left: 5px; } span:nth-child(1) { - @include content_color($theme_color); + color: $theme_color; margin-left: 0; } span:nth-child(2) { diff --git a/manager/src/views/lili-floor-renovation/modelList/carousel2.vue b/manager/src/views/lili-floor-renovation/modelList/carousel2.vue index ebeefc15..39a0606a 100644 --- a/manager/src/views/lili-floor-renovation/modelList/carousel2.vue +++ b/manager/src/views/lili-floor-renovation/modelList/carousel2.vue @@ -43,7 +43,7 @@
-
Hi,{{ userInfo.nickName || "欢迎来到LiLi Shop" | secrecyMobile }}
+
Hi,{{ userInfo.nickName || "欢迎来到管理后台" | secrecyMobile }}
@@ -343,7 +343,7 @@ export default { margin-left: 5px; } span:nth-child(1) { - @include content_color($theme_color); + color: $theme_color; margin-left: 0; } span:nth-child(2) { diff --git a/manager/src/views/login.vue b/manager/src/views/login.vue index f0709603..386ceddf 100644 --- a/manager/src/views/login.vue +++ b/manager/src/views/login.vue @@ -141,15 +141,7 @@ export default { align-items: center; justify-content: center; - .ivu-tabs-nav-container { - line-height: 2; - font-size: 17px; - box-sizing: border-box; - white-space: nowrap; - overflow: hidden; - position: relative; - zoom: 1; - } + .verify-con { position: absolute; top: 150px; @@ -159,37 +151,27 @@ export default { .form { padding-top: 1vh; - .input-verify { - width: 67%; - } } - .forget-pass, - .other-way { - font-size: 14px; - } - - .login-btn, - .other-login { - margin-top: 3vh; - } - - .icons { - display: flex; - align-items: center; - } - - .other-icon { + .login-btn { + background: linear-gradient(135deg, $theme_color 0%, $warning_color 100%); + height: 40px; cursor: pointer; - margin-left: 10px; + border-radius: 4px; display: flex; align-items: center; - color: rgba(0, 0, 0, 0.2); - - :hover { - color: #2d8cf0; - } + justify-content: center; + font-size: 16px; + color: #fff; + width: 100%; + text-align: center; + transition: 0.35s; } + .login-btn:hover { + opacity: .9; + border-radius: 10px; + } + } .flex { justify-content: center; diff --git a/manager/src/views/main-components/footer.vue b/manager/src/views/main-components/footer.vue index 1b1fe0f6..bf6a6caa 100644 --- a/manager/src/views/main-components/footer.vue +++ b/manager/src/views/main-components/footer.vue @@ -1,28 +1,26 @@ @@ -46,4 +44,5 @@ export default { } } } + diff --git a/manager/src/views/main-components/tags-page-opened.vue b/manager/src/views/main-components/tags-page-opened.vue index 9e2f432b..a7edb4fe 100644 --- a/manager/src/views/main-components/tags-page-opened.vue +++ b/manager/src/views/main-components/tags-page-opened.vue @@ -248,6 +248,6 @@ export default { } } .ivu-tag-primary, .ivu-tag-primary.ivu-tag-dot .ivu-tag-dot-inner{ - background: red; + background: $theme_color; } diff --git a/manager/src/views/my-components/map/index.vue b/manager/src/views/my-components/map/index.vue index 1b7ec301..317531ab 100644 --- a/manager/src/views/my-components/map/index.vue +++ b/manager/src/views/my-components/map/index.vue @@ -31,9 +31,11 @@ diff --git a/seller/src/api/address.js b/seller/src/api/address.js index ccbd6d84..da29b353 100644 --- a/seller/src/api/address.js +++ b/seller/src/api/address.js @@ -1,5 +1,5 @@ // 统一请求路径前缀在libs/axios.js中修改 -import {getRequest, postRequest, putRequest, deleteRequest, importRequest, getRequestWithNoToken} from '@/libs/axios'; +import {getRequest} from '@/libs/axios'; // 传给后台citycode 获取城市街道等id diff --git a/seller/src/api/common.js b/seller/src/api/common.js index aea5012d..8b8ae7c4 100644 --- a/seller/src/api/common.js +++ b/seller/src/api/common.js @@ -6,6 +6,6 @@ export const getChildRegion = (id) => { }; // 点地图获取地址信息 -export const getRegion = (parpams) => { - return getRequest(`${commonUrl}/common/region/region`, parpams); +export const getRegion = (params) => { + return getRequest(`${commonUrl}/common/region/region`, params); }; diff --git a/seller/src/config/index.js b/seller/src/config/index.js index a126144c..a3d1e757 100644 --- a/seller/src/config/index.js +++ b/seller/src/config/index.js @@ -39,6 +39,14 @@ export default { * @description api请求基础路径前缀 */ baseUrlPrefix: "/store", + /** + * @description 高德web端申请的api key + */ + aMapKey: "b440952723253aa9fe483e698057bf7d", + /** + * @description 官网地址 + */ + website: "https://www.pickmall.cn", /** * @description 需要加载的插件 */ diff --git a/seller/src/libs/dictUtil.js b/seller/src/libs/dictUtil.js deleted file mode 100644 index 9f3d0fbb..00000000 --- a/seller/src/libs/dictUtil.js +++ /dev/null @@ -1,32 +0,0 @@ -import axios from 'axios'; -import { getDictData } from '@/api/index'; - -let dictUtil = { - -}; - -// 获取常用的数据字典保存至vuex -dictUtil.initDictData = function (vm) { - // axios.get(getDictData + "sex").then(res => { - // if(res.success){ - // vm.$store.commit("setSex", res.result); - // } - // }); - // axios.get(getDictData + "message_type").then(res => { - // if(res.success){ - // vm.$store.commit("setMessageType", res.result); - // } - // }); - // axios.get(getDictData + "priority").then(res => { - // if(res.success){ - // vm.$store.commit("setPriority", res.result); - // } - // }); - // axios.get(getDictData + "leave_type").then(res => { - // if(res.success){ - // vm.$store.commit("setLeaveType", res.result); - // } - // }); -}; - -export default dictUtil; diff --git a/seller/src/libs/hasPermission.js b/seller/src/libs/hasPermission.js deleted file mode 100644 index 5e1f42b8..00000000 --- a/seller/src/libs/hasPermission.js +++ /dev/null @@ -1,14 +0,0 @@ -const hasPermission = { - install (Vue, options) { - Vue.directive('has', { - inserted (el, binding, vnode) { - let permTypes = vnode.context.$route.meta.permTypes; - if (permTypes&&!permTypes.includes(binding.value)) { - el.parentNode.removeChild(el); - } - } - }); - } -}; - -export default hasPermission; diff --git a/seller/src/libs/hasRole.js b/seller/src/libs/hasRole.js deleted file mode 100644 index 4fadf551..00000000 --- a/seller/src/libs/hasRole.js +++ /dev/null @@ -1,16 +0,0 @@ -import { getStore } from './storage'; - -const hasRole = { - install (Vue, options) { - Vue.directive('hasRole', { - inserted (el, binding) { - let roles = getStore("roles"); - if (roles&&!roles.includes(binding.value)) { - el.parentNode.removeChild(el); - } - } - }); - } -}; - -export default hasRole; diff --git a/seller/src/libs/importTemplate.js b/seller/src/libs/importTemplate.js deleted file mode 100644 index 9d073595..00000000 --- a/seller/src/libs/importTemplate.js +++ /dev/null @@ -1,82 +0,0 @@ -// 导入表格模版数据 -export const userColumns = [ - { - title: "username", - key: "username" - }, - { - title: "password", - key: "password" - }, - { - title: "avatar", - key: "avatar" - }, - { - title: "departmentId", - key: "departmentId" - }, - { - title: "mobile", - key: "mobile" - }, - { - title: "email", - key: "email" - }, - { - title: "sex", - key: "sex" - }, - { - title: "address", - key: "address" - }, - { - title: "type", - key: "type" - }, - { - title: "status", - key: "status" - }, - { - title: "delFlag", - key: "delFlag" - }, - { - title: "defaultRole", - key: "defaultRole" - } -] - -export const userData = [ - { - username: "【记得删除该说明行】唯一用户名不能为空", - password: "密码不能为空", - avatar: "头像图片链接", - departmentId: "部门表主键id", - email: "邮箱", - mobile: "手机", - sex: "性别 0(女) 1(男)", - address: "地址数据省市编号 请勿乱填", - type: "用户类型 0(普通用户) 1(管理员)", - status: "用户状态 0(正常) -1(禁用)", - delFlag: "删除标志 0(正常) 1(已删)", - defaultRole: "角色 0(不分配默认角色) 1(分配默认注册用户角色)" - }, - { - username: "lili", - password: "123456", - avatar: "https://s1.ax1x.com/2018/05/19/CcdVQP.png", - departmentId: "40652338142121984", - email: "1012139570@qq.com", - sex: 1, - address: "[\"510000\",\"510100\",\"510104\"]", - mobile: "18782059038", - type: 0, - status: 0, - delFlag: 0, - defaultRole: 1 - } -] \ No newline at end of file diff --git a/seller/src/libs/table2excel.js b/seller/src/libs/table2excel.js deleted file mode 100644 index 1569a9fd..00000000 --- a/seller/src/libs/table2excel.js +++ /dev/null @@ -1,100 +0,0 @@ -var idTmr; -function getExplorer () { - var explorer = window.navigator.userAgent; - if (explorer.indexOf('MSIE') >= 0) { - // ie - return 'ie'; - } else if (explorer.indexOf('Firefox') >= 0) { - // firefox - return 'Firefox'; - } else if (explorer.indexOf('Chrome') >= 0) { - // Chrome - return 'Chrome'; - } else if (explorer.indexOf('Opera') >= 0) { - // Opera - return 'Opera'; - } else if (explorer.indexOf('Safari') >= 0) { - // Safari - return 'Safari'; - }; -}; -function tranform (table, aId, name) { - let tableHead = table.$children[0].$el; - let tableBody = table.$children[1].$el; - let tableInnerHTML = ''; - if (table.$children.length !== 1) { - let len = tableBody.rows.length; - let i = -1; - while (i < len) { - if (i == -1) { - Array.from(tableHead.rows[0].children).forEach((td) => { - tableInnerHTML = tableInnerHTML + '' + td.children[0].children[0].innerHTML + ''; - }); - tableInnerHTML += ''; - } else { - tableInnerHTML += ''; - Array.from(tableBody.rows[i].children).forEach((td) => { - tableInnerHTML = tableInnerHTML + '' + td.children[0].children[0].innerHTML + ''; - }); - tableInnerHTML += ''; - } - i++; - } - tableInnerHTML += ''; - } - - if (getExplorer() !== 'Safari' && name.substr(-1, 4) !== '.xls') { - name += '.xls'; - } - - if (getExplorer() == 'ie') { - var curTbl = table; - var oXL = new ActiveXObject('Excel.Application'); - var oWB = oXL.Workbooks.Add(); - var xlsheet = oWB.Worksheets(1); - var sel = document.body.createTextRange(); - sel.moveToElementText(curTbl); - sel.select(); - sel.execCommand('Copy'); - xlsheet.Paste(); - oXL.Visible = true; - - try { - var fname = oXL.Application.GetSaveAsFilename('Excel.xls', 'Excel Spreadsheets (*.xls), *.xls'); - } catch (e) { - print('Nested catch caught ' + e); - } finally { - oWB.SaveAs(fname); - // oWB.Close(savechanges = false); - oXL.Quit(); - oXL = null; - idTmr = setInterval(Cleanup(), 1); - } - } else { - tableToExcel(tableInnerHTML, aId, name); - } -} -function Cleanup () { - window.clearInterval(idTmr); - // CollectGarbage(); -} -let tableToExcel = (function () { - let uri = 'data:application/vnd.ms-excel;base64,'; - let template = '{table}
'; - let base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))); }; - let format = function (s, c) { - return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }); - }; - return function (table, aId, name) { - let ctx = {worksheet: name || 'Worksheet', table: table}; - document.getElementById(aId).href = uri + base64(format(template, ctx)); - document.getElementById(aId).download = name; - document.getElementById(aId).click(); - }; -})(); - -const table2excel = {}; - -table2excel.transform = tranform; - -export default table2excel; diff --git a/seller/src/main.js b/seller/src/main.js index 48239dcb..371d9c06 100644 --- a/seller/src/main.js +++ b/seller/src/main.js @@ -19,7 +19,7 @@ import { import { setStore, getStore, removeStore } from "@/libs/storage"; import util from "@/libs/util"; -import dictUtil from "@/libs/dictUtil"; + import VueLazyload from "vue-lazyload"; @@ -83,8 +83,7 @@ new Vue({ mounted() { // 初始化菜单 util.initRouter(this); - // 初始化全局数据字典 - dictUtil.initDictData(this); + this.currentPageName = this.$route.name; // 显示打开的页面的列表 this.$store.commit("setOpenedList"); diff --git a/seller/src/styles/common.scss b/seller/src/styles/common.scss index feb0ebbe..c40e7ecc 100644 --- a/seller/src/styles/common.scss +++ b/seller/src/styles/common.scss @@ -125,20 +125,11 @@ li { // 主题颜色 -$success_color: #19be6b; -$warning_color: #ff9900; -$error_color: #ed3f14; - -$theme_color: #ed3f14; - -$border_color: #dddee1; -$title_color: #8c8c8c; -$light_title_color: #1c2438; -$light_content_color: #495060; -$light_sub_color: #80848f; -$light_background_color: #f8f8f9; -$light_white_background_color: #fff; -// 暗黑主题颜色 -$dark_background_color: #141414; -$dark_sub_background_color: #1d1d1d; //稍微浅一点的 -$dark_content_color: #d5d5d5; +$success_color: #68cabe; +$warning_color: #fa6419; +$error_color: #ff3c2a; +$theme_color: #FF5C58; +.theme_color { + color: $theme_color !important; +} +$bg_color: #f1f6fa; diff --git a/seller/src/styles/table-common.scss b/seller/src/styles/table-common.scss index ccce9a12..2c61e440 100644 --- a/seller/src/styles/table-common.scss +++ b/seller/src/styles/table-common.scss @@ -2,12 +2,6 @@ .operation { margin-bottom: 2vh; } - - .select-count { - font-weight: 600; - color: #40a9ff; - } - .select-clear { margin-left: 10px; } diff --git a/seller/src/styles/theme.less b/seller/src/styles/theme.less index 1032cdb9..c604aa4f 100644 --- a/seller/src/styles/theme.less +++ b/seller/src/styles/theme.less @@ -1,7 +1,10 @@ @import "~view-design/src/styles/index.less"; // iview 自定义样式 -@primary-color: #ed3f14; +@primary-color: #ff5c58; +@info-color: #fa6419; +@success-color: #68cabe; +@error-color: #ff3c2a; @table-thead-bg: #f8f8f9; @table-td-stripe-bg: #f8f8f9; @table-td-hover-bg: #ededed; diff --git a/seller/src/views/goods/goods-seller/draftGoods.vue b/seller/src/views/goods/goods-seller/draftGoods.vue index 602f6d29..486a465b 100644 --- a/seller/src/views/goods/goods-seller/draftGoods.vue +++ b/seller/src/views/goods/goods-seller/draftGoods.vue @@ -1,77 +1,32 @@ @@ -152,33 +156,18 @@ export default { }; diff --git a/seller/src/views/main-components/footer.vue b/seller/src/views/main-components/footer.vue index 41985922..bf6a6caa 100644 --- a/seller/src/views/main-components/footer.vue +++ b/seller/src/views/main-components/footer.vue @@ -7,7 +7,7 @@ Copyright © {{year}} - Present - {{config.title}} + {{config.title}}
@@ -44,4 +44,5 @@ export default { } } } + diff --git a/seller/src/views/main-components/tags-page-opened.vue b/seller/src/views/main-components/tags-page-opened.vue index 1a097051..3983e07f 100644 --- a/seller/src/views/main-components/tags-page-opened.vue +++ b/seller/src/views/main-components/tags-page-opened.vue @@ -255,20 +255,20 @@ export default { z-index: 11000; list-style-type: none; border-radius: 4px; - box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .1); + box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04); li { margin: 0; padding: 5px 15px; cursor: pointer; &:hover { - background: #eee; + background: rgba($color: $theme_color, $alpha: .1); } } } .ivu-tag-primary{ /deep/ .ivu-tag-dot-inner{ - background: red !important; + background: $theme_color !important; } } diff --git a/seller/src/views/my-components/map/index.vue b/seller/src/views/my-components/map/index.vue index 3685e12b..36616695 100644 --- a/seller/src/views/my-components/map/index.vue +++ b/seller/src/views/my-components/map/index.vue @@ -31,10 +31,12 @@ diff --git a/seller/src/views/shop/shopSetting.vue b/seller/src/views/shop/shopSetting.vue index 14ab1bea..30ba05ba 100644 --- a/seller/src/views/shop/shopSetting.vue +++ b/seller/src/views/shop/shopSetting.vue @@ -127,7 +127,7 @@ export default { form: { // 添加或编辑表单对象初始化数据 storeAddressPath: "", // 店铺地址中文 - center: "", // 经度 + 纬度 + storeCenter: "", // 经度 + 纬度 longitude: "", //经度 latitude: "", //纬度 storeAddressDetail: "", //详细地址 @@ -194,7 +194,7 @@ export default { this.form = res.result; this.$set(this.form, "address", res.result.storeAddressPath); this.storeName = res.result.storeName; - this.form.center = res.result.storeCenter; + this.form.storeCenter = res.result.storeCenter; Cookies.set("userInfoSeller", JSON.stringify(res.result)); //库存预警数赋值 @@ -296,7 +296,7 @@ export default { this.$set(this.form, "address", item.addr); this.form.storeAddressPath = item.addr; this.form.storeAddressIdPath = item.addrId; - this.form.center = item.position.lat + "," + item.position.lng; + this.form.storeCenter = item.position.lng + "," + item.position.lat }, }, mounted() { diff --git a/seller/vue.config.js b/seller/vue.config.js index 3303dc9e..1a782929 100644 --- a/seller/vue.config.js +++ b/seller/vue.config.js @@ -22,7 +22,6 @@ let externals = { "js-cookie": "Cookies", wangeditor: "wangEditor", "sockjs-client": "SockJS", - vuedraggable: "vuedraggable", "@antv/g2": "G2" }; @@ -40,7 +39,6 @@ let cdn = { "https://cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.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" ] };