Commit ab62dc8d by damodmg

引用eslint

parent daec9508
.DS_Store
node_modules/
/build/
/config/
/dist/
/*.js
// 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.
// "standard",
'plugin:vue/essential',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'plugin:prettier/recommended'
],
// required to lint *.vue files
plugins: ['vue', 'prettier'],
// add your custom rules here
rules: {
'prettier/prettier': [
'error',
{
endOfLine: 'auto'
}
],
// allow async-await
'generator-star-spacing': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 2 : 0,
'no-alert': process.env.NODE_ENV === 'production' ? 2 : 0, //禁止使用alert confirm prompt
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
// --------------------静态检测-----------------------------
/**
* 静态检测:
* 以下基本位能够帮助发现代码错误的规则
* */
// 禁止与负零进行比较
'no-compare-neg-zero': 2,
// 禁止将常量作为 if 或三元表达式的测试条件,比如 if (true), let foo = 0 ? 'foo' : 'bar'
'no-constant-condition': [
2,
{
checkLoops: false
}
],
// 禁止在函数参数中出现重复名称的参数 【辅助检测】
'no-dupe-args': 2,
// 禁止在对象字面量中出现重复名称的键名 【辅助检测】
'no-dupe-keys': 2,
// 禁止出现空代码块 【可读性差】
'no-empty': [
2,
{
"allowEmptyCatch": true
}
],
// 禁止将 catch 的第一个参数 error 重新赋值 【重新赋值,error将没有意义】
'no-ex-assign': 2,
// @fixable 禁止函数表达式中出现多余的括号,比如 let foo = (function () { return 1 }) 【一般不会这么写,可读性差】
'no-extra-parens': [2, 'functions'],
// 禁止将一个函数申明重新赋值,如:
// function foo() {}
// foo = bar [静态检测:无意义]
'no-func-assign': 2,
// 禁止在 if 内出现函数申明或使用 var 定义变量
'no-inner-declarations': [2, 'both'],
// 禁止使用特殊空白符(比如全角空格),除非是出现在字符串、正则表达式或模版字符串中
'no-irregular-whitespace': [
2,
{
skipStrings: true,
skipComments: false,
skipRegExps: true,
skipTemplates: true
}
],
// typeof 表达式比较的对象必须是 'undefined', 'object', 'boolean', 'number', 'string', 'function' 或 'symbol'
'valid-typeof': 2,
// -----------------------------------最佳实践----------------------------------------------
/**
* 最佳实践
* 这些规则通过一些最佳实践帮助你避免问题
*/
// 禁止函数的循环复杂度超过 20,【https://en.wikipedia.org/wiki/Cyclomatic_complexity】
complexity: [
2,
{
"max": 20
}
],
// 不允许有空函数,除非是将一个空函数设置为某个项的默认值 【否则空函数并没有实际意义】
'no-empty-function': [
2,
{
allow: ['functions', 'arrowFunctions']
}
],
// 禁止修改原生对象 【例如 Array.protype.xxx=funcion(){},很容易出问题,比如for in 循环数组 会出问题】
'no-extend-native': 2,
// @fixable 表示小数时,禁止省略 0,比如 .5 【可读性】
'no-floating-decimal': 2,
// 禁止直接 new 一个类而不赋值 【 那么除了占用内存还有什么意义呢? @off vue语法糖大量存在此类语义 先手动关闭】
'no-new': 0,
// 禁止使用 new Function,比如 let x = new Function("a", "b", "return a + b"); 【可读性差】
'no-new-func': 2,
// 禁止将自己赋值给自己 [规则帮助检测]
'no-self-assign': 2,
// 禁止将自己与自己比较 [规则帮助检测]
'no-self-compare': 2,
// @fixable 立即执行的函数必须符合如下格式 (function () { alert('Hello') })() 【立即函数写法很多,这个是最易读最标准的】
'wrap-iife': [
2,
'inside',
{
functionPrototypeMethods: true
}
],
// 禁止使用保留字作为变量名 [规则帮助检测保留字,通常ide难以发现,生产会出现问题]
'no-shadow-restricted-names': 2,
// 禁止使用未定义的变量
'no-undef': [
2,
{
typeof: false
}
],
// 定义过的变量必须使用 【正规应该是这样的,具体可以大家讨论】
'no-unused-vars': [
2,
{
vars: 'all',
args: 'none',
caughtErrors: 'none',
ignoreRestSiblings: true
}
],
// 变量必须先定义后使用 【ps:涉及到es6存在不允许变量提升的问题,以免引起意想不到的错误,具体可以大家讨论】
'no-use-before-define': [
2,
{
functions: false,
classes: false,
variables: false
}
],
// ----------------------------------------------------代码规范----------------------------------------------------------
/**
* 代码规范
* 有关【空格】、【链式换行】、【缩进】、【=、{}、()、首位空格】规范没有添加,怕大家一时间接受不了,目前所挑选的规则都是:保障我们的代码可读性、可维护性的
* */
// 变量名必须是 camelcase 驼峰风格的
// @off 【涉及到 很多 api 或文件名可能都不是 camelcase 先关闭】
camelcase: 0,
// @fixable 禁止在行首写逗号
'comma-style': [2, 'last'],
// @fixable 一个缩进必须用两个空格替代
// @off 【不限制大家,为了关闭eslint默认值,所以手动关闭,off不可去掉】 讨论
indent: [2, 2, { SwitchCase: 1 }],
//@off 手动关闭//前面需要回车的规则 注释
'spaced-comment': 0,
//@off 手动关闭: 禁用行尾空白
'no-trailing-spaces': 2,
//@off 手动关闭: 不允许多行回车
'no-multiple-empty-lines': 1,
//@off 手动关闭: 逗号前必须加空格
'comma-spacing': 0,
//@off 手动关闭: 冒号后必须加空格
'key-spacing': 1,
// @fixable 结尾禁止使用分号
//@off [vue官方推荐无分号,不知道大家是否可以接受?先手动off掉] 讨论
// "semi": [2,"never"],
semi: 0,
// 代码块嵌套的深度禁止超过 5 层
'max-depth': [1, 10],
// 回调函数嵌套禁止超过 5 层,多了请用 async await 替代
'max-nested-callbacks': [2, 5],
// 函数的参数禁止超过 7 个
'max-params': [2, 7],
// new 后面的类名必须首字母大写 【面向对象编程原则】
'new-cap': [
2,
{
newIsCap: true,
capIsNew: false,
properties: true
}
],
// @fixable new 后面的类必须有小括号 【没有小括号、指针指过去没有意义】
'new-parens': 2,
// @fixable 禁止属性前有空格,比如 foo. bar() 【可读性太差,一般也没人这么写】
'no-whitespace-before-property': 2,
// @fixable 禁止 if 后面不加大括号而写两行代码 eg: if(a>b) a=0 b=0
'nonblock-statement-body-position': [2, 'beside', { overrides: { while: 'below' } }],
// 禁止变量申明时用逗号一次申明多个 eg: let a,b,c,d,e,f,g = [] 【debug并不好审查、并且没办法单独写注释】
'one-var': [2, 'never'],
// @fixable 【变量申明必须每行一个,同上】
'one-var-declaration-per-line': [2, 'always'],
//是否使用全等
eqeqeq: 0,
//this别名
'consistent-this': [2, 'that'],
// -----------------------------ECMAScript 6-------------------------------------
/**
* ECMAScript 6
* 这些规则与 ES6 有关 【请大家 尝试使用正确使用const和let代替var,以后大家熟悉之后可能会提升规则】
* */
// 禁止对定义过的 class 重新赋值
'no-class-assign': 2,
// @fixable 禁止出现难以理解的箭头函数,比如 let x = a => 1 ? 2 : 3
'no-confusing-arrow': [2, { allowParens: true }],
// 禁止对使用 const 定义的常量重新赋值
'no-const-assign': 2,
// 禁止重复定义类
'no-dupe-class-members': 2,
// 禁止重复 import 模块
'no-duplicate-imports': 2,
//@off 以后可能会开启 禁止 var
'no-var': 0,
// ---------------------------------被关闭的规则-----------------------
// parseInt必须指定第二个参数 parseInt("071",10);
radix: 0,
//强制使用一致的反勾号、双引号或单引号 (quotes) 关闭
quotes: 0,
//要求或禁止函数圆括号之前有一个空格
'space-before-function-paren': [0, 'always'],
//禁止或强制圆括号内的空格
'space-in-parens': [0, 'never'],
//关键字后面是否要空一格
'space-after-keywords': [0, 'always'],
// 要求或禁止在函数标识符和其调用之间有空格
'func-call-spacing': [0, 'never']
}
};
{
"printWidth": 400,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"semi": true,
"trailingComma": "none",
"bracketSpacing": true,
"jsxBracketSameLine": true,
"proseWrap": "preserve"
}
...@@ -47,6 +47,7 @@ exports.cssLoaders = function (options) { ...@@ -47,6 +47,7 @@ exports.cssLoaders = function (options) {
if (options.extract) { if (options.extract) {
return ExtractTextPlugin.extract({ return ExtractTextPlugin.extract({
use: loaders, use: loaders,
publicPath:"../../",
fallback: 'vue-style-loader' fallback: 'vue-style-loader'
}) })
} else { } else {
......
...@@ -27,20 +27,21 @@ module.exports = { ...@@ -27,20 +27,21 @@ module.exports = {
errorOverlay: true, errorOverlay: true,
notifyOnErrors: true, notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
// Use Eslint Loader? // Use Eslint Loader?
// If true, your code will be linted during bundling and // If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console. // linting errors and warnings will be shown in the console.
useEslint: false, useEslint: true,
// If true, eslint errors and warnings will also be shown in the error overlay // If true, eslint errors and warnings will also be shown in the error overlay
// in the browser. // in the browser.
showEslintErrorsInOverlay: false,
// showEslintErrorsInOverlay: false,
/** /**
* Source Maps * Source Maps
*/ */
// https://webpack.js.org/configuration/devtool/#development // https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-module-eval-source-map', devtool: 'cheap-module-eval-source-map',
...@@ -59,7 +60,7 @@ module.exports = { ...@@ -59,7 +60,7 @@ module.exports = {
// Paths // Paths
assetsRoot: path.resolve(__dirname, '../dist'), assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static', assetsSubDirectory: 'static',
assetsPublicPath: '/integral-mall/', assetsPublicPath: './',
/** /**
* Source Maps * Source Maps
......
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel="shortcut icon" href=./static/img/favicon.ico><title>GIC后台</title><link rel=stylesheet type=text/css href=static/css/iconfont.css><link rel=stylesheet type=text/css href=static/css/common.css><link href=/integral-mall/static/css/app.dc7515ded3a783d66118c49b81d6e3a7.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.03.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/upload-image.2.0.00.js></script><script type=text/javascript src=/integral-mall/static/js/manifest.003beacb9c9ae622c7f2.js></script><script type=text/javascript src=/integral-mall/static/js/vendor.001c8c8c5c313dc75bd0.js></script><script type=text/javascript src=/integral-mall/static/js/app.f1feb583bfa10eac0636.js></script></body></html> <!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel="shortcut icon" href=./static/img/favicon.ico><title>GIC后台</title><link rel=stylesheet type=text/css href=static/css/iconfont.css><link rel=stylesheet type=text/css href=static/css/common.css><link href=./static/css/app.6b0d26a45c323d2bf6448589ccd55867.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.03.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/upload-image.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/input.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.00.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.264a1f7323512c77f7a5.js></script><script type=text/javascript src=./static/js/app.1ee2eaac00ac61d77731.js></script></body></html>
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(r){var n=window.webpackJsonp;window.webpackJsonp=function(e,u,c){for(var f,i,l,a=0,p=[];a<e.length;a++)i=e[a],t[i]&&p.push(t[i][0]),t[i]=0;for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(r[f]=u[f]);for(n&&n(e,u,c);p.length;)p.shift()();if(c)for(a=0;a<c.length;a++)l=o(o.s=c[a]);return l};var e={},t={2:0};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,n,e){o.o(r,n)||Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:e})},o.n=function(r){var n=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(n,"a",n),n},o.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},o.p="/integral-mall/",o.oe=function(r){throw console.error(r),r}}([]);
\ No newline at end of file
!function(r){var n=window.webpackJsonp;window.webpackJsonp=function(e,u,c){for(var f,i,p,a=0,l=[];a<e.length;a++)i=e[a],o[i]&&l.push(o[i][0]),o[i]=0;for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(r[f]=u[f]);for(n&&n(e,u,c);l.length;)l.shift()();if(c)for(a=0;a<c.length;a++)p=t(t.s=c[a]);return p};var e={},o={2:0};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=r,t.c=e,t.d=function(r,n,e){t.o(r,n)||Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:e})},t.n=function(r){var n=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(n,"a",n),n},t.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},t.p="./",t.oe=function(r){throw console.error(r),r}}([]);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -16,17 +16,21 @@ ...@@ -16,17 +16,21 @@
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
<!-- 库引用cdn --> <!-- 库引用cdn -->
<script src="//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js"></script> <script src='//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js'></script>
<script src="//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js"></script> <script src='//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js'></script>
<script src="//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js"></script> <script src='//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js'></script>
<script src="//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js"></script> <script src='//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js'></script>
<!-- 组件引用cdn --> <!-- 组件引用cdn -->
<script src="//web-1251519181.file.myqcloud.com/components/header.2.0.03.js"></script> <script src='//web-1251519181.file.myqcloud.com/components/header.2.0.03.js'></script>
<script src="//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.02.js"></script> <script src='//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.02.js'></script>
<script src="//web-1251519181.file.myqcloud.com/components/export-excel.2.0.01.js"></script> <script src='//web-1251519181.file.myqcloud.com/components/export-excel.2.0.01.js'></script>
<script src="//web-1251519181.file.myqcloud.com/components/footer.2.0.02.js"></script> <script src='//web-1251519181.file.myqcloud.com/components/footer.2.0.02.js'></script>
<script src="//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js"></script> <script src='//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js'></script>
<script src="//web-1251519181.file.myqcloud.com/components/upload-image.2.0.00.js"></script> <script src='//web-1251519181.file.myqcloud.com/components/upload-image.2.0.00.js'></script>
<!-- 二次封装的input -->
<script src='//web-1251519181.file.myqcloud.com/components/input.2.0.00.js'></script>
<!-- 删除确认弹窗 -->
<script src='//web-1251519181.file.myqcloud.com/components/delete.2.0.00.js'></script>
</body> </body>
</html> </html>
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev", "start": "npm run dev",
"build": "node build/build.js", "build": "node build/build.js",
"publish": "publish.bat" "publish": "publish.bat",
"format": "onchange 'test/**/*.js' 'src/**/*.js' 'src/**/*.vue' -- prettier --write {{changed}}",
"formater": "onchange \"test/**/*.js\" \"src/**/*.js\" \"src/**/*.vue\" -- prettier --write {{changed}}"
}, },
"dependencies": { "dependencies": {
"@gic-test/vue-gic-store-linkage": "^1.0.7", "@gic-test/vue-gic-store-linkage": "^1.0.7",
...@@ -17,7 +19,6 @@ ...@@ -17,7 +19,6 @@
"@tinymce/tinymce-vue": "^1.1.0", "@tinymce/tinymce-vue": "^1.1.0",
"axios": "^0.18.0", "axios": "^0.18.0",
"element-ui": "^2.4.1", "element-ui": "^2.4.1",
"packele": "^1.0.8",
"scriptjs": "^2.5.8", "scriptjs": "^2.5.8",
"tinymce": "^4.8.5", "tinymce": "^4.8.5",
"vue": "^2.5.2", "vue": "^2.5.2",
...@@ -30,19 +31,29 @@ ...@@ -30,19 +31,29 @@
"devDependencies": { "devDependencies": {
"ansi-html": "^0.0.7", "ansi-html": "^0.0.7",
"autoprefixer": "^7.1.2", "autoprefixer": "^7.1.2",
"babel-cli": "^6.26.0",
"babel-core": "^6.22.1", "babel-core": "^6.22.1",
"babel-eslint": "^8.2.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3", "babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1", "babel-loader": "^7.1.1",
"babel-plugin-syntax-jsx": "^6.18.0", "babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0", "babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0", "babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2", "babel-preset-env": "^1.3.2",
"babel-preset-flow": "^6.23.0",
"babel-preset-stage-2": "^6.22.0", "babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1", "chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1", "copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0", "css-loader": "^0.28.0",
"eslint": "^4.15.0",
"eslint-config-prettier": "^3.6.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-prettier": "^3.0.1",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-vue": "^4.0.0",
"element-theme-chalk": "^2.4.1", "element-theme-chalk": "^2.4.1",
"extract-text-webpack-plugin": "^3.0.0", "extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4", "file-loader": "^1.1.4",
...@@ -51,12 +62,14 @@ ...@@ -51,12 +62,14 @@
"localforage": "^1.7.2", "localforage": "^1.7.2",
"node-notifier": "^5.1.2", "node-notifier": "^5.1.2",
"node-sass": "^4.9.0", "node-sass": "^4.9.0",
"onchange": "^5.2.0",
"optimize-css-assets-webpack-plugin": "^3.2.0", "optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0", "ora": "^1.2.0",
"portfinder": "^1.0.13", "portfinder": "^1.0.13",
"postcss-import": "^11.0.0", "postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8", "postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1", "postcss-url": "^7.2.1",
"prettier": "^1.16.4",
"rimraf": "^2.6.0", "rimraf": "^2.6.0",
"sass-loader": "^7.0.3", "sass-loader": "^7.0.3",
"semver": "^5.3.0", "semver": "^5.3.0",
......
<template> <template>
<div id="app"> <div id="app">
<keep-alive :include="include"> <keep-alive :include="include">
...@@ -10,19 +9,19 @@ ...@@ -10,19 +9,19 @@
<script> <script>
export default { export default {
name: 'App', name: 'App',
data(){ data() {
return { return {
include:[] include: []
} };
} }
} };
</script> </script>
<style lang="scss"> <style lang="scss">
@import './assets/theme/index.css'; @import './assets/theme/index.css';
@import './assets/style/base/index.scss'; @import './assets/style/base/index.scss';
@import './assets/iconfont/iconfont.css'; @import './assets/iconfont/iconfont.css';
#app{ #app {
height: 100%; height: 100%;
background-color: #f0f2f5; background-color: #f0f2f5;
} }
......
/*eslint-disable*/
import axios from 'axios' import axios from 'axios'
import store from '../store/index' import store from '../store/index'
// import router from '../router' // import router from '../router'
...@@ -41,7 +42,6 @@ request.interceptors.response.use( ...@@ -41,7 +42,6 @@ request.interceptors.response.use(
return response; return response;
}, },
error => { error => {
console.log(error)
if (error.response) { if (error.response) {
switch (error.response.status) { switch (error.response.status) {
case 401: case 401:
......
import vueGicAsideMenu from './component.vue' // 导入组件 import vueGicAsideMenu from './component.vue'; // 导入组件
const vueGicAside = { const vueGicAside = {
install(Vue, options) { install(Vue, options) {
Vue.component(vueGicAsideMenu.name, vueGicAsideMenu) // vueGicAsideMenu.name 组件的name属性 Vue.component(vueGicAsideMenu.name, vueGicAsideMenu); // vueGicAsideMenu.name 组件的name属性
// 类似通过 this.$xxx 方式调用插件的 其实只是挂载到原型上而已 // 类似通过 this.$xxx 方式调用插件的 其实只是挂载到原型上而已
// Vue.prototype.$xxx // 最终可以在任何地方通过 this.$xxx 调用 // Vue.prototype.$xxx // 最终可以在任何地方通过 this.$xxx 调用
// 虽然没有明确规定用$开头 但是大家都默认遵守这个规定 // 虽然没有明确规定用$开头 但是大家都默认遵守这个规定
} }
} };
if (typeof window !== 'undefined' && window.Vue) { if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(vueGicAside); window.Vue.use(vueGicAside);
} }
export default vueGicAside export default vueGicAside;
// export { // export {
// vueGicAsideMenu // vueGicAsideMenu
// } // }
...@@ -2,4 +2,4 @@ import upload from './upload'; ...@@ -2,4 +2,4 @@ import upload from './upload';
export default { export default {
upload upload
} };
...@@ -3,16 +3,18 @@ ...@@ -3,16 +3,18 @@
<vue-gic-header class="user-header-pop" style="z-index: 1999;min-width:1400px" :projectName="projectName" :collapseFlag="collapseFlag" @collapseTag="collapseTagHandler" @toRouterView="toRouterView"></vue-gic-header> <vue-gic-header class="user-header-pop" style="z-index: 1999;min-width:1400px" :projectName="projectName" :collapseFlag="collapseFlag" @collapseTag="collapseTagHandler" @toRouterView="toRouterView"></vue-gic-header>
<div class="layout"> <div class="layout">
<vue-gic-aside-menu class="layout-left" v-if="asideShow" :projectName="projectName" :leftModulesName="leftModulesName" :collapseFlag.sync="collapseFlag"></vue-gic-aside-menu> <vue-gic-aside-menu class="layout-left" v-if="asideShow" :projectName="projectName" :leftModulesName="leftModulesName" :collapseFlag.sync="collapseFlag"></vue-gic-aside-menu>
<div class="layout-right" :class="[{'asideShow': asideShow},{'collapseFlag':asideShow && collapseFlag}]"> <div class="layout-right" :class="[{ asideShow: asideShow }, { collapseFlag: asideShow && collapseFlag }]">
<div class="layout-title"> <div class="layout-title">
<el-breadcrumb class="dm-breadcrumb" separator="/"> <el-breadcrumb class="dm-breadcrumb" separator="/">
<el-breadcrumb-item :to="{ path: '' }"><a href="/report/#/memberSummary">首页</a></el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '' }"><a href="/report/#/memberSummary">首页</a></el-breadcrumb-item>
<el-breadcrumb-item :class="{'no-link':!v.path}" v-for="(v,i) in breadcrumb" :key="i" :to="{ path: v.path }">{{v.name}}</el-breadcrumb-item> <el-breadcrumb-item :class="{ 'no-link': !v.path }" v-for="(v, i) in breadcrumb" :key="i" :to="{ path: v.path }">{{ v.name }}</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
<h3><span>{{contentTitle}}</span></h3> <h3>
<span>{{ contentTitle }}</span>
</h3>
</div> </div>
<div class="layout-content__wrap"> <div class="layout-content__wrap">
<div class="layout-content" :class="[{'asideShow': asideShow},{'collapseFlag':asideShow && collapseFlag}]"> <div class="layout-content" :class="[{ asideShow: asideShow }, { collapseFlag: asideShow && collapseFlag }]">
<router-view></router-view> <router-view></router-view>
</div> </div>
</div> </div>
...@@ -23,29 +25,30 @@ ...@@ -23,29 +25,30 @@
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
collapseFlag: false, collapseFlag: false,
projectName: "integral-mall", projectName: 'integral-mall',
leftModulesName: '公众号配置', leftModulesName: '公众号配置'
} };
}, },
created(){ created() {
$bus.$on('aside-menu',val => { /* eslint-disable */
this.leftMenuRouter = val $bus.$on('aside-menu', val => {
}) this.leftMenuRouter = val;
});
}, },
/* eslint-disable */
destroyed() { destroyed() {
$bus.$off('aside-menu'); $bus.$off('aside-menu');
}, },
computed: { computed: {
asideShow() { asideShow() {
console.log(this.$store.state)
return this.$store.state.marketing.asideShow; return this.$store.state.marketing.asideShow;
}, },
contentTitle() { contentTitle() {
return this.$route.name return this.$route.name;
}, },
breadcrumb() { breadcrumb() {
return this.$store.state.marketing.breadcrumb; return this.$store.state.marketing.breadcrumb;
...@@ -57,19 +60,19 @@ ...@@ -57,19 +60,19 @@
// } // }
// }, // },
methods: { methods: {
// 处理路由跳转 // // 处理路由跳转
toRouterView(val) { // toRouterView(val) {
var that = this; // var that = this;
// 模拟检查数据 // // 模拟检查数据
// //有两个参数 // // //有两个参数
//{ // //{
// name:, // // name:,
// path: // // path:
//} // //}
that.$router.push({ // that.$router.push({
path: val // path: val
}) // });
}, // },
// 处理路由跳转 // 处理路由跳转
toRouterView(val) { toRouterView(val) {
//有两个参数 //有两个参数
...@@ -79,21 +82,21 @@ ...@@ -79,21 +82,21 @@
//} //}
this.$router.push({ this.$router.push({
path: val.path path: val.path
}) });
}, },
// 折叠事件 // 折叠事件
collapseTagHandler(val){ collapseTagHandler(val) {
this.collapseFlag = val this.collapseFlag = val;
}
} }
} }
};
</script> </script>
<style lang="scss"> <style lang="scss">
.layout-container{ .layout-container {
height:100%; height: 100%;
display:flex; display: flex;
} }
.layout { .layout {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
background-color: #f0f2f5; background-color: #f0f2f5;
...@@ -109,50 +112,50 @@ ...@@ -109,50 +112,50 @@
left: 0; left: 0;
z-index: 9; z-index: 9;
} }
&-right{ &-right {
position: relative; position: relative;
flex: 1; flex: 1;
overflow-x:auto; overflow-x: auto;
transition: width 0.5s; transition: width 0.5s;
-moz-transition: width 0.5s; -moz-transition: width 0.5s;
-webkit-transition: width 0.5s; -webkit-transition: width 0.5s;
-o-transition: width 0.5s; -o-transition: width 0.5s;
height: 100%; height: 100%;
// overflow-y: auto; // overflow-y: auto;
margin-left:0px; margin-left: 0px;
&.asideShow{ &.asideShow {
margin-left: 200px; margin-left: 200px;
} }
&.collapseFlag{ &.collapseFlag {
margin-left: 64px; margin-left: 64px;
} }
} }
&-title{ &-title {
// position: absolute; // position: absolute;
// width: 100%; // width: 100%;
// top:0; // top:0;
// left:0; // left:0;
height:85px; height: 85px;
background:#fff; background: #fff;
// box-shadow: 0 3px 5px rgba(147,165,184,.13); // box-shadow: 0 3px 5px rgba(147,165,184,.13);
padding:15px 0 0 30px; padding: 15px 0 0 30px;
border-bottom: 1px solid #e4e7ed; border-bottom: 1px solid #e4e7ed;
h3 { h3 {
color:#303133; color: #303133;
font-size:20px; font-size: 20px;
padding:24px 0; padding: 24px 0;
font-weight:500; font-weight: 500;
span{ span {
color:#303133; color: #303133;
font-size:20px; font-size: 20px;
font-weight:500; font-weight: 500;
} }
i{ i {
font-size:20px; font-size: 20px;
color:#c0c4ce; color: #c0c4ce;
cursor: pointer; cursor: pointer;
&:hover{ &:hover {
color:#909399; color: #909399;
} }
} }
} }
...@@ -160,7 +163,7 @@ ...@@ -160,7 +163,7 @@
&-content__wrap { &-content__wrap {
overflow-y: auto; overflow-y: auto;
position: relative; position: relative;
top:-1px; top: -1px;
&::-webkit-scrollbar { &::-webkit-scrollbar {
display: none; display: none;
} }
...@@ -169,19 +172,18 @@ ...@@ -169,19 +172,18 @@
// margin-top: 100px; // margin-top: 100px;
min-height: calc(100% - 200px); min-height: calc(100% - 200px);
min-width: 1400px; min-width: 1400px;
&.asideShow{ &.asideShow {
min-width: 1200px; min-width: 1200px;
} }
&.collapseFlag{ &.collapseFlag {
min-width: 1336px; min-width: 1336px;
} }
} }
} }
.dm-breadcrumb{ .dm-breadcrumb {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
} }
.user-header-pop { .user-header-pop {
min-width: 95px; min-width: 95px;
...@@ -189,5 +191,4 @@ ...@@ -189,5 +191,4 @@
.el-popover.user-header-pop { .el-popover.user-header-pop {
min-width: 95px; min-width: 95px;
} }
</style> </style>
/*eslint-disable*/
const config = { const config = {
development: { development: {
api: '/dmApi/' api: '/dmApi/'
}, },
production: { production: {
// api: 'https://hope.demogic.com/', // api: 'https://hope.demogic.com/',
api: (window.location.protocol + '//' + window.location.host +'/') || '' api: window.location.protocol + '//' + window.location.host + '/' || ''
} }
} };
export default { export default {
api: config[process.env['NODE_ENV']]['api'] api: config[process.env['NODE_ENV']]['api']
} };
export default axios export default axios;
\ No newline at end of file
import Vue from 'vue' import Vue from 'vue';
import App from './App' import App from './App';
import router from './router' import router from './router';
import store from './store' import store from './store';
import { axios } from './service/api/index' import { axios } from './service/api/index';
import ElementUI from 'element-ui' import ElementUI from 'element-ui';
// import vueGicHeader from '@gic-test/vue-gic-header' // import vueGicHeader from '@gic-test/vue-gic-header'
// import vueGicFooter from '@gic-test/vue-gic-footer' // import vueGicFooter from '@gic-test/vue-gic-footer'
// 单个图片预览插件 // 单个图片预览插件
// import vueGicImgPreview from '@gic-test/vue-gic-img-preview' // import vueGicImgPreview from '@gic-test/vue-gic-img-preview'
import vueGicStoreLinkage from '@gic-test/vue-gic-store-linkage/src/lib' import vueGicStoreLinkage from '@gic-test/vue-gic-store-linkage/src/lib';
// import vueGicAsideMenu from '@/components/aside-menu' // import vueGicAsideMenu from '@/components/aside-menu'
// 图片墙上传插件 // 图片墙上传插件
// import vueGicUploadImage from '@gic-test/vue-gic-upload-image/src/lib' // import vueGicUploadImage from '@gic-test/vue-gic-upload-image/src/lib'
import VueClipboard from 'vue-clipboard2' import VueClipboard from 'vue-clipboard2';
// import vueGicExportExcel from '@gic-test/vue-gic-export-excel' // import vueGicExportExcel from '@gic-test/vue-gic-export-excel'
Vue.config.productionTip = false;
Vue.use(ElementUI);
import packele from 'packele'
Vue.config.productionTip = false
Vue.use(packele)
Vue.use(ElementUI)
// Vue.use(vueGicHeader) // Vue.use(vueGicHeader)
// Vue.use(vueGicFooter) // Vue.use(vueGicFooter)
// Vue.use(vueGicAsideMenu) // Vue.use(vueGicAsideMenu)
Vue.use(vueGicStoreLinkage) Vue.use(vueGicStoreLinkage);
// Vue.use(vueGicImgPreview) // Vue.use(vueGicImgPreview)
// Vue.use(vueGicUploadImage) // Vue.use(vueGicUploadImage)
Vue.use(VueClipboard) Vue.use(VueClipboard);
// Vue.use(vueGicExportExcel) // Vue.use(vueGicExportExcel)
Vue.prototype.axios = axios; Vue.prototype.axios = axios;
Vue.prototype.axios.withCredentials = true Vue.prototype.axios.withCredentials = true;
/* eslint-disable */
window.$bus = new Vue(); window.$bus = new Vue();
let flag = false let flag = false;
Vue.prototype.$tips = function({ message = '提示', type = 'success' }) { Vue.prototype.$tips = function({ message = '提示', type = 'success' }) {
if (flag) { return } else { this.$message({ message, type }) } if (flag) {
flag = true; return;
setTimeout(_ => { flag = false }, 1000) } else {
this.$message({ message, type });
} }
/* eslint-disable no-new */ flag = true;
setTimeout(_ => {
flag = false;
}, 1000);
};
/* eslint-disable no-new */
new Vue({ new Vue({
el: '#app', el: '#app',
router, router,
store, store,
components: { App }, components: { App },
template: '<App/>' template: '<App/>'
}) });
\ No newline at end of file
import Vue from 'vue' import Vue from 'vue';
import Router from 'vue-router' import Router from 'vue-router';
import routes from './routes' import routes from './routes';
Vue.use(Router) Vue.use(Router);
let router = new Router({ let router = new Router({
routes, routes,
...@@ -13,17 +13,14 @@ let router = new Router({ ...@@ -13,17 +13,14 @@ let router = new Router({
} }
const layoutRight = document.querySelector('.layout-right'); const layoutRight = document.querySelector('.layout-right');
if (layoutRight) { if (layoutRight) {
layoutRight.scrollTo(0,0); layoutRight.scrollTo(0, 0);
} }
} }
});
}) router.beforeEach((to, from, next) => {
router.beforeEach((to,from,next) => {
document.title = to.name; document.title = to.name;
next() next();
}) });
export default router
export default router;
import Layout from '@/components/layout' import Layout from '@/components/layout';
import page401 from '@/views/error/401' import page401 from '@/views/error/401';
import page403 from '@/views/error/403' import page403 from '@/views/error/403';
import page404 from '@/views/error/404' import page404 from '@/views/error/404';
import page500 from '@/views/error/500' import page500 from '@/views/error/500';
//积分商城 //积分商城
import mall from '../views/mall/index'; import mall from '../views/mall/index';
import couponList from '../views/mall/coupon/list'; import couponList from '../views/mall/coupon/list';
...@@ -13,19 +13,21 @@ import giftExchange from '../views/mall/gift/exchange'; ...@@ -13,19 +13,21 @@ import giftExchange from '../views/mall/gift/exchange';
import giftInfo from '../views/mall/gift/info.vue'; import giftInfo from '../views/mall/gift/info.vue';
import goodsList from '../views/mall/goods/list'; import goodsList from '../views/mall/goods/list';
export default [
export default [{ {
path: '/', path: '/',
name: 'layout', name: 'layout',
component: Layout, component: Layout,
redirect: '/mall', redirect: '/mall',
children: [{ children: [
{
path: 'mall', path: 'mall',
name: '积分商城', name: '积分商城',
component: mall, component: mall,
redirect: '/coupon', redirect: '/coupon',
meta: {}, meta: {},
children: [{ children: [
{
path: '/coupon', path: '/coupon',
name: '优惠券', name: '优惠券',
component: couponList, component: couponList,
...@@ -121,7 +123,6 @@ export default [{ ...@@ -121,7 +123,6 @@ export default [{
} }
}, },
{ {
path: '/goods', path: '/goods',
name: '待发货', name: '待发货',
...@@ -129,9 +130,10 @@ export default [{ ...@@ -129,9 +130,10 @@ export default [{
meta: { meta: {
menu: 'goods' menu: 'goods'
} }
}, }
]
}
] ]
}]
}, },
{ {
path: '/401', path: '/401',
...@@ -152,5 +154,5 @@ export default [{ ...@@ -152,5 +154,5 @@ export default [{
path: '*', path: '*',
name: '未知领域', name: '未知领域',
component: page404 component: page404
}, }
] ];
\ No newline at end of file
import {requests} from './index'; import { requests } from './index';
import router from '@/router'; import router from '@/router';
const MARKET_PREFIX = 'api-marketing/'; const MARKET_PREFIX = 'api-marketing/';
const PLUG_PREFIX = 'api-plug/'; const PLUG_PREFIX = 'api-plug/';
const GOODS_PREFIX = 'api-admin/'; const GOODS_PREFIX = 'api-admin/';
import Vue from 'vue'; import Vue from 'vue';
const _vm = new Vue(); const _vm = new Vue();
//获取营销场景 //获取营销场景
export const sceneSettingList = (params) => requests(MARKET_PREFIX + 'scene-setting-list', params); export const sceneSettingList = params => requests(MARKET_PREFIX + 'scene-setting-list', params);
//获取营销场景 //获取营销场景
export const getCardList = (params) => requests(PLUG_PREFIX + 'get-coupon-list', params); export const getCardList = params => requests(PLUG_PREFIX + 'get-coupon-list', params);
//所有门店分组 //所有门店分组
export const storeGroupList = (params) => requests(GOODS_PREFIX + 'store-group-list', params); export const storeGroupList = params => requests(GOODS_PREFIX + 'store-group-list', params);
//上传图片 //上传图片
export const uploadImgText = (params) => requests(PLUG_PREFIX + 'upload-img', params); export const uploadImgText = params => requests(PLUG_PREFIX + 'upload-img', params);
import Vue from 'vue' /*eslint-disable*/
import axios from 'axios' import Vue from 'vue';
import config from '@/config' import axios from 'axios';
import { log } from '@/utils' import config from '@/config';
import qs from 'qs' import { log } from '@/utils';
import Router from 'vue-router' import qs from 'qs';
import Router from 'vue-router';
const router = new Router(); const router = new Router();
// 加载最小时间 // 加载最小时间
const MINI_TIME = 300 const MINI_TIME = 300;
// 超时时间 // 超时时间
let TIME_OUT_MAX = 20000 let TIME_OUT_MAX = 20000;
// 环境value // 环境value
let _isDev = process.env.NODE_ENV === 'development' let _isDev = process.env.NODE_ENV === 'development';
// 请求接口host // 请求接口host
let _apiHost = config.api let _apiHost = config.api;
// 请求组(判断当前请求数) // 请求组(判断当前请求数)
let _requests = [] let _requests = [];
//创建一个请求实例 //创建一个请求实例
const instance = axios.create({ const instance = axios.create({
baseURL: _apiHost, baseURL: _apiHost,
timeout: TIME_OUT_MAX, timeout: TIME_OUT_MAX,
headers: {'Content-Type': 'application/x-www-form-urlencoded'}, headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
}) });
/** /**
* 添加请求,显示loading * 添加请求,显示loading
* @param {请求配置} config * @param {请求配置} config
*/ */
function pushRequest(config) { function pushRequest(config) {
log(`${config.url}--begin`) log(`${config.url}--begin`);
_requests.push(config) _requests.push(config);
} }
/** /**
...@@ -38,12 +39,12 @@ function pushRequest(config) { ...@@ -38,12 +39,12 @@ function pushRequest(config) {
* @param {请求配置} config * @param {请求配置} config
*/ */
function popRequest(config) { function popRequest(config) {
log(`${config.url}--end`) log(`${config.url}--end`);
let _index = _requests.findIndex(r => { let _index = _requests.findIndex(r => {
return r === config return r === config;
}) });
if (_index > -1) { if (_index > -1) {
_requests.splice(_index, 1) _requests.splice(_index, 1);
} }
} }
/** /**
...@@ -51,91 +52,86 @@ function popRequest(config) { ...@@ -51,91 +52,86 @@ function popRequest(config) {
* @param {*} code * @param {*} code
* @param {string} [message='请求错误'] * @param {string} [message='请求错误']
*/ */
function handlerErr(code,message = '请求错误') { function handlerErr(code, message = '请求错误') {
switch (code) { switch (code) {
case 404: case 404:
message = '404,错误请求' message = '404,错误请求';
router.push('/404') router.push('/404');
break break;
case 401: case 401:
if (!_isDev) { if (!_isDev) {
window.location.href = config.api+'/gic-web/#/' window.location.href = config.api + '/gic-web/#/';
} }
message = '登录失效' message = '登录失效';
break break;
case 403: case 403:
message = '禁止访问' message = '禁止访问';
router.push('/403') router.push('/403');
break break;
case 408: case 408:
message = '请求超时' message = '请求超时';
break break;
case 500: case 500:
message = '服务器内部错误' message = '服务器内部错误';
// router.push('/500') // router.push('/500')
break break;
case 501: case 501:
message = '功能未实现' message = '功能未实现';
break break;
case 503: case 503:
message = '服务不可用' message = '服务不可用';
break break;
case 504: case 504:
message = '网关错误' message = '网关错误';
break break;
} }
Vue.prototype.$tips({type:'warning',message:message}) Vue.prototype.$tips({ type: 'warning', message: message });
} }
/** /**
* 请求地址,请求数据,是否静默,请求方法 * 请求地址,请求数据,是否静默,请求方法
*/ */
const requests = (url, data = {},contentTypeIsJSON = false, isSilence = false, method = 'POST') => { const requests = (url, data = {}, contentTypeIsJSON = false, isSilence = false, method = 'POST') => {
let _opts = { method, url } let _opts = { method, url };
const _query = {} const _query = {};
let _timer = null let _timer = null;
if (method.toLocaleUpperCase() === 'POST') { if (method.toLocaleUpperCase() === 'POST') {
if (contentTypeIsJSON) { if (contentTypeIsJSON) {
_opts.data = data; _opts.data = data;
_opts.headers = {'Content-Type': 'application/json'}; _opts.headers = { 'Content-Type': 'application/json' };
_opts.url += '?requestProject=marketing'; _opts.url += '?requestProject=marketing';
} else { } else {
_opts.data = qs.stringify(Object.assign({requestProject:'gic-web'},data)) _opts.data = qs.stringify(Object.assign({ requestProject: 'integral-mall' }, data));
} }
} else { } else {
_opts.params = _query _opts.params = _query;
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let _random = { stamp: Date.now(), url: `${_apiHost + url}` } let _random = { stamp: Date.now(), url: `${_apiHost + url}` };
if (!isSilence) { if (!isSilence) {
_timer = setTimeout(() => { _timer = setTimeout(() => {
pushRequest(_random) pushRequest(_random);
}, MINI_TIME) }, MINI_TIME);
} }
instance(_opts) instance(_opts)
.then(res => { .then(res => {
clearTimeout(_timer) clearTimeout(_timer);
popRequest(_random) popRequest(_random);
if (res.data.errorCode !== 0) { if (res.data.errorCode !== 0) {
reject(res); reject(res);
handlerErr(res.data.errorCode,res.data.message); handlerErr(res.data.errorCode, res.data.message);
} else { } else {
resolve(res.data) resolve(res.data);
} }
}) })
.catch(res => { .catch(res => {
clearTimeout(_timer) clearTimeout(_timer);
popRequest(_random) popRequest(_random);
if (res) { if (res) {
handlerErr(res.response.status,'接口异常') handlerErr(res.response.status, '接口异常');
} }
reject(res) reject(res);
}) });
}) });
} };
export { instance as axios, requests };
export {
instance as axios,
requests
}
import { requests } from './index'; import { requests } from './index';
import config from '@/config'; import config from '@/config';
const PREFIX = 'api-integral-mall/'; const PREFIX = 'api-integral-mall/';
// 卡券列表 // 卡券列表
export const getCardList = (params) => requests(PREFIX + 'list-card', params); export const getCardList = params => requests(PREFIX + 'list-card', params);
// 首页优惠券 // 首页优惠券
export const getPageCardsList = (params) => requests(PREFIX + 'page-cards', params); export const getPageCardsList = params => requests(PREFIX + 'page-cards', params);
//更新库存 //更新库存
export const updateStockService = (params) => requests(PREFIX + 'update-stock', params); export const updateStockService = params => requests(PREFIX + 'update-stock', params);
//更新兑换所需积分 //更新兑换所需积分
export const updateIntegralCostService = (params) => requests(PREFIX + 'update-integral-cost', params); export const updateIntegralCostService = params => requests(PREFIX + 'update-integral-cost', params);
//更新兑换所需现金 //更新兑换所需现金
export const updateCashCostService = (params) => requests(PREFIX + 'update-cash-cost', params); export const updateCashCostService = params => requests(PREFIX + 'update-cash-cost', params);
//删除商品 //删除商品
export const deleteProService = (params) => requests(PREFIX + 'delete-pro', params); export const deleteProService = params => requests(PREFIX + 'delete-pro', params);
//查看兑换记录 //查看兑换记录
export const getPageExchangeLogsList = (params) => requests(PREFIX + 'page-exchange-logs', params); export const getPageExchangeLogsList = params => requests(PREFIX + 'page-exchange-logs', params);
//查询单个商品 //查询单个商品
export const getIntegralMallProInfo = (params) => requests(PREFIX + 'get-integral-mall-pro', params); export const getIntegralMallProInfo = params => requests(PREFIX + 'get-integral-mall-pro', params);
//基础数据-会员等级 //基础数据-会员等级
export const getGradeList = (params) => requests(PREFIX + 'load-grade', params); export const getGradeList = params => requests(PREFIX + 'load-grade', params);
//创建修改积分商品 //创建修改积分商品
export const createIntegralProService = (params) => requests(PREFIX + 'create-integral-pro', params, true); export const createIntegralProService = params => requests(PREFIX + 'create-integral-pro', params, true);
// 首页礼品列表 // 首页礼品列表
export const getPageGiftList = (params) => requests(PREFIX + 'page-gift', params); export const getPageGiftList = params => requests(PREFIX + 'page-gift', params);
// 基础数据-分类列表 // 基础数据-分类列表
export const getCategoryList = (params) => requests(PREFIX + 'load-category', params); export const getCategoryList = params => requests(PREFIX + 'load-category', params);
// 导出优惠券兑换记录 // 导出优惠券兑换记录
export const exportExchangeListExcel = config.api + PREFIX + 'download-exchange-list-execl'; export const exportExchangeListExcel = config.api + PREFIX + 'download-exchange-list-execl';
// 导出代发货商品 // 导出代发货商品
export const exportOnlineListExcel = config.api + PREFIX + 'download-integral-online-excel'; export const exportOnlineListExcel = config.api + PREFIX + 'download-integral-online-excel';
// 查看物流 // 查看物流
export const getLogisticsInfo = (params) => requests(PREFIX + 'list-logistics-traces', params); export const getLogisticsInfo = params => requests(PREFIX + 'list-logistics-traces', params);
// 基础数据-物流列表 // 基础数据-物流列表
export const getLogisticsList = (params) => requests(PREFIX + 'load-logisties', params); export const getLogisticsList = params => requests(PREFIX + 'load-logisties', params);
// 订单发货,取消,修改物流 // 订单发货,取消,修改物流
export const orderOptService = (params) => requests(PREFIX + 'order-opt', params); export const orderOptService = params => requests(PREFIX + 'order-opt', params);
// 首页待发货 // 首页待发货
export const getPageUndeliverList = (params) => requests(PREFIX + 'page-undeliver', params); export const getPageUndeliverList = params => requests(PREFIX + 'page-undeliver', params);
// 首页代发货数量 // 首页代发货数量
export const getNotSendCount = (params) => requests(PREFIX + 'get-not-send-count', params); export const getNotSendCount = params => requests(PREFIX + 'get-not-send-count', params);
// 礼品设置热门商品 // 礼品设置热门商品
export const setHotStatusService = (params) => requests(PREFIX + 'update-hot-status', params); export const setHotStatusService = params => requests(PREFIX + 'update-hot-status', params);
// 新建礼品分类 // 新建礼品分类
export const createCategoryService = (params) => requests(PREFIX + 'create-gift-category', params); export const createCategoryService = params => requests(PREFIX + 'create-gift-category', params);
// 删除礼品分类 // 删除礼品分类
export const delCategoryService = (params) => requests(PREFIX + 'del-gift-category', params); export const delCategoryService = params => requests(PREFIX + 'del-gift-category', params);
// 获取卡券成本 // 获取卡券成本
export const getCashCostService = (params) => requests(PREFIX + 'get-integral-mall-CashCost', params); export const getCashCostService = params => requests(PREFIX + 'get-integral-mall-CashCost', params);
// 获取卡券成本 // 获取卡券成本
export const getMemberInfo = (params) => requests(PREFIX + 'get-member', params); export const getMemberInfo = params => requests(PREFIX + 'get-member', params);
\ No newline at end of file
import Vue from 'vue' import Vue from 'vue';
import Vuex from 'vuex' import Vuex from 'vuex';
import marketing from './modules/marketing' import marketing from './modules/marketing';
Vue.use(Vuex);
Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
modules: { modules: {
marketing, marketing
}, }
}) });
// initial state // initial state
const state = { const state = {
all: 0, all: 0,
cartData: [], cartData: [],
total: 0, total: 0,
leftMenu:[], leftMenu: [],
storeObj:{}, storeObj: {},
asideShow:false, asideShow: false,
breadcrumb:[] breadcrumb: []
} };
// getters // getters
const getters = { const getters = {
allProducts: (state, getters, rootState) => { allProducts: (state, getters, rootState) => {
return state.all return state.all;
}, },
allCartData: state => state.cartData, allCartData: state => state.cartData,
total: state => { total: state => {
state.total = 0; state.total = 0;
for( let item of state.cartData ) { for (let item of state.cartData) {
state.total += item.price state.total += item.price;
} }
return state.total return state.total;
} }
} };
// actions // actions
const actions = { const actions = {
setAll({commit},data) { setAll({ commit }, data) {
commit('mutations_setAll',data); commit('mutations_setAll', data);
}, },
setCartData({commit},item) { setCartData({ commit }, item) {
commit('mutations_CartData',item) commit('mutations_CartData', item);
}, },
removecartData( {commit}, item ) { removecartData({ commit }, item) {
commit( 'mutations_removeCartData',item ) commit('mutations_removeCartData', item);
} }
} };
// mutations // mutations
const mutations = { const mutations = {
mutations_setAll( state,num ) { mutations_setAll(state, num) {
state.all = num state.all = num;
}, },
mutations_CartData(state, item ) { mutations_CartData(state, item) {
state.cartData.push( item ) state.cartData.push(item);
}, },
mutations_removeCartData( state,item ) { mutations_removeCartData(state, item) {
for( let i in state.cartData ) { for (let i in state.cartData) {
if( state.cartData[i].id === item.id ) { if (state.cartData[i].id === item.id) {
state.cartData.splice(i,1) state.cartData.splice(i, 1);
} }
} }
}, },
mutations_setStoreObj(state,val) { mutations_setStoreObj(state, val) {
state.storeObj = val state.storeObj = val;
}, },
aside_handler(state,val) { aside_handler(state, val) {
state.asideShow = val state.asideShow = val;
}, },
mutations_breadcrumb(state,val) { mutations_breadcrumb(state, val) {
state.breadcrumb = val state.breadcrumb = val;
} }
} };
export default { export default {
state, state,
getters, getters,
actions, actions,
mutations mutations
} };
/*eslint-disable*/
// 环境value // 环境value
let _isDev = process.env.NODE_ENV === 'development' let _isDev = process.env.NODE_ENV === 'development';
import Vue from 'vue'; import Vue from 'vue';
...@@ -8,25 +8,24 @@ import Vue from 'vue'; ...@@ -8,25 +8,24 @@ import Vue from 'vue';
* 开发输出log * 开发输出log
* @param {消息} msg * @param {消息} msg
*/ */
export const log = (msg) => { export const log = msg => {
if (_isDev && console && console.log) { if (_isDev && console && console.log) {
console.log(msg) console.log(msg);
} }
} };
/** /**
* 补零 * 补零
* @param {String/Number} num * @param {String/Number} num
*/ */
export const fillZero = (num) => { export const fillZero = num => {
num = num * 1; num = num * 1;
if (num < 10) { if (num < 10) {
return '0' + num; return '0' + num;
} else { } else {
return num; return num;
} }
} };
/** /**
* *
...@@ -34,26 +33,29 @@ export const fillZero = (num) => { ...@@ -34,26 +33,29 @@ export const fillZero = (num) => {
* @param {*转换的格式} type * @param {*转换的格式} type
*/ */
export const formateDateTimeByType = (date, type = 'yyyy-MM-dd-HH-mm-ss') => { export const formateDateTimeByType = (date, type = 'yyyy-MM-dd-HH-mm-ss') => {
if (!date) { return '' } // var year, month, day, hours, min, sec
if (!date) {
return '';
}
if (typeof date === 'number') { if (typeof date === 'number') {
date = new Date(date); date = new Date(date);
} }
if (typeof date === 'string') { if (typeof date === 'string') {
return date return date;
} else { } else {
var year = type.indexOf('yyyy') >= 0 ? (fillZero(date.getFullYear())) : ''; let year = type.indexOf('yyyy') >= 0 ? fillZero(date.getFullYear()) : '';
var month = type.indexOf('MM') >= 0 ? ('-' + fillZero(date.getMonth() + 1)) : ''; let month = type.indexOf('MM') >= 0 ? '-' + fillZero(date.getMonth() + 1) : '';
var day = type.indexOf('dd') >= 0 ? ('-' + fillZero(date.getDate()) + '') : ''; let day = type.indexOf('dd') >= 0 ? '-' + fillZero(date.getDate()) + '' : '';
var hours = type.indexOf('HH') >= 0 ? (' ' + fillZero(date.getHours())) : ''; let hours = type.indexOf('HH') >= 0 ? ' ' + fillZero(date.getHours()) : '';
var min = type.indexOf('mm') >= 0 ? (':' + fillZero(date.getMinutes())) : ''; let min = type.indexOf('mm') >= 0 ? ':' + fillZero(date.getMinutes()) : '';
var sec = type.indexOf('ss') >= 0 ? (':' + fillZero(date.getSeconds())) : ''; let sec = type.indexOf('ss') >= 0 ? ':' + fillZero(date.getSeconds()) : '';
// console.log(year+month+day+hours+min+sec); // console.log(year+month+day+hours+min+sec);
return year + month + day + hours + min + sec; return year + month + day + hours + min + sec;
} }
} };
export const numberToChinese = (num) => { export const numberToChinese = num => {
var chnNumChar = { var chnNumChar = {
: 0, : 0,
: 1, : 1,
...@@ -70,13 +72,13 @@ export const numberToChinese = (num) => { ...@@ -70,13 +72,13 @@ export const numberToChinese = (num) => {
let result = ''; let result = '';
for (let i in chnNumChar) { for (let i in chnNumChar) {
if (num === chnNumChar[i]) { if (num === chnNumChar[i]) {
result = i result = i;
} }
} }
return result; return result;
} };
export const numberToWeekChinese = (num) => { export const numberToWeekChinese = num => {
var chnNumChar = { var chnNumChar = {
: 0, : 0,
: 1, : 1,
...@@ -89,19 +91,18 @@ export const numberToWeekChinese = (num) => { ...@@ -89,19 +91,18 @@ export const numberToWeekChinese = (num) => {
let result = '--'; let result = '--';
for (let i in chnNumChar) { for (let i in chnNumChar) {
if (num === chnNumChar[i]) { if (num === chnNumChar[i]) {
result = i result = i;
} }
} }
return result; return result;
} };
/** /**
* *
* @param 清空数据 * @param 清空数据
*/ */
export const resetParams = (obj) => { export const resetParams = obj => {
for (let item in obj) { for (let item in obj) {
if (item && obj[item]) { if (item && obj[item]) {
switch (obj[item].constructor) { switch (obj[item].constructor) {
...@@ -123,14 +124,13 @@ export const resetParams = (obj) => { ...@@ -123,14 +124,13 @@ export const resetParams = (obj) => {
} }
} }
} }
} };
// 交换数组元素 // 交换数组元素
function swapItems(arr, index1, index2) { function swapItems(arr, index1, index2) {
arr[index1] = arr.splice(index2, 1, arr[index1])[0]; arr[index1] = arr.splice(index2, 1, arr[index1])[0];
return arr; return arr;
}; }
// 上移 // 上移
export const upRecord = function(arr, $index) { export const upRecord = function(arr, $index) {
if ($index == 0) { if ($index == 0) {
...@@ -146,17 +146,15 @@ export const downRecord = function(arr, $index) { ...@@ -146,17 +146,15 @@ export const downRecord = function(arr, $index) {
swapItems(arr, $index, $index + 1); swapItems(arr, $index, $index + 1);
}; };
//字符串判断是否为空 //字符串判断是否为空
export const voidStr = function(str, msg) { export const voidStr = function(str, msg) {
if (!str) { if (!str) {
Vue.prototype.$tips({ type: 'warning', message: msg || '内容填写不全' }) Vue.prototype.$tips({ type: 'warning', message: msg || '内容填写不全' });
return true; return true;
} else { } else {
return false; return false;
} }
} };
/** /**
* 频率控制 返回函数连续调用时,action 执行频率限定为 次 / delay * 频率控制 返回函数连续调用时,action 执行频率限定为 次 / delay
...@@ -168,52 +166,52 @@ export const voidStr = function(str, msg) { ...@@ -168,52 +166,52 @@ export const voidStr = function(str, msg) {
export const throttle = function(delay, action) { export const throttle = function(delay, action) {
var last = 0; var last = 0;
return function() { return function() {
var curr = +new Date() var curr = +new Date();
if (curr - last > delay) { if (curr - last > delay) {
action.apply(this, arguments) action.apply(this, arguments);
last = curr last = curr;
}
} }
} };
};
/** /**
* 验证是否为网址 * 验证是否为网址
*/ */
export const checkUrl = function(urlString) { export const checkUrl = function(urlString) {
if (urlString != "") { var reg;
var reg = /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/; if (urlString != '') {
reg = /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/;
if (!reg.test(urlString)) { if (!reg.test(urlString)) {
Vue.prototype.$tips({ type: "warning", message: "网址不规范,示例:http://www.domain.com" }); Vue.prototype.$tips({ type: 'warning', message: '网址不规范,示例:http://www.domain.com' });
return true; return true;
} }
} else { } else {
Vue.prototype.$tips({ type: "warning", message: "网址不规范,示例:http://www.domain.com" }); Vue.prototype.$tips({ type: 'warning', message: '网址不规范,示例:http://www.domain.com' });
return true; return true;
} }
return false; return false;
} };
// 对Date的扩展,将 Date 转化为指定格式的String // 对Date的扩展,将 Date 转化为指定格式的String
// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符, // 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) // 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
// 例子: // 例子:
// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 // (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
// (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 // (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
export const format = function(date, fmt) { //author: meizz export const format = function(date, fmt) {
//author: meizz
var o = { var o = {
"M+": date.getMonth() + 1, //月份 'M+': date.getMonth() + 1, //月份
"d+": date.getDate(), //日 'd+': date.getDate(), //日
"h+": date.getHours(), //小时 'h+': date.getHours(), //小时
"m+": date.getMinutes(), //分 'm+': date.getMinutes(), //分
"s+": date.getSeconds(), //秒 's+': date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度 'q+': Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒 S: date.getMilliseconds() //毫秒
}; };
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length)); if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
for (var k in o) for (let k in o) {
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length));
return fmt; return fmt;
} }
\ No newline at end of file };
...@@ -11,10 +11,9 @@ export default { ...@@ -11,10 +11,9 @@ export default {
var len = 0; var len = 0;
for (var i = 0; i < val.length; i++) { for (var i = 0; i < val.length; i++) {
var a = val.charAt(i); var a = val.charAt(i);
if (a.match(/[^\x00-\xff]/ig) != null) { if (a.match(/[^\x00-\xff]/gi) != null) {
len += 2; len += 2;
} } else {
else {
len += 1; len += 1;
} }
} }
...@@ -23,14 +22,13 @@ export default { ...@@ -23,14 +22,13 @@ export default {
/* /*
* 一个汉字算一个字,一个英文字母或数字算半个字 * 一个汉字算一个字,一个英文字母或数字算半个字
*/ */
getZhLen: function (val) { getZhLen: function(val) {
var len = 0; var len = 0;
for (var i = 0; i < val.length; i++) { for (var i = 0; i < val.length; i++) {
var a = val.charAt(i); var a = val.charAt(i);
if (a.match(/[^\x00-\xff]/ig) != null) { if (a.match(/[^\x00-\xff]/gi) != null) {
len += 1; len += 1;
} } else {
else {
len += 0.5; len += 0.5;
} }
} }
...@@ -38,20 +36,19 @@ export default { ...@@ -38,20 +36,19 @@ export default {
}, },
/*暂无用*/ /*暂无用*/
cutStr: function(str, len,type){ cutStr: function(str, len, type) {
var char_length = 0; var char_length = 0;
for (var i = 0; i < str.length; i++){ for (var i = 0; i < str.length; i++) {
var son_str = str.charAt(i); var son_str = str.charAt(i);
if(type==1) { if (type == 1) {
encodeURI(son_str).length > 2 ? char_length += 1 : char_length += 0.5; encodeURI(son_str).length > 2 ? (char_length += 1) : (char_length += 0.5);
} }
if(type==2) { if (type == 2) {
char_length += 1 ; char_length += 1;
} }
if (char_length >= len){ if (char_length >= len) {
var sub_len = char_length == len ? i+1 : i; var sub_len = char_length == len ? i + 1 : i;
return str.substr(0, sub_len); return str.substr(0, sub_len);
} }
} }
}, },
...@@ -63,12 +60,9 @@ export default { ...@@ -63,12 +60,9 @@ export default {
var returnValue = ''; var returnValue = '';
var byteValLen = 0; var byteValLen = 0;
for (var i = 0; i < val.length; i++) { for (var i = 0; i < val.length; i++) {
if (val[i].match(/[^\x00-\xff]/ig) != null) if (val[i].match(/[^\x00-\xff]/gi) != null) byteValLen += 1;
byteValLen += 1; else byteValLen += 0.5;
else if (byteValLen > max) break;
byteValLen += 0.5;
if (byteValLen > max)
break;
returnValue += val[i]; returnValue += val[i];
} }
return returnValue; return returnValue;
...@@ -77,16 +71,13 @@ export default { ...@@ -77,16 +71,13 @@ export default {
/* /*
* 限制字符数用, 一个汉字算两个字符,一个英文/字母算一个字符 * 限制字符数用, 一个汉字算两个字符,一个英文/字母算一个字符
*/ */
getCharVal: function (val, max) { getCharVal: function(val, max) {
var returnValue = ''; var returnValue = '';
var byteValLen = 0; var byteValLen = 0;
for (var i = 0; i < val.length; i++) { for (var i = 0; i < val.length; i++) {
if (val[i].match(/[^\x00-\xff]/ig) != null) if (val[i].match(/[^\x00-\xff]/gi) != null) byteValLen += 2;
byteValLen += 2; else byteValLen += 1;
else if (byteValLen > max) break;
byteValLen += 1;
if (byteValLen > max)
break;
returnValue += val[i]; returnValue += val[i];
} }
return returnValue; return returnValue;
...@@ -99,4 +90,4 @@ export default { ...@@ -99,4 +90,4 @@ export default {
var regTest = /^\d+(\.\d+)?$/; var regTest = /^\d+(\.\d+)?$/;
return regTest.test(v); return regTest.test(v);
} }
} };
/*策略规则*/ /*策略规则*/
const strategies = { const strategies = {
isNonEmpty(value, errorMsg) { isNonEmpty(value, errorMsg) {
return value === '' ? return value === '' ? errorMsg : void 0;
errorMsg : void 0
}, },
minLength(value, length, errorMsg) { minLength(value, length, errorMsg) {
return value.length < length ? return value.length < length ? errorMsg : void 0;
errorMsg : void 0
}, },
isMoblie(value, errorMsg) { isMoblie(value, errorMsg) {
return !/^1(3|5|7|8|9)[0-9]{9}$/.test(value) ? return !/^1(3|5|7|8|9)[0-9]{9}$/.test(value) ? errorMsg : void 0;
errorMsg : void 0
}, },
isEmail(value, errorMsg) { isEmail(value, errorMsg) {
return !/^\w+([+-.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(value) ? return !/^\w+([+-.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(value) ? errorMsg : void 0;
errorMsg : void 0
} }
} };
/*Validator类*/ /*Validator类*/
export default class Validator { export default class Validator {
constructor() { constructor() {
this.cache = [] //保存校验规则 this.cache = []; //保存校验规则
} }
add(dom, rules) { add(dom, rules) {
for (let rule of rules) { for (let rule of rules) {
let strategyAry = rule.strategy.split(':') //例如['minLength',6] let strategyAry = rule.strategy.split(':'); //例如['minLength',6]
let errorMsg = rule.errorMsg //'用户名不能为空' let errorMsg = rule.errorMsg; //'用户名不能为空'
this.cache.push(() => { this.cache.push(() => {
let strategy = strategyAry.shift() //用户挑选的strategy let strategy = strategyAry.shift(); //用户挑选的strategy
strategyAry.unshift(dom.value) //把input的value添加进参数列表 strategyAry.unshift(dom.value); //把input的value添加进参数列表
strategyAry.push(errorMsg) //把errorMsg添加进参数列表,[dom.value,6,errorMsg] strategyAry.push(errorMsg); //把errorMsg添加进参数列表,[dom.value,6,errorMsg]
return strategies[strategy].apply(dom, strategyAry) return strategies[strategy].apply(dom, strategyAry);
}) });
} }
} }
start() { start() {
for (let validatorFunc of this.cache) { for (let validatorFunc of this.cache) {
let errorMsg = validatorFunc()//开始校验,并取得校验后的返回信息 let errorMsg = validatorFunc(); //开始校验,并取得校验后的返回信息
if (errorMsg) {//r如果有确切返回值,说明校验没有通过 if (errorMsg) {
return errorMsg //r如果有确切返回值,说明校验没有通过
return errorMsg;
} }
} }
} }
......
<template> <template>
<div class="errPage-container"> <div class="errPage-container">
<el-button @click="back" icon='arrow-left' class="pan-back-btn">返回</el-button> <el-button @click="back" icon="arrow-left" class="pan-back-btn">返回</el-button>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<h1 class="text-jumbo text-ginormous">Oops!</h1> <h1 class="text-jumbo text-ginormous">Oops!</h1>
...@@ -13,21 +13,21 @@ ...@@ -13,21 +13,21 @@
<router-link to="/report/#/memberSummary">回首页</router-link> <router-link to="/report/#/memberSummary">回首页</router-link>
</li> </li>
<li class="link-type"><router-link to="/report/#/memberSummary">回首页</router-link></li> <li class="link-type"><router-link to="/report/#/memberSummary">回首页</router-link></li>
<li><a @click.prevent="dialogVisible=true" href="#">点我看图</a></li> <li><a @click.prevent="dialogVisible = true" href="#">点我看图</a></li>
</ul> </ul>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<img :src="errGif" width="313" height="428" alt="Girl has dropped her ice cream."> <img :src="errGif" width="313" height="428" alt="Girl has dropped her ice cream." />
</el-col> </el-col>
</el-row> </el-row>
<el-dialog title="随便看" :visible.sync="dialogVisible"> <el-dialog title="随便看" :visible.sync="dialogVisible">
<img class="pan-img" :src="ewizardClap"> <img class="pan-img" :src="ewizardClap" />
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import errGif from '@/assets/img/401.gif' import errGif from '@/assets/img/401.gif';
export default { export default {
name: 'page401', name: 'page401',
...@@ -36,22 +36,22 @@ export default { ...@@ -36,22 +36,22 @@ export default {
errGif: errGif + '?' + +new Date(), errGif: errGif + '?' + +new Date(),
ewizardClap: 'https://wpimg.wallstcn.com/007ef517-bafd-4066-aae4-6883632d9646', ewizardClap: 'https://wpimg.wallstcn.com/007ef517-bafd-4066-aae4-6883632d9646',
dialogVisible: false dialogVisible: false
} };
}, },
methods: { methods: {
back() { back() {
if (this.$route.query.noGoBack) { if (this.$route.query.noGoBack) {
this.$router.push({ path: '/' }) this.$router.push({ path: '/' });
} else { } else {
this.$router.go(-1) this.$router.go(-1);
} }
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.errPage-container { .errPage-container {
width: 800px; width: 800px;
margin: 100px auto; margin: 100px auto;
.pan-back-btn { .pan-back-btn {
...@@ -85,5 +85,5 @@ export default { ...@@ -85,5 +85,5 @@ export default {
} }
} }
} }
} }
</style> </style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div style="background:#f0f2f5;margin-top: -20px;height:100%;"> <div style="background:#f0f2f5;margin-top: -20px;height:100%;">
<div class="wscn-http404"> <div class="wscn-http404">
<div class="pic-404"> <div class="pic-404">
<img class="pic-404__parent" :src="img_403" alt="403"> <img class="pic-404__parent" :src="img_403" alt="403" />
</div> </div>
<div class="bullshit"> <div class="bullshit">
<!-- <div class="bullshit__oops">403</div> --> <!-- <div class="bullshit__oops">403</div> -->
...@@ -14,21 +14,21 @@ ...@@ -14,21 +14,21 @@
</template> </template>
<script> <script>
import img_403 from '@/assets/img/error_403.svg' import img_403 from '@/assets/img/error_403.svg';
export default { export default {
name: 'page403', name: 'page403',
data() { data() {
return { return {
img_403 img_403
} };
}, },
computed: { computed: {
message() { message() {
return '抱歉,你无权访问该页面' return '抱歉,你无权访问该页面';
} }
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -174,7 +174,7 @@ export default { ...@@ -174,7 +174,7 @@ export default {
animation-fill-mode: forwards;*/ animation-fill-mode: forwards;*/
} }
&__headline { &__headline {
color: rgba(0,0,0,.45); color: rgba(0, 0, 0, 0.45);
font-size: 20px; font-size: 20px;
line-height: 28px; line-height: 28px;
margin-bottom: 16px; margin-bottom: 16px;
...@@ -200,9 +200,9 @@ export default { ...@@ -200,9 +200,9 @@ export default {
border: 1px solid #1890ff; border: 1px solid #1890ff;
color: #fff; color: #fff;
background-color: #1890ff; background-color: #1890ff;
text-shadow: 0 -1px 0 rgba(0,0,0,.12); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
-webkit-box-shadow: 0 2px 0 rgba(0,0,0,.035); -webkit-box-shadow: 0 2px 0 rgba(0, 0, 0, 0.035);
box-shadow: 0 2px 0 rgba(0,0,0,.035); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.035);
cursor: pointer; cursor: pointer;
/*animation-name: slideUp; /*animation-name: slideUp;
animation-duration: 0.5s; animation-duration: 0.5s;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div style="background:#f0f2f5;margin-top: -20px;height:100%;"> <div style="background:#f0f2f5;margin-top: -20px;height:100%;">
<div class="wscn-http404"> <div class="wscn-http404">
<div class="pic-404"> <div class="pic-404">
<img class="pic-404__parent" :src="img_404" alt="404"> <img class="pic-404__parent" :src="img_404" alt="404" />
</div> </div>
<div class="bullshit"> <div class="bullshit">
<!-- <div class="bullshit__oops">404</div> --> <!-- <div class="bullshit__oops">404</div> -->
...@@ -14,24 +14,21 @@ ...@@ -14,24 +14,21 @@
</template> </template>
<script> <script>
import img_404 from '@/assets/img/error_404.svg' import img_404 from '@/assets/img/error_404.svg';
export default { export default {
name: 'page404', name: 'page404',
data() { data() {
return { return {
img_404 img_404
} };
}, },
computed: { computed: {
message() { message() {
return '抱歉,你访问的页面不存在' return '抱歉,你访问的页面不存在';
} }
},
mounted(){
console.log(this.$route.path)
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -177,7 +174,7 @@ export default { ...@@ -177,7 +174,7 @@ export default {
animation-fill-mode: forwards;*/ animation-fill-mode: forwards;*/
} }
&__headline { &__headline {
color: rgba(0,0,0,.45); color: rgba(0, 0, 0, 0.45);
font-size: 20px; font-size: 20px;
line-height: 28px; line-height: 28px;
margin-bottom: 16px; margin-bottom: 16px;
...@@ -203,9 +200,9 @@ export default { ...@@ -203,9 +200,9 @@ export default {
border: 1px solid #1890ff; border: 1px solid #1890ff;
color: #fff; color: #fff;
background-color: #1890ff; background-color: #1890ff;
text-shadow: 0 -1px 0 rgba(0,0,0,.12); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
-webkit-box-shadow: 0 2px 0 rgba(0,0,0,.035); -webkit-box-shadow: 0 2px 0 rgba(0, 0, 0, 0.035);
box-shadow: 0 2px 0 rgba(0,0,0,.035); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.035);
cursor: pointer; cursor: pointer;
/*animation-name: slideUp; /*animation-name: slideUp;
animation-duration: 0.5s; animation-duration: 0.5s;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div style="background:#f0f2f5;margin-top: -20px;height:100%;"> <div style="background:#f0f2f5;margin-top: -20px;height:100%;">
<div class="wscn-http404"> <div class="wscn-http404">
<div class="pic-404"> <div class="pic-404">
<img class="pic-404__parent" :src="img_500" alt="500"> <img class="pic-404__parent" :src="img_500" alt="500" />
</div> </div>
<div class="bullshit"> <div class="bullshit">
<!-- <div class="bullshit__oops">500</div> --> <!-- <div class="bullshit__oops">500</div> -->
...@@ -14,21 +14,21 @@ ...@@ -14,21 +14,21 @@
</template> </template>
<script> <script>
import img_500 from '@/assets/img/error_500.svg' import img_500 from '@/assets/img/error_500.svg';
export default { export default {
name: 'page500', name: 'page500',
data() { data() {
return { return {
img_500 img_500
} };
}, },
computed: { computed: {
message() { message() {
return '抱歉,服务器出错了' return '抱歉,服务器出错了';
} }
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -174,7 +174,7 @@ export default { ...@@ -174,7 +174,7 @@ export default {
animation-fill-mode: forwards;*/ animation-fill-mode: forwards;*/
} }
&__headline { &__headline {
color: rgba(0,0,0,.45); color: rgba(0, 0, 0, 0.45);
font-size: 20px; font-size: 20px;
line-height: 28px; line-height: 28px;
margin-bottom: 16px; margin-bottom: 16px;
...@@ -200,9 +200,9 @@ export default { ...@@ -200,9 +200,9 @@ export default {
border: 1px solid #1890ff; border: 1px solid #1890ff;
color: #fff; color: #fff;
background-color: #1890ff; background-color: #1890ff;
text-shadow: 0 -1px 0 rgba(0,0,0,.12); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
-webkit-box-shadow: 0 2px 0 rgba(0,0,0,.035); -webkit-box-shadow: 0 2px 0 rgba(0, 0, 0, 0.035);
box-shadow: 0 2px 0 rgba(0,0,0,.035); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.035);
cursor: pointer; cursor: pointer;
/*animation-name: slideUp; /*animation-name: slideUp;
animation-duration: 0.5s; animation-duration: 0.5s;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div style="background:#f0f2f5;margin-top: -20px;height:100%;"> <div style="background:#f0f2f5;margin-top: -20px;height:100%;">
<div class="wscn-http404"> <div class="wscn-http404">
<div class="pic-404"> <div class="pic-404">
<img class="pic-404__parent" :src="imgSrc" alt="404"> <img class="pic-404__parent" :src="imgSrc" alt="404" />
</div> </div>
<div class="bullshit"> <div class="bullshit">
<!-- <div class="bullshit__oops">404</div> --> <!-- <div class="bullshit__oops">404</div> -->
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<script> <script>
import img_403 from '@/assets/403_images/error_403.svg'; import img_403 from '@/assets/403_images/error_403.svg';
import img_404 from '@/assets/404_images/error_404.svg'; import img_404 from '@/assets/404_images/error_404.svg';
import img_500 from '@/assets/500_images/error_500.svg' import img_500 from '@/assets/500_images/error_500.svg';
export default { export default {
name: 'errpage', name: 'errpage',
...@@ -34,15 +34,15 @@ export default { ...@@ -34,15 +34,15 @@ export default {
404: '抱歉,你访问的页面不存在', 404: '抱歉,你访问的页面不存在',
500: '抱歉,服务器出错了' 500: '抱歉,服务器出错了'
} }
} };
}, },
mounted(){ mounted() {
var that = this; var that = this;
var path = that.$route.path.split('/')[1]; var path = that.$route.path.split('/')[1];
that.imgSrc = that.srcList[path]; that.imgSrc = that.srcList[path];
that.message = that.msgList[path]; that.message = that.msgList[path];
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -188,7 +188,7 @@ export default { ...@@ -188,7 +188,7 @@ export default {
animation-fill-mode: forwards;*/ animation-fill-mode: forwards;*/
} }
&__headline { &__headline {
color: rgba(0,0,0,.45); color: rgba(0, 0, 0, 0.45);
font-size: 20px; font-size: 20px;
line-height: 28px; line-height: 28px;
margin-bottom: 16px; margin-bottom: 16px;
...@@ -214,9 +214,9 @@ export default { ...@@ -214,9 +214,9 @@ export default {
border: 1px solid #1890ff; border: 1px solid #1890ff;
color: #fff; color: #fff;
background-color: #1890ff; background-color: #1890ff;
text-shadow: 0 -1px 0 rgba(0,0,0,.12); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
-webkit-box-shadow: 0 2px 0 rgba(0,0,0,.035); -webkit-box-shadow: 0 2px 0 rgba(0, 0, 0, 0.035);
box-shadow: 0 2px 0 rgba(0,0,0,.035); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.035);
cursor: pointer; cursor: pointer;
/*animation-name: slideUp; /*animation-name: slideUp;
animation-duration: 0.5s; animation-duration: 0.5s;
......
<template> <template>
<section class="sms-lib curson-pointer"> <section class="sms-lib curson-pointer">
<div class="pb22"> <div class="pb22">
<span class="pr10">{{total}}</span> <span class="pr10">{{ total }}</span>
<el-input :disabled="disabled" v-model="listParams.searchParam" class="w200" clearable placeholder="请输入卡券名称" @change="getCardList"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input> <el-input :disabled="disabled" v-model="listParams.searchParam" class="w200" clearable placeholder="请输入卡券名称" @change="getCardList"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<span class="fz12 gray pl20">领取限制 < 100的卡券不支持选择,系统已自动过滤</span> <span class="fz12 gray pl20">领取限制 &lt;100的卡券不支持选择,系统已自动过滤</span>
</div> </div>
<el-table tooltipEffect="light" :data="tableList" style="width: 100%" v-loading="loading" @row-click="chooseCard"> <el-table tooltipEffect="light" :data="tableList" style="width: 100%" v-loading="loading" @row-click="chooseCard">
<el-table-column :show-overflow-tooltip="false" width="60" align="center" prop="coupCardId"> <el-table-column :show-overflow-tooltip="false" width="60" align="center" prop="coupCardId">
...@@ -19,53 +19,53 @@ ...@@ -19,53 +19,53 @@
<el-table-column :show-overflow-tooltip="false" align="left" prop="cardLimit" label="兑换限制"></el-table-column> <el-table-column :show-overflow-tooltip="false" align="left" prop="cardLimit" label="兑换限制"></el-table-column>
<el-table-column :show-overflow-tooltip="false" align="left" prop="couponStock" label="库存"></el-table-column> <el-table-column :show-overflow-tooltip="false" align="left" prop="couponStock" label="库存"></el-table-column>
</el-table> </el-table>
<el-pagination v-show='tableList.length>0' background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="listParams.pageSize" layout="total, prev, pager, next" :total="total"></el-pagination> <el-pagination v-show="tableList.length > 0" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="listParams.pageSize" layout="total, prev, pager, next" :total="total"></el-pagination>
</section> </section>
</template> </template>
<script> <script>
import {getCardList} from '@/service/api/mallApi.js'; import { getCardList } from '@/service/api/mallApi.js';
export default { export default {
props:{ props: {
activeId:{ activeId: {
type:String, type: String,
default:'' default: ''
}, },
cardIdName:{ cardIdName: {
type:String, type: String,
default:'coupCardId' default: 'coupCardId'
}, },
tableHeight:{ tableHeight: {
type:String, type: String,
default:'auto' default: 'auto'
}, },
showPagination:{ showPagination: {
type:Boolean, type: Boolean,
default:true default: true
}, },
disabled:{ disabled: {
type:Boolean, type: Boolean,
default:false default: false
}, },
cardType:{ cardType: {
type:String, type: String,
default:'2' default: '2'
} }
}, },
data(){ data() {
return{ return {
listParams:{ listParams: {
searchParam:'', searchParam: '',
currentPage:1, currentPage: 1,
pageSize:10, pageSize: 10,
requestProject:'gic-web', requestProject: 'gic-web',
coupCardId:'', coupCardId: '',
cardType:this.cardType cardType: this.cardType
}, },
total:0, total: 0,
tableList:[], tableList: [],
selectedId:this.activeId selectedId: this.activeId
} };
}, },
watch: { watch: {
selectedId(val) { selectedId(val) {
...@@ -73,31 +73,30 @@ export default { ...@@ -73,31 +73,30 @@ export default {
if (this.cardIdName === 'wechatCardId') { if (this.cardIdName === 'wechatCardId') {
this.tableList.map(v => { this.tableList.map(v => {
if (v.coupCardId === val) { if (v.coupCardId === val) {
val = v.wechatCardId val = v.wechatCardId;
obj = v; obj = v;
} }
}) });
} else { } else {
this.tableList.map(v => { this.tableList.map(v => {
if (v.coupCardId === val) { if (v.coupCardId === val) {
obj = v; obj = v;
} }
}) });
} }
this.$emit('update:activeId',val); this.$emit('update:activeId', val);
this.$emit('emitActiveObj',obj); this.$emit('emitActiveObj', obj);
}, },
activeId(val) { activeId(val) {
this.selectedId = val; this.selectedId = val;
} }
}, },
created(){ created() {
this.selectedId = this.activeId; this.selectedId = this.activeId;
this.getCardList(); this.getCardList();
}, },
methods:{ methods: {
handleSizeChange(val) { handleSizeChange(val) {
this.listParams.pageSize = val; this.listParams.pageSize = val;
this.getCardList(); this.getCardList();
...@@ -120,10 +119,11 @@ export default { ...@@ -120,10 +119,11 @@ export default {
this.listParams.searchParams = ''; this.listParams.searchParams = '';
this.getCardList(); this.getCardList();
}, },
/* eslint-disable */
chooseCard(row) { chooseCard(row) {
this.selectedId = row.coupCardId; this.selectedId = row.coupCardId;
$bus.$emit('card-temp-choose',row); $bus.$emit('card-temp-choose', row);
} }
} }
} };
</script> </script>
...@@ -4,73 +4,49 @@ ...@@ -4,73 +4,49 @@
<div class="wechat-url" style="margin-bottom:30px;"> <div class="wechat-url" style="margin-bottom:30px;">
<p style="font-weight: 600;margin-bottom:15px">页面链接</p> <p style="font-weight: 600;margin-bottom:15px">页面链接</p>
<div style="display:flex;align-items: center"> <div style="display:flex;align-items: center">
<el-input <el-input type="textarea" :rows="2" v-model="modalData.pageUrl" disabled> </el-input>
type="textarea" <a href="javaScript:void(0)" style="width:40px;margin-left:20px" v-clipboard:copy="modalData.pageUrl" v-clipboard:success="onCopy" v-clipboard:error="onError">
:rows="2"
v-model="modalData.pageUrl"
disabled>
</el-input>
<a
href="javaScript:void(0)"
style="width:40px;margin-left:20px"
v-clipboard:copy="modalData.pageUrl"
v-clipboard:success="onCopy"
v-clipboard:error="onError"
>
复制 复制
</a> </a>
</div> </div>
</div> </div>
<div class="wechat-img-box" v-loading="modalData.loading"> <div class="wechat-img-box" v-loading="modalData.loading">
<p style="font-weight: 600;margin-bottom:15px">小程序二维码</p> <p style="font-weight: 600;margin-bottom:15px">小程序二维码</p>
<img <img :src="modalData.imgUrl" class="wechat-img" style="width:140px;height:140px;margin-left:130px" />
:src="modalData.imgUrl"
class="wechat-img"
style="width:140px;height:140px;margin-left:130px">
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import request from '../../../api/request.js' export default {
import common from '../../../../static/js/common.js'; props: {
export default { modalData: {
props:{ type: Object
modalData:{
type:Object,
} }
}, },
data() { data() {
return { return {
// loading:true, // loading:true,
} };
},
mounted(){
}, },
methods: { methods: {
onCopy(e){ onCopy(e) {
this.$message.success("复制成功") this.$message.success('复制成功');
}, },
onError(e){ onError(e) {
this.$message.error("复制失败") this.$message.error('复制失败');
}
} }
} }
};
</script> </script>
<style scoped> <style scoped>
.wechat-img-box{ .wechat-img-box {
margin:0 auto; margin: 0 auto;
text-align: center; text-align: center;
} }
.wechat-img{ .wechat-img {
width:200px; width: 200px;
height:200px; height: 200px;
} }
</style>
<style>
\ No newline at end of file
...@@ -47,31 +47,30 @@ export const postForm = (url, params) => { ...@@ -47,31 +47,30 @@ export const postForm = (url, params) => {
--> -->
<template> <template>
<div class="tinymce-contain"> <div class="tinymce-contain">
<editor id='tinymce' v-model='tinymceHtml' :init='init'></editor> <editor id="tinymce" v-model="tinymceHtml" :init="init"></editor>
</div> </div>
</template> </template>
<script> <script>
// import request from '../../api/request.js' // import request from '../../api/request.js'
import request from '../../../api/request.js' import request from '../../../api/request.js';
import tinymce from 'tinymce/tinymce' import tinymce from 'tinymce/tinymce';
import 'tinymce/themes/modern/theme' import 'tinymce/themes/modern/theme';
import Editor from '@tinymce/tinymce-vue' import Editor from '@tinymce/tinymce-vue';
import 'tinymce/plugins/image' import 'tinymce/plugins/image';
import 'tinymce/plugins/link' import 'tinymce/plugins/link';
import 'tinymce/plugins/code' import 'tinymce/plugins/code';
import 'tinymce/plugins/table' import 'tinymce/plugins/table';
import 'tinymce/plugins/lists' import 'tinymce/plugins/lists';
import 'tinymce/plugins/contextmenu' import 'tinymce/plugins/contextmenu';
import 'tinymce/plugins/wordcount' import 'tinymce/plugins/wordcount';
import 'tinymce/plugins/colorpicker' import 'tinymce/plugins/colorpicker';
import 'tinymce/plugins/textcolor' import 'tinymce/plugins/textcolor';
export default { export default {
name: "tinymce-edit", name: 'tinymce-edit',
props: ["bodyHtml",'projectName'], props: ['bodyHtml', 'projectName'],
data() { data() {
return { return {
tinymceHtml: '请输入内容', tinymceHtml: '请输入内容',
init: { init: {
language_url: 'static/tinymce/zh_CN.js', language_url: 'static/tinymce/zh_CN.js',
...@@ -84,74 +83,67 @@ export default { ...@@ -84,74 +83,67 @@ export default {
// images_upload_base_path: '/some/basepath', // images_upload_base_path: '/some/basepath',
images_upload_credentials: true, //是否应传递cookie等跨域的凭据 images_upload_credentials: true, //是否应传递cookie等跨域的凭据
// images_upload_handler提供三个参数:blobInfo, success, failure // images_upload_handler提供三个参数:blobInfo, success, failure
images_upload_handler: (blobInfo, success, failure)=>{ images_upload_handler: (blobInfo, success, failure) => {
console.log(blobInfo) this.handleImgUpload(blobInfo, success, failure);
this.handleImgUpload(blobInfo, success, failure)
}, },
// 添加插件 // 添加插件
// plugins: 'link lists image code table colorpicker textcolor wordcount contextmenu', // plugins: 'link lists image code table colorpicker textcolor wordcount contextmenu',
// toolbar: // toolbar:
// 'bold italic underline strikethrough | fontsizeselect | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent blockquote | undo redo | link unlink image code | removeformat', // 'bold italic underline strikethrough | fontsizeselect | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent blockquote | undo redo | link unlink image code | removeformat',
plugins: 'image textcolor', plugins: 'image textcolor',
toolbar: toolbar: 'fontsizeselect | forecolor backcolor | alignleft aligncenter alignright alignjustify | link unlink image code',
'fontsizeselect | forecolor backcolor | alignleft aligncenter alignright alignjustify | link unlink image code', fontsize_formats: '8px 10px 12px 14px 18px 24px 36px',
fontsize_formats: "8px 10px 12px 14px 18px 24px 36px",
branding: false, branding: false,
menubar: false, menubar: false,
setup: function(editor) { setup: function(editor) {
// 点击编辑框回调 // 点击编辑框回调
editor.on('click', function(e) { editor.on('click', function(e) {});
console.log('Editor was clicked');
});
}
} }
} }
};
}, },
methods: { methods: {
// 上传图片 // 上传图片
handleImgUpload (blobInfo, success, failure) { handleImgUpload(blobInfo, success, failure) {
var that = this var that = this;
let formdata = new FormData() let formdata = new FormData();
formdata.set('upload_file', blobInfo.blob()) formdata.set('upload_file', blobInfo.blob());
formdata.set("requestProject",that.repProjectName); formdata.set('requestProject', that.repProjectName);
console.log(formdata) request
request.post('/api-plug/upload-img', formdata).then(res => { .post('/api-plug/upload-img', formdata)
success(res.data.result[0].qcloudImageUrl) .then(res => {
}).catch(res => { success(res.data.result[0].qcloudImageUrl);
console.log(res)
failure('error')
}) })
}, .catch(res => {
failure('error');
});
}
}, },
watch: { watch: {
projectName: function(newData,oldData){ projectName: function(newData, oldData) {
var that = this; var that = this;
// console.log("新数据:",newData,oldData)
that.repProjectName = newData || 'gic-web'; that.repProjectName = newData || 'gic-web';
}, },
bodyHtml: function(newData,oldData){ bodyHtml: function(newData, oldData) {
var that = this; var that = this;
// console.log("新数据:",newData,oldData)
that.tinymceHtml = newData; that.tinymceHtml = newData;
}, }
}, },
components: { components: {
Editor Editor
}, },
mounted() { mounted() {
var that = this var that = this;
tinymce.init({ tinymce.init({
fontsize_formats: "8px 10px 12px 14px 18px 24px 36px", fontsize_formats: '8px 10px 12px 14px 18px 24px 36px'
}); });
that.tinymceHtml = that.bodyHtml; that.tinymceHtml = that.bodyHtml;
} }
};
}
</script> </script>
<style scoped> <style scoped>
.tinymce-contain { .tinymce-contain {
width: 900px width: 900px;
} }
</style> </style>
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover placement="top" width="160" v-model="model[theType+'Flag']"> <el-popover placement="top" width="160" v-model="model[theType + 'Flag']">
<el-input-number v-if="model[theType+'Flag']" class="w150" size="small" controls-position="right" :precision="precision" v-model="model.inputValue" :min="0" ></el-input-number> <el-input-number v-if="model[theType + 'Flag']" class="w150" size="small" controls-position="right" :precision="precision" v-model="model.inputValue" :min="0"></el-input-number>
<div style="text-align: right; margin:10px 0 0 0;"> <div style="text-align: right; margin:10px 0 0 0;">
<el-button size="mini" type="text" @click="model[theType+'Flag'] = false">取消</el-button> <el-button size="mini" type="text" @click="model[theType + 'Flag'] = false">取消</el-button>
<el-button type="primary" size="mini" @click="submit">确定</el-button> <el-button type="primary" size="mini" @click="submit">确定</el-button>
</div> </div>
<div slot="reference" @click="edit"> <div slot="reference" @click="edit">
<span>{{model[theType]}}{{typeName}}</span> <i class="el-icon-edit cursor-hover"></i> <span>{{ model[theType] }}{{ typeName }}</span> <i class="el-icon-edit cursor-hover"></i>
</div> </div>
</el-popover> </el-popover>
</template> </template>
...@@ -19,42 +19,44 @@ export default { ...@@ -19,42 +19,44 @@ export default {
model: { model: {
type: Object, type: Object,
default() { default() {
return {} return {};
} }
}, },
theType: String, theType: String,
typeName: String, typeName: String,
precision:{ precision: {
type:Number, type: Number,
default:0 default: 0
} }
}, },
methods:{ methods: {
// 提交更新并刷新列表 // 提交更新并刷新列表
async submit() { async submit() {
// try { // try {
console.log(this.value,this.theType,this.model.inputValue,this.precision)
if (this.theType === 'cashCost' && this.model.inputValue > this.model.costValue) { if (this.theType === 'cashCost' && this.model.inputValue > this.model.costValue) {
this.$tips({type:'warning',message:'现金费用不能大于礼品成本'}); this.$tips({ type: 'warning', message: '现金费用不能大于礼品成本' });
return; return;
} }
let res = null; let res = null;
if (this.theType === 'virtualStock') { // 库存 if (this.theType === 'virtualStock') {
res = await updateStockService({proId:this.model.integralMallProId,stock:this.model.inputValue}); // 库存
} else if (this.theType === 'cashCost') { // 现金费用 res = await updateStockService({ proId: this.model.integralMallProId, stock: this.model.inputValue });
res = await updateCashCostService({proId:this.model.integralMallProId,cost:this.model.inputValue}); } else if (this.theType === 'cashCost') {
} else if (this.theType === 'integralCost') { // 积分费用 // 现金费用
res = await updateIntegralCostService({proId:this.model.integralMallProId,cost:this.model.inputValue}); res = await updateCashCostService({ proId: this.model.integralMallProId, cost: this.model.inputValue });
} else if (this.theType === 'integralCost') {
// 积分费用
res = await updateIntegralCostService({ proId: this.model.integralMallProId, cost: this.model.inputValue });
} }
if (res.errorCode === 0) { if (res.errorCode === 0) {
if (this.theType === 'virtualStock') { if (this.theType === 'virtualStock') {
this.$tips({type:'success',message: '积分商城修改库存时,请同步修改对应卡券的库存'}); this.$tips({ type: 'success', message: '积分商城修改库存时,请同步修改对应卡券的库存' });
} else { } else {
this.$tips({type:'success',message: '更新成功'}); this.$tips({ type: 'success', message: '更新成功' });
} }
this.$emit('refresh'); this.$emit('refresh');
} else { } else {
this.$tips({type:'error',message: '更新失败'}); this.$tips({ type: 'error', message: '更新失败' });
} }
// } catch (err) { // } catch (err) {
// this.$tips({type:'error',message: '更新失败'}); // this.$tips({type:'error',message: '更新失败'});
...@@ -65,9 +67,9 @@ export default { ...@@ -65,9 +67,9 @@ export default {
// 这里precision不能更新 所以加上nextTick // 这里precision不能更新 所以加上nextTick
this.$nextTick(_ => { this.$nextTick(_ => {
this.model[this.theType + 'Flag'] = true; this.model[this.theType + 'Flag'] = true;
this.$set(this.model,'inputValue',this.model[this.theType]); this.$set(this.model, 'inputValue', this.model[this.theType]);
}) });
} }
} }
} };
</script> </script>
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
<el-button type="primary" class="fr" icon="iconfont icon-icon_yunxiazai fz14" @click="exportExcel"> 导出列表</el-button> <el-button type="primary" class="fr" icon="iconfont icon-icon_yunxiazai fz14" @click="exportExcel"> 导出列表</el-button>
</div> </div>
<el-table tooltipEffect="light" :data="tableList" style="width: 100%"> <el-table tooltipEffect="light" :data="tableList" style="width: 100%">
<el-table-column v-for="(v,i) in tableHeader" :align="v.align" :key="i" :prop="v.prop" :label="v.label"> <el-table-column v-for="(v, i) in tableHeader" :align="v.align" :key="i" :prop="v.prop" :label="v.label">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="v.formatter" v-html="v.formatter(scope.row)"></span> <span v-if="v.formatter" v-html="v.formatter(scope.row)"></span>
<component v-else-if="v.component" :is="v.component" :row="scope.row"></component> <component v-else-if="v.component" :is="v.component" :row="scope.row"></component>
<span v-else>{{scope.row[v.prop]}}</span> <span v-else>{{ scope.row[v.prop] }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -25,63 +25,80 @@ ...@@ -25,63 +25,80 @@
</section> </section>
</template> </template>
<script> <script>
import {getPageExchangeLogsList,exportExchangeListExcel} from '@/service/api/mallApi.js'; import { getPageExchangeLogsList } from '@/service/api/mallApi.js';
import {formateDateTimeByType} from '@/utils/index.js'; import { formateDateTimeByType } from '@/utils/index.js';
import memberInfoCom from '../common/member-info'; import memberInfoCom from '../common/member-info';
export default { export default {
components:{ components: {
memberInfoCom memberInfoCom
}, },
data() { data() {
let _vm = this; var that = this;
return { return {
loading:false, loading: false,
tableHeader:[ tableHeader: [
{label:'兑换时间',prop:'createTime',minWidth:'170',align:'left',formatter(row){ {
return formateDateTimeByType(row.createTime,'yyyy-MM-dd-HH-mm-ss'); label: '兑换时间',
}}, prop: 'createTime',
{label:'流水号',prop:'definedCode',minWidth:'100',align:'left'}, minWidth: '170',
{label:'会员信息',prop:'issuingQuantity',minWidth:'170',align:'left',component:'memberInfoCom'}, align: 'left',
{label:'消耗积分',prop:'unitCostIntegral',width:'80',align:'left'}, formatter(row) {
{label:'领取状态',prop:'status',width:'100',align:'left',formatter(row){ return formateDateTimeByType(row.createTime, 'yyyy-MM-dd-HH-mm-ss');
let statusLabel ='--'; }
_vm.statusOptions.map(v => { },
{ label: '流水号', prop: 'definedCode', minWidth: '100', align: 'left' },
{ label: '会员信息', prop: 'issuingQuantity', minWidth: '170', align: 'left', component: 'memberInfoCom' },
{ label: '消耗积分', prop: 'unitCostIntegral', width: '80', align: 'left' },
{
label: '领取状态',
prop: 'status',
width: '100',
align: 'left',
formatter(row) {
let statusLabel = '--';
that.statusOptions.map(v => {
if (row.status === v.value) { if (row.status === v.value) {
statusLabel = v.label statusLabel = v.label;
} }
}); });
return statusLabel; return statusLabel;
}}, }
{label:'使用状态',prop:'useStatus',width:'100',align:'left',formatter(row){ },
return row.useStatus === 5?'已使用':'未使用'; {
}}, label: '使用状态',
prop: 'useStatus',
width: '100',
align: 'left',
formatter(row) {
return row.useStatus === 5 ? '已使用' : '未使用';
}
}
], ],
total:0, total: 0,
statusOptions:[{label:'所有领取状态',value:-1},{label:'未领取',value:1},{label:'已领取',value:2}], statusOptions: [{ label: '所有领取状态', value: -1 }, { label: '未领取', value: 1 }, { label: '已领取', value: 2 }],
useStatusOptions:[{label:'所有使用状态',value:-1},{label:'已使用',value:1},{label:'未使用',value:2}], useStatusOptions: [{ label: '所有使用状态', value: -1 }, { label: '已使用', value: 1 }, { label: '未使用', value: 2 }],
listParams:{ listParams: {
pageSize: 20, pageSize: 20,
currentPage: 1, currentPage: 1,
status: -1, status: -1,
useStatus: -1, useStatus: -1,
memberInfo: "", memberInfo: '',
integralMallProId: this.$route.params.id, integralMallProId: this.$route.params.id,
beginTime: "", beginTime: '',
endTime: "" endTime: ''
}, },
dateTime:['',''], dateTime: ['', ''],
tableList:[], tableList: [],
// 导出数据控件 // 导出数据控件
projectName: 'integral-mall', // 当前项目名 projectName: 'integral-mall', // 当前项目名
dialogVisible:false, dialogVisible: false,
excelUrl:'/api-integral-mall/download-exchange-list-execl', // 下载数据的地址 excelUrl: '/api-integral-mall/download-exchange-list-execl', // 下载数据的地址
params:{}, // 传递的参数 params: {} // 传递的参数
}; };
}, },
created() { created() {
// 更新面包屑 // 更新面包屑
this.$store.commit('mutations_breadcrumb',[{name:'积分商城'},{name:'优惠券',path:'/coupon'},{name:'优惠券兑换记录',path:''}]); this.$store.commit('mutations_breadcrumb', [{ name: '积分商城' }, { name: '优惠券', path: '/coupon' }, { name: '优惠券兑换记录', path: '' }]);
this.getPageExchangeLogsList(); this.getPageExchangeLogsList();
}, },
methods: { methods: {
...@@ -98,8 +115,8 @@ import memberInfoCom from '../common/member-info'; ...@@ -98,8 +115,8 @@ import memberInfoCom from '../common/member-info';
async getPageExchangeLogsList() { async getPageExchangeLogsList() {
this.loading = true; this.loading = true;
if (this.dateTime) { if (this.dateTime) {
this.listParams.beginTime = formateDateTimeByType(this.dateTime[0],'yyyy-MM-dd'); this.listParams.beginTime = formateDateTimeByType(this.dateTime[0], 'yyyy-MM-dd');
this.listParams.endTime = formateDateTimeByType(this.dateTime[1],'yyyy-MM-dd'); this.listParams.endTime = formateDateTimeByType(this.dateTime[1], 'yyyy-MM-dd');
} else { } else {
this.listParams.beginTime = this.listParams.senendTimedEndTime = ''; this.listParams.beginTime = this.listParams.senendTimedEndTime = '';
} }
...@@ -109,29 +126,29 @@ import memberInfoCom from '../common/member-info'; ...@@ -109,29 +126,29 @@ import memberInfoCom from '../common/member-info';
this.loading = false; this.loading = false;
}, },
// 导出列表 // 导出列表
exportExcel(){ exportExcel() {
if (this.dateTime) { if (this.dateTime) {
this.listParams.beginTime = formateDateTimeByType(this.dateTime[0],'yyyy-MM-dd'); this.listParams.beginTime = formateDateTimeByType(this.dateTime[0], 'yyyy-MM-dd');
this.listParams.endTime = formateDateTimeByType(this.dateTime[1],'yyyy-MM-dd'); this.listParams.endTime = formateDateTimeByType(this.dateTime[1], 'yyyy-MM-dd');
} else { } else {
this.listParams.beginTime = this.listParams.senendTimedEndTime = ''; this.listParams.beginTime = this.listParams.senendTimedEndTime = '';
} }
if (!this.listParams.beginTime || !this.listParams.endTime) { if (!this.listParams.beginTime || !this.listParams.endTime) {
this.$tips({type: 'warning',message: '时间不能为空'}); this.$tips({ type: 'warning', message: '时间不能为空' });
return; return;
} }
this.params ={ this.params = {
integralMallProId:this.listParams.integralMallProId, integralMallProId: this.listParams.integralMallProId,
status:this.listParams.status, status: this.listParams.status,
useStatus:this.listParams.useStatus, useStatus: this.listParams.useStatus,
memberInfo:this.listParams.memberInfo, memberInfo: this.listParams.memberInfo,
beginTime:this.listParams.beginTime, beginTime: this.listParams.beginTime,
endTime:this.listParams.endTime, endTime: this.listParams.endTime,
requestProject:'integral-mall' requestProject: 'integral-mall'
} };
this.dialogVisible = true this.dialogVisible = true;
// window.location = `${exportExchangeListExcel}?integralMallProId=${this.listParams.integralMallProId}&status=${this.listParams.status}&useStatus=${this.listParams.useStatus}&memberInfo=${this.listParams.memberInfo}&beginTime=${this.listParams.beginTime}&endTime=${this.listParams.endTime}&requestProject=marketing`; // window.location = `${exportExchangeListExcel}?integralMallProId=${this.listParams.integralMallProId}&status=${this.listParams.status}&useStatus=${this.listParams.useStatus}&memberInfo=${this.listParams.memberInfo}&beginTime=${this.listParams.beginTime}&endTime=${this.listParams.endTime}&requestProject=marketing`;
},
} }
}; }
};
</script> </script>
import { getGradeList, getCategoryList, createIntegralProService, getIntegralMallProInfo, createCategoryService } from '@/service/api/mallApi.js'; import { getGradeList, createIntegralProService, getIntegralMallProInfo } from '@/service/api/mallApi.js';
import cardTemp from '../common/card-temp.vue'; import cardTemp from '../common/card-temp.vue';
import { formateDateTimeByType } from '@/utils/index.js'; import { formateDateTimeByType } from '@/utils/index.js';
export default { export default {
...@@ -10,8 +10,8 @@ export default { ...@@ -10,8 +10,8 @@ export default {
form: { form: {
integralMallProId: '', integralMallProId: '',
proReferId: '', proReferId: '',
cardType:0, cardType: 0,
cardName:'', cardName: '',
proName: '', // String 商品名字,优惠券就是所选券的名字。 (必填) proName: '', // String 商品名字,优惠券就是所选券的名字。 (必填)
integralCost: 0, // Number 100 积分费用 (必填) integralCost: 0, // Number 100 积分费用 (必填)
cashCost: 0, // Number 现金费用,两位小数 cashCost: 0, // Number 现金费用,两位小数
...@@ -32,7 +32,7 @@ export default { ...@@ -32,7 +32,7 @@ export default {
rules: { rules: {
integralCost: { required: true, type: 'number', min: 0, message: '请输入积分费用', trigger: 'blur' }, integralCost: { required: true, type: 'number', min: 0, message: '请输入积分费用', trigger: 'blur' },
cashCost: { required: true, type: 'number', min: 0, message: '请输入现金费用', trigger: 'blur' }, cashCost: { required: true, type: 'number', min: 0, message: '请输入现金费用', trigger: 'blur' },
memberGradeArr: { required: true, type: 'array', message: '请选择适用会员', trigger: 'blur' }, memberGradeArr: { required: true, type: 'array', message: '请选择适用会员', trigger: 'blur' }
}, },
memberGradeOptions: [], memberGradeOptions: [],
exchangeDateWeekOptions: ['1', '2', '3', '4', '5', '6', '7'], exchangeDateWeekOptions: ['1', '2', '3', '4', '5', '6', '7'],
...@@ -40,21 +40,21 @@ export default { ...@@ -40,21 +40,21 @@ export default {
sendChildData: { sendChildData: {
storeType: 0, storeType: 0,
storeGroupIds: '', storeGroupIds: '',
storeIds: [], storeIds: []
}, },
timeRangeList: [{}], timeRangeList: [{}],
isLimitTimes: false, isLimitTimes: false,
isAdd: this.$route.meta.type === 'add', isAdd: this.$route.meta.type === 'add',
isEdit: this.$route.meta.type === 'edit', isEdit: this.$route.meta.type === 'edit',
isInfo: this.$route.meta.type === 'info', isInfo: this.$route.meta.type === 'info'
} };
}, },
created() { created() {
this.$store.commit('mutations_breadcrumb', [{ name: '积分商城' }, { name: '优惠券', path: '/coupon' }, { name: this.isAdd ? '新增优惠券' : '编辑优惠券', path: '' }]); this.$store.commit('mutations_breadcrumb', [{ name: '积分商城' }, { name: '优惠券', path: '/coupon' }, { name: this.isAdd ? '新增优惠券' : '编辑优惠券', path: '' }]);
this.getGradeList(); this.getGradeList();
// 解决响应式问题 // 解决响应式问题
if (!this.timeRangeList) { if (!this.timeRangeList) {
this.$set(this.timeRangeList, 0, { timeRange: ['', ''] }) this.$set(this.timeRangeList, 0, { timeRange: ['', ''] });
} }
if (this.isEdit || this.isInfo) { if (this.isEdit || this.isInfo) {
this.getIntegralMallProInfo(); this.getIntegralMallProInfo();
...@@ -62,21 +62,21 @@ export default { ...@@ -62,21 +62,21 @@ export default {
}, },
computed: { computed: {
asideShow() { asideShow() {
return this.$store.state.marketing.asideShow return this.$store.state.marketing.asideShow;
} }
}, },
watch: { watch: {
'form.limitTimes' (val) { 'form.limitTimes'(val) {
this.isLimitTimes = (val > 0); this.isLimitTimes = val > 0;
}, }
}, },
methods: { methods: {
// init 拉取详情 // init 拉取详情
/* eslint-disable */
async getIntegralMallProInfo() { async getIntegralMallProInfo() {
let res = await getIntegralMallProInfo({ integralMallProId: this.$route.params.id }); let res = await getIntegralMallProInfo({ integralMallProId: this.$route.params.id });
if (res.errorCode === 0) { if (res.errorCode === 0) {
const result = res.result; const result = res.result;
this.form.integralMallProId = result.integralMallProId || ''; this.form.integralMallProId = result.integralMallProId || '';
this.form.proReferId = result.proReferId || ''; this.form.proReferId = result.proReferId || '';
...@@ -96,15 +96,10 @@ export default { ...@@ -96,15 +96,10 @@ export default {
this.form.exchangeDateWeekArr = result.exchangeDateWeek ? result.exchangeDateWeek.split(',').filter(v => v) : []; this.form.exchangeDateWeekArr = result.exchangeDateWeek ? result.exchangeDateWeek.split(',').filter(v => v) : [];
this.form.limitTimeBegin = result.limitTimeBegin || ''; this.form.limitTimeBegin = result.limitTimeBegin || '';
this.form.cardType = result.cardType this.form.cardType = result.cardType;
console.log('333333',this.form.cardType)
// result.showStore = 2;
this.sendChildData = { this.sendChildData = {
storeType: result.showStore || 0 storeType: result.showStore || 0
} };
if (result.showStore === 1) { if (result.showStore === 1) {
this.sendChildData.storeGroupIds = result.storeGroupIds || ''; this.sendChildData.storeGroupIds = result.storeGroupIds || '';
...@@ -113,30 +108,29 @@ export default { ...@@ -113,30 +108,29 @@ export default {
if (result.storeInfo.length) { if (result.storeInfo.length) {
result.storeInfo.map(v => { result.storeInfo.map(v => {
list.push(v); list.push(v);
}) });
} }
this.sendChildData.storeIds = list; this.sendChildData.storeIds = list;
} }
console.log(this.sendChildData)
if (this.form.exchangeTimeType === 2 && result.timeZones) { if (this.form.exchangeTimeType === 2 && result.timeZones) {
let list = result.timeZones.split('#').filter(v => v); let list = result.timeZones.split('#').filter(v => v);
list.map((v, i) => { list.map((v, i) => {
let arr = v.split('-'); let arr = v.split('-');
this.$set(this.timeRangeList, i, { timeRange: [arr[0], arr[1]] }) this.$set(this.timeRangeList, i, { timeRange: [arr[0], arr[1]] });
}); });
} }
this.isLimitTimes = this.form.limitTimes > 0; this.isLimitTimes = this.form.limitTimes > 0;
this.$nextTick(_ => { this.$nextTick(_ => {
this.$refs.cardTemp.getCardList(); this.$refs.cardTemp.getCardList();
}) });
} }
}, },
//门店分组回执方法 //门店分组回执方法
getSelectGroupData(val) { getSelectGroupData(val) {
this.sendChildData.storeType = val.storeType || 0 this.sendChildData.storeType = val.storeType || 0;
this.sendChildData.storeGroupIds = val.storeGroupIds || '' this.sendChildData.storeGroupIds = val.storeGroupIds || '';
this.sendChildData.storeIds = val.storeIds || [] this.sendChildData.storeIds = val.storeIds || [];
}, },
// 拉取会员等级列表 // 拉取会员等级列表
async getGradeList() { async getGradeList() {
...@@ -144,12 +138,11 @@ export default { ...@@ -144,12 +138,11 @@ export default {
if (res.errorCode === 0) { if (res.errorCode === 0) {
this.memberGradeOptions = res.result || []; this.memberGradeOptions = res.result || [];
} }
console.log(res);
}, },
// 获取卡券组件回调的对象 // 获取卡券组件回调的对象
getCardActiveObjFun(val) { getCardActiveObjFun(val) {
if (val.hasOwnProperty('cardType')) { if (val.hasOwnProperty('cardType')) {
this.form.cardType = val.cardType this.form.cardType = val.cardType;
} }
if (val.coupCardId && this.isAdd) { if (val.coupCardId && this.isAdd) {
this.form.virtualStock = val.couponStock || 0; this.form.virtualStock = val.couponStock || 0;
...@@ -164,7 +157,7 @@ export default { ...@@ -164,7 +157,7 @@ export default {
this.$tips({ type: 'warning', message: '最多五个时间段' }); this.$tips({ type: 'warning', message: '最多五个时间段' });
return; return;
} }
this.$set(this.timeRangeList, length, { timeRange: ['', ''] }) this.$set(this.timeRangeList, length, { timeRange: ['', ''] });
}, },
// 删除时间段 // 删除时间段
delTimeRange(index) { delTimeRange(index) {
...@@ -172,11 +165,9 @@ export default { ...@@ -172,11 +165,9 @@ export default {
}, },
submit(formName) { submit(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate(valid => {
if (valid) { if (valid) {
this.submitService(); this.submitService();
} else {
console.log('表单未提交完整');
} }
}); });
}, },
...@@ -186,8 +177,6 @@ export default { ...@@ -186,8 +177,6 @@ export default {
this.$tips({ type: 'warning', message: '请选择优惠券' }); this.$tips({ type: 'warning', message: '请选择优惠券' });
return; return;
} }
console.log(4444444,this.form.cardType)
console.log(this.timeRangeList)
let params = { let params = {
integralMallProId: this.form.integralMallProId || '', integralMallProId: this.form.integralMallProId || '',
proType: 1, // 商品类型 1 优惠券,2礼品,3实物 proType: 1, // 商品类型 1 优惠券,2礼品,3实物
...@@ -206,12 +195,9 @@ export default { ...@@ -206,12 +195,9 @@ export default {
showStore: this.sendChildData.storeType || 0, // 显示门店 0所有 1部分分组 2部分门店 showStore: this.sendChildData.storeType || 0, // 显示门店 0所有 1部分分组 2部分门店
virtualStock: this.form.virtualStock || 0, //库存 virtualStock: this.form.virtualStock || 0, //库存
cardType :this.form.cardType cardType: this.form.cardType
} };
console.log(22222,params)
// 判断 兑换日期 // 判断 兑换日期
if (params.exchangeDateType === 2) { if (params.exchangeDateType === 2) {
...@@ -243,7 +229,6 @@ export default { ...@@ -243,7 +229,6 @@ export default {
let list = []; let list = [];
let flag = false; let flag = false;
let arr = []; let arr = [];
console.log(JSON.stringify(this.timeRangeList))
this.timeRangeList.forEach(v => { this.timeRangeList.forEach(v => {
if (!v.timeRange || !v.timeRange[0]) { if (!v.timeRange || !v.timeRange[0]) {
flag = true; flag = true;
...@@ -251,7 +236,7 @@ export default { ...@@ -251,7 +236,7 @@ export default {
arr.push(v.timeRange); arr.push(v.timeRange);
list.push(v.timeRange[0] + '-' + v.timeRange[1]); list.push(v.timeRange[0] + '-' + v.timeRange[1]);
} }
}) });
if (flag) { if (flag) {
this.$tips({ type: 'warning', message: '部分时段未填写完整' }); this.$tips({ type: 'warning', message: '部分时段未填写完整' });
return; return;
...@@ -265,14 +250,13 @@ export default { ...@@ -265,14 +250,13 @@ export default {
} }
let breakFlag = false; let breakFlag = false;
for (var i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
if (breakFlag) { if (breakFlag) {
break; break;
} }
var p1 = arr[i]; let p1 = arr[i];
for (var j = i + 1; j < arr.length; j++) { for (let j = i + 1; j < arr.length; j++) {
var p2 = arr[j]; let p2 = arr[j];
console.log(p1, p2);
if ((p2[0] > p1[0] && p2[0] < p1[1]) || (p2[1] > p1[0] && p2[1] < p1[1]) || (p1[0] > p2[0] && p1[0] < p2[1]) || (p1[1] > p2[0] && p1[1] < p2[1])) { if ((p2[0] > p1[0] && p2[0] < p1[1]) || (p2[1] > p1[0] && p2[1] < p1[1]) || (p1[0] > p2[0] && p1[0] < p2[1]) || (p1[1] > p2[0] && p1[1] < p2[1])) {
breakFlag = true; breakFlag = true;
break; break;
...@@ -280,7 +264,7 @@ export default { ...@@ -280,7 +264,7 @@ export default {
} }
} }
if (breakFlag) { if (breakFlag) {
this.$tips({ type: 'warning', message: "兑换时段之间不允许出现时间交叠" }); this.$tips({ type: 'warning', message: '兑换时段之间不允许出现时间交叠' });
return; return;
} }
} }
...@@ -295,9 +279,7 @@ export default { ...@@ -295,9 +279,7 @@ export default {
} }
} }
// 门店分组 // 门店分组
console.log(this.sendChildData)
if (this.sendChildData.storeType === 1) { if (this.sendChildData.storeType === 1) {
if (this.sendChildData.storeGroupIds) { if (this.sendChildData.storeGroupIds) {
params.storeGroupIds = this.sendChildData.storeGroupIds || ''; params.storeGroupIds = this.sendChildData.storeGroupIds || '';
...@@ -315,17 +297,18 @@ export default { ...@@ -315,17 +297,18 @@ export default {
} }
} }
createIntegralProService(params).then(res => { createIntegralProService(params)
.then(res => {
if (res.errorCode === 0) { if (res.errorCode === 0) {
this.$router.push('/coupon'); this.$router.push('/coupon');
this.$tips({ type: 'success', message: '操作成功' }); this.$tips({ type: 'success', message: '操作成功' });
} else { } else {
this.$tips({ type: 'error', message: '操作失败' }); this.$tips({ type: 'error', message: '操作失败' });
} }
console.log(res);
}).catch(err => {
this.$tips({ type: 'error', message: '操作失败' });
}) })
.catch(err => {
this.$tips({ type: 'error', message: '操作失败' });
});
} }
} }
} };
\ No newline at end of file
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
<el-input-number controls-position="right" :disabled="isEdit || isInfo" v-model="form.cashCost" class="w300" :precision="2" :min="0"></el-input-number> <el-input-number controls-position="right" :disabled="isEdit || isInfo" v-model="form.cashCost" class="w300" :precision="2" :min="0"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item prop="limitTimes" label="次数限制"> <el-form-item prop="limitTimes" label="次数限制">
<el-checkbox :disabled="isInfo" v-model="isLimitTimes"> 每个会员限制兑换 <el-checkbox :disabled="isInfo" v-model="isLimitTimes"> 每个会员限制兑换 </el-checkbox>
</el-checkbox>
<el-input-number controls-position="right" :disabled="isInfo" v-model="form.limitTimes" class="w100" :precision="0" :min="0"></el-input-number> <el-input-number controls-position="right" :disabled="isInfo" v-model="form.limitTimes" class="w100" :precision="0" :min="0"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item prop="memberGradeArr" label="适用会员"> <el-form-item prop="memberGradeArr" label="适用会员">
...@@ -54,14 +53,13 @@ ...@@ -54,14 +53,13 @@
<el-radio :label="2" class="vertical-middle">部分时段</el-radio> <el-radio :label="2" class="vertical-middle">部分时段</el-radio>
</el-radio-group> </el-radio-group>
<div v-show="form.exchangeTimeType === 2" class=""> <div v-show="form.exchangeTimeType === 2" class="">
<p v-for="(v,i) in timeRangeList" :key="i" class="pt8"> <p v-for="(v, i) in timeRangeList" :key="i" class="pt8">
<el-time-picker :disabled="form.exchangeTimeType === 1" class="vertical-middle w300" is-range v-model="v.timeRange" value-format="HH:mm" format="HH:mm" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker> <el-time-picker :disabled="form.exchangeTimeType === 1" class="vertical-middle w300" is-range v-model="v.timeRange" value-format="HH:mm" format="HH:mm" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
<el-button v-if="i" class="vertical-middle" type="text" @click="delTimeRange(i)">删除</el-button> <el-button v-if="i" class="vertical-middle" type="text" @click="delTimeRange(i)">删除</el-button>
</p> </p>
<span class="gray fz12 vertical-top">请使用24小时制输入时间,格式如11:00至14:30</span> <span class="gray fz12 vertical-top">请使用24小时制输入时间,格式如11:00至14:30</span>
<p><el-button type="text" @click="addTimeRange">添加时间段</el-button></p> <p><el-button type="text" @click="addTimeRange">添加时间段</el-button></p>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item prop="proShowStatus" label="显示状态"> <el-form-item prop="proShowStatus" label="显示状态">
<el-radio-group v-model="form.proShowStatus"> <el-radio-group v-model="form.proShowStatus">
...@@ -74,13 +72,13 @@ ...@@ -74,13 +72,13 @@
<el-radio :label="1">立即发布</el-radio> <el-radio :label="1">立即发布</el-radio>
<el-radio :label="2">定时发布</el-radio> <el-radio :label="2">定时发布</el-radio>
</el-radio-group> </el-radio-group>
<div class="pt8" v-if="form.releaseType ===2"> <div class="pt8" v-if="form.releaseType === 2">
<el-date-picker v-model="form.limitTimeBegin" type="datetime" placeholder="选择日期时间"></el-date-picker> <el-date-picker v-model="form.limitTimeBegin" type="datetime" placeholder="选择日期时间"></el-date-picker>
</div> </div>
</el-form-item> </el-form-item>
</div> </div>
<div class="btn-wrap_fixed" :class="{'on':asideShow}"> <div class="btn-wrap_fixed" :class="{ on: asideShow }">
<el-button type="primary" @click="submit('form')" v-if="!isInfo">{{isAdd?'确认新增':'确认编辑'}}</el-button> <el-button type="primary" @click="submit('form')" v-if="!isInfo">{{ isAdd ? '确认新增' : '确认编辑' }}</el-button>
<el-button @click="$router.go(-1)">返 回</el-button> <el-button @click="$router.go(-1)">返 回</el-button>
</div> </div>
</el-form> </el-form>
......
...@@ -8,33 +8,20 @@ ...@@ -8,33 +8,20 @@
<el-form-item label="礼品主图" class="is-required"> <el-form-item label="礼品主图" class="is-required">
<div class="member-upload-image"> <div class="member-upload-image">
<p class="gray fz13">规格750*750,大小≤1M</p> <p class="gray fz13">规格750*750,大小≤1M</p>
<vue-gic-upload-image <vue-gic-upload-image :projectName="projectName" :wxFlag="wxFlag" :actionUrl="actionUrl" :imageList="imageList" :limitW="limitW" :limitH="limitH" :imgSize="imgSize" with-credentials :maxImageLength="maxlength" @uploadOnSuccess="uploadOnSuccess" @sortImg="sortImg" @deleteImage="deleteImage"> </vue-gic-upload-image>
:projectName="projectName"
:wxFlag="wxFlag"
:actionUrl="actionUrl"
:imageList="imageList"
:limitW="limitW"
:limitH="limitH"
:imgSize="imgSize"
with-credentials
:maxImageLength="maxlength"
@uploadOnSuccess="uploadOnSuccess"
@sortImg="sortImg"
@deleteImage="deleteImage">
</vue-gic-upload-image>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item prop="proCategoryId" label="礼品分类"> <el-form-item prop="proCategoryId" label="礼品分类">
<el-select v-model="form.proCategoryId" placeholder="请选择" class="w300 delete-select"> <el-select v-model="form.proCategoryId" placeholder="请选择" class="w300 delete-select">
<el-option v-for="(v,i) in categoryOptions" :key="i" :label="v.categoryName" :value="v.integralMallCategoryId"> <el-option v-for="(v, i) in categoryOptions" :key="i" :label="v.categoryName" :value="v.integralMallCategoryId">
<span class="fl">{{v.categoryName}}</span> <span class="fl">{{ v.categoryName }}</span>
<el-button class="fr delete-icon" type="text" @click.stop="deleteCategory(v.integralMallCategoryId)" style="line-height:34px" ><i class="el-icon-error el-icon--right"></i></el-button> <el-button class="fr delete-icon" type="text" @click.stop="deleteCategory(v.integralMallCategoryId)" style="line-height:34px"><i class="el-icon-error el-icon--right"></i></el-button>
</el-option> </el-option>
</el-select> </el-select>
<el-button type="text" @click="createCategory">新建分类</el-button> <el-button type="text" @click="createCategory">新建分类</el-button>
</el-form-item> </el-form-item>
<el-form-item prop="integralCost" label="积分费用"> <el-form-item prop="integralCost" label="积分费用">
<el-input-number class="w300" controls-position="right" :disabled="isInfo || isEdit" v-model="form.integralCost" :precision="0" :step="1" :min="0" ></el-input-number> <el-input-number class="w300" controls-position="right" :disabled="isInfo || isEdit" v-model="form.integralCost" :precision="0" :step="1" :min="0"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item prop="cashCost" label="现金费用"> <el-form-item prop="cashCost" label="现金费用">
<el-input-number controls-position="right" :disabled="isInfo || isEdit" v-model="form.cashCost" class="w300" :precision="2" :step="0.1" :min="0"></el-input-number> <el-input-number controls-position="right" :disabled="isInfo || isEdit" v-model="form.cashCost" class="w300" :precision="2" :step="0.1" :min="0"></el-input-number>
...@@ -43,8 +30,7 @@ ...@@ -43,8 +30,7 @@
<el-input-number controls-position="right" :disabled="isInfo || isEdit || form.changeType === 1" v-model="form.costValue" class="w300" :precision="2" :step="0.1" :min="0"></el-input-number> <el-input-number controls-position="right" :disabled="isInfo || isEdit || form.changeType === 1" v-model="form.costValue" class="w300" :precision="2" :step="0.1" :min="0"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item prop="limitTimes" label="次数限制"> <el-form-item prop="limitTimes" label="次数限制">
<el-checkbox :disabled="isInfo" v-model="isLimitTimes"> 每个会员限制兑换 <el-checkbox :disabled="isInfo" v-model="isLimitTimes"> 每个会员限制兑换 </el-checkbox>
</el-checkbox>
<el-input-number controls-position="right" :disabled="isInfo" v-model="form.limitTimes" class="w100" :precision="0" :min="0"></el-input-number> <el-input-number controls-position="right" :disabled="isInfo" v-model="form.limitTimes" class="w100" :precision="0" :min="0"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item prop="memberGradeArr" label="适用会员"> <el-form-item prop="memberGradeArr" label="适用会员">
...@@ -78,7 +64,7 @@ ...@@ -78,7 +64,7 @@
<el-option v-for="item in monthOptions" :key="item" :label="item" :value="item"></el-option> <el-option v-for="item in monthOptions" :key="item" :label="item" :value="item"></el-option>
</el-select> </el-select>
</div> </div>
<div class="pt8" v-if="form.exchangeDateType ===4"> <div class="pt8" v-if="form.exchangeDateType === 4">
<el-select class="w300" size="small" v-model="form.exchangeDateWeekArr" multiple placeholder="请选择"> <el-select class="w300" size="small" v-model="form.exchangeDateWeekArr" multiple placeholder="请选择">
<el-option v-for="item in exchangeDateWeekOptions" :key="item" :label="item" :value="item"></el-option> <el-option v-for="item in exchangeDateWeekOptions" :key="item" :label="item" :value="item"></el-option>
</el-select> </el-select>
...@@ -91,14 +77,13 @@ ...@@ -91,14 +77,13 @@
<el-radio :label="2" class="vertical-middle">部分时段</el-radio> <el-radio :label="2" class="vertical-middle">部分时段</el-radio>
</el-radio-group> </el-radio-group>
<div v-show="form.exchangeTimeType === 2" class=""> <div v-show="form.exchangeTimeType === 2" class="">
<p v-for="(v,i) in timeRangeList" :key="i" class="pt8"> <p v-for="(v, i) in timeRangeList" :key="i" class="pt8">
<el-time-picker :disabled="form.exchangeTimeType === 1" class="vertical-middle w300" is-range v-model="v.timeRange" value-format="HH:mm" format="HH:mm" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker> <el-time-picker :disabled="form.exchangeTimeType === 1" class="vertical-middle w300" is-range v-model="v.timeRange" value-format="HH:mm" format="HH:mm" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
<el-button v-if="i" class="vertical-middle" type="text" @click="delTimeRange(i)">删除</el-button> <el-button v-if="i" class="vertical-middle" type="text" @click="delTimeRange(i)">删除</el-button>
</p> </p>
<span class="gray fz12 vertical-top">请使用24小时制输入时间,格式如11:00至14:30</span> <span class="gray fz12 vertical-top">请使用24小时制输入时间,格式如11:00至14:30</span>
<p><el-button type="text" @click="addTimeRange">添加时间段</el-button></p> <p><el-button type="text" @click="addTimeRange">添加时间段</el-button></p>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item prop="proShowStatus" label="显示状态" class="is-required"> <el-form-item prop="proShowStatus" label="显示状态" class="is-required">
...@@ -112,7 +97,7 @@ ...@@ -112,7 +97,7 @@
<el-radio :label="1">立即发布</el-radio> <el-radio :label="1">立即发布</el-radio>
<el-radio :label="2">定时发布</el-radio> <el-radio :label="2">定时发布</el-radio>
</el-radio-group> </el-radio-group>
<div class="pt8" v-if="form.releaseType ===2"> <div class="pt8" v-if="form.releaseType === 2">
<el-date-picker v-model="form.limitTimeBegin" type="datetime" placeholder="选择日期时间"></el-date-picker> <el-date-picker v-model="form.limitTimeBegin" type="datetime" placeholder="选择日期时间"></el-date-picker>
</div> </div>
</el-form-item> </el-form-item>
...@@ -134,8 +119,8 @@ ...@@ -134,8 +119,8 @@
<card-temp ref="cardTemp" pbSize="pb15" :activeId.sync="form.proReferId" @emitActiveObj="getCardActiveObjFun" :showPagination="false" :cardLimitType="3"></card-temp> <card-temp ref="cardTemp" pbSize="pb15" :activeId.sync="form.proReferId" @emitActiveObj="getCardActiveObjFun" :showPagination="false" :cardLimitType="3"></card-temp>
</div> </div>
</div> </div>
<div class="btn-wrap_fixed" :class="{'on':asideShow}"> <div class="btn-wrap_fixed" :class="{ on: asideShow }">
<el-button type="primary" @click="submit('form')" v-if="!isInfo">{{isAdd?'确认新增':'确认编辑'}}</el-button> <el-button type="primary" @click="submit('form')" v-if="!isInfo">{{ isAdd ? '确认新增' : '确认编辑' }}</el-button>
<el-button @click="$router.go(-1)">返 回</el-button> <el-button @click="$router.go(-1)">返 回</el-button>
</div> </div>
</el-form> </el-form>
......
...@@ -2,19 +2,25 @@ ...@@ -2,19 +2,25 @@
<el-dialog class="express dialog__body__nopadding" title="查看详情" :visible.sync="show" width="40%" :before-close="close"> <el-dialog class="express dialog__body__nopadding" title="查看详情" :visible.sync="show" width="40%" :before-close="close">
<div class="express--info"> <div class="express--info">
<div v-if="infoStatus === 3"> <div v-if="infoStatus === 3">
<p>收件人:<span style="color:#606266">{{info.consignee || '--'}}</span></p> <p>
<p>联系方式:<span style="color:#606266">{{info.consigneePhone || '--'}}</span></p> 收件人:<span style="color:#606266">{{ info.consignee || '--' }}</span>
<p>收货地址:<span style="color:#606266">{{info.receivingAddress || '--'}}</span></p> </p>
<p>
联系方式:<span style="color:#606266">{{ info.consigneePhone || '--' }}</span>
</p>
<p>
收货地址:<span style="color:#606266">{{ info.receivingAddress || '--' }}</span>
</p>
</div> </div>
<div v-if="infoStatus === 1"> <div v-if="infoStatus === 1">
<p>发货时间:{{formateDateTimeByType(info.deliveryTime,'yyyy-MM-dd-HH-mm') || '--'}}</p> <p>发货时间:{{ formateDateTimeByType(info.deliveryTime, 'yyyy-MM-dd-HH-mm') || '--' }}</p>
<p>操作人员:{{info.clerkName || '--'}}</p> <p>操作人员:{{ info.clerkName || '--' }}</p>
<p>发货内容:{{info.deliveryContent || '--'}}</p> <p>发货内容:{{ info.deliveryContent || '--' }}</p>
</div> </div>
<div v-if="infoStatus !== 1"> <div v-if="infoStatus !== 1">
<p>取消时间:{{formateDateTimeByType(info.cancelTime,'yyyy-MM-dd-HH-mm') || '--'}}</p> <p>取消时间:{{ formateDateTimeByType(info.cancelTime, 'yyyy-MM-dd-HH-mm') || '--' }}</p>
<p>操作人员:{{info.clerkName || '--'}}</p> <p>操作人员:{{ info.clerkName || '--' }}</p>
<p>取消原因:{{info.cancelReason || '--'}}</p> <p>取消原因:{{ info.cancelReason || '--' }}</p>
</div> </div>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -23,26 +29,25 @@ ...@@ -23,26 +29,25 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { getLogisticsInfo } from '@/service/api/mallApi.js';
import { formateDateTimeByType } from '@/utils/index.js';
import {getLogisticsInfo,getLogisticsList,orderOptService} from '@/service/api/mallApi.js'; export default {
import {formateDateTimeByType} from '@/utils/index.js'; props: {
show: {
export default { type: Boolean,
props:{ default: false
show:{
type:Boolean,
default:false
}, },
id:{ id: {
type:String, type: String,
default:'' default: ''
}, },
infoStatus:{ infoStatus: {
type:Number, type: Number,
default:false default: 0
} }
}, },
watch:{ watch: {
show(val) { show(val) {
if (val) { if (val) {
this.getLogisticsInfo(); this.getLogisticsInfo();
...@@ -52,17 +57,17 @@ import {formateDateTimeByType} from '@/utils/index.js'; ...@@ -52,17 +57,17 @@ import {formateDateTimeByType} from '@/utils/index.js';
data() { data() {
return { return {
formateDateTimeByType, formateDateTimeByType,
loading:false, loading: false,
info:{} info: {}
} };
}, },
methods: { methods: {
close() { close() {
this.$emit('update:show',false); this.$emit('update:show', false);
}, },
async getLogisticsInfo() { async getLogisticsInfo() {
this.loading = true; this.loading = true;
let res = await getLogisticsInfo({integralMallProExchangeId:this.id}); let res = await getLogisticsInfo({ integralMallProExchangeId: this.id });
if (res.errorCode === 0) { if (res.errorCode === 0) {
this.info = res.result.changeLog || {}; this.info = res.result.changeLog || {};
} }
...@@ -73,7 +78,7 @@ import {formateDateTimeByType} from '@/utils/index.js'; ...@@ -73,7 +78,7 @@ import {formateDateTimeByType} from '@/utils/index.js';
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.express{ .express {
&--info { &--info {
p { p {
line-height: 30px; line-height: 30px;
......
...@@ -7,23 +7,23 @@ ...@@ -7,23 +7,23 @@
<script> <script>
import { getNotSendCount } from '@/service/api/mallApi.js'; import { getNotSendCount } from '@/service/api/mallApi.js';
export default { export default {
name: "mall", name: 'mall',
data() { data() {
const vm = this;
return { return {
total:0, total: 0
}; };
}, },
created() { created() {
this.$store.commit("mutations_breadcrumb", [{ name: "积分商城" }]); this.$store.commit('mutations_breadcrumb', [{ name: '积分商城' }]);
this.$store.commit("aside_handler", true); this.$store.commit('aside_handler', true);
this.getNotSendCount(); this.getNotSendCount();
$bus.$on('refresh-not-send-count',() => { /* eslint-disable */
$bus.$on('refresh-not-send-count', () => {
this.getNotSendCount(); this.getNotSendCount();
}); });
}, },
methods:{ methods: {
async getNotSendCount(){ async getNotSendCount() {
let res = await getNotSendCount(); let res = await getNotSendCount();
if (res.errorCode === 0) { if (res.errorCode === 0) {
this.total = res.result; this.total = res.result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment