commit message
3
seller/.browserslistrc
Normal file
@@ -0,0 +1,3 @@
|
||||
> 1%
|
||||
last 2 versions
|
||||
not ie <= 8
|
||||
14
seller/.editorconfig
Normal file
@@ -0,0 +1,14 @@
|
||||
# https://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
insert_final_newline = false
|
||||
trim_trailing_whitespace = false
|
||||
4
seller/.eslintignore
Normal file
@@ -0,0 +1,4 @@
|
||||
build/*.js
|
||||
src/assets
|
||||
public
|
||||
dist
|
||||
198
seller/.eslintrc.js
Normal file
@@ -0,0 +1,198 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
parserOptions: {
|
||||
parser: 'babel-eslint',
|
||||
sourceType: 'module'
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
node: true,
|
||||
es6: true,
|
||||
},
|
||||
extends: ['plugin:vue/recommended', 'eslint:recommended'],
|
||||
|
||||
// add your custom rules here
|
||||
//it is base on https://github.com/vuejs/eslint-config-vue
|
||||
rules: {
|
||||
"vue/max-attributes-per-line": [2, {
|
||||
"singleline": 10,
|
||||
"multiline": {
|
||||
"max": 1,
|
||||
"allowFirstLine": false
|
||||
}
|
||||
}],
|
||||
"vue/singleline-html-element-content-newline": "off",
|
||||
"vue/multiline-html-element-content-newline":"off",
|
||||
"vue/name-property-casing": ["error", "PascalCase"],
|
||||
"vue/no-v-html": "off",
|
||||
'accessor-pairs': 2,
|
||||
'arrow-spacing': [2, {
|
||||
'before': true,
|
||||
'after': true
|
||||
}],
|
||||
'block-spacing': [2, 'always'],
|
||||
'brace-style': [2, '1tbs', {
|
||||
'allowSingleLine': true
|
||||
}],
|
||||
'camelcase': [0, {
|
||||
'properties': 'always'
|
||||
}],
|
||||
'comma-dangle': [2, 'never'],
|
||||
'comma-spacing': [2, {
|
||||
'before': false,
|
||||
'after': true
|
||||
}],
|
||||
'comma-style': [2, 'last'],
|
||||
'constructor-super': 2,
|
||||
'curly': [2, 'multi-line'],
|
||||
'dot-location': [2, 'property'],
|
||||
'eol-last': 2,
|
||||
'eqeqeq': ["error", "always", {"null": "ignore"}],
|
||||
'generator-star-spacing': [2, {
|
||||
'before': true,
|
||||
'after': true
|
||||
}],
|
||||
'handle-callback-err': [2, '^(err|error)$'],
|
||||
'indent': [2, 2, {
|
||||
'SwitchCase': 1
|
||||
}],
|
||||
'jsx-quotes': [2, 'prefer-single'],
|
||||
'key-spacing': [2, {
|
||||
'beforeColon': false,
|
||||
'afterColon': true
|
||||
}],
|
||||
'keyword-spacing': [2, {
|
||||
'before': true,
|
||||
'after': true
|
||||
}],
|
||||
'new-cap': [2, {
|
||||
'newIsCap': true,
|
||||
'capIsNew': false
|
||||
}],
|
||||
'new-parens': 2,
|
||||
'no-array-constructor': 2,
|
||||
'no-caller': 2,
|
||||
'no-console': 'off',
|
||||
'no-class-assign': 2,
|
||||
'no-cond-assign': 2,
|
||||
'no-const-assign': 2,
|
||||
'no-control-regex': 0,
|
||||
'no-delete-var': 2,
|
||||
'no-dupe-args': 2,
|
||||
'no-dupe-class-members': 2,
|
||||
'no-dupe-keys': 2,
|
||||
'no-duplicate-case': 2,
|
||||
'no-empty-character-class': 2,
|
||||
'no-empty-pattern': 2,
|
||||
'no-eval': 2,
|
||||
'no-ex-assign': 2,
|
||||
'no-extend-native': 2,
|
||||
'no-extra-bind': 2,
|
||||
'no-extra-boolean-cast': 2,
|
||||
'no-extra-parens': [2, 'functions'],
|
||||
'no-fallthrough': 2,
|
||||
'no-floating-decimal': 2,
|
||||
'no-func-assign': 2,
|
||||
'no-implied-eval': 2,
|
||||
'no-inner-declarations': [2, 'functions'],
|
||||
'no-invalid-regexp': 2,
|
||||
'no-irregular-whitespace': 2,
|
||||
'no-iterator': 2,
|
||||
'no-label-var': 2,
|
||||
'no-labels': [2, {
|
||||
'allowLoop': false,
|
||||
'allowSwitch': false
|
||||
}],
|
||||
'no-lone-blocks': 2,
|
||||
'no-mixed-spaces-and-tabs': 2,
|
||||
'no-multi-spaces': 2,
|
||||
'no-multi-str': 2,
|
||||
'no-multiple-empty-lines': [2, {
|
||||
'max': 1
|
||||
}],
|
||||
'no-native-reassign': 2,
|
||||
'no-negated-in-lhs': 2,
|
||||
'no-new-object': 2,
|
||||
'no-new-require': 2,
|
||||
'no-new-symbol': 2,
|
||||
'no-new-wrappers': 2,
|
||||
'no-obj-calls': 2,
|
||||
'no-octal': 2,
|
||||
'no-octal-escape': 2,
|
||||
'no-path-concat': 2,
|
||||
'no-proto': 2,
|
||||
'no-redeclare': 2,
|
||||
'no-regex-spaces': 2,
|
||||
'no-return-assign': [2, 'except-parens'],
|
||||
'no-self-assign': 2,
|
||||
'no-self-compare': 2,
|
||||
'no-sequences': 2,
|
||||
'no-shadow-restricted-names': 2,
|
||||
'no-spaced-func': 2,
|
||||
'no-sparse-arrays': 2,
|
||||
'no-this-before-super': 2,
|
||||
'no-throw-literal': 2,
|
||||
'no-trailing-spaces': 2,
|
||||
'no-undef': 2,
|
||||
'no-undef-init': 2,
|
||||
'no-unexpected-multiline': 2,
|
||||
'no-unmodified-loop-condition': 2,
|
||||
'no-unneeded-ternary': [2, {
|
||||
'defaultAssignment': false
|
||||
}],
|
||||
'no-unreachable': 2,
|
||||
'no-unsafe-finally': 2,
|
||||
'no-unused-vars': [2, {
|
||||
'vars': 'all',
|
||||
'args': 'none'
|
||||
}],
|
||||
'no-useless-call': 2,
|
||||
'no-useless-computed-key': 2,
|
||||
'no-useless-constructor': 2,
|
||||
'no-useless-escape': 0,
|
||||
'no-whitespace-before-property': 2,
|
||||
'no-with': 2,
|
||||
'one-var': [2, {
|
||||
'initialized': 'never'
|
||||
}],
|
||||
'operator-linebreak': [2, 'after', {
|
||||
'overrides': {
|
||||
'?': 'before',
|
||||
':': 'before'
|
||||
}
|
||||
}],
|
||||
'padded-blocks': [2, 'never'],
|
||||
'quotes': [2, 'single', {
|
||||
'avoidEscape': true,
|
||||
'allowTemplateLiterals': true
|
||||
}],
|
||||
'semi': [2, 'never'],
|
||||
'semi-spacing': [2, {
|
||||
'before': false,
|
||||
'after': true
|
||||
}],
|
||||
'space-before-blocks': [2, 'always'],
|
||||
'space-before-function-paren': [2, 'never'],
|
||||
'space-in-parens': [2, 'never'],
|
||||
'space-infix-ops': 2,
|
||||
'space-unary-ops': [2, {
|
||||
'words': true,
|
||||
'nonwords': false
|
||||
}],
|
||||
'spaced-comment': [2, 'always', {
|
||||
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
|
||||
}],
|
||||
'template-curly-spacing': [2, 'never'],
|
||||
'use-isnan': 2,
|
||||
'valid-typeof': 2,
|
||||
'wrap-iife': [2, 'any'],
|
||||
'yield-star-spacing': [2, 'both'],
|
||||
'yoda': [2, 'never'],
|
||||
'prefer-const': 2,
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
||||
'object-curly-spacing': [2, 'always', {
|
||||
objectsInObjects: false
|
||||
}],
|
||||
'array-bracket-spacing': [2, 'never']
|
||||
}
|
||||
}
|
||||
23
seller/.gitignore
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
dist/
|
||||
gifs/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
test/unit/coverage
|
||||
test/e2e/reports
|
||||
selenium-debug.log
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
|
||||
yarn.lock
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
8
seller/Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
FROM nginx:alpine
|
||||
|
||||
RUN mkdir -p /app/
|
||||
COPY ./dist /app/
|
||||
COPY ./nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
|
||||
EXPOSE 80
|
||||
38
seller/README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# LILISHOP-UI
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Run your tests
|
||||
```
|
||||
npm run test
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
详情点击 [https://cli.vuejs.org/zn/config/](https://cli.vuejs.org/zn/config/).
|
||||
|
||||
#### login.vue页面,测试时不走权限,直接return 318行
|
||||
#### util.initRouter 方法,开发时注释掉登录验证,调用路由接口验证
|
||||
#### Main.vue 页面,241行,修改,避免报错
|
||||
|
||||
#### main-components 头部,左侧所有内容
|
||||
|
||||
#### lili-floor-renovation 楼层装修模块
|
||||
|
||||
10
seller/babel.config.js
Normal file
@@ -0,0 +1,10 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
[
|
||||
'@vue/app',
|
||||
{
|
||||
useBuiltIns: 'entry'
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
1
seller/docker.sh
Normal file
@@ -0,0 +1 @@
|
||||
docker build -t registry.cn-beijing.aliyuncs.com/lili-images/seller-ui-1.0.1:0.0.1 .
|
||||
51
seller/nginx.conf
Normal file
@@ -0,0 +1,51 @@
|
||||
#这个文件给docker用的
|
||||
#user nobody;
|
||||
worker_processes 1;
|
||||
|
||||
#error_log logs/error.log;
|
||||
#error_log logs/error.log notice;
|
||||
#error_log logs/error.log info;
|
||||
|
||||
#pid logs/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
# '$status $body_bytes_sent "$http_referer" '
|
||||
# '"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
#access_log logs/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
#keepalive_timeout 0;
|
||||
keepalive_timeout 65;
|
||||
client_max_body_size 10m;
|
||||
gzip on;
|
||||
gzip_min_length 5k;
|
||||
gzip_buffers 4 16k;
|
||||
gzip_http_version 1.0;
|
||||
gzip_comp_level 4;
|
||||
gzip_types text/plain application/x-javascript application/javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
|
||||
gzip_vary on;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root /app;
|
||||
try_files $uri $uri/ /index.html $uri/ =404;
|
||||
index index.html index.htm;
|
||||
}
|
||||
}
|
||||
}
|
||||
62
seller/package.json
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"name": "lilishop",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"description": "lilishop-ui",
|
||||
"author": "lili-platform",
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"dev": "vue-cli-service serve"
|
||||
},
|
||||
"dependencies": {
|
||||
"@amap/amap-jsapi-loader": "0.0.7",
|
||||
"@antv/g2": "^4.1.14",
|
||||
"axios": "^0.21.1",
|
||||
"core-js": "^3.6.5",
|
||||
"countup.js": "^2.0.4",
|
||||
"date-fns": "^1.30.1",
|
||||
"dplayer": "^1.26.0",
|
||||
"gitalk": "^1.6.2",
|
||||
"html2canvas": "^1.0.0-rc.5",
|
||||
"js-cookie": "^2.2.1",
|
||||
"node-sass": "^4.14.1",
|
||||
"pinyin": "^2.9.0",
|
||||
"print-js": "^1.0.63",
|
||||
"qrcodejs2": "0.0.2",
|
||||
"quill": "^1.3.7",
|
||||
"sass-loader": "^8.0.2",
|
||||
"sockjs-client": "^1.4.0",
|
||||
"stompjs": "^2.3.3",
|
||||
"swiper": "^6.3.5",
|
||||
"view-design": "^4.2.0",
|
||||
"vue": "^2.6.10",
|
||||
"vue-awesome": "^4.0.2",
|
||||
"vue-awesome-swiper": "^4.1.1",
|
||||
"vue-clipboard2": "^0.3.0",
|
||||
"vue-cropper": "^0.4.9",
|
||||
"vue-i18n": "^8.15.1",
|
||||
"vue-json-pretty": "^1.4.1",
|
||||
"vue-lazyload": "^1.3.3",
|
||||
"vue-router": "^3.1.3",
|
||||
"vuedraggable": "^2.23.2",
|
||||
"vuex": "^3.4.0",
|
||||
"wangeditor": "^4.6.13",
|
||||
"xlsx": "^0.16.2",
|
||||
"xss": "^1.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^4.4.4",
|
||||
"@vue/cli-plugin-router": "^4.4.4",
|
||||
"@vue/cli-plugin-vuex": "^4.4.4",
|
||||
"@vue/cli-service": "^4.4.4",
|
||||
"compression-webpack-plugin": "^4.0.0",
|
||||
"css-loader": "^5.0.1",
|
||||
"less": "^3.12.2",
|
||||
"less-loader": "^6.2.0",
|
||||
"style-loader": "^2.0.0",
|
||||
"style-resources-loader": "^1.3.2",
|
||||
"vue-cli-plugin-style-resources-loader": "^0.1.4",
|
||||
"vue-template-compiler": "^2.6.10"
|
||||
}
|
||||
}
|
||||
5
seller/postcss.config.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
autoprefixer: {}
|
||||
}
|
||||
}
|
||||
109
seller/public/index.html
Normal file
@@ -0,0 +1,109 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
|
||||
<link rel="icon" href="./logo.ico" type="image/x-icon">
|
||||
<title>lili store</title>
|
||||
<meta name="keywords"
|
||||
content="keywords">
|
||||
<meta name="description"
|
||||
content="description">
|
||||
<!-- 部署CDN优化 -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vuex@3.1.2/dist/vuex.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-i18n@8.15.1/dist/vue-i18n.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/axios@0.19.0/dist/axios.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/view-design@4.1.1/dist/styles/iview.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/view-design@4.1.1/dist/iview.min.js"></script>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-lazyload@1.3.3/vue-lazyload.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/xlsx@0.15.3/dist/xlsx.full.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/dplayer@1.25.0/dist/DPlayer.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/print-js@1.0.63/dist/print.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/html2canvas@1.0.0-rc.5/dist/html2canvas.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-json-pretty@1.6.2/vue-json-pretty.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gitalk@1.5.0/dist/gitalk.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/wangeditor@3.1.1/release/wangEditor.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/quill@1.3.7/dist/quill.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/quill@1.3.7/dist/quill.snow.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/stomp.js/2.3.3/stomp.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.8.4/Sortable.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vuedraggable@2.23.2/dist/vuedraggable.umd.min.js"></script>
|
||||
<script src="https://v.vaptcha.com/v3.js"></script>
|
||||
<style>
|
||||
.page-loading-wrap {
|
||||
padding: 120px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.half-circle-spinner,
|
||||
.half-circle-spinner * {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.half-circle-spinner {
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
border-radius: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.half-circle-spinner .circle {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 100%;
|
||||
border: calc(35px / 10) solid transparent;
|
||||
}
|
||||
|
||||
.half-circle-spinner .circle.circle-1 {
|
||||
border-top-color: #5cadff;
|
||||
animation: half-circle-spinner-animation 1s infinite;
|
||||
}
|
||||
|
||||
.half-circle-spinner .circle.circle-2 {
|
||||
border-bottom-color: #5cadff;
|
||||
animation: half-circle-spinner-animation 1s infinite alternate;
|
||||
}
|
||||
|
||||
@keyframes half-circle-spinner-animation {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but lili-admin doesn't work properly without JavaScript enabled. Please enable it to
|
||||
continue.</strong>
|
||||
</noscript>
|
||||
<div id="app">
|
||||
<div class="page-loading-wrap">
|
||||
<div class="half-circle-spinner">
|
||||
<div class="circle circle-1"></div>
|
||||
<div class="circle circle-2"></div>
|
||||
</div>
|
||||
<h4 style="margin-top:20px;">正在加载资源...</h4>
|
||||
</div>
|
||||
</div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
|
||||
</html>
|
||||
BIN
seller/public/logo.ico
Normal file
|
After Width: | Height: | Size: 19 KiB |
46
seller/src/App.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<div id="main" class="app-main">
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
mounted() {},
|
||||
beforeDestroy() {},
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
.app-main {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.br button {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.operation button {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.ivu-btn-text:focus {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.ivu-tag {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
10
seller/src/api/address.js
Normal file
@@ -0,0 +1,10 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {getRequest, postRequest, putRequest, deleteRequest, importRequest, getRequestWithNoToken} from '@/libs/axios';
|
||||
|
||||
|
||||
// 传给后台citycode 获取城市街道等id
|
||||
export const handleRegion = (params) => {
|
||||
return getRequest(`/address/region`,params)
|
||||
}
|
||||
|
||||
|
||||
11
seller/src/api/common.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import {commonUrl, getRequest} from '@/libs/axios';
|
||||
|
||||
// 通过id获取子地区
|
||||
export const getChildRegion = (id) => {
|
||||
return getRequest(`${commonUrl}/common/region/item/${id}`);
|
||||
};
|
||||
|
||||
// 点地图获取地址信息
|
||||
export const getRegion = (parpams) => {
|
||||
return getRequest(`${commonUrl}/common/region/region`, parpams);
|
||||
};
|
||||
72
seller/src/api/distribution.js
Normal file
@@ -0,0 +1,72 @@
|
||||
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {getRequest, postRequest, putRequest, deleteRequest, importRequest, getRequestWithNoToken} from '@/libs/axios';
|
||||
|
||||
|
||||
//获取分销商品列表
|
||||
export const getDistributionGoods = (params) => {
|
||||
return getRequest('/distributionGoods', params)
|
||||
}
|
||||
|
||||
// 取消分销商品
|
||||
export const distributionGoodsCancel = (id) => {
|
||||
return deleteRequest(`/distributionGoods/cancel/${id}`)
|
||||
}
|
||||
|
||||
// 选择分销商品
|
||||
export const distributionGoodsCheck = (id,param) => {
|
||||
return putRequest(`/distributionGoods/checked/${id}`,param)
|
||||
}
|
||||
|
||||
|
||||
//查询分销商
|
||||
export const getDistributionListData = (params) => {
|
||||
return getRequest('/distribution/getByPage', params)
|
||||
}
|
||||
//审核分销商
|
||||
export const auditDistribution = (id, params) => {
|
||||
return putRequest(`/distribution/audit/${id}`, params)
|
||||
}
|
||||
|
||||
// 清退分销商
|
||||
export const retreatDistribution = (id, params) => {
|
||||
return putRequest(`/distribution/retreat/${id}`, params)
|
||||
}
|
||||
|
||||
// 恢复分销商
|
||||
export const resumeDistribution = (id, params) => {
|
||||
return putRequest(`/distribution/resume/${id}`, params)
|
||||
}
|
||||
|
||||
//保存更新分销设置
|
||||
export const saveDistributionSetting = (params) => {
|
||||
return postRequest('/distribution/setting/insertOrUpdate', params)
|
||||
}
|
||||
|
||||
//获取分销设置
|
||||
export const getDistributionSetting = (id, params) => {
|
||||
return getRequest(`/distribution/setting/get/${id}`, params)
|
||||
}
|
||||
|
||||
|
||||
//获取分销订单列表
|
||||
export const getDistributionOrder = (params) => {
|
||||
return getRequest('/distribution/order/getByPage', params)
|
||||
}
|
||||
|
||||
|
||||
//删除分销商品
|
||||
export const delDistributionGoods = (ids) => {
|
||||
return deleteRequest(`/distribution/goods/delByIds/${ids}`)
|
||||
}
|
||||
//获取分销佣金信息
|
||||
export const getDistributionCash = (params) => {
|
||||
return getRequest('/distribution/cash/getByPage', params)
|
||||
}
|
||||
//审核分销佣金申请
|
||||
export const auditDistributionCash = (id,params) => {
|
||||
return postRequest(`/distribution/cash/audit/${id}`, params)
|
||||
}
|
||||
|
||||
|
||||
|
||||
370
seller/src/api/goods.js
Normal file
@@ -0,0 +1,370 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {
|
||||
getRequest,
|
||||
postRequest,
|
||||
putRequest,
|
||||
deleteRequest,
|
||||
importRequest,
|
||||
getRequestWithNoToken,
|
||||
commonUrl
|
||||
} from "@/libs/axios";
|
||||
import config from "@/config";
|
||||
|
||||
// 文件上传接口
|
||||
export const uploadFile = commonUrl + "/common/upload/file";
|
||||
// 验证码渲染图片接口
|
||||
export const drawCodeImage = "/common/captcha/draw/";
|
||||
// 获取菜单
|
||||
export const getMenuList = "/permission/getMenuList";
|
||||
// 获取数据字典
|
||||
export const getDictData = "/dictData/getByType/";
|
||||
// Websocket
|
||||
export const ws = "/ws";
|
||||
|
||||
// 获取当前店铺分类
|
||||
export const getShopGoodsLabelList = () => {
|
||||
return getRequest(`/goods/label`);
|
||||
};
|
||||
|
||||
// 添加当前店铺分类
|
||||
export const addShopGoodsLabel = params => {
|
||||
return postRequest(`/goods/label`, params);
|
||||
};
|
||||
|
||||
// 修改当前店铺分类
|
||||
export const editShopGoodsLabel = params => {
|
||||
return putRequest(`/goods/label`, params);
|
||||
};
|
||||
|
||||
// 删除当前店铺分类
|
||||
export const delCategdelShopGoodsLabel = id => {
|
||||
return deleteRequest(`/goods/label/${id}`);
|
||||
};
|
||||
|
||||
// 根据goodsId分页获取商品列表
|
||||
export const getQueryGoodsIdGoodsList = goodsId => {
|
||||
return getRequest(`/goods/sku/${goodsId}/list`);
|
||||
};
|
||||
|
||||
// 获取商品分页列表
|
||||
export const getGoodsSkuListDataSeller = params => {
|
||||
return getRequest("/goods/sku/list", params);
|
||||
};
|
||||
|
||||
// 获取商品品牌分页列表
|
||||
export const getUserListData = params => {
|
||||
return getRequest("/goods/brand/getByPage", params);
|
||||
};
|
||||
// 添加或修改品牌设置
|
||||
export const insertOrUpdateBrand = params => {
|
||||
return postRequest("/goods/brand/insertOrUpdate", params);
|
||||
};
|
||||
// 启用品牌
|
||||
export const enableBrand = (id, params) => {
|
||||
return postRequest(`/goods/brand/enable/${id}`, params);
|
||||
};
|
||||
// 禁用品牌
|
||||
export const disableBrand = (id, params) => {
|
||||
return postRequest(`/goods/brand/disable/${id}`, params);
|
||||
};
|
||||
//根据分类id获取关联品牌
|
||||
export const getCategoryBrandListData = (category_id, params) => {
|
||||
return getRequest(`/category/brand/${category_id}`, params);
|
||||
};
|
||||
//保存获取关联品牌
|
||||
export const saveCategoryBrand = (category_id, params) => {
|
||||
return postRequest(`/category/brand/${category_id}`, params);
|
||||
};
|
||||
//保存获取关联规格
|
||||
export const saveCategorySpec = (category_id, params) => {
|
||||
return postRequest(`/goods/category/spec/${category_id}`, params);
|
||||
};
|
||||
|
||||
//获取所有可用品牌
|
||||
export const getBrandListData = params => {
|
||||
return getRequest("/goods/brand/all", params);
|
||||
};
|
||||
// 获取所有可用规格
|
||||
export const getSpecificationList = params => {
|
||||
return getRequest("/goods/spec/all", params);
|
||||
};
|
||||
|
||||
// 获取店铺分类列表数据
|
||||
export const getAllList = id => {
|
||||
return getRequest(`/goods/label/get/${id}`);
|
||||
};
|
||||
|
||||
// 添加商品分类
|
||||
export const insertCategory = params => {
|
||||
return postRequest("/goods/category/insertCategory", params);
|
||||
};
|
||||
// 添加商品分类
|
||||
export const updateCategory = params => {
|
||||
return postRequest("/goods/category/updateCategory", params);
|
||||
};
|
||||
//删除商品分类
|
||||
export const delCategory = id => {
|
||||
return deleteRequest(`/goods/category/del/${id}`);
|
||||
};
|
||||
// 启用分类
|
||||
export const enableCategory = (id, type) => {
|
||||
return postRequest(`/goods/category/enable/${id}`, type);
|
||||
};
|
||||
// 禁用分类
|
||||
export const disableCategory = (id, type) => {
|
||||
return postRequest(`/goods/category/disable/${id}`, type);
|
||||
};
|
||||
|
||||
// 获取商品规格分页列表
|
||||
export const getSpecListData = params => {
|
||||
return getRequest("/goods/spec/list", params);
|
||||
};
|
||||
// 添加或修改规格设置
|
||||
export const insertOrUpdateSpec = params => {
|
||||
return postRequest("/goods/spec/edit", params);
|
||||
};
|
||||
//根据分类id获取关联规格
|
||||
export const getCategorySpecListData = (category_id, params) => {
|
||||
return getRequest(`/goods/category/spec/${category_id}`, params);
|
||||
};
|
||||
//删除gUI个
|
||||
export const delSpec = (id, params) => {
|
||||
return deleteRequest(`/goods/spec/del/${id}`, params);
|
||||
};
|
||||
// 获取商品规格值列表
|
||||
export const getSpecValuesListData = (id, params) => {
|
||||
return getRequest(`/goods/spec-values/values/${id}`, params);
|
||||
};
|
||||
// 添加商品规格值
|
||||
export const saveSpecValues = (id, params) => {
|
||||
return postRequest(`/goods/spec-values/save/${id}`, params);
|
||||
};
|
||||
|
||||
// 查询某分类下的全部子分类列表
|
||||
export const getGoodsCategory = parent_id => {
|
||||
return getRequest(`/goods/category/${parent_id}/all-children`);
|
||||
};
|
||||
|
||||
// 获取商品sku分页列表
|
||||
export const getGoodsSkuData = params => {
|
||||
return getRequest("/goods/sku/list", params);
|
||||
};
|
||||
|
||||
// 获取商品分页列表
|
||||
export const getGoodsListData = params => {
|
||||
return getRequest("/goods/list", params);
|
||||
};
|
||||
// 获取待审核商品分页列表
|
||||
export const getAuthGoodsListData = params => {
|
||||
return getRequest("/goods/auth/list", params);
|
||||
};
|
||||
|
||||
// 审核商品
|
||||
export const authGoods = (id, params) => {
|
||||
return putRequest(`/goods/${id}/auth`, params);
|
||||
};
|
||||
|
||||
/**
|
||||
* 发布商品 查询商品品类 分级查询(商城商品品类)
|
||||
* @param ids
|
||||
* @param params
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
export const getGoodsCategoryLevelList = (ids, params) => {
|
||||
return getRequest(`/goods/category/${ids}/children`, params);
|
||||
};
|
||||
|
||||
// 获取全部经营类目
|
||||
export const getGoodsCategoryAll = () => {
|
||||
return getRequest(`/goods/category/all`);
|
||||
};
|
||||
|
||||
// 获取当前店铺分类
|
||||
export const getShopGoodsLabelListSeller = () => {
|
||||
return getRequest(`/goods/label`);
|
||||
};
|
||||
|
||||
//查询分类绑定参数信息
|
||||
export const getCategoryParamsListData = (id, params) => {
|
||||
return getRequest(`/goods/category/parameters/${id}`, params);
|
||||
};
|
||||
//查询商品绑定参数信息
|
||||
export const getCategoryParamsByGoodsId = (goodsId, categoryId) => {
|
||||
return getRequest(`/goods/parameters/${goodsId}/${categoryId}`);
|
||||
};
|
||||
//更新或者保存参数
|
||||
export const insertOrUpdateParams = params => {
|
||||
return postRequest("/goods/parameters/save", params);
|
||||
};
|
||||
//删除参数
|
||||
export const deleteParams = (id, params) => {
|
||||
return deleteRequest(`/goods/parameters/${id}`, params);
|
||||
};
|
||||
//更新或者保存参数组
|
||||
export const insertOrUpdateParamsGroup = params => {
|
||||
return postRequest("/goods/category/parameters/save", params);
|
||||
};
|
||||
//删除参数组
|
||||
export const deleteParamsGroup = (id, params) => {
|
||||
return deleteRequest(`/goods/category/parameters/${id}`, params);
|
||||
};
|
||||
|
||||
//保存获取关联规格
|
||||
export const getGoodsSpecInfo = (category_id, params) => {
|
||||
return getRequest(`/goods/category/spec/goods/${category_id}`, params);
|
||||
};
|
||||
|
||||
//获取sku列表
|
||||
export const getSkuPage = params => {
|
||||
return getRequest(`/goodsSku/getByPage`, params);
|
||||
};
|
||||
|
||||
// 获取商品规格值列表
|
||||
export const getSpecValuesListSellerData = (id, params) => {
|
||||
return getRequest(`/goods/spec-values/values/${id}`, params);
|
||||
};
|
||||
// 添加商品规格值
|
||||
export const saveSpecValuesSeller = (id, params) => {
|
||||
return postRequest(`/goods/spec-values/save/${id}`, params);
|
||||
};
|
||||
|
||||
// 获取商品规格分页列表
|
||||
export const getSpecListSellerData = params => {
|
||||
return getRequest("/goods/spec/page", params);
|
||||
};
|
||||
// 添加或修改规格设置
|
||||
export const insertSpecSeller = params => {
|
||||
return postRequest("/goods/spec", params);
|
||||
};
|
||||
|
||||
// 更新商品库存
|
||||
export const updateGoodsSkuStocks = params => {
|
||||
return putRequest("/goods/update/stocks", params, {
|
||||
"Content-Type": "application/json"
|
||||
});
|
||||
};
|
||||
// 获取商品分页列表
|
||||
export const getGoodsListDataSeller = params => {
|
||||
return getRequest("/goods/list", params);
|
||||
};
|
||||
// 获取商品告警分页列表
|
||||
export const getGoodsListDataByStockSeller = params => {
|
||||
return getRequest("/goods/list/stock", params);
|
||||
};
|
||||
// 获取商品详情
|
||||
export const getGoods = id => {
|
||||
return getRequest(`/goods/get/${id}`);
|
||||
};
|
||||
// 上架商品
|
||||
export const upGoods = params => {
|
||||
return putRequest(`/goods/up`, params);
|
||||
};
|
||||
// 删除商品
|
||||
export const deleteGoods = params => {
|
||||
return putRequest(`/goods/delete`, params);
|
||||
};
|
||||
// 下架商品
|
||||
export const lowGoods = params => {
|
||||
return putRequest(`/goods/under`, params);
|
||||
};
|
||||
|
||||
// 获取商品单位列表
|
||||
export const getGoodsUnitList = () => {
|
||||
return getRequest(`/goods/unit`);
|
||||
};
|
||||
//根据分类id获取关联品牌
|
||||
export const getCategoryBrandListDataSeller = (category_id, params) => {
|
||||
return getRequest(`/goods/category/${category_id}/brands`, params);
|
||||
};
|
||||
|
||||
export function createGoods(params) {
|
||||
return postRequest("/goods/create", params, {
|
||||
"Content-Type": "application/json"
|
||||
});
|
||||
}
|
||||
|
||||
export function editGoods(goodsId, params) {
|
||||
return putRequest(`/goods/update/${goodsId}`, params, {
|
||||
"Content-Type": "application/json"
|
||||
});
|
||||
}
|
||||
|
||||
// 获取草稿商品分页列表
|
||||
export const getDraftGoodsListData = params => {
|
||||
return getRequest("/draft/goods/page", params);
|
||||
};
|
||||
|
||||
// 获取草稿商品详情
|
||||
export const getDraftGoodsDetail = id => {
|
||||
return getRequest(`/draft/goods/${id}`);
|
||||
};
|
||||
|
||||
// 保存草稿商品
|
||||
export function saveDraftGoods(params) {
|
||||
return postRequest("/draft/goods/save", params, {
|
||||
"Content-Type": "application/json"
|
||||
});
|
||||
}
|
||||
|
||||
// 删除草稿商品
|
||||
export const deleteDraftGoods = id => {
|
||||
return deleteRequest(`/draft/goods/${id}`);
|
||||
};
|
||||
|
||||
//查询分类绑定参数信息
|
||||
export const getCategoryParamsListDataSeller = (id, params) => {
|
||||
return getRequest(`/goods/category/parameters/${id}`, params);
|
||||
};
|
||||
|
||||
//保存获取关联规格
|
||||
export const getGoodsSpecInfoSeller = (category_id, params) => {
|
||||
return getRequest(`/goods/category/spec/goods/${category_id}`, params);
|
||||
};
|
||||
|
||||
//批量设置运费模板
|
||||
export const batchShipTemplate = params => {
|
||||
return putRequest(`/goods/freight`, params);
|
||||
};
|
||||
|
||||
|
||||
// 获取订单统计图表
|
||||
export const getOrderChart = params => {
|
||||
return getRequest(`/statistics/order`, params);
|
||||
};
|
||||
|
||||
// 订单统计概览
|
||||
export const getOrderOverView = params => {
|
||||
return getRequest(`/statistics/order/overview`, params);
|
||||
};
|
||||
|
||||
// 统计相关订单统计
|
||||
|
||||
export const statisticsOrderList = params => {
|
||||
return getRequest(`/statistics/order/order`, params);
|
||||
};
|
||||
|
||||
// 统计相关退单统计
|
||||
|
||||
export const statisticsOrderRefundList = params => {
|
||||
return getRequest(`/statistics/order/refund`, params);
|
||||
};
|
||||
|
||||
// 获取行业统计列表
|
||||
export const goodsCategoryStatistics = params => {
|
||||
return getRequest(`/statistics/goods/getCategoryByPage`, params);
|
||||
};
|
||||
|
||||
// 获取统计列表,排行前一百的数据
|
||||
export const goodsStatistics = params => {
|
||||
return getRequest(`/statistics/goods`, params);
|
||||
};
|
||||
|
||||
// 获取退款统计列表
|
||||
export const refundStatistics = params => {
|
||||
return getRequest(`/statistics/refund/order/getByPage`, params);
|
||||
};
|
||||
|
||||
// 获取退款统计金额
|
||||
export const refundPriceStatistics = params => {
|
||||
return getRequest(`/statistics/refund/order/getPrice`, params);
|
||||
};
|
||||
273
seller/src/api/index.js
Normal file
@@ -0,0 +1,273 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {
|
||||
getRequest,
|
||||
postRequest,
|
||||
putRequest,
|
||||
deleteRequest,
|
||||
getRequestWithNoToken,
|
||||
postRequestWithNoToken,
|
||||
commonUrl,
|
||||
baseUrl
|
||||
} from "@/libs/axios";
|
||||
|
||||
// 文件上传接口
|
||||
export const uploadFile = commonUrl + "/common/upload/file";
|
||||
// 验证码渲染图片接口
|
||||
export const drawCodeImage = commonUrl + "/common/captcha/draw/";
|
||||
// 获取菜单
|
||||
export const getMenuList = baseUrl + "/permission/getMenuList";
|
||||
|
||||
//获取所有city
|
||||
export const getAllCity = (params) => {
|
||||
return getRequest(commonUrl+'/common/region/allCity', params)
|
||||
}
|
||||
|
||||
// 登陆
|
||||
export const getHomeNotice = params => {
|
||||
return getRequest("/article/getByPage?type=STORE_ARTICLE&pageSize=15");
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 登陆
|
||||
export const getSellerHomeData = params => {
|
||||
return getRequest("/statistics/index", params);
|
||||
};
|
||||
|
||||
|
||||
// 登陆
|
||||
export const login = params => {
|
||||
return postRequestWithNoToken("/login/userLogin", params);
|
||||
};
|
||||
// 获取用户登录信息
|
||||
export const userInfo = params => {
|
||||
return getRequest("/user/info", params);
|
||||
};
|
||||
// 获取登录信息
|
||||
export const userMsg = params => {
|
||||
return getRequest('/settings', params)
|
||||
}
|
||||
// 注册
|
||||
export const regist = params => {
|
||||
return postRequest("/user/regist", params);
|
||||
};
|
||||
// 初始化验证码
|
||||
export const initCaptcha = params => {
|
||||
return getRequestWithNoToken("/common/captcha/init", params);
|
||||
};
|
||||
// 发送登录短信验证码
|
||||
export const sendLoginSms = (mobile, params) => {
|
||||
return getRequest(`/common/captcha/sendLoginSms/${mobile}`, params);
|
||||
};
|
||||
// 发送注册短信验证码
|
||||
export const sendRegistSms = (mobile, params) => {
|
||||
return getRequest(`/common/captcha/sendRegistSms/${mobile}`, params);
|
||||
};
|
||||
// 发送重置密码短信验证码
|
||||
export const sendResetSms = (mobile, params) => {
|
||||
return getRequest(`${commonUrl}/common/captcha/sendResetSms/${mobile}`, params);
|
||||
};
|
||||
// 发送修改绑定手机短信验证码
|
||||
export const sendEditMobileSms = (mobile, params) => {
|
||||
return getRequest(`/common/captcha/sendEditMobileSms/${mobile}`, params);
|
||||
};
|
||||
// 通过手机重置密码
|
||||
export const resetByMobile = params => {
|
||||
return postRequest("/user/resetByMobile", params);
|
||||
};
|
||||
// 发送重置密码邮件验证码
|
||||
export const sendResetEmail = (email, params) => {
|
||||
return getRequest(`/email/sendResetCode/${email}`, params);
|
||||
};
|
||||
// 发送修改绑定邮件验证码
|
||||
export const sendEditEmail = (email, params) => {
|
||||
return getRequest(`/email/sendEditCode/${email}`, params);
|
||||
};
|
||||
// 通过邮件重置密码
|
||||
export const resetByEmail = params => {
|
||||
return postRequest("/email/resetByEmail", params);
|
||||
};
|
||||
// 短信验证码登录
|
||||
export const smsLogin = params => {
|
||||
return postRequest("/user/smsLogin", params);
|
||||
};
|
||||
// IP天气信息
|
||||
export const ipInfo = params => {
|
||||
return getRequest("/common/ip/info", params);
|
||||
};
|
||||
// 个人中心编辑
|
||||
export const userInfoEdit = params => {
|
||||
return postRequest("/user/edit", params);
|
||||
};
|
||||
// 个人中心发送修改邮箱验证邮件
|
||||
export const sendCodeEmail = (email, params) => {
|
||||
return getRequest(`/email/sendCode/${email}`, params);
|
||||
};
|
||||
// 个人中心发送修改邮箱验证邮件
|
||||
export const editEmail = params => {
|
||||
return postRequest("/email/editEmail", params);
|
||||
};
|
||||
// 个人中心修改密码
|
||||
export const changePass = params => {
|
||||
return postRequest("/login/modifyPass", params);
|
||||
};
|
||||
// 个人中心修改手机
|
||||
export const changeMobile = params => {
|
||||
return postRequest("/user/changeMobile", params);
|
||||
};
|
||||
// 获取绑定账号信息
|
||||
export const relatedInfo = (username, params) => {
|
||||
return getRequest(`/relate/getRelatedInfo/${username}`, params);
|
||||
};
|
||||
// 解绑账号
|
||||
export const unRelate = params => {
|
||||
return postRequest("/relate/delByIds", params);
|
||||
};
|
||||
// 分页获取绑定账号信息
|
||||
export const getRelatedListData = params => {
|
||||
return getRequest("/relate/findByCondition", params);
|
||||
};
|
||||
|
||||
// 获取用户数据 多条件
|
||||
export const getUserListData = params => {
|
||||
return getRequest("/user/getByCondition", params);
|
||||
};
|
||||
// 通过用户名搜索
|
||||
export const searchUserByName = (username, params) => {
|
||||
return getRequest("/user/searchByName/" + username, params);
|
||||
};
|
||||
// 获取全部用户数据
|
||||
export const getAllUserData = params => {
|
||||
return getRequest("/user/getAll", params);
|
||||
};
|
||||
|
||||
// 添加用户
|
||||
export const addUser = params => {
|
||||
return postRequest("/user/admin/add", params);
|
||||
};
|
||||
// 编辑用户
|
||||
export const editUser = params => {
|
||||
return postRequest("/user/admin/edit", params);
|
||||
};
|
||||
// 启用用户
|
||||
export const enableUser = (id, params) => {
|
||||
return postRequest(`/user/admin/enable/${id}`, params);
|
||||
};
|
||||
// 禁用用户
|
||||
export const disableUser = (id, params) => {
|
||||
return postRequest(`/user/admin/disable/${id}`, params);
|
||||
};
|
||||
// 删除用户
|
||||
export const deleteUser = (ids, params) => {
|
||||
return deleteRequest(`/user/delByIds/${ids}`, params);
|
||||
};
|
||||
// 重置用户密码
|
||||
export const resetUserPass = params => {
|
||||
return postRequest("/user/resetPass", params);
|
||||
};
|
||||
/****************************** 权限结束 */
|
||||
|
||||
// 分页获取日志数据
|
||||
export const getLogListData = params => {
|
||||
return getRequest("/log/getAllByPage", params);
|
||||
};
|
||||
// 分页获取消息数据
|
||||
export const getMessageData = params => {
|
||||
return getRequest("/message/getByCondition", params);
|
||||
};
|
||||
// 获取单个消息详情
|
||||
export const getMessageDataById = (id, params) => {
|
||||
return getRequest(`/message/get/${id}`, params);
|
||||
};
|
||||
// 添加消息
|
||||
export const addMessage = params => {
|
||||
return postRequest("/message/add", params);
|
||||
};
|
||||
// 编辑消息
|
||||
export const editMessage = params => {
|
||||
return postRequest("/message/edit", params);
|
||||
};
|
||||
// 回收站还原消息
|
||||
export const reductionMessage = (ids, params) => {
|
||||
return putRequest(`/message/${ids}/reduction`, params);
|
||||
};
|
||||
// 彻底删除消息
|
||||
export const clearMessage = (ids, params) => {
|
||||
return deleteRequest(`/message/${ids}`, params);
|
||||
};
|
||||
// 已读消息放入回收站
|
||||
export const deleteMessage = (ids, params) => {
|
||||
return deleteRequest(`/message/${ids}/delete`, params);
|
||||
};
|
||||
// 分页获取消息推送数据
|
||||
export const getMessageSendData = params => {
|
||||
return getRequest("/message", params);
|
||||
};
|
||||
// 进入消息中心首次加载全部数据
|
||||
export const getAllMessage = params => {
|
||||
return getRequest("/message/all", params);
|
||||
};
|
||||
// 已读消息
|
||||
export const read = (id) => {
|
||||
return putRequest(`/message/${id}/read`);
|
||||
};
|
||||
// 删除发送消息
|
||||
export const deleteMessageSend = (ids, params) => {
|
||||
return deleteRequest(`/messageSend/delByIds/${ids}`, params);
|
||||
};
|
||||
|
||||
// 分页获取文件数据
|
||||
export const getFileListData = params => {
|
||||
return getRequest("/file", params);
|
||||
};
|
||||
|
||||
|
||||
// 复制文件
|
||||
export const copyFile = params => {
|
||||
return postRequest("/file/copy", params);
|
||||
};
|
||||
// 重命名文件
|
||||
export const renameFile = params => {
|
||||
return postRequest("/file/rename", params);
|
||||
};
|
||||
// 删除文件
|
||||
export const deleteFile = (ids, params) => {
|
||||
return deleteRequest(`/file/delete/${ids}`, params);
|
||||
};
|
||||
// 下载文件
|
||||
export const aliDownloadFile = (fKey, params) => {
|
||||
return getRequest(`/file/ali/download/${fKey}`, params);
|
||||
};
|
||||
|
||||
|
||||
// base64上传
|
||||
export const base64Upload = params => {
|
||||
return postRequest("/upload/file", params);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// 添加商品计量单位
|
||||
export const addGoodsUnit = (params) => {
|
||||
return postRequest(`/goods/goodsUnit`, params);
|
||||
};
|
||||
// 分页获取商品计量单位
|
||||
export const getGoodsUnitPage = (params) => {
|
||||
return getRequest(`/goods/goodsUnit`, params);
|
||||
};
|
||||
// 编辑商品计量单位
|
||||
export const updateGoodsUnit = (id, params) => {
|
||||
return putRequest(`/goods/goodsUnit/${id}`, params);
|
||||
};
|
||||
// 删除商品计量单位
|
||||
export const delGoodsUnit = (ids) => {
|
||||
return deleteRequest(`/goods/goodsUnit/delete/${ids}`);
|
||||
};
|
||||
|
||||
//
|
||||
export const handleRefreshToken = (token) => {
|
||||
return getRequestWithNoToken(`/login/refresh/${token}`);
|
||||
};
|
||||
|
||||
|
||||
34
seller/src/api/logistics.js
Normal file
@@ -0,0 +1,34 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {
|
||||
getRequest,
|
||||
postRequest,
|
||||
putRequest,
|
||||
deleteRequest,
|
||||
importRequest,
|
||||
getRequestWithNoToken
|
||||
} from "@/libs/axios";
|
||||
|
||||
|
||||
|
||||
// 分页获取物流公司
|
||||
export const getLogisticsPage = params => {
|
||||
return getRequest(`/logistics/getByPage`, params);
|
||||
};
|
||||
// 删除
|
||||
export const delLogistics = id => {
|
||||
return deleteRequest(`/logistics/delete/${id}`);
|
||||
};
|
||||
// 添加
|
||||
export const addLogistics = params => {
|
||||
return postRequest(`/logistics/save`,params);
|
||||
};
|
||||
// 通过id查询详情
|
||||
export const getLogisticsDetail = id => {
|
||||
return getRequest(`/logistics/get/${id}`);
|
||||
};
|
||||
// 编辑
|
||||
export const updateLogistics = (id,params) => {
|
||||
return putRequest(`/logistics/${id}`,params);
|
||||
};
|
||||
|
||||
|
||||
91
seller/src/api/member.js
Normal file
@@ -0,0 +1,91 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {getRequest, putRequest, postRequest} from "@/libs/axios";
|
||||
|
||||
// 分页获取会员评价
|
||||
export const getMemberReview = params => {
|
||||
return getRequest("/memberEvaluation", params);
|
||||
};
|
||||
|
||||
// 根据id获取评价详情
|
||||
export const getMemberInfoReview = id => {
|
||||
return getRequest(`/memberEvaluation/get/${id}`);
|
||||
};
|
||||
|
||||
//回复评价信息
|
||||
export const replyMemberReview = (id, params) => {
|
||||
return putRequest(`/memberEvaluation/reply/${id}`, params);
|
||||
};
|
||||
|
||||
// 获取会员注册统计列表
|
||||
export const getStatisticsList = params => {
|
||||
return getRequest("/statistics/view/list", params);
|
||||
};
|
||||
|
||||
// 获取分页
|
||||
export const getMember = params => {
|
||||
return getRequest("/member/getByPage", params);
|
||||
};
|
||||
|
||||
|
||||
// 添加或修改
|
||||
export const insertOrUpdateSpec = params => {
|
||||
return postRequest("/memberNoticeSenter/insertOrUpdate", params);
|
||||
};
|
||||
//删除gUI个
|
||||
export const delSpec = (id, params) => {
|
||||
return deleteRequest(`/goods/spec/del/${id}`, params);
|
||||
};
|
||||
|
||||
// 获取会员列表
|
||||
export const getMemberListData = params => {
|
||||
return getRequest("/member", params);
|
||||
};
|
||||
|
||||
// 获取会员详情
|
||||
export const getMemberInfoData = id => {
|
||||
return getRequest(`/member/${id}`);
|
||||
};
|
||||
|
||||
// 修改会员基本信息
|
||||
export const updateMember = params => {
|
||||
return putRequest(`/member`, params);
|
||||
};
|
||||
|
||||
// 添加会员基本信息
|
||||
export const addMember = params => {
|
||||
return postRequest(`/member`, params);
|
||||
};
|
||||
|
||||
// 获取会员列表
|
||||
export const getMemberAll = () => {
|
||||
return getRequest("/member/getAll");
|
||||
};
|
||||
|
||||
// 增加或修改会员列表
|
||||
export const operationMemberListData = params => {
|
||||
return postRequest("/member/insertOrUpdate", params);
|
||||
};
|
||||
|
||||
// 增加或修改会员列表
|
||||
export const deleteMemberListData = ids => {
|
||||
return deleteRequest(`/member/delByIds/${ids}`);
|
||||
};
|
||||
// 获取充值记录列表数据
|
||||
export const getUserRecharge = params => {
|
||||
return getRequest("/recharge", params);
|
||||
};
|
||||
|
||||
// 获取预存款明细列表数据
|
||||
export const getUserDeposit = params => {
|
||||
return getRequest("/deposit", params);
|
||||
};
|
||||
|
||||
// 获取提现申请列表数据
|
||||
export const getUserWithdrawApply = params => {
|
||||
return getRequest("/members/withdraw-apply", params);
|
||||
};
|
||||
|
||||
// 审核提现申请
|
||||
export const withdrawApply = params => {
|
||||
return postRequest("/members/withdraw-apply", params);
|
||||
};
|
||||
48
seller/src/api/open.js
Normal file
@@ -0,0 +1,48 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import { getRequest, postRequest, putRequest, deleteRequest, importRequest, uploadFileRequest } from '@/libs/axios';
|
||||
|
||||
|
||||
// 认证
|
||||
export const authorize = (params) => {
|
||||
return getRequest('/oauth2/authorize', params)
|
||||
}
|
||||
// 认证过
|
||||
export const authorized = (params) => {
|
||||
return getRequest('/oauth2/authorized', params)
|
||||
}
|
||||
// 获取token
|
||||
export const token = (params) => {
|
||||
return getRequest('/oauth2/token', params)
|
||||
}
|
||||
// 获取user信息
|
||||
export const user = (params) => {
|
||||
return getRequest('/oauth2/user', params)
|
||||
}
|
||||
|
||||
// 获取随机secretKey
|
||||
export const getSecretKey = (params) => {
|
||||
return getRequest('/client/getSecretKey', params)
|
||||
}
|
||||
// 获取客户端
|
||||
export const getClientDataList = (params) => {
|
||||
return getRequest('/client/getByCondition', params)
|
||||
}
|
||||
// 添加客户端
|
||||
export const addClient = (params) => {
|
||||
return postRequest('/client/save', params)
|
||||
}
|
||||
// 编辑客户端
|
||||
export const updateClient = (params) => {
|
||||
return putRequest('/client/update', params)
|
||||
}
|
||||
// 删除客户端
|
||||
export const deleteClient = (ids, params) => {
|
||||
return deleteRequest(`/client/delByIds/${ids}`, params)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
116
seller/src/api/order.js
Normal file
@@ -0,0 +1,116 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {getRequest, postRequest, putRequest} from '@/libs/axios';
|
||||
|
||||
|
||||
// 获取普通订单列表
|
||||
export const getOrderList = (params) => {
|
||||
return getRequest(`/orders`, params)
|
||||
}
|
||||
|
||||
// 获取普通订单详细信息
|
||||
export const getOrderDetail = (sn) => {
|
||||
return getRequest(`/orders/${sn}`)
|
||||
}
|
||||
|
||||
// 调整订单金额
|
||||
export const modifyOrderPrice = (sn, params) => {
|
||||
return putRequest(`/orders/update/${sn}/price`, params)
|
||||
}
|
||||
|
||||
// 取消订单
|
||||
export const cancelOrder = (sn, params) => {
|
||||
return postRequest(`/orders/${sn}/cancel`, params)
|
||||
}
|
||||
|
||||
// 修改收货地址
|
||||
export const editOrderConsignee = (sn, params) => {
|
||||
return postRequest(`/orders/update/${sn}/consignee`, params)
|
||||
}
|
||||
//获取投诉列表
|
||||
export const getComplainPage = (params) => {
|
||||
return getRequest(`/complain`, params)
|
||||
}
|
||||
|
||||
//获取投诉详情
|
||||
export const getComplainDetail = (id) => {
|
||||
return getRequest(`/complain/${id}`)
|
||||
}
|
||||
|
||||
//添加交易投诉对话
|
||||
export const addOrderComplaint = (params) => {
|
||||
return postRequest(`/complain/communication/`, params)
|
||||
}
|
||||
|
||||
//添加交易投诉对话
|
||||
export const appeal = (params) => {
|
||||
return putRequest(`/complain/appeal`, params)
|
||||
}
|
||||
|
||||
//获取订单日志
|
||||
export const getOrderLog = (sn, params) => {
|
||||
return getRequest(`/orderLog/${sn}`, params)
|
||||
}
|
||||
|
||||
// 订单发货
|
||||
export const orderDelivery = (sn, params) => {
|
||||
return postRequest(`/orders/${sn}/delivery`, params)
|
||||
}
|
||||
|
||||
// 获取商家选中的物流公司
|
||||
export const getLogisticsChecked = () => {
|
||||
return getRequest(`/logistics/getChecked`)
|
||||
}
|
||||
|
||||
// 订单核验
|
||||
export const orderTake = (sn, params) => {
|
||||
return postRequest(`/orders/${sn}/take`, params)
|
||||
}
|
||||
|
||||
// 售后服务单
|
||||
export const afterSaleOrderPage = (params) => {
|
||||
return getRequest(`/afterSale/page`, params)
|
||||
}
|
||||
|
||||
// 售后服务单详情
|
||||
export const afterSaleOrderDetail = (sn) => {
|
||||
return getRequest(`/afterSale/${sn}`)
|
||||
}
|
||||
|
||||
// 商家审核
|
||||
export const afterSaleSellerReview = (sn, params) => {
|
||||
return putRequest(`/afterSale/review/${sn}`, params)
|
||||
}
|
||||
|
||||
// 商家确认收货
|
||||
export const afterSaleSellerConfirm = (sn, params) => {
|
||||
return putRequest(`/afterSale/confirm/${sn}`, params)
|
||||
}
|
||||
|
||||
// 商家换货业务发货
|
||||
export const afterSaleSellerDelivery = (sn, params) => {
|
||||
return postRequest(`/afterSale/${sn}/delivery`, params)
|
||||
}
|
||||
//查询物流
|
||||
export const getTraces = (sn, params) => {
|
||||
return postRequest(`/orders/getTraces/${sn}`, params)
|
||||
}
|
||||
//售后单查询物流
|
||||
export const getSellerDeliveryTraces = (sn, params) => {
|
||||
return getRequest(`/afterSale/getSellerDeliveryTraces/${sn}`, params)
|
||||
}
|
||||
//售后单查询物流
|
||||
export const getAfterSaleTraces = (sn, params) => {
|
||||
return getRequest(`/afterSale/getDeliveryTraces/${sn}`, params)
|
||||
}
|
||||
//获取发票列表
|
||||
export const getReceiptPage = (params) => {
|
||||
return getRequest(`/receipt`, params)
|
||||
}
|
||||
|
||||
//获取发票列表
|
||||
export const invoicing = (id) => {
|
||||
return postRequest(`receipt/${id}/invoicing`)
|
||||
}
|
||||
|
||||
|
||||
|
||||
69
seller/src/api/other.js
Normal file
@@ -0,0 +1,69 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {
|
||||
getRequest,
|
||||
postRequest,
|
||||
putRequest,
|
||||
deleteRequest,
|
||||
importRequest,
|
||||
getRequestWithNoToken,
|
||||
putRequestWithNoForm,
|
||||
postRequestWithNoForm,
|
||||
} from "@/libs/axios";
|
||||
|
||||
/**
|
||||
* 楼层装修设置
|
||||
*
|
||||
*/
|
||||
export const setHomeSetup = params => {
|
||||
|
||||
return postRequest("/pageData/add", params);
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取页面信息
|
||||
*
|
||||
*/
|
||||
export const getHomeData = params => {
|
||||
|
||||
return getRequest(`/pageData/${params}`);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 查询楼层装修
|
||||
*
|
||||
*/
|
||||
export const getHomeList = params => {
|
||||
|
||||
return getRequest("/pageData/pageDataList", params);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 修改楼层装修
|
||||
*
|
||||
*/
|
||||
export const updateHome = (id,params) => {
|
||||
|
||||
return putRequest(`/pageData/update/${id}`, params);
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除楼层装修
|
||||
*
|
||||
*/
|
||||
export const removePageHome = (id) => {
|
||||
|
||||
return deleteRequest(`/pageData/removePageData/${id}`);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 发布页面
|
||||
*
|
||||
*/
|
||||
export const releasePageHome = (id) => {
|
||||
|
||||
return putRequest(`/pageData/releasePageData`,id);
|
||||
};
|
||||
|
||||
113
seller/src/api/pages.js
Normal file
@@ -0,0 +1,113 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {getRequest, postRequest, putRequest, deleteRequest, importRequest, getRequestWithNoToken} from '@/libs/axios';
|
||||
|
||||
//保存导航栏
|
||||
export const save = (params) => {
|
||||
return postRequest('/siteNavigation/save', params)
|
||||
}
|
||||
//保存导航栏
|
||||
export const update = (params) => {
|
||||
return postRequest('/siteNavigation/update', params)
|
||||
}
|
||||
//查询导航栏
|
||||
export const getNavigationData = (params) => {
|
||||
return getRequest('/siteNavigation/getByPage', params)
|
||||
}
|
||||
//禁用导航栏
|
||||
export const disableNavigation = (ids) => {
|
||||
return deleteRequest(`/siteNavigation/disable/${ids}`)
|
||||
}
|
||||
//启用导航栏
|
||||
export const enableNavigation = (ids) => {
|
||||
return deleteRequest(`/siteNavigation/enable/${ids}`)
|
||||
}
|
||||
//删除导航栏
|
||||
export const delNavigation = (ids) => {
|
||||
return deleteRequest(`/siteNavigation/remove/${ids}`)
|
||||
}
|
||||
|
||||
//
|
||||
export const saveFocus = (params) => {
|
||||
return deleteRequest('/siteNavigation/remove/${ids}', params)
|
||||
}
|
||||
|
||||
//查询焦点图
|
||||
export const getFocusData = (params) => {
|
||||
return getRequest('/focus/getByPage', params)
|
||||
}
|
||||
//查询焦点图
|
||||
export const saveFocusData = (params) => {
|
||||
return postRequest('/focus/insertOrUpdate', params)
|
||||
}
|
||||
//禁用导航栏
|
||||
export const disableFocus = (ids) => {
|
||||
return putRequest(`/focus/disable/${ids}`)
|
||||
}
|
||||
//启用导航栏
|
||||
export const enableFocus = (ids) => {
|
||||
return putRequest(`/focus/enable/${ids}`)
|
||||
}
|
||||
//删除导航栏
|
||||
export const delFocus = (ids) => {
|
||||
return deleteRequest(`/focus/delByIds/${ids}`)
|
||||
}
|
||||
|
||||
//根据店铺编号查询页面数据(店铺编号为0则为平台)
|
||||
export const getPageData = (id) => {
|
||||
return getRequest(`/page/get/${id}`)
|
||||
}
|
||||
|
||||
//保存页面数据
|
||||
export const savePageData = (params) => {
|
||||
return postRequest('/page/insertOrUpdate', params)
|
||||
}
|
||||
//获取分类列表数据
|
||||
export const getArticleCategory = (parent_id) => {
|
||||
return getRequest(`/article-category/${parent_id}/all-children`)
|
||||
}
|
||||
//文章分类添加
|
||||
export const saveArticleCategory = (params) => {
|
||||
return postRequest('/article-category', params)
|
||||
}
|
||||
|
||||
//删除文章分类
|
||||
export const delArticleCategory = (id) => {
|
||||
return deleteRequest(`/article-category/${id}`)
|
||||
}
|
||||
//修改文章分类
|
||||
export const updateArticleCategory = (params, id) => {
|
||||
return putRequest(`/article-category/update/${id}`, params)
|
||||
}
|
||||
//文章添加
|
||||
export const saveArticle = (params) => {
|
||||
return postRequest('/article', params)
|
||||
}
|
||||
//文章修改
|
||||
export const updateArticle = (params) => {
|
||||
return putRequest(`/article/update/${params.id}`, params)
|
||||
}
|
||||
//查看文章
|
||||
export const seeArticle = (id) => {
|
||||
return getRequest(`/article/${id}`)
|
||||
}
|
||||
//获取文章列表数据
|
||||
export const getArticle = (params) => {
|
||||
return getRequest('/article/getByPage', params)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//删除文章数据
|
||||
export const delArticle = (ids) => {
|
||||
return deleteRequest(`/article/delByIds/${ids}`)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
15
seller/src/api/platform.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import { getRequest, postRequest, putRequest, deleteRequest, importRequest, getRequestWithNoToken } from '@/libs/axios';
|
||||
|
||||
// 验证码渲染图片接口
|
||||
export const drawCodeImage = "/lili/common/captcha/draw/"
|
||||
|
||||
|
||||
// 获取kuaidi配置
|
||||
export const getParams = (params) => {
|
||||
return getRequest('/platformSetting/get/'+params)
|
||||
}
|
||||
// 编辑kuaidi配置
|
||||
export const editParams = (params,method) => {
|
||||
return postRequest('/platformSetting/insertOrUpdate/'+method, params)
|
||||
}
|
||||
131
seller/src/api/promotion.js
Normal file
@@ -0,0 +1,131 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import { getRequest, postRequest, putRequest, deleteRequest, importRequest, uploadFileRequest } from '@/libs/axios';
|
||||
|
||||
// 获取拼团列表
|
||||
export const getPintuanList = (params) => {
|
||||
return getRequest('/promotion/pintuan', params)
|
||||
}
|
||||
// 新建 拼团
|
||||
export const savePintuan = (params) => {
|
||||
return postRequest('/promotion/pintuan', params,{'Content-type': 'application/json'})
|
||||
}
|
||||
// 编辑 拼团
|
||||
export const editPintuan = (params) => {
|
||||
return putRequest('/promotion/pintuan', params,{'Content-type': 'application/json'})
|
||||
}
|
||||
// 手动开启拼团活动
|
||||
export const openPintuan = (pintuanId, params) => {
|
||||
return putRequest(`/promotion/pintuan/open/${pintuanId}`, params)
|
||||
}
|
||||
|
||||
// 手动关闭拼团活动
|
||||
export const closePintuan = (pintuanId) => {
|
||||
return putRequest(`/promotion/pintuan/close/${pintuanId}`)
|
||||
}
|
||||
|
||||
// 删除拼团活动
|
||||
export const deletePintuan = (pintuanId) => {
|
||||
return deleteRequest(`/promotion/pintuan/${pintuanId}`)
|
||||
}
|
||||
|
||||
// 根据id获取拼团信息
|
||||
export const getPintuanDetail = (id) => {
|
||||
return getRequest(`/promotion/pintuan/${id}`)
|
||||
}
|
||||
|
||||
// 获取拼团商品列表
|
||||
export const getPintuanGoodsList = (params) => {
|
||||
return getRequest(`/promotion/pintuan/goods/${params.pintuanId}`,params)
|
||||
}
|
||||
|
||||
// 新增优惠券
|
||||
export const saveShopCoupon = (params) => {
|
||||
return postRequest('/promotion/coupon', params,{'Content-type': 'application/json'})
|
||||
}
|
||||
|
||||
// 修改优惠券
|
||||
export const editShopCoupon = (params) => {
|
||||
return putRequest('/promotion/coupon', params,{'Content-type': 'application/json'})
|
||||
}
|
||||
|
||||
// 获取优惠券列表
|
||||
export const getShopCouponList = (params) => {
|
||||
return getRequest('/promotion/coupon', params)
|
||||
}
|
||||
|
||||
// 更新优惠券状态
|
||||
export const updateCouponStatus = ( params) => {
|
||||
return putRequest(`/promotion/coupon/status`, params)
|
||||
}
|
||||
|
||||
// 作废优惠券
|
||||
export const deleteShopCoupon = (ids) => {
|
||||
return deleteRequest(`/promotion/coupon/${ids}`)
|
||||
}
|
||||
// 上架优惠券
|
||||
export const upShopCoupon = (ids, params) => {
|
||||
return postRequest(`/promotion/coupon/up/${ids}`, params)
|
||||
}
|
||||
// 获取单个优惠券
|
||||
export const getShopCoupon = (id) => {
|
||||
return getRequest(`/promotion/coupon/${id}`)
|
||||
}
|
||||
|
||||
// 获取优惠券领取详情
|
||||
export const getMemberReceiveCouponList = (id) => {
|
||||
return getRequest(`/promotion/memberCoupon/getByPage/${id}`)
|
||||
}
|
||||
// 作废会员优惠券
|
||||
export const deleteMemberReceiveCoupon = (ids, params) => {
|
||||
return deleteRequest(`/promotion/memberCoupon/delByIds/${ids}`, params)
|
||||
}
|
||||
|
||||
// 限时秒杀活动列表
|
||||
export const seckillList = (params) => {
|
||||
return getRequest(`/promotion/seckill`,params)
|
||||
}
|
||||
|
||||
// 限时秒杀活动商品
|
||||
export const seckillGoodsList = (params) => {
|
||||
return getRequest(`/promotion/seckill/apply`,params)
|
||||
}
|
||||
|
||||
// 添加限时抢购 商品
|
||||
export const setSeckillGoods = (params) => {
|
||||
return postRequest(`/promotion/seckill/apply/${params.seckillId}`,params.applyVos,{'Content-type': 'application/json'})
|
||||
}
|
||||
|
||||
// 添加限时抢购 商品
|
||||
export const removeSeckillGoods = (seckillId, ids) => {
|
||||
return deleteRequest(`/promotion/seckill/apply/${seckillId}/${ids}`)
|
||||
}
|
||||
|
||||
// 限时秒杀活动详情
|
||||
export const seckillDetail = (seckillId) => {
|
||||
return getRequest(`/promotion/seckill/${seckillId}`)
|
||||
}
|
||||
|
||||
// 满减满赠活动列表
|
||||
export const getFullDiscountList = (params) => {
|
||||
return getRequest(`/promotion/fullDiscount`,params)
|
||||
}
|
||||
|
||||
// 新增满减活动
|
||||
export const newFullDiscount = (params) => {
|
||||
return postRequest(`/promotion/fullDiscount`,params,{'Content-type': 'application/json'})
|
||||
}
|
||||
|
||||
// 编辑满减活动
|
||||
export const editFullDiscount = (params) => {
|
||||
return putRequest(`/promotion/fullDiscount`,params,{'Content-type': 'application/json'})
|
||||
}
|
||||
|
||||
// 通过id获取满减活动
|
||||
export const getFullDiscountById = (id) => {
|
||||
return getRequest(`/promotion/fullDiscount/${id}`)
|
||||
}
|
||||
|
||||
// 删除满减活动
|
||||
export const delFullDiscount = (id) => {
|
||||
return deleteRequest(`/promotion/fullDiscount/${id}`)
|
||||
}
|
||||
123
seller/src/api/shops.js
Normal file
@@ -0,0 +1,123 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {getRequest, postRequest, putRequest, deleteRequest, importRequest, getRequestWithNoToken} from '@/libs/axios';
|
||||
|
||||
// Vaptcha ID
|
||||
export const vaptchaID = "5dce36188713b71e70a41eb7"
|
||||
// 文件上传接口
|
||||
export const uploadFile = "/upload/file"
|
||||
// 验证码渲染图片接口
|
||||
export const drawCodeImage = "/common/captcha/draw/"
|
||||
// 获取菜单
|
||||
export const getMenuList = "/permission/getMenuList"
|
||||
// 获取数据字典
|
||||
export const getDictData = "/dictData/getByType/"
|
||||
// Websocket
|
||||
export const ws = "/ws"
|
||||
|
||||
|
||||
//查询店铺列表
|
||||
export const getShopListData = (params) => {
|
||||
return getRequest('/shop', params)
|
||||
}
|
||||
// 获取结算单分页
|
||||
export const getBillPage = (params) => {
|
||||
return getRequest(`/bill/getByPage`, params)
|
||||
}
|
||||
|
||||
// 获取商家结算单流水分页
|
||||
export const getSellerFlow = (id, params) => {
|
||||
return getRequest(`/bill/${id}/getStoreFlow`, params)
|
||||
}
|
||||
|
||||
// 商家核对结算单
|
||||
export const reconciliation = (id, params) => {
|
||||
return putRequest(`/bill/check/${id}/`, params)
|
||||
}
|
||||
|
||||
// 获取商家分销订单流水分页
|
||||
export const getDistributionFlow = (id, params) => {
|
||||
return getRequest(`/bill/${id}/getDistributionFlow`, params)
|
||||
}
|
||||
|
||||
// 获取商家结算单详细
|
||||
export const getBillDetail = (id, params) => {
|
||||
return getRequest(`/bill/get/${id}`, params)
|
||||
}
|
||||
|
||||
// 获取所有物流公司
|
||||
export const getLogistics = (id, params) => {
|
||||
return getRequest(`/logistics`, params)
|
||||
}
|
||||
|
||||
// 开启物流公司
|
||||
export const logisticsChecked = (id, params) => {
|
||||
return postRequest(`/logistics/${id}`, params)
|
||||
}
|
||||
|
||||
// 关闭开启物流公司
|
||||
export const logisticsUnChecked = (id, params) => {
|
||||
return deleteRequest(`/logistics/${id}`, params)
|
||||
}
|
||||
// 获取商家自提点
|
||||
export const getShopAddress = (id, params) => {
|
||||
return getRequest(`/storeAddress/`, params)
|
||||
}
|
||||
|
||||
// 修改商家自提点
|
||||
export const editShopAddress = (id, params) => {
|
||||
return putRequest(`/storeAddress/${id}`, params)
|
||||
}
|
||||
|
||||
// 添加商品自提点
|
||||
export const addShopAddress = (params) => {
|
||||
return postRequest(`/storeAddress/`, params)
|
||||
}
|
||||
|
||||
// 添加商品自提点
|
||||
export const deleteShopAddress = (id) => {
|
||||
return deleteRequest(`/storeAddress/${id}`)
|
||||
}
|
||||
|
||||
// 获取商家详细信息
|
||||
export const getShopInfo = () => {
|
||||
return getRequest(`/settings`)
|
||||
}
|
||||
|
||||
// 保存商家详细信息
|
||||
export const saveShopInfo = (params) => {
|
||||
return putRequest(`/settings`, params)
|
||||
}
|
||||
|
||||
//获取商家退货地址
|
||||
export const getRefundGoodsAddress = () => {
|
||||
return getRequest(`/settings/storeAfterSaleAddress`)
|
||||
}
|
||||
//修改商家退货地址
|
||||
export const saveRefundGoodsAddress = (params) => {
|
||||
return putRequest(`/settings/storeAfterSaleAddress`, params)
|
||||
}
|
||||
|
||||
//修改保存库存预警数
|
||||
export const updateStockWarning = (params) => {
|
||||
return putRequest(`/settings/updateStockWarning`, params)
|
||||
}
|
||||
//查询运费模板
|
||||
export const getShipTemplate = () => {
|
||||
return getRequest(`/freightTemplate`)
|
||||
}
|
||||
//删除运费模板
|
||||
export const deleteShipTemplate = (id) => {
|
||||
return deleteRequest(`/freightTemplate/${id}`)
|
||||
}
|
||||
//新增运费模板
|
||||
export const addShipTemplate = (params, headers) => {
|
||||
return postRequest(`/freightTemplate`, params, headers)
|
||||
}
|
||||
|
||||
//新增运费模板
|
||||
export const editShipTemplate = (id, params, headers) => {
|
||||
return putRequest(`/freightTemplate/${id}`, params, headers)
|
||||
}
|
||||
|
||||
|
||||
|
||||
20
seller/src/api/statistics.js
Normal file
@@ -0,0 +1,20 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import {getRequest, postRequest, putRequest, deleteRequest, importRequest, getRequestWithNoToken} from '@/libs/axios';
|
||||
|
||||
//商品统计
|
||||
export const getGoodsStatisticsData = (params) => {
|
||||
return getRequest(`/statistics/goods`, params)
|
||||
}
|
||||
|
||||
//获取订单统计金额
|
||||
export const getOrderStatisticsPrice = (params) => {
|
||||
return getRequest(`/statistics/order/getPrice`, params)
|
||||
}
|
||||
|
||||
//订单统计列表
|
||||
export const getOrderStatistics = (params) => {
|
||||
return getRequest(`/statistics/order/getByPage`, params)
|
||||
}
|
||||
|
||||
|
||||
|
||||
BIN
seller/src/assets/background.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
1
seller/src/assets/background.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg height="100%" width="100%" id="svg" viewBox="0 0 1440 400" xmlns="http://www.w3.org/2000/svg" class="transition duration-300 ease-in-out delay-150"><defs><linearGradient id="gradient"><stop offset="5%" stop-color="#fab741ff"></stop><stop offset="95%" stop-color="#f78da7ff"></stop></linearGradient></defs><path d="M 0,400 C 0,400 0,200 0,200 C 45.64618509382542,216.47686725610436 91.29237018765085,232.9537345122087 133,241 C 174.70762981234915,249.0462654877913 212.47670434322208,248.66192920726948 257,220 C 301.5232956567779,191.33807079273052 352.80081243946097,134.39854865871342 396,148 C 439.19918756053903,161.60145134128658 474.3200458989338,245.7438761578768 511,266 C 547.6799541010662,286.2561238421232 585.9190039648037,242.62594670977953 635,230 C 684.0809960351963,217.37405329022047 744.0039382418512,235.75233700300504 792,247 C 839.9960617581488,258.24766299699496 876.0652430677914,262.3647052782003 912,253 C 947.9347569322086,243.63529472179968 983.7350894869837,220.78884188419372 1025,189 C 1066.2649105130163,157.21115811580628 1112.9943989842734,116.47992718502479 1162,127 C 1211.0056010157266,137.5200728149752 1262.2873145759218,199.2914493757072 1309,220 C 1355.7126854240782,240.7085506242928 1397.8563427120391,220.3542753121464 1440,200 C 1440,200 1440,400 1440,400 Z" stroke="none" stroke-width="0" fill="url(#gradient)" class="transition-all duration-300 ease-in-out delay-150"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
BIN
seller/src/assets/dashboard/console.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
seller/src/assets/dashboard/department.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
seller/src/assets/dashboard/fee.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
seller/src/assets/dashboard/user.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
seller/src/assets/decorate/delete.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
seller/src/assets/decorate/edit.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
seller/src/assets/decorate/phone.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
seller/src/assets/decorate/poplarGoods.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
seller/src/assets/festival_icon.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
seller/src/assets/iPhoneX_model.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
seller/src/assets/img-error.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
seller/src/assets/lili.png
Normal file
|
After Width: | Height: | Size: 302 KiB |
BIN
seller/src/assets/loading.gif
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
seller/src/assets/loading2.gif
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
seller/src/assets/loading3.gif
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
seller/src/assets/logo-min.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
seller/src/assets/logo.png
Normal file
|
After Width: | Height: | Size: 234 KiB |
BIN
seller/src/assets/logo1.png
Normal file
|
After Width: | Height: | Size: 138 KiB |
BIN
seller/src/assets/nav/1.jpg
Normal file
|
After Width: | Height: | Size: 119 KiB |
BIN
seller/src/assets/nav/2.jpg
Normal file
|
After Width: | Height: | Size: 86 KiB |
BIN
seller/src/assets/nav/3.jpg
Normal file
|
After Width: | Height: | Size: 133 KiB |
BIN
seller/src/assets/nav/4.jpg
Normal file
|
After Width: | Height: | Size: 202 KiB |
BIN
seller/src/assets/nav/5.jpg
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
seller/src/assets/nav/nav_showimg1.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
seller/src/assets/nav/nav_showimg2.jpg
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
seller/src/assets/play.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
seller/src/assets/seckillBg.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
seller/src/assets/selected.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
seller/src/assets/title.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
seller/src/assets/vaptcha-loading.gif
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
48
seller/src/config/index.js
Normal file
@@ -0,0 +1,48 @@
|
||||
export default {
|
||||
/**
|
||||
* @description 配置显示在浏览器标签的title
|
||||
*/
|
||||
title: "Lili电商",
|
||||
/**
|
||||
* @description token在Cookie中存储的天数,默认1天
|
||||
*/
|
||||
cookieExpires: 1,
|
||||
/**
|
||||
* @description 是否使用国际化,默认为false
|
||||
* 如果不使用,则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'}
|
||||
* 用来在菜单中显示文字
|
||||
*/
|
||||
useI18n: true,
|
||||
|
||||
/**
|
||||
* @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.103:9000',
|
||||
|
||||
// seller: 'http://192.168.0.103:8889',
|
||||
},
|
||||
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请求基础路径前缀
|
||||
*/
|
||||
baseUrlPrefix: "/store",
|
||||
/**
|
||||
* @description 需要加载的插件
|
||||
*/
|
||||
plugin: {
|
||||
"error-store": {
|
||||
showInHeader: true, // 设为false后不会在顶部显示错误日志徽标
|
||||
developmentOff: true // 设为true后在开发环境不会收集错误信息,方便开发中排查错误
|
||||
}
|
||||
}
|
||||
};
|
||||
47
seller/src/libs/RegExp.js
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* 各种正则表达式
|
||||
* mobile 手机号
|
||||
* email 电子邮箱
|
||||
* password 密码【6-20位】
|
||||
* integer 正整数【不包含0】
|
||||
* money 金钱
|
||||
* TINumber 纳税识别号
|
||||
* IDCard 身份证
|
||||
* userName 账户名称【汉字、字母、数字、“-”、“_”的组合】
|
||||
* URL URL
|
||||
* TEL 固定电话
|
||||
*/
|
||||
|
||||
// 手机号
|
||||
export const mobile = /^0?(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])[0-9]{8}$/
|
||||
|
||||
// 电子邮箱
|
||||
export const email = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
|
||||
|
||||
// 密码【6-20位】
|
||||
export const password = /^[@A-Za-z0-9!#$%^&*.~,]{6,20}$/
|
||||
|
||||
// 正整数【不包含0】
|
||||
export const integer = /^[1-9]\d*$/
|
||||
|
||||
// 正整数【包含0】
|
||||
export const Integer = /^[0-9]\d*$/
|
||||
|
||||
// 金钱
|
||||
export const money = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
|
||||
|
||||
// 纳税识别号
|
||||
export const TINumber = /^((\d{6}[0-9A-Z]{9})|([0-9A-Za-z]{2}\d{6}[0-9A-Za-z]{10,12}))$/
|
||||
|
||||
// 身份证
|
||||
export const IDCard = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
|
||||
|
||||
// 账户名称【汉字、字母、数字、“-”、“_”的组合】
|
||||
export const userName = /[A-Za-z0-9_\-\u4e00-\u9fa5]$/
|
||||
|
||||
// URL
|
||||
export const URL =
|
||||
/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
|
||||
|
||||
// 固话
|
||||
export const TEL = /0\d{2,3}-\d{7,8}/
|
||||
337
seller/src/libs/axios.js
Normal file
@@ -0,0 +1,337 @@
|
||||
import axios from "axios";
|
||||
import config from "@/config";
|
||||
import { getStore, setStore } from "./storage";
|
||||
import { router } from "../router/index";
|
||||
import { Message } from "view-design";
|
||||
import Cookies from "js-cookie";
|
||||
import {handleRefreshToken} from "@/api/index"
|
||||
|
||||
// 统一请求路径前缀
|
||||
export const baseUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.seller : config.api_prod.seller) + config.baseUrlPrefix;
|
||||
export const commonUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.common : config.api_prod.common);
|
||||
|
||||
var isRefreshToken = 0;
|
||||
const refreshToken = getTokenDebounce()
|
||||
const service = axios.create({
|
||||
timeout: 10000,
|
||||
baseURL: baseUrl
|
||||
})
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
if (config.method == 'get') {
|
||||
config.params = {
|
||||
_t: Date.parse(new Date()) / 1000,
|
||||
...config.params
|
||||
}
|
||||
}
|
||||
return config;
|
||||
},
|
||||
err => {
|
||||
Message.error("请求超时");
|
||||
return Promise.resolve(err);
|
||||
}
|
||||
);
|
||||
|
||||
// http response 拦截器
|
||||
service.interceptors.response.use(
|
||||
response => {
|
||||
const data = response.data;
|
||||
// 根据返回的code值来做不同的处理(和后端约定)
|
||||
if (!data.success && data.message) {
|
||||
Message.error(data.message);
|
||||
}
|
||||
switch (data.code) {
|
||||
case 400:
|
||||
if (data.message !== null) {
|
||||
Message.error(data.message);
|
||||
} else {
|
||||
Message.error("系统异常");
|
||||
}
|
||||
break;
|
||||
case 401:
|
||||
// 未登录 清除已登录状态
|
||||
Cookies.set("userInfo", "");
|
||||
setStore("accessToken", "");
|
||||
if (router.history.current.name != "login") {
|
||||
if (data.message !== null) {
|
||||
Message.error(data.message);
|
||||
} else {
|
||||
Message.error("未知错误,请重新登录");
|
||||
}
|
||||
router.push("/login");
|
||||
}
|
||||
break;
|
||||
case 403:
|
||||
// 权限不足
|
||||
if (data.message !== null) {
|
||||
Message.error(data.message);
|
||||
} else {
|
||||
Message.error("权限不足");
|
||||
}
|
||||
break;
|
||||
case 500:
|
||||
// 系统异常
|
||||
if (data.message !== null) {
|
||||
Message.error(data.message);
|
||||
} else {
|
||||
Message.error("系统异常");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return data;
|
||||
}
|
||||
},
|
||||
async error => {
|
||||
// 返回状态码不为200时候的错误处理
|
||||
|
||||
if (error.response) {
|
||||
if (error.response.status === 401) {
|
||||
// 这种情况一般调到登录页
|
||||
} else if (error.response.status === 403) {
|
||||
isRefreshToken++;
|
||||
if(isRefreshToken === 1) {
|
||||
const getTokenRes = await refreshToken();
|
||||
if (getTokenRes === 'success') { // 刷新token
|
||||
if (isRefreshToken === 1) {
|
||||
error.response.config.headers.accessToken = getStore('accessToken')
|
||||
return service(error.response.config)
|
||||
} else {
|
||||
router.go(0)
|
||||
}
|
||||
} else {
|
||||
Cookies.set("userInfo", "");
|
||||
router.push('/login')
|
||||
}
|
||||
isRefreshToken = 0
|
||||
}
|
||||
} else {
|
||||
// 其他错误处理
|
||||
Message.error(error.response.data.message)
|
||||
}
|
||||
}
|
||||
|
||||
/* router.push("/login") */
|
||||
return Promise.resolve(error);
|
||||
}
|
||||
);
|
||||
|
||||
// 防抖闭包来一波
|
||||
function getTokenDebounce() {
|
||||
let lock = false
|
||||
let success = false
|
||||
return function () {
|
||||
if (!lock) {
|
||||
lock = true
|
||||
let oldRefreshToken = getStore("refreshToken");
|
||||
handleRefreshToken(oldRefreshToken).then(res => {
|
||||
if (res.code === 200) {
|
||||
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
|
||||
})
|
||||
}
|
||||
return new Promise(resolve => {
|
||||
// 一直看lock,直到请求失败或者成功
|
||||
const timer = setInterval(() => {
|
||||
if (!lock) {
|
||||
clearInterval(timer)
|
||||
if (success) {
|
||||
resolve('success')
|
||||
} else {
|
||||
resolve('fail')
|
||||
}
|
||||
}
|
||||
}, 500) // 轮询时间间隔
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const getRequest = (url, params) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "get",
|
||||
url: `${url}`,
|
||||
params: params,
|
||||
headers: {
|
||||
accessToken: accessToken
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const postRequest = (url, params, headers) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "post",
|
||||
url: `${url}`,
|
||||
data: params,
|
||||
transformRequest: headers
|
||||
? undefined
|
||||
: [
|
||||
function(data) {
|
||||
let ret = "";
|
||||
for (let it in data) {
|
||||
ret +=
|
||||
encodeURIComponent(it) +
|
||||
"=" +
|
||||
encodeURIComponent(data[it]) +
|
||||
"&";
|
||||
}
|
||||
ret = ret.substring(0, ret.length - 1);
|
||||
return ret;
|
||||
}
|
||||
],
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
accessToken: accessToken,
|
||||
...headers
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 不带form表单不带transformRequest */
|
||||
export const postRequestWithNoForm = (url, params) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "post",
|
||||
url: `${url}`,
|
||||
data: params,
|
||||
|
||||
headers: {
|
||||
accessToken: accessToken
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// export const postRequestWithHeaders = (url, params) => {
|
||||
// let accessToken = getStore("accessToken");
|
||||
// return axios({
|
||||
// method: "post",
|
||||
// url: `${url}`,
|
||||
// data: params,
|
||||
|
||||
// headers: {
|
||||
// accessToken: accessToken,
|
||||
// "Content-Type": "application/x-www-form-urlencoded"
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
export const putRequest = (url, params,headers) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "put",
|
||||
url: `${url}`,
|
||||
data: params,
|
||||
transformRequest: headers
|
||||
? undefined
|
||||
: [
|
||||
function(data) {
|
||||
let ret = "";
|
||||
for (let it in data) {
|
||||
ret +=
|
||||
encodeURIComponent(it) +
|
||||
"=" +
|
||||
encodeURIComponent(data[it]) +
|
||||
"&";
|
||||
}
|
||||
ret = ret.substring(0, ret.length - 1);
|
||||
return ret;
|
||||
}
|
||||
],
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
accessToken: accessToken,
|
||||
...headers
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const putRequestWithNoForm = (url, params) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "put",
|
||||
url: `${url}`,
|
||||
data: params,
|
||||
|
||||
headers: {
|
||||
accessToken: accessToken
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteRequest = (url, params) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "delete",
|
||||
url: `${url}`,
|
||||
params: params,
|
||||
headers: {
|
||||
accessToken: accessToken
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const importRequest = (url, params) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "post",
|
||||
url: `${url}`,
|
||||
data: params,
|
||||
headers: {
|
||||
accessToken: accessToken
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const uploadFileRequest = (url, params) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "post",
|
||||
url: `${url}`,
|
||||
params: params,
|
||||
headers: {
|
||||
accessToken: accessToken
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 无需token验证的请求 避免旧token过期导致请求失败
|
||||
* @param {*} url
|
||||
* @param {*} params
|
||||
*/
|
||||
export const getRequestWithNoToken = (url, params) => {
|
||||
return service({
|
||||
method: "get",
|
||||
url: `${url}`,
|
||||
params: params
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 无需token验证的请求 避免旧token过期导致请求失败
|
||||
* @param {*} url
|
||||
* @param {*} params
|
||||
*/
|
||||
export const postRequestWithNoToken = (url, params) => {
|
||||
return service({
|
||||
method: "post",
|
||||
url: `${url}`,
|
||||
params: params
|
||||
});
|
||||
};
|
||||
|
||||
32
seller/src/libs/dictUtil.js
Normal file
@@ -0,0 +1,32 @@
|
||||
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;
|
||||
77
seller/src/libs/emoji.js
Normal file
@@ -0,0 +1,77 @@
|
||||
// 新浪表情包api https://api.weibo.com/2/emotions.json?source=1362404091
|
||||
export const sina = [
|
||||
{
|
||||
alt: "[坏笑]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/4d/2018new_huaixiao_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[笑cry]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/4a/2018new_xiaoku_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[拜拜]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/fd/2018new_baibai_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[微笑]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/e3/2018new_weixioa02_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[偷笑]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/71/2018new_touxiao_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[亲亲]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/2c/2018new_qinqin_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[太开心]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/1e/2018new_taikaixin_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[挤眼]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/43/2018new_jiyan_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[可怜]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/96/2018new_kelian_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[可爱]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/09/2018new_keai_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[doge]",
|
||||
src: "http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/a1/2018new_doge02_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[二哈]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/22/2018new_erha_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[喵喵]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/7b/2018new_miaomiao_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[摊手]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/62/2018new_tanshou_org.png"
|
||||
},
|
||||
{
|
||||
alt: "[跪了]",
|
||||
src:
|
||||
"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/75/2018new_gui_org.png"
|
||||
}
|
||||
]
|
||||
102
seller/src/libs/excel.js
Normal file
@@ -0,0 +1,102 @@
|
||||
import XLSX from 'xlsx';
|
||||
|
||||
function auto_width(ws, data){
|
||||
/*set worksheet max width per col*/
|
||||
const colWidth = data.map(row => row.map(val => {
|
||||
/*if null/undefined*/
|
||||
if (val == null) {
|
||||
return {'wch': 10};
|
||||
}
|
||||
/*if chinese*/
|
||||
else if (val.toString().charCodeAt(0) > 255) {
|
||||
return {'wch': val.toString().length * 2};
|
||||
} else {
|
||||
return {'wch': val.toString().length};
|
||||
}
|
||||
}))
|
||||
/*start in the first row*/
|
||||
let result = colWidth[0];
|
||||
for (let i = 1; i < colWidth.length; i++) {
|
||||
for (let j = 0; j < colWidth[i].length; j++) {
|
||||
if (result[j]['wch'] < colWidth[i][j]['wch']) {
|
||||
result[j]['wch'] = colWidth[i][j]['wch'];
|
||||
}
|
||||
}
|
||||
}
|
||||
ws['!cols'] = result;
|
||||
}
|
||||
|
||||
function json_to_array(key, jsonData){
|
||||
return jsonData.map(v => key.map(j => { return v[j] }));
|
||||
}
|
||||
|
||||
// fix data,return string
|
||||
function fixdata(data) {
|
||||
let o = ''
|
||||
let l = 0
|
||||
const w = 10240
|
||||
for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)))
|
||||
o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
|
||||
return o
|
||||
}
|
||||
|
||||
// get head from excel file,return array
|
||||
function get_header_row(sheet) {
|
||||
const headers = []
|
||||
const range = XLSX.utils.decode_range(sheet['!ref'])
|
||||
let C
|
||||
const R = range.s.r /* start in the first row */
|
||||
for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */
|
||||
var cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })] /* find the cell in the first row */
|
||||
var hdr = 'UNKNOWN ' + C // <-- replace with your desired default
|
||||
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
|
||||
headers.push(hdr)
|
||||
}
|
||||
return headers
|
||||
}
|
||||
|
||||
export const export_table_to_excel= (id, filename) => {
|
||||
const table = document.getElementById(id);
|
||||
const wb = XLSX.utils.table_to_book(table);
|
||||
XLSX.writeFile(wb, filename);
|
||||
}
|
||||
|
||||
export const export_json_to_excel = ({data, key, title, filename, autoWidth}) => {
|
||||
const wb = XLSX.utils.book_new();
|
||||
data.unshift(title);
|
||||
const ws = XLSX.utils.json_to_sheet(data, {header: key, skipHeader: true});
|
||||
if(autoWidth){
|
||||
const arr = json_to_array(key, data);
|
||||
auto_width(ws, arr);
|
||||
}
|
||||
XLSX.utils.book_append_sheet(wb, ws, filename);
|
||||
XLSX.writeFile(wb, filename + '.xlsx');
|
||||
}
|
||||
|
||||
export const export_array_to_excel = ({key, data, title, filename, autoWidth}) => {
|
||||
const wb = XLSX.utils.book_new();
|
||||
const arr = json_to_array(key, data);
|
||||
arr.unshift(title);
|
||||
const ws = XLSX.utils.aoa_to_sheet(arr);
|
||||
if(autoWidth){
|
||||
auto_width(ws, arr);
|
||||
}
|
||||
XLSX.utils.book_append_sheet(wb, ws, filename);
|
||||
XLSX.writeFile(wb, filename + '.xlsx');
|
||||
}
|
||||
|
||||
export const read = (data, type) => {
|
||||
const workbook = XLSX.read(data, { type: type });
|
||||
const firstSheetName = workbook.SheetNames[0];
|
||||
const worksheet = workbook.Sheets[firstSheetName];
|
||||
const header = get_header_row(worksheet);
|
||||
const results = XLSX.utils.sheet_to_json(worksheet);
|
||||
return {header, results};
|
||||
}
|
||||
|
||||
export default {
|
||||
export_table_to_excel,
|
||||
export_array_to_excel,
|
||||
export_json_to_excel,
|
||||
read
|
||||
}
|
||||
14
seller/src/libs/hasPermission.js
Normal file
@@ -0,0 +1,14 @@
|
||||
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;
|
||||
16
seller/src/libs/hasRole.js
Normal file
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
3513
seller/src/libs/icon.js
Normal file
82
seller/src/libs/importTemplate.js
Normal file
@@ -0,0 +1,82 @@
|
||||
// 导入表格模版数据
|
||||
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
|
||||
}
|
||||
]
|
||||
2
seller/src/libs/lazyLoading.js
Normal file
@@ -0,0 +1,2 @@
|
||||
export default (url) =>()=>import(`@/views/${url}.vue`)
|
||||
|
||||
706
seller/src/libs/routerJson.js
Normal file
@@ -0,0 +1,706 @@
|
||||
export const result = [
|
||||
{
|
||||
name: "lili",
|
||||
showAlways: true,
|
||||
level: 0,
|
||||
type: -1,
|
||||
title: "商品",
|
||||
path: "",
|
||||
component: "",
|
||||
icon: "md-home",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "goods-list",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "商品管理",
|
||||
path: "",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "goods-operation",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "商品发布",
|
||||
path: "goods-operation",
|
||||
component: "goods-operation",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
},
|
||||
{
|
||||
name: "goods",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "商品列表",
|
||||
path: "goods",
|
||||
component: "goods/goods-seller/goods",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
},
|
||||
{
|
||||
name: "daft-goods",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "草稿商品",
|
||||
path: "daft-goods",
|
||||
component: "goods/goods-seller/draftGoods",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
},
|
||||
|
||||
{
|
||||
path: "template-goods",
|
||||
props: {type: "TEMPLATE"},
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "商品模版",
|
||||
component: "goods/goods-seller/draftGoods",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
name: "template-goods",
|
||||
children: null,
|
||||
permTypes: []
|
||||
},
|
||||
{
|
||||
name: "category",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "店铺分类",
|
||||
path: "category",
|
||||
component: "goods/goods-manage/category",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
name: "order",
|
||||
showAlways: true,
|
||||
level: 0,
|
||||
type: -1,
|
||||
title: "订单",
|
||||
path: "",
|
||||
component: "",
|
||||
icon: "md-home",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "order",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "订单管理",
|
||||
path: "/order",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "order",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "商品订单",
|
||||
path: "orderList",
|
||||
component: "order/order/orderList",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "memberComment",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "评价管理",
|
||||
path: "/order",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "memberComment",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "评价管理",
|
||||
path: "memberComment",
|
||||
component: "member/memberComment",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "order",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "售后管理",
|
||||
path: "/order",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "returnGoodsOrder",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "退货管理",
|
||||
path: "returnGoodsOrder",
|
||||
component: "order/after-order/returnGoodsOrder",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "returnMoneyOrder",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "退款管理",
|
||||
path: "returnMoneyOrder",
|
||||
component: "order/after-order/returnMoneyOrder",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "orderComplaint",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "投诉管理",
|
||||
path: "orderComplaint",
|
||||
component: "order/after-order/orderComplaint",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
name: "bill",
|
||||
showAlways: true,
|
||||
level: 0,
|
||||
type: -1,
|
||||
title: "财务",
|
||||
path: "",
|
||||
component: "",
|
||||
icon: "md-home",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "bill",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "财务管理",
|
||||
path: "/bill",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "bill",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "财务对账",
|
||||
path: "bill",
|
||||
component: "shop/bill/accountStatementBill",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "storeBill",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "店铺结算",
|
||||
path: "storeBill",
|
||||
component: "shop/bill/storeBill",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
name: "receipt",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "发票管理",
|
||||
path: "/bill",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "receipt",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "发票管理",
|
||||
path: "receipt",
|
||||
component: "order/receiptManager/receipt",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "promotion",
|
||||
showAlways: true,
|
||||
level: 0,
|
||||
type: -1,
|
||||
title: "营销",
|
||||
path: "",
|
||||
component: "",
|
||||
icon: "md-home",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "promotion",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "平台活动",
|
||||
path: "/promotion",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "pintuan",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "拼团活动",
|
||||
path: "pintuan",
|
||||
component: "promotion/pintuan/pintuan",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "seckill",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "秒杀活动",
|
||||
path: "seckill",
|
||||
component: "promotion/seckill/seckill",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "promotion",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "商家活动",
|
||||
path: "/promotion",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "full-cut",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "满额活动",
|
||||
path: "full-cut",
|
||||
component: "promotion/fullCut/full-cut",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "coupon",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "优惠券",
|
||||
path: "coupon",
|
||||
component: "promotion/coupon/coupon",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "promotion",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "分销管理",
|
||||
path: "/promotion",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "distributionGoods",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "分销商品",
|
||||
path: "distributionGoods",
|
||||
component: "distribution/distributionGoods",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
name: "statistics",
|
||||
showAlways: true,
|
||||
level: 0,
|
||||
type: -1,
|
||||
title: "统计",
|
||||
path: "",
|
||||
component: "",
|
||||
icon: "md-home",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "statistics",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "统计管理",
|
||||
path: "/statistics",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "goodsStatistics",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "商品统计",
|
||||
path: "goodsStatistics",
|
||||
component: "statistics/goods",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "orderStatistics",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "订单统计",
|
||||
path: "orderStatistics",
|
||||
component: "statistics/order",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "trafficStatistics",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "流量统计",
|
||||
path: "trafficStatistics",
|
||||
component: "statistics/traffic",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
name: "settings",
|
||||
showAlways: true,
|
||||
level: 0,
|
||||
type: -1,
|
||||
title: "设置",
|
||||
path: "",
|
||||
component: "",
|
||||
icon: "md-home",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
children: [
|
||||
{
|
||||
name: "user-manage",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "页面设置",
|
||||
path: "user-manage",
|
||||
component: "sys/user-manage/userManage",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: []
|
||||
},
|
||||
{
|
||||
name: "ship",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "配送设置",
|
||||
path: "",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "shipTemplate",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "配送模板",
|
||||
path: "shipTemplate",
|
||||
component: "shop/ship/shipTemplate",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
},
|
||||
{
|
||||
name: "logistics",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "物流公司",
|
||||
path: "logistics",
|
||||
component: "shop/ship/logistics",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "shop",
|
||||
showAlways: false,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "店铺管理",
|
||||
path: "/shop",
|
||||
component: "Main",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
children: [
|
||||
{
|
||||
name: "shopSetting",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "店铺设置",
|
||||
path: "shopSetting",
|
||||
component: "shop/shopSetting",
|
||||
icon: "md-log-in",
|
||||
isMenu: true,
|
||||
url: null,
|
||||
description: null,
|
||||
buttonType: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
},
|
||||
{
|
||||
name: "shopAddress",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "自提点管理",
|
||||
path: "shopAddress",
|
||||
component: "shop/shopAddress",
|
||||
icon: "md-log-in",
|
||||
isMenu: true,
|
||||
url: null,
|
||||
description: null,
|
||||
buttonType: "",
|
||||
children: null,
|
||||
permTypes: []
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "messages",
|
||||
showAlways: true,
|
||||
level: 0,
|
||||
type: -1,
|
||||
title: "消息",
|
||||
path: "",
|
||||
component: "",
|
||||
icon: "md-home",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
description: "",
|
||||
buttonType: "",
|
||||
children: [
|
||||
{
|
||||
name: "user-manage",
|
||||
showAlways: true,
|
||||
level: 1,
|
||||
type: 0,
|
||||
title: "系统消息",
|
||||
path: "user-manage",
|
||||
component: "sys/user-manage/userManage",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: [
|
||||
{
|
||||
name: "message_index",
|
||||
showAlways: true,
|
||||
level: 2,
|
||||
type: 0,
|
||||
title: "系统消息",
|
||||
path: "message",
|
||||
component: "message",
|
||||
icon: "md-person",
|
||||
isMenu: true,
|
||||
url: "",
|
||||
permTypes: [],
|
||||
children: null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
30
seller/src/libs/storage.js
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 存储localStorage
|
||||
*/
|
||||
export const setStore = (name, content) => {
|
||||
if (!name) return;
|
||||
if (typeof content !== 'string') {
|
||||
content = JSON.stringify(content);
|
||||
}
|
||||
window.localStorage.setItem(name, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取localStorage
|
||||
*/
|
||||
export const getStore = name => {
|
||||
if (!name) return;
|
||||
let v = window.localStorage.getItem(name);
|
||||
if (v == null) {
|
||||
return "";
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除localStorage
|
||||
*/
|
||||
export const removeStore = name => {
|
||||
if (!name) return;
|
||||
window.localStorage.removeItem(name);
|
||||
}
|
||||
100
seller/src/libs/table2excel.js
Normal file
@@ -0,0 +1,100 @@
|
||||
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;
|
||||
459
seller/src/libs/util.js
Normal file
@@ -0,0 +1,459 @@
|
||||
import axios from 'axios';
|
||||
import { getMenuList } from '@/api/index';
|
||||
import lazyLoading from './lazyLoading.js';
|
||||
import router from '@/router/index';
|
||||
import Cookies from "js-cookie";
|
||||
import { result } from './routerJson.js';
|
||||
|
||||
let util = {
|
||||
|
||||
};
|
||||
|
||||
util.title = function (title) {
|
||||
title = title || 'lili ';
|
||||
window.document.title = title;
|
||||
};
|
||||
|
||||
util.millsToTime = function (mills) {
|
||||
if (!mills) {
|
||||
return "";
|
||||
}
|
||||
let s = mills / 1000;
|
||||
if (s < 60) {
|
||||
return s.toFixed(0) + " 秒"
|
||||
}
|
||||
let m = s / 60;
|
||||
if (m < 60) {
|
||||
return m.toFixed(0) + " 分钟"
|
||||
}
|
||||
let h = m / 60;
|
||||
if (h < 24) {
|
||||
return h.toFixed(0) + " 小时"
|
||||
}
|
||||
let d = h / 24;
|
||||
if (d < 30) {
|
||||
return d.toFixed(0) + " 天"
|
||||
}
|
||||
let month = d / 30
|
||||
if (month < 12) {
|
||||
return month.toFixed(0) + " 个月"
|
||||
}
|
||||
let year = month / 12
|
||||
return year.toFixed(0) + " 年"
|
||||
|
||||
};
|
||||
|
||||
util.inOf = function (arr, targetArr) {
|
||||
let res = true;
|
||||
arr.forEach(item => {
|
||||
if (targetArr.indexOf(item) < 0) {
|
||||
res = false;
|
||||
}
|
||||
});
|
||||
return res;
|
||||
};
|
||||
|
||||
util.oneOf = function (ele, targetArr) {
|
||||
if (targetArr.indexOf(ele) >= 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
util.getRouterObjByName = function (routers, name) {
|
||||
if (!name || !routers || !routers.length) {
|
||||
return null;
|
||||
}
|
||||
let routerObj = null;
|
||||
for (let item of routers) {
|
||||
if (item.name == name) {
|
||||
return item;
|
||||
}
|
||||
routerObj = util.getRouterObjByName(item.children, name);
|
||||
if (routerObj) {
|
||||
return routerObj;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
util.handleTitle = function (vm, item) {
|
||||
if (typeof item.title == 'object') {
|
||||
return vm.$t(item.title.i18n);
|
||||
} else {
|
||||
return item.title;
|
||||
}
|
||||
};
|
||||
|
||||
util.setCurrentPath = function (vm, name) {
|
||||
let title = '';
|
||||
let isOtherRouter = false;
|
||||
vm.$store.state.app.routers.forEach(item => {
|
||||
if (item.children.length == 1) {
|
||||
if (item.children[0].name == name) {
|
||||
title = util.handleTitle(vm, item);
|
||||
if (item.name == 'otherRouter') {
|
||||
isOtherRouter = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
item.children.forEach(child => {
|
||||
if (child.name == name) {
|
||||
title = util.handleTitle(vm, child);
|
||||
if (item.name == 'otherRouter') {
|
||||
isOtherRouter = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
let currentPathArr = [];
|
||||
if (name == 'home_index') {
|
||||
currentPathArr = [
|
||||
{
|
||||
title: util.handleTitle(vm, util.getRouterObjByName(vm.$store.state.app.routers, 'home_index')),
|
||||
path: '',
|
||||
name: 'home_index'
|
||||
}
|
||||
];
|
||||
} else if ((name.indexOf('_index') >= 0 || isOtherRouter) && name !== 'home_index') {
|
||||
currentPathArr = [
|
||||
{
|
||||
title: util.handleTitle(vm, util.getRouterObjByName(vm.$store.state.app.routers, 'home_index')),
|
||||
path: '/home',
|
||||
name: 'home_index'
|
||||
},
|
||||
{
|
||||
title: title,
|
||||
path: '',
|
||||
name: name
|
||||
}
|
||||
];
|
||||
} else {
|
||||
let currentPathObj = vm.$store.state.app.routers.filter(item => {
|
||||
if (item.children.length <= 1) {
|
||||
return item.children[0].name == name;
|
||||
} else {
|
||||
let i = 0;
|
||||
let childArr = item.children;
|
||||
let len = childArr.length;
|
||||
while (i < len) {
|
||||
if (childArr[i].name == name) {
|
||||
return true;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
})[0];
|
||||
if (currentPathObj.children.length <= 1 && currentPathObj.name == 'home') {
|
||||
currentPathArr = [
|
||||
{
|
||||
title: '首页',
|
||||
path: '',
|
||||
name: 'home_index'
|
||||
}
|
||||
];
|
||||
} else if (currentPathObj.children.length <= 1 && currentPathObj.name !== 'home') {
|
||||
currentPathArr = [
|
||||
{
|
||||
title: '首页',
|
||||
path: '/home',
|
||||
name: 'home_index'
|
||||
},
|
||||
{
|
||||
title: currentPathObj.title,
|
||||
path: '',
|
||||
name: name
|
||||
}
|
||||
];
|
||||
} else {
|
||||
let childObj = currentPathObj.children.filter((child) => {
|
||||
return child.name == name;
|
||||
})[0];
|
||||
currentPathArr = [
|
||||
{
|
||||
title: '首页',
|
||||
path: '/home',
|
||||
name: 'home_index'
|
||||
},
|
||||
{
|
||||
title: currentPathObj.title,
|
||||
path: '',
|
||||
name: currentPathObj.name
|
||||
},
|
||||
{
|
||||
title: childObj.title,
|
||||
path: currentPathObj.path + '/' + childObj.path,
|
||||
name: name
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
vm.$store.commit('setCurrentPath', currentPathArr);
|
||||
|
||||
return currentPathArr;
|
||||
};
|
||||
|
||||
util.openNewPage = function (vm, name, argu, query) {
|
||||
if (!vm.$store) {
|
||||
return;
|
||||
}
|
||||
let storeOpenedList = vm.$store.state.app.storeOpenedList;
|
||||
let openedPageLen = storeOpenedList.length;
|
||||
let i = 0;
|
||||
let tagHasOpened = false;
|
||||
while (i < openedPageLen) {
|
||||
if (name == storeOpenedList[i].name) { // 页面已经打开
|
||||
vm.$store.commit('storeOpenedList', {
|
||||
index: i,
|
||||
argu: argu,
|
||||
query: query
|
||||
});
|
||||
tagHasOpened = true;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (!tagHasOpened) {
|
||||
let tag = vm.$store.state.app.tagsList.filter((item) => {
|
||||
if (item.children) {
|
||||
return name == item.children[0].name;
|
||||
} else {
|
||||
return name == item.name;
|
||||
}
|
||||
});
|
||||
tag = tag[0];
|
||||
if (tag) {
|
||||
tag = tag.children ? tag.children[0] : tag;
|
||||
if (argu) {
|
||||
tag.argu = argu;
|
||||
}
|
||||
if (query) {
|
||||
tag.query = query;
|
||||
}
|
||||
vm.$store.commit('increateTag', tag);
|
||||
}
|
||||
}
|
||||
vm.$store.commit('setCurrentPageName', name);
|
||||
};
|
||||
|
||||
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) {
|
||||
route.replace({
|
||||
name: routers[i].children[0].name
|
||||
});
|
||||
notHandle = false;
|
||||
next();
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (notHandle) {
|
||||
next();
|
||||
}
|
||||
};
|
||||
|
||||
// 将Csv文件解析为二维数组
|
||||
export const getArrayFromFile = (file) => {
|
||||
let nameSplit = file.name.split('.')
|
||||
let format = nameSplit[nameSplit.length - 1]
|
||||
return new Promise((resolve, reject) => {
|
||||
let reader = new FileReader()
|
||||
reader.readAsText(file) // 以文本格式读取
|
||||
let arr = []
|
||||
reader.onload = function (evt) {
|
||||
let data = evt.target.result // 读到的数据
|
||||
let pasteData = data.trim()
|
||||
arr = pasteData.split((/[\n\u0085\u2028\u2029]|\r\n?/g)).map(row => {
|
||||
return row.split('\t')
|
||||
}).map(item => {
|
||||
return item[0].split(',')
|
||||
})
|
||||
if (format == 'csv') resolve(arr)
|
||||
else reject(new Error('[Format Error]:不是Csv文件'))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 将二维数组转为表格数据
|
||||
export const getTableDataFromArray = (array) => {
|
||||
let columns = []
|
||||
let tableData = []
|
||||
if (array.length > 1) {
|
||||
let titles = array.shift()
|
||||
columns = titles.map(item => {
|
||||
return {
|
||||
title: item,
|
||||
key: item
|
||||
}
|
||||
})
|
||||
tableData = array.map(item => {
|
||||
let res = {}
|
||||
item.forEach((col, i) => {
|
||||
res[titles[i]] = col
|
||||
})
|
||||
return res
|
||||
})
|
||||
}
|
||||
return {
|
||||
columns,
|
||||
tableData
|
||||
}
|
||||
}
|
||||
|
||||
util.initRouter = function (vm) { // 初始化路由
|
||||
const constRoutes = [];
|
||||
const otherRoutes = [];
|
||||
|
||||
// 404路由需要和动态路由一起加载
|
||||
const otherRouter = [{
|
||||
path: '/*',
|
||||
name: 'error-404',
|
||||
meta: {
|
||||
title: '404-页面不存在'
|
||||
},
|
||||
component: 'error-page/404'
|
||||
}];
|
||||
// 判断用户是否登录
|
||||
let userInfo = Cookies.get('userInfo')
|
||||
// if (!userInfo) {
|
||||
// // 未登录
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (!vm.$store.state.app.added) {
|
||||
// 第一次加载 读取数据
|
||||
let accessToken = window.localStorage.getItem('accessToken');
|
||||
// 加载菜单
|
||||
// axios.get(getMenuList, { headers: { 'accessToken': accessToken } }).then(res => {
|
||||
// let menuData = res.result;
|
||||
let menuData = result;
|
||||
if (!menuData) {
|
||||
return;
|
||||
}
|
||||
util.initAllMenuData(constRoutes, menuData);
|
||||
util.initRouterNode(otherRoutes, otherRouter);
|
||||
// 添加所有主界面路由
|
||||
vm.$store.commit('updateAppRouter', constRoutes.filter(item => item.children.length > 0));
|
||||
// 添加全局路由
|
||||
vm.$store.commit('updateDefaultRouter', otherRoutes);
|
||||
// 添加菜单路由
|
||||
util.initMenuData(vm, menuData);
|
||||
// 缓存数据 修改加载标识
|
||||
window.localStorage.setItem('menuData', JSON.stringify(menuData));
|
||||
vm.$store.commit('setAdded', true);
|
||||
// });
|
||||
} else {
|
||||
// 读取缓存数据
|
||||
let data = window.localStorage.getItem('menuData');
|
||||
if (!data) {
|
||||
vm.$store.commit('setAdded', false);
|
||||
return;
|
||||
}
|
||||
let menuData = JSON.parse(data);
|
||||
// 添加菜单路由
|
||||
util.initMenuData(vm, menuData);
|
||||
}
|
||||
};
|
||||
|
||||
// 添加所有顶部导航栏下的菜单路由
|
||||
util.initAllMenuData = function (constRoutes, data) {
|
||||
|
||||
let allMenuData = [];
|
||||
data.forEach(e => {
|
||||
if (e.type == -1) {
|
||||
e.children.forEach(item => {
|
||||
allMenuData.push(item);
|
||||
})
|
||||
}
|
||||
})
|
||||
util.initRouterNode(constRoutes, allMenuData);
|
||||
}
|
||||
|
||||
// 生成菜单格式数据
|
||||
util.initMenuData = function (vm, data) {
|
||||
const menuRoutes = [];
|
||||
let menuData = data;
|
||||
// 顶部菜单
|
||||
let navList = [];
|
||||
menuData.forEach(e => {
|
||||
let nav = {
|
||||
name: e.name,
|
||||
title: e.title,
|
||||
icon: e.icon
|
||||
}
|
||||
navList.push(nav);
|
||||
})
|
||||
if (navList.length < 1) {
|
||||
return;
|
||||
}
|
||||
// 存入vuex
|
||||
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);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 默认第一个
|
||||
currNav = navList[0].name;
|
||||
vm.$store.commit('setCurrNavTitle', navList[0].title);
|
||||
}
|
||||
vm.$store.commit('setCurrNav', currNav);
|
||||
for (var item of menuData) {
|
||||
if (item.name == currNav) {
|
||||
// 过滤
|
||||
menuData = item.children;
|
||||
break;
|
||||
}
|
||||
}
|
||||
util.initRouterNode(menuRoutes, menuData);
|
||||
// 刷新界面菜单
|
||||
vm.$store.commit('updateMenulist', menuRoutes.filter(item => item.children.length > 0));
|
||||
|
||||
let tagsList = [];
|
||||
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);
|
||||
};
|
||||
|
||||
// 生成路由节点
|
||||
util.initRouterNode = function (routers, data) { // data为所有子菜单数据
|
||||
|
||||
for (var item of data) {
|
||||
let menu = Object.assign({}, item);
|
||||
// menu.component = import(`@/views/${menu.component}.vue`);
|
||||
menu.component = lazyLoading(menu.component);
|
||||
|
||||
if (item.children && item.children.length > 0) {
|
||||
menu.children = [];
|
||||
util.initRouterNode(menu.children, item.children);
|
||||
}
|
||||
|
||||
let meta = {};
|
||||
// 给页面添加权限、标题、第三方网页链接
|
||||
meta.permTypes = menu.permTypes ? menu.permTypes : null;
|
||||
meta.title = menu.title ? menu.title + " - lilishop商家后台" : null;
|
||||
meta.url = menu.url ? menu.url : null;
|
||||
menu.meta = meta;
|
||||
|
||||
routers.push(menu);
|
||||
}
|
||||
};
|
||||
|
||||
export default util;
|
||||
80
seller/src/libs/validate.js
Normal file
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* 密码格式验证
|
||||
* @param rule 验证规则(不少于6位)
|
||||
* @param value 需要验证的值
|
||||
* @param callback 回调函数
|
||||
*/
|
||||
export const validatePassword = (rule, value, callback) => {
|
||||
if (value.length < 6) {
|
||||
callback(new Error('密码长度不得小于6位'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 手机号码格式验证
|
||||
* @param rule 验证规则
|
||||
* @param value 需要验证的值
|
||||
* @param callback 回调函数
|
||||
*/
|
||||
export const validateMobile = (rule, value, callback) => {
|
||||
var reg = /^[1][3,4,5,6,7,8][0-9]{9}$/;
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error('手机号格式错误'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 身份证号码格式验证
|
||||
* @param rule 验证规则(是否满足18位)
|
||||
* @param value 需要验证的值
|
||||
* @param callback 回调函数
|
||||
*/
|
||||
export const validateIDCard = (rule, value, callback) => {
|
||||
const reg = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error('身份证号码格式错误'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 验证是否整数
|
||||
export function isInteger(rule, value, callback) {
|
||||
if (!value) {
|
||||
return callback(new Error('输入不可以为空'));
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (!Number(value)) {
|
||||
callback(new Error('请输入正整数'));
|
||||
} else {
|
||||
const re = /^[0-9]*[1-9][0-9]*$/;
|
||||
const rsCheck = re.test(value);
|
||||
if (!rsCheck) {
|
||||
callback(new Error('请输入正整数'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
export function isMoney(rule, value, callback) {
|
||||
if (!value) {
|
||||
return callback(new Error('输入不可以为空'));
|
||||
}
|
||||
let re =/(^[1-9]{1}[0-9]*$)|(^[0-9]*\.[0-9]{2}$)/;
|
||||
const rsCheck = re.test(value);
|
||||
if (!rsCheck) {
|
||||
callback(new Error('请输入正整数'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
export function validatetoFixedNew(str) {
|
||||
return str ;
|
||||
}
|
||||
20
seller/src/libs/zh.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "zh",
|
||||
"options": {
|
||||
"months": ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
|
||||
"shortMonths": ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
|
||||
"days": ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
|
||||
"shortDays": ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
|
||||
"toolbar": {
|
||||
"exportToSVG": "下载图表 SVG",
|
||||
"exportToPNG": "下载图表 PNG",
|
||||
"menu": "菜单",
|
||||
"selection": "选择",
|
||||
"selectionZoom": "区域缩放",
|
||||
"zoomIn": "缩小",
|
||||
"zoomOut": "放大",
|
||||
"pan": "移动",
|
||||
"reset": "重置缩放"
|
||||
}
|
||||
}
|
||||
}
|
||||
28
seller/src/locale/index.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import Vue from 'vue';
|
||||
import VueI18n from 'vue-i18n';
|
||||
import zhLocale from './lang/zh-CN';
|
||||
import enLocale from './lang/en-US';
|
||||
import zhCnLocale from 'view-design/src/locale/lang/zh-CN';
|
||||
import enUsLocale from 'view-design/src/locale/lang/en-US';
|
||||
|
||||
Vue.use(VueI18n);
|
||||
|
||||
// 根据浏览器信息自动设置语言
|
||||
const navLang = navigator.language;
|
||||
const localLang = (navLang == 'zh-CN' || navLang == 'en-US') ? navLang : false;
|
||||
const lang = window.localStorage.lang || localLang || 'zh-CN';
|
||||
|
||||
Vue.config.lang = lang;
|
||||
|
||||
// 多语言配置 vue-i18n 6.x+
|
||||
Vue.locale = () => { };
|
||||
const messages = {
|
||||
'zh-CN': Object.assign(zhCnLocale, zhLocale),
|
||||
'en-US': Object.assign(enUsLocale, enLocale)
|
||||
};
|
||||
const i18n = new VueI18n({
|
||||
locale: lang,
|
||||
messages
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
24
seller/src/locale/lang/en-US.js
Normal file
@@ -0,0 +1,24 @@
|
||||
export default {
|
||||
lili: 'lili',
|
||||
usernameLogin: 'UsernameLogin',
|
||||
mobileLogin: 'MobileLogin',
|
||||
autoLogin: 'Auto Login',
|
||||
forgetPass: 'Forget Password',
|
||||
otherLogin: 'Sign in with',
|
||||
regist: 'Register',
|
||||
login: 'Login',
|
||||
logining: 'Logining...',
|
||||
home: 'home',
|
||||
switchLangTitle: 'Switch Lang',
|
||||
international: 'Switch Lang',
|
||||
userCenter: 'Account Center',
|
||||
changePass: 'Account Pass',
|
||||
logout: 'Logout',
|
||||
tagOption: 'Label Options',
|
||||
closeAll: 'Close All',
|
||||
closeOthers: 'Close Others',
|
||||
help: 'Help',
|
||||
privacy: 'Privacy',
|
||||
terms: 'Terms',
|
||||
rights: 'All Rights Reserved'
|
||||
};
|
||||
24
seller/src/locale/lang/zh-CN.js
Normal file
@@ -0,0 +1,24 @@
|
||||
export default {
|
||||
lili: 'lili',
|
||||
usernameLogin: '账户密码登录',
|
||||
mobileLogin: '手机号登录',
|
||||
autoLogin: '自动登录',
|
||||
forgetPass: '忘记密码',
|
||||
otherLogin: '其他方式登录',
|
||||
regist: '注册账户',
|
||||
login: '登录',
|
||||
logining: '登录中...',
|
||||
home: '首页',
|
||||
switchLangTitle: '切换语言',
|
||||
international: '多语言切换',
|
||||
userCenter: '个人中心',
|
||||
changePass: '修改密码',
|
||||
logout: '退出登录',
|
||||
tagOption: '标签选项',
|
||||
closeAll: '关闭全部',
|
||||
closeOthers: '关闭其他',
|
||||
help: '帮助',
|
||||
privacy: '隐私',
|
||||
terms: '条款',
|
||||
rights: '版权所有'
|
||||
};
|
||||
87
seller/src/main.js
Normal file
@@ -0,0 +1,87 @@
|
||||
// The Vue build version to load with the `import` command
|
||||
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
||||
import Vue from "vue";
|
||||
import ViewUI from "view-design";
|
||||
import "./styles/theme.less";
|
||||
|
||||
import "core-js/stable";
|
||||
import "regenerator-runtime/runtime";
|
||||
|
||||
import App from "./App";
|
||||
import { router } from "./router/index";
|
||||
import store from "./store";
|
||||
import i18n from "@/locale";
|
||||
|
||||
import {
|
||||
getRequest,
|
||||
postRequest,
|
||||
putRequest,
|
||||
deleteRequest,
|
||||
importRequest,
|
||||
uploadFileRequest
|
||||
} from "@/libs/axios";
|
||||
import { setStore, getStore, removeStore } from "@/libs/storage";
|
||||
|
||||
import util from "@/libs/util";
|
||||
import dictUtil from "@/libs/dictUtil";
|
||||
|
||||
import VueLazyload from "vue-lazyload";
|
||||
import VueClipboard from "vue-clipboard2";
|
||||
|
||||
import * as filters from "@/utils/filters"; // global filter
|
||||
|
||||
import { md5 } from "@/utils/md5.js";
|
||||
Vue.config.devtools = true;
|
||||
Vue.config.productionTip = false;
|
||||
Vue.use(VueLazyload, {
|
||||
error: require("./assets/img-error.png"),
|
||||
loading: require("./assets/loading2.gif")
|
||||
});
|
||||
Vue.use(ViewUI, {
|
||||
i18n: (key, value) => i18n.t(key, value)
|
||||
});
|
||||
|
||||
Vue.use(VueClipboard);
|
||||
|
||||
// 挂载全局使用的方法
|
||||
Vue.prototype.getRequest = getRequest;
|
||||
Vue.prototype.postRequest = postRequest;
|
||||
Vue.prototype.putRequest = putRequest;
|
||||
Vue.prototype.deleteRequest = deleteRequest;
|
||||
Vue.prototype.importRequest = importRequest;
|
||||
Vue.prototype.uploadFileRequest = uploadFileRequest;
|
||||
Vue.prototype.setStore = setStore;
|
||||
Vue.prototype.getStore = getStore;
|
||||
Vue.prototype.removeStore = removeStore;
|
||||
Vue.prototype.md5 = md5;
|
||||
|
||||
Array.prototype.remove = function(from, to) {
|
||||
var rest = this.slice((to || from) + 1 || this.length);
|
||||
this.length = from < 0 ? this.length + from : from;
|
||||
return this.push.apply(this, rest);
|
||||
};
|
||||
|
||||
Object.keys(filters).forEach(key => {
|
||||
Vue.filter(key, filters[key]);
|
||||
});
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
el: "#app",
|
||||
router,
|
||||
store,
|
||||
i18n,
|
||||
render: h => h(App),
|
||||
data: {
|
||||
currentPageName: ""
|
||||
},
|
||||
mounted() {
|
||||
// 初始化菜单
|
||||
util.initRouter(this);
|
||||
// 初始化全局数据字典
|
||||
dictUtil.initDictData(this);
|
||||
this.currentPageName = this.$route.name;
|
||||
// 显示打开的页面的列表
|
||||
this.$store.commit("setOpenedList");
|
||||
this.$store.commit("initCachepage");
|
||||
}
|
||||
});
|
||||
46
seller/src/router/index.js
Normal file
@@ -0,0 +1,46 @@
|
||||
import Vue from 'vue';
|
||||
import ViewUI from 'view-design';
|
||||
import Util from '../libs/util';
|
||||
import VueRouter from 'vue-router';
|
||||
import Cookies from 'js-cookie';
|
||||
import {routers} from './router';
|
||||
|
||||
Vue.use(VueRouter);
|
||||
|
||||
// 路由配置
|
||||
const RouterConfig = {
|
||||
mode: 'history',
|
||||
routes: routers
|
||||
};
|
||||
|
||||
export const router = new VueRouter(RouterConfig);
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
ViewUI.LoadingBar.start();
|
||||
Util.title(to.meta.title);
|
||||
|
||||
next();
|
||||
|
||||
const name = to.name;
|
||||
|
||||
if (!Cookies.get('userInfo') && name !== 'login') {
|
||||
// 判断是否已经登录且前往的页面不是登录页
|
||||
next({
|
||||
name: 'login'
|
||||
});
|
||||
} else if (Cookies.get('userInfo') && name === 'login') {
|
||||
// 判断是否已经登录且前往的是登录页
|
||||
Util.title();
|
||||
next({
|
||||
name: 'home_index'
|
||||
});
|
||||
} else {
|
||||
Util.toDefaultPage([...routers], name, router, next);
|
||||
}
|
||||
});
|
||||
|
||||
router.afterEach((to) => {
|
||||
Util.openNewPage(router.app, to.name, to.params, to.query);
|
||||
ViewUI.LoadingBar.finish();
|
||||
window.scrollTo(0, 0);
|
||||
});
|
||||
165
seller/src/router/router.js
Normal file
@@ -0,0 +1,165 @@
|
||||
import Main from "@/views/Main.vue";
|
||||
|
||||
// 不作为Main组件的子页面展示的页面单独写,如下
|
||||
export const loginRouter = {
|
||||
path: "/login",
|
||||
name: "login",
|
||||
meta: {
|
||||
title: "登录 - lili "
|
||||
},
|
||||
component: () => import("@/views/login.vue")
|
||||
};
|
||||
|
||||
// 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里
|
||||
export const otherRouter = {
|
||||
path: "/",
|
||||
name: "otherRouter",
|
||||
redirect: "/home",
|
||||
component: Main,
|
||||
children: [
|
||||
{
|
||||
path: "home",
|
||||
title: { i18n: "home" },
|
||||
name: "home_index",
|
||||
component: () => import("@/views/home/home.vue")
|
||||
},
|
||||
{
|
||||
path: "change-password",
|
||||
title: "修改密码",
|
||||
name: "change_pass",
|
||||
component: () => import("@/views/change-password/change-password.vue")
|
||||
},
|
||||
{
|
||||
path: "message",
|
||||
title: "消息中心",
|
||||
name: "message_index",
|
||||
component: () => import("@/views/message/message.vue")
|
||||
},
|
||||
{
|
||||
path: "stock-goods",
|
||||
title: "店铺端商品库存告警列表",
|
||||
name: "stock-goods",
|
||||
component: () => import("@/views/goods/goods-seller/goodsStock.vue")
|
||||
},
|
||||
{
|
||||
path: "goods-operation",
|
||||
title: "添加商品",
|
||||
name: "goods-operation",
|
||||
component: () => import("@/views/goods/goods-seller/goodsOperation.vue")
|
||||
},
|
||||
{
|
||||
path: "goods-operation-edit",
|
||||
title: "编辑商品",
|
||||
name: "goods-operation-edit",
|
||||
component: () => import("@/views/goods/goods-seller/goodsOperation.vue")
|
||||
},
|
||||
{
|
||||
path: "goods-template-operation-edit",
|
||||
title: "编辑模版",
|
||||
name: "goods-template-operation-edit",
|
||||
component: () => import("@/views/goods/goods-seller/goodsOperation.vue")
|
||||
},
|
||||
{
|
||||
path: "goods-draft-operation-edit",
|
||||
title: "编辑草稿",
|
||||
name: "goods-draft-operation-edit",
|
||||
component: () => import("@/views/goods/goods-seller/goodsOperation.vue")
|
||||
},
|
||||
{
|
||||
path: "add-coupon",
|
||||
title: "店铺优惠券",
|
||||
name: "add-coupon",
|
||||
component: () => import("@/views/promotion/coupon/couponPublish.vue")
|
||||
},
|
||||
{
|
||||
path: "bill-detail",
|
||||
title: "结算单详情",
|
||||
name: "bill-detail",
|
||||
component: () => import("@/views/shop/bill/billDetail.vue")
|
||||
},
|
||||
{
|
||||
path: "seckill-goods",
|
||||
title: "限时抢购商品",
|
||||
name: "seckill-goods",
|
||||
component: () => import("@/views/promotion/seckill/seckillGoods.vue")
|
||||
},
|
||||
{
|
||||
path: "pintuan-goods",
|
||||
title: "拼团商品",
|
||||
name: "pintuan-goods",
|
||||
component: () => import("@/views/promotion/pintuan/pintuanGoods.vue")
|
||||
},
|
||||
{
|
||||
path: "new-pintuan",
|
||||
title: "新增拼团",
|
||||
name: "new-pintuan",
|
||||
component: () => import("@/views/promotion/pintuan/newPintuan.vue")
|
||||
},
|
||||
{
|
||||
path: "order-detail",
|
||||
title: "订单详情",
|
||||
name: "order-detail",
|
||||
component: () => import("@/views/order/order/orderDetail.vue")
|
||||
},
|
||||
{
|
||||
path: "order-complaint-detail",
|
||||
title: "投诉详情",
|
||||
name: "order-complaint-detail",
|
||||
component: () =>
|
||||
import("@/views/order/after-order/orderComplaintDetail.vue")
|
||||
},
|
||||
{
|
||||
path: "return-goods-order-detail",
|
||||
title: "售后详情",
|
||||
name: "return-goods-order-detail",
|
||||
component: () =>
|
||||
import("@/views/order/after-order/reurnGoodsOrderDetail.vue")
|
||||
},
|
||||
{
|
||||
path: "full-cut",
|
||||
title: "满优惠",
|
||||
name: "full-cut",
|
||||
component: () => import("@/views/promotion/fullCut/full-cut.vue")
|
||||
},
|
||||
{
|
||||
path: "full-cut-detail",
|
||||
title: "添加满优惠",
|
||||
name: "full-cut-detail",
|
||||
component: () => import("@/views/promotion/fullCut/newFullCut.vue")
|
||||
},
|
||||
{
|
||||
path: "order-detail",
|
||||
title: "订单详情",
|
||||
name: "order-detail",
|
||||
component: () => import("@/views/order/order/orderDetail.vue")
|
||||
},
|
||||
// {
|
||||
// path: "/*",
|
||||
// name: "error-404",
|
||||
// meta: {
|
||||
// title: "404-页面不存在"
|
||||
// },
|
||||
// component: () => import("@/views/error-page/404.vue")
|
||||
// }
|
||||
]
|
||||
};
|
||||
|
||||
export const page403 = {
|
||||
path: "/403",
|
||||
meta: {
|
||||
title: "403-权限不足"
|
||||
},
|
||||
name: "error-403",
|
||||
component: () => import("@/views/error-page/403.vue")
|
||||
};
|
||||
|
||||
export const page500 = {
|
||||
path: "/500",
|
||||
meta: {
|
||||
title: "500-服务端错误"
|
||||
},
|
||||
name: "error-500",
|
||||
component: () => import("@/views/error-page/500.vue")
|
||||
};
|
||||
// 所有上面定义的路由都要写在下面的routers里
|
||||
export const routers = [loginRouter, otherRouter, page500, page403];
|
||||
28
seller/src/store/index.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
|
||||
import app from './modules/app';
|
||||
import user from './modules/user';
|
||||
import dict from './modules/dict';
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
const store = new Vuex.Store({
|
||||
state: {
|
||||
// 状态
|
||||
|
||||
},
|
||||
mutations: {
|
||||
// 改变方法
|
||||
},
|
||||
actions: {
|
||||
|
||||
},
|
||||
modules: {
|
||||
app,
|
||||
user,
|
||||
dict
|
||||
}
|
||||
});
|
||||
|
||||
export default store;
|
||||
177
seller/src/store/modules/app.js
Normal file
@@ -0,0 +1,177 @@
|
||||
import { otherRouter } from '@/router/router';
|
||||
import { router } from '@/router/index';
|
||||
import Util from '@/libs/util';
|
||||
import Cookies from 'js-cookie';
|
||||
import Vue from 'vue';
|
||||
|
||||
const app = {
|
||||
state: {
|
||||
styleStore:"", //移动端楼层装修中选择风格存储
|
||||
loading: false, // 全局加载动画
|
||||
added: false, // 加载路由标识
|
||||
navList: [], // 顶部菜单
|
||||
currNav: "", // 当前顶部菜单name
|
||||
currNavTitle: "", // 当前顶部菜单标题
|
||||
cachePage: [],
|
||||
lang: '',
|
||||
isFullScreen: false,
|
||||
openedSubmenuArr: [], // 要展开的菜单数组
|
||||
menuTheme: 'dark', // 主题
|
||||
themeColor: '',
|
||||
storeOpenedList: [{
|
||||
title: '首页',
|
||||
path: '',
|
||||
name: 'home_index'
|
||||
}],
|
||||
currentPageName: '',
|
||||
currentPath: [
|
||||
{
|
||||
title: '首页',
|
||||
path: '',
|
||||
name: 'home_index'
|
||||
}
|
||||
],
|
||||
// 面包屑数组 左侧菜单
|
||||
menuList: [],
|
||||
routers: [
|
||||
otherRouter
|
||||
],
|
||||
tagsList: [...otherRouter.children],
|
||||
messageCount: 0,
|
||||
// 在这里定义你不想要缓存的页面的name属性值(参见路由配置router.js)
|
||||
dontCache: ['test', 'test']
|
||||
},
|
||||
mutations: {
|
||||
// 动态添加主界面路由,需要缓存
|
||||
updateAppRouter(state, routes) {
|
||||
state.routers.push(...routes);
|
||||
router.addRoutes(routes);
|
||||
},
|
||||
// 动态添加全局路由404、500等页面,不需要缓存
|
||||
updateDefaultRouter(state, routes) {
|
||||
router.addRoutes(routes);
|
||||
},
|
||||
setLoading(state, v) {
|
||||
state.loading = v;
|
||||
},
|
||||
setAdded(state, v) {
|
||||
state.added = v;
|
||||
},
|
||||
setNavList(state, list) {
|
||||
state.navList = list;
|
||||
},
|
||||
setCurrNav(state, v) {
|
||||
state.currNav = v;
|
||||
},
|
||||
setCurrNavTitle(state, v) {
|
||||
state.currNavTitle = v;
|
||||
},
|
||||
setTagsList(state, list) {
|
||||
state.tagsList.push(...list);
|
||||
},
|
||||
updateMenulist(state, routes) {
|
||||
state.menuList = routes;
|
||||
},
|
||||
addOpenSubmenu(state, name) {
|
||||
let hasThisName = false;
|
||||
let isEmpty = false;
|
||||
if (name.length == 0) {
|
||||
isEmpty = true;
|
||||
}
|
||||
if (state.openedSubmenuArr.indexOf(name) > -1) {
|
||||
hasThisName = true;
|
||||
}
|
||||
if (!hasThisName && !isEmpty) {
|
||||
state.openedSubmenuArr.push(name);
|
||||
}
|
||||
},
|
||||
closePage(state, name) {
|
||||
state.cachePage.forEach((item, index) => {
|
||||
if (item == name) {
|
||||
state.cachePage.splice(index, 1);
|
||||
}
|
||||
});
|
||||
},
|
||||
initCachepage(state) {
|
||||
if (localStorage.cachePage) {
|
||||
state.cachePage = JSON.parse(localStorage.cachePage);
|
||||
}
|
||||
},
|
||||
removeTag(state, name) {
|
||||
state.storeOpenedList.map((item, index) => {
|
||||
if (item.name == name) {
|
||||
state.storeOpenedList.splice(index, 1);
|
||||
}
|
||||
});
|
||||
},
|
||||
storeOpenedList(state, get) {
|
||||
let openedPage = state.storeOpenedList[get.index];
|
||||
if (get.argu) {
|
||||
openedPage.argu = get.argu;
|
||||
}
|
||||
if (get.query) {
|
||||
openedPage.query = get.query;
|
||||
}
|
||||
state.storeOpenedList.splice(get.index, 1, openedPage);
|
||||
localStorage.storeOpenedList = JSON.stringify(state.storeOpenedList);
|
||||
},
|
||||
clearAllTags(state) {
|
||||
state.storeOpenedList.splice(1);
|
||||
state.cachePage.length = 0;
|
||||
localStorage.storeOpenedList = JSON.stringify(state.storeOpenedList);
|
||||
},
|
||||
clearOtherTags(state, vm) {
|
||||
let currentName = vm.$route.name;
|
||||
let currentIndex = 0;
|
||||
state.storeOpenedList.forEach((item, index) => {
|
||||
if (item.name == currentName) {
|
||||
currentIndex = index;
|
||||
}
|
||||
});
|
||||
if (currentIndex == 0) {
|
||||
state.storeOpenedList.splice(1);
|
||||
} else {
|
||||
state.storeOpenedList.splice(currentIndex + 1);
|
||||
state.storeOpenedList.splice(1, currentIndex - 1);
|
||||
}
|
||||
let newCachepage = state.cachePage.filter(item => {
|
||||
return item == currentName;
|
||||
});
|
||||
state.cachePage = newCachepage;
|
||||
localStorage.storeOpenedList = JSON.stringify(state.storeOpenedList);
|
||||
},
|
||||
setOpenedList(state) {
|
||||
state.storeOpenedList = localStorage.storeOpenedList ? JSON.parse(localStorage.storeOpenedList) : [otherRouter.children[0]];
|
||||
},
|
||||
setCurrentPath(state, pathArr) {
|
||||
state.currentPath = pathArr;
|
||||
},
|
||||
setCurrentPageName(state, name) {
|
||||
state.currentPageName = name;
|
||||
},
|
||||
setAvatarPath(state, path) {
|
||||
localStorage.avatorImgPath = path;
|
||||
},
|
||||
switchLang(state, lang) {
|
||||
state.lang = lang;
|
||||
localStorage.lang = lang;
|
||||
Vue.config.lang = lang;
|
||||
},
|
||||
clearOpenedSubmenu(state) {
|
||||
state.openedSubmenuArr.length = 0;
|
||||
},
|
||||
setMessageCount(state, count) {
|
||||
state.messageCount = count;
|
||||
},
|
||||
increateTag(state, tagObj) {
|
||||
if (!Util.oneOf(tagObj.name, state.dontCache)) {
|
||||
state.cachePage.push(tagObj.name);
|
||||
localStorage.cachePage = JSON.stringify(state.cachePage);
|
||||
}
|
||||
state.storeOpenedList.push(tagObj);
|
||||
localStorage.storeOpenedList = JSON.stringify(state.storeOpenedList);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default app;
|
||||
26
seller/src/store/modules/dict.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const dict = {
|
||||
state: {
|
||||
// 经常需要读取的数据字典
|
||||
sex: [],
|
||||
messageType: [],
|
||||
priority: [],
|
||||
leaveType: []
|
||||
},
|
||||
mutations: {
|
||||
// 设置值的改变方法
|
||||
setSex(state, list) {
|
||||
state.sex = list;
|
||||
},
|
||||
setMessageType(state, list) {
|
||||
state.messageType = list;
|
||||
},
|
||||
setPriority(state, list) {
|
||||
state.priority = list;
|
||||
},
|
||||
setLeaveType(state, list) {
|
||||
state.leaveType = list;
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
export default dict;
|
||||
14
seller/src/store/modules/user.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
const user = {
|
||||
state: {},
|
||||
mutations: {
|
||||
logout () {
|
||||
Cookies.remove('userInfo');
|
||||
// 清空打开的页面等数据
|
||||
localStorage.clear();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default user;
|
||||
195
seller/src/styles/common.scss
Normal file
@@ -0,0 +1,195 @@
|
||||
$theme_color: #804ed1;
|
||||
|
||||
|
||||
//自动移滚动条样式
|
||||
::-webkit-scrollbar{
|
||||
width: 1px;
|
||||
height: 5px;
|
||||
}
|
||||
::-webkit-scrollbar-thumb{
|
||||
border-radius: 1em;
|
||||
background-color: rgba(50,50,50,.3);
|
||||
}
|
||||
::-webkit-scrollbar-track{
|
||||
border-radius: 1em;
|
||||
background-color: rgba(50,50,50,.1);
|
||||
}
|
||||
|
||||
|
||||
.flex{
|
||||
display: flex !important;
|
||||
|
||||
}
|
||||
.flex_justify_content{
|
||||
justify-content: center;
|
||||
}
|
||||
.flex_align_item{
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.global_text_left {
|
||||
text-align: left;
|
||||
}
|
||||
.global_text_right {
|
||||
text-align: right;
|
||||
}
|
||||
.global_float_left {
|
||||
float: left;
|
||||
}
|
||||
.global_float_right {
|
||||
float: right;
|
||||
}
|
||||
.clearfix::after{
|
||||
content: '';
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
.width_1200{width: 1200px;}
|
||||
.width_800{width: 800px;}
|
||||
.width_400{width: 400px;}
|
||||
.width_300{width: 300px;}
|
||||
.width_200{width: 200px;}
|
||||
.width_100{width: 100px;}
|
||||
|
||||
.fz_12{font-size: 12px;}
|
||||
.fz_14{font-size: 14px;}
|
||||
.fz_16{font-size: 16px;}
|
||||
.fz_18{font-size: 18px;}
|
||||
.fw_bold{font-weight: bold;}
|
||||
|
||||
.mb_20{margin-bottom: 20px;}
|
||||
.mt_20{margin-top: 20px;}
|
||||
.ml_20{margin-left: 20px;}
|
||||
.mr_20{margin-right: 20px;}
|
||||
|
||||
.mb_10{margin-bottom: 10px;}
|
||||
.mt_10{margin-top: 10px;}
|
||||
.ml_10{margin-left: 10px;}
|
||||
.mr_10{margin-right: 10px;}
|
||||
|
||||
.pb_20{padding-bottom: 20px;}
|
||||
.pt_20{padding-top: 20px;}
|
||||
.pl_20{padding-left: 20px;}
|
||||
.pr_20{padding-right: 20px;}
|
||||
|
||||
.pb_10{padding-bottom: 10px;}
|
||||
.pt_10{padding-top: 10px;}
|
||||
.pl_10{padding-left: 10px;}
|
||||
.pr_10{padding-right: 10px;}
|
||||
|
||||
ul,li{
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.ellipsis{
|
||||
overflow: hidden;
|
||||
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;
|
||||
|
||||
$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;
|
||||
|
||||
/***** 封装一些方法可用于 黑暗主题 ,明亮主题 *****/
|
||||
|
||||
// 背景颜色
|
||||
@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;
|
||||
}
|
||||
}
|
||||
83
seller/src/styles/table-common.scss
Normal file
@@ -0,0 +1,83 @@
|
||||
.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;
|
||||
}
|
||||
}
|
||||
|
||||
.tree-list {
|
||||
position: relative;
|
||||
min-height: 80px;
|
||||
}
|
||||
|
||||
.drawer-footer {
|
||||
z-index: 10;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 16px;
|
||||
text-align: right;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.block-tool .ivu-tooltip,
|
||||
.block-tool .ivu-tooltip-rel {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.block-pop .ivu-poptip,
|
||||
.block-pop .ivu-poptip-rel {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.search-input{
|
||||
width: 270px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.ivu-form-item{
|
||||
margin:8px 10px !important;
|
||||
}
|
||||
.search-form {
|
||||
width: 100% !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #F0F0F0;
|
||||
padding: 10px;
|
||||
margin: 0;
|
||||
flex-wrap: wrap;
|
||||
/deep/ .ivu-form-item{
|
||||
|
||||
}
|
||||
}
|
||||
.padding-row{
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.search-btn{
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.div-zoom{
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 4;
|
||||
overflow: hidden;
|
||||
}
|
||||
9
seller/src/styles/theme.less
Normal file
@@ -0,0 +1,9 @@
|
||||
@import "~view-design/src/styles/index.less";
|
||||
// iview 自定义样式
|
||||
|
||||
@primary-color: #ed3f14;
|
||||
@table-thead-bg: #f8f8f9;
|
||||
@table-td-stripe-bg: #f8f8f9;
|
||||
@table-td-hover-bg: #ededed;
|
||||
@table-td-highlight-bg: #ededed;
|
||||
@font-size-base: 12px;
|
||||
42
seller/src/styles/tree-common.scss
Normal file
@@ -0,0 +1,42 @@
|
||||
.search {
|
||||
.operation {
|
||||
margin-bottom: 2vh;
|
||||
}
|
||||
|
||||
.select-title {
|
||||
font-weight: 600;
|
||||
color: #40a9ff;
|
||||
}
|
||||
|
||||
.select-clear {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.tree-bar {
|
||||
overflow: auto;
|
||||
margin-top: 5px;
|
||||
position: relative;
|
||||
min-height: 80px;
|
||||
}
|
||||
|
||||
.tree-bar::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
.tree-bar::-webkit-scrollbar-thumb {
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: inset 0 0 2px #d1d1d1;
|
||||
background: #e4e4e4;
|
||||
}
|
||||
|
||||
.block-tool .ivu-tooltip,
|
||||
.block-tool .ivu-tooltip-rel {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.block-pop .ivu-poptip,
|
||||
.block-pop .ivu-poptip-rel {
|
||||
display: block;
|
||||
}
|
||||
118
seller/src/utils/filters.js
Normal file
@@ -0,0 +1,118 @@
|
||||
/**
|
||||
* 金钱单位置换 2999 --> 2,999.00
|
||||
* @param val
|
||||
* @param unit
|
||||
* @param location
|
||||
* @returns {*}
|
||||
*/
|
||||
export function unitPrice(val, unit, location) {
|
||||
let price = formatPrice(val)
|
||||
if (location === 'before') {
|
||||
return price.substr(0, price.length - 3)
|
||||
}
|
||||
if (location === 'after') {
|
||||
return price.substr(-2)
|
||||
}
|
||||
return (unit || '') + price
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 货币格式化
|
||||
* @param price
|
||||
* @returns {string}
|
||||
*/
|
||||
export function formatPrice(price) {
|
||||
if (typeof price !== 'number') return price
|
||||
return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理unix时间戳,转换为可阅读时间格式
|
||||
* @param unix
|
||||
* @param format
|
||||
* @returns {*|string}
|
||||
*/
|
||||
export function unixToDate(unix, format) {
|
||||
let _format = format || 'yyyy-MM-dd hh:mm:ss'
|
||||
const d = new Date(unix * 1000)
|
||||
const o = {
|
||||
'M+': d.getMonth() + 1,
|
||||
'd+': d.getDate(),
|
||||
'h+': d.getHours(),
|
||||
'm+': d.getMinutes(),
|
||||
's+': d.getSeconds(),
|
||||
'q+': Math.floor((d.getMonth() + 3) / 3),
|
||||
S: d.getMilliseconds()
|
||||
}
|
||||
if (/(y+)/.test(_format)) _format = _format.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length))
|
||||
for (const k in o) if (new RegExp('(' + k + ')').test(_format)) _format = _format.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
|
||||
return _format
|
||||
}
|
||||
//是否格式化
|
||||
export function unixWhether(status) {
|
||||
switch (status) {
|
||||
case 'YES':
|
||||
return "是"
|
||||
case 'NO':
|
||||
return "否"
|
||||
}
|
||||
}
|
||||
|
||||
export function unixSellerBillStatus(status_code) {
|
||||
switch (status_code) {
|
||||
case 'OUT':
|
||||
return '已出账'
|
||||
case 'CHECK':
|
||||
return '已对账'
|
||||
case 'EXAMINE':
|
||||
return '已审核'
|
||||
case 'PAY':
|
||||
return '已结算'
|
||||
case 'COMPLETE':
|
||||
return '已完成'
|
||||
}
|
||||
}
|
||||
export function unixSwitchStatus(status_code) {
|
||||
switch (status_code) {
|
||||
case 'OPEN':
|
||||
return '开启'
|
||||
case 'CLOSE':
|
||||
return '关闭'
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 13888888888 -> 138****8888
|
||||
* @param mobile
|
||||
* @returns {*}
|
||||
*/
|
||||
export function secrecyMobile(mobile) {
|
||||
mobile = String(mobile)
|
||||
if (!/\d{11}/.test(mobile)) {
|
||||
return mobile
|
||||
}
|
||||
return mobile.replace(/(\d{3})(\d{4})(\d{4})/, '$1****$3')
|
||||
}
|
||||
|
||||
|
||||
export function formatDate(date, fmt) {
|
||||
if (/(y+)/.test(fmt)) {
|
||||
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
||||
}
|
||||
let o = {
|
||||
'M+': date.getMonth() + 1,
|
||||
'd+': date.getDate(),
|
||||
'h+': date.getHours(),
|
||||
'm+': date.getMinutes(),
|
||||
's+': date.getSeconds()
|
||||
};
|
||||
for (let k in o) {
|
||||
if (new RegExp(`(${k})`).test(fmt)) {
|
||||
let str = o[k] + '';
|
||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
|
||||
}
|
||||
}
|
||||
return fmt;
|
||||
};
|
||||
27
seller/src/utils/index.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import * as regular from './regular'
|
||||
|
||||
export {
|
||||
regular
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数组对象深拷贝
|
||||
* @param obj
|
||||
* @returns {*}
|
||||
*/
|
||||
export default function cloneObj(obj) {
|
||||
let str = null
|
||||
let newobj = obj.constructor === Array ? [] : {}
|
||||
if (typeof obj !== 'object') {
|
||||
return
|
||||
} else if (window && window.JSON) {
|
||||
str = JSON.stringify(obj) // 系列化对象
|
||||
newobj = JSON.parse(str) // 还原
|
||||
} else {
|
||||
for (var i in obj) {
|
||||
newobj[i] = typeof obj[i] === 'object' ? cloneObj(obj[i]) : obj[i]
|
||||
}
|
||||
}
|
||||
return newobj
|
||||
}
|
||||
223
seller/src/utils/md5.js
Normal file
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
||||
* Digest Algorithm, as defined in RFC 1321.
|
||||
* Version 1.1 Copyright (C) Paul Johnston 1999 - 2002.
|
||||
* Code also contributed by Greg Holt
|
||||
* See http://pajhome.org.uk/site/legal.html for details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
||||
* to work around bugs in some JS interpreters.
|
||||
*/
|
||||
function safe_add(x, y) {
|
||||
var lsw = (x & 0xFFFF) + (y & 0xFFFF)
|
||||
var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
|
||||
return (msw << 16) | (lsw & 0xFFFF)
|
||||
}
|
||||
|
||||
/*
|
||||
* Bitwise rotate a 32-bit number to the left.
|
||||
*/
|
||||
function rol(num, cnt) {
|
||||
return (num << cnt) | (num >>> (32 - cnt))
|
||||
}
|
||||
|
||||
/*
|
||||
* These functions implement the four basic operations the algorithm uses.
|
||||
*/
|
||||
function cmn(q, a, b, x, s, t) {
|
||||
return safe_add(rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)
|
||||
}
|
||||
|
||||
function ff(a, b, c, d, x, s, t) {
|
||||
return cmn((b & c) | ((~b) & d), a, b, x, s, t)
|
||||
}
|
||||
|
||||
function gg(a, b, c, d, x, s, t) {
|
||||
return cmn((b & d) | (c & (~d)), a, b, x, s, t)
|
||||
}
|
||||
|
||||
function hh(a, b, c, d, x, s, t) {
|
||||
return cmn(b ^ c ^ d, a, b, x, s, t)
|
||||
}
|
||||
|
||||
function ii(a, b, c, d, x, s, t) {
|
||||
return cmn(c ^ (b | (~d)), a, b, x, s, t)
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate the MD5 of an array of little-endian words, producing an array
|
||||
* of little-endian words.
|
||||
*/
|
||||
function coreMD5(x) {
|
||||
var a = 1732584193
|
||||
var b = -271733879
|
||||
var c = -1732584194
|
||||
var d = 271733878
|
||||
|
||||
for (var i = 0; i < x.length; i += 16) {
|
||||
var olda = a
|
||||
var oldb = b
|
||||
var oldc = c
|
||||
var oldd = d
|
||||
|
||||
a = ff(a, b, c, d, x[i + 0], 7, -680876936)
|
||||
d = ff(d, a, b, c, x[i + 1], 12, -389564586)
|
||||
c = ff(c, d, a, b, x[i + 2], 17, 606105819)
|
||||
b = ff(b, c, d, a, x[i + 3], 22, -1044525330)
|
||||
a = ff(a, b, c, d, x[i + 4], 7, -176418897)
|
||||
d = ff(d, a, b, c, x[i + 5], 12, 1200080426)
|
||||
c = ff(c, d, a, b, x[i + 6], 17, -1473231341)
|
||||
b = ff(b, c, d, a, x[i + 7], 22, -45705983)
|
||||
a = ff(a, b, c, d, x[i + 8], 7, 1770035416)
|
||||
d = ff(d, a, b, c, x[i + 9], 12, -1958414417)
|
||||
c = ff(c, d, a, b, x[i + 10], 17, -42063)
|
||||
b = ff(b, c, d, a, x[i + 11], 22, -1990404162)
|
||||
a = ff(a, b, c, d, x[i + 12], 7, 1804603682)
|
||||
d = ff(d, a, b, c, x[i + 13], 12, -40341101)
|
||||
c = ff(c, d, a, b, x[i + 14], 17, -1502002290)
|
||||
b = ff(b, c, d, a, x[i + 15], 22, 1236535329)
|
||||
|
||||
a = gg(a, b, c, d, x[i + 1], 5, -165796510)
|
||||
d = gg(d, a, b, c, x[i + 6], 9, -1069501632)
|
||||
c = gg(c, d, a, b, x[i + 11], 14, 643717713)
|
||||
b = gg(b, c, d, a, x[i + 0], 20, -373897302)
|
||||
a = gg(a, b, c, d, x[i + 5], 5, -701558691)
|
||||
d = gg(d, a, b, c, x[i + 10], 9, 38016083)
|
||||
c = gg(c, d, a, b, x[i + 15], 14, -660478335)
|
||||
b = gg(b, c, d, a, x[i + 4], 20, -405537848)
|
||||
a = gg(a, b, c, d, x[i + 9], 5, 568446438)
|
||||
d = gg(d, a, b, c, x[i + 14], 9, -1019803690)
|
||||
c = gg(c, d, a, b, x[i + 3], 14, -187363961)
|
||||
b = gg(b, c, d, a, x[i + 8], 20, 1163531501)
|
||||
a = gg(a, b, c, d, x[i + 13], 5, -1444681467)
|
||||
d = gg(d, a, b, c, x[i + 2], 9, -51403784)
|
||||
c = gg(c, d, a, b, x[i + 7], 14, 1735328473)
|
||||
b = gg(b, c, d, a, x[i + 12], 20, -1926607734)
|
||||
|
||||
a = hh(a, b, c, d, x[i + 5], 4, -378558)
|
||||
d = hh(d, a, b, c, x[i + 8], 11, -2022574463)
|
||||
c = hh(c, d, a, b, x[i + 11], 16, 1839030562)
|
||||
b = hh(b, c, d, a, x[i + 14], 23, -35309556)
|
||||
a = hh(a, b, c, d, x[i + 1], 4, -1530992060)
|
||||
d = hh(d, a, b, c, x[i + 4], 11, 1272893353)
|
||||
c = hh(c, d, a, b, x[i + 7], 16, -155497632)
|
||||
b = hh(b, c, d, a, x[i + 10], 23, -1094730640)
|
||||
a = hh(a, b, c, d, x[i + 13], 4, 681279174)
|
||||
d = hh(d, a, b, c, x[i + 0], 11, -358537222)
|
||||
c = hh(c, d, a, b, x[i + 3], 16, -722521979)
|
||||
b = hh(b, c, d, a, x[i + 6], 23, 76029189)
|
||||
a = hh(a, b, c, d, x[i + 9], 4, -640364487)
|
||||
d = hh(d, a, b, c, x[i + 12], 11, -421815835)
|
||||
c = hh(c, d, a, b, x[i + 15], 16, 530742520)
|
||||
b = hh(b, c, d, a, x[i + 2], 23, -995338651)
|
||||
|
||||
a = ii(a, b, c, d, x[i + 0], 6, -198630844)
|
||||
d = ii(d, a, b, c, x[i + 7], 10, 1126891415)
|
||||
c = ii(c, d, a, b, x[i + 14], 15, -1416354905)
|
||||
b = ii(b, c, d, a, x[i + 5], 21, -57434055)
|
||||
a = ii(a, b, c, d, x[i + 12], 6, 1700485571)
|
||||
d = ii(d, a, b, c, x[i + 3], 10, -1894986606)
|
||||
c = ii(c, d, a, b, x[i + 10], 15, -1051523)
|
||||
b = ii(b, c, d, a, x[i + 1], 21, -2054922799)
|
||||
a = ii(a, b, c, d, x[i + 8], 6, 1873313359)
|
||||
d = ii(d, a, b, c, x[i + 15], 10, -30611744)
|
||||
c = ii(c, d, a, b, x[i + 6], 15, -1560198380)
|
||||
b = ii(b, c, d, a, x[i + 13], 21, 1309151649)
|
||||
a = ii(a, b, c, d, x[i + 4], 6, -145523070)
|
||||
d = ii(d, a, b, c, x[i + 11], 10, -1120210379)
|
||||
c = ii(c, d, a, b, x[i + 2], 15, 718787259)
|
||||
b = ii(b, c, d, a, x[i + 9], 21, -343485551)
|
||||
|
||||
a = safe_add(a, olda)
|
||||
b = safe_add(b, oldb)
|
||||
c = safe_add(c, oldc)
|
||||
d = safe_add(d, oldd)
|
||||
}
|
||||
return [a, b, c, d]
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an array of little-endian words to a hex string.
|
||||
*/
|
||||
function binl2hex(binarray) {
|
||||
var hex_tab = "0123456789abcdef"
|
||||
var str = ""
|
||||
for (var i = 0; i < binarray.length * 4; i++) {
|
||||
str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) +
|
||||
hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF)
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an array of little-endian words to a base64 encoded string.
|
||||
*/
|
||||
function binl2b64(binarray) {
|
||||
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
|
||||
var str = ""
|
||||
for (var i = 0; i < binarray.length * 32; i += 6) {
|
||||
str += tab.charAt(((binarray[i >> 5] << (i % 32)) & 0x3F) |
|
||||
((binarray[i >> 5 + 1] >> (32 - i % 32)) & 0x3F))
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an 8-bit character string to a sequence of 16-word blocks, stored
|
||||
* as an array, and append appropriate padding for MD4/5 calculation.
|
||||
* If any of the characters are >255, the high byte is silently ignored.
|
||||
*/
|
||||
function str2binl(str) {
|
||||
var nblk = ((str.length + 8) >> 6) + 1 // number of 16-word blocks
|
||||
var blks = new Array(nblk * 16)
|
||||
for (var i = 0; i < nblk * 16; i++) blks[i] = 0
|
||||
for (var i = 0; i < str.length; i++)
|
||||
blks[i >> 2] |= (str.charCodeAt(i) & 0xFF) << ((i % 4) * 8)
|
||||
blks[i >> 2] |= 0x80 << ((i % 4) * 8)
|
||||
blks[nblk * 16 - 2] = str.length * 8
|
||||
return blks
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a wide-character string to a sequence of 16-word blocks, stored as
|
||||
* an array, and append appropriate padding for MD4/5 calculation.
|
||||
*/
|
||||
function strw2binl(str) {
|
||||
var nblk = ((str.length + 4) >> 5) + 1 // number of 16-word blocks
|
||||
var blks = new Array(nblk * 16)
|
||||
for (var i = 0; i < nblk * 16; i++) blks[i] = 0
|
||||
for (var i = 0; i < str.length; i++)
|
||||
blks[i >> 1] |= str.charCodeAt(i) << ((i % 2) * 16)
|
||||
blks[i >> 1] |= 0x80 << ((i % 2) * 16)
|
||||
blks[nblk * 16 - 2] = str.length * 16
|
||||
return blks
|
||||
}
|
||||
|
||||
/*
|
||||
* External interface
|
||||
*/
|
||||
function hexMD5(str) {
|
||||
return binl2hex(coreMD5(str2binl(str)))
|
||||
}
|
||||
|
||||
function hexMD5w(str) {
|
||||
return binl2hex(coreMD5(strw2binl(str)))
|
||||
}
|
||||
|
||||
function b64MD5(str) {
|
||||
return binl2b64(coreMD5(str2binl(str)))
|
||||
}
|
||||
|
||||
function b64MD5w(str) {
|
||||
return binl2b64(coreMD5(strw2binl(str)))
|
||||
}
|
||||
/* Backward compatibility */
|
||||
function calcMD5(str) {
|
||||
return binl2hex(coreMD5(str2binl(str)))
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
md5: hexMD5
|
||||
}
|
||||
59
seller/src/utils/regular.js
Normal file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* 各种正则表达式
|
||||
*
|
||||
* qq qq号
|
||||
* name 汉字
|
||||
* mobile 手机号
|
||||
* email 电子邮箱
|
||||
* password 密码【6-20位】
|
||||
* integer 正整数【不包含0】
|
||||
* money 金钱
|
||||
* IDCard 身份证
|
||||
* userName 账户名称【汉字、字母、数字、“-”、“_”的组合】
|
||||
* URL URL
|
||||
* TEL 固定电话
|
||||
*/
|
||||
|
||||
|
||||
//qq
|
||||
export const qq = /^[1-9][0-9]{4,14}$/
|
||||
//汉字
|
||||
export const name = /^[\u4e00-\u9fa5]{0,}$/
|
||||
|
||||
// 手机号
|
||||
export const mobile = /^0?(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])[0-9]{8}$/
|
||||
|
||||
// 电子邮箱
|
||||
export const email = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
|
||||
|
||||
// 密码【6-20位】
|
||||
export const password = /^[@A-Za-z0-9!#$%^&*.~,]{6,20}$/
|
||||
|
||||
// 正整数【不包含0】
|
||||
export const integer = /^[1-9]\d*$/
|
||||
|
||||
// 正整数【包含0】
|
||||
export const Integer = /^[0-9]\d*$/
|
||||
|
||||
// 折扣
|
||||
export const discount = /^((0\.[1-9]{1})|(([1-9]{1})(\.\d{1})?))$/
|
||||
|
||||
// 0-100正整数
|
||||
export const rate = /^([0-9]{1,2}|100)$/
|
||||
|
||||
// 金钱
|
||||
export const money = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
|
||||
|
||||
|
||||
// 身份证
|
||||
export const IDCard = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
|
||||
|
||||
// 账户名称【汉字、字母、数字、“-”、“_”的组合】
|
||||
export const userName = /[A-Za-z0-9_\-\u4e00-\u9fa5]$/
|
||||
|
||||
// URL
|
||||
export const URL =
|
||||
/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
|
||||
|
||||
// 固话
|
||||
export const TEL = /0\d{2,3}-\d{7,8}/
|
||||
21
seller/src/utils/validate.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import * as regExp from "./regular";
|
||||
|
||||
//表单中必须输入汉字
|
||||
export function validateNeedName(rule, value, callback) {
|
||||
const name = regExp.name;
|
||||
if (name.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
return callback(new Error("请输入汉字"));
|
||||
}
|
||||
}
|
||||
|
||||
//表单中输入手机号验证
|
||||
export function validateMobile(rule, value, callback) {
|
||||
const mobile = regExp.mobile;
|
||||
if (mobile.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
return callback(new Error("手机号输入错误!"));
|
||||
}
|
||||
}
|
||||
206
seller/src/views/Main.vue
Normal file
@@ -0,0 +1,206 @@
|
||||
<style lang="scss" scoped>
|
||||
@import "./main.scss";
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div class="main">
|
||||
<div class="sidebar-menu-con menu-bar">
|
||||
<div class="logo-con">
|
||||
<img src="../assets/logo.png" key="max-logo" />
|
||||
</div>
|
||||
<shrinkable-menu></shrinkable-menu>
|
||||
</div>
|
||||
<!-- 顶部标题栏主体 -->
|
||||
<div class="main-header-con" style="padding-left:240px">
|
||||
<div class="main-header">
|
||||
<div :class="{'header-avator-con':navType!=4, 'header-avator-con nav4':navType == 4}">
|
||||
<!-- 用户头像 -->
|
||||
<div class="user-dropdown-menu-con">
|
||||
<Row type="flex" justify="end" align="middle" class="user-dropdown-innercon">
|
||||
<Dropdown transfer trigger="hover" @on-click="handleClickUserDropdown">
|
||||
<div class="dropList">
|
||||
<span class="main-user-name">{{ userInfo.storeName }}</span>
|
||||
<Icon type="md-arrow-dropdown" />
|
||||
<Avatar :src="userInfo.storeLogo" style="background: #fff;margin-left: 10px;"></Avatar>
|
||||
</div>
|
||||
<DropdownMenu slot="list">
|
||||
<!-- <DropdownItem name="ownSpace">{{ $t('userCenter') }}</DropdownItem> -->
|
||||
<DropdownItem name="changePass">{{ $t('changePass') }}</DropdownItem>
|
||||
<DropdownItem name="loginOut" divided>{{ $t('logout') }}</DropdownItem>
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
</Row>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 已打开的页面标签 -->
|
||||
<div class="tags-con">
|
||||
<tags-page-opened :pageTagsList="pageTagsList"></tags-page-opened>
|
||||
</div>
|
||||
</div>
|
||||
<div class="single-page-con">
|
||||
<div class="single-page">
|
||||
<keep-alive :include="cachePage">
|
||||
<router-view></router-view>
|
||||
</keep-alive>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 全局加载动画 -->
|
||||
<circleLoading class="loading-position" v-show="loading" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import shrinkableMenu from "./main-components/shrinkable-menu/shrinkable-menu.vue";
|
||||
import tagsPageOpened from "./main-components/tags-page-opened.vue";
|
||||
import breadcrumbNav from "./main-components/breadcrumb-nav.vue";
|
||||
import fullScreen from "./main-components/fullscreen.vue";
|
||||
import messageTip from "./main-components/message-tip.vue";
|
||||
import circleLoading from "@/views/my-components/lili/circle-loading.vue";
|
||||
import Cookies from "js-cookie";
|
||||
import util from "@/libs/util.js";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
shrinkableMenu,
|
||||
tagsPageOpened,
|
||||
breadcrumbNav,
|
||||
fullScreen,
|
||||
messageTip,
|
||||
circleLoading,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sliceNum: 5, // 展示nav数量
|
||||
userInfo: "", // 用户信息
|
||||
navType: 1, // nav类型
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
loading() {
|
||||
return this.$store.state.app.loading;
|
||||
},
|
||||
pageTagsList() {
|
||||
return this.$store.state.app.storeOpenedList; // 打开的页面的页面对象
|
||||
},
|
||||
cachePage() {
|
||||
return this.$store.state.app.cachePage;
|
||||
},
|
||||
lang() {
|
||||
return this.$store.state.app.lang;
|
||||
},
|
||||
mesCount() {
|
||||
return 0;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
// 菜单
|
||||
let pathArr = util.setCurrentPath(this, this.$route.name);
|
||||
if (pathArr.length >= 2) {
|
||||
this.$store.commit("addOpenSubmenu", pathArr[1].name);
|
||||
}
|
||||
|
||||
let userInfo = JSON.parse(Cookies.get("userInfo"));
|
||||
this.userInfo = userInfo;
|
||||
this.checkTag(this.$route.name);
|
||||
|
||||
let currWidth = document.body.clientWidth;
|
||||
if (currWidth <= 1200) {
|
||||
this.sliceNum = 2;
|
||||
}
|
||||
},
|
||||
selectNav(name) {
|
||||
this.$store.commit("setCurrNav", name);
|
||||
this.setStore("currNav", name);
|
||||
// 清空所有已打开标签
|
||||
// this.$store.commit("clearAllTags");
|
||||
if (this.$route.name != "home_index") {
|
||||
this.$router.push({
|
||||
name: "home_index",
|
||||
});
|
||||
}
|
||||
util.initRouter(this);
|
||||
},
|
||||
toggleClick() {
|
||||
this.shrink = !this.shrink;
|
||||
},
|
||||
handleLanDropdown(name) {
|
||||
this.$i18n.locale = name;
|
||||
this.$store.commit("switchLang", name);
|
||||
},
|
||||
handleClickUserDropdown(name) {
|
||||
if (name == "ownSpace") {
|
||||
util.openNewPage(this, "personal-enter");
|
||||
this.$router.push({
|
||||
name: "personal-enter",
|
||||
});
|
||||
} else if (name == "changePass") {
|
||||
util.openNewPage(this, "change_pass");
|
||||
this.$router.push({
|
||||
name: "change_pass",
|
||||
});
|
||||
} else if (name == "loginOut") {
|
||||
Cookies.set("accessToken", "");
|
||||
this.$store.commit("logout", this);
|
||||
this.$store.commit("clearOpenedSubmenu");
|
||||
this.setStore("accessToken", "");
|
||||
this.setStore("refreshToken", "");
|
||||
this.$router.push({ path: "/login" });
|
||||
}
|
||||
},
|
||||
checkTag(name) {
|
||||
let openpageHasTag = this.pageTagsList.some((item) => {
|
||||
if (item.name == name) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (!openpageHasTag) {
|
||||
// 解决关闭当前标签后再点击回退按钮会退到当前页时没有标签的问题
|
||||
util.openNewPage(
|
||||
this,
|
||||
name,
|
||||
this.$route.params || {},
|
||||
this.$route.query || {}
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
resize() {
|
||||
let currWidth = document.body.clientWidth;
|
||||
let count = currWidth / 300;
|
||||
if (count > 6) {
|
||||
this.sliceNum = 6;
|
||||
} else {
|
||||
this.sliceNum = count;
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
$route(to) {
|
||||
this.$store.commit("setCurrentPageName", to.name);
|
||||
let pathArr = util.setCurrentPath(this, to.name);
|
||||
if (pathArr.length > 2) {
|
||||
this.$store.commit("addOpenSubmenu", pathArr[1].name);
|
||||
}
|
||||
this.checkTag(to.name);
|
||||
localStorage.currentPageName = to.name;
|
||||
},
|
||||
lang() {
|
||||
util.setCurrentPath(this, this.$route.name); // 在切换语言时用于刷新面包屑
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
let that = this;
|
||||
this.resize();
|
||||
window.addEventListener("resize", function () {
|
||||
that.resize();
|
||||
});
|
||||
},
|
||||
created() {
|
||||
// 显示打开的页面的列表
|
||||
this.$store.commit("setOpenedList");
|
||||
},
|
||||
};
|
||||
</script>
|
||||
19
seller/src/views/change-password/change-password.scss
Normal file
@@ -0,0 +1,19 @@
|
||||
.change-pass {
|
||||
&-btn-box {
|
||||
margin-bottom: 10px;
|
||||
|
||||
button {
|
||||
padding-left: 0;
|
||||
|
||||
span {
|
||||
color: #2D8CF0;
|
||||
transition: all .2s;
|
||||
}
|
||||
|
||||
span:hover {
|
||||
color: #0C25F1;
|
||||
transition: all .2s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||