first commit
18
.babelrc
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"modules": false,
|
||||
"targets": {
|
||||
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
|
||||
}
|
||||
}],
|
||||
"stage-2"
|
||||
],
|
||||
"plugins": ["transform-vue-jsx", "transform-runtime"],
|
||||
"env": {
|
||||
"test": {
|
||||
"presets": ["env", "stage-2"],
|
||||
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
|
||||
}
|
||||
}
|
||||
}
|
||||
9
.editorconfig
Normal file
@@ -0,0 +1,9 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
5
.eslintignore
Normal file
@@ -0,0 +1,5 @@
|
||||
/build/
|
||||
/config/
|
||||
/dist/
|
||||
/*.js
|
||||
/test/unit/coverage/
|
||||
31
.eslintrc.js
Normal file
@@ -0,0 +1,31 @@
|
||||
// https://eslint.org/docs/user-guide/configuring
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
parserOptions: {
|
||||
parser: 'babel-eslint'
|
||||
},
|
||||
|
||||
env: {
|
||||
browser: true,
|
||||
},
|
||||
extends: [
|
||||
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
|
||||
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
|
||||
'plugin:vue/essential',
|
||||
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
|
||||
'standard'
|
||||
],
|
||||
// required to lint *.vue files
|
||||
plugins: [
|
||||
'vue'
|
||||
],
|
||||
// add your custom rules here
|
||||
rules: {
|
||||
// allow async-await
|
||||
'generator-star-spacing': 'off',
|
||||
// allow debugger during development
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||
'semi': [0, 'never']
|
||||
}
|
||||
}
|
||||
18
.gitignore
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
/dist/
|
||||
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
|
||||
dist.zip
|
||||
7
.postcssrc.js
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
"plugins": {
|
||||
"postcss-import": {},
|
||||
"postcss-url": {},
|
||||
"autoprefixer": {}
|
||||
}
|
||||
}
|
||||
5
.prettierrc.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"semi": false,
|
||||
"trailingComma": "none"
|
||||
}
|
||||
90
README.md
Normal file
@@ -0,0 +1,90 @@
|
||||
# jxc4-backstage
|
||||
|
||||
> 京西菜市-后台管理系统
|
||||
|
||||
## Build Setup
|
||||
|
||||
``` bash
|
||||
# install dependencies
|
||||
npm install
|
||||
|
||||
# serve with hot reload at localhost:8080
|
||||
npm run dev
|
||||
|
||||
# build for production with minification
|
||||
npm run build
|
||||
|
||||
# build for production and view the bundle analyzer report
|
||||
npm run build --report
|
||||
|
||||
# run unit tests
|
||||
npm run unit
|
||||
|
||||
# run e2e tests
|
||||
npm run e2e
|
||||
|
||||
# run all tests
|
||||
npm test
|
||||
```
|
||||
|
||||
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
|
||||
|
||||
---
|
||||
|
||||
## 重要返回值
|
||||
|
||||
#### businessType
|
||||
值 | 状态
|
||||
:-:|:-:
|
||||
1|立即达
|
||||
2|定时达
|
||||
|
||||
#### status 订单状态
|
||||
值 | 状态
|
||||
:-:|:-:
|
||||
10|待拣货
|
||||
15|待配送
|
||||
20|配送中
|
||||
105|妥投(属于完成状态)
|
||||
110|完成
|
||||
115|已取消
|
||||
120|订单失败
|
||||
|
||||
#### vendorID 订单从哪来
|
||||
值|对应
|
||||
:-:|:-:
|
||||
0|京东到家
|
||||
1|美团
|
||||
2|e了么
|
||||
4|银豹
|
||||
11|微盟微商城
|
||||
14|抖店
|
||||
16|淘鲜达
|
||||
|
||||
|
||||
#### vendorOrderID 订单号(前端显示的订单号)
|
||||
|
||||
#### waybillStatus 运单状态
|
||||
值|运单状态
|
||||
:-:|:-:
|
||||
10|接单
|
||||
15|到店
|
||||
20|正在配送
|
||||
100|EndBegin
|
||||
105|已交付
|
||||
115|取消
|
||||
120|失败
|
||||
|
||||
#### waybillVendorID 哪个承运商在运
|
||||
值|承运商
|
||||
:-:|:-:
|
||||
-1|未安排(可以结合status判断是否是商家自送)
|
||||
0|达达专送(京东到家)
|
||||
1|美团专送
|
||||
2|e了么专送
|
||||
101|达达配送
|
||||
102|美团配送
|
||||
103|蜂鸟配送
|
||||
104|抖音配送
|
||||
105|uu配送
|
||||
106|顺丰配送
|
||||
34
build/build.js
Normal file
@@ -0,0 +1,34 @@
|
||||
'use strict'
|
||||
require('./check-versions')()
|
||||
|
||||
process.env.NODE_ENV = 'production'
|
||||
|
||||
const ora = require('ora')
|
||||
const rm = require('rimraf')
|
||||
const path = require('path')
|
||||
const chalk = require('chalk')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const webpackConfig = require('./webpack.prod.conf')
|
||||
|
||||
const spinner = ora('building for production...')
|
||||
spinner.start()
|
||||
|
||||
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
||||
if (err) throw err
|
||||
webpack(webpackConfig, (err, stats) => {
|
||||
spinner.stop()
|
||||
if (err) throw err
|
||||
process.stdout.write(stats.toString({
|
||||
colors: true,
|
||||
modules: false,
|
||||
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
|
||||
chunks: false,
|
||||
chunkModules: false
|
||||
}) + '\n\n')
|
||||
|
||||
if (stats.hasErrors()) {
|
||||
process.exit(1)
|
||||
}
|
||||
})
|
||||
})
|
||||
49
build/check-versions.js
Normal file
@@ -0,0 +1,49 @@
|
||||
'use strict'
|
||||
const chalk = require('chalk')
|
||||
const semver = require('semver')
|
||||
const packageConfig = require('../package.json')
|
||||
const shell = require('shelljs')
|
||||
|
||||
function exec (cmd) {
|
||||
return require('child_process').execSync(cmd).toString().trim()
|
||||
}
|
||||
|
||||
const versionRequirements = [
|
||||
{
|
||||
name: 'node',
|
||||
currentVersion: semver.clean(process.version),
|
||||
versionRequirement: packageConfig.engines.node
|
||||
}
|
||||
]
|
||||
|
||||
if (shell.which('npm')) {
|
||||
versionRequirements.push({
|
||||
name: 'npm',
|
||||
currentVersion: exec('npm --version'),
|
||||
versionRequirement: packageConfig.engines.npm
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = function () {
|
||||
const warnings = []
|
||||
|
||||
for (let i = 0; i < versionRequirements.length; i++) {
|
||||
const mod = versionRequirements[i]
|
||||
|
||||
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
|
||||
warnings.push(mod.name + ': ' +
|
||||
chalk.red(mod.currentVersion) + ' should be ' +
|
||||
chalk.green(mod.versionRequirement)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (warnings.length) {
|
||||
|
||||
for (let i = 0; i < warnings.length; i++) {
|
||||
const warning = warnings[i]
|
||||
}
|
||||
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
BIN
build/logo.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
101
build/utils.js
Normal file
@@ -0,0 +1,101 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const config = require('../config')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const packageConfig = require('../package.json')
|
||||
|
||||
exports.assetsPath = function (_path) {
|
||||
const assetsSubDirectory = process.env.NODE_ENV === 'production'
|
||||
? config.build.assetsSubDirectory
|
||||
: config.dev.assetsSubDirectory
|
||||
|
||||
return path.posix.join(assetsSubDirectory, _path)
|
||||
}
|
||||
|
||||
exports.cssLoaders = function (options) {
|
||||
options = options || {}
|
||||
|
||||
const cssLoader = {
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
sourceMap: options.sourceMap
|
||||
}
|
||||
}
|
||||
|
||||
const postcssLoader = {
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
sourceMap: options.sourceMap
|
||||
}
|
||||
}
|
||||
|
||||
// generate loader string to be used with extract text plugin
|
||||
function generateLoaders (loader, loaderOptions) {
|
||||
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
|
||||
|
||||
if (loader) {
|
||||
loaders.push({
|
||||
loader: loader + '-loader',
|
||||
options: Object.assign({}, loaderOptions, {
|
||||
sourceMap: options.sourceMap
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// Extract CSS when that option is specified
|
||||
// (which is the case during production build)
|
||||
if (options.extract) {
|
||||
return ExtractTextPlugin.extract({
|
||||
use: loaders,
|
||||
fallback: 'vue-style-loader'
|
||||
})
|
||||
} else {
|
||||
return ['vue-style-loader'].concat(loaders)
|
||||
}
|
||||
}
|
||||
|
||||
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
|
||||
return {
|
||||
css: generateLoaders(),
|
||||
postcss: generateLoaders(),
|
||||
less: generateLoaders('less'),
|
||||
sass: generateLoaders('sass', { indentedSyntax: true }),
|
||||
scss: generateLoaders('sass'),
|
||||
stylus: generateLoaders('stylus'),
|
||||
styl: generateLoaders('stylus')
|
||||
}
|
||||
}
|
||||
|
||||
// Generate loaders for standalone style files (outside of .vue)
|
||||
exports.styleLoaders = function (options) {
|
||||
const output = []
|
||||
const loaders = exports.cssLoaders(options)
|
||||
|
||||
for (const extension in loaders) {
|
||||
const loader = loaders[extension]
|
||||
output.push({
|
||||
test: new RegExp('\\.' + extension + '$'),
|
||||
use: loader
|
||||
})
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
exports.createNotifierCallback = () => {
|
||||
const notifier = require('node-notifier')
|
||||
|
||||
return (severity, errors) => {
|
||||
if (severity !== 'error') return
|
||||
|
||||
const error = errors[0]
|
||||
const filename = error.file && error.file.split('!').pop()
|
||||
|
||||
notifier.notify({
|
||||
title: packageConfig.name,
|
||||
message: severity + ': ' + error.name,
|
||||
subtitle: filename || '',
|
||||
icon: path.join(__dirname, 'logo.png')
|
||||
})
|
||||
}
|
||||
}
|
||||
22
build/vue-loader.conf.js
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const config = require('../config')
|
||||
const isProduction = process.env.NODE_ENV === 'production'
|
||||
const sourceMapEnabled = isProduction
|
||||
? config.build.productionSourceMap
|
||||
: config.dev.cssSourceMap
|
||||
|
||||
module.exports = {
|
||||
loaders: utils.cssLoaders({
|
||||
sourceMap: sourceMapEnabled,
|
||||
extract: isProduction
|
||||
}),
|
||||
cssSourceMap: sourceMapEnabled,
|
||||
cacheBusting: config.dev.cacheBusting,
|
||||
transformToRequire: {
|
||||
video: ['src', 'poster'],
|
||||
source: 'src',
|
||||
img: 'src',
|
||||
image: 'xlink:href'
|
||||
}
|
||||
}
|
||||
97
build/webpack.base.conf.js
Normal file
@@ -0,0 +1,97 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const config = require('../config')
|
||||
const vueLoaderConfig = require('./vue-loader.conf')
|
||||
|
||||
function resolve (dir) {
|
||||
return path.join(__dirname, '..', dir)
|
||||
}
|
||||
|
||||
// const createLintingRule = () => ({
|
||||
// test: /\.(js|vue)$/,
|
||||
// loader: 'eslint-loader',
|
||||
// enforce: 'pre',
|
||||
// include: [resolve('src'), resolve('test')],
|
||||
// options: {
|
||||
// formatter: require('eslint-friendly-formatter'),
|
||||
// emitWarning: !config.dev.showEslintErrorsInOverlay
|
||||
// }
|
||||
// })
|
||||
|
||||
module.exports = {
|
||||
context: path.resolve(__dirname, '../'),
|
||||
entry: {
|
||||
app: './src/main.js'
|
||||
},
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: '[name].js',
|
||||
publicPath: process.env.NODE_ENV === 'production'
|
||||
? config.build.assetsPublicPath
|
||||
: config.dev.assetsPublicPath
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.vue', '.json'],
|
||||
alias: {
|
||||
'vue$': 'vue/dist/vue.esm.js',
|
||||
'@': resolve('src'),
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
// true中的
|
||||
// ...(config.dev.useEslint ? [createLintingRule()] : []),
|
||||
{
|
||||
test: /\.vue$/,
|
||||
loader: 'vue-loader',
|
||||
options: vueLoaderConfig
|
||||
},
|
||||
{
|
||||
test: /\.(sass|scss)$/,
|
||||
loader: 'style-loader!css-loader!sass-loader!postcss-loader'
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader?cacheDirectory=true',
|
||||
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('img/[name].[hash:7].[ext]')
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('media/[name].[hash:7].[ext]')
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
node: {
|
||||
// prevent webpack from injecting useless setImmediate polyfill because Vue
|
||||
// source contains it (although only uses it if it's native).
|
||||
setImmediate: false,
|
||||
// prevent webpack from injecting mocks to Node native modules
|
||||
// that does not make sense for the client
|
||||
dgram: 'empty',
|
||||
fs: 'empty',
|
||||
net: 'empty',
|
||||
tls: 'empty',
|
||||
child_process: 'empty'
|
||||
}
|
||||
}
|
||||
105
build/webpack.dev.conf.js
Normal file
@@ -0,0 +1,105 @@
|
||||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const merge = require('webpack-merge')
|
||||
const path = require('path')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
|
||||
const portfinder = require('portfinder')
|
||||
const os = require('os')
|
||||
const HappyPack = require('happypack')
|
||||
// 手动创建进程池
|
||||
const happyThreadPool = HappyPack.ThreadPool({ size: os.cpus().length })
|
||||
|
||||
const HOST = process.env.HOST
|
||||
const PORT = process.env.PORT && Number(process.env.PORT)
|
||||
|
||||
const devWebpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
|
||||
},
|
||||
// cheap-module-eval-source-map is faster for development
|
||||
devtool: config.dev.devtool,
|
||||
|
||||
// these devServer options should be customized in /config/index.js
|
||||
devServer: {
|
||||
clientLogLevel: 'warning',
|
||||
historyApiFallback: {
|
||||
rewrites: [
|
||||
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
|
||||
],
|
||||
},
|
||||
hot: true,
|
||||
contentBase: false, // since we use CopyWebpackPlugin.
|
||||
compress: true,
|
||||
host: HOST || config.dev.host,
|
||||
port: PORT || config.dev.port,
|
||||
open: config.dev.autoOpenBrowser,
|
||||
overlay: config.dev.errorOverlay
|
||||
? { warnings: false, errors: true }
|
||||
: false,
|
||||
publicPath: config.dev.assetsPublicPath,
|
||||
proxy: config.dev.proxyTable,
|
||||
quiet: true, // necessary for FriendlyErrorsPlugin
|
||||
watchOptions: {
|
||||
poll: config.dev.poll,
|
||||
},
|
||||
disableHostCheck: true
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': require('../config/dev.env')
|
||||
}),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
// https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: 'index.html',
|
||||
inject: true
|
||||
}),
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.dev.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
}
|
||||
]),
|
||||
new HappyPack({
|
||||
id: 'happyBabel',
|
||||
threadPool: happyThreadPool,
|
||||
loaders: ['babel-loader?cacheDirectory', 'vue-loader', 'sass-loader', 'css-loader', 'postcss-loader']
|
||||
})
|
||||
]
|
||||
})
|
||||
|
||||
module.exports = new Promise((resolve, reject) => {
|
||||
portfinder.basePort = process.env.PORT || config.dev.port
|
||||
portfinder.getPort((err, port) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
// publish the new Port, necessary for e2e tests
|
||||
process.env.PORT = port
|
||||
// add port to devServer config
|
||||
devWebpackConfig.devServer.port = port
|
||||
|
||||
// Add FriendlyErrorsPlugin
|
||||
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
|
||||
compilationSuccessInfo: {
|
||||
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
|
||||
},
|
||||
onErrors: config.dev.notifyOnErrors
|
||||
? utils.createNotifierCallback()
|
||||
: undefined
|
||||
}))
|
||||
|
||||
resolve(devWebpackConfig)
|
||||
}
|
||||
})
|
||||
})
|
||||
167
build/webpack.prod.conf.js
Normal file
@@ -0,0 +1,167 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const merge = require('webpack-merge')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||
const os = require('os')
|
||||
const HappyPack = require('happypack')
|
||||
// 手动创建进程池
|
||||
const happyThreadPool = HappyPack.ThreadPool({ size: os.cpus().length })
|
||||
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
||||
|
||||
const env = process.env.NODE_ENV === 'testing'
|
||||
? require('../config/test.env')
|
||||
: require('../config/prod.env')
|
||||
|
||||
const webpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
extract: true,
|
||||
usePostCSS: true
|
||||
})
|
||||
},
|
||||
devtool: config.build.productionSourceMap ? config.build.devtool : false,
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: utils.assetsPath('js/[name].[chunkhash].js'),
|
||||
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
|
||||
},
|
||||
plugins: [
|
||||
// http://vuejs.github.io/vue-loader/en/workflow/production.html
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': env
|
||||
}),
|
||||
new UglifyJsPlugin({
|
||||
uglifyOptions: {
|
||||
// 允许并发
|
||||
parallel: true,
|
||||
// 开启缓存
|
||||
cache: true,
|
||||
compress: {
|
||||
reduce_vars: true,
|
||||
warnings: false
|
||||
}
|
||||
},
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
parallel: true
|
||||
}),
|
||||
// extract css into its own file
|
||||
new ExtractTextPlugin({
|
||||
filename: utils.assetsPath('css/[name].[contenthash].css'),
|
||||
// Setting the following option to `false` will not extract CSS from codesplit chunks.
|
||||
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
|
||||
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
|
||||
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
|
||||
allChunks: true,
|
||||
}),
|
||||
// Compress extracted CSS. We are using this plugin so that possible
|
||||
// duplicated CSS from different components can be deduped.
|
||||
new OptimizeCSSPlugin({
|
||||
cssProcessorOptions: config.build.productionSourceMap
|
||||
? { safe: true, map: { inline: false } }
|
||||
: { safe: true }
|
||||
}),
|
||||
// generate dist index.html with correct asset hash for caching.
|
||||
// you can customize output by editing /index.html
|
||||
// see https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: process.env.NODE_ENV === 'testing'
|
||||
? 'index.html'
|
||||
: config.build.index,
|
||||
template: 'index.html',
|
||||
inject: true,
|
||||
minify: {
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true
|
||||
// more options:
|
||||
// https://github.com/kangax/html-minifier#options-quick-reference
|
||||
},
|
||||
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
||||
chunksSortMode: 'dependency'
|
||||
}),
|
||||
// keep module.id stable when vendor modules does not change
|
||||
new webpack.HashedModuleIdsPlugin(),
|
||||
// enable scope hoisting
|
||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||
// split vendor js into its own file
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'vendor',
|
||||
minChunks (module) {
|
||||
// any required modules inside node_modules are extracted to vendor
|
||||
return (
|
||||
module.resource &&
|
||||
/\.js$/.test(module.resource) &&
|
||||
module.resource.indexOf(
|
||||
path.join(__dirname, '../node_modules')
|
||||
) === 0
|
||||
)
|
||||
}
|
||||
}),
|
||||
// extract webpack runtime and module manifest to its own file in order to
|
||||
// prevent vendor hash from being updated whenever app bundle is updated
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'manifest',
|
||||
minChunks: Infinity
|
||||
}),
|
||||
// This instance extracts shared chunks from code splitted chunks and bundles them
|
||||
// in a separate chunk, similar to the vendor chunk
|
||||
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'app',
|
||||
async: 'vendor-async',
|
||||
children: true,
|
||||
minChunks: 3
|
||||
}),
|
||||
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.build.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
}
|
||||
]),
|
||||
// 多进程
|
||||
new HappyPack({
|
||||
id: 'happyBabel',
|
||||
threadPool: happyThreadPool,
|
||||
loaders: ['babel-loader?cacheDirectory', 'vue-loader', 'sass-loader', 'css-loader', 'postcss-loader']
|
||||
}),
|
||||
// 文件结构可视化
|
||||
// new BundleAnalyzerPlugin()
|
||||
]
|
||||
})
|
||||
|
||||
if (config.build.productionGzip) {
|
||||
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
||||
|
||||
webpackConfig.plugins.push(
|
||||
new CompressionWebpackPlugin({
|
||||
asset: '[path].gz[query]',
|
||||
algorithm: 'gzip',
|
||||
test: new RegExp(
|
||||
'\\.(' +
|
||||
config.build.productionGzipExtensions.join('|') +
|
||||
')$'
|
||||
),
|
||||
threshold: 10240,
|
||||
minRatio: 0.8
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
if (config.build.bundleAnalyzerReport) {
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
||||
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
|
||||
}
|
||||
|
||||
module.exports = webpackConfig
|
||||
7
config/dev.env.js
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict'
|
||||
const merge = require('webpack-merge')
|
||||
const prodEnv = require('./prod.env')
|
||||
|
||||
module.exports = merge(prodEnv, {
|
||||
NODE_ENV: '"development"'
|
||||
})
|
||||
225
config/index.js
Normal file
@@ -0,0 +1,225 @@
|
||||
'use strict'
|
||||
// Template version: 1.3.1
|
||||
// see http://vuejs-templates.github.io/webpack for documentation.
|
||||
|
||||
const path = require('path')
|
||||
|
||||
module.exports = {
|
||||
dev: {
|
||||
// Paths
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: '/',
|
||||
proxyTable: {
|
||||
'/api/': {
|
||||
// 老接口
|
||||
target: 'http://www.jxc4.com/api',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/api/': '/', // 把 /api/ 替换成 / 然后把地址加载 target后面进行请求
|
||||
}
|
||||
},
|
||||
'/v3/': {
|
||||
// 后端本地调试接口
|
||||
target: 'http://192.168.0.63:8080/v2',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/v3/': '/', // 把 /v3/ 替换成 / 然后把地址加载 target后面进行请求
|
||||
}
|
||||
},
|
||||
'/mock/': {
|
||||
// 老接口
|
||||
target: 'https://easy-mock.com/mock/5b8cca6d9896546ad1f1c89a/mock',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/mock/': '/', // 把 /api/ 替换成 / 然后把地址加载 target后面进行请求
|
||||
}
|
||||
},
|
||||
'/v2/': {
|
||||
// 新接口
|
||||
// target: 'http://api.jxc4.com/v2',
|
||||
// target: 'http://alpha.jxc4.com/v2', // 对应真实数据,修改后不会向平台提交
|
||||
target: 'http://www.jxc4.com/beta/v2', // 正式环境
|
||||
// target: 'http://192.168.56.1:8080/', // 后端api
|
||||
// target: 'http://alpha3.jxc4.com/v2', // 对应京东,修改后会提交
|
||||
// target: 'http://www-gblm.jxc4.com/v2', // 百货 / 宠物
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/v2/': '/'
|
||||
}
|
||||
},
|
||||
'/c1/': { //冲天猴接口
|
||||
// 新接口
|
||||
// target: 'http://api.jxc4.com/v2',
|
||||
// target: 'http://alpha.jxc4.com/v2', // 对应真实数据,修改后不会向平台提交
|
||||
target: 'https://www.jxcs.net/v2', // 正式环境
|
||||
// target: 'http://alpha3.jxc4.com/v2', // 对应京东,修改后会提交
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/c1/': '/'
|
||||
}
|
||||
},
|
||||
'/v1/': {
|
||||
// 新接口
|
||||
// target: 'http://api.jxc4.com/v2',
|
||||
// target: 'http://alpha.jxc4.com/v2', // 对应真实数据,修改后不会向平台提交
|
||||
target: 'http://www.jxc4.com/v2', // 正式环境
|
||||
// target: 'http://192.168.56.1:8080', // 后端api
|
||||
// target: 'http://www-jxgy.jxc4.com/v2', // 京西果园
|
||||
// target: 'http://www-gblm.jxc4.com/v2', // 百货 / 宠物
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/v1/': '/'
|
||||
}
|
||||
},
|
||||
'/jd/': {
|
||||
// 新接口
|
||||
target: 'https://daojia.jd.com',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/jd/': '/'
|
||||
}
|
||||
},
|
||||
'/jd2/': {
|
||||
// 新接口
|
||||
target: 'http://store.jd.com',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/jd2/': '/'
|
||||
}
|
||||
},
|
||||
'/sta-store.jddj.com/': {
|
||||
// 新接口
|
||||
target: 'https://sta-store.jddj.com',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/sta-store.jddj.com/': '/'
|
||||
}
|
||||
},
|
||||
'/ebaiapi/': {
|
||||
// 新接口
|
||||
target: 'https://be.ele.me',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/ebaiapi/': '/'
|
||||
}
|
||||
},
|
||||
'/opendjapi/': {
|
||||
// 新接口
|
||||
target: 'https://opendj.jd.com',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/opendjapi/': '/'
|
||||
}
|
||||
},
|
||||
'/openjddjapi/': {
|
||||
// 新接口
|
||||
target: 'https://openapi.jddj.com',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/openjddjapi/': '/'
|
||||
}
|
||||
},
|
||||
'/test/': {
|
||||
// 新接口
|
||||
target: 'https://dfsc.imdada.cn',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/test/': '/'
|
||||
}
|
||||
},
|
||||
'/mtTest/': {
|
||||
// 新接口
|
||||
target: 'http://i.waimai.meituan.com',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/mtTest/': '/'
|
||||
}
|
||||
},
|
||||
'/mtwm/': {
|
||||
// 新接口
|
||||
target: 'https://waimaieapp.meituan.com',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/mtwm/': '/'
|
||||
}
|
||||
},
|
||||
'/mtwm2/': {
|
||||
// 新接口
|
||||
target: 'http://e.waimai.meituan.com',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/mtwm2/': '/'
|
||||
}
|
||||
},
|
||||
'/elem/': {
|
||||
// 新接口
|
||||
target: 'https://h5.ele.me/restapi/shopping/v3',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/elem/': '/'
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
// Various Dev Server settings
|
||||
host: 'localhost', // can be overwritten by process.env.HOST
|
||||
port: 8085, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||
autoOpenBrowser: false,
|
||||
errorOverlay: true,
|
||||
notifyOnErrors: true,
|
||||
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
|
||||
|
||||
// Use Eslint Loader?
|
||||
// If true, your code will be linted during bundling and
|
||||
// linting errors and warnings will be shown in the console.
|
||||
useEslint: true,
|
||||
// If true, eslint errors and warnings will also be shown in the error overlay
|
||||
// in the browser.
|
||||
showEslintErrorsInOverlay: false,
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
// https://webpack.js.org/configuration/devtool/#development
|
||||
devtool: 'cheap-module-eval-source-map',
|
||||
|
||||
// If you have problems debugging vue-files in devtools,
|
||||
// set this to false - it *may* help
|
||||
// https://vue-loader.vuejs.org/en/options.html#cachebusting
|
||||
cacheBusting: true,
|
||||
|
||||
cssSourceMap: true
|
||||
},
|
||||
|
||||
build: {
|
||||
// Template for index.html
|
||||
index: path.resolve(__dirname, '../dist/alpha/index.html'),
|
||||
|
||||
// Paths
|
||||
assetsRoot: path.resolve(__dirname, '../dist/alpha'),
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: '', //相对路径
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
productionSourceMap: true,
|
||||
// https://webpack.js.org/configuration/devtool/#production
|
||||
devtool: '#source-map',
|
||||
|
||||
// Gzip off by default as many popular static hosts such as
|
||||
// Surge or Netlify already gzip all static assets for you.
|
||||
// Before setting to `true`, make sure to:
|
||||
// npm install --save-dev compression-webpack-plugin
|
||||
productionGzip: false,
|
||||
productionGzipExtensions: ['js', 'css'],
|
||||
|
||||
// Run the build command with an extra argument to
|
||||
// View the bundle analyzer report after build finishes:
|
||||
// `npm run build --report`
|
||||
// Set to `true` or `false` to always turn it on or off
|
||||
bundleAnalyzerReport: process.env.npm_config_report
|
||||
}
|
||||
}
|
||||
4
config/prod.env.js
Normal file
@@ -0,0 +1,4 @@
|
||||
'use strict'
|
||||
module.exports = {
|
||||
NODE_ENV: '"production"'
|
||||
}
|
||||
7
config/test.env.js
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict'
|
||||
const merge = require('webpack-merge')
|
||||
const devEnv = require('./dev.env')
|
||||
|
||||
module.exports = merge(devEnv, {
|
||||
NODE_ENV: '"testing"'
|
||||
})
|
||||
52
index.html
Normal file
@@ -0,0 +1,52 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="shortcut icon" type="image/x-icon" href="">
|
||||
<!-- 自动将HTTP请求升级成安全的HTTPS请求。 -->
|
||||
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
|
||||
<title>京西菜市-管理平台</title>
|
||||
<style>
|
||||
.yz-loading {
|
||||
width: 140px;
|
||||
height: 140px;
|
||||
border: 16px solid rgb(223, 223, 223);
|
||||
border-radius: 50%;
|
||||
border-top-color: lightgreen;
|
||||
animation: rot .5s ease-in-out infinite;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
margin-left: -70px;
|
||||
margin-top: -70px;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.yz-mask {
|
||||
position: fixed;
|
||||
z-index: 9998;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: white;
|
||||
}
|
||||
|
||||
@keyframes rot {
|
||||
from {
|
||||
transform: rotateZ(0)
|
||||
}
|
||||
|
||||
to {
|
||||
transform: rotateZ(360deg)
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
14
jsconfig.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES6",
|
||||
"module": "commonjs",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
}
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
513
log_update.json
Normal file
@@ -0,0 +1,513 @@
|
||||
[
|
||||
{
|
||||
"time": "2019-04-24",
|
||||
"content": [
|
||||
{
|
||||
"title": "订单增加了几种新状态",
|
||||
"content": [
|
||||
"取货失败待审核",
|
||||
"取货失败待",
|
||||
"投递失败"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-04-19",
|
||||
"content": [
|
||||
{
|
||||
"title": "门店商品管理下架sku标红",
|
||||
"content": [
|
||||
"京西商品库已下架sku,如果门店商品还是可售的,会标红商品名以及相应的sku价格和规格"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "订单妥投状态已移入已完成",
|
||||
"content": [
|
||||
"妥投不再作为订单查询的筛选条件"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "添加测试打印按钮",
|
||||
"content": [
|
||||
"在编辑门店信息时如果绑定了打印机提供测试打印按钮",
|
||||
"测试打印按钮只有在绑定打印机成功后才会出现"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-04-18",
|
||||
"content": [
|
||||
{
|
||||
"title": "营业时间段2支持",
|
||||
"content": [
|
||||
"检索门店、创建门店、编辑门店支持营业时间段2的编辑"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "添加测试打印按钮",
|
||||
"content": [
|
||||
"在编辑门店信息时如果绑定了打印机提供测试打印按钮",
|
||||
"测试打印按钮只有在绑定打印机成功后才会出现"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-04-17",
|
||||
"content": [
|
||||
{
|
||||
"title": "门店商品管理支持多个门店选择",
|
||||
"content": [
|
||||
"选择门店大于1,需要自己点击查询按钮",
|
||||
"选择门店大于1,只提供单商品操作",
|
||||
"选择门店大于1,不提供销量查询功能",
|
||||
"选择门店大于1,请谨慎使用导出excel功能(时间可能会很长)",
|
||||
"选择门店大于1,必须填入skuIDs或者skuNameIDs进行查找"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-04-12",
|
||||
"content": [
|
||||
{
|
||||
"title": "单门店平台(比如饿百,美团外卖)同步门店商品",
|
||||
"content": [
|
||||
"单门店平台(比如饿百,美团外卖)同步门店商品时,只同步SKUNAME和SKU可售的。这样可减少同步量。不过这样一来京西这边门店商品信息与平台那边就可能不太一致了哈,大家注意一下"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-04-11",
|
||||
"content": [
|
||||
{
|
||||
"title": "支持门店绑定网络打印机",
|
||||
"content": [
|
||||
"在创建门店、编辑门店中进行设置,设置先选择打印机品牌,再填写信息",
|
||||
"目前支持三种网络打印机:飞鹅、外卖管家、易迅云",
|
||||
"连接wifi时,请选择 2.4GWIFI, 不要选择 5GWIFI"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-03-28",
|
||||
"content": [
|
||||
{
|
||||
"title": "支持新账号密码登录",
|
||||
"content": [
|
||||
"已经钉钉扫码登录的小伙伴,可以点击右上角名字菜单内-【修改密码】,进行密码的初始化或者修改,设置密码后即可使用账号密码方式登录,用户名为绑定钉钉时输入的用户名,也可选择手机号登录"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-03-26",
|
||||
"content": [
|
||||
{
|
||||
"title": "京西门店商品逻辑改动",
|
||||
"content": [
|
||||
"只有基础SKUNAME和SKU为可售状态的商品才会返回"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "订单管理增加 【更多操作】-【停止运单调度】 功能",
|
||||
"content": [
|
||||
"该功能将取消三方运单,并且不会再自动重新召唤三方配送"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "订单管理增加 【更多操作】-【转门店自配送】 功能",
|
||||
"content": [
|
||||
"该功能将配送方式转为纯门店自送,不召唤其他配送"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-03-22",
|
||||
"content": [
|
||||
{
|
||||
"title": "新功能异步任务完成钉钉消息通知",
|
||||
"content": [
|
||||
"异步任务完成在钉钉有消息通知(在钉钉的工作通知中),这个必须要绑定了钉钉的才有,版本刚上线有问题反馈"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-03-11",
|
||||
"content": [
|
||||
{
|
||||
"title": "增加钉钉扫码登录的方式",
|
||||
"content": [
|
||||
"需要先在 【钉钉App】-【工作】-【其他应用】-【京西菜市管理后台】 中先进行钉钉与京西的绑定才可进行钉钉扫码登录"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-03-08",
|
||||
"content": [
|
||||
{
|
||||
"title": "饿百错误信息提示优化",
|
||||
"content": [
|
||||
"饿百错误信息添加门店与商品信息"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "商品管理-门店商品管理",
|
||||
"content": [
|
||||
"门店商品管理-查询功能,增加按sku查询的功能(只读)"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-03-07",
|
||||
"content": [
|
||||
{
|
||||
"title": "商品管理-京西商品管理",
|
||||
"content": [
|
||||
"商品管理-查询功能,增加按sku查询的功能(只读)"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-03-06",
|
||||
"content": [
|
||||
{
|
||||
"title": "门店管理-京西门店管理",
|
||||
"content": [
|
||||
"创建/修改门店页面,配送范围修改,在范围规划模式下,增加一键画圆的功能"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "系统管理-任务查询",
|
||||
"content": [
|
||||
"任务查询支持通过创建人查询,输入创建人,则只导出指定条件下由该创建人创建的任务"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-02-27",
|
||||
"content": [
|
||||
{
|
||||
"title": "商品管理-创建/修改商品",
|
||||
"content": [
|
||||
"创建/修改商品页面,上传/修改的图片尺寸必须为800*800"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-02-22",
|
||||
"content": [
|
||||
{
|
||||
"title": "订单管理-取消三方运单",
|
||||
"content": [
|
||||
"订单管理页面提供取消三方运单操作,此操作会取消当前所有的三方运单,会自己再次调度(在操作->更多操作里面,点击可以显示/隐藏,另手动召唤配送功能也一起收入更多操作中)"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-02-21",
|
||||
"content": [
|
||||
{
|
||||
"title": "订单管理-差评管理",
|
||||
"content": [
|
||||
"差评管理页面支持城市选择,如未选择门店,拉取指定城市所有门店数据,城市不限为全国"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-02-20",
|
||||
"content": [
|
||||
{
|
||||
"title": "订单管理-差评管理",
|
||||
"content": [
|
||||
"订单管理新增差评管理功能,支持查询/导出指定门店差评"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-02-19",
|
||||
"content": [
|
||||
{
|
||||
"title": "京西门店管理-创建门店",
|
||||
"content": [
|
||||
"创建门店页面加入地图编辑相应功能"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "门店创建回档",
|
||||
"content": [
|
||||
"由于门店创建和门店修改页面合并,产生了一系列问题,现在将门店创建页面回档,门店创建页面暂时不支持地图操作,可以通过创建后修改的方式进行作业,相关功能后续优化"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-02-18",
|
||||
"content": [
|
||||
{
|
||||
"title": "订单管理",
|
||||
"content": [
|
||||
"合并京东到家全国账号所有订单至后台,合并饿了么所有订单至后台,由于一些数据丢失,部分订单的运单信息不全"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-02-15",
|
||||
"content": [
|
||||
{
|
||||
"title": "订单管理",
|
||||
"content": [
|
||||
"订单列表/订单详情,平台归属饿百的订单支持真实号查询,如订单创建时间距离当前时间较近(4小时以内),会导致获取到的真实号与临时号相同,另新创建未接单的订单取不到真实号"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "临时功能",
|
||||
"content": [
|
||||
"提供将京东为SPU的商品转换为非SPU的临时功能"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "商品管理-京西商品管理",
|
||||
"content": [
|
||||
"商品列表查询条件,支持选择多规格:不限制/是/否",
|
||||
"创建商品:商品重量自动填写,不可以手动输入,商品规格不为份的也可以选择是否为多规格商品(默认为否)"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-02-14",
|
||||
"content": [
|
||||
{
|
||||
"title": "订单管理-手动召唤配送",
|
||||
"content": [
|
||||
"强制召唤配送改为手动召唤配送,点击可选普通召唤/强制召唤,普通召唤订单是结束状态后不能召唤,强制召唤完全不判断订单状态(需要二次确认)"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-02-13",
|
||||
"content": [
|
||||
{
|
||||
"title": "营销活动-促销活动管理",
|
||||
"content": [
|
||||
"拉取时间参数变更,默认拉取60天内创建的活动"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "任务查询",
|
||||
"content": [
|
||||
"任务查询页面进行分页操作,提升页面单次渲染速度"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-01-29",
|
||||
"content": [
|
||||
{
|
||||
"title": "京西商品管理-创建/修改商品",
|
||||
"content": [
|
||||
"所在城市支持选择全国-全国在城市选项最下方"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-01-28",
|
||||
"content": [
|
||||
{
|
||||
"title": "订单管理",
|
||||
"content": [
|
||||
"订单号查询,当订单号输入框含有数据时,查询会忽略其他条件"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "门店账单推送",
|
||||
"content": [
|
||||
"门店账单推送必须选择菜市名称"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "门店管理-地址及配送范围",
|
||||
"content": [
|
||||
"以门店为圆心,显示1-2-3-4-5km距离辅助线"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-01-26",
|
||||
"content": [
|
||||
{
|
||||
"title": "滚动条优化",
|
||||
"content": [
|
||||
"在含有列表显示框的页面,优化滚动条显示效果"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "平台同步标志显示",
|
||||
"content": [
|
||||
"在京东商品管理,门店商品管理页面,针对skusName以及单条sku的平台同步状态作显示(O--正常,D--待删除,N--待创建,M--已修改)"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-01-24",
|
||||
"content": [
|
||||
{
|
||||
"title": "订单管理",
|
||||
"content": [
|
||||
"将更多条件中的门店选择放置到了最外层(其它条件不变)",
|
||||
"导出订单时,保存真实号信息"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "门店商品管理",
|
||||
"content": [
|
||||
"将skuIDs与skuNameIDs条件直接放置在了最外层"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "门店账单推送",
|
||||
"content": [
|
||||
"《门店账单推送》界面新增标题输入框(必须有值)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "门店管理",
|
||||
"content": [
|
||||
"门店管理-创建门店/修改门店效果统一,都可以通过地图进行编辑"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "京西商品管理",
|
||||
"content": [
|
||||
"修改商品界面取消SKU的保存按钮,统一在最下方进行保存"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "系统平台变更",
|
||||
"content": [
|
||||
"将京西系统中饿了么平台删除,添加微盟微商城"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "任务查询",
|
||||
"content": [
|
||||
"任务查询-错误详情显示,增加显示错误详情按钮,点击即可查看错误详情"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "最后操作和操作时间展示",
|
||||
"content": [
|
||||
"会将相关信息的最后操作者和操作时间展示到页面上,包括但不局限于商品、商家商品、门店、门店绑定"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-01-17",
|
||||
"content": [
|
||||
{
|
||||
"title": "商品管理",
|
||||
"content": [
|
||||
"初始化商品,从京西商品管理-初始化商品,单独提取到左侧菜单栏,使用方法不变",
|
||||
"删除远程门店商品-删除门店平台商品信息(包括分类)(!!!此操作会先清除平台上已有的商品及分类信息),此操作只适用于单门店模式平台",
|
||||
"以上均为敏感操作,已作标红处理"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "门店管理-京西门店管理",
|
||||
"content": [
|
||||
"门店状态显示,营业中-绿色,休息-红色,禁用-灰色,地图模式一致",
|
||||
"地图模式-显示店铺详情,地图模式下在地图位置指示标识上悬停1秒,可以查看店铺详情"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "列表批量操作",
|
||||
"content": [
|
||||
"京西门店管理、京西商品管理、促销活动管理,均支持批量删除",
|
||||
"订单管理页面预留多选功能,暂不支持任何批量操作"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "京西门店管理-修改门店",
|
||||
"content": [
|
||||
"门店地址修改,支持通过搜索框搜索选定所在城市的地址,二次确认后门店地址会自动补充选择地址的详细地址,可以根据需要修改",
|
||||
"创建门店暂不支持以上功能,可以先创建后再修改"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-01-12",
|
||||
"content": [
|
||||
{
|
||||
"title": "京西商品管理-SPU设置",
|
||||
"content": [
|
||||
"创建/修改商品,所有规格,是否为多规格商品,均已页面自动默认为“是”,不再显示或提供选择"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "订单管理-订单列表",
|
||||
"content": [
|
||||
"订单列表-客户信息,新增真实号,如没有真实号码,可点击搜索按钮查找(仅支持京东到家订单)",
|
||||
"订单详情-客户信息,新增真实号,如没有真实号码,可点击搜索按钮查找(仅支持京东到家订单)",
|
||||
"火狐浏览器取号失败已优化,当前可以使用火狐浏览器取号"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-01-11",
|
||||
"content": [
|
||||
{
|
||||
"title": "临时功能-将被转化的老SKU在门店下架",
|
||||
"content": [
|
||||
"暂时屏蔽该功能"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "门店管理-京西门店管理",
|
||||
"content": [
|
||||
"京西门店管理-地图模式,新增地图模式,使用方法等同于列表模式,点击“地图查询”即可进入地图模式(地图模式会一次性拉取并显示所有符合条件的店铺,而不是分页显示,如果拉取条件为全国,可能略慢)",
|
||||
"地图模式-屏蔽配送范围,地图模式下独有的屏蔽配送范围开关,点击可以开启/关闭店铺配送范围显示",
|
||||
"地图模式-店铺选取,当鼠标移入代表该店铺的中心指示标识时,选中店铺会显示高亮,指示标识右下方会提示“双击进入”,双击指示标识,即可进入选中店铺详情页",
|
||||
"店铺详情-地址及配送范围,配送范围支持地图修改,选择“范围规划”,若店铺原本配送范围为范围规划,显示原本多边形,否则显示一个以店铺为中心的三角形(顶点距离店铺均为3km),选择“半径服务”,若店铺原本配送范围为半径服务,显示一个以店铺为圆心,半径为原本半径的圆,否则默认半径3km",
|
||||
"配送范围-规划范围修改,配送范围由多个实点之间连线构成,直接拉取实点,可以改变实点坐标,从而改变配送范围,两个连接的实点中肯定存在一个虚点,虚点点击一次即可转化为实点(不可直接拉拽虚点,拉拽虚点会生成一个实点,但是会被判定为拉拽地图,需要在地图任意位置拉拽一次才能返回编辑范围模式),双击实点即可消除一个实点",
|
||||
"配送范围-服务半径修改,配送范围是一个以店铺为圆心的圆,通过拉拽半径上的实点,或者直接输入半径,可以改变配送范围(暂时不允许拉拽圆心,拉拽圆心之后需要在地图任意位置拉拽一次才能返回编辑范围模式)",
|
||||
"配送范围-退出地图编辑模式,点击店铺所在的指示标识,即可开启/退出编辑模式(拉拽虚点/圆心后需要在地图任意位置拉拽一次才能使用该功能)"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"time": "2019-01-10",
|
||||
"content": [
|
||||
{
|
||||
"title": "京西商品管理-商品SKU",
|
||||
"content": [
|
||||
"sku条数限制,从原本的限制最多五条,更改为限制最多十条"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
19739
package-lock.json
generated
Normal file
116
package.json
Normal file
@@ -0,0 +1,116 @@
|
||||
{
|
||||
"name": "jxc4-backstage",
|
||||
"version": "1.0.0",
|
||||
"description": "京西菜市-后台管理系统",
|
||||
"author": "13684045763 <315862477@qq.com>",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
|
||||
"start": "npm run dev",
|
||||
"unit": "jest --config test/unit/jest.conf.js --coverage",
|
||||
"e2e": "node test/e2e/runner.js",
|
||||
"test": "npm run unit && npm run e2e",
|
||||
"lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
|
||||
"build": "npm run clean && node build/build.js",
|
||||
"clean": "rimraf dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.18.0",
|
||||
"compressorjs": "^1.2.1",
|
||||
"crypto-js": "^4.2.0",
|
||||
"echarts": "^4.9.0",
|
||||
"element-ui": "~2.4.6",
|
||||
"file-saver": "^2.0.0-rc.3",
|
||||
"moment": "2.22.2",
|
||||
"normalize.css": "^8.0.0",
|
||||
"qrcode": "^1.3.3",
|
||||
"qrcodejs2": "^0.0.2",
|
||||
"qs": "^6.9.4",
|
||||
"showdown": "^1.9.1",
|
||||
"sortablejs": "^1.15.6",
|
||||
"spark-md5": "^3.0.0",
|
||||
"vue": "^2.6.10",
|
||||
"vue-amap": "^0.5.8",
|
||||
"vue-qriously": "^1.1.1",
|
||||
"vue-router": "^3.0.1",
|
||||
"vue-svg-icon": "^1.2.9",
|
||||
"vue-ueditor-wrap": "^2.5.6",
|
||||
"vuedraggable": "^2.23.0",
|
||||
"vuex": "^3.0.1",
|
||||
"xlsx": "^0.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^7.1.2",
|
||||
"babel-core": "^6.22.1",
|
||||
"babel-eslint": "^8.2.1",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||
"babel-jest": "^21.0.2",
|
||||
"babel-loader": "^7.1.1",
|
||||
"babel-plugin-component": "^1.1.1",
|
||||
"babel-plugin-dynamic-import-node": "^1.2.0",
|
||||
"babel-plugin-syntax-jsx": "^6.18.0",
|
||||
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
|
||||
"babel-plugin-transform-runtime": "^6.22.0",
|
||||
"babel-plugin-transform-vue-jsx": "^3.5.0",
|
||||
"babel-preset-env": "^1.3.2",
|
||||
"babel-preset-stage-2": "^6.22.0",
|
||||
"babel-register": "^6.22.0",
|
||||
"chalk": "^2.0.1",
|
||||
"chromedriver": "^2.27.2",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"cross-spawn": "^5.0.1",
|
||||
"css-loader": "^0.28.0",
|
||||
"eslint": "^4.15.0",
|
||||
"eslint-config-standard": "^10.2.1",
|
||||
"eslint-friendly-formatter": "^3.0.0",
|
||||
"eslint-loader": "^1.7.1",
|
||||
"eslint-plugin-import": "^2.7.0",
|
||||
"eslint-plugin-node": "^5.2.0",
|
||||
"eslint-plugin-promise": "^3.4.0",
|
||||
"eslint-plugin-standard": "^3.0.1",
|
||||
"eslint-plugin-vue": "^4.0.0",
|
||||
"extract-text-webpack-plugin": "^3.0.0",
|
||||
"file-loader": "^1.1.4",
|
||||
"friendly-errors-webpack-plugin": "^1.6.1",
|
||||
"happypack": "^5.0.1",
|
||||
"html-webpack-plugin": "^2.30.1",
|
||||
"jest": "^22.0.4",
|
||||
"jest-serializer-vue": "^0.3.0",
|
||||
"less": "^3.8.1",
|
||||
"less-loader": "^4.1.0",
|
||||
"nightwatch": "^0.9.12",
|
||||
"node-notifier": "^5.1.2",
|
||||
"node-sass": "^4.9.3",
|
||||
"optimize-css-assets-webpack-plugin": "^3.2.0",
|
||||
"ora": "^1.2.0",
|
||||
"portfinder": "^1.0.13",
|
||||
"postcss-import": "^11.0.0",
|
||||
"postcss-loader": "^2.0.8",
|
||||
"postcss-url": "^7.2.1",
|
||||
"rimraf": "^2.6.2",
|
||||
"sass": "^1.13.1",
|
||||
"sass-loader": "^7.1.0",
|
||||
"selenium-server": "^3.0.1",
|
||||
"semver": "^5.3.0",
|
||||
"shelljs": "^0.7.6",
|
||||
"uglifyjs-webpack-plugin": "^1.1.1",
|
||||
"url-loader": "^0.5.8",
|
||||
"vue-jest": "^1.0.2",
|
||||
"vue-loader": "^13.3.0",
|
||||
"vue-style-loader": "^3.0.1",
|
||||
"vue-template-compiler": "^2.5.2",
|
||||
"webpack": "^3.6.0",
|
||||
"webpack-bundle-analyzer": "^2.13.1",
|
||||
"webpack-dev-server": "^2.9.1",
|
||||
"webpack-merge": "^4.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.0.0",
|
||||
"npm": ">= 3.0.0"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not ie <= 8"
|
||||
]
|
||||
}
|
||||
43
root.json
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"yunyingMap": {
|
||||
"18048531223": "ʯ<><CAAF>",
|
||||
"13684045763": "<22><><EFBFBD><EFBFBD>",
|
||||
"18160030913": "<22><><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"19136159097": "<22><>ܰ",
|
||||
"18982250714": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"18780171617": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"15708459454": "Ф<><D0A4>",
|
||||
"18383211225": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"17338665724": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"19982595610": "<22><><EFBFBD><EFBFBD>",
|
||||
"18080119588": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"13608076295": "<22>ż<EFBFBD><C5BC><EFBFBD>",
|
||||
"13708196093": "<22><><EFBFBD>Ӻ<EFBFBD>",
|
||||
"15208271238": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"17380734342": "<22><><EFBFBD><EFBFBD>",
|
||||
"18328080405": "Ф<><D0A4><EFBFBD><EFBFBD>",
|
||||
"18782186576": "<22><><EFBFBD>",
|
||||
"18583684218": "<22><>С<EFBFBD><D0A1>",
|
||||
"15983243001": "<22><EFBFBD><EEBAA3>",
|
||||
"18282536808": "<22><><EFBFBD><EFBFBD>",
|
||||
"18280930035": "<22>ܿ<EFBFBD>Ӱ",
|
||||
"18252169947": "<22><><EFBFBD><EFBFBD>Ƽ",
|
||||
"18630465684": "<22><><EFBFBD>",
|
||||
"15620911796": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"13198121812": "<22><><EFBFBD><EFBFBD>",
|
||||
"15892879280": "<22><><EFBFBD>˷<EFBFBD>",
|
||||
"18160011502": "<22><><EFBFBD><EFBFBD>ٻ",
|
||||
"18781962924": "<22>",
|
||||
"15928865396": "<22>μ<EFBFBD><CEBC><EFBFBD>",
|
||||
"13350726500": "̷<><CCB7><EFBFBD><EFBFBD>",
|
||||
"15520828601": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"18280085346": "֣<><D6A3><EFBFBD><EFBFBD>",
|
||||
"18980410281":"万世雄"
|
||||
},
|
||||
memberMap: {
|
||||
"15123535138": "13206278888",
|
||||
"̷Ƽ": "<22><><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"13541860634": "13752897800",
|
||||
"÷<><C3B7>": "<22>Ž<EFBFBD>ƽ"
|
||||
}
|
||||
}
|
||||
80
src/App.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<div id="app" v-if="appShow">
|
||||
<router-view />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCookie } from '@/tools'
|
||||
import { Hotupdate, updateTip, needUpdate } from '@/utils/updeteServe.js'
|
||||
export default {
|
||||
name: 'App',
|
||||
data() {
|
||||
return {
|
||||
appShow: false,
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// // 跟新系统
|
||||
// updateServe() {
|
||||
// // this.$store.commit('setUpdateServe', false)
|
||||
// // location.reload()
|
||||
// },
|
||||
|
||||
// nowUpdateServe() {
|
||||
// // this.$store.commit('setUpdateServe', false)
|
||||
// },
|
||||
},
|
||||
|
||||
async created() {
|
||||
Hotupdate(this)
|
||||
if (getCookie('Token')) {
|
||||
await this.$store.dispatch('GetUserInfo')
|
||||
}
|
||||
|
||||
if(this.$store.getters['jxStorePick/allCity'].length === 0) this.$store.dispatch('jxStorePick/getCity') // 获取城市信息
|
||||
this.appShow = true
|
||||
let loading = document.querySelector('.yz-loading')
|
||||
let mask = document.querySelector('.yz-mask')
|
||||
if (loading) {
|
||||
setTimeout(() => {
|
||||
loading.style.display = 'none'
|
||||
mask.style.display = 'none'
|
||||
}, 200)
|
||||
}
|
||||
// 判断页面是否进入后台
|
||||
document.addEventListener('visibilitychange', async () => {
|
||||
if (document.hidden === false) {
|
||||
const willupdate = await needUpdate()
|
||||
if (willupdate) {
|
||||
updateTip(this)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './assets/scss/global.scss';
|
||||
kbd {
|
||||
align-items: center;
|
||||
background: linear-gradient(-225deg, #d5dbe4, #f8f8f8);
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 -2px 0 0 #cdcde6, inset 0 0 1px 1px #fff,
|
||||
0 1px 2px 1px rgba(30, 35, 90, 0.4);
|
||||
display: flex;
|
||||
height: 18px;
|
||||
justify-content: center;
|
||||
margin-right: 0.5em;
|
||||
margin-left: 0.5em;
|
||||
padding: 0 0 1px;
|
||||
border: 0;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.ctrl {
|
||||
width: 36px;
|
||||
}
|
||||
</style>
|
||||
52
src/apis/APIAuth.js
Normal file
@@ -0,0 +1,52 @@
|
||||
/* eslint-disable */
|
||||
import api from '@/utils/api.js'
|
||||
|
||||
/*
|
||||
用户注册
|
||||
/user2/RegisterUser post(formData)
|
||||
*payload json数据,User对象(手机号必填)
|
||||
*mobileVerifyCode 手机验证码(通过auth2.SendVerifyCode获得)
|
||||
authToken 之前通过login得到的认证TOKEN(可以为空)
|
||||
|
||||
----payload
|
||||
UserID2 str 用户名(英文数字下划线)
|
||||
Name str 昵称
|
||||
Mobile str 手机号
|
||||
Email string `orm:"size(32)" json:"email"`
|
||||
IDCardNo string `orm:"size(18);column(id_card_no)" json:"idCardNo"` // 身份证号
|
||||
*/
|
||||
export const APIRegisterUser = async (string, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/user2/RegisterUser', {
|
||||
method: 'POST',
|
||||
data: string,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('RegisterUser', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
发送验证码
|
||||
/auth2/SendVerifyCode post
|
||||
captchaID str 图片验证码ID
|
||||
captchaValue str 图片验证码值
|
||||
authToken str 之前的认证token
|
||||
*authID str 手机号或邮件
|
||||
*/
|
||||
export const APISendVerifyCode = async (string, noLoading = true) => {
|
||||
try {
|
||||
let res = api('v2/auth2/SendVerifyCode', {
|
||||
method: 'POST',
|
||||
data: string,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('/auth2/SendVerifyCode', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
84
src/apis/APIBrand.js
Normal file
@@ -0,0 +1,84 @@
|
||||
import api from '@/utils/api.js'
|
||||
export const APIGetBrandSecretNumbers = async (string, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/store/GetBrandSecretNumbers', {
|
||||
method: 'GET',
|
||||
params: string,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('RegisterUser', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const APIGetSecretNumberBind = async (string, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/store/GetSecretNumberBind', {
|
||||
method: 'GET',
|
||||
params: string,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('RegisterUser', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const APIDelSecretBind = async (string, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/store/DelSecretBind', {
|
||||
method: 'POST',
|
||||
data: string,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('RegisterUser', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const APIUpdateSecretBind = async (string, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/store/UpdateSecretBind', {
|
||||
method: 'POST',
|
||||
data: string,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('RegisterUser', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const APIBindSecretNumber = async (string, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/store/BindSecretNumber', {
|
||||
method: 'POST',
|
||||
data: string,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('RegisterUser', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const APIBuySecretNo = async (string, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/store/BuySecretNo', {
|
||||
method: 'POST',
|
||||
data: string,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('RegisterUser', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
0
src/apis/APICat.js
Normal file
33
src/apis/APIConfig.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import api from '@/utils/api.js'
|
||||
import { mkUrl } from "@/utils/api";
|
||||
// 根据关键字查询config
|
||||
export const APIQueryConfig = async (keyword, type, noLoading = true) => {
|
||||
try {
|
||||
const res = await api('v2/cms/QueryConfigs', {
|
||||
params: {
|
||||
keyword,
|
||||
type
|
||||
},
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('queryConfig', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 更新config
|
||||
export const APIUpdateConfig = async (json, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/cms/UpdateConfig', {
|
||||
method: 'PUT',
|
||||
data: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
192
src/apis/APIOrder.js
Normal file
@@ -0,0 +1,192 @@
|
||||
/* eslint-disable */
|
||||
import api from '@/utils/api.js'
|
||||
|
||||
// 投诉骑手(三方运送)
|
||||
// token string true "认证token"
|
||||
// vendorOrderID string true "订单号"
|
||||
// vendorID int true "订单所属厂商ID"
|
||||
// waybillVendorID int true "运单所属厂商ID"
|
||||
// complaintID int true "投诉原因ID"
|
||||
// waybillID string false "运单ID"
|
||||
export const APIComplaintRider = async (string) => {
|
||||
try {
|
||||
await api('v2/order/ComplaintRider', {
|
||||
method: 'POST',
|
||||
data: string
|
||||
})
|
||||
} catch (e) {
|
||||
console.error('order/ComplaintRider', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 查询门店订单扣款记录
|
||||
/*
|
||||
storeIDs 门店ID列表
|
||||
vendorOrderID 订单ID
|
||||
vendorIDs 订单所属厂商ID列表
|
||||
fromTime 开始日期(包含),格式(2006-01-02 00:00:00),如果订单号为空此项必须要求
|
||||
toTime 结束日期(包含),格式(2006-01-02 23:00:00),如果订单号为空此项必须要求
|
||||
status 账单状态,0是未结账,1是已结账
|
||||
type 扣款类型,1为差评补贴,2为优惠券
|
||||
offset 结果起始序号(以0开始,缺省为0)
|
||||
pageSize 结果页大小(缺省为50,-1表示全部
|
||||
*/
|
||||
export const APIGetOrdersSupplement = async (query, noLoading = false) => {
|
||||
try {
|
||||
let res = await api('v2/order/GetOrdersSupplement', {
|
||||
method: 'GET',
|
||||
params: query,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('APIGetOrdersSupplement', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 新增/修改扣款记录
|
||||
// payload
|
||||
/*
|
||||
新增
|
||||
storeID int
|
||||
vendorOrderID string
|
||||
vendorID string
|
||||
type int //扣款类型,1为差评订单补贴,2为优惠券
|
||||
linkID int //作为冲账标志关联某条扣款记录,若新增为某一记录的冲账,则此字段填那条记录的id
|
||||
supplementFee int //扣款金额
|
||||
comment string //备注
|
||||
|
||||
----
|
||||
修改
|
||||
id int
|
||||
createdAt time
|
||||
storeID int
|
||||
vendorOrderID string
|
||||
vendorID string
|
||||
status int //账单状态,若已结账则不允许再修改 ,暂时 0为未结账,1为已结账,-1为作废
|
||||
linkID int //作为冲账标志关联某条扣款记录
|
||||
type int //扣款类型,1为差评订单补贴,2为优惠券
|
||||
supplementFee int //扣款金额
|
||||
billID string //账单ID,后期可能关联账单用
|
||||
comment string //备注
|
||||
*/
|
||||
export const APIAddUpdateOrdersSupplement = async (json, noLoading = false) => {
|
||||
try {
|
||||
let res = await api('v2/order/AddUpdateOrdersSupplement', {
|
||||
method: 'POST',
|
||||
data: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('AddUpdateOrdersSupplement', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 得到订单详情
|
||||
// vendorOrderID
|
||||
// vendorID
|
||||
// refresh
|
||||
export const APIGetOrderInfo = async (query, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/order/GetOrderInfo', {
|
||||
params: query,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('APIGetOrderInfo', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 查询订单状态
|
||||
export const orderStatusList = async (query, noLoading = true) => {
|
||||
try {
|
||||
const res = await api('v2/order/GetOrderStatusList', {
|
||||
params: query,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const APIGetMatterOrderStatus = async (json) => {
|
||||
try {
|
||||
const res = api('v2/jxorder/GetMatterOrderStatus?vendorOrderID=' + json.vendorOrderID, {
|
||||
noLoading: true
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 重发京东物流
|
||||
export const APISendFailedMatterOrder = async (json, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/jxorder/SendFailedMatterOrder', {
|
||||
method: 'POST',
|
||||
data: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('SendFailedMatterOrder', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取门店发票申请 美团
|
||||
* @Param token header string true "认证token"
|
||||
* @Param storeId formData int false "门店id"
|
||||
* @Param startTime formData string true "开始时间"
|
||||
* @Param endTime formData string true "结束时间"
|
||||
* @Param status formData string false "发票回复状态[1未回复/2回复]"
|
||||
* @Param offset query int false "结果起始序号(以0开始,缺省为0)"
|
||||
* @Param pageSize query int false "结果页大小(缺省为50,-1表示全部)"
|
||||
*/
|
||||
export const APIGetInvoiceRecord = async (json,page,noLoading=true) => {
|
||||
try {
|
||||
let str = ""
|
||||
// if(page.offset) str = `offset=${page.offset}`
|
||||
// if(page.pageSize) str = `offset=${page.offset || 0}&pageSize=${page.pageSize || -1}`
|
||||
let res = await api(`v2/order/GetInvoiceRecord?${str.length > 0 ? str : ''}`, {
|
||||
method: 'POST',
|
||||
data: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('APIGetInvoiceRecord', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传订单发票
|
||||
* @Param token header string true "认证token"
|
||||
* @Param orderId formData string true "订单ID"
|
||||
* @Param invoiceUrl formData string true "发票地址[10M内pdf/png/jpeg/jpg]"
|
||||
* @Param invoiceId formData string true "发票号码"
|
||||
*/
|
||||
export const APIUploadOrderInvoice = async (json,noLoading=true) => {
|
||||
try {
|
||||
let res = await api('v2/order/UploadOrderInvoice ', {
|
||||
method: 'POST',
|
||||
data: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('UploadOrderInvoice ', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
162
src/apis/APIPromotion.js
Normal file
@@ -0,0 +1,162 @@
|
||||
import api from '@/utils/api.js'
|
||||
import { formatDate } from '@/utils/index.js'
|
||||
|
||||
/**
|
||||
* 获取活动列表
|
||||
* @param {*} json 查询条件
|
||||
*/
|
||||
export const APIQueryActs = async (json, noLoading = true) => {
|
||||
try {
|
||||
const { data } = await api('v2/act/QueryActs', {
|
||||
params: {
|
||||
createdAtFrom: formatDate(new Date() - 30 * 24 * 60 * 60 * 1000, 'YYYY-MM-DD hh:mm:ss'),
|
||||
createdAtTo: formatDate(new Date(), 'YYYY-MM-DD hh:mm:ss'),
|
||||
typeList: JSON.stringify([3]),
|
||||
statusList: JSON.stringify([1]),
|
||||
...json
|
||||
},
|
||||
noLoading
|
||||
})
|
||||
if (data) {
|
||||
return data.map(item => ({
|
||||
actID: item.id,
|
||||
...json
|
||||
}))
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('APIQueryActs', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 删除活动中某些商品
|
||||
// actID
|
||||
// actStoreSkuDeleteList [{
|
||||
// storeID,
|
||||
// skuID
|
||||
// }]
|
||||
// isAsync
|
||||
export const APIUpdateActStoreSkuBind = async (json, noLoading = true) => {
|
||||
try {
|
||||
return await api('v2/act/UpdateActStoreSkuBind', {
|
||||
method: 'PUT',
|
||||
data: json,
|
||||
noLoading
|
||||
})
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
//获取平台流量活动
|
||||
//vendorID
|
||||
//storeID
|
||||
export const APIGetVendorPopActs = async (json, noLoading = true) => {
|
||||
try {
|
||||
return await api('v2/act/GetVendorPopActs', {
|
||||
method: 'GET',
|
||||
params: json,
|
||||
noLoading
|
||||
})
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
//活动详情
|
||||
export const APIGetVendorPopActDetail = async (json, noLoading = true) => {
|
||||
try {
|
||||
return await api('v2/act/GetVendorPopActDetail', {
|
||||
method: 'GET',
|
||||
params: json,
|
||||
noLoading
|
||||
})
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取美团活动(获取本地的数据)
|
||||
* @Param token header string true "认证token"
|
||||
*
|
||||
* @Param storeIDs query string false "门店IDs"
|
||||
* @Param skuIDs query string false "skuIDs"
|
||||
* @Param keyword query string false "关键字"
|
||||
* @Param beginAt query string false "活动开始日期"
|
||||
* @Param endAt query string false "活动结束日期"
|
||||
* @Param actType query int false "折扣或者秒杀"
|
||||
* @Param offset query int false "起始序号(以0开始,缺省为0)"
|
||||
* @Param pageSize query int false "表页大小(缺省全部)"
|
||||
*/
|
||||
|
||||
export const GetActMtwmVendor = async (json, noLoading = true) => {
|
||||
try {
|
||||
return await api('v2/act/GetActMtwmVendor', {
|
||||
method: 'GET',
|
||||
params: json,
|
||||
noLoading
|
||||
})
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新美团活动数据
|
||||
export const RefreshMTActivityList = async (noLoading = true) => {
|
||||
try {
|
||||
return await api('v2/act/RefreshMTActivityList', {
|
||||
method: 'GET',
|
||||
noLoading
|
||||
})
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 根据skuId获取没有参加活动的门店id
|
||||
* @Param token header string true "认证token"
|
||||
* @Param skuID query int false "skuID"
|
||||
* @Param offset query int false "起始序号(以0开始,缺省为0)"
|
||||
* @Param pageSize query int false "表页大小(缺省全部)"
|
||||
*/
|
||||
export const GetNotHaveSkuActList = async (json, noLoading = true) => {
|
||||
try {
|
||||
return await api('v2/act/GetNotHaveSkuActList', {
|
||||
method: 'GET',
|
||||
params: json,
|
||||
noLoading
|
||||
})
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title 查询美团平台线上活动(会有不在我们本地创建的)
|
||||
* @Param token header string true "认证token"
|
||||
* @Param vendorStoreID query string false "美团门店ID"
|
||||
* @Param vendorOrgCode query string false "美团appID"
|
||||
* @Param beginAt query int false "活动开始日期 时间戳"
|
||||
* @Param endAt query int false "活动结束日期 时间戳"
|
||||
* @Param actType query int false "折扣或者秒杀 商品满减2 折扣(爆品)3"
|
||||
*/
|
||||
export const GetMTOnlineAct = async (json, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('/v2/act/GetMTOnlineAct', {
|
||||
method: 'GET',
|
||||
params: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('', e)
|
||||
throw (e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
21
src/apis/APISku.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import api from '@/utils/api.js'
|
||||
// import {json2query} from '@/utils'
|
||||
|
||||
/**
|
||||
* UPC查询
|
||||
* @param {*} name 商品名
|
||||
* @param {*} upcCode UPCCODE
|
||||
* @param {*} noLoading false
|
||||
*/
|
||||
export const APIGetJDUPC = async (params, noLoading = false) => {
|
||||
try {
|
||||
let res = await api('v2/sku/GetJdUpcCodeByName', {
|
||||
method: 'GET',
|
||||
params,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
99
src/apis/APISkuNames.js
Normal file
@@ -0,0 +1,99 @@
|
||||
import { formatDate } from '@/utils'
|
||||
import api from '@/utils/api.js'
|
||||
|
||||
export const APIGetSkuNames = async (json, noLoading = false) => {
|
||||
try {
|
||||
let res = await api('v2/sku/GetSkuNames', {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...json
|
||||
},
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
export const APIGetSkuNamesNew = async (json, noLoading = false) => {
|
||||
try {
|
||||
let res = await api('v2/sku/GetSkuNamesNew', {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...json
|
||||
},
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const APIGetSkuNamesPOST = async (str, noLoading = true) => {
|
||||
|
||||
try {
|
||||
let res = await api('v2/sku/GetSkuNames', {
|
||||
method: 'POST',
|
||||
data: str,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const updateMtCatToJd = async (mtCatID,jdCatID, noLoading = true) => {
|
||||
let form = new FormData()
|
||||
form.append('mtCatID', mtCatID)
|
||||
form.append('jdCatID', jdCatID)
|
||||
try {
|
||||
let res = await api('v2/sku/UpdateMtCatToJd', {
|
||||
method: 'POST',
|
||||
data: form,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const getVendorCategoriesWithMap = async (vendorID, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/sku/GetVendorCategoriesWithMap', {
|
||||
method: 'GET',
|
||||
params: {
|
||||
vendorID
|
||||
},
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
// 根据城市信息查找推荐商品(按销量)
|
||||
// token string true "认证token"
|
||||
// cityCode int true "城市id"
|
||||
// storeID int false "门店id" //不传
|
||||
// store/sku/GetTopSkusByCityCode [get]
|
||||
export const APIGetTopSkusByCityCode = async (params, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/store/sku/GetTopSkusByCityCode', {
|
||||
params,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('store/sku/GetTopSkusByCityCode', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
98
src/apis/APIUser.js
Normal file
@@ -0,0 +1,98 @@
|
||||
/* eslint-disable */
|
||||
import api from '@/utils/api.js'
|
||||
|
||||
|
||||
export const APIGetBrandUser = async (json, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/store/GetBrandUser', {
|
||||
params: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('GetUsers', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到用户列表
|
||||
* GET
|
||||
* /user2/GetUsers
|
||||
* @param {Number} userType* 用户类型(0表示全部)
|
||||
* @param {String} keyword 关键字
|
||||
* ...userIDs
|
||||
*/
|
||||
export const APIGetUsers = async (json, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/user2/GetUsers', {
|
||||
params: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('GetUsers', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 给指定**角色**添加**用户**列表
|
||||
* POST
|
||||
* /user2/AddUsers4Role
|
||||
* formData
|
||||
* @param {String} roleName* 角色名 (必填)
|
||||
* @param {Number} storeID 门店ID
|
||||
* @param {Array<String>} userIDs* 用户ID列表 (必填)
|
||||
*/
|
||||
|
||||
export const APIAddUsers4Role = async (string, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/user2/AddUsers4Role', {
|
||||
method: 'POST',
|
||||
data: string,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('AddUsers4Role', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户分成比例
|
||||
* @param {*} string
|
||||
* @param {*} noLoading
|
||||
*/
|
||||
export const APIUpdateUserWxNoAndPercent = async (string, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/user2/UpdateUserWxNoAndPercent', {
|
||||
method: 'PUT',
|
||||
data: string,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('UpdateUserWxNoAndPercent', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁用用户
|
||||
* @param {*} userID
|
||||
* @param {*} noLoading
|
||||
*/
|
||||
export const APIDeleteUserInfo = async (userID, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/user2/DeleteUserInfo?userID=' + userID, {
|
||||
method: 'DELETE',
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('APIDeleteUserInfo', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
42
src/apis/APIreport.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import api from '@/utils/api.js'
|
||||
|
||||
export const APIReportForOrders = async (json) => {
|
||||
try {
|
||||
let res = await api('v2/report/StatisticsReportForOrders', {
|
||||
method: 'POST',
|
||||
data: json
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const APIGetStoreManageState = async (json) => {
|
||||
try {
|
||||
let res = await api('v2/report/GetStoreManageState', {
|
||||
method: 'GET',
|
||||
params: json,
|
||||
// noLoading:true
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const userMemberReport = async (json) => {
|
||||
try {
|
||||
let res = await api('v2/report/UserMemberReport', {
|
||||
method: 'GET',
|
||||
params: json,
|
||||
noLoading:true
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
116
src/apis/APIshop.js
Normal file
@@ -0,0 +1,116 @@
|
||||
import api from '@/utils/api.js'
|
||||
|
||||
export const APIGetStores = async (json, noLoading = false) => {
|
||||
try {
|
||||
let res = await api('v2/store/GetStores', {
|
||||
method: 'POST',
|
||||
data: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加平台门店绑定
|
||||
* @param {*} storeID
|
||||
* @param {*} vendorID
|
||||
* @param {*} vendorOrgCode 选填
|
||||
* @param {*} payload {"vendorStoreID":"103083","autoPickup":1,"deliveryCompetition":1,"pricePercentage":100,"isSync":1,"pricePercentagePack":"美团调价策略7.18"}
|
||||
*/
|
||||
export const APIAddStoreMap = async (json, noLoading = false) => {
|
||||
try {
|
||||
let res = await api('v2/store/AddStoreVendorMap', {
|
||||
method: 'POST',
|
||||
data: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改平台门店绑定
|
||||
* @param {*} storeID
|
||||
* @param {*} vendorID
|
||||
* @param {*} payload {"vendorStoreID":"103083","autoPickup":1,"deliveryCompetition":1,"pricePercentage":100,"isSync":1,"pricePercentagePack":"美团调价策略7.18"}
|
||||
*/
|
||||
export const APIUpdateStoreMap = async (json, noLoading = false) => {
|
||||
try {
|
||||
let res = await api('v2/store/UpdateStoreVendorMap', {
|
||||
method: 'PUT',
|
||||
data: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/* 发送消息
|
||||
storeIDs
|
||||
title
|
||||
content
|
||||
isAsync
|
||||
isContinueWhenError
|
||||
*/
|
||||
export const APISendStoreMessage = async (string, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/msg/SendStoreMessage', {
|
||||
method: 'POST',
|
||||
data: string,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('APISendStoreMessage', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
更新门店信息
|
||||
storeID
|
||||
payload
|
||||
*/
|
||||
export const APIUpdateStore = async (json, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/store/UpdateStore', {
|
||||
method: 'PUT',
|
||||
data: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/* 查询远端门店
|
||||
vendorStoreID
|
||||
vendorID
|
||||
vendorOrgCode
|
||||
*/
|
||||
export const APIGetVendorStore = async (json) => {
|
||||
try {
|
||||
const res = await api('v2/store/GetVendorStore', {
|
||||
params: {
|
||||
...json
|
||||
},
|
||||
noLoading: true
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
146
src/apis/APIstoreSku.js
Normal file
@@ -0,0 +1,146 @@
|
||||
import api from '@/utils/api.js'
|
||||
|
||||
/* 修改单门店商品
|
||||
{
|
||||
nameID: id,
|
||||
unitPrice: price,
|
||||
isFocus: ,
|
||||
statusSaleBegin
|
||||
statusSaleEnd
|
||||
skus: [
|
||||
{
|
||||
skuID: id,
|
||||
isSale:
|
||||
}
|
||||
]
|
||||
}
|
||||
*/
|
||||
export const APIUpdateStoreSkus = async (json, noLoading = false) => {
|
||||
try {
|
||||
let res = await api('v2/store/sku/UpdateStoresSkus', {
|
||||
method: 'PUT',
|
||||
data: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取门店商品
|
||||
* @param {*} json 查询条件
|
||||
*/
|
||||
export const APIGetStoresSkus = async (json, noLoading = true) => {
|
||||
try {
|
||||
const res = await api('v2/store/sku/GetStoresSkus', {
|
||||
params: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('APIGetStoresSkus', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取门店商品审核列表
|
||||
* @param {*} json 数据
|
||||
* @param {*} noLoading no
|
||||
*/
|
||||
export const APIGetStoreSkuAudit = async (json, noLoading = true) => {
|
||||
try {
|
||||
const res = await api('v2/store/sku/GetStoreSkuAudit', {
|
||||
params: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('GetStoreSkuAudit', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
//获取门店审核列表
|
||||
export const APIGetStoreCheckList = async (json, noLoading = true) => {
|
||||
try {
|
||||
const res = await api('v2/store/GetStoreAudit', {
|
||||
params: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('GetStoreAudit', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 处理门店商品审核
|
||||
* @param {*} query
|
||||
* @param {*} noLoading
|
||||
*/
|
||||
export const APIStoreSkuPriceAudit = async (query, noLoading = true) => {
|
||||
try {
|
||||
return await api('v2/store/sku/StoreSkuPriceAudit', {
|
||||
method: 'POST',
|
||||
data: query,
|
||||
noLoading
|
||||
})
|
||||
} catch (e) {
|
||||
console.error('APIStoreSkuPriceAudit', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 处理门店审核
|
||||
* @param {*} query
|
||||
* @param {*} noLoading
|
||||
* paload :userID name
|
||||
*/
|
||||
export const APIStoreAudit = async (query, noLoading = true) => {
|
||||
try {
|
||||
return await api('v2/store/StoreAudit', {
|
||||
method: 'POST',
|
||||
data: query,
|
||||
noLoading
|
||||
})
|
||||
} catch (e) {
|
||||
console.error('GetStoreAudit', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 批量修改门店商品,不同步
|
||||
* @param {*} json 数据
|
||||
* @param {*} noLoading 不显示loading
|
||||
* storeIDs
|
||||
* payload
|
||||
* payload=[{nameID, unitPrice, isFocus, isSale}]
|
||||
* isRefreshHigh
|
||||
*/
|
||||
|
||||
export const APIUpdateStoresSkusWithoutSync = async (json, noLoading = true) => {
|
||||
try {
|
||||
return await api('v2/store/sku/UpdateStoresSkusWithoutSync', {
|
||||
method: 'PUT',
|
||||
data: json,
|
||||
noLoading
|
||||
})
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const getStoresSkusSaleInfo = async (json, noLoading = true) => {
|
||||
try {
|
||||
return await api('v2/store/sku/GetStoresSkusSaleInfo', {
|
||||
method: 'GET',
|
||||
params: json,
|
||||
noLoading
|
||||
})
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
89
src/apis/APIsync.js
Normal file
@@ -0,0 +1,89 @@
|
||||
import api from '@/utils/api.js'
|
||||
import {json2query} from '@/utils'
|
||||
|
||||
// export const APIReportForOrders = async (json) => {
|
||||
// try {
|
||||
// let res = await api('v2/report/StatisticsReportForOrders', {
|
||||
// method: 'POST',
|
||||
// data: json
|
||||
// })
|
||||
// return res
|
||||
// } catch (e) {
|
||||
// console.error(e)
|
||||
// throw e
|
||||
// }
|
||||
// }
|
||||
|
||||
// 同步商家分类
|
||||
// vendorID - integer - 平台ID(京东0 美团1 饿百3)
|
||||
// vendorOrgCode - string - 平台账号
|
||||
// isForce - boolean - 是否强制(设置修改标志)
|
||||
// isAsync - boolean - 是否异步
|
||||
// isContinueWhenError - boolean - 单个同步失败是否继续,缺省false
|
||||
export const APISyncCat = async (json, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/sync/SyncCategories', {
|
||||
method: 'POST',
|
||||
data: json2query(json),
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 重置商品库
|
||||
// vendorID * - integer - 平台ID(京东0 美团1 饿百3)
|
||||
// vendorOrgCode * - string - 平台账号
|
||||
// isAsync - boolean - 是否异步操作
|
||||
// isContinueWhenError - boolean - 单个同步失败是否继续,缺省false
|
||||
|
||||
export const APIResetSkuNames = async (json, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/sync/FullSyncVendorStuff', {
|
||||
method: 'POST',
|
||||
data: json2query(json),
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 同步平台门店
|
||||
// vendorIDs
|
||||
// vendorOrgCode
|
||||
// storeIDs
|
||||
// isForce
|
||||
// isAsync
|
||||
// isContinueWhenError
|
||||
export const APISyncStores = async (json, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/sync/SyncStores', {
|
||||
method: 'POST',
|
||||
data: json2query(json),
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('SyncStores', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 同步京狗商品库存
|
||||
export const APISyncJGStoresSkus = async (json, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/sync/SyncJdsStoresSkus', {
|
||||
method: 'PUT',
|
||||
data: json2query(json),
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('SyncStores', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
104
src/apis/JDCat.js
Normal file
@@ -0,0 +1,104 @@
|
||||
import api from '@/utils/api.js'
|
||||
import $ajax from 'axios'
|
||||
import { hideLoad } from '@/tools/loading.js'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
// vendorOrgCode 账号ID
|
||||
// vendorID 平台ID
|
||||
async function getVendorCategoryMap (json) {
|
||||
try {
|
||||
let res = await api('v2/sku/GetVendorCategoryMap', {
|
||||
params: json,
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
//新增平台类别
|
||||
function addVendorCategory(vendorID,vendorOrgCode,categroyID,level,parentID,vendorCategoryName, vendorCategorySeq,fn) {
|
||||
let form = new FormData()
|
||||
form.append('vendorID', vendorID)
|
||||
form.append('vendorOrgCode',vendorOrgCode)
|
||||
form.append('categroyID', categroyID)
|
||||
form.append('level', level)
|
||||
form.append('parentID', parentID)
|
||||
form.append('vendorCategoryName', vendorCategoryName)
|
||||
form.append('vendorCategorySeq', vendorCategorySeq)
|
||||
$ajax.post('v2/sku/AddVendorCategoryMap', form, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
//修改平台类型
|
||||
async function updateVendorCategoryMap(ID,vendorCategoryName ,level,categroyID, parentID ,isDelete=false, fn) {
|
||||
let form = new FormData()
|
||||
form.append('ID', ID)
|
||||
form.append('vendorCategoryName', vendorCategoryName)
|
||||
form.append('level', level)
|
||||
form.append('categroyID', categroyID)
|
||||
form.append('parentID', parentID)
|
||||
form.append('isDelete', isDelete)
|
||||
try {
|
||||
let res = await api('v2/sku/UpdateVendorCategoryMap', {
|
||||
method: 'PUT',
|
||||
data: form
|
||||
})
|
||||
fn && fn({ code: '0' })
|
||||
return res
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
hideLoad()
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
//加载门店分类到京东
|
||||
async function loadStoreVendorCategories (vendorID,vendorOrgCode,storeID) {
|
||||
let form = new FormData()
|
||||
form.append('vendorID', vendorID)
|
||||
form.append('vendorOrgCode', vendorOrgCode)
|
||||
form.append('storeID', storeID)
|
||||
try {
|
||||
let res = await api('v2/sku/LoadStoreVendorCategories', {
|
||||
method: 'POST',
|
||||
data: form,
|
||||
noLoading: true,
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
hideLoad()
|
||||
msgWarning(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
function SortCat(categoryID, categoryIDs, vendorID ,vendorOrgCode , fn ) {
|
||||
let formData = new FormData()
|
||||
formData.append('categoryID', categoryID)
|
||||
formData.append('vendorID', vendorID)
|
||||
formData.append('vendorOrgCode', vendorOrgCode)
|
||||
formData.append('categoryIDs', JSON.stringify(categoryIDs))
|
||||
|
||||
$ajax.put('v2/sku/ReorderVendorCategories', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export { getVendorCategoryMap,addVendorCategory,updateVendorCategoryMap,SortCat,loadStoreVendorCategories}
|
||||
200
src/apis/cat.js
Normal file
@@ -0,0 +1,200 @@
|
||||
import $ajax from 'axios'
|
||||
// import {Message} from 'element-ui'
|
||||
import { hideLoad } from '@/tools/loading.js'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
import api from '@/utils/api.js'
|
||||
|
||||
/*
|
||||
新增商品类别 post /sku/AddCategory
|
||||
payload json
|
||||
--------
|
||||
type 0 skuNameCat
|
||||
type 1 skuCat
|
||||
*/
|
||||
function addCat(json, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('payload', JSON.stringify(json))
|
||||
$ajax.post('v2/sku/AddCategory', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
/*
|
||||
通过store_id
|
||||
新增商品类别 post /sku/AddCategory
|
||||
payload json
|
||||
--------
|
||||
type 0 skuNameCat
|
||||
type 1 skuCat
|
||||
*/
|
||||
function storeAddCat(storeID, storeCategroyName, level, parentID, storeCategroySeq,isHidden,categroyID, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('storeID', storeID)
|
||||
formData.append('level', level)
|
||||
formData.append('parentID', parentID)
|
||||
formData.append('storeCategroyName', storeCategroyName)
|
||||
formData.append('storeCategroySeq', storeCategroySeq)
|
||||
formData.append('isHidden', isHidden)
|
||||
if(categroyID!==0){
|
||||
formData.append('categroyID', categroyID)
|
||||
}
|
||||
$ajax.post('v2/store/AddStoreCategoryMap', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
/*
|
||||
删除商品类别 delete /sku/DeleteCategory
|
||||
categoryID int
|
||||
*/
|
||||
function deleteCat(categoryID, fn) {
|
||||
$ajax.delete('v2/sku/DeleteCategory', {
|
||||
params: {
|
||||
categoryID
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
修改分类 put /sku/UpdateCategory
|
||||
categoryID int 类别ID
|
||||
payload json
|
||||
*/
|
||||
async function updateCat(categoryID, json, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('categoryID', categoryID)
|
||||
formData.append('payload', JSON.stringify(json))
|
||||
try {
|
||||
let res = await api('v2/sku/UpdateCategory', {
|
||||
method: 'PUT',
|
||||
data: formData
|
||||
})
|
||||
fn && fn({ code: '0' })
|
||||
return res
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
hideLoad()
|
||||
throw e
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/*
|
||||
通过门店 store_id
|
||||
修改分类 put /sku/UpdateCategory
|
||||
categoryID int 类别ID
|
||||
payload json
|
||||
*/
|
||||
async function storeUpdateCat(ID, categoryID,level, parentID, storeCategroyName,isDelete,isHidden, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('ID', ID)
|
||||
formData.append('categoryID', categoryID)
|
||||
formData.append('level', level)
|
||||
formData.append('parentID', parentID)
|
||||
formData.append('storeCategroyName', storeCategroyName)
|
||||
formData.append('isDelete',isDelete)
|
||||
formData.append('isHidden',isHidden)
|
||||
|
||||
|
||||
try {
|
||||
let res = await api('v2/store/UpdateStoreCategoryMap', {
|
||||
method: 'PUT',
|
||||
data: formData
|
||||
})
|
||||
fn && fn({ code: '0' })
|
||||
return res
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
hideLoad()
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
商品类别排序 put /sku/ReorderCategories
|
||||
categoryID int 父ID
|
||||
categoryIDs str 子类别ID列表 [1,2,3,4]
|
||||
*/
|
||||
function sortCat(categoryID, categoryIDs, fn, isExd,onlySort) {
|
||||
let formData = new FormData()
|
||||
formData.append('categoryID', categoryID)
|
||||
formData.append('categoryIDs', JSON.stringify(categoryIDs))
|
||||
if (isExd) formData.append('isExd', isExd)
|
||||
// onlySort 1 只修改排序 其余修改排序并同步分类
|
||||
if(onlySort) formData.append('onlySort', 1)
|
||||
$ajax.put('v2/sku/ReorderCategories', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
/*
|
||||
通过门店 store_id
|
||||
商品类别排序 put /sku/ReorderCategories
|
||||
categoryID int 父ID
|
||||
categoryIDs str 子类别ID列表 [1,2,3,4]
|
||||
*/
|
||||
function storeSortCat(categoryID, categoryIDs, storeID, fn ) {
|
||||
let formData = new FormData()
|
||||
formData.append('categoryID', categoryID)
|
||||
formData.append('storeID', storeID)
|
||||
formData.append('categoryIDs', JSON.stringify(categoryIDs))
|
||||
|
||||
$ajax.put('v2/sku/ReorderStoreCategories', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
function copyStoreCat(fromStoreID,toStoreIDs,isAsync,isContinueWhenError,fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('fromStoreID', fromStoreID)
|
||||
formData.append('toStoreIDs', toStoreIDs)
|
||||
// formData.append('categoryIDs', categoryIDs)
|
||||
formData.append('isAsync', isAsync)
|
||||
formData.append('isContinueWhenError', isContinueWhenError)
|
||||
$ajax.put('v2/sku/CopyStoreCategories', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(res => {
|
||||
msgWarning(res.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
export { addCat, deleteCat, updateCat, sortCat, storeSortCat, storeUpdateCat, storeAddCat, copyStoreCat}
|
||||
377
src/apis/cms.js
Normal file
@@ -0,0 +1,377 @@
|
||||
import $ajax from 'axios'
|
||||
// import {Message} from 'element-ui'
|
||||
import { hideLoad } from '@/tools/loading.js'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
import api from '@/utils/api.js'
|
||||
/*
|
||||
得到地点 get /cms/GetPlaces
|
||||
keyword str 关键字
|
||||
parentCode int 上级地点code 中国为:100000,北京为:110000,北京市为:110100
|
||||
level int 地点级别 1省 2市 3区
|
||||
*/
|
||||
export function getPlaces(parentCode, fn) {
|
||||
$ajax.get('v2/cms/GetPlaces', {
|
||||
params: {
|
||||
parentCode
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
//通过经纬度获取城市名
|
||||
export const getCityName = async (lng, lat) => {
|
||||
try {
|
||||
let res = await api(`v2/cms/GetCoordinateCityInfo?lng=${lng}&lat=${lat}`)
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
export function getPlaces2(keyword, fn) {
|
||||
$ajax.get('v2/cms/GetPlaces', {
|
||||
params: {
|
||||
keyword
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
根据坐标得到区码 get /cms/GetCoordinateDistrictCode
|
||||
lng num 经度
|
||||
lat num 纬度
|
||||
该接口使用腾讯的api,已经没用了
|
||||
*/
|
||||
export function getCoordinateDistrictCode(lng, lat, fn) {
|
||||
$ajax.get('v2/cms/GetCoordinateDistrictCode', {
|
||||
params: {
|
||||
lng,
|
||||
lat
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
得到第三方配送等待时间 get /cms/GetConfig
|
||||
key str
|
||||
*/
|
||||
export function getConfig(key, fn) {
|
||||
$ajax.get('v2/cms/GetConfig', {
|
||||
params: {
|
||||
key
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
设置配置参数 put /cms/SetConfig
|
||||
key str
|
||||
value str
|
||||
*/
|
||||
export function setConfig(key, value, fn) {
|
||||
$ajax.put(`v2/cms/SetConfig?key=${key}&value=${value}`).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
从UPC码得到商品信息 get /cms/GetProductInfoByBarCode
|
||||
barCode str
|
||||
*/
|
||||
export function getInfoByBarcode(barCode, fn) {
|
||||
$ajax.get('v2/cms/GetProductInfoByBarCode', {
|
||||
params: {
|
||||
barCode
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
// export {getPlaces, getCoordinateDistrictCode, getPlaces2, getConfig, setConfig, getInfoByBarcode}
|
||||
|
||||
/*
|
||||
type str 配置类型,当前支持 PricePack, Bank
|
||||
key str 配置名
|
||||
keyword str 关键字
|
||||
*/
|
||||
export const queryConfigs = async (json = {}) => {
|
||||
try {
|
||||
let { noLoading = false, type = 'PricePack', key, keyword } = json
|
||||
let params = {
|
||||
type
|
||||
}
|
||||
if (key) params.key = key
|
||||
if (keyword) params.keyword = keyword
|
||||
let res = await api('v2/cms/QueryConfigs', {
|
||||
params,
|
||||
noLoading
|
||||
})
|
||||
if (res) {
|
||||
if (type === 'Bank') {
|
||||
// 银行
|
||||
return res
|
||||
} else {
|
||||
// 调价包
|
||||
return res.map(item => ({
|
||||
...item,
|
||||
value: JSON.parse(item.value)
|
||||
}))
|
||||
}
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
return -1
|
||||
} finally {
|
||||
hideLoad()
|
||||
}
|
||||
}
|
||||
// 查询会员配置
|
||||
export const queryVipConfigs = async () => {
|
||||
try {
|
||||
let params = { type: 'DiscountCard', key: '会员折扣卡' }
|
||||
let noLoading = false
|
||||
let res = await api('v2/cms/QueryConfigs', {
|
||||
params,
|
||||
noLoading
|
||||
})
|
||||
if (res) {
|
||||
return res
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
return -1
|
||||
} finally {
|
||||
hideLoad()
|
||||
}
|
||||
}
|
||||
|
||||
export const updateStoreTemplate = async (json = {}) => {
|
||||
try {
|
||||
let { noLoading = false, storeID , content, sound } = json
|
||||
let form = new FormData()
|
||||
form.append('storeID', storeID)
|
||||
form.append('content', content)
|
||||
form.append('sound', sound)
|
||||
let res = await api('v2/store/UpdateStoreTemplate', {
|
||||
method: 'POST',
|
||||
data: form,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
return -1
|
||||
} finally {
|
||||
hideLoad()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
## 新增配置 POST(FormData) /cms/NewConfig
|
||||
type str 配置类型,当前只支持 PricePack
|
||||
key str 配置名
|
||||
value str 配置值 []
|
||||
*/
|
||||
export const newConfig = async (json = {}) => {
|
||||
try {
|
||||
let { noLoading = false, type = 'PricePack', key, value } = json
|
||||
let form = new FormData()
|
||||
form.append('type', type)
|
||||
form.append('key', key)
|
||||
form.append('value', value)
|
||||
let res = await api('v2/cms/NewConfig', {
|
||||
method: 'POST',
|
||||
data: form,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
return -1
|
||||
} finally {
|
||||
hideLoad()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
## 删除配置 DELETE(query) /cms/DeleteConfig
|
||||
type str 配置类型,当前只支持 PricePack
|
||||
key str 配置名
|
||||
*/
|
||||
export const deleteConfig = async (json = {}) => {
|
||||
try {
|
||||
let { noLoading, type = 'PricePack', key } = json
|
||||
let params = {
|
||||
type,
|
||||
key
|
||||
}
|
||||
let res = await api('v2/cms/DeleteConfig', {
|
||||
method: 'DELETE',
|
||||
params,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
return -1
|
||||
} finally {
|
||||
hideLoad()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
## 修改配置 PUT(formData) /cms/UpdateConfig
|
||||
type str 配置类型,当前只支持 PricePack
|
||||
key str 配置名
|
||||
value str 配置值
|
||||
*/
|
||||
export const updateConfig = async (json = {}) => {
|
||||
try {
|
||||
let { noLoading, type = 'PricePack', key, value } = json
|
||||
let form = new FormData()
|
||||
form.append('type', type)
|
||||
form.append('key', key)
|
||||
form.append('value', value)
|
||||
let res = await api('v2/cms/UpdateConfig', {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: form,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
return -1
|
||||
} finally {
|
||||
hideLoad()
|
||||
}
|
||||
}
|
||||
|
||||
// 获取平台账号信息
|
||||
export const getVendorOrgCodeInfo = async () => {
|
||||
try {
|
||||
let res = await api('v2/cms/GetVendorOrgCodeInfo')
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 新接口 获取平台账号信息 vendorType=platform 查平台账号 vendorID 0 京东
|
||||
export const newCetVendorOrgCodeInfo = async (vendorID=-1,) => {
|
||||
try {
|
||||
let res = await api('v2/sys/GetVendorOrgCode',{
|
||||
params:{
|
||||
vendorType:'platform',
|
||||
vendorID,
|
||||
},
|
||||
noLoading:true,
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 新接口 修改平台账号信息 vendorType=platform 查平台账号 vendorID 0 京东
|
||||
export const updateVendorOrgCode = async (id,json) => {
|
||||
let form = new FormData()
|
||||
form.append('id', id)
|
||||
form.append('payload', JSON.stringify(json))
|
||||
try {
|
||||
let res = await api('v2/sys/UpdateVendorOrgCode',{
|
||||
method:'POST',
|
||||
data:form,
|
||||
noLoading:true,
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const addVendorOrgCode = async (json) => {
|
||||
let form = new FormData()
|
||||
form.append('payload', JSON.stringify(json))
|
||||
try {
|
||||
let res = await api('v2/sys/AddVendorOrgCode',{
|
||||
method:'POST',
|
||||
data:form,
|
||||
noLoading:true,
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const getDayVercabulary = async (offset,pageSize,noLoading = true) => {
|
||||
try {
|
||||
let res = await api(`v2/know/GetMaterialList?offset=${offset}&pageSize=${pageSize}`, { noLoading })
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
export const getDayArticle = async (offset,pageSize,noLoading = true) => {
|
||||
try {
|
||||
let res = await api(`v2/know/GetKnowledgeDepot?offset=${offset}&pageSize=${pageSize}`, { noLoading })
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
107
src/apis/common.js
Normal file
@@ -0,0 +1,107 @@
|
||||
import $ajax from 'axios'
|
||||
// import {hideLoad} from '@/tools/loading.js'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
import { hideLoad } from '@/tools/loading.js' // 引入封装的loading方法
|
||||
import api from '@/utils/api.js'
|
||||
|
||||
/**
|
||||
* 获取城市
|
||||
* @param {Boolean} includeDisabled 是否包括禁用城市
|
||||
* @param {Boolean} noLoading 是否需要loading
|
||||
*/
|
||||
async function getCity(includeDisabled, noLoading) {
|
||||
let str = ''
|
||||
if (includeDisabled) str += '&includeDisabled=true'
|
||||
// 获取城市数据
|
||||
let cityData = (await ($ajax.get('v2/cms/GetPlaces?level=2' + str, {
|
||||
noLoading: !!noLoading
|
||||
}))).data
|
||||
// 判断城市是否获取成功
|
||||
if (cityData.code !== '0') {
|
||||
msgWarning('[获取城市列表失败] ' + cityData.desc)
|
||||
} else {
|
||||
return JSON.parse(cityData.data)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取城市信息
|
||||
*/
|
||||
export const getAllCityInfo = async (noLoading = false) => {
|
||||
try {
|
||||
let res = await api('v2/cms/GetPlaces',noLoading)
|
||||
hideLoad()
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
async function getJxCat(noLoading) {
|
||||
// 获取分类数据
|
||||
let categories = (await $ajax.get('v2/sku/GetCategories', { noLoading })).data
|
||||
// 判断分类是否获取成功
|
||||
if (categories.code !== '0') {
|
||||
msgWarning('[获取分类列表失败] ' + categories.desc)
|
||||
} else {
|
||||
categories = JSON.parse(categories.data)
|
||||
return {
|
||||
catLevel1: categories.filter(item => item.level === 1),
|
||||
catLevel2: categories.filter(item => item.level === 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//获取京西商城用户信息
|
||||
function getJxUser(keyword, offset, pageSize, fromTime, toTime, vendorIDs, fn) {
|
||||
$ajax.get('v2/user2/GetJxShopUsers', {
|
||||
params: {
|
||||
keyword,
|
||||
offset,
|
||||
fromTime,
|
||||
toTime,
|
||||
vendorIDs,
|
||||
pageSize
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 模块:获取商城首页菜单列表
|
||||
* 作者:张树伟
|
||||
* 日期:2022年7月7日
|
||||
* 邮箱:2966211270@qq.com
|
||||
*/
|
||||
function getMerchantMenu(storeID,fn) {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
var URL_AJAX = `store/sku/GetTopCategoriesByStoreIDs?storeIDs=%5B${storeID}%5D`
|
||||
}else {
|
||||
var URL_AJAX = `http://www.jxc4.com/v2/store/sku/GetTopCategoriesByStoreIDs?storeIDs=%5B${storeID}%5D`
|
||||
}
|
||||
|
||||
$ajax.get(URL_AJAX)
|
||||
.then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
let newData = JSON.parse(res.data.data)
|
||||
fn && fn(newData)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
export { getCity, getJxCat, getJxUser, getMerchantMenu }
|
||||
62
src/apis/controls/auth.js
Normal file
@@ -0,0 +1,62 @@
|
||||
/* eslint-disable */
|
||||
import {json2query} from '@/utils'
|
||||
import {APIRegisterUser, APISendVerifyCode} from '@/apis/APIAuth.js'
|
||||
import {getCookie} from '@/tools/'
|
||||
|
||||
/*
|
||||
用户注册
|
||||
/user2/RegisterUser post(formData)
|
||||
*payload json数据,User对象(手机号必填)
|
||||
*mobileVerifyCode 手机验证码(通过auth2.SendVerifyCode获得)
|
||||
authToken 之前通过login得到的认证TOKEN(可以为空)
|
||||
|
||||
----payload
|
||||
UserID2 str 用户名(英文数字下划线)
|
||||
Name str 昵称
|
||||
Mobile str 手机号
|
||||
Email string `orm:"size(32)" json:"email"`
|
||||
IDCardNo string `orm:"size(18);column(id_card_no)" json:"idCardNo"` // 身份证号
|
||||
*/
|
||||
// 通过手机号注册
|
||||
/**
|
||||
*
|
||||
* @param {*} mobile 手机号
|
||||
* @param {*} mobileVerifyCode 验证码
|
||||
* @param {*} noLoading
|
||||
*/
|
||||
export const registerUser = async (mobile, mobileVerifyCode, noLoading = true) => {
|
||||
try {
|
||||
let res = await APIRegisterUser(json2query({
|
||||
payload: JSON.stringify({
|
||||
userID2: mobile,
|
||||
name: mobile,
|
||||
mobile
|
||||
})
|
||||
// mobileVerifyCode
|
||||
// authToken: getCookie('Token')
|
||||
}), noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
发送验证码
|
||||
/auth2/SendVerifyCode post
|
||||
captchaID str 图片验证码ID
|
||||
captchaValue str 图片验证码值
|
||||
authToken str 之前的认证token
|
||||
*authID str 手机号或邮件
|
||||
*/
|
||||
export const sendCode = async (mobile, noLoading = true) => {
|
||||
try {
|
||||
let res = await APISendVerifyCode(json2query({
|
||||
authID: mobile,
|
||||
authToken: getCookie('Token')
|
||||
}), noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
51
src/apis/controls/brand.js
Normal file
@@ -0,0 +1,51 @@
|
||||
import api from '@/utils/api.js'
|
||||
|
||||
|
||||
// 查询品牌
|
||||
export const getBrands = async (query, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/store/GetBrands', {
|
||||
params: query,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('GetBrands', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const addBrand = async (json, noLoading = true) => {
|
||||
let form = new FormData()
|
||||
form.append('payload', JSON.stringify(json))
|
||||
try {
|
||||
let res = await api('v2/store/AddBrand', {
|
||||
method: 'POST',
|
||||
data: form,
|
||||
noLoading,
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('AddBrand', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const updateBrand = async (json, isDel = false, noLoading = true) => {
|
||||
let form = new FormData()
|
||||
form.append('payload', JSON.stringify(json))
|
||||
form.append('isDel', isDel)
|
||||
try {
|
||||
let res = await api('v2/store/UpdateBrand', {
|
||||
method: 'POST',
|
||||
data: form,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('updateBrand', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
28
src/apis/controls/config.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import {json2query} from '@/utils'
|
||||
import {APIQueryConfig, APIUpdateConfig, APIUpdateCthrConfig} from '@/apis/APIConfig.js'
|
||||
|
||||
|
||||
// 查询bannerList
|
||||
export const queryBannerList = async () => {
|
||||
try {
|
||||
const res = await APIQueryConfig('shopBanner', 'JxStore')
|
||||
return JSON.parse(res[0].value)
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 更新bannerList
|
||||
export const updateBannerList = async (value) => {
|
||||
try {
|
||||
const res = await APIUpdateConfig(json2query({
|
||||
type: 'JxStore',
|
||||
key: 'shopBanner',
|
||||
value
|
||||
}))
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
460
src/apis/controls/order.js
Normal file
@@ -0,0 +1,460 @@
|
||||
/* eslint-disable */
|
||||
import { APIComplaintRider, APIGetOrdersSupplement, APIAddUpdateOrdersSupplement, APIGetOrderInfo, APIGetMatterOrderStatus, APISendFailedMatterOrder } from '@/apis/APIOrder.js'
|
||||
import { json2query } from '@/utils'
|
||||
import api from '@/utils/api.js'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
import { hideLoad } from '@/tools/loading.js'
|
||||
/**
|
||||
* 查询订单全能接口 get /order/GetOrders
|
||||
* keyword str
|
||||
* fromDate str 2018-07-18
|
||||
* toDate str
|
||||
* vendorID int
|
||||
* storeIDs str 京西门店ID列表 []
|
||||
* statuss str 订单状态列表 [10, 15, 20, 110, 105, 115, 120]
|
||||
* cities str 城市列表 []
|
||||
* offset
|
||||
* pageSize
|
||||
*/
|
||||
export const apiGetOrder = async (json,noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/order/GetOrders', {
|
||||
params: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取售后单信息
|
||||
*/
|
||||
export const apiGetAfsOrders = async (query, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/order/GetAfsOrders', {
|
||||
params: query,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('GetOrders', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 补充评价订单号
|
||||
* userName
|
||||
* appOrgCode 菜市:589/5873 果园:4123
|
||||
* fromTime
|
||||
* toTime
|
||||
*/
|
||||
// https://www.jxc4.com/v2/store/GetOrderID4Comment?userName=jxcaishi_cookie&appOrgCode=5873&fromTime=2024-07-25&toTime=2024-08-04
|
||||
export const apiGetOrderID4Comment = async (query,noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/store/GetOrderID4Comment', {
|
||||
params: query,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (error) {
|
||||
console.error('GetOrders', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 投诉骑手(三方运送)
|
||||
// token string true "认证token"
|
||||
// vendorOrderID string true "订单号"
|
||||
// vendorID int true "订单所属厂商ID"
|
||||
// waybillVendorID int true "运单所属厂商ID"
|
||||
// complaintID int true "投诉原因ID"
|
||||
export const complainRider = async (json) => {
|
||||
try {
|
||||
await APIComplaintRider(json2query(json))
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 重发京东物流
|
||||
export const sendFailedMatterOrder = async (json) => {
|
||||
try {
|
||||
await APISendFailedMatterOrder(json2query(json))
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
//修改配送信息
|
||||
export const updateOrderInfo = async (json = {}) => {
|
||||
try {
|
||||
let { vendorOrderID, vendorID, payload } = json
|
||||
let form = new FormData()
|
||||
form.append('vendorOrderID', vendorOrderID)
|
||||
form.append('vendorID', vendorID)
|
||||
form.append('payload', payload)
|
||||
let res = await api('v2/order/UpdateOrderInfo', {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: form,
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
} finally {
|
||||
hideLoad()
|
||||
}
|
||||
}
|
||||
export const APIdelOrderSkuInfo = async (json = {}) => {
|
||||
try {
|
||||
let { vendorOrderID, vendorID, ID } = json
|
||||
let form = new FormData()
|
||||
form.append('vendorOrderID', vendorOrderID)
|
||||
form.append('vendorID', vendorID)
|
||||
form.append('ID', ID)
|
||||
let res = await api('v2/order/DelOrderSkuInfo', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: form,
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
} finally {
|
||||
hideLoad()
|
||||
}
|
||||
}
|
||||
//刷新报价订单的订单商品
|
||||
export const refreshOrderSkuInfo = async (json = {}) => {
|
||||
try {
|
||||
let { vendorOrderID, vendorID, skuID } = json
|
||||
let form = new FormData()
|
||||
form.append('vendorOrderID', vendorOrderID)
|
||||
form.append('vendorID', vendorID)
|
||||
form.append('skuID', skuID)
|
||||
let res = await api('v2/order/RefreshOrderSkuInfo', {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: form,
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
} finally {
|
||||
hideLoad()
|
||||
}
|
||||
}
|
||||
// 查询门店订单扣款记录
|
||||
/*
|
||||
storeIDs 门店ID列表
|
||||
vendorOrderID 订单ID
|
||||
vendorIDs 订单所属厂商ID列表
|
||||
fromTime 开始日期(包含),格式(2006-01-02),如果订单号为空此项必须要求
|
||||
toTime 结束日期(包含),格式(2006-01-02),如果订单号为空此项必须要求
|
||||
status 账单状态,0是未结账,1是已结账
|
||||
type 扣款类型,1为差评补贴,2为优惠券
|
||||
offset 结果起始序号(以0开始,缺省为0)
|
||||
pageSize 结果页大小(缺省为50,-1表示全部
|
||||
*/
|
||||
export const getOrdersSupplement = async (json, noLoading = true) => {
|
||||
try {
|
||||
let res = await APIGetOrdersSupplement(json, noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 新增/修改扣款记录
|
||||
// payload
|
||||
/*
|
||||
新增
|
||||
storeID int
|
||||
vendorOrderID string
|
||||
vendorID string
|
||||
type int //扣款类型,1为差评订单补贴,2为优惠券
|
||||
linkID int //作为冲账标志关联某条扣款记录,若新增为某一记录的冲账,则此字段填那条记录的id
|
||||
supplementFee int //扣款金额
|
||||
comment string //备注
|
||||
|
||||
----
|
||||
修改
|
||||
id int
|
||||
createdAt time
|
||||
storeID int
|
||||
vendorOrderID string
|
||||
vendorID string
|
||||
status int //账单状态,若已结账则不允许再修改 ,暂时 0为未结账,1为已结账,-1为作废
|
||||
linkID int //作为冲账标志关联某条扣款记录
|
||||
type int //扣款类型,1为差评订单补贴,2为优惠券
|
||||
supplementFee int //扣款金额
|
||||
billID string //账单ID,后期可能关联账单用
|
||||
comment string //备注
|
||||
*/
|
||||
export const addUpdateOrdersSupplement = async (payload, noLoading = true) => {
|
||||
try {
|
||||
let res = await APIAddUpdateOrdersSupplement(json2query({
|
||||
payload: JSON.stringify(payload)
|
||||
}), noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 得到订单详情
|
||||
// vendorOrderID
|
||||
// vendorID
|
||||
// refresh
|
||||
export const getOrderInfo = async (json, noLoading = true) => {
|
||||
try {
|
||||
let res = await APIGetOrderInfo({
|
||||
...json,
|
||||
refresh: false
|
||||
}, noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const getMatterOrderStatus = async (vendorOrderID) => {
|
||||
try {
|
||||
const res = await APIGetMatterOrderStatus({ vendorOrderID })
|
||||
return res || []
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加小费
|
||||
* @param {*} vendorOrderID 订单号
|
||||
* @param {*} vendorID 厂商ID
|
||||
* @param {*} tipFee 小费
|
||||
*/
|
||||
export const updateOrderWaybillTip = async ({
|
||||
vendorOrderID,
|
||||
vendorID,
|
||||
tipFee
|
||||
}) => {
|
||||
try {
|
||||
const res = await api('v2/order/UpdateOrderWaybillTip', {
|
||||
method: 'POST',
|
||||
data: json2query({
|
||||
vendorOrderID,
|
||||
vendorID,
|
||||
tipFee
|
||||
}),
|
||||
noLoading: true
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
export const updateOrderWaybillDesiredFee = async ({
|
||||
vendorOrderID,
|
||||
desiredFee,
|
||||
}) => {
|
||||
let formData = new FormData()
|
||||
formData.append('vendorOrderID', vendorOrderID)
|
||||
formData.append('desiredFee', desiredFee)
|
||||
try {
|
||||
const res = await api('v2/order/UpdateWaybillDesiredFee', {
|
||||
method: 'PUT',
|
||||
data: formData,
|
||||
noLoading: true
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
//刷新京东商城收货人信息
|
||||
export const refreshReceiveManInfo = async (vendorOrderID) => {
|
||||
let formData = new FormData()
|
||||
formData.append('vendorOrderID', vendorOrderID)
|
||||
try {
|
||||
const res = await api('v2/order/RefreshJdsOrderConsigneeInfo', {
|
||||
method: 'PUT',
|
||||
data: formData,
|
||||
noLoading: true
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
//售前删除
|
||||
export const delBeforeSale = async (skuID, vendorOrderID) => {
|
||||
let formData = new FormData()
|
||||
formData.append('vendorOrderID', vendorOrderID)
|
||||
formData.append('skuID', skuID)
|
||||
try {
|
||||
const res = await api('v2/order/AdjustJdsOrderSimple', {
|
||||
method: 'POST',
|
||||
data: formData,
|
||||
noLoading: true
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
得到订单sku信息 get /order/GetOrderSkuInfo
|
||||
vendorOrderID str 订单ID
|
||||
vendorID int 订单所属厂商ID
|
||||
*/
|
||||
export const getOrderSkus = async (vendorOrderID,vendorID, noLoading = true) => {
|
||||
try {
|
||||
let res = await api('v2/order/GetOrderSkuInfo', {
|
||||
params: {
|
||||
vendorOrderID,
|
||||
vendorID
|
||||
},
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('SendFailedMatterOrder', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 扫码枪 京西门店订单扫码枪扫码支付 post
|
||||
* @Param token header string true "认证token"
|
||||
* @Param vendorOrderID formData string true "订单ID"
|
||||
* @Param paymentLabel formData string true "支付身份标示"
|
||||
*
|
||||
* @Param payType formData string true "扫码方式[tonglian/lakala]"
|
||||
*
|
||||
*/
|
||||
export const pay4OrderByBarCodeScanner =async (vendorOrderID,paymentLabel,noLoading = false) => {
|
||||
try {
|
||||
let form = new FormData()
|
||||
form.append('vendorOrderID', vendorOrderID)
|
||||
form.append('paymentLabel', paymentLabel)
|
||||
form.append('payType', 'lakala')
|
||||
let res = await api('v2/jxorder/Pay4OrderByBarCodeScanner', {
|
||||
method: 'POST',
|
||||
data: form,
|
||||
noLoading
|
||||
})
|
||||
if(res.includes('该终端不存在,请进行新增操作')){
|
||||
throw res
|
||||
}else {
|
||||
return res
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('pay4OrderByBarCodeScanner', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 扫码枪 手动刷新扫码枪扫码支付订单状态 post
|
||||
* @Param token header string true "认证token"
|
||||
* @Param vendorOrderID formData string true "订单ID"
|
||||
* @Param payType formData string true "扫码方式[tonglian/lakala]"
|
||||
*
|
||||
*/
|
||||
export const refreshPayStatus =async (vendorOrderID,paymentLabel,noLoading = false) => {
|
||||
try {
|
||||
let form = new FormData()
|
||||
form.append('vendorOrderID', vendorOrderID)
|
||||
form.append('payType', 'lakala')
|
||||
let res = await api('v2/jxorder/RefreshPayStatus', {
|
||||
method: 'POST',
|
||||
data: form,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('refreshPayStatus', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 扫码枪 到店扫码支付订单退款 收获退款 post
|
||||
* @Param token header string true "认证token"
|
||||
* @Param vendorOrderID formData string true "订单ID"
|
||||
* @Param skuIds formData string true "[key:value]退款商品 skuId:count,int"
|
||||
* @Param Reason formData string true "退单原因"
|
||||
*
|
||||
* @Param payType formData string true "扫码方式[tonglian/lakala]"
|
||||
*
|
||||
*/
|
||||
export const refundOnlineOrder = async (vendorOrderID,skuIds,reason,noLoading = false,payType) => {
|
||||
try {
|
||||
let form = new FormData()
|
||||
form.append('vendorOrderID', vendorOrderID)
|
||||
form.append('skuIds', JSON.stringify(skuIds))
|
||||
form.append('reason', reason)
|
||||
if(payType) form.append('payType', 'lakala')
|
||||
let res = await api('v2/jxorder/RefundOnlineOrder', {
|
||||
method: 'POST',
|
||||
data: form,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('refundOnlineOrder', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 支付宝 扫码枪 注册到通联,每个门店只有一个,要更改,必须先注销
|
||||
* @router /TerminalRegister [post]
|
||||
* @Param token header string true "认证token"
|
||||
* @Param storeId formData int true "京西门店ID"
|
||||
* @Param operation formData string true "当前操作00-新增,02-注销"
|
||||
*/
|
||||
export const terminalRegister = async (storeId,operation) => {
|
||||
try {
|
||||
let form = new FormData()
|
||||
form.append('storeId', storeId)
|
||||
form.append('operation', operation)
|
||||
let res = await api('v2/jxorder/TerminalRegister', {
|
||||
method: 'POST',
|
||||
data:form
|
||||
})
|
||||
return res
|
||||
} catch (error) {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 扫码订单刷新售后信息
|
||||
* @Param afsOrderId formData string true 售后订单id
|
||||
* @Param payType formData string true "扫码方式[tl/lkl]"
|
||||
*/
|
||||
export const queryBarCodeRefundStatus = async (afsOrderId,payType = 'lakala') => {
|
||||
try {
|
||||
let form = new FormData()
|
||||
form.append('afsOrderId', afsOrderId)
|
||||
form.append('payType', payType)
|
||||
let res = await api('v2/jxorder/QueryBarCodeRefundStatus', {
|
||||
method: 'POST',
|
||||
data:form
|
||||
})
|
||||
return res
|
||||
} catch (error) {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
42
src/apis/controls/promotion.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import {
|
||||
APIQueryActs,
|
||||
APIUpdateActStoreSkuBind
|
||||
} from '@/apis/APIPromotion.js'
|
||||
import {getStoreSku} from '@/apis/controls/storeSku.js'
|
||||
import {json2query} from '@/utils'
|
||||
|
||||
// 改价取消直降活动
|
||||
export const updatePriceCancelType3Promotions = async (nameID, storeID) => {
|
||||
try {
|
||||
// 先查询skuIDs
|
||||
const {skus} = await getStoreSku(storeID, nameID)
|
||||
const reqPromotions = []
|
||||
if (skus) {
|
||||
// skus存在,查询活动
|
||||
skus.forEach(item => {
|
||||
if (item.actType === 3) {
|
||||
reqPromotions.push(APIQueryActs({skuID: item.id, storeID}))
|
||||
}
|
||||
})
|
||||
}
|
||||
const promotions = await Promise.all(reqPromotions)
|
||||
const reqCancels = []
|
||||
promotions.forEach(data => {
|
||||
if (data) {
|
||||
data.forEach(item => {
|
||||
reqCancels.push(APIUpdateActStoreSkuBind(json2query({
|
||||
actID: item.actID,
|
||||
actStoreSkuDeleteList: JSON.stringify([{
|
||||
skuID: item.skuID,
|
||||
storeID: item.storeID
|
||||
}]),
|
||||
isAsync: true
|
||||
})))
|
||||
})
|
||||
}
|
||||
})
|
||||
await Promise.all(reqCancels)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
68
src/apis/controls/report.js
Normal file
@@ -0,0 +1,68 @@
|
||||
import {APIReportForOrders,APIGetStoreManageState} from '@/apis/APIreport.js'
|
||||
import {json2query} from '@/utils'
|
||||
|
||||
/* token *
|
||||
string
|
||||
(header)
|
||||
认证token
|
||||
|
||||
storeIDs *
|
||||
string
|
||||
(formData)
|
||||
京西门店ID列表[1,2,3]
|
||||
|
||||
fromDate
|
||||
string
|
||||
(formData)
|
||||
开始日期(包含),格式(2006-01-02 00:00:00)
|
||||
|
||||
toDate
|
||||
string
|
||||
(formData)
|
||||
结束日期(包含) */
|
||||
|
||||
export const orderReport = async (json) => {
|
||||
try {
|
||||
let res = await APIReportForOrders(json2query(json))
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
//查询门店经营数据
|
||||
export const getStoreManageState = async (json) => {
|
||||
try {
|
||||
let res = await APIGetStoreManageState(json)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
/* [{}]
|
||||
storeID: 100113 // 门店ID
|
||||
name // 门店名称
|
||||
|
||||
marketManName // 市场负责人
|
||||
operatorName // 运营负责人1
|
||||
operatorName2 // 运营负责人2
|
||||
|
||||
orderCounts: 386 // 订单数量
|
||||
discountMoney: 502664 // 订单优惠
|
||||
|
||||
actualPayPrice: 1698830 // 实际支付
|
||||
earningPrice: 0 // 预计收益
|
||||
|
||||
salePrice: 2026184 // 售卖价
|
||||
shopPrice: 1996349 // 京西价
|
||||
|
||||
desiredFee: 1000 // 配送费
|
||||
waybillTipMoney: 5200 // 京西已加配送小费
|
||||
distanceFreightMoney: 18400 // 远距离配送费
|
||||
|
||||
pmSubsidyMoney: 120759 // 平台补贴
|
||||
totalShopMoney: 1457947 // 平台结算
|
||||
|
||||
totalGrossProfit: 132962 // 总毛利
|
||||
comGrossProfit: 132962 // 公司毛利
|
||||
cityManagerGrossProfit: 0 // 城市经理毛利
|
||||
*/
|
||||
135
src/apis/controls/shop.js
Normal file
@@ -0,0 +1,135 @@
|
||||
import { APIGetStores, APIAddStoreMap, APIUpdateStoreMap, APISendStoreMessage, APIUpdateStore, APIGetVendorStore } from '@/apis/APIshop.js'
|
||||
import { json2query } from '@/utils'
|
||||
|
||||
// 跳转到门店
|
||||
export const goStore = (context, storeID) => {
|
||||
let routeData = context.$router.resolve({
|
||||
name: 'JxStoreManager',
|
||||
query: { storeID }
|
||||
})
|
||||
window.open(routeData.href, '_blank')
|
||||
}
|
||||
|
||||
// 查询门店
|
||||
export const getStores = async (json, noLoading) => {
|
||||
try {
|
||||
let res = await APIGetStores(json2query(json), noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const proxyGetStores = (function () {
|
||||
const cacheObj = {}
|
||||
return function () {
|
||||
let args = Array.prototype.join.call(arguments, ',')
|
||||
if (args in cacheObj) {
|
||||
return cacheObj[args]
|
||||
}
|
||||
cacheObj[args] = getStores(...arguments)
|
||||
return cacheObj[args]
|
||||
}
|
||||
})()
|
||||
|
||||
// 通过关键字查询所有门店
|
||||
export const getAllStoresByKeyword = async (marketManPhone, noLoading) => {
|
||||
try {
|
||||
let res = await getStores({
|
||||
marketManPhone,
|
||||
offset: 0,
|
||||
pageSize: -1
|
||||
}, noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 查询单个门店信息
|
||||
export const getOneStore = async (storeID, noLoading = true) => {
|
||||
try {
|
||||
let res = await getStores({
|
||||
storeIDs: JSON.stringify([storeID]),
|
||||
offset: 0,
|
||||
pageSize: -1
|
||||
}, noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加平台门店绑定
|
||||
* @param {*} storeID
|
||||
* @param {*} vendorID
|
||||
* @param {*} vendorOrgCode 选填
|
||||
* @param {*} payload {"vendorStoreID":"103083","autoPickup":1,"deliveryCompetition":1,"pricePercentage":100,"isSync":1,"pricePercentagePack":"美团调价策略7.18"}
|
||||
*/
|
||||
export const addStoreMap = async (json, noLoading = false) => {
|
||||
try {
|
||||
await APIAddStoreMap(json2query(json), noLoading)
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改平台门店绑定
|
||||
* @param {*} storeID
|
||||
* @param {*} vendorID
|
||||
* @param {*} payload {"vendorStoreID":"103083","autoPickup":1,"deliveryCompetition":1,"pricePercentage":100,"isSync":1,"pricePercentagePack":"美团调价策略7.18"}
|
||||
*/
|
||||
export const updateStoreMap = async (json, noLoading = false) => {
|
||||
try {
|
||||
await APIUpdateStoreMap(json2query(json), noLoading)
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改门店
|
||||
* @param {*} storeID
|
||||
* @param {*} payload
|
||||
*/
|
||||
export const updateStore = async (json, noLoading = false) => {
|
||||
try {
|
||||
await APIUpdateStore(json2query(json), noLoading)
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/* 发送消息
|
||||
storeIDs
|
||||
title
|
||||
content
|
||||
isAsync
|
||||
isContinueWhenError
|
||||
*/
|
||||
export const sendMsg = async (json, noLoading = false) => {
|
||||
try {
|
||||
let res = await APISendStoreMessage(json2query(json), noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// 更新门店信息
|
||||
|
||||
/* 查询远端门店
|
||||
vendorStoreID
|
||||
vendorID
|
||||
vendorOrgCode
|
||||
*/
|
||||
export const getVendorStore = async (json) => {
|
||||
try {
|
||||
const res = await APIGetVendorStore(json)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
64
src/apis/controls/skuNames.js
Normal file
@@ -0,0 +1,64 @@
|
||||
import {APIGetSkuNames,APIGetSkuNamesNew, APIGetTopSkusByCityCode, APIGetSkuNamesPOST} from '@/apis/APISkuNames'
|
||||
import {json2query} from '@/utils'
|
||||
|
||||
export const getSkuNames = async (json, noLoading) => {
|
||||
try {
|
||||
let res = await APIGetSkuNames(json, noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
export const getSkuNamesNew = async (json, noLoading) => {
|
||||
try {
|
||||
let res = await APIGetSkuNamesNew(json, noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
export const getSkuNamesPOST = async (json, noLoading) => {
|
||||
try {
|
||||
let res = await APIGetSkuNamesPOST(json2query(json), noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const getSkuNamesBySkuIDs = async (skuIDs) => {
|
||||
try {
|
||||
let res = await getSkuNamesPOST({
|
||||
skuIDs: JSON.stringify(skuIDs),
|
||||
offset: 0,
|
||||
pageSize: -1,
|
||||
isBySku: true
|
||||
}, true)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const getSkuNamesByNameIDs = async (nameIDs) => {
|
||||
try {
|
||||
let {skuNames} = await getSkuNames({
|
||||
nameIDs: JSON.stringify(nameIDs),
|
||||
offset: 0,
|
||||
pageSize: -1,
|
||||
isBySku: false
|
||||
}, true)
|
||||
return skuNames
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const getTopSkusByCityCode = async (json) => {
|
||||
try {
|
||||
let res = APIGetTopSkusByCityCode(json)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
111
src/apis/controls/storeSku.js
Normal file
@@ -0,0 +1,111 @@
|
||||
import {
|
||||
APIUpdateStoreSkus,
|
||||
APIGetStoresSkus,
|
||||
APIStoreSkuPriceAudit,
|
||||
APIUpdateStoresSkusWithoutSync,
|
||||
APIStoreAudit
|
||||
} from '@/apis/APIstoreSku.js'
|
||||
import { json2query } from '@/utils'
|
||||
|
||||
/* 修改单门店商品
|
||||
storeID
|
||||
payload
|
||||
isContinueWhenError
|
||||
isAsync
|
||||
|
||||
----payload
|
||||
|
||||
{
|
||||
nameID: id,
|
||||
unitPrice: price,
|
||||
isFocus: ,
|
||||
statusSaleBegin
|
||||
statusSaleEnd
|
||||
skus: [
|
||||
{
|
||||
skuID: id,
|
||||
isSale:
|
||||
}
|
||||
]
|
||||
}
|
||||
*/
|
||||
export const updateStoreSkus = async (json, noLoading = false) => {
|
||||
try {
|
||||
json.storeIDs = [json.storeID]
|
||||
let res = await APIUpdateStoreSkus(json2query(json), noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const getStoreSku = async (storeID, skuNameID, isFocus = true) => {
|
||||
try {
|
||||
const { skuNames } = await APIGetStoresSkus({
|
||||
nameIDs: JSON.stringify([skuNameID]),
|
||||
storeIDs: JSON.stringify([storeID]),
|
||||
isFocus
|
||||
})
|
||||
return skuNames ? skuNames[0] : null
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const getStoreSkus = async (storeID, skuIDs, isFocus = true) => {
|
||||
try {
|
||||
const { skuNames } = await APIGetStoresSkus({
|
||||
skuIDs: JSON.stringify(skuIDs),
|
||||
storeIDs: JSON.stringify([storeID]),
|
||||
isFocus,
|
||||
fromStatus: 0,
|
||||
toStatus: 1,
|
||||
pageSize: -1,
|
||||
isBySku: true
|
||||
})
|
||||
return skuNames || []
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* status 1 批准 -1 拒绝
|
||||
* isAsync
|
||||
* isContinueWhenError
|
||||
* payload: [{}]
|
||||
StoreID int `orm:"column(store_id)" json:"storeID"`
|
||||
NameID int `orm:"column(name_id)" json:"nameID"` // 这个根据type不同,可能是SKUNAME ID或SKU ID
|
||||
AuditPrice int `json:"auditPrice"` //运营录入的审核价格
|
||||
Remark string `orm:"size(255)" json:"remark"`
|
||||
*/
|
||||
export const storeSkuPriceAudit = async (json, noLoading) => {
|
||||
try {
|
||||
return await APIStoreSkuPriceAudit(json2query(json))
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
export const storeAudit = async (json, noLoading) => {
|
||||
try {
|
||||
return await APIStoreAudit(json2query(json))
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 批量修改门店商品,不同步
|
||||
* @param {*} json 数据
|
||||
* @param {*} noLoading 不显示loading
|
||||
* storeIDs
|
||||
* payload
|
||||
* payload=[{nameID, unitPrice, isFocus, isSale}]
|
||||
* isRefreshHigh
|
||||
*/
|
||||
export const updateStoresSkusWithoutSync = async (json) => {
|
||||
try {
|
||||
return await APIUpdateStoresSkusWithoutSync(json2query(json))
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
87
src/apis/controls/user.js
Normal file
@@ -0,0 +1,87 @@
|
||||
import {APIGetUsers, APIAddUsers4Role, APIUpdateUserWxNoAndPercent, APIDeleteUserInfo} from '@/apis/APIUser'
|
||||
import {json2query} from '@/utils'
|
||||
|
||||
/**
|
||||
* 得到用户列表
|
||||
* GET
|
||||
* /user2/GetUsers
|
||||
* @param {Number} userType* 用户类型(0表示全部)
|
||||
* @param {String} keyword 关键字
|
||||
* ...userIDs
|
||||
*/
|
||||
// 得到一个用户
|
||||
export const getOneUser = async (keyword, noLoading = true) => {
|
||||
try {
|
||||
let {totalCount, data} = await APIGetUsers({
|
||||
userType: 0,
|
||||
keyword
|
||||
}, noLoading)
|
||||
return totalCount ? data[0] : null
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
// 得到一个用户
|
||||
export const getOneUserInfoWithAuth = async (mobile, noLoading = true) => {
|
||||
try {
|
||||
let {totalCount, data} = await APIGetUsers({
|
||||
userType: 0,
|
||||
mobile
|
||||
}, noLoading)
|
||||
return totalCount ? data[0] : null
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 给指定**角色**添加**用户**列表
|
||||
* POST
|
||||
* /user2/AddUsers4Role
|
||||
* formData
|
||||
* @param {String} roleName* 角色名 (必填)
|
||||
* @param {Number} storeID 门店ID
|
||||
* @param {Array<String>} userIDs* 用户ID列表 (必填)
|
||||
*/
|
||||
|
||||
// 给门店添加用户
|
||||
export const addUsers4Role = async (json, noLoading = true) => {
|
||||
try {
|
||||
let res = await APIAddUsers4Role(json2query(json), noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户分成比例
|
||||
* userID
|
||||
* dividePercentage
|
||||
* isReceiver
|
||||
*/
|
||||
export const updateUserPercent = async (json, noLoading = true) => {
|
||||
try {
|
||||
const reqJson = {
|
||||
...json,
|
||||
isReceiver: true
|
||||
}
|
||||
let res = await APIUpdateUserWxNoAndPercent(json2query(reqJson), noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁用用户
|
||||
* @param {*} userID
|
||||
* @param {*} noLoading
|
||||
*/
|
||||
export const deleteUser = async (userID, noLoading = true) => {
|
||||
try {
|
||||
const res = await APIDeleteUserInfo(userID, noLoading)
|
||||
return res
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
30
src/apis/financial.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import $ajax from 'axios'
|
||||
// import {Message} from 'element-ui'
|
||||
import {hideLoad} from '@/tools/loading.js' // 引入封装的loading方法
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
|
||||
|
||||
/*
|
||||
查询任务进度 get /task/GetTasks
|
||||
taskID str 任务ID
|
||||
fromStatus int 起始状态
|
||||
toStatus int 结束状态
|
||||
lastHours int 多少小时以内的
|
||||
*/
|
||||
function getTasks (params, fn) {
|
||||
$ajax.get('v2/task/GetTasks', {
|
||||
params: params
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export {getTasks}
|
||||
21
src/apis/getServiceInfo.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import $ajax from 'axios'
|
||||
// import {Message} from 'element-ui'
|
||||
import {hideLoad} from '@/tools/loading.js'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
/*
|
||||
得到服务相关的一些基础信息,包括版本,及一些元数据信息 get /cms/GetServiceInfo
|
||||
*/
|
||||
function getServiceInfo (fn) {
|
||||
$ajax.get('v2/cms/GetServiceInfo').then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export {getServiceInfo}
|
||||
245
src/apis/goods.js
Normal file
@@ -0,0 +1,245 @@
|
||||
import $ajax from 'axios'
|
||||
// import {Message} from 'element-ui'
|
||||
import {hideLoad} from '@/tools/loading.js'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
import api from '@/utils/api.js'
|
||||
|
||||
/*
|
||||
得到商品信息 get /sku/GetSkuNames
|
||||
keyword str 查询关键字
|
||||
nameIDs str SkuName IDs列表
|
||||
skuIDs str Sku ID列表
|
||||
id int SkuName ID
|
||||
name str 商品名称
|
||||
prefix str 商品前缀
|
||||
placeCode int 可售地点Code
|
||||
isGlobal boo 是否全国可售
|
||||
categoryID int 商品所属类别ID
|
||||
skuCategoryID int sku分类
|
||||
unit str 商品单位
|
||||
vendorSkuIDs str 商品平台ID
|
||||
fromStatus int 查询起始状态(0正常 1下架)
|
||||
toStatus int 查询结束状态(0正常 1下架)
|
||||
offset int 起始序号
|
||||
pageSize int 列表页大小 -1表示全部
|
||||
nameIDs
|
||||
skuIDs
|
||||
*/
|
||||
|
||||
function getSkuNames (json, fn) {
|
||||
$ajax.get('v2/sku/GetSkuNames', {
|
||||
params: json
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
function getSkuNamesNew (json, fn) {
|
||||
$ajax.get('v2/sku/GetSkuNamesNew', {
|
||||
params: json
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
/*
|
||||
删除整个商品 skuName delete /sku/DeleteSkuName
|
||||
nameID int 商品名ID
|
||||
*/
|
||||
|
||||
function deleteSkuName (nameID, fn) {
|
||||
$ajax.delete('v2/sku/DeleteSkuName', {
|
||||
params: {
|
||||
nameID
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
export async function deleteSkuName2 (nameID, fn, noSyncAlert) {
|
||||
try {
|
||||
let res = await api('v2/sku/DeleteSkuName', {
|
||||
method: 'DELETE',
|
||||
params: {
|
||||
nameID
|
||||
},
|
||||
noSyncAlert
|
||||
})
|
||||
if (res.code && res.code === '-105') {
|
||||
fn && fn(res)
|
||||
} else {
|
||||
fn && fn({code: '0'})
|
||||
}
|
||||
} catch (e) {
|
||||
fn && fn(e)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
删除商品规格sku delete /sku/DeleteSku
|
||||
skuID int 商品ID
|
||||
*/
|
||||
async function deleteSku (skuID, fn) {
|
||||
try {
|
||||
let res = await api('v2/sku/DeleteSku', {
|
||||
method: 'DELETE',
|
||||
params: {
|
||||
skuID
|
||||
}
|
||||
})
|
||||
if (res.code && res.code === '-105') {
|
||||
fn && fn(res)
|
||||
} else {
|
||||
fn && fn({code: '0'})
|
||||
}
|
||||
} catch (e) {
|
||||
fn && fn(e)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
修改SkuName put /sku/UpdateSkuName
|
||||
nameID int 商品名ID
|
||||
payload str json skus, places无效
|
||||
*/
|
||||
async function updateSkuName (nameID, json, fn, extraJson) {
|
||||
try {
|
||||
let data = `nameID=${nameID}&payload=${encodeURIComponent(JSON.stringify(json))}`
|
||||
if (extraJson && ('isExd' in extraJson)) {
|
||||
data += `&isExd=true`
|
||||
}
|
||||
let res = await api('v2/sku/UpdateSkuName', {
|
||||
method: 'PUT',
|
||||
data
|
||||
})
|
||||
if (res.code && res.code === '-105') {
|
||||
fn && fn(res)
|
||||
} else {
|
||||
fn && fn({code: '0'})
|
||||
}
|
||||
} catch (e) {
|
||||
fn && fn(e)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
得到厂商商品类别 get /sku/GetVendorCategories
|
||||
vendorID int 厂商ID
|
||||
parentID int -1表示所有,缺省为-1
|
||||
*/
|
||||
|
||||
/*
|
||||
增加商品 post /sku/AddSkuName
|
||||
payload json
|
||||
*/
|
||||
function AddSkuName (json, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('payload', JSON.stringify(json))
|
||||
$ajax.post('v2/sku/AddSkuName', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
更新sku put /sku/UpdateSku
|
||||
skuID int 商品名id
|
||||
payload json
|
||||
*/
|
||||
async function updateSku (skuID, json, fn) {
|
||||
try {
|
||||
let res = await api('v2/sku/UpdateSku', {
|
||||
method: 'PUT',
|
||||
data: `skuID=${skuID}&payload=${encodeURIComponent(JSON.stringify(json))}`
|
||||
})
|
||||
if (res.code && res.code === '-105') {
|
||||
fn && fn(res)
|
||||
} else {
|
||||
fn && fn({code: '0'})
|
||||
}
|
||||
} catch (e) {
|
||||
fn && fn(e)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
添加sku post /sku/AddSku
|
||||
nameID int skuName ID
|
||||
payload json
|
||||
*/
|
||||
async function AddSku (nameID, json, fn) {
|
||||
try {
|
||||
let res = await api('v2/sku/AddSku', {
|
||||
method: 'POST',
|
||||
data: `nameID=${nameID}&payload=${encodeURIComponent(JSON.stringify(json))}`
|
||||
})
|
||||
if (res.code && res.code === '-105') {
|
||||
fn && fn(res)
|
||||
} else {
|
||||
fn && fn({code: '0', data: res})
|
||||
}
|
||||
} catch (e) {
|
||||
fn && fn(e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分类信息
|
||||
*/
|
||||
async function getCate(params,noLoading =true) {
|
||||
try {
|
||||
let res = await api('v2/sku/GetVendorCategories', {
|
||||
params,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (error) {
|
||||
console.log('error',error)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
添加sku post /sku/AddSku
|
||||
nameID int skuName ID
|
||||
payload json
|
||||
*/
|
||||
function transformJdSpu2SkuApi (nameIDs, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('nameIDs', nameIDs)
|
||||
$ajax.post('v2/initdata/TransformJdSpu2Sku', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
export {getSkuNames, getSkuNamesNew,deleteSku, deleteSkuName, updateSkuName, AddSkuName, updateSku, AddSku, transformJdSpu2SkuApi,getCate}
|
||||
133
src/apis/groupmanager.js
Normal file
@@ -0,0 +1,133 @@
|
||||
import $ajax from 'axios'
|
||||
// import {Message} from 'element-ui'
|
||||
import {hideLoad} from '@/tools/loading.js'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
|
||||
/*
|
||||
得到门店用户信息 get /user/TmpGetStoreUsers
|
||||
storeID int jx门店ID
|
||||
*/
|
||||
function getStoreUsers (storeID, fn) {
|
||||
$ajax.get('v2/user/TmpGetStoreUsers', {
|
||||
params: {
|
||||
storeID
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
得到用户门店及成员信息 get /user/TmpGetUserInfo
|
||||
mobile str 手机号
|
||||
*/
|
||||
function getUserInfo (mobile, fn) {
|
||||
$ajax.get('v2/user/TmpGetUserInfo', {
|
||||
params: {
|
||||
mobile
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
解绑 put /user/TmpUnbindMobile
|
||||
此操作会将此手机关联的所有门店信息清除(取消组长,取消自己为他组组员),如果此人为组长,取消后组员也相应会取消门店绑定(但组员的成员关系还在)
|
||||
mobile str 手机号
|
||||
*/
|
||||
function unbindMobile (mobile, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('mobile', mobile)
|
||||
$ajax.put('v2/user/TmpUnbindMobile', formData).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
给店长绑定组员 put
|
||||
/user/TmpAddMobile2Mobile
|
||||
parentMobile str 店长手机号
|
||||
mobile str 要绑定的手机号
|
||||
*/
|
||||
function addMobile2Mobile (parentMobile, mobile, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('parentMobile', parentMobile)
|
||||
formData.append('mobile', mobile)
|
||||
$ajax.put('v2/user/TmpAddMobile2Mobile', formData).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
绑定店长 put /user/TmpBindMobile2Store
|
||||
此操作会将此手机设置成为相应门的组长,如果之前有组员关系,则此操作后,组员也会自动与门店绑定
|
||||
mobile str 手机号
|
||||
storeID int 门店ID
|
||||
*/
|
||||
function bindMobile2Store (mobile, storeID, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('mobile', mobile)
|
||||
formData.append('storeID', storeID)
|
||||
$ajax.put('v2/user/TmpBindMobile2Store', formData).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
修改手机号 put /user/TmpChangeMobile
|
||||
curMobile str 当前手机号
|
||||
expectedMobile str 手机号
|
||||
*/
|
||||
function changeMobile (curMobile, expectedMobile, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('curMobile', curMobile)
|
||||
formData.append('expectedMobile', expectedMobile)
|
||||
$ajax.put('v2/user/TmpChangeMobile', formData).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export {getStoreUsers, getUserInfo, unbindMobile, addMobile2Mobile, bindMobile2Store, changeMobile}
|
||||
1227
src/apis/lakala/lakala.js
Normal file
53
src/apis/login.js
Normal file
@@ -0,0 +1,53 @@
|
||||
import $ajax from 'axios'
|
||||
// import {Message} from 'element-ui'
|
||||
import {hideLoad} from '@/tools/loading.js' // 引入封装的loading方法
|
||||
import {getRoot} from '@/utils/updateCheck.js'
|
||||
|
||||
// 登录成功接口 post
|
||||
// id str
|
||||
// type str 当前支持[weixinsns,localpass]
|
||||
// secret str 密码
|
||||
function reqLogin (id, secret, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('id', id)
|
||||
formData.append('type', 'localpass')
|
||||
formData.append('secret', secret)
|
||||
$ajax.post('/v2/auth/Login', formData).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
function reqLogin2 (loginForm, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('authType', loginForm.authType)
|
||||
formData.append('authIDType', loginForm.authIDType)
|
||||
formData.append('authID', loginForm.authID)
|
||||
formData.append('authSecret', loginForm.authSecret)
|
||||
$ajax.post('v2/auth2/Login', formData).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
// 获取用户信息 get
|
||||
// token str
|
||||
async function getUserInfo (token, fn) {
|
||||
await getRoot()
|
||||
$ajax.get('v2/auth2/GetTokenInfo', {}, {
|
||||
headers: {
|
||||
token: token
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export {reqLogin, reqLogin2, getUserInfo}
|
||||
352
src/apis/order.js
Normal file
@@ -0,0 +1,352 @@
|
||||
import $ajax from 'axios'
|
||||
import { Message } from 'element-ui'
|
||||
import { hideLoad } from '@/tools/loading.js' // 引入封装的loading方法
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
import { json2query } from '@/utils'
|
||||
// import {api} from '@/utils/api'
|
||||
|
||||
// 同步方法
|
||||
|
||||
// 获取订单数量 get
|
||||
|
||||
function getOrderCount(fn) {
|
||||
$ajax.get('/mock/getOrderCount').then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === 'success') {
|
||||
fn && fn(res.data.data)
|
||||
} else {
|
||||
Message({
|
||||
message: res.msg
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
// 今日营业概况 get
|
||||
function getBusinessInfo(fn) {
|
||||
$ajax.get('/mock/businessInfo').then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === 'success') {
|
||||
fn && fn(res.data.data)
|
||||
} else {
|
||||
Message({
|
||||
message: res.msg,
|
||||
center: true
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
// 个平台概况 get
|
||||
function getPlatformInfo(fn) {
|
||||
$ajax.get('/mock/platformInfo').then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === 'success') {
|
||||
fn && fn(res.data.data)
|
||||
} else {
|
||||
Message({
|
||||
message: res.msg
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
创建三方运单 post /order/CreateWaybillOnProviders
|
||||
vendorOrderID str 订单ID
|
||||
vendorID int 订单所属厂商ID
|
||||
*/
|
||||
function createWaybill(vendorOrderID, vendorID, forceCreate, maxAddFee, maxDiffFee2Mtps, courierVendorIDs, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('vendorOrderID', vendorOrderID)
|
||||
formData.append('vendorID', vendorID)
|
||||
formData.append('forceCreate', forceCreate)
|
||||
if (courierVendorIDs && courierVendorIDs.length > 0) formData.append('courierVendorIDs', JSON.stringify(courierVendorIDs))
|
||||
if (maxAddFee) formData.append('maxAddFee', maxAddFee)
|
||||
if (maxDiffFee2Mtps) formData.append('maxDiffFee2Mtps', maxDiffFee2Mtps)
|
||||
$ajax.post('/v2/order/CreateWaybillOnProviders', formData).then(res => {
|
||||
hideLoad() // 关闭加载中
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
// 弹出提示框
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad() // 关闭加载中
|
||||
})
|
||||
}
|
||||
export function createWaybillForce(vendorOrderID, vendorID, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('vendorOrderID', vendorOrderID)
|
||||
formData.append('vendorID', vendorID)
|
||||
formData.append('forceCreate', true)
|
||||
|
||||
$ajax.post('/v2/order/CreateWaybillOnProviders', formData).then(res => {
|
||||
hideLoad() // 关闭加载中
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
// 弹出提示框
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad() // 关闭加载中
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
取消订单当前所有三方运单 post /order/order/CancelAll3rdWaybills
|
||||
vendorOrderID str 订单ID
|
||||
vendorID int 订单所属厂商ID
|
||||
*/
|
||||
function cancelAll3rdWaybillsApi(vendorOrderID, vendorID, fn, isStopSchedule) {
|
||||
let formData = new FormData()
|
||||
formData.append('vendorOrderID', vendorOrderID)
|
||||
formData.append('vendorID', vendorID)
|
||||
if (isStopSchedule) formData.append('isStopSchedule', true)
|
||||
$ajax.post('/v2/order/CancelAll3rdWaybills', formData).then(res => {
|
||||
hideLoad() // 关闭加载中
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
// 弹出提示框
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad() // 关闭加载中
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
取消订单运单 post /order/order/CancelWaybill
|
||||
// @Param token header string true "认证token"
|
||||
|
||||
// @Param vendorWaybillID formData string true "运单ID"
|
||||
// @Param waybillVendorID formData int true "运单所属的厂商ID"
|
||||
// @Param reasonID formData int false "原因ID"
|
||||
// @Param reason formData string false "取消
|
||||
*/
|
||||
function cancelWaybillsApi(vendorWaybillID, waybillVendorID, reasonID, reason, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('vendorWaybillID', vendorWaybillID)
|
||||
formData.append('waybillVendorID', waybillVendorID)
|
||||
if (reasonID) formData.append('reasonID', reasonID)
|
||||
if (reason) formData.append('reason', reason)
|
||||
$ajax.post('/v2/order/CancelWaybill', formData).then(res => {
|
||||
hideLoad() // 关闭加载中
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
// 弹出提示框
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad() // 关闭加载中
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
转门店自送 post /order/SelfDelivering
|
||||
vendorOrderID str 订单ID
|
||||
vendorID int 订单所属厂商ID
|
||||
*/
|
||||
function selfDelivering(vendorOrderID, vendorID, riderName, riderTel, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('vendorOrderID', vendorOrderID)
|
||||
formData.append('vendorID', vendorID)
|
||||
if (vendorID === 14 || vendorID === 3 || vendorID === 1 || vendorID === 16 || vendorID === 0) {
|
||||
formData.append('courierName', riderName)
|
||||
formData.append('courierMobile', riderTel)
|
||||
}
|
||||
$ajax.post('/v2/order/SelfDelivering', formData).then(res => {
|
||||
hideLoad() // 关闭加载中
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
// 弹出提示框
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad() // 关闭加载中
|
||||
})
|
||||
}
|
||||
//售前删除
|
||||
function delBeforeSale(vendorOrderID, skuID, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('vendorOrderID', vendorOrderID)
|
||||
formData.append('skuID', skuID)
|
||||
$ajax.post('/v2/order/AdjustJdsOrderSimple', formData).then(res => {
|
||||
hideLoad() // 关闭加载中
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
// 弹出提示框
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad() // 关闭加载中
|
||||
})
|
||||
}
|
||||
|
||||
function ExportOrderWithSku(json, fn) {
|
||||
$ajax.get('v2/order/ExportOrderWithSku', {
|
||||
params: json,
|
||||
timeout: 1000 * 300
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export function getOrdersPost(json, fn) {
|
||||
$ajax.post('v2/order/GetOrders', json2query(json), {
|
||||
timeout: 1000 * 300
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
得到订单运单信息 get /order/GetOrderWaybillInfo
|
||||
vendorOrderID str 订单ID
|
||||
vendorID int 订单所属厂商
|
||||
*/
|
||||
function getOrderWaybillInfo(vendorOrderID, vendorID, fn) {
|
||||
$ajax.get('v2/order/GetOrderWaybillInfo', {
|
||||
params: {
|
||||
vendorOrderID,
|
||||
vendorID
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
// 取消订单
|
||||
function cancelOrder(vendorOrderID, vendorID, reason, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('vendorOrderID', vendorOrderID)
|
||||
formData.append('vendorID', vendorID)
|
||||
if (reason.trim()) formData.append('reason', reason)
|
||||
$ajax.put('/v2/order/CancelOrder', formData).then(res => {
|
||||
hideLoad() // 关闭加载中
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
// 弹出提示框
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad() // 关闭加载中
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
查询订单/运单状态 get /order/GetOrderStatusList
|
||||
vendorOrderID str 订单ID
|
||||
vendorID int 订单所属厂商
|
||||
orderType int 订单1 运单2 订单+运单 -1
|
||||
|
||||
id: 56522
|
||||
orderType: 1
|
||||
refVendorID: 0 源订单厂商
|
||||
refVendorOrderID: "817279388000141" 源订单ID
|
||||
remark: "" 备注
|
||||
status: 5 状态
|
||||
statusTime: "2018-07-19T23:49:47+08:00" 时间
|
||||
vendorID: 0
|
||||
vendorOrderID: "817279388000141" 可能是订单可能是运单,要看orderType
|
||||
vendorStatus: "32000"
|
||||
----------------------
|
||||
|
||||
orderStatus:
|
||||
5: "新订单"
|
||||
8: "调整单"
|
||||
10: "已接单"
|
||||
15: "已拣货"
|
||||
20: "配送中"
|
||||
105: "送达"
|
||||
110: "完成"
|
||||
115: "取消"
|
||||
120: "失败"
|
||||
|
||||
waybillStatus:
|
||||
5: "新运单"
|
||||
8: "取消接受"
|
||||
10: "已接单"
|
||||
15: "已到店"
|
||||
20: "配送中"
|
||||
105: "送达"
|
||||
115: "取消"
|
||||
120: "失败"
|
||||
*/
|
||||
|
||||
export { getOrderCount, getBusinessInfo, getPlatformInfo, createWaybill, ExportOrderWithSku, getOrderWaybillInfo, cancelAll3rdWaybillsApi, cancelWaybillsApi, selfDelivering, cancelOrder, delBeforeSale }
|
||||
|
||||
/*
|
||||
order
|
||||
|
||||
actualFee: 0
|
||||
actualPayPrice: 2037
|
||||
businessType: 1
|
||||
buyerComment: ""
|
||||
consigneeAddress: "合肥市蜀山区御湖观邸4#202"
|
||||
consigneeMobile: "13285650429,2865"
|
||||
consigneeName: "陈珺"
|
||||
courierMobile: "18256922755"
|
||||
courierName: "邢海珍"
|
||||
currentConsigneeMobile: ""
|
||||
deliveryFlag: 0
|
||||
desiredFee: 0
|
||||
expectedDeliveredTime: "2018-11-14T16:38:00+08:00"
|
||||
goodsCount: 8
|
||||
jxStoreID: 100498
|
||||
lockStatus: 0
|
||||
orderCreatedAt: "2018-11-14T15:37:00+08:00"
|
||||
orderFinishedAt: "2018-11-14T15:54:52+08:00"
|
||||
orderSeq: 11
|
||||
salePrice: 1587
|
||||
shopPrice: 5561
|
||||
skuCount: 8
|
||||
status: 105
|
||||
storeID: 100498
|
||||
storeName: "京西菜市-海恒店(可免邮)"
|
||||
vendorID: 0
|
||||
vendorOrderID: "827445005000021"
|
||||
vendorOrderID2: ""
|
||||
vendorStoreID: "11749726"
|
||||
vendorWaybillID: "827445005000021"
|
||||
waybillCreatedAt: "2018-11-14T15:39:21+08:00"
|
||||
waybillFinishedAt: "2018-11-14T15:54:52+08:00"
|
||||
waybillStatus: 105
|
||||
waybillVendorID: 0
|
||||
weight: 2500
|
||||
*/
|
||||
187
src/apis/permission.js
Normal file
@@ -0,0 +1,187 @@
|
||||
import api from '@/utils/api.js'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
// 权限菜单相关接口 by Master Wan
|
||||
|
||||
// 添加功能(菜单)
|
||||
// payload:
|
||||
// color: "" //字体颜色
|
||||
// imgURL: "https://image.jxc4.com/image/432cc6451cd5376dd8f13ca46600d731.tem.png" //图标地址
|
||||
// level: 1 等级
|
||||
// name: "首页" 菜单名
|
||||
// parentID: 0 父级ID
|
||||
export const addMenu = async (payload, noLoading = true) => {
|
||||
let form = new FormData()
|
||||
form.append('payload ', JSON.stringify(payload))
|
||||
try {
|
||||
let res = await api('v2/power/AddMenu', {
|
||||
method: 'POST',
|
||||
data: form,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('AddMenu', e)
|
||||
msgWarning(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//添加角色
|
||||
// name 角色名
|
||||
export const addRole = async (name, noLoading = true) => {
|
||||
let form = new FormData()
|
||||
form.append('name', name)
|
||||
try {
|
||||
let res = await api('v2/power/AddRole', {
|
||||
method: 'POST',
|
||||
data: form,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('AddRole', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//获取菜单
|
||||
export const getMenu = async (userID='' , noLoading = true) => {
|
||||
try {
|
||||
let res = await api(`v2/power/GetMenu?userID=${userID}`, {
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('GetMenu', e)
|
||||
msgWarning(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//查询用户角色
|
||||
export const getUserRole = async (userID = '', noLoading = true) => {
|
||||
|
||||
try {
|
||||
let res = await api(`v2/power/GetUserRole?userID=${userID}`, {
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('GetUserRole', e)
|
||||
msgWarning(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//查询角色的菜单
|
||||
// roleID 用户ID int
|
||||
export const getRoleMenu = async (roleID, noLoading = true) => {
|
||||
|
||||
try {
|
||||
let res = await api(`v2/power/GetRoleMenu?roleID=${roleID}`, {
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('GetRoleMenu', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//查询角色
|
||||
export const getRole = async (name,noLoading = true) => {
|
||||
try {
|
||||
let url = name ? `v2/power/GetRole?name=${name}`: 'v2/power/GetRole'
|
||||
let res = await api(url, { noLoading })
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('GetRole', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//修改菜单
|
||||
export const UpdateMenu = async (json, noLoading = true) => {
|
||||
let form = new FormData()
|
||||
form.append('payload', json.payload)
|
||||
form.append('menuID', json.menuID)
|
||||
form.append('isDelete', json.isDelete)
|
||||
try {
|
||||
let res = await api('v2/power/UpdateMenu', {
|
||||
method: 'PUT',
|
||||
data: form,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//修改角色
|
||||
export const UpdateRole = async (json, noLoading = true) => {
|
||||
let form = new FormData()
|
||||
form.append('name', json.name)
|
||||
form.append('roleID', json.roleID)
|
||||
if(json.brandID) form.append('brandID', json.brandID)
|
||||
if(json.cityCodes) form.append('cityCodes', JSON.stringify(json.cityCodes))
|
||||
if(json.storeIDs) form.append('storeIDs', JSON.stringify(json.storeIDs))
|
||||
form.append('isDelete', json.isDelete)
|
||||
try {
|
||||
let res = await api('v2/power/UpdateRole', {
|
||||
method: 'PUT',
|
||||
data: form,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//修改角色菜单
|
||||
export const UpdateRoleMenu = async (roleIDs, menuIDs, noLoading = true) => {
|
||||
let form = new FormData()
|
||||
form.append('roleIDs', JSON.stringify([roleIDs]))
|
||||
form.append('menuIDs', JSON.stringify(menuIDs))
|
||||
try {
|
||||
let res = await api('v2/power/UpdateRoleMenu', {
|
||||
method: 'PUT',
|
||||
data: form,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//修改用户角色
|
||||
export const UpdateUserRole = async (json, noLoading = true) => {
|
||||
let form = new FormData()
|
||||
form.append('userIDs', JSON.stringify(json.userIDs))
|
||||
form.append('roleIDs', JSON.stringify(json.roleIDs))
|
||||
try {
|
||||
let res = await api('v2/power/UpdateUserRole', {
|
||||
method: 'PUT',
|
||||
data: form,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
97
src/apis/priceReference.js
Normal file
@@ -0,0 +1,97 @@
|
||||
import $ajax from 'axios'
|
||||
import api from '@/utils/api.js'
|
||||
// import {hideLoad} from '@/tools/loading.js'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
import { hideLoad } from '@/tools/loading.js'
|
||||
function getJdDaojiaApi(params, fn) {
|
||||
$ajax.get('jd/client', {
|
||||
params: params,
|
||||
timeout: 1000 * 600
|
||||
}).then(res => {
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else if (res.data.code === '90003') {
|
||||
msgWarning(params.body.storeId + '-' + res.data.detail)
|
||||
} else {
|
||||
msgWarning(res.data.detail)
|
||||
}
|
||||
}).catch(err => {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const getJdDaojiaApi2 = async (params) => {
|
||||
const res = await $ajax.get('jd/client', {
|
||||
params: params,
|
||||
timeout: 1000 * 600
|
||||
})
|
||||
if (res.data.code === '0') {
|
||||
return res.data
|
||||
} else if (res.data.code === '90003') {
|
||||
msgWarning(params.body.storeId + '-' + res.data.detail)
|
||||
} else {
|
||||
msgWarning(res.data.detail)
|
||||
}
|
||||
}
|
||||
const getJdDaojiaApi3 = async (vendorStoreID) => {
|
||||
const res = await $ajax.get('v2/store/GetJddjStoreInfo', {
|
||||
params: {
|
||||
vendorStoreID
|
||||
},
|
||||
timeout: 1000 * 600
|
||||
})
|
||||
if (res.data.code === '0') {
|
||||
return res.data
|
||||
} else if (res.data.code === '90003') {
|
||||
msgWarning(params.body.storeId + '-' + res.data.detail)
|
||||
} else {
|
||||
msgWarning(res.data.detail)
|
||||
}
|
||||
}
|
||||
|
||||
//新版店铺分析
|
||||
export const queryPageStores = async (json, noLoading = true) => {
|
||||
try {
|
||||
const res = await api('v2/netspider/QueryPageStores', {
|
||||
params: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
hideLoad()
|
||||
msgWarning(e)
|
||||
console.error('queryConfig', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
//畅销分析
|
||||
export const queryPageSkus = async (json, noLoading = true) => {
|
||||
try {
|
||||
const res = await api('v2/netspider/QueryPageSkus', {
|
||||
params: json,
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
hideLoad()
|
||||
console.error('queryConfig', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export const getPageBrands = async (noLoading = true) => {
|
||||
try {
|
||||
const res = await api('v2/netspider/GetPageBrands', {
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
hideLoad()
|
||||
console.error('queryConfig', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
export { getJdDaojiaApi, getJdDaojiaApi2, getJdDaojiaApi3 }
|
||||
204
src/apis/promotion.js
Normal file
@@ -0,0 +1,204 @@
|
||||
import $ajax from 'axios'
|
||||
// import {Message} from 'element-ui'
|
||||
import {hideLoad} from '@/tools/loading.js' // 引入封装的loading方法
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
|
||||
/*
|
||||
创建促销 post /promotion/CreatePromotion
|
||||
*vendorID int 厂商ID,当前只支持京东 0
|
||||
*name str 促销名,必须唯一(最好带日期)
|
||||
*beginAt str 开始时间
|
||||
*endAt str 结束时间
|
||||
*type int 促销类型 3直降 4秒杀
|
||||
*storeIDs str [1,2]
|
||||
*skuPrices arr json数组
|
||||
isAsync boo 是否异步,目前只支持 false
|
||||
advertising str 广告语
|
||||
vendorPromotionID str 厂商活动ID
|
||||
------------
|
||||
|
||||
{
|
||||
SkuID int `json:"skuID"`
|
||||
PriceType int `json:"priceType"` 1绝对价格 2百分比
|
||||
Price int `json:"price"` // 分,这个不是单价
|
||||
LimitSkuCount int `json:"limitSkuCount"` 活动库存
|
||||
IsLock int8 `json:"isLock"` 0和1,1表示要锁定
|
||||
}
|
||||
const (
|
||||
PriceTypePrice = 1 // 绝对价格
|
||||
PriceTypePercentage = 2 // 百分比
|
||||
)
|
||||
*/
|
||||
function createPromotion (json, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('vendorID', Number(json.vendorID))
|
||||
formData.append('name', json.name)
|
||||
formData.append('beginAt', json.beginAt)
|
||||
formData.append('endAt', json.endAt)
|
||||
formData.append('type', Number(json.type))
|
||||
formData.append('storeIDs', JSON.stringify(json.storeIDs))
|
||||
formData.append('skuPrices', JSON.stringify(json.skuPrices))
|
||||
formData.append('isAsync', json.isAsync)
|
||||
if (json.isContinueWhenError) formData.append('isContinueWhenError', json.isContinueWhenError)
|
||||
if (json.advertising) {
|
||||
formData.append('advertising', json.advertising)
|
||||
}
|
||||
if (json.vendorPromotionID) {
|
||||
formData.append('vendorPromotionID', json.vendorPromotionID)
|
||||
}
|
||||
$ajax.post('v2/promotion/CreatePromotion', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
// 优化错误信息提示
|
||||
let errmsg = res.data.desc
|
||||
// 活动价大于等于原价
|
||||
if (errmsg.indexOf('活动价大于等于原价') !== -1) {
|
||||
// 提取数字部分
|
||||
errmsg = errmsg.match(/\d+/g)
|
||||
// 商品名称 json.skuInfos 数组中
|
||||
// 表格模板
|
||||
let html = `<table class="errmsg-table">
|
||||
<caption>活动价大于等于原价</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>京东门店ID</th>
|
||||
<th>京西skuID</th>
|
||||
<th>商品名称</th>
|
||||
<th>活动价</th>
|
||||
<th>建议修改价格</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
`
|
||||
let arr1 = [] // storeID
|
||||
let arr2 = [] // skuID
|
||||
errmsg.forEach((item, index) => {
|
||||
if (index % 2 === 0) {
|
||||
arr1.push(item)
|
||||
} else {
|
||||
arr2.push(item)
|
||||
}
|
||||
})
|
||||
// json.skuPrices
|
||||
let skuPrices = json.skuPrices
|
||||
arr1.forEach((item, index) => {
|
||||
// 找到商品名称
|
||||
let name = ''
|
||||
try {
|
||||
name = json.skuInfos.filter(item => item.SkuID === Number(arr2[index]))[0].name
|
||||
} catch (e) {
|
||||
}
|
||||
// 找到原价
|
||||
let originPrice = skuPrices.filter(item => item.SkuID === Number(arr2[index]))[0].Price
|
||||
html += `<tr>
|
||||
<td>${item}</td>
|
||||
<td>${arr2[index]}</td>
|
||||
<td>${name}</td>
|
||||
<td>${(originPrice / 100).toFixed(2)}</td>
|
||||
<td>${json.type === 3 ? ((originPrice + 10) / 100).toFixed(2) : ((originPrice / 0.8) / 100).toFixed(2)}</td>
|
||||
</tr>`
|
||||
})
|
||||
html += `</tbody></table>`
|
||||
msgWarning(html)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function getPromotions (json, fn) {
|
||||
$ajax.get('v2/promotion/GetPromotions', {
|
||||
params: json
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
取消活动 put /promotion/CancelPromotion
|
||||
promotionID int 活动ID
|
||||
*/
|
||||
function cancelPromotion (promotionID, fn) {
|
||||
$ajax.put('v2/promotion/CancelPromotion?promotionID=' + promotionID).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
锁定解锁活动 sku put /promotion/LockPromotionSkus
|
||||
formData
|
||||
promotionID int 活动ID
|
||||
isLock int 0不锁定 1锁定
|
||||
skuIDs str [] 不传缺省全部
|
||||
*/
|
||||
function lockPromotionskus (json, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('promotionID', Number(json.promotionID))
|
||||
formData.append('isLock', Number(json.isLock))
|
||||
if (json.skuIDs) {
|
||||
formData.append('skuIDs', JSON.stringify(json.skuIDs))
|
||||
}
|
||||
$ajax.put('v2/promotion/LockPromotionSkus', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
从远端同步活动状态 put /promotion/RefreshPromotionStatus
|
||||
promotionID int 活动ID
|
||||
*/
|
||||
function syncPromotionStatus (promotionID, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('promotionID', Number(promotionID))
|
||||
$ajax.put('v2/promotion/RefreshPromotionStatus', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export {createPromotion, getPromotions, cancelPromotion, lockPromotionskus, syncPromotionStatus}
|
||||
25
src/apis/qiniu.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import $ajax from 'axios'
|
||||
// import {Message} from 'element-ui'
|
||||
import {hideLoad} from '@/tools/loading.js'
|
||||
|
||||
/*
|
||||
得到七牛上传服务临时token,当前设置为5分钟内有效。正常使用场景为每次上传资源前实时获取,而不是保存下来一直使用 get /cms/GetQiniuUploadToken
|
||||
suffix str 文件后缀
|
||||
*/
|
||||
|
||||
function getQiNiuToken (suffix, hashCode, fn) {
|
||||
$ajax.get(`v2/cms/GetQiniuUploadToken?suffix=${suffix}&hashCode=${hashCode}`).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
try {
|
||||
let data = JSON.parse(res.data.data)
|
||||
fn && fn(data)
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export {getQiNiuToken}
|
||||
80
src/apis/sendMessages.js
Normal file
@@ -0,0 +1,80 @@
|
||||
import $ajax from 'axios'
|
||||
import { hideLoad } from '@/tools/loading.js'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
|
||||
function sendMessagesApi(json, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('storeIDs', json.storeIDs)
|
||||
formData.append('title', json.title)
|
||||
formData.append('content', json.content)
|
||||
formData.append('isAsync', json.isAsync)
|
||||
formData.append('isContinueWhenError', json.isContinueWhenError)
|
||||
formData.append('messageType', json.messageType)
|
||||
formData.append('imgs', json.imgs)
|
||||
if(json.actInfo) formData.append('actInfo', json.actInfo)
|
||||
$ajax.post('v2/msg/SendStoreMessage', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(err => {
|
||||
msgWarning(err.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
function getStoreMessagesApi(json, fn) {
|
||||
let arr = []
|
||||
for (let attr in json) {
|
||||
arr.push(`${attr}=${json[attr]}`)
|
||||
}
|
||||
let str = arr.join('&')
|
||||
$ajax.get(`v2/msg/GetStoreMessages?${str}`).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(err => {
|
||||
msgWarning(err.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
function getStoreMessageStatusesApi(json, fn) {
|
||||
let arr = []
|
||||
for (let attr in json) {
|
||||
arr.push(`${attr}=${json[attr]}`)
|
||||
}
|
||||
let str = arr.join('&')
|
||||
$ajax.get(`v2/msg/GetStoreMessageStatuses?${str}`).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
//发送消息给商城用户
|
||||
function sendMsgToWxUser(json, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('userIDs', json.userIDs)
|
||||
formData.append('title', json.title)
|
||||
formData.append('content', json.content)
|
||||
if (json.isAsync) {
|
||||
formData.append('isAsync', json.isAsync)
|
||||
}
|
||||
if (json.isContinueWhenError) {
|
||||
formData.append('isContinueWhenError', json.isContinueWhenError)
|
||||
}
|
||||
$ajax.post('v2/msg/SendUserMessage ', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(err => {
|
||||
msgWarning(err.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
export { sendMessagesApi, getStoreMessagesApi, getStoreMessageStatusesApi, sendMsgToWxUser }
|
||||
1021
src/apis/store.js
Normal file
370
src/apis/storeSku.js
Normal file
@@ -0,0 +1,370 @@
|
||||
import $ajax from 'axios'
|
||||
// import {Message} from 'element-ui'
|
||||
import { hideLoad } from '@/tools/loading.js' // 引入封装的loading方法
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
import api from '@/utils/api.js'
|
||||
|
||||
/*
|
||||
得到商家商品信息,如下条件之间是与的关系。对于没有关注的商品,按城市限制。但对于已经关注的商品就不限制了,因为已经在平台上可售,可以操作(改价等等)
|
||||
get /store/sku/GetStoresSkus
|
||||
*storeID int 门店ID
|
||||
*isFocus boo 是否关注
|
||||
keyword str 关键字
|
||||
nameID int SkuName ID
|
||||
skuID int
|
||||
name str 商品名称
|
||||
prefix str 商品前缀
|
||||
categoryID int 类别ID
|
||||
unit str 商品单位
|
||||
jdID int 商品京东ID
|
||||
fromStatus int 0不可售 1可售
|
||||
toStatus int 0不可售 1可售
|
||||
offset int 起始序号,默认0
|
||||
pageSize int 50
|
||||
|
||||
stFromTime str 销量统计开始时间
|
||||
stToTime str 销量统计结束时间
|
||||
stFromCount int 销量起始(包含)
|
||||
stToCount int 销量结束(包含)
|
||||
|
||||
返回结果中 sku中的 count 是销量
|
||||
*/
|
||||
function getStoresSkus(json, fn, errFn) {
|
||||
$ajax.get('v2/store/sku/GetStoresSkus', {
|
||||
params: json
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
errFn && errFn()
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
修改商家商品 put /store/sku/UpdateStoreSku
|
||||
storeID int
|
||||
payload json 单对象
|
||||
*/
|
||||
|
||||
/*
|
||||
skuName
|
||||
NameID int `json:"nameID"`
|
||||
UnitPrice int `json:"unitPrice"`
|
||||
locationCode string `json:"locationCode"` // 物料货架码
|
||||
IsFocus int `json:"isFocus"` // -1未关注,0忽略,1关注
|
||||
SubStoreID int `json:"subStoreID"`
|
||||
Skus []*StoreSkuBindSkuInfo `json:"skus"`
|
||||
|
||||
sku
|
||||
SkuID int `json:"skuID"`
|
||||
IsSale int `json:"isSale"` // -1不可售,0忽略,1可售
|
||||
|
||||
ElmID int64 `json:"elmID"`
|
||||
EbaiID int64 `json:"ebaiID"`
|
||||
*/
|
||||
|
||||
/*
|
||||
批量修改商品 put /store/sku/UpdateStoreSkus
|
||||
storeID int
|
||||
payload json 数组包起来
|
||||
|
||||
{
|
||||
NameID: id,
|
||||
UnitPrice: price,
|
||||
IsFocus: ,
|
||||
Skus: [
|
||||
{
|
||||
SkuID: id,
|
||||
IsSale:
|
||||
}
|
||||
]
|
||||
}
|
||||
*/
|
||||
|
||||
async function updateStoreSkus(storeID, arr, fn, ...arg) {
|
||||
let formData = new FormData()
|
||||
// return false
|
||||
storeID instanceof Array ? formData.append('storeIDs', JSON.stringify(storeID)) : formData.append('storeIDs', JSON.stringify([storeID]))
|
||||
formData.append('payload', JSON.stringify(arr))
|
||||
// 额外参数
|
||||
if (arg.length) {
|
||||
if (arg[0].causeFlag) formData.append('causeFlag', arg[0].causeFlag)
|
||||
}
|
||||
try {
|
||||
let res = await api('v2/store/sku/UpdateStoresSkus', {
|
||||
method: 'PUT',
|
||||
data: formData
|
||||
})
|
||||
if (typeof res === 'object' && res.code === '-105') {
|
||||
fn && fn(res)
|
||||
} else {
|
||||
fn && fn({ code: '0' })
|
||||
}
|
||||
return res
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
hideLoad()
|
||||
throw e
|
||||
}
|
||||
}
|
||||
//批量修改 暂时果园用
|
||||
async function updateStoreSkusArr(storeID, arr, fn, ...arg) {
|
||||
let formData = new FormData()
|
||||
|
||||
// return false
|
||||
formData.append('storeIDs', JSON.stringify(storeID))
|
||||
formData.append('payload', JSON.stringify(arr))
|
||||
// 额外参数
|
||||
if (arg.length) {
|
||||
if (arg[0].causeFlag) formData.append('causeFlag', arg[0].causeFlag)
|
||||
}
|
||||
try {
|
||||
let res = await api('v2/store/sku/UpdateStoresSkus', {
|
||||
method: 'PUT',
|
||||
data: formData
|
||||
})
|
||||
if (typeof res === 'object' && res.code === '-105') {
|
||||
fn && fn(res)
|
||||
} else {
|
||||
fn && fn({ code: '0' })
|
||||
}
|
||||
return res
|
||||
} catch (e) {
|
||||
msgWarning(e)
|
||||
hideLoad()
|
||||
throw e
|
||||
}
|
||||
}
|
||||
/*
|
||||
京西门店拷贝到京西 post /store/sku/CopyStoreSkus
|
||||
fromStoreID int 源门店ID
|
||||
toStoreID int 目标门店ID
|
||||
copyMode str fresh清除后拷贝 update增量拷贝
|
||||
pricePercentage int 价格百分比 默认 100
|
||||
categoryIDs str [1,2,3] skuName的类别
|
||||
skuIDs str [1,2,3] skuID列表
|
||||
*/
|
||||
function copyStoreSkus(json, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('fromStoreID', json.fromStoreID)
|
||||
// formData.append('toStoreID', json.toStoreID)
|
||||
formData.append('toStoreIDs', JSON.stringify(json.toStoreIDs))
|
||||
formData.append('copyMode', json.copyMode)
|
||||
formData.append('isScale', json.isScale)
|
||||
formData.append('pricePercentage', JSON.stringify(Number(json.pricePercentage)))
|
||||
if (json.categoryIDs.length !== 0) {
|
||||
formData.append('categoryIDs', JSON.stringify(json.categoryIDs))
|
||||
}
|
||||
if (json.skuIDs.length !== 0) {
|
||||
formData.append('skuIDs', JSON.stringify(json.skuIDs))
|
||||
}
|
||||
$ajax.post('v2/store/sku/CopyStoreSkus', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning('[复制错误] ' + res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
formData
|
||||
批量修改多门店,商品上下架,sku可售 put /store/sku/UpdateStoresSkus
|
||||
storeIDs str 门店ID列表 [12,23]
|
||||
payload str json,StoreSkuBindInfo对象数组
|
||||
--------------------
|
||||
sku
|
||||
IsSale int `json:"isSale"` // -1不可售,0忽略,1可售
|
||||
[{
|
||||
nameID: skuNameID,
|
||||
unitPrice: skuNamePrice,
|
||||
isFocus: , -1未关注,0忽略,1关注
|
||||
isSale: -1不可售,0忽略,1可售
|
||||
Skus: [
|
||||
{
|
||||
SkuID: id,
|
||||
IsSale: -1不可售,0忽略,1可售
|
||||
}
|
||||
]
|
||||
}]
|
||||
*/
|
||||
function updateStoresSkus(json, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('storeIDs', JSON.stringify(json.storeIDs))
|
||||
formData.append('payload', JSON.stringify(json.payload))
|
||||
if (typeof json.isContinueWhenError === 'boolean') formData.append('isContinueWhenError', json.isContinueWhenError)
|
||||
if (typeof json.isAsync === 'boolean') formData.append('isAsync', json.isAsync)
|
||||
if (typeof json.isScale === 'boolean') formData.append('isScale', json.isScale)
|
||||
if (typeof json.isRefreshHigh === 'boolean') formData.append('isRefreshHigh', json.isRefreshHigh)
|
||||
$ajax.put('v2/store/sku/UpdateStoresSkus', formData, {
|
||||
timeout: 1000 * 300,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
批量修改多商家商品可售状态 put /store/sku/UpdateStoresSkusSale
|
||||
storeIDs str [1,2,3]
|
||||
payload arr
|
||||
--------------------------------
|
||||
sku
|
||||
IsSale int `json:"isSale"` // -1不可售,0忽略,1可售
|
||||
|
||||
{
|
||||
SkuID: id,
|
||||
IsSale:
|
||||
}
|
||||
storeIDs: [100118]
|
||||
payload: [{"SkuID":33066,"IsSale":1}]
|
||||
isContinueWhenError: true
|
||||
isAsync: false
|
||||
autoSaleAt: 临时不可售参数
|
||||
*/
|
||||
function updateStoresSkusSale(json, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('storeIDs', JSON.stringify(json.storeIDs))
|
||||
formData.append('payload', JSON.stringify(json.payload))
|
||||
if (typeof json.isContinueWhenError === 'boolean') formData.append('isContinueWhenError', json.isContinueWhenError)
|
||||
if (typeof json.isAsync === 'boolean') formData.append('isAsync', json.isAsync)
|
||||
if (json.autoSaleAt) formData.append('autoSaleAt', json.autoSaleAt)
|
||||
if (json.ignoreDontSale) formData.append('autoSaleAt', json.ignoreDontSale)
|
||||
$ajax.put('v2/store/sku/UpdateStoresSkusSale', formData, {
|
||||
timeout: 1000 * 300,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
获取门店审核商品 get /store/sku/GetStoreOpRequests
|
||||
*fromTime str 申请开始时间
|
||||
toTime str 申请结束时间
|
||||
keyword str 查询关键字
|
||||
storeIDs str 门店ID列表
|
||||
itemIDs str skuNameID
|
||||
types str 类型列表对象 1改价 2关注
|
||||
statuss str 状态列表对象 0新 1拒绝 2接受
|
||||
offset int 0
|
||||
pageSize int -1全部
|
||||
|
||||
--------list--------
|
||||
id: 1
|
||||
unitPrice: 2000 // 关注为0
|
||||
intParam1: 3000
|
||||
intParam2: 0
|
||||
itemID: 1213
|
||||
jsonParam: ""
|
||||
lastOperator: "fakeboss"
|
||||
remark: ""
|
||||
skuNameName: "龙须 龙口粉丝"
|
||||
skuNamePrefix: ""
|
||||
status: 0
|
||||
storeID: 11
|
||||
storeName: "杜城店"
|
||||
type: 1
|
||||
*/
|
||||
function getStoreOpRequests(json, fn) {
|
||||
$ajax.get('v2/store/sku/GetStoreOpRequests', {
|
||||
params: json
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
formData
|
||||
处理商家商品价格申请 put /store/sku/HandleStoreOpRequest
|
||||
reqIDs str 请求ID列表对象
|
||||
handleType int -1 拒绝, 1批准
|
||||
rejectReason str 拒绝理由
|
||||
*/
|
||||
|
||||
function handleStoreOpRequests(reqIDs, handleType, rejectReason, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('reqIDs', JSON.stringify(reqIDs))
|
||||
formData.append('handleType', handleType)
|
||||
formData.append('rejectReason', rejectReason)
|
||||
$ajax.put('v2/store/sku/HandleStoreOpRequest', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 美团门店复制到美团
|
||||
* @param {string } fromStoreID 被复制门店id
|
||||
* @param {string } toStoreID 复制到门店id
|
||||
* @param {Function} fn
|
||||
*/
|
||||
function copyMtToMt(fromStoreID, toStoreID, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('fromStoreID', fromStoreID)
|
||||
formData.append('toStoreID', toStoreID)
|
||||
$ajax.post('v2/router/CopyMtToMt', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export { getStoresSkus, updateStoreSkus, updateStoreSkusArr, copyStoreSkus, updateStoresSkus, updateStoresSkusSale, getStoreOpRequests, handleStoreOpRequests, copyMtToMt }
|
||||
169
src/apis/sync.js
Normal file
@@ -0,0 +1,169 @@
|
||||
import $ajax from 'axios'
|
||||
// import {Message} from 'element-ui'
|
||||
import {hideLoad} from '@/tools/loading.js' // 引入封装的loading方法
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
|
||||
/*
|
||||
全新初始化商家商品信息(!!!此操作会先清除平台上已有的商品及分类信息),此操作只适用于单门店模式平台 put /sync/FullSyncStoresSkus
|
||||
storeIDs str 门店ID列表
|
||||
vendorIDs str 厂商ID列表
|
||||
isAsync boo 是否异步
|
||||
isContinueWhenError boo 单个同步失败是否继续,默认false
|
||||
*/
|
||||
function fullSyncStoresSkus (storeIDs, vendorIDs, isAsync, isContinueWhenError, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('storeIDs', storeIDs)
|
||||
formData.append('vendorIDs', vendorIDs)
|
||||
formData.append('isAsync', isAsync)
|
||||
formData.append('isContinueWhenError', isContinueWhenError)
|
||||
$ajax.put('v2/sync/FullSyncStoresSkus', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
删除远程门店商品信息(!!!此操作会先清除平台上已有的商品及分类信息),此操作只适用于单门店模式平台 put /sync/FullSyncStoresSkus
|
||||
storeIDs str 门店ID列表
|
||||
vendorIDs str 厂商ID列表
|
||||
isAsync boo 是否异步
|
||||
isContinueWhenError boo 单个同步失败是否继续,默认false
|
||||
*/
|
||||
function deleteSyncStoresSkus (storeIDs, vendorIDs, isAsync, isContinueWhenError, fn) {
|
||||
// let formData = new FormData()
|
||||
// formData.append('storeIDs', storeIDs)
|
||||
// formData.append('vendorIDs', vendorIDs)
|
||||
// formData.append('isAsync', isAsync)
|
||||
// formData.append('isContinueWhenError', isContinueWhenError)
|
||||
$ajax.delete('v2/sync/DeleteRemoteStoreSkus', {
|
||||
params: {
|
||||
storeIDs, vendorIDs, isAsync, isContinueWhenError
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
同步商家商品信息,单店模式才支持 put /sync/SyncStoresSkus
|
||||
storeIDs str 门店ID列表
|
||||
vendorIDs int 厂商ID
|
||||
isAsync boo 是否同步操作
|
||||
isForce boo 是否强制同步(防止在平台改了,本地没有脏标志)
|
||||
skuIDs str []skuID列表,缺省为全部
|
||||
isContinueWhenError boo 单个失败是否继续
|
||||
*/
|
||||
|
||||
export const syncStoresSkus = (json, fn) => {
|
||||
let formData = new FormData()
|
||||
formData.append('storeIDs', JSON.stringify(json.storeIDs))
|
||||
formData.append('vendorIDs', JSON.stringify(json.vendorIDs))
|
||||
formData.append('isAsync', json.isAsync)
|
||||
formData.append('isForce', json.isForce)
|
||||
if (json.skuIDs.length !== 0) {
|
||||
formData.append('skuIDs', JSON.stringify(json.skuIDs))
|
||||
}
|
||||
if (json.isContinueWhenError) {
|
||||
formData.append('isContinueWhenError', json.isContinueWhenError)
|
||||
}
|
||||
$ajax.put('v2/sync/SyncStoresSkus', formData, {
|
||||
timeout: 1000 * 300,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
同步京东商品库 put /sync/SyncSkuNames
|
||||
nameIDs str
|
||||
isForce boo 是否强制同步(防止在平台改了,本地没有脏标志)
|
||||
isAsync boo 是否异步
|
||||
isContinueWhenError boo 单个失败是否继续
|
||||
*/
|
||||
export const syncSkuNames = (json, fn) => {
|
||||
let formData = new FormData()
|
||||
// formData.append('vendorIDs', JSON.stringify(json.vendorIDs))
|
||||
formData.append('isAsync', json.isAsync)
|
||||
formData.append('isForce', json.isForce)
|
||||
formData.append('vendorOrgCode', json.vendorOrgCode)
|
||||
formData.append('isContinueWhenError', json.isContinueWhenError)
|
||||
if (json.nameIDs.length !== 0) {
|
||||
formData.append('nameIDs', JSON.stringify(json.nameIDs))
|
||||
}
|
||||
$ajax.post('v2/sync/SyncSkuNames', formData, {
|
||||
timeout: 1000 * 300,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
同步美团饿百分类 put /sync/SyncStoresCategory
|
||||
storeIDs str 门店ID列表
|
||||
vendorIDs int 厂商ID
|
||||
isAsync boo 是否同步操作
|
||||
isForce boo 是否强制同步(防止在平台改了,本地没有脏标志)
|
||||
isContinueWhenError boo 单个失败是否继续
|
||||
*/
|
||||
export const syncCat = (json, fn) => {
|
||||
let formData = new FormData()
|
||||
formData.append('vendorIDs', JSON.stringify(json.vendorIDs))
|
||||
formData.append('storeIDs', JSON.stringify(json.storeIDs))
|
||||
formData.append('isAsync', json.isAsync)
|
||||
formData.append('isForce', json.isForce)
|
||||
formData.append('isContinueWhenError', json.isContinueWhenError)
|
||||
$ajax.put('v2/sync/SyncStoresCategory', formData, {
|
||||
timeout: 1000 * 300,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export {fullSyncStoresSkus, deleteSyncStoresSkus}
|
||||
82
src/apis/task.js
Normal file
@@ -0,0 +1,82 @@
|
||||
import $ajax from 'axios'
|
||||
import {hideLoad} from '@/tools/loading.js'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
|
||||
/*
|
||||
查询任务进度 get /task/GetTasks
|
||||
taskID str 任务ID
|
||||
fromStatus int 起始状态
|
||||
toStatus int 结束状态
|
||||
lastHours int 多少小时以内的
|
||||
|
||||
TaskStatusBegin = 0
|
||||
TaskStatusWorking = 0
|
||||
TaskStatusCanceling = 1
|
||||
|
||||
TaskStatusEndBegin = 2
|
||||
TaskStatusFinished = 2
|
||||
TaskStatusCanceled = 3
|
||||
TaskStatusFailed = 4
|
||||
TaskStatusEnd = 4
|
||||
|
||||
CACD8972ECA211E8A27B525400AE46A6
|
||||
|
||||
batchSize: 1
|
||||
children: null
|
||||
createdAt: "2018-11-19T20:07:41.076305281+08:00"
|
||||
createdBy: "renyutian"
|
||||
err: null
|
||||
failedItemCount: 0
|
||||
failedJobCount: 0
|
||||
finishedItemCount: 1
|
||||
finishedJobCount: 1
|
||||
// id: "B6C54901EBF311E8A27B525400AE46A6"
|
||||
isContinueWhenError: true
|
||||
//name: "SyncStore"
|
||||
parallelCount: 1
|
||||
result: Array(0)
|
||||
status: 2
|
||||
terminatedAt: "2018-11-19T20:07:41.111749903+08:00"
|
||||
totalItemCount: 1
|
||||
totalJobCount: 1
|
||||
updatedAt: "2018-11-19T20:07:41.111730154+08:00"
|
||||
*/
|
||||
function getTasks (params, fn) {
|
||||
$ajax.get('v2/task/GetTasks', {
|
||||
params: params
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
取消任务 put /task/CancelTask
|
||||
taskID
|
||||
*/
|
||||
function cancelTask (taskID, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('taskID', taskID)
|
||||
$ajax.put('v2/task/CancelTask', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.code === '0') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
msgWarning(res.data.desc)
|
||||
}
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export {getTasks, cancelTask}
|
||||
64
src/apis/temporary.js
Normal file
@@ -0,0 +1,64 @@
|
||||
import $ajax from 'axios'
|
||||
import {hideLoad} from '@/tools/loading.js'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
|
||||
function convert2JDSPUApi (json, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('count', json.count)
|
||||
formData.append('isAsync', json.isAsync)
|
||||
formData.append('isContinueWhenError', json.isContinueWhenError)
|
||||
$ajax.post('v2/initdata/Convert2JDSPU', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(err => {
|
||||
msgWarning(err.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
function Change2JDSPU4StoreApi (json, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('storeIDs', json.storeIDs)
|
||||
formData.append('isAsync', json.isAsync)
|
||||
formData.append('step', json.step)
|
||||
formData.append('isContinueWhenError', json.isContinueWhenError)
|
||||
$ajax.post('v2/initdata/Change2JDSPU4Store', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(err => {
|
||||
msgWarning(err.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
添加sku post /sku/AddSku
|
||||
nameID int skuName ID
|
||||
payload json
|
||||
*/
|
||||
function transformJdSpu2SkuApi (json, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('count', json.count)
|
||||
formData.append('isAsync', json.isAsync)
|
||||
formData.append('isContinueWhenError', json.isContinueWhenError)
|
||||
$ajax.post('v2/initdata/TransformJdSpu2Sku', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(err => {
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export {convert2JDSPUApi, Change2JDSPU4StoreApi, transformJdSpu2SkuApi}
|
||||
54
src/apis/upSkyMonkey/MTVip.js
Normal file
@@ -0,0 +1,54 @@
|
||||
import $ajax from 'axios'
|
||||
import { showLoad, hideLoad } from '@/tools/loading'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
|
||||
export function UpLoadMTVip(json, fn) {
|
||||
showLoad
|
||||
let formData = new FormData()
|
||||
formData.append('payload', JSON.stringify(json))
|
||||
$ajax.post('https://www.jxcs.net/v2/job/ImprotMtMembers', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
export function getMtMembers(fn) {
|
||||
showLoad
|
||||
$ajax.get('https://www.jxcs.net/v2/job/GetMtMembers', {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export function updateCthrBannerList(value) {
|
||||
showLoad()
|
||||
let from = new FormData()
|
||||
from.append('type', 'Sys')
|
||||
from.append('key', 'banner')
|
||||
from.append('value', value)
|
||||
$ajax.put('https://www.jxcs.net/v2/cms/UpdateConfig', from, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'token': 'rushSkyMonkeyToken_20201203'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
fn && fn(res.data)
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
113
src/apis/upSkyMonkey/cthCms.js
Normal file
@@ -0,0 +1,113 @@
|
||||
import $ajax from 'axios'
|
||||
import { showLoad, hideLoad } from '@/tools/loading'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
|
||||
export function queryConfigs(json = {}) {
|
||||
showLoad
|
||||
let { noLoading = false, type = 'PricePack', key, keyword } = json
|
||||
let params = {
|
||||
type
|
||||
}
|
||||
if (key) params.key = key
|
||||
if (keyword) params.keyword = keyword
|
||||
return $ajax.get('https://www.jxcs.net/v2/cms/QueryConfigs', {
|
||||
params,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if (res.data.data !== 'null') {
|
||||
if (type === 'Bank') {
|
||||
// 银行
|
||||
return res.data.data
|
||||
} else {
|
||||
// 调价包
|
||||
return res.data.data
|
||||
}
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteConfig(json = {}, fn) {
|
||||
showLoad
|
||||
let { noLoading, type = 'PricePack', key } = json
|
||||
let params = {
|
||||
type,
|
||||
key
|
||||
}
|
||||
$ajax.delete('https://www.jxcs.net/v2/cms/DeleteConfig', {
|
||||
params,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export function updateConfig(json, fn) {
|
||||
showLoad
|
||||
let { noLoading, type = 'PricePack', key, value } = json
|
||||
let form = new FormData()
|
||||
form.append('type', type)
|
||||
form.append('key', key)
|
||||
form.append('value', value)
|
||||
return $ajax.put('https://www.jxcs.net/v2/cms/UpdateConfig', form, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
export function newConfig(json) {
|
||||
showLoad
|
||||
let { noLoading = false, type = 'PricePack', key, value } = json
|
||||
let form = new FormData()
|
||||
form.append('type', type)
|
||||
form.append('key', key)
|
||||
form.append('value', value)
|
||||
return $ajax.post('https://www.jxcs.net/v2/cms/newConfig', form, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export function queryVipConfigs() {
|
||||
showLoad
|
||||
let params = { type: 'MemberCard' }
|
||||
let noLoading = false
|
||||
return $ajax.get('https://www.jxcs.net/v2/cms/QueryConfigs', {
|
||||
params,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
131
src/apis/upSkyMonkey/getCourier.js
Normal file
@@ -0,0 +1,131 @@
|
||||
/**
|
||||
* @description 快递查询模块
|
||||
* @author zhang shu wei
|
||||
* @since 2022年7月11日10:48:46
|
||||
*/
|
||||
import $ajax from 'axios'
|
||||
import { showLoad, hideLoad } from '@/tools/loading'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
|
||||
/**
|
||||
* 查询快递数据
|
||||
*/
|
||||
export function GET_DATA(json) {
|
||||
showLoad()
|
||||
|
||||
// 处理数据
|
||||
let fromData = new FormData()
|
||||
fromData.append('expressType', json.expressType)
|
||||
fromData.append('orderNo', json.orderNo)
|
||||
fromData.append('orderStatus', json.orderStatus)
|
||||
fromData.append('pageNum', json.pageNum)
|
||||
fromData.append('pageSize', json.pageSize)
|
||||
fromData.append('startTime', json.startTime)
|
||||
fromData.append('endTime', json.endTime)
|
||||
|
||||
return $ajax.post('https://www.jxcs.net/v2/express/GetOrderList', fromData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'token': 'rushSkyMonkeyToken_20201203'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(err => {
|
||||
msgWarning(err.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 用户提现列表查询
|
||||
*/
|
||||
export function GetWithdrawalList(json) {
|
||||
showLoad()
|
||||
|
||||
let fromData = new FormData()
|
||||
fromData.append('pageNum', json.pageNum)
|
||||
fromData.append('pageSize', json.pageSize)
|
||||
fromData.append('userName', json.userName)
|
||||
fromData.append('userId', json.userId)
|
||||
fromData.append('orderId', json.orderId)
|
||||
fromData.append('phone', json.phone)
|
||||
fromData.append('orderStatus', json.orderStatus)
|
||||
fromData.append('startTime', json.startTime)
|
||||
fromData.append('endTime', json.endTime)
|
||||
|
||||
return $ajax.post('https://www.jxcs.net/v2/withdrawal/GetWithdrawalList', fromData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'token': 'rushSkyMonkeyToken_20201203'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(err => {
|
||||
msgWarning(err.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 提现审核
|
||||
*/
|
||||
export function ExamineWithdrawalOrder(json) {
|
||||
showLoad()
|
||||
let fromData = new FormData()
|
||||
fromData.append('phone', json.phone)
|
||||
fromData.append('orderId', json.orderId)
|
||||
fromData.append('examineStatus', json.examineStatus)
|
||||
fromData.append('remark', json.remark)
|
||||
fromData.append('userId', json.userId)
|
||||
return $ajax.post('https://www.jxcs.net/v2/withdrawal/ExamineWithdrawalOrder', fromData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'token': 'rushSkyMonkeyToken_20201203'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(err => {
|
||||
msgWarning(err.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 话费记录
|
||||
*/
|
||||
export const system_query_recharge_list = params => {
|
||||
showLoad()
|
||||
|
||||
return $ajax.post('https://www.jxcs.net/v2/recharge/SystemQueryRechargeList', params, {
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(err => {
|
||||
msgWarning(err.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 石总账户余额
|
||||
*/
|
||||
export const query_account_bill = () => {
|
||||
showLoad()
|
||||
return $ajax.get('https://www.jxcs.net/v2/recharge/QueryAccountBill').then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(err => {
|
||||
msgWarning(err.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
155
src/apis/upSkyMonkey/order.js
Normal file
@@ -0,0 +1,155 @@
|
||||
import $ajax from 'axios'
|
||||
import { showLoad, hideLoad } from '@/tools/loading'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
|
||||
//冲天猴服务器信息
|
||||
export function getMonkeyServiceInfo(json) {
|
||||
showLoad
|
||||
return $ajax.get('https://www.jxcs.net/v2/cms/GetServiceInfo', {
|
||||
params: json,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
//提现账单列表
|
||||
export function getCashBillList(json) {
|
||||
showLoad
|
||||
return $ajax.get('https://www.jxcs.net/v2/order/GetOrders', {
|
||||
params: json,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
// 手动点完成提现操作
|
||||
export function finishedCashOrders(orderIDs) {
|
||||
let formData = new FormData()
|
||||
formData.append('orderIDs', JSON.stringify(orderIDs))
|
||||
showLoad
|
||||
return $ajax.post('https://www.jxcs.net/v2/order/FinishedCashOrders', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
//获取任务
|
||||
export function getJobs(json) {
|
||||
showLoad
|
||||
return $ajax.get('https://www.jxcs.net/v2/job/GetJobs', {
|
||||
params: json,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
// 置顶or 推荐
|
||||
export function reloadJobSpan(jobIDs, span) {
|
||||
let formData = new FormData()
|
||||
formData.append('jobIDs', JSON.stringify(jobIDs))
|
||||
formData.append('span', span)
|
||||
showLoad
|
||||
return $ajax.post('https://www.jxcs.net/v2/job/ReloadJobSpan', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
// 设置任务标签
|
||||
export function createJobSpan(jobIDs, endAt, span) {
|
||||
let formData = new FormData()
|
||||
formData.append('jobIDs', JSON.stringify(jobIDs))
|
||||
formData.append('endAt', endAt)
|
||||
formData.append('span', span)
|
||||
showLoad
|
||||
return $ajax.post('https://www.jxcs.net/v2/job/CreateJobSpan', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
//取消任务
|
||||
export function cancelJob(jobID) {
|
||||
let formData = new FormData()
|
||||
formData.append('jobID', JSON.stringify(jobID))
|
||||
showLoad
|
||||
return $ajax.post('https://www.jxcs.net/v2/job/CancelPublishJob', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
//
|
||||
export function getManageStatisticsJob(json) {
|
||||
showLoad
|
||||
return $ajax.get('https://www.jxcs.net/v2/order/GetManageStatisticsJob', {
|
||||
params: json,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
////图表数据
|
||||
export function getManageStatisticsImg(json) {
|
||||
showLoad
|
||||
return $ajax.get('https://www.jxcs.net/v2/order/GetManageStatisticsImg', {
|
||||
params: json,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
19
src/apis/upSkyMonkey/pay.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import $ajax from 'axios'
|
||||
import { showLoad, hideLoad } from '@/tools/loading'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
//冲天猴服务器信息
|
||||
export function getPayStatistics(json) {
|
||||
showLoad
|
||||
return $ajax.get('https://www.jxcs.net/v2/order/GetPayStatistics', {
|
||||
params: json,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
82
src/apis/upSkyMonkey/union-mission.js
Normal file
@@ -0,0 +1,82 @@
|
||||
import $ajax from 'axios'
|
||||
import { showLoad, hideLoad } from '@/tools/loading'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
|
||||
|
||||
export function getUnionActList(vendorID ,actType) {
|
||||
showLoad
|
||||
let params = {
|
||||
actType,
|
||||
vendorID
|
||||
}
|
||||
return $ajax.get('https://www.jxcs.net/v2/union/GetUnionActList', {
|
||||
params,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if(res.data.data){
|
||||
return JSON.parse(res.data.data)
|
||||
}else{
|
||||
return []
|
||||
}
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
export function publishJob(json = {}) {
|
||||
showLoad
|
||||
let form = new FormData()
|
||||
form.append('payload', JSON.stringify(json))
|
||||
return $ajax.post('https://www.jxcs.net/v2/job/PublishJob', form, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export function updateJob(json = {}) {
|
||||
showLoad
|
||||
let form = new FormData()
|
||||
form.append('payload', JSON.stringify(json))
|
||||
return $ajax.post('https://www.jxcs.net/v2/job/UpdateJob', form, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
export function getUnionOrders(json) {
|
||||
showLoad
|
||||
let params =json
|
||||
return $ajax.get('https://www.jxcs.net/v2/union/GetUnionOrders', {
|
||||
params,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
if(res.data.data){
|
||||
return JSON.parse(res.data.data)
|
||||
}else{
|
||||
return []
|
||||
}
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
139
src/apis/upSkyMonkey/user.js
Normal file
@@ -0,0 +1,139 @@
|
||||
import $ajax from 'axios'
|
||||
import { showLoad, hideLoad } from '@/tools/loading'
|
||||
import msgWarning from '@/tools/msgwarning.js'
|
||||
import api from '@/utils/api.js'
|
||||
|
||||
|
||||
/**
|
||||
* 得到用户统计信息
|
||||
*/
|
||||
export function getUserStatistics() {
|
||||
showLoad
|
||||
return $ajax.get('https://www.jxcs.net/v2/event/GetUserStatistics', {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询用户列表
|
||||
*/
|
||||
export function getUsersList(json) {
|
||||
showLoad
|
||||
return $ajax.get('https://www.jxcs.net/v2/user2/GetUsers', {
|
||||
params: json,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改用户余额
|
||||
*/
|
||||
export function updatUserMoney(json) {
|
||||
showLoad // 显示加载层
|
||||
let formData = new FormData()
|
||||
formData.append('phone', json.phone)
|
||||
formData.append('userID', json.userID)
|
||||
formData.append('money', json.money)
|
||||
|
||||
return $ajax.post('https://www.jxcs.net/v2/balance/UpdateUserBalance', formData,{
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'token': 'rushSkyMonkeyToken_20201203'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(err => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//查询用户角色
|
||||
export const userRuler = async (userID = '', noLoading = true) => {
|
||||
|
||||
try {
|
||||
let res = await api(`v2/power/GetUserRole?userID=${userID}`, {
|
||||
noLoading
|
||||
})
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('GetUserRole', e)
|
||||
msgWarning(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 未知模块
|
||||
*/
|
||||
export function getConfig(key, type) {
|
||||
showLoad
|
||||
return $ajax.get('https://www.jxcs.net/v2/cms/QueryConfigs', {
|
||||
params: {
|
||||
key,
|
||||
type
|
||||
},
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 未知模块
|
||||
*/
|
||||
export function updateCatelogies(value) {
|
||||
showLoad()
|
||||
let form = new FormData()
|
||||
form.append('type', 'Sys')
|
||||
form.append('key', 'IndexCategories')
|
||||
form.append('value', value)
|
||||
$ajax.put('https://www.jxcs.net/v2/cms/UpdateConfig', form, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'token': 'rushSkyMonkeyToken_20201203'
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoad()
|
||||
return res.data
|
||||
}).catch(res => {
|
||||
msgWarning(res.data.desc)
|
||||
hideLoad()
|
||||
})
|
||||
}
|
||||
129
src/apis/user_wx.js
Normal file
@@ -0,0 +1,129 @@
|
||||
import $ajax from 'axios'
|
||||
import Mint from 'mint-ui' // 引入 mint-ui
|
||||
// import store from '@/store/index.js' // 引入store
|
||||
|
||||
// 获取微信用户信息 get
|
||||
// openId 用户openId
|
||||
function reqWeixin (openId, fn) {
|
||||
$ajax.get('/api/weixin', {
|
||||
params: {
|
||||
openId: openId
|
||||
}
|
||||
}).then(res => {
|
||||
Mint.Indicator.close() // 关闭加载中
|
||||
if (res.data.code === 'success') {
|
||||
fn && fn(JSON.parse(res.data.data))
|
||||
} else {
|
||||
// 弹出提示框
|
||||
Mint.Toast({
|
||||
message: res.data.desc,
|
||||
position: 'center',
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
Mint.Indicator.close() // 关闭加载中
|
||||
})
|
||||
}
|
||||
|
||||
// 获取短信验证码 post
|
||||
// mobile
|
||||
function getTelMsg (mobile, fn) {
|
||||
let formData = new FormData()
|
||||
formData.append('mobile', mobile)
|
||||
$ajax.post('/api_php/capt/createsms2', formData).then(res => {
|
||||
Mint.Indicator.close() // 关闭加载中
|
||||
if (res.data.code === 'success') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
// 弹出提示框
|
||||
Mint.Toast({
|
||||
message: res.data.desc,
|
||||
position: 'center',
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
Mint.Indicator.close() // 关闭加载中
|
||||
})
|
||||
}
|
||||
|
||||
// 用户绑定 post
|
||||
// nickname
|
||||
// openid
|
||||
// smssure
|
||||
// tels
|
||||
function userBind (nickname, openid, smssure, tels, fn) {
|
||||
return $ajax.post('/api_php/capt/getdata2', {
|
||||
nickname: nickname,
|
||||
openid: openid,
|
||||
smssure: smssure,
|
||||
tels: tels
|
||||
}).then(res => {
|
||||
Mint.Indicator.close() // 关闭加载中
|
||||
if (res.data.code === 'success') {
|
||||
fn && fn(res.data)
|
||||
} else {
|
||||
// 弹出提示框
|
||||
Mint.Toast({
|
||||
message: res.data.desc,
|
||||
position: 'center',
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
Mint.Indicator.close() // 关闭加载中
|
||||
})
|
||||
}
|
||||
|
||||
// 判断手机号是否已经绑定(发送验证码之前判断) get
|
||||
// openid
|
||||
// phone
|
||||
function telIsBind (openid, phone, fn) {
|
||||
$ajax.get('/api/telephone/binding', {
|
||||
params: {
|
||||
openid: openid,
|
||||
phone: phone
|
||||
}
|
||||
}).then(res => {
|
||||
Mint.Indicator.close() // 关闭加载中
|
||||
if (res.data.code === 'success') {
|
||||
fn && fn(JSON.parse(res.data.data))
|
||||
} else {
|
||||
// 弹出提示框
|
||||
Mint.Toast({
|
||||
message: res.data.desc,
|
||||
position: 'center',
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
Mint.Indicator.close() // 关闭加载中
|
||||
})
|
||||
}
|
||||
|
||||
// 用户解绑 put
|
||||
// openId
|
||||
// tel
|
||||
function userUnbind (openId, tel, fn) {
|
||||
// let formData = new FormData()
|
||||
// formData.append('openId', openId)
|
||||
// formData.append('tel', tel)
|
||||
$ajax.put('/api/telephone/unbinding', `openId=${encodeURIComponent(openId)}&tel=${encodeURIComponent(tel)}`).then(res => {
|
||||
Mint.Indicator.close() // 关闭加载中
|
||||
if (res.data.code === 'success') {
|
||||
fn && fn(JSON.parse(res.data.data))
|
||||
} else {
|
||||
// 弹出提示框
|
||||
Mint.Toast({
|
||||
message: res.data.desc,
|
||||
position: 'center',
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
Mint.Indicator.close() // 关闭加载中
|
||||
})
|
||||
}
|
||||
|
||||
export {reqWeixin, getTelMsg, userBind, telIsBind, userUnbind}
|
||||
BIN
src/assets/img/colorBorder.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/assets/img/icon-dd.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
src/assets/img/icon-permission.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/assets/img/icon-prompt.png
Normal file
|
After Width: | Height: | Size: 572 B |
BIN
src/assets/img/icon/cthr-icon1.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
src/assets/img/icon/cthr-icon2.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
src/assets/img/icon/cthr-icon3.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
src/assets/img/icon/cthr-icon4.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
src/assets/img/icon/cthr-icon5.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src/assets/img/icon/cthr-icon6.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
src/assets/img/icon/cthr-icon7.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
src/assets/img/icon/cthr-icon8.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
src/assets/img/icon_about.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/assets/img/icon_cookbook.png
Normal file
|
After Width: | Height: | Size: 692 B |
BIN
src/assets/img/icon_finance.png
Normal file
|
After Width: | Height: | Size: 573 B |
BIN
src/assets/img/icon_goods.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/assets/img/icon_home.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/assets/img/icon_monkey.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
src/assets/img/icon_order.png
Normal file
|
After Width: | Height: | Size: 765 B |
BIN
src/assets/img/icon_promotion.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/assets/img/icon_reference.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |