优化管理端商家端冗余以及配置内容。抽出公共主题颜色、站点标题等内容。分离config中api配置,修改商家发布中拖拽以及控制台出错的bug。

master
lemon橪 2021-09-22 15:08:34 +08:00
parent 53cc6f46d1
commit 2037b57a5d
50 changed files with 393 additions and 861 deletions

View File

@ -31,6 +31,7 @@
<script> <script>
import AMapLoader from '@amap/amap-jsapi-loader'; import AMapLoader from '@amap/amap-jsapi-loader';
import { handleRegion } from '@/api/address.js'; import { handleRegion } from '@/api/address.js';
import config from '@/config'
export default { export default {
name: 'map', name: 'map',
props: { props: {
@ -41,6 +42,7 @@ export default {
}, },
data () { data () {
return { return {
config,
showMap: false, // showMap: false, //
mapSearch: '', // mapSearch: '', //
map: null, // map: null, //
@ -88,7 +90,7 @@ export default {
}, },
init () { // init () { //
AMapLoader.load({ AMapLoader.load({
key: 'b440952723253aa9fe483e698057bf7d', // WebKey load key: this.config.aMapKey, // WebKey load
version: '', // JSAPI 1.4.15 version: '', // JSAPI 1.4.15
plugins: [ plugins: [
'AMap.ToolBar', 'AMap.ToolBar',

View File

@ -2,7 +2,7 @@ export default {
/** /**
* @description 配置显示在浏览器标签的title * @description 配置显示在浏览器标签的title
*/ */
title: 'Lili电商', title: "Lili电商",
/** /**
* @description token在Cookie中存储的天数默认1天 * @description token在Cookie中存储的天数默认1天
*/ */
@ -13,6 +13,10 @@ export default {
* 用来在菜单中显示文字 * 用来在菜单中显示文字
*/ */
useI18n: false, useI18n: false,
/**
* @description 高德web端申请的api key
*/
aMapKey: "b440952723253aa9fe483e698057bf7d",
/** /**
* @description api请求基础路径 * @description api请求基础路径
*/ */
@ -22,26 +26,26 @@ export default {
// seller: 'http://192.168.0.101:8889', // seller: 'http://192.168.0.101:8889',
// manager: 'http://192.168.0.101:8887' // manager: 'http://192.168.0.101:8887'
common: 'https://common-api.pickmall.cn', common: "https://common-api.pickmall.cn",
buyer: 'https://buyer-api.pickmall.cn', buyer: "https://buyer-api.pickmall.cn",
seller: 'https://store-api.pickmall.cn', seller: "https://store-api.pickmall.cn",
manager: 'https://admin-api.pickmall.cn' manager: "https://admin-api.pickmall.cn"
}, },
api_prod: { api_prod: {
common: 'https://common-api.pickmall.cn', common: "https://common-api.pickmall.cn",
buyer: 'https://buyer-api.pickmall.cn', buyer: "https://buyer-api.pickmall.cn",
seller: 'https://store-api.pickmall.cn', seller: "https://store-api.pickmall.cn",
manager: 'https://admin-api.pickmall.cn' manager: "https://admin-api.pickmall.cn"
}, },
/** /**
* @description api请求基础路径前缀 * @description api请求基础路径前缀
*/ */
baseUrlPrefix: '/buyer', baseUrlPrefix: "/buyer",
/** /**
* @description 需要加载的插件 * @description 需要加载的插件
*/ */
plugin: { plugin: {
'error-store': { "error-store": {
showInHeader: true, // 设为false后不会在顶部显示错误日志徽标 showInHeader: true, // 设为false后不会在顶部显示错误日志徽标
developmentOff: true // 设为true后在开发环境不会收集错误信息方便开发中排查错误 developmentOff: true // 设为true后在开发环境不会收集错误信息方便开发中排查错误
} }

30
manager/public/config.js Normal file
View File

@ -0,0 +1,30 @@
var BASE = {
/**
* @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"
},
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 // 跳转买家端地址 pc端
*/
PC_URL: "https://pc-b2b2c.pickmall.cn",
/**
* @description // 跳转买家端地址 wap端
*/
WAP_URL: "https://m-b2b2c.pickmall.cn",
/**
* @description api请求基础路径前缀
*/
PREFIX: "/manager"
};

View File

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> --> <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
<link rel="icon" href="./logo.ico" type="image/x-icon" /> <link rel="icon" href="./logo.ico" type="image/x-icon" />
<title>lili admin</title> <title>admin</title>
<meta name="keywords" content="keywords" /> <meta name="keywords" content="keywords" />
<meta name="description" content="description" /> <meta name="description" content="description" />
<% for(var css of htmlWebpackPlugin.options.cdn.css) { %> <% for(var css of htmlWebpackPlugin.options.cdn.css) { %>
@ -67,9 +67,10 @@
<% for(var js of htmlWebpackPlugin.options.cdn.js) { %> <% for(var js of htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%=js%>"></script> <script src="<%=js%>"></script>
<% } %> <% } %>
<script src="/config.js"></script>
<noscript> <noscript>
<strong <strong
>We're sorry but lili-admin doesn't work properly without JavaScript >We're sorry but admin doesn't work properly without JavaScript
enabled. Please enable it to continue.</strong enabled. Please enable it to continue.</strong
> >
</noscript> </noscript>

View File

@ -10,9 +10,9 @@ import {
postRequestWithNoForm, postRequestWithNoForm,
managerUrl managerUrl
} from "@/libs/axios"; } 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"; export const uploadFile = commonUrl+ "/common/upload/file";

View File

@ -2,7 +2,7 @@ export default {
/** /**
* @description 配置显示在浏览器标签的title * @description 配置显示在浏览器标签的title
*/ */
title: "Lili电商", title: "lilishop",
/** /**
* @description token在Cookie中存储的天数默认1天 * @description token在Cookie中存储的天数默认1天
*/ */
@ -16,26 +16,14 @@ export default {
/** /**
* @description api请求基础路径 * @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 需要加载的插件 * @description 需要加载的插件
*/ */

View File

@ -1,31 +1,36 @@
import axios from "axios"; import axios from "axios";
import config from "@/config";
import { getStore, setStore } from "./storage.js"; import { getStore, setStore } from "./storage.js";
import { router } from "../router/index"; import { router } from "../router/index";
import { Message } from "view-design"; import { Message } from "view-design";
import Cookies from "js-cookie"; 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 commonUrl =
export const managerUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.manager : config.api_prod.manager) + config.baseUrlPrefix; 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({ const service = axios.create({
timeout: 8000, timeout: 8000,
baseURL: managerUrl baseURL: managerUrl
}) });
var isRefreshToken = 0; var isRefreshToken = 0;
const refreshToken = getTokenDebounce() const refreshToken = getTokenDebounce();
service.interceptors.request.use( service.interceptors.request.use(
config => { config => {
if (config.method == 'get') { if (config.method == "get") {
config.params = { config.params = {
_t: Date.parse(new Date()) / 1000, _t: Date.parse(new Date()) / 1000,
...config.params ...config.params
};
} }
} const uuid = getStore("uuid");
const uuid = getStore('uuid'); config.headers["uuid"] = uuid;
config.headers['uuid'] = uuid;
return config; return config;
}, },
err => { err => {
@ -36,7 +41,7 @@ service.interceptors.request.use(
// http response 拦截器 // http response 拦截器
service.interceptors.response.use( service.interceptors.response.use(
(response) => { response => {
const data = response.data; const data = response.data;
// 根据返回的code值来做不同的处理(和后端约定) // 根据返回的code值来做不同的处理(和后端约定)
if (!data.success && data.message) { if (!data.success && data.message) {
@ -76,7 +81,7 @@ service.interceptors.response.use(
return data; return data;
} }
}, },
async (error) => { async error => {
// 返回状态码不为200时候的错误处理 // 返回状态码不为200时候的错误处理
if (error.response) { if (error.response) {
if (error.response.status === 401) { if (error.response.status === 401) {
@ -87,77 +92,76 @@ service.interceptors.response.use(
isRefreshToken++; isRefreshToken++;
if (isRefreshToken === 1) { if (isRefreshToken === 1) {
const getTokenRes = await refreshToken(); const getTokenRes = await refreshToken();
if (getTokenRes === 'success') { // 刷新token if (getTokenRes === "success") {
// 刷新token
if (isRefreshToken === 1) { if (isRefreshToken === 1) {
error.response.config.headers.accessToken = getStore('accessToken') error.response.config.headers.accessToken = getStore(
return service(error.response.config) "accessToken"
);
return service(error.response.config);
} else { } else {
router.go(0) router.go(0);
} }
} else { } else {
Cookies.set("userInfoManager", ""); Cookies.set("userInfoManager", "");
router.push('/login') router.push("/login");
} }
isRefreshToken = 0 isRefreshToken = 0;
} }
} else { } else {
// 其他错误处理 // 其他错误处理
console.log(error.response.data); console.log(error.response.data);
Message.error(error.response.data.message) Message.error(error.response.data.message);
} }
} }
/* router.push("/login") */ /* router.push("/login") */
return Promise.resolve(error); return Promise.resolve(error);
} }
) );
// 防抖闭包来一波 // 防抖闭包来一波
function getTokenDebounce() { function getTokenDebounce() {
let lock = false let lock = false;
let success = false let success = false;
return function() { return function() {
if (!lock) { if (!lock) {
lock = true lock = true;
let oldRefreshToken = getStore("refreshToken"); let oldRefreshToken = getStore("refreshToken");
handleRefreshToken(oldRefreshToken).then(res => { handleRefreshToken(oldRefreshToken)
.then(res => {
if (res.success) { if (res.success) {
let { let { accessToken, refreshToken } = res.result;
accessToken,
refreshToken
} = res.result;
setStore("accessToken", accessToken); setStore("accessToken", accessToken);
setStore("refreshToken", refreshToken); setStore("refreshToken", refreshToken);
success = true success = true;
lock = false lock = false;
} else { } else {
success = false success = false;
lock = false lock = false;
router.push('/login') router.push("/login");
} }
}).catch((err) => {
success = false
lock = false
}) })
.catch(err => {
success = false;
lock = false;
});
} }
return new Promise(resolve => { return new Promise(resolve => {
// 一直看lock,直到请求失败或者成功 // 一直看lock,直到请求失败或者成功
const timer = setInterval(() => { const timer = setInterval(() => {
if (!lock) { if (!lock) {
clearInterval(timer) clearInterval(timer);
if (success) { if (success) {
resolve('success') resolve("success");
} else { } else {
resolve('fail') resolve("fail");
} }
} }
}, 500) // 轮询时间间隔 }, 500); // 轮询时间间隔
}) });
};
} }
}
export const getRequest = (url, params) => { export const getRequest = (url, params) => {
let accessToken = getStore("accessToken"); let accessToken = getStore("accessToken");
@ -321,7 +325,6 @@ export const getRequestWithNoToken = (url, params) => {
}); });
}; };
/** /**
* 无需token验证的请求 避免旧token过期导致请求失败 * 无需token验证的请求 避免旧token过期导致请求失败
* @param {*} url * @param {*} url
@ -334,4 +337,3 @@ export const postRequestWithNoToken = (url, params) => {
params: params params: params
}); });
}; };

View File

@ -1,17 +1,12 @@
import axios from 'axios'; import { getCurrentPermissionList } from "@/api/index";
import { import lazyLoading from "./lazyLoading.js";
getCurrentPermissionList
} from '@/api/index';
import lazyLoading from './lazyLoading.js';
import router from '@/router/index';
import Cookies from "js-cookie"; import Cookies from "js-cookie";
let util = { let util = {};
};
util.title = function(title) { util.title = function(title) {
title = title || 'lili 运营后台'; title = title || "运营后台";
window.document.title = title; window.document.title = title;
}; };
// 判断元素是否存在于数组中 // 判断元素是否存在于数组中
@ -33,8 +28,9 @@ util.openNewPage = function (vm, name, argu, query) {
let i = 0; let i = 0;
let tagHasOpened = false; let tagHasOpened = false;
while (i < openedPageLen) { while (i < openedPageLen) {
if (name == pageOpenedList[i].name) { // 页面已经打开 if (name == pageOpenedList[i].name) {
vm.$store.commit('pageOpenedList', { // 页面已经打开
vm.$store.commit("pageOpenedList", {
index: i, index: i,
argu: argu, argu: argu,
query: query query: query
@ -45,7 +41,7 @@ util.openNewPage = function (vm, name, argu, query) {
i++; i++;
} }
if (!tagHasOpened) { if (!tagHasOpened) {
let tag = vm.$store.state.app.tagsList.filter((item) => { let tag = vm.$store.state.app.tagsList.filter(item => {
if (item.children) { if (item.children) {
return name == item.children[0].name; return name == item.children[0].name;
} else { } else {
@ -61,7 +57,7 @@ util.openNewPage = function (vm, name, argu, query) {
if (query) { if (query) {
tag.query = query; tag.query = query;
} }
vm.$store.commit('increateTag', tag); vm.$store.commit("increateTag", tag);
} }
} }
}; };
@ -71,7 +67,11 @@ util.toDefaultPage = function (routers, name, route, next) {
let i = 0; let i = 0;
let notHandle = true; let notHandle = true;
while (i < len) { 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({ route.replace({
name: routers[i].children[0].name 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 constRoutes = [];
const otherRoutes = []; const otherRoutes = [];
// 404路由需要和动态路由一起加载 // 404路由需要和动态路由一起加载
const otherRouter = [{ const otherRouter = [
path: '/*', {
name: 'error-404', path: "/*",
name: "error-404",
meta: { meta: {
title: '404-页面不存在' title: "404-页面不存在"
}, },
frontRoute: 'error-page/404' frontRoute: "error-page/404"
}]; }
];
// 判断用户是否登录 // 判断用户是否登录
let userInfo = Cookies.get('userInfoManager') let userInfo = Cookies.get("userInfoManager");
if (!userInfo) { if (!userInfo) {
// 未登录 // 未登录
return; return;
@ -114,13 +117,13 @@ util.initRouter = function (vm) { // 初始化路由
// 格式化数据,设置 空children 为 null // 格式化数据,设置 空children 为 null
for (let i = 0; i < menuData.length; i++) { 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++) { for (let k = 0; k < t.length; k++) {
let tt = t[k].children; let tt = t[k].children;
for (let z = 0; z < tt.length; z++) { for (let z = 0; z < tt.length; z++) {
tt[z].children = null tt[z].children = null;
// 给所有三级路由添加字段显示一级菜单name方便点击页签时的选中筛选 // 给所有三级路由添加字段显示一级菜单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.initAllMenuData(constRoutes, menuData);
util.initRouterNode(otherRoutes, otherRouter); 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); util.initMenuData(vm, menuData);
// 缓存数据 修改加载标识 // 缓存数据 修改加载标识
window.localStorage.setItem('menuData', JSON.stringify(menuData)); window.localStorage.setItem("menuData", JSON.stringify(menuData));
vm.$store.commit('setAdded', true); vm.$store.commit("setAdded", true);
}); });
} else { } else {
// 读取缓存数据 // 读取缓存数据
let data = window.localStorage.getItem('menuData'); let data = window.localStorage.getItem("menuData");
if (!data) { if (!data) {
vm.$store.commit('setAdded', false); vm.$store.commit("setAdded", false);
return; return;
} }
let menuData = JSON.parse(data); let menuData = JSON.parse(data);
@ -155,17 +161,16 @@ util.initRouter = function (vm) { // 初始化路由
// 添加所有顶部导航栏下的菜单路由 // 添加所有顶部导航栏下的菜单路由
util.initAllMenuData = function(constRoutes, data) { util.initAllMenuData = function(constRoutes, data) {
let allMenuData = []; let allMenuData = [];
data.forEach(e => { data.forEach(e => {
if (e.level == 0) { if (e.level == 0) {
e.children.forEach(item => { e.children.forEach(item => {
allMenuData.push(item); allMenuData.push(item);
}) });
} }
}) });
util.initRouterNode(constRoutes, allMenuData); util.initRouterNode(constRoutes, allMenuData);
} };
// 生成菜单格式数据 // 生成菜单格式数据
util.initMenuData = function(vm, data) { util.initMenuData = function(vm, data) {
@ -177,29 +182,29 @@ util.initMenuData = function (vm, data) {
let nav = { let nav = {
name: e.name, name: e.name,
title: e.title title: e.title
} };
navList.push(nav); navList.push(nav);
}) });
if (navList.length < 1) { if (navList.length < 1) {
return; return;
} }
// 存入vuex // 存入vuex
vm.$store.commit('setNavList', navList); vm.$store.commit("setNavList", navList);
let currNav = window.localStorage.getItem('currNav') let currNav = window.localStorage.getItem("currNav");
if (currNav) { if (currNav) {
// 读取缓存title // 读取缓存title
for (var item of navList) { for (var item of navList) {
if (item.name == currNav) { if (item.name == currNav) {
vm.$store.commit('setCurrNavTitle', item.title); vm.$store.commit("setCurrNavTitle", item.title);
break; break;
} }
} }
} else { } else {
// 默认第一个 // 默认第一个
currNav = navList[0].name; 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) { for (let item of menuData) {
if (item.name == currNav) { if (item.name == currNav) {
// 过滤 // 过滤
@ -209,21 +214,25 @@ util.initMenuData = function (vm, data) {
} }
util.initRouterNode(menuRoutes, menuData); 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 = []; let tagsList = [];
vm.$store.state.app.routers.map((item) => { vm.$store.state.app.routers.map(item => {
if (item.children.length <= 1) { if (item.children.length <= 1) {
tagsList.push(item.children[0]); tagsList.push(item.children[0]);
} else { } else {
tagsList.push(...item.children); 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) { for (let item of data) {
let menu = Object.assign({}, item); let menu = Object.assign({}, item);
@ -237,8 +246,8 @@ util.initRouterNode = function (routers, data) { // data为所有子菜单数据
let meta = {}; let meta = {};
// 给页面添加标题、父级菜单name方便左侧菜单选中 // 给页面添加标题、父级菜单name方便左侧菜单选中
meta.title = menu.title ? menu.title + " - lilishop 运营后台" : null; meta.title = menu.title ? menu.title + " - 运营后台" : null;
meta.firstRouterName = item.firstRouterName meta.firstRouterName = item.firstRouterName;
menu.meta = meta; menu.meta = meta;
routers.push(menu); routers.push(menu);

View File

@ -1,5 +1,7 @@
import config from '@/config/index'
export default { export default {
lili: 'lili', lili: config.title,
usernameLogin: 'UsernameLogin', usernameLogin: 'UsernameLogin',
mobileLogin: 'MobileLogin', mobileLogin: 'MobileLogin',
autoLogin: 'Auto Login', autoLogin: 'Auto Login',

View File

@ -1,5 +1,6 @@
import config from '@/config/index'
export default { export default {
lili: 'lili', lili: config.title,
usernameLogin: '账户密码登录', usernameLogin: '账户密码登录',
mobileLogin: '手机号登录', mobileLogin: '手机号登录',
autoLogin: '自动登录', autoLogin: '自动登录',

View File

@ -11,7 +11,7 @@ import App from './App'
import { router } from './router/index' import { router } from './router/index'
import store from './store' import store from './store'
import i18n from '@/locale' import i18n from '@/locale'
import vueQr from 'vue-qr'
import { getRequest, postRequest, putRequest, deleteRequest, importRequest, uploadFileRequest } from '@/libs/axios' import { getRequest, postRequest, putRequest, deleteRequest, importRequest, uploadFileRequest } from '@/libs/axios'
import { setStore, getStore, removeStore } from '@/libs/storage' import { setStore, getStore, removeStore } from '@/libs/storage'
import util from '@/libs/util' import util from '@/libs/util'
@ -21,13 +21,13 @@ import liliDialog from '@/views/lili-dialog'
import {md5} from '@/utils/md5.js'; import {md5} from '@/utils/md5.js';
Vue.config.devtools = true; Vue.config.devtools = true;
Vue.config.productionTip = false Vue.config.productionTip = false
const buyerUrlPC = 'https://pc-b2b2c.pickmall.cn' // 跳转买家端地址 pc端 const PC_URL = BASE.PC_URL; // 跳转买家端地址 pc端
const buyerUrlWap = 'https://m-b2b2c.pickmall.cn' // 跳转买家端地址 wap端 const WAP_URL = BASE.WAP_URL; // 跳转买家端地址 wap端
Vue.prototype.linkTo = function (goodsId, skuId) { // 跳转买家端商品 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端二维码 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, { Vue.use(ViewUI, {
@ -35,7 +35,7 @@ Vue.use(ViewUI, {
}); });
Vue.component('liliDialog',liliDialog) Vue.component('liliDialog',liliDialog)
Vue.component(vueQr)

View File

@ -1,11 +1,11 @@
import Main from "@/views/Main.vue"; import Main from "@/views/Main.vue";
import config from '@/config/index'
// 不作为Main组件的子页面展示的页面单独写如下 // 不作为Main组件的子页面展示的页面单独写如下
export const loginRouter = { export const loginRouter = {
path: "/login", path: "/login",
name: "login", name: "login",
meta: { meta: {
title: "登录 - lili运营后台" title: `登录 - ${config.title}运营后台`
}, },
component: () => import("@/views/login.vue") component: () => import("@/views/login.vue")
}; };

View File

@ -1,4 +1,3 @@
$theme_color: #804ed1;
// //
@ -89,113 +88,15 @@ ul,li{
text-overflow:ellipsis; text-overflow:ellipsis;
white-space: nowrap; 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
*/
// //
// $success_color: #68cabe;
$primary_color: #2d8cf0; $warning_color: #fa6419;
$primary_light_color: #0f1011; $error_color: #ff3c2a;
$primary_dark_color: #2b85e4; $theme_color: #FF5C58;
$success_color: #19be6b;
$warning_color: #ff9900;
$error_color: #ed3f14;
$handle-btn-color: #438cde;
$theme_color: #ed3f14;
.theme_color { .theme_color {
color: #ed3f14 !important; color: $theme_color !important;
} }
$border_color: #dddee1; $bg_color: #f1f6fa;
$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;
/***** 封装一些方法可用于 黑暗主题 ,明亮主题 *****/
//
@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"; @import "./table-common.scss";

View File

@ -1,13 +1,16 @@
@import "~view-design/src/styles/index.less"; @import "~view-design/src/styles/index.less";
// iview 自定义样式 // iview 自定义样式
@primary-color: #ed3f14; @primary-color: #ff5c58;
@info-color: #fa6419;
@success-color: #68cabe;
@error-color: #ff3c2a;
@table-thead-bg: #f8f8f9; @table-thead-bg: #f8f8f9;
@table-td-stripe-bg: #f8f8f9; @table-td-stripe-bg: #f8f8f9;
@table-td-hover-bg: #ededed; @table-td-hover-bg: #ededed;
@table-td-highlight-bg: #ededed; @table-td-highlight-bg: #ededed;
@font-size-base: 12px; @font-size-base: 12px;
.ivu-drawer, .ivu-drawer,
.drawer, .drawer,
.ivu-drawer-wrap { .ivu-drawer-wrap {

View File

@ -74,7 +74,7 @@ export default {
render: (h, params) => { render: (h, params) => {
return h("img", { return h("img", {
attrs: { attrs: {
src: params.row.thumbnail, src: params.row.thumbnail || '',
alt: "加载图片失败", alt: "加载图片失败",
}, },
style: { style: {

View File

@ -85,7 +85,7 @@ export default {
render: (h, params) => { render: (h, params) => {
return h("img", { return h("img", {
attrs: { attrs: {
src: params.row.logo, src: params.row.logo || '',
alt: "加载图片失败", alt: "加载图片失败",
}, },
style: { style: {

View File

@ -90,8 +90,7 @@ h4 {
color: #ffaa71; color: #ffaa71;
} }
} }
.count-list {
}
.flow-list { .flow-list {
height: 330px; height: 330px;

View File

@ -615,7 +615,7 @@ export const modelData = [{
icon: 'md-image', icon: 'md-image',
options: { options: {
list: [{ list: [{
name: 'LILI生鲜', name: '生鲜',
describe: "年货带回家 满199减60", describe: "年货带回家 满199减60",
img: require('@/assets/nav/decorate8.png'), img: require('@/assets/nav/decorate8.png'),
url: '', url: '',
@ -624,8 +624,8 @@ export const modelData = [{
size: '170*170' size: '170*170'
}, },
{ {
name: 'LILI众筹', name: '众筹',
describe: "备孕有孕检测仪", describe: "年货带回家",
img: require('@/assets/nav/decorate9.png'), img: require('@/assets/nav/decorate9.png'),
url: '', url: '',
fromColor: "#325bb4", fromColor: "#325bb4",
@ -633,7 +633,7 @@ export const modelData = [{
size: '170*170' size: '170*170'
}, },
{ {
name: 'LILI生鲜', name: '生鲜',
describe: "年货带回家 满199减60", describe: "年货带回家 满199减60",
img: require('@/assets/nav/decorate8.png'), img: require('@/assets/nav/decorate8.png'),
url: '', url: '',
@ -642,7 +642,7 @@ export const modelData = [{
size: '170*170' size: '170*170'
}, },
{ {
name: 'LILI众筹', name: '众筹',
describe: "备孕有孕检测仪", describe: "备孕有孕检测仪",
img: require('@/assets/nav/decorate9.png'), img: require('@/assets/nav/decorate9.png'),
url: '', url: '',
@ -651,7 +651,7 @@ export const modelData = [{
size: '170*170' size: '170*170'
}, },
{ {
name: 'LILI生鲜', name: '生鲜',
describe: "年货带回家 满199减60", describe: "年货带回家 满199减60",
img: require('@/assets/nav/decorate8.png'), img: require('@/assets/nav/decorate8.png'),
url: '', url: '',
@ -660,7 +660,7 @@ export const modelData = [{
size: '170*170' size: '170*170'
}, },
{ {
name: 'LILI众筹', name: '众筹',
describe: "备孕有孕检测仪", describe: "备孕有孕检测仪",
img: require('@/assets/nav/decorate9.png'), img: require('@/assets/nav/decorate9.png'),
url: '', url: '',

View File

@ -22,7 +22,7 @@
<div class="person-msg"> <div class="person-msg">
<img :src="userInfo.face" v-if="userInfo.face" alt /> <img :src="userInfo.face" v-if="userInfo.face" alt />
<Avatar icon="ios-person" class="mb_10" v-else size="80" /> <Avatar icon="ios-person" class="mb_10" v-else size="80" />
<div>Hi{{ userInfo.nickName || "欢迎来到LiLi Shop" | secrecyMobile }}</div> <div>Hi{{ userInfo.nickName || "欢迎来到管理后台" | secrecyMobile }}</div>
<div v-if="userInfo.id"> <div v-if="userInfo.id">
<Button type="error" shape="circle">会员中心</Button> <Button type="error" shape="circle">会员中心</Button>
</div> </div>
@ -263,7 +263,7 @@ export default {
margin-left: 5px; margin-left: 5px;
} }
span:nth-child(1) { span:nth-child(1) {
@include content_color($theme_color); color: $theme_color;
margin-left: 0; margin-left: 0;
} }
span:nth-child(2) { span:nth-child(2) {

View File

@ -43,7 +43,7 @@
<div class="person-msg"> <div class="person-msg">
<img :src="userInfo.face" v-if="userInfo.face" alt /> <img :src="userInfo.face" v-if="userInfo.face" alt />
<Avatar icon="ios-person" class="mb_10" v-else size="80" /> <Avatar icon="ios-person" class="mb_10" v-else size="80" />
<div>Hi{{ userInfo.nickName || "欢迎来到LiLi Shop" | secrecyMobile }}</div> <div>Hi{{ userInfo.nickName || "欢迎来到管理后台" | secrecyMobile }}</div>
<div v-if="userInfo.id"> <div v-if="userInfo.id">
<Button type="error" shape="circle">会员中心</Button> <Button type="error" shape="circle">会员中心</Button>
</div> </div>
@ -343,7 +343,7 @@ export default {
margin-left: 5px; margin-left: 5px;
} }
span:nth-child(1) { span:nth-child(1) {
@include content_color($theme_color); color: $theme_color;
margin-left: 0; margin-left: 0;
} }
span:nth-child(2) { span:nth-child(2) {

View File

@ -141,15 +141,7 @@ export default {
align-items: center; align-items: center;
justify-content: 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 { .verify-con {
position: absolute; position: absolute;
top: 150px; top: 150px;
@ -159,37 +151,27 @@ export default {
.form { .form {
padding-top: 1vh; padding-top: 1vh;
.input-verify {
width: 67%;
}
} }
.forget-pass, .login-btn {
.other-way { background: linear-gradient(135deg, $theme_color 0%, $warning_color 100%);
font-size: 14px; height: 40px;
}
.login-btn,
.other-login {
margin-top: 3vh;
}
.icons {
display: flex;
align-items: center;
}
.other-icon {
cursor: pointer; cursor: pointer;
margin-left: 10px; border-radius: 4px;
display: flex; display: flex;
align-items: center; align-items: center;
color: rgba(0, 0, 0, 0.2); justify-content: center;
font-size: 16px;
color: #fff;
width: 100%;
text-align: center;
transition: 0.35s;
}
.login-btn:hover {
opacity: .9;
border-radius: 10px;
}
:hover {
color: #2d8cf0;
}
}
} }
.flex { .flex {
justify-content: center; justify-content: center;

View File

@ -1,28 +1,26 @@
<template> <template>
<div class="foot"> <div class="foot">
<Row type="flex" justify="space-around" class="help"> <Row type="flex" justify="space-around" class="help">
<a class="item" href="https://pickmall.com" target="_blank">{{ $t('help') }}</a> <a class="item" :href="config.website" target="_blank">帮助</a>
<a class="item" href="https://pickmall.com" target="_blank">{{ $t('privacy') }}</a> <a class="item" :href="config.website" target="_blank">隐私</a>
<a class="item" href="https://pickmall.com" target="_blank">{{ $t('terms') }}</a> <a class="item" :href="config.website" target="_blank">条款</a>
</Row> </Row>
<Row type="flex" justify="center" class="copyright"> <Row type="flex" justify="center" class="copyright">
Copyright © {{year}} - Present Copyright © {{year}} - Present
<a <a :href="config.website" class="href" target="_blank" style="margin:0 5px;">{{config.title}}</a>
href="https://pickmall.cn/"
target="_blank"
style="margin:0 5px;"
>lili-shop</a> {{ $t('rights') }}
</Row> </Row>
</div> </div>
</template> </template>
<script> <script>
import config from '@/config/index'
export default { export default {
name: "footer",
data() { data() {
return { return {
year: new Date().getFullYear() config,
} year: new Date().getFullYear(), //
};
}, },
}; };
</script> </script>
@ -46,4 +44,5 @@ export default {
} }
} }
} }
</style> </style>

View File

@ -248,6 +248,6 @@ export default {
} }
} }
.ivu-tag-primary, .ivu-tag-primary.ivu-tag-dot .ivu-tag-dot-inner{ .ivu-tag-primary, .ivu-tag-primary.ivu-tag-dot .ivu-tag-dot-inner{
background: red; background: $theme_color;
} }
</style> </style>

View File

@ -31,9 +31,11 @@
<script> <script>
import AMapLoader from "@amap/amap-jsapi-loader"; import AMapLoader from "@amap/amap-jsapi-loader";
import { getRegion } from "@/api/common.js"; import { getRegion } from "@/api/common.js";
import config from '@/config'
export default { export default {
data() { data() {
return { return {
config,
showMap: false, // modal showMap: false, // modal
mapSearch: "", // mapSearch: "", //
map: null, // map: null, //
@ -71,7 +73,7 @@ export default {
// //
init() { init() {
AMapLoader.load({ AMapLoader.load({
key: "b440952723253aa9fe483e698057bf7d", // WebKey load key: this.config.aMapKey, // WebKey load
version: "", // JSAPI 1.4.15 version: "", // JSAPI 1.4.15
plugins: [ plugins: [
"AMap.ToolBar", "AMap.ToolBar",

View File

@ -20,7 +20,7 @@
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button> <Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form> </Form>
<Row class="operation padding-row"> <Row class="operation padding-row">
<Button @click="delAll"></Button>
</Row> </Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-selection-change="changeSelect"> <Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-selection-change="changeSelect">
</Table> </Table>

View File

@ -576,7 +576,7 @@ export default {
}, },
// //
getAddress(item) { getAddress(item) {
this.shopForm.storeCenter = item.position.lat + "," + item.position.lng; this.shopForm.storeCenter = item.position.lng + ',' + item.position.lat;
this.$set(this.shopForm, "storeAddressPath", item.addr); this.$set(this.shopForm, "storeAddressPath", item.addr);
this.$set(this.shopForm, "storeAddressIdPath", item.addrId); this.$set(this.shopForm, "storeAddressIdPath", item.addrId);
}, },

View File

@ -47,7 +47,7 @@
<div> <div>
<Upload <Upload
style="display:inline-block;" style="display:inline-block;"
:action="baseUrl + '/common/upload/file'" :action="commonUrl + '/common/upload/file'"
:headers="accessToken" :headers="accessToken"
:on-success="handleSuccess" :on-success="handleSuccess"
:on-error="handleError" :on-error="handleError"
@ -257,6 +257,7 @@ import {
import DPlayer from "dplayer"; import DPlayer from "dplayer";
import config from "@/config"; import config from "@/config";
import { commonUrl } from "@/libs/axios";
var dp; var dp;
export default { export default {
name: "oss-manage", name: "oss-manage",
@ -268,8 +269,8 @@ export default {
}, },
data() { data() {
return { return {
commonUrl, //
config, // api config, // api
baseUrl: "", //
selectImage: false, // selectImage: false, //
accessToken: {}, // token accessToken: {}, // token
loading: false, // loading: false, //
@ -342,7 +343,7 @@ export default {
if (params.row.fileType.includes("image") > 0) { if (params.row.fileType.includes("image") > 0) {
return h("img", { return h("img", {
attrs: { attrs: {
src: params.row.url, src: params.row.url || '',
alt: "加载图片失败", alt: "加载图片失败",
}, },
style: { style: {
@ -813,10 +814,6 @@ export default {
if(!this.isComponent) { // if(!this.isComponent) { //
this.init(); this.init();
} }
this.baseUrl =
process.env.NODE_ENV === "development"
? this.config.api_dev.common
: this.config.api_prod.common;
}, },
}; };

View File

@ -70,7 +70,7 @@
<script src="/config.js"></script> <script src="/config.js"></script>
<noscript> <noscript>
<strong <strong
>We're sorry but lili-admin doesn't work properly without JavaScript >We're sorry doesn't work properly without JavaScript
enabled. Please enable it to continue.</strong enabled. Please enable it to continue.</strong
> >
</noscript> </noscript>

View File

@ -1,5 +1,5 @@
// 统一请求路径前缀在libs/axios.js中修改 // 统一请求路径前缀在libs/axios.js中修改
import {getRequest, postRequest, putRequest, deleteRequest, importRequest, getRequestWithNoToken} from '@/libs/axios'; import {getRequest} from '@/libs/axios';
// 传给后台citycode 获取城市街道等id // 传给后台citycode 获取城市街道等id

View File

@ -6,6 +6,6 @@ export const getChildRegion = (id) => {
}; };
// 点地图获取地址信息 // 点地图获取地址信息
export const getRegion = (parpams) => { export const getRegion = (params) => {
return getRequest(`${commonUrl}/common/region/region`, parpams); return getRequest(`${commonUrl}/common/region/region`, params);
}; };

View File

@ -13,6 +13,14 @@ export default {
* 用来在菜单中显示文字 * 用来在菜单中显示文字
*/ */
useI18n: true, useI18n: true,
/**
* @description 高德web端申请的api key
*/
aMapKey: "b440952723253aa9fe483e698057bf7d",
/**
* @description 官网地址
*/
website: "https://www.pickmall.cn",
/** /**
* @description 需要加载的插件 * @description 需要加载的插件
*/ */

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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
}
]

View File

@ -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 = '<thead><tr>';
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 + '<th>' + td.children[0].children[0].innerHTML + '</th>';
});
tableInnerHTML += '</tr><thead><tbody>';
} else {
tableInnerHTML += '<tr>';
Array.from(tableBody.rows[i].children).forEach((td) => {
tableInnerHTML = tableInnerHTML + '<td>' + td.children[0].children[0].innerHTML + '</td>';
});
tableInnerHTML += '</tr>';
}
i++;
}
tableInnerHTML += '</tbody>';
}
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 = '<html><head><meta charset="UTF-8"></head><body><table>{table}</table></body></html>';
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;

View File

@ -19,7 +19,7 @@ import {
import { setStore, getStore, removeStore } from "@/libs/storage"; import { setStore, getStore, removeStore } from "@/libs/storage";
import util from "@/libs/util"; import util from "@/libs/util";
import dictUtil from "@/libs/dictUtil";
import VueLazyload from "vue-lazyload"; import VueLazyload from "vue-lazyload";
@ -83,8 +83,7 @@ new Vue({
mounted() { mounted() {
// 初始化菜单 // 初始化菜单
util.initRouter(this); util.initRouter(this);
// 初始化全局数据字典
dictUtil.initDictData(this);
this.currentPageName = this.$route.name; this.currentPageName = this.$route.name;
// 显示打开的页面的列表 // 显示打开的页面的列表
this.$store.commit("setOpenedList"); this.$store.commit("setOpenedList");

View File

@ -125,20 +125,11 @@ li {
// //
$success_color: #19be6b; $success_color: #68cabe;
$warning_color: #ff9900; $warning_color: #fa6419;
$error_color: #ed3f14; $error_color: #ff3c2a;
$theme_color: #FF5C58;
$theme_color: #ed3f14; .theme_color {
color: $theme_color !important;
$border_color: #dddee1; }
$title_color: #8c8c8c; $bg_color: #f1f6fa;
$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;

View File

@ -2,12 +2,6 @@
.operation { .operation {
margin-bottom: 2vh; margin-bottom: 2vh;
} }
.select-count {
font-weight: 600;
color: #40a9ff;
}
.select-clear { .select-clear {
margin-left: 10px; margin-left: 10px;
} }

View File

@ -1,7 +1,10 @@
@import "~view-design/src/styles/index.less"; @import "~view-design/src/styles/index.less";
// iview 自定义样式 // iview 自定义样式
@primary-color: #ed3f14; @primary-color: #ff5c58;
@info-color: #fa6419;
@success-color: #68cabe;
@error-color: #ff3c2a;
@table-thead-bg: #f8f8f9; @table-thead-bg: #f8f8f9;
@table-td-stripe-bg: #f8f8f9; @table-td-stripe-bg: #f8f8f9;
@table-td-hover-bg: #ededed; @table-td-hover-bg: #ededed;

View File

@ -1,77 +1,32 @@
<template> <template>
<div class="search"> <div class="search">
<Card> <Card>
<Form <Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form mb_10"
ref="searchForm" @keydown.enter.native="handleSearch">
:model="searchForm"
inline
:label-width="70"
class="search-form mb_10"
@keydown.enter.native="handleSearch"
>
<Form-item label="商品名称" prop="goodsName"> <Form-item label="商品名称" prop="goodsName">
<Input <Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px" />
type="text"
v-model="searchForm.goodsName"
placeholder="请输入商品名称"
clearable
style="width: 200px"
/>
</Form-item> </Form-item>
<span v-if="drop">
<Form-item label="状态" prop="status"> <Form-item label="状态" prop="status">
<Select <Select v-model="searchForm.marketEnable" placeholder="请选择" clearable style="width: 200px">
v-model="searchForm.marketEnable"
placeholder="请选择"
clearable
style="width: 200px"
>
<Option value="DOWN">下架</Option> <Option value="DOWN">下架</Option>
<Option value="UPPER">上架</Option> <Option value="UPPER">上架</Option>
</Select> </Select>
</Form-item> </Form-item>
<Form-item label="商品编号" prop="sn"> <Form-item label="商品编号" prop="sn">
<Input <Input type="text" v-model="searchForm.sn" placeholder="商品编号" clearable style="width: 200px" />
type="text"
v-model="searchForm.sn"
placeholder="商品编号"
clearable
style="width: 200px"
/>
</Form-item> </Form-item>
</span>
<Form-item style="margin-left: -35px" class="br"> <Form-item style="margin-left: -35px" class="br">
<Button @click="handleSearch" type="primary" icon="ios-search" <Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button>
>搜索</Button
>
<Button @click="handleReset"></Button>
<a class="drop-down" @click="dropDown">
{{ dropDownContent }}
<Icon :type="dropDownIcon"></Icon>
</a>
</Form-item> </Form-item>
</Form> </Form>
<Table <Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10"></Table>
:loading="loading"
border
:columns="columns"
:data="data"
ref="table"
class="mt_10"
></Table>
<Row type="flex" justify="end" class="mt_10"> <Row type="flex" justify="end" class="mt_10">
<Page <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
:current="searchForm.pageNumber" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator
:total="total" show-sizer></Page>
:page-size="searchForm.pageSize"
@on-change="changePage"
@on-page-size-change="changePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-elevator
show-sizer
></Page>
</Row> </Row>
</Card> </Card>
</div> </div>
@ -85,22 +40,20 @@ export default {
data() { data() {
return { return {
loading: true, // loading: true, //
drop: false,
dropDownContent: "展开",
dropDownIcon: "ios-arrow-down",
searchForm: { searchForm: {
// //
pageNumber: 1, // pageNumber: 1, //
pageSize: 10, // pageSize: 10, //
sort: "create_time", // sort: "create_time", //
order: "desc", // order: "desc", //
saveType: "TEMPLATE" saveType: "TEMPLATE",
}, },
columns: [ // columns: [
//
{ {
title: "ID", title: "ID",
key: "id", key: "id",
minWidth: 120 minWidth: 120,
}, },
{ {
title: "商品原图", title: "商品原图",
@ -126,14 +79,17 @@ export default {
{ {
title: "商品名称", title: "商品名称",
key: "goodsName", key: "goodsName",
minWidth: 120 minWidth: 120,
}, },
{ {
title: "商品价格", title: "商品价格",
key: "price", key: "price",
render: (h, params) => { render: (h, params) => {
return h('div', this.$options.filters.unitPrice(params.row.price, '¥')) return h(
} "div",
this.$options.filters.unitPrice(params.row.price, "¥")
);
},
}, },
{ {
@ -143,7 +99,7 @@ export default {
{ {
title: "创建时间", title: "创建时间",
key: "createTime", key: "createTime",
minWidth: 120 minWidth: 120,
}, },
{ {
title: "操作", title: "操作",
@ -187,7 +143,7 @@ export default {
}, },
}, },
"删除" "删除"
) ),
]); ]);
}, },
}, },
@ -197,12 +153,16 @@ export default {
}; };
}, },
methods: { methods: {
init() { // init() {
//
this.getDataList(); this.getDataList();
}, },
// //
editGoods(v) { editGoods(v) {
this.$router.push({ name: "goods-template-operation-edit", query: { draftId: v.id } }) this.$router.push({
name: "goods-template-operation-edit",
query: { draftId: v.id },
});
}, },
// //
removeDraft(id) { removeDraft(id) {
@ -246,17 +206,7 @@ export default {
// //
this.getDataList(); this.getDataList();
}, },
//
dropDown() {
if (this.drop) {
this.dropDownContent = "展开";
this.dropDownIcon = "ios-arrow-down";
} else {
this.dropDownContent = "收起";
this.dropDownIcon = "ios-arrow-up";
}
this.drop = !this.drop;
},
// //
getDataList() { getDataList() {
this.loading = true; this.loading = true;
@ -281,22 +231,4 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.search {
.operation {
margin-bottom: 2vh;
}
.select-count {
font-weight: 600;
color: #40a9ff;
}
.select-clear {
margin-left: 10px;
}
.page {
margin-top: 2vh;
}
.drop-down {
margin-left: 5px;
}
}
</style> </style>

View File

@ -6,18 +6,20 @@
<Row style="flex-direction: column;"> <Row style="flex-direction: column;">
<Form ref="usernameLoginForm" :model="form" :rules="rules" class="form"> <Form ref="usernameLoginForm" :model="form" :rules="rules" class="form">
<FormItem prop="username"> <FormItem prop="username">
<Input v-model="form.username" prefix="ios-contact" size="large" clearable placeholder="请输入用户名" autocomplete="off" /> <Input v-model="form.username" prefix="ios-contact" size="large" clearable placeholder="请输入用户名"
autocomplete="off" />
</FormItem> </FormItem>
<FormItem prop="password"> <FormItem prop="password">
<Input type="password" v-model="form.password" prefix="ios-lock" size="large" password placeholder="请输入密码" autocomplete="off" /> <Input type="password" v-model="form.password" prefix="ios-lock" size="large" password placeholder="请输入密码"
autocomplete="off" />
</FormItem> </FormItem>
</Form> </Form>
<Row> <Row>
<Button class="login-btn" type="primary" size="large" :loading="loading" @click="submitLogin" long> <div class="login-btn" type="primary" size="large" :loading="loading" @click="submitLogin" long>
<span v-if="!loading"></span> <span v-if="!loading"></span>
<span v-else></span> <span v-else></span>
</Button> </div>
</Row> </Row>
</Row> </Row>
@ -26,6 +28,8 @@
<verify ref="verify" class="verify-con" verifyType="LOGIN" @change="verifyChange"></verify> <verify ref="verify" class="verify-con" verifyType="LOGIN" @change="verifyChange"></verify>
</Col> </Col>
</Row> </Row>
</div> </div>
</template> </template>
@ -152,33 +156,18 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.row {
padding: 70px 50px;
border-radius: 0.8em;
}
.login { .login {
height: 100%; height: 100%;
background: url("../assets/background.png") no-repeat; background: url("../assets/background.png") no-repeat;
background-size: 100%; background-size: 100%;
background-position-y: bottom; background-position-y: bottom;
background-color: #edf0f3; background-color: #fff;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: 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;
}
/deep/ .ivu-row {
display: flex;
}
.verify-con { .verify-con {
position: absolute; position: absolute;
top: 126px; top: 126px;
@ -187,40 +176,26 @@ export default {
} }
.form { .form {
padding-top: 1vh; padding-top: 1vh;
.input-verify {
width: 67%;
}
} }
.forget-pass, .login-btn {
.other-way { background: linear-gradient(135deg, $theme_color 0%, $warning_color 100%);
font-size: 14px; height: 40px;
}
.login-btn,
.other-login {
margin-top: 3vh;
}
.icons {
display: flex;
align-items: center;
}
.other-icon {
cursor: pointer; cursor: pointer;
margin-left: 10px; border-radius: 4px;
display: flex; display: flex;
align-items: center; align-items: center;
color: rgba(0, 0, 0, 0.2);
:hover {
color: #2d8cf0;
}
}
}
.flex {
justify-content: center; justify-content: center;
font-size: 16px;
color: #fff;
width: 100%;
text-align: center;
transition: 0.35s;
} }
.login-btn:hover {
opacity: .9;
border-radius: 10px;
}
}
</style> </style>

View File

@ -7,7 +7,7 @@
</Row> </Row>
<Row type="flex" justify="center" class="copyright"> <Row type="flex" justify="center" class="copyright">
Copyright © {{year}} - Present Copyright © {{year}} - Present
<a :href="config.website" target="_blank" style="margin:0 5px;">{{config.title}}</a> <a :href="config.website" class="href" target="_blank" style="margin:0 5px;">{{config.title}}</a>
</Row> </Row>
</div> </div>
</template> </template>
@ -44,4 +44,5 @@ export default {
} }
} }
} }
</style> </style>

View File

@ -255,20 +255,20 @@ export default {
z-index: 11000; z-index: 11000;
list-style-type: none; list-style-type: none;
border-radius: 4px; 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 { li {
margin: 0; margin: 0;
padding: 5px 15px; padding: 5px 15px;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
background: #eee; background: rgba($color: $theme_color, $alpha: .1);
} }
} }
} }
.ivu-tag-primary{ .ivu-tag-primary{
/deep/ .ivu-tag-dot-inner{ /deep/ .ivu-tag-dot-inner{
background: red !important; background: $theme_color !important;
} }
} }

View File

@ -31,10 +31,12 @@
<script> <script>
import AMapLoader from "@amap/amap-jsapi-loader"; import AMapLoader from "@amap/amap-jsapi-loader";
import { getRegion } from "@/api/common.js"; import { getRegion } from "@/api/common.js";
import config from '@/config'
export default { export default {
name: "map", name: "map",
data() { data() {
return { return {
config,
showMap: false, // showMap: false, //
mapSearch: "", // mapSearch: "", //
map: null, // map: null, //
@ -71,7 +73,7 @@ export default {
}, },
init() { init() {
AMapLoader.load({ AMapLoader.load({
key: "b440952723253aa9fe483e698057bf7d", // WebKey load key: this.config.aMapKey, // WebKey load
version: "", // JSAPI 1.4.15 version: "", // JSAPI 1.4.15
plugins: [ plugins: [
"AMap.ToolBar", "AMap.ToolBar",

View File

@ -898,37 +898,9 @@ dl dt {
} }
} }
.flex-card {
display: flex;
height: 600px;
}
.card-item {
margin: 5px 0;
}
.flex-card-left {
flex: 4;
//background: #f8f8f8;
}
.flex-card-right {
flex: 6;
}
.search { .search {
.operation {
margin-bottom: 2vh;
}
.select-count {
font-weight: 600;
color: #40a9ff;
}
.select-clear {
margin-left: 10px;
}
.div-item { .div-item {
line-height: 35px; line-height: 35px;
@ -944,15 +916,6 @@ dl dt {
} }
} }
.div-status-right {
margin-top: 20px;
margin-left: 30px;
font-size: 20px;
}
.page {
margin-top: 2vh;
}
button { button {
margin-left: 5px; margin-left: 5px;
@ -985,7 +948,7 @@ dl dt {
} }
.flowPrice { .flowPrice {
color: #cc0000; color: $theme_color;
font-size: 22px; font-size: 22px;
} }
} }

View File

@ -51,7 +51,7 @@
<template slot-scope="{ row }" slot="action"> <template slot-scope="{ row }" slot="action">
<div class="row"> <div class="row">
<Button <Button
type="primary" type="default"
size="small" size="small"
v-if="row.promotionStatus == 'NEW'" v-if="row.promotionStatus == 'NEW'"
@click="edit(row)" @click="edit(row)"
@ -75,7 +75,6 @@
type="error" type="error"
size="small" size="small"
v-if="row.promotionStatus != 'START'" v-if="row.promotionStatus != 'START'"
ghost
@click="remove(row)" @click="remove(row)"
>删除</Button >删除</Button
>&nbsp; >&nbsp;

View File

@ -215,16 +215,5 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.seckill {
.operation {
margin: 10px 0;
}
.select-count {
font-weight: 600;
color: #40a9ff;
}
.select-clear {
margin-left: 10px;
}
}
</style> </style>

View File

@ -127,7 +127,7 @@ export default {
form: { form: {
// //
storeAddressPath: "", // storeAddressPath: "", //
center: "", // + storeCenter: "", // +
longitude: "", // longitude: "", //
latitude: "", // latitude: "", //
storeAddressDetail: "", // storeAddressDetail: "", //
@ -194,7 +194,7 @@ export default {
this.form = res.result; this.form = res.result;
this.$set(this.form, "address", res.result.storeAddressPath); this.$set(this.form, "address", res.result.storeAddressPath);
this.storeName = res.result.storeName; this.storeName = res.result.storeName;
this.form.center = res.result.storeCenter; this.form.storeCenter = res.result.storeCenter;
Cookies.set("userInfoSeller", JSON.stringify(res.result)); Cookies.set("userInfoSeller", JSON.stringify(res.result));
// //
@ -296,7 +296,7 @@ export default {
this.$set(this.form, "address", item.addr); this.$set(this.form, "address", item.addr);
this.form.storeAddressPath = item.addr; this.form.storeAddressPath = item.addr;
this.form.storeAddressIdPath = item.addrId; this.form.storeAddressIdPath = item.addrId;
this.form.center = item.position.lat + "," + item.position.lng; this.form.storeCenter = item.position.lng + "," + item.position.lat
}, },
}, },
mounted() { mounted() {

View File

@ -22,7 +22,6 @@ let externals = {
"js-cookie": "Cookies", "js-cookie": "Cookies",
wangeditor: "wangEditor", wangeditor: "wangEditor",
"sockjs-client": "SockJS", "sockjs-client": "SockJS",
vuedraggable: "vuedraggable",
"@antv/g2": "G2" "@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/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/wangeditor@latest/dist/wangEditor.min.js",
"https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.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"
] ]
}; };