KK-MALL前端完整代码

This commit is contained in:
Kirk Lin 2021-06-14 12:13:20 +08:00
parent c742c181e2
commit fd838498a3
158 changed files with 19419 additions and 8062 deletions

View file

@ -1,11 +1,16 @@
package name.lkk.common.enume;
/**
* @author kirklin
* @author kirklin
*/
public enum OrderStatusEnum {
CREATE_NEW(0,"待付款"),
PAYED(1,"已付款"),
SENDED(2,"已发货"),
RECIEVED(3,"已完成"),
CANCLED(4,"已取消"),
SENDER(2,"已发货"),
RECEIVED(3,"已完成"),
CANCELED(4,"已取消"),
SERVICING(5,"售后中"),
SERVICED(6,"售后完成");
private Integer code;

View file

@ -1,59 +0,0 @@
## 更新日志
### 1.2.2
*2018-10-16*
- 修复判断当前路由类型 bug
- 默认开放element-ui所有组件
- 修复子菜单同级出现子菜单项会同时选中bug
- 捕获首次请求菜单列表和权限异常,自动跳转至登录页
- 修复菜单按钮权限错误bug [#41](https://github.com/renrenio/renren-fast-vue/issues/41)
- 提供重置登录信息状态方法。修复登出或替换账号还保留之前账号操作信息和痕迹bug
- 优化token失效、退出后为了强制清空整站临时存储数据而刷新页面问题。注意: 此次vux数据并未做重置处理
### 1.2.1
*2018-06-08*
- 修复tabs关闭最后一个tab后再次打开会保留最后一个tab bug
- 优化完善mock模拟数据
- 修复linux系统引入主题色文件名大小写编译错误bug [#22](https://github.com/daxiongYang/renren-fast-vue/issues/22)
- 新增echarts图表、ueditor富文本编辑器demo
- 移除登录成功token前端设置的失效时间
- 修复退出token失效后返回登录页面未清空整站临时存储数据bug
- 修复手机号码验证正则bug
- 同步后台 修改config模块key vulue子段为paramKey paramValue
- 修复角色管理 新增修改授权接口请求错误bug
- 修复1.2 新版本的导航栏Tab错位bug [#14](https://github.com/daxiongYang/renren-fast-vue/issues/14)
- 修复动态菜单路由 最前面带/bug
- 修复其它已知bug
### 1.2.0
*2018-05-03*
- 支持菜单管理操作动态(菜单)路由
- 移除api文件夹目录简化api请求方式
- 新增element-ui组件主题12套可同步修改配置设置成整站主题
- 调整store状态目录结构改变设置获取方式
- 调整views视图层结构更友好的支持动态(菜单)路由
- 修复其它已知bug
### 1.1.0
*2018-04-15*
- 使用SVG Sprite矢量图标替换fontawesome字体图标
- 新增内容tabs标签页关闭当前其它全部、刷新当前功能
- 新增scss变量皮肤定制
- 优化路由机制通过meta isTab属性设定是否通过tab标签页展示内容
- 更新element-ui 2.3.2 用于修复左侧菜单收缩卡顿问题
- 新增mock本地开发模拟数据功能
- 修复本地开发找不到baseUrl问题
- 更新element-ui 2.2.1 用于修复tree半选中状态项不能传给后台接口问题
- 修复其它已知bug
### 1.0.0
*2018-02-11*

View file

@ -1,19 +0,0 @@
## renren-fast-vue
- renren-fast-vue基于vue、element-ui构建开发实现[renren-fast](https://gitee.com/renrenio/renren-fast)后台管理前端功能,提供一套更优的前端解决方案
- 前后端分离通过token进行数据交互可独立部署
- 主题定制通过scss变量统一一站式定制
- 动态菜单,通过菜单管理统一管理访问路由
- 数据切换通过mock配置对接口数据mock模拟数据进行切换
- 发布时可动态配置CDN静态资源切换新旧版本
- 演示地址:[http://demo.open.renren.io/renren-fast](http://demo.open.renren.io/renren-fast) (账号密码admin/admin)
![输入图片说明](https://images.gitee.com/uploads/images/2019/0305/133529_ff15f192_63154.png "01.png")
![输入图片说明](https://images.gitee.com/uploads/images/2019/0305/133537_7a1b2d85_63154.png "02.png")
## 说明文档
项目开发、部署等说明都在[wiki](https://github.com/renrenio/renren-fast-vue/wiki)中。
## 更新日志
每个版本的详细更改都记录在[release notes](https://github.com/renrenio/renren-fast-vue/releases)中。

View file

@ -54,7 +54,6 @@ exports.cssLoaders = function (options) {
}
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),

View file

@ -9,15 +9,14 @@ function resolve (dir) {
}
const createLintingRule = () => ({
//关闭语法检查
// test: /\.(js|vue)$/,
// loader: 'eslint-loader',
// enforce: 'pre',
// include: [resolve('src'), resolve('test')],
// options: {
// formatter: require('eslint-friendly-formatter'),
// emitWarning: !config.dev.showEslintErrorsInOverlay
// }
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [resolve('src'), resolve('test')],
options: {
formatter: require('eslint-friendly-formatter'),
emitWarning: !config.dev.showEslintErrorsInOverlay
}
})
module.exports = {

View file

@ -44,7 +44,6 @@ const devWebpackConfig = merge(baseWebpackConfig, {
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',

View file

@ -30,7 +30,6 @@ const webpackConfig = merge(baseWebpackConfig, {
chunkFilename: utils.assetsPath('js/[id].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
@ -46,21 +45,13 @@ const webpackConfig = merge(baseWebpackConfig, {
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].css'),
// set the following option to `true` if you want to extract CSS from
// codesplit chunks into this main css file as well.
// This will result in *all* of your app's CSS being loaded upfront.
allChunks: false,
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: config.build.productionSourceMap
? { safe: true, map: { inline: false } }
: { safe: true }
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: process.env.NODE_ENV === 'testing'
? 'index.html'
@ -71,10 +62,7 @@ const webpackConfig = merge(baseWebpackConfig, {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// keep module.id stable when vender modules does not change
@ -101,9 +89,6 @@ const webpackConfig = merge(baseWebpackConfig, {
name: 'manifest',
minChunks: Infinity
}),
// This instance extracts shared chunks from code splitted chunks and bundles them
// in a separate chunk, similar to the vendor chunk
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
new webpack.optimize.CommonsChunkPlugin({
name: 'app',
async: 'vendor-async',

View file

@ -1,5 +1,4 @@
'use strict'
// This is the webpack config used for unit tests.
const utils = require('./utils')
const webpack = require('webpack')
@ -14,8 +13,6 @@ const webpackConfig = merge(baseWebpackConfig, {
devtool: '#inline-source-map',
resolveLoader: {
alias: {
// necessary to to make lang="scss" work in test when using vue-loader's ?inject option
// see discussion at https://github.com/vuejs/vue-loader/issues/724
'scss-loader': 'sass-loader'
}
},
@ -26,7 +23,6 @@ const webpackConfig = merge(baseWebpackConfig, {
]
})
// no need for app entry during tests
delete webpackConfig.entry
module.exports = webpackConfig

View file

@ -33,7 +33,7 @@ module.exports = {
// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: true,
useEslint: false,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay: false,

View file

@ -6,12 +6,12 @@ var del = require('del');
var distPath = path.resolve('./dist');
var version = ''; // 版本号
var versionPath = ''; // 版本号路径
var env = process.env.npm_config_qa ? 'qa' : process.env.npm_config_uat ? 'uat' : 'prod'; // 运行环境
var env = ''; // 运行环境
// 创建版本号(年月日时分)
(function () {
var d = new Date();
var yy = d.getFullYear();
var yy = d.getFullYear().toString().slice(2);
var MM = d.getMonth() + 1 >= 10 ? (d.getMonth() + 1) : '0' + (d.getMonth() + 1);
var DD = d.getDate() >= 10 ? d.getDate() : '0' + d.getDate();
var h = d.getHours() >= 10 ? d.getHours() : '0' + d.getHours();
@ -24,43 +24,43 @@ var env = process.env.npm_config_qa ? 'qa' : process.env.npm_config_uat
gulp.task('build', $.shell.task([ 'node build/build.js' ]));
// 创建版本号目录
gulp.task('create:versionCatalog', function () {
gulp.task('create:versionCatalog', ['build'], function () {
return gulp.src(`${distPath}/static/**/*`)
.pipe(gulp.dest(`${versionPath}/static/`))
});
// 替换${versionPath}/static/js/manifest.js window.SITE_CONFIG.cdnUrl占位变量
gulp.task('replace:cdnUrl', function () {
gulp.task('replace:cdnUrl', ['create:versionCatalog'], function () {
return gulp.src(`${versionPath}/static/js/manifest.js`)
.pipe($.replace(new RegExp(`"${require('./config').build.assetsPublicPath}"`, 'g'), 'window.SITE_CONFIG.cdnUrl + "/"'))
.pipe(gulp.dest(`${versionPath}/static/js/`))
});
// 替换${versionPath}/static/config/index-${env}.js window.SITE_CONFIG['version']配置变量
gulp.task('replace:version', function () {
gulp.task('replace:version', ['create:versionCatalog'], function () {
return gulp.src(`${versionPath}/static/config/index-${env}.js`)
.pipe($.replace(/window.SITE_CONFIG\['version'\] = '.*'/g, `window.SITE_CONFIG['version'] = '${version}'`))
.pipe(gulp.dest(`${versionPath}/static/config/`))
});
// 合并${versionPath}/static/config/[index-${env}, init].js 至 ${distPath}/config/index.js
gulp.task('concat:config', function () {
gulp.task('concat:config', ['replace:version'], function () {
return gulp.src([`${versionPath}/static/config/index-${env}.js`, `${versionPath}/static/config/init.js`])
.pipe($.concat('index.js'))
.pipe(gulp.dest(`${distPath}/config/`))
});
//清除, 编译 / 处理项目中产生的文件
gulp.task('cleanBuild', function () {
return del([`${distPath}/static`, `${versionPath}/static/config`])
});
// 清空
gulp.task('clean', function () {
return del([versionPath])
});
//gulp.series|4.0 依赖
//gulp.parallel|4.0 多个依赖嵌套
gulp.task('default',gulp.series(gulp.series('build','create:versionCatalog','replace:cdnUrl','replace:version','concat:config','cleanBuild')));
gulp.task('default', ['clean'], function () {
// 获取环境配置
env = process.env.npm_config_qa ? 'qa' : process.env.npm_config_uat ? 'uat' : 'prod'
// 开始打包编译
gulp.start(['build', 'create:versionCatalog', 'replace:cdnUrl', 'replace:version', 'concat:config'], function () {
// 清除, 编译 / 处理项目中产生的文件
del([`${distPath}/static`, `${versionPath}/static/config`])
})
});

View file

@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>人人快速开发平台</title>
<title>kk-Mall后台管理系统</title>
<% if (process.env.NODE_ENV === 'production') { %>
<!-- 生产环境 -->
<script>document.write('<script src="./config/index.js?t=' + new Date().getTime() + '"><\/script>');</script>
@ -22,4 +22,4 @@
<body>
<div id="app"></div>
</body>
</html>
</html>

File diff suppressed because it is too large Load diff

View file

@ -18,14 +18,16 @@
"babel-plugin-component": "0.10.1",
"babel-polyfill": "6.26.0",
"element-ui": "2.8.2",
"gulp": "4.0.2",
"gulp": "3.9.1",
"gulp-concat": "2.6.1",
"gulp-load-plugins": "2.0.5",
"gulp-replace": "1.0.0",
"gulp-shell": "0.8.0",
"gulp-load-plugins": "1.5.0",
"gulp-replace": "0.6.1",
"gulp-shell": "0.6.5",
"lodash": "4.17.5",
"node-sass": "4.13.1",
"node-sass": "^6.0.0",
"npm": "^6.9.0",
"pubsub-js": "^1.8.0",
"qs": "^6.9.4",
"sass-loader": "6.0.6",
"svg-sprite-loader": "3.7.3",
"vue": "2.5.16",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 73 KiB

BIN
renren-fast-vue/src/assets/img/login_bg.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 238 KiB

View file

@ -1,7 +1,7 @@
<template>
<div>
<el-upload
action="http://mall-kk.oss-cn-hangzhou.aliyuncs.com"
action="http://mall-fire.oss-cn-shenzhen.aliyuncs.com"
:data="dataObj"
:list-type="listType"
:file-list="fileList"

View file

@ -2,11 +2,11 @@ import http from '@/utils/httpRequest.js'
export function policy() {
return new Promise((resolve,reject)=>{
http({
url: http.adornUrl("/third/server/oss/policy"),
url: http.adornUrl("/third/party/oss/policy"),
method: "get",
params: http.adornParams({})
}).then(({ data }) => {
resolve(data);
})
});
}
}

View file

@ -1,7 +1,7 @@
<template>
<div>
<el-upload
action="http://mall-kk.oss-cn-hangzhou.aliyuncs.com"
action="http://mall-fire.oss-cn-shenzhen.aliyuncs.com"
:data="dataObj"
list-type="picture"
:multiple="false"

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

@ -55,6 +55,7 @@ import {
Col,
Upload,
Progress,
Spinner,
Badge,
Card,
Rate,
@ -72,6 +73,12 @@ import {
Aside,
Main,
Footer,
Timeline,
TimelineItem,
Link,
Divider,
Image,
Calendar,
Loading,
MessageBox,
Message,
@ -124,6 +131,7 @@ Vue.use(Row)
Vue.use(Col)
Vue.use(Upload)
Vue.use(Progress)
Vue.use(Spinner)
Vue.use(Badge)
Vue.use(Card)
Vue.use(Rate)
@ -141,6 +149,22 @@ Vue.use(Header)
Vue.use(Aside)
Vue.use(Main)
Vue.use(Footer)
Vue.use(Timeline)
Vue.use(TimelineItem)
Vue.use(Link)
Vue.use(Divider)
Vue.use(Image)
Vue.use(Calendar)
Vue.use(Loading.directive)
Vue.prototype.$loading = Loading.service
Vue.prototype.$msgbox = MessageBox
Vue.prototype.$alert = MessageBox.alert
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$prompt = MessageBox.prompt
Vue.prototype.$notify = Notification
Vue.prototype.$message = Message
Vue.use(Loading.directive)

0
renren-fast-vue/src/icons/svg/icon-admin.svg Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 965 B

After

Width:  |  Height:  |  Size: 965 B

0
renren-fast-vue/src/icons/svg/icon-config.svg Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

0
renren-fast-vue/src/icons/svg/icon-job.svg Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 811 B

After

Width:  |  Height:  |  Size: 811 B

0
renren-fast-vue/src/icons/svg/icon-log.svg Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

0
renren-fast-vue/src/icons/svg/icon-menu.svg Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 723 B

After

Width:  |  Height:  |  Size: 723 B

0
renren-fast-vue/src/icons/svg/icon-oss.svg Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

0
renren-fast-vue/src/icons/svg/icon-role.svg Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

0
renren-fast-vue/src/icons/svg/icon-sql.svg Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

0
renren-fast-vue/src/icons/svg/icon-system.svg Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View file

@ -1,20 +1,21 @@
import Vue from 'vue'
import App from '@/App'
import router from '@/router' // api: https://github.com/vuejs/vue-router
import store from '@/store' // api: https://github.com/vuejs/vuex
import VueCookie from 'vue-cookie' // api: https://github.com/alfhen/vue-cookie
import '@/element-ui' // api: https://github.com/ElemeFE/element
import '@/icons' // api: http://www.iconfont.cn/
import router from '@/router'
import store from '@/store'
import VueCookie from 'vue-cookie'
import '@/element-ui'
import '@/icons'
import '@/element-ui-theme'
import '@/assets/scss/index.scss'
import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios
import httpRequest from '@/utils/httpRequest'
import { isAuth } from '@/utils'
import cloneDeep from 'lodash/cloneDeep'
import PubSub from 'pubsub-js'
Vue.use(VueCookie)
Vue.config.productionTip = false
// 非生产环境, 适配mockjs模拟数据 // api: https://github.com/nuysoft/Mock
// 非生产环境, 适配mockjs模拟数据
if (process.env.NODE_ENV !== 'production') {
require('@/mock')
}
@ -22,6 +23,7 @@ if (process.env.NODE_ENV !== 'production') {
// 挂载全局
Vue.prototype.$http = httpRequest // ajax请求方法
Vue.prototype.isAuth = isAuth // 权限方法
Vue.prototype.PubSub = PubSub
// 保存整站vuex本地储存初始状态
window.SITE_CONFIG['storeState'] = cloneDeep(store.state)

View file

@ -36,7 +36,8 @@ const mainRoutes = {
{ path: '/home', component: _import('common/home'), name: 'home', meta: { title: '首页' } },
{ path: '/theme', component: _import('common/theme'), name: 'theme', meta: { title: '主题' } },
{ path: '/demo-echarts', component: _import('demo/echarts'), name: 'demo-echarts', meta: { title: 'demo-echarts', isTab: true } },
{ path: '/demo-ueditor', component: _import('demo/ueditor'), name: 'demo-ueditor', meta: { title: 'demo-ueditor', isTab: true } }
{ path: '/demo-ueditor', component: _import('demo/ueditor'), name: 'demo-ueditor', meta: { title: 'demo-ueditor', isTab: true } },
{ path: '/product-attrupdate', component: _import('modules/product/attrupdate'), name: 'attr-update', meta: { title: '规格维护', isTab: true } }
],
beforeEnter (to, from, next) {
let token = Vue.cookie.get('token')
@ -49,7 +50,7 @@ const mainRoutes = {
}
const router = new Router({
mode: 'hash',
mode: 'history',
scrollBehavior: () => ({ y: 0 }),
isAddDynamicMenuRoutes: false, // 是否已经添加动态(菜单)路由
routes: globalRoutes.concat(mainRoutes)
@ -148,10 +149,6 @@ function fnAddDynamicMenuRoutes (menuList = [], routes = []) {
{ path: '*', redirect: { name: '404' } }
])
sessionStorage.setItem('dynamicMenuRoutes', JSON.stringify(mainRoutes.children || '[]'))
console.log('\n')
console.log('%c!<-------------------- 动态(菜单)路由 s -------------------->', 'color:blue')
console.log(mainRoutes.children)
console.log('%c!<-------------------- 动态(菜单)路由 e -------------------->', 'color:blue')
}
}

View file

@ -16,8 +16,8 @@ export function getUUID () {
* @param {*} key
*/
export function isAuth (key) {
//return JSON.parse(sessionStorage.getItem('permissions') || '[]').indexOf(key) !== -1 || false
return true;
// return JSON.parse(sessionStorage.getItem('permissions') || '[]').indexOf(key) !== -1 || false
return true
}
/**

View file

@ -1,27 +1,28 @@
<template>
<div class="mod-home">
<h3>项目介绍</h3>
<h3>Mall</h3>
<ul>
<li>renren-fast-vue基于vueelement-ui构建开发实现<a href="https://gitee.com/renrenio/renren-fast" target="_blank">renren-fast</a>后台管理前端功能提供一套更优的前端解决方案</li>
<li>kk-Mall在线文档<a href="https://easydoc.xyz/doc/75716633/ZUqEdvA4/FTx6LRbR" target="_blank">Mall.doc</a></li>
<li>前后端分离通过token进行数据交互可独立部署</li>
<li>主题定制通过scss变量统一一站式定制</li>
<li>动态菜单通过菜单管理统一管理访问路由</li>
<li>数据切换通过mock配置对接口数据mock模拟数据进行切换</li>
<li>发布时可动态配置CDN静态资源切换新旧版本</li>
<li>演示地址<a href="http://demo.open.renren.io/renren-fast" target="_blank">http://demo.open.renren.io/renren-fast</a> (admin/admin)</li>
<li>演示地址<a href="http://kk-Mall.top:8080/mall" target="_blank">http://KirkLin.top/mall</a> (admin/admin)</li>
</ul>
<h3>获取帮助</h3>
<h3 target="_blank">读已提交SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;</h3>
<ul>
<li>官方社区<a href="https://www.renren.io/community" target="_blank">https://www.renren.io/community</a></li>
<li>前端Git地址<a href="https://github.com/renrenio/renren-fast-vue" target="_blank">https://github.com/renrenio/renren-fast-vue</a></li>
<li>后台Git地址<a href="https://gitee.com/renrenio/renren-fast" target="_blank">https://gitee.com/renrenio/renren-fast</a></li>
<li>代码生成器<a href="https://gitee.com/renrenio/renren-generator" target="_blank">https://gitee.com/renrenio/renren-generator</a></li>
<li>如需关注项目最新动态请WatchStar项目同时也是对项目最好的支持</li>
<li>项目Git地址<a href="https://github.com/" target="_blank">https://github.com/</a></li>
<li>代码生成器<a href="http://127.0.0.1:81/" target="_blank">KK-MAll_CODE</a></li>
</ul>
<h3>官方QQ群</h3>
<h3>ES安装</h3>
<h5><a href="https://raw.githubusercontent.com/elastic/elasticsearch/master/docs/src/test/resources/accounts.json">ElasticSearch测试文档[开启科学上网]</a></h5>
<ul>
<li>高级群324780204(大牛云集跟大牛学习新技能)</li>
<li>普通群145799952(学习交流互相解答各种疑问)</li>
<li>mkdir -p /mydocker/mall/elasticsearch/config</li>
<li>mkdir -p /mydocker/mall/elasticsearch/data</li>
<li>mkdir -p /mydocker/mall/elasticsearch/plugins</li>
<li>echo "http.host: 0.0.0.0" >> /mydocker/mall/elasticsearch/config/elasticsearch.yml</li>
<li>chmod -R 777 /mydocker/mall/elasticsearch/</li>
</ul>
</div>
</template>

View file

@ -3,12 +3,18 @@
<div class="site-content__wrapper">
<div class="site-content">
<div class="brand-info">
<h2 class="brand-info__text">renren-fast-vue</h2>
<p class="brand-info__intro">renren-fast-vue基于vueelement-ui构建开发实现renren-fast后台管理前端功能提供一套更优的前端解决方案</p>
<h2 class="brand-info__text">kk-Mall</h2>
<p class="brand-info__intro">kk-Mall基于vueelement-ui构建开发</p>
</div>
<div class="login-main">
<h3 class="login-title">管理员登录</h3>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" status-icon>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
status-icon
>
<el-form-item prop="userName">
<el-input v-model="dataForm.userName" placeholder="帐号"></el-input>
</el-form-item>
@ -18,11 +24,10 @@
<el-form-item prop="captcha">
<el-row :gutter="20">
<el-col :span="14">
<el-input v-model="dataForm.captcha" placeholder="验证码">
</el-input>
<el-input v-model="dataForm.captcha" placeholder="验证码"></el-input>
</el-col>
<el-col :span="10" class="login-captcha">
<img :src="captchaPath" @click="getCaptcha()" alt="">
<img :src="captchaPath" @click="getCaptcha()" alt />
</el-col>
</el-row>
</el-form-item>
@ -37,142 +42,144 @@
</template>
<script>
import { getUUID } from '@/utils'
export default {
data () {
return {
dataForm: {
userName: '',
password: '',
uuid: '',
captcha: ''
},
dataRule: {
userName: [
{ required: true, message: '帐号不能为空', trigger: 'blur' }
],
password: [
{ required: true, message: '密码不能为空', trigger: 'blur' }
],
captcha: [
{ required: true, message: '验证码不能为空', trigger: 'blur' }
]
},
captchaPath: ''
}
},
created () {
this.getCaptcha()
},
methods: {
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl('/sys/login'),
method: 'post',
data: this.$http.adornData({
'username': this.dataForm.userName,
'password': this.dataForm.password,
'uuid': this.dataForm.uuid,
'captcha': this.dataForm.captcha
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$cookie.set('token', data.token)
this.$router.replace({ name: 'home' })
} else {
this.getCaptcha()
this.$message.error(data.msg)
}
})
}
})
import { getUUID } from "@/utils";
export default {
data() {
return {
dataForm: {
userName: "",
password: "",
uuid: "",
captcha: ""
},
//
getCaptcha () {
this.dataForm.uuid = getUUID()
this.captchaPath = this.$http.adornUrl(`/captcha.jpg?uuid=${this.dataForm.uuid}`)
}
dataRule: {
userName: [
{ required: true, message: "帐号不能为空", trigger: "blur" }
],
password: [
{ required: true, message: "密码不能为空", trigger: "blur" }
],
captcha: [
{ required: true, message: "验证码不能为空", trigger: "blur" }
]
},
captchaPath: ""
};
},
created() {
this.getCaptcha();
},
methods: {
//
dataFormSubmit() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
this.$http({
url: this.$http.adornUrl("/sys/login"),
method: "post",
data: this.$http.adornData({
username: this.dataForm.userName,
password: this.dataForm.password,
uuid: this.dataForm.uuid,
captcha: this.dataForm.captcha
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.$cookie.set("token", data.token);
this.$router.replace({ name: "home" });
} else {
this.getCaptcha();
this.$message.error(data.msg);
}
});
}
});
},
//
getCaptcha() {
this.dataForm.uuid = getUUID();
this.captchaPath = this.$http.adornUrl(
`/captcha.jpg?uuid=${this.dataForm.uuid}`
);
}
}
};
</script>
<style lang="scss">
.site-wrapper.site-page--login {
.site-wrapper.site-page--login {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(38, 50, 56, 0.6);
overflow: hidden;
&:before {
position: fixed;
top: 0;
left: 0;
z-index: -1;
width: 100%;
height: 100%;
content: "";
background-image: url(~@/assets/img/login_bg.jpg);
background-size: cover;
}
.site-content__wrapper {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(38, 50, 56, .6);
padding: 0;
margin: 0;
overflow-x: hidden;
overflow-y: auto;
background-color: transparent;
}
.site-content {
min-height: 100%;
padding: 30px 500px 30px 30px;
}
.brand-info {
margin: 220px 100px 0 90px;
color: #fff;
}
.brand-info__text {
margin: 0 0 22px 0;
font-size: 48px;
font-weight: 400;
text-transform: uppercase;
}
.brand-info__intro {
margin: 10px 0;
font-size: 16px;
line-height: 1.58;
opacity: 0.6;
}
.login-main {
position: absolute;
top: 0;
right: 0;
padding: 150px 60px 180px;
width: 470px;
min-height: 100%;
background-color: #fff;
}
.login-title {
font-size: 16px;
}
.login-captcha {
overflow: hidden;
&:before {
position: fixed;
top: 0;
left: 0;
z-index: -1;
> img {
width: 100%;
height: 100%;
content: "";
background-image: url(~@/assets/img/login_bg.jpg);
background-size: cover;
}
.site-content__wrapper {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding: 0;
margin: 0;
overflow-x: hidden;
overflow-y: auto;
background-color: transparent;
}
.site-content {
min-height: 100%;
padding: 30px 500px 30px 30px;
}
.brand-info {
margin: 220px 100px 0 90px;
color: #fff;
}
.brand-info__text {
margin: 0 0 22px 0;
font-size: 48px;
font-weight: 400;
text-transform : uppercase;
}
.brand-info__intro {
margin: 10px 0;
font-size: 16px;
line-height: 1.58;
opacity: .6;
}
.login-main {
position: absolute;
top: 0;
right: 0;
padding: 150px 60px 180px;
width: 470px;
min-height: 100%;
background-color: #fff;
}
.login-title {
font-size: 16px;
}
.login-captcha {
overflow: hidden;
> img {
width: 100%;
cursor: pointer;
}
}
.login-btn-submit {
width: 100%;
margin-top: 38px;
cursor: pointer;
}
}
.login-btn-submit {
width: 100%;
margin-top: 38px;
}
}
</style>

View file

@ -1,11 +1,10 @@
<template>
<div class="mod-demo-echarts">
<el-alert
title="提示:"
type="warning"
:closable="false">
<el-alert title="提示:" type="warning" :closable="false">
<div slot-scope="description">
<p class="el-alert__description">1. 此Demo只提供ECharts官方使用文档入门部署和体验功能具体使用请参考http://echarts.baidu.com/index.html</p>
<p
class="el-alert__description"
>1. 此Demo只提供ECharts官方使用文档入门部署和体验功能具体使用请参考https://github.com/</p>
</div>
</el-alert>
@ -35,438 +34,450 @@
</template>
<script>
import echarts from 'echarts'
export default {
data () {
return {
chartLine: null,
chartBar: null,
chartPie: null,
chartScatter: null
}
import echarts from "echarts";
export default {
data() {
return {
chartLine: null,
chartBar: null,
chartPie: null,
chartScatter: null
};
},
mounted() {
this.initChartLine();
this.initChartBar();
this.initChartPie();
this.initChartScatter();
},
activated() {
// echartresize, resize, bug
if (this.chartLine) {
this.chartLine.resize();
}
if (this.chartBar) {
this.chartBar.resize();
}
if (this.chartPie) {
this.chartPie.resize();
}
if (this.chartScatter) {
this.chartScatter.resize();
}
},
methods: {
// 线
initChartLine() {
var option = {
title: {
text: "折线图堆叠"
},
tooltip: {
trigger: "axis"
},
legend: {
data: ["邮件营销", "联盟广告", "视频广告", "直接访问", "搜索引擎"]
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: "category",
boundaryGap: false,
data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]
},
yAxis: {
type: "value"
},
series: [
{
name: "邮件营销",
type: "line",
stack: "总量",
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: "联盟广告",
type: "line",
stack: "总量",
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: "视频广告",
type: "line",
stack: "总量",
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: "直接访问",
type: "line",
stack: "总量",
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: "搜索引擎",
type: "line",
stack: "总量",
data: [820, 932, 901, 934, 1290, 1330, 1320]
}
]
};
this.chartLine = echarts.init(document.getElementById("J_chartLineBox"));
this.chartLine.setOption(option);
window.addEventListener("resize", () => {
this.chartLine.resize();
});
},
mounted () {
this.initChartLine()
this.initChartBar()
this.initChartPie()
this.initChartScatter()
},
activated () {
// echartresize, resize, bug
if (this.chartLine) {
this.chartLine.resize()
}
if (this.chartBar) {
this.chartBar.resize()
}
if (this.chartPie) {
this.chartPie.resize()
}
if (this.chartScatter) {
this.chartScatter.resize()
}
},
methods: {
// 线
initChartLine () {
var option = {
'title': {
'text': '折线图堆叠'
},
'tooltip': {
'trigger': 'axis'
},
'legend': {
'data': [ '邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎' ]
},
'grid': {
'left': '3%',
'right': '4%',
'bottom': '3%',
'containLabel': true
},
'toolbox': {
'feature': {
'saveAsImage': { }
}
},
'xAxis': {
'type': 'category',
'boundaryGap': false,
'data': [ '周一', '周二', '周三', '周四', '周五', '周六', '周日' ]
},
'yAxis': {
'type': 'value'
},
'series': [
{
'name': '邮件营销',
'type': 'line',
'stack': '总量',
'data': [ 120, 132, 101, 134, 90, 230, 210 ]
},
{
'name': '联盟广告',
'type': 'line',
'stack': '总量',
'data': [ 220, 182, 191, 234, 290, 330, 310 ]
},
{
'name': '视频广告',
'type': 'line',
'stack': '总量',
'data': [ 150, 232, 201, 154, 190, 330, 410 ]
},
{
'name': '直接访问',
'type': 'line',
'stack': '总量',
'data': [ 320, 332, 301, 334, 390, 330, 320 ]
},
{
'name': '搜索引擎',
'type': 'line',
'stack': '总量',
'data': [ 820, 932, 901, 934, 1290, 1330, 1320 ]
}
//
initChartBar() {
var option = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow"
}
},
legend: {
data: [
"直接访问",
"邮件营销",
"联盟广告",
"视频广告",
"搜索引擎",
"百度",
"谷歌",
"必应",
"其他"
]
}
this.chartLine = echarts.init(document.getElementById('J_chartLineBox'))
this.chartLine.setOption(option)
window.addEventListener('resize', () => {
this.chartLine.resize()
})
},
//
initChartBar () {
var option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
xAxis: [
{
type: "category",
data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]
}
],
yAxis: [
{
type: "value"
}
],
series: [
{
name: "直接访问",
type: "bar",
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: "邮件营销",
type: "bar",
stack: "广告",
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: "联盟广告",
type: "bar",
stack: "广告",
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: "视频广告",
type: "bar",
stack: "广告",
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: "搜索引擎",
type: "bar",
data: [862, 1018, 964, 1026, 1679, 1600, 1570],
markLine: {
lineStyle: {
normal: {
type: "dashed"
}
},
data: [[{ type: "min" }, { type: "max" }]]
}
},
legend: {
data: ['直接访问', '邮件营销', '联盟广告', '视频广告', '搜索引擎', '百度', '谷歌', '必应', '其他']
{
name: "百度",
type: "bar",
barWidth: 5,
stack: "搜索引擎",
data: [620, 732, 701, 734, 1090, 1130, 1120]
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
{
name: "谷歌",
type: "bar",
stack: "搜索引擎",
data: [120, 132, 101, 134, 290, 230, 220]
},
xAxis: [
{
type: 'category',
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: '直接访问',
type: 'bar',
data: [320, 332, 301, 334, 390, 330, 320]
{
name: "必应",
type: "bar",
stack: "搜索引擎",
data: [60, 72, 71, 74, 190, 130, 110]
},
{
name: "其他",
type: "bar",
stack: "搜索引擎",
data: [62, 82, 91, 84, 109, 110, 120]
}
]
};
this.chartBar = echarts.init(document.getElementById("J_chartBarBox"));
this.chartBar.setOption(option);
window.addEventListener("resize", () => {
this.chartBar.resize();
});
},
//
initChartPie() {
var option = {
backgroundColor: "#2c343c",
title: {
text: "Customized Pie",
left: "center",
top: 20,
textStyle: {
color: "#ccc"
}
},
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
visualMap: {
show: false,
min: 80,
max: 600,
inRange: {
colorLightness: [0, 1]
}
},
series: [
{
name: "访问来源",
type: "pie",
radius: "55%",
center: ["50%", "50%"],
data: [
{ value: 335, name: "直接访问" },
{ value: 310, name: "邮件营销" },
{ value: 274, name: "联盟广告" },
{ value: 235, name: "视频广告" },
{ value: 400, name: "搜索引擎" }
].sort(function(a, b) {
return a.value - b.value;
}),
roseType: "radius",
label: {
normal: {
textStyle: {
color: "rgba(255, 255, 255, 0.3)"
}
}
},
{
name: '邮件营销',
type: 'bar',
stack: '广告',
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: '联盟广告',
type: 'bar',
stack: '广告',
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: '视频广告',
type: 'bar',
stack: '广告',
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: '搜索引擎',
type: 'bar',
data: [862, 1018, 964, 1026, 1679, 1600, 1570],
markLine: {
labelLine: {
normal: {
lineStyle: {
normal: {
type: 'dashed'
}
color: "rgba(255, 255, 255, 0.3)"
},
data: [
[{ type: 'min' }, { type: 'max' }]
]
smooth: 0.2,
length: 10,
length2: 20
}
},
{
name: '百度',
type: 'bar',
barWidth: 5,
stack: '搜索引擎',
data: [620, 732, 701, 734, 1090, 1130, 1120]
},
{
name: '谷歌',
type: 'bar',
stack: '搜索引擎',
data: [120, 132, 101, 134, 290, 230, 220]
},
{
name: '必应',
type: 'bar',
stack: '搜索引擎',
data: [60, 72, 71, 74, 190, 130, 110]
},
{
name: '其他',
type: 'bar',
stack: '搜索引擎',
data: [62, 82, 91, 84, 109, 110, 120]
}
]
}
this.chartBar = echarts.init(document.getElementById('J_chartBarBox'))
this.chartBar.setOption(option)
window.addEventListener('resize', () => {
this.chartBar.resize()
})
},
//
initChartPie () {
var option = {
backgroundColor: '#2c343c',
title: {
text: 'Customized Pie',
left: 'center',
top: 20,
textStyle: {
color: '#ccc'
}
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
visualMap: {
show: false,
min: 80,
max: 600,
inRange: {
colorLightness: [0, 1]
}
},
series: [
{
name: '访问来源',
type: 'pie',
radius: '55%',
center: ['50%', '50%'],
data: [
{ value: 335, name: '直接访问' },
{ value: 310, name: '邮件营销' },
{ value: 274, name: '联盟广告' },
{ value: 235, name: '视频广告' },
{ value: 400, name: '搜索引擎' }
].sort(function (a, b) { return a.value - b.value }),
roseType: 'radius',
label: {
normal: {
textStyle: {
color: 'rgba(255, 255, 255, 0.3)'
}
}
},
labelLine: {
normal: {
lineStyle: {
color: 'rgba(255, 255, 255, 0.3)'
},
smooth: 0.2,
length: 10,
length2: 20
}
},
itemStyle: {
normal: {
color: '#c23531',
shadowBlur: 200,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
},
animationType: 'scale',
animationEasing: 'elasticOut',
animationDelay: function (idx) {
return Math.random() * 200
itemStyle: {
normal: {
color: "#c23531",
shadowBlur: 200,
shadowColor: "rgba(0, 0, 0, 0.5)"
}
},
animationType: "scale",
animationEasing: "elasticOut",
animationDelay: function(idx) {
return Math.random() * 200;
}
}
]
};
this.chartPie = echarts.init(document.getElementById("J_chartPieBox"));
this.chartPie.setOption(option);
window.addEventListener("resize", () => {
this.chartPie.resize();
});
},
//
initChartScatter() {
var option = {
backgroundColor: new echarts.graphic.RadialGradient(0.3, 0.3, 0.8, [
{ offset: 0, color: "#f7f8fa" },
{ offset: 1, color: "#cdd0d5" }
]),
title: {
text: "2000 与 2020 年各国家人均寿命与 GDP"
},
legend: {
right: 10,
data: ["2000", "2020"]
},
xAxis: {
splitLine: {
lineStyle: {
type: "dashed"
}
}
},
yAxis: {
splitLine: {
lineStyle: {
type: "dashed"
}
]
}
this.chartPie = echarts.init(document.getElementById('J_chartPieBox'))
this.chartPie.setOption(option)
window.addEventListener('resize', () => {
this.chartPie.resize()
})
},
//
initChartScatter () {
var option = {
backgroundColor: new echarts.graphic.RadialGradient(0.3, 0.3, 0.8, [
{ offset: 0, color: '#f7f8fa' },
{ offset: 1, color: '#cdd0d5' }
]),
title: {
text: '1990 与 2015 年各国家人均寿命与 GDP'
},
legend: {
right: 10,
data: ['1990', '2015']
},
xAxis: {
splitLine: {
lineStyle: {
type: 'dashed'
scale: true
},
series: [
{
name: "2000",
data: [
[28604, 77, 17096869, "Australia", 1990],
[31163, 77.4, 27662440, "Canada", 1990],
[1516, 68, 1154605773, "China", 1990],
[13670, 74.7, 10582082, "Cuba", 1990],
[28599, 75, 4986705, "Finland", 1990],
[29476, 77.1, 56943299, "France", 1990],
[31476, 75.4, 78958237, "Germany", 1990],
[28666, 78.1, 254830, "Iceland", 1990],
[1777, 57.7, 870601776, "India", 1990],
[29550, 79.1, 122249285, "Japan", 1990],
[2076, 67.9, 20194354, "North Korea", 1990],
[12087, 72, 42972254, "South Korea", 1990],
[24021, 75.4, 3397534, "New Zealand", 1990],
[43296, 76.8, 4240375, "Norway", 1990],
[10088, 70.8, 38195258, "Poland", 1990],
[19349, 69.6, 147568552, "Russia", 1990],
[10670, 67.3, 53994605, "Turkey", 1990],
[26424, 75.7, 57110117, "United Kingdom", 1990],
[37062, 75.4, 252847810, "United States", 1990]
],
type: "scatter",
symbolSize: function(data) {
return Math.sqrt(data[2]) / 5e2;
},
label: {
emphasis: {
show: true,
formatter: function(param) {
return param.data[3];
},
position: "top"
}
},
itemStyle: {
normal: {
shadowBlur: 10,
shadowColor: "rgba(120, 36, 50, 0.5)",
shadowOffsetY: 5,
color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [
{ offset: 0, color: "rgb(251, 118, 123)" },
{ offset: 1, color: "rgb(204, 46, 72)" }
])
}
}
},
yAxis: {
splitLine: {
lineStyle: {
type: 'dashed'
{
name: "2020",
data: [
[44056, 81.8, 23968973, "Australia", 2015],
[43294, 81.7, 35939927, "Canada", 2015],
[13334, 76.9, 1376048943, "China", 2015],
[21291, 78.5, 11389562, "Cuba", 2015],
[38923, 80.8, 5503457, "Finland", 2015],
[37599, 81.9, 64395345, "France", 2015],
[44053, 81.1, 80688545, "Germany", 2015],
[42182, 82.8, 329425, "Iceland", 2015],
[5903, 66.8, 1311050527, "India", 2015],
[36162, 83.5, 126573481, "Japan", 2015],
[1390, 71.4, 25155317, "North Korea", 2015],
[34644, 80.7, 50293439, "South Korea", 2015],
[34186, 80.6, 4528526, "New Zealand", 2015],
[64304, 81.6, 5210967, "Norway", 2015],
[24787, 77.3, 38611794, "Poland", 2015],
[23038, 73.13, 143456918, "Russia", 2015],
[19360, 76.5, 78665830, "Turkey", 2015],
[38225, 81.4, 64715810, "United Kingdom", 2015],
[53354, 79.1, 321773631, "United States", 2015]
],
type: "scatter",
symbolSize: function(data) {
return Math.sqrt(data[2]) / 5e2;
},
label: {
emphasis: {
show: true,
formatter: function(param) {
return param.data[3];
},
position: "top"
}
},
scale: true
},
series: [
{
name: '1990',
data: [
[28604, 77, 17096869, 'Australia', 1990],
[31163, 77.4, 27662440, 'Canada', 1990],
[1516, 68, 1154605773, 'China', 1990],
[13670, 74.7, 10582082, 'Cuba', 1990],
[28599, 75, 4986705, 'Finland', 1990],
[29476, 77.1, 56943299, 'France', 1990],
[31476, 75.4, 78958237, 'Germany', 1990],
[28666, 78.1, 254830, 'Iceland', 1990],
[1777, 57.7, 870601776, 'India', 1990],
[29550, 79.1, 122249285, 'Japan', 1990],
[2076, 67.9, 20194354, 'North Korea', 1990],
[12087, 72, 42972254, 'South Korea', 1990],
[24021, 75.4, 3397534, 'New Zealand', 1990],
[43296, 76.8, 4240375, 'Norway', 1990],
[10088, 70.8, 38195258, 'Poland', 1990],
[19349, 69.6, 147568552, 'Russia', 1990],
[10670, 67.3, 53994605, 'Turkey', 1990],
[26424, 75.7, 57110117, 'United Kingdom', 1990],
[37062, 75.4, 252847810, 'United States', 1990]
],
type: 'scatter',
symbolSize: function (data) {
return Math.sqrt(data[2]) / 5e2
},
label: {
emphasis: {
show: true,
formatter: function (param) {
return param.data[3]
},
position: 'top'
}
},
itemStyle: {
normal: {
shadowBlur: 10,
shadowColor: 'rgba(120, 36, 50, 0.5)',
shadowOffsetY: 5,
color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [
{ offset: 0, color: 'rgb(251, 118, 123)' },
{ offset: 1, color: 'rgb(204, 46, 72)' }
])
}
}
},
{
name: '2015',
data: [
[44056, 81.8, 23968973, 'Australia', 2015],
[43294, 81.7, 35939927, 'Canada', 2015],
[13334, 76.9, 1376048943, 'China', 2015],
[21291, 78.5, 11389562, 'Cuba', 2015],
[38923, 80.8, 5503457, 'Finland', 2015],
[37599, 81.9, 64395345, 'France', 2015],
[44053, 81.1, 80688545, 'Germany', 2015],
[42182, 82.8, 329425, 'Iceland', 2015],
[5903, 66.8, 1311050527, 'India', 2015],
[36162, 83.5, 126573481, 'Japan', 2015],
[1390, 71.4, 25155317, 'North Korea', 2015],
[34644, 80.7, 50293439, 'South Korea', 2015],
[34186, 80.6, 4528526, 'New Zealand', 2015],
[64304, 81.6, 5210967, 'Norway', 2015],
[24787, 77.3, 38611794, 'Poland', 2015],
[23038, 73.13, 143456918, 'Russia', 2015],
[19360, 76.5, 78665830, 'Turkey', 2015],
[38225, 81.4, 64715810, 'United Kingdom', 2015],
[53354, 79.1, 321773631, 'United States', 2015]
],
type: 'scatter',
symbolSize: function (data) {
return Math.sqrt(data[2]) / 5e2
},
label: {
emphasis: {
show: true,
formatter: function (param) {
return param.data[3]
},
position: 'top'
}
},
itemStyle: {
normal: {
shadowBlur: 10,
shadowColor: 'rgba(25, 100, 150, 0.5)',
shadowOffsetY: 5,
color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [
{ offset: 0, color: 'rgb(129, 227, 238)' },
{ offset: 1, color: 'rgb(25, 183, 207)' }
])
}
itemStyle: {
normal: {
shadowBlur: 10,
shadowColor: "rgba(25, 100, 150, 0.5)",
shadowOffsetY: 5,
color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [
{ offset: 0, color: "rgb(129, 227, 238)" },
{ offset: 1, color: "rgb(25, 183, 207)" }
])
}
}
]
}
this.chartPie = echarts.init(document.getElementById('J_chartScatterBox'))
this.chartPie.setOption(option)
window.addEventListener('resize', () => {
this.chartPie.resize()
})
}
}
]
};
this.chartPie = echarts.init(
document.getElementById("J_chartScatterBox")
);
this.chartPie.setOption(option);
window.addEventListener("resize", () => {
this.chartPie.resize();
});
}
}
};
</script>
<style lang="scss">
.mod-demo-echarts {
> .el-alert {
margin-bottom: 10px;
}
> .el-row {
margin-top: -10px;
margin-bottom: -10px;
.el-col {
padding-top: 10px;
padding-bottom: 10px;
}
}
.chart-box {
min-height: 400px;
.mod-demo-echarts {
> .el-alert {
margin-bottom: 10px;
}
> .el-row {
margin-top: -10px;
margin-bottom: -10px;
.el-col {
padding-top: 10px;
padding-bottom: 10px;
}
}
.chart-box {
min-height: 400px;
}
}
</style>

View file

@ -5,13 +5,12 @@
type="warning"
:closable="false">
<div slot-scope="description">
<p class="el-alert__description">1. 此Demo只提供UEditor官方使用文档入门部署和体验功能具体使用请参考http://fex.baidu.com/ueditor/</p>
<p class="el-alert__description">2. 浏览器控制台报错请求后台配置项http错误上传功能将不能正常使用此错需要后台提供上传接口方法赋值给serverUrl属性</p>
<p class="el-alert__description">1. 此Demo只提供UEditor官方使用文档入门部署和体验功能具体使用请参考https://github.com//</p>
</div>
</el-alert>
<script :id="ueId" class="ueditor-box" type="text/plain" style="width: 100%; height: 260px;">hello world!</script>
<script :id="ueId" class="ueditor-box" type="text/plain" style="width: 100%; height: 260px;">kk-Mall!</script>
<!-- 获取内容 -->
<p><el-button @click="getContent()">获得内容</el-button></p>
<el-dialog

View file

@ -2,8 +2,8 @@
<nav class="site-navbar" :class="'site-navbar--' + navbarLayoutType">
<div class="site-navbar__header">
<h1 class="site-navbar__brand" @click="$router.push({ name: 'home' })">
<a class="site-navbar__brand-lg" href="javascript:;">人人快速开发平台</a>
<a class="site-navbar__brand-mini" href="javascript:;">人人</a>
<a class="site-navbar__brand-lg" href="javascript:;">kk-Mall后台管理</a>
<a class="site-navbar__brand-mini" href="javascript:;">firefly</a>
</h1>
</div>
<div class="site-navbar__body clearfix">
@ -24,16 +24,11 @@
</el-badge>
</template>
</el-menu-item>
<el-menu-item index="2">
<el-badge value="hot">
<a href="https://www.renren.io/" target="_blank">官方社区</a>
</el-badge>
</el-menu-item>
<el-submenu index="3">
<el-submenu index="3" >
<template slot="title">Git源码</template>
<el-menu-item index="2-1"><a href="https://github.com/renrenio/renren-fast-vue" target="_blank">前端</a></el-menu-item>
<el-menu-item index="2-2"><a href="https://gitee.com/renrenio/renren-fast" target="_blank">后台</a></el-menu-item>
<el-menu-item index="2-3"><a href="https://gitee.com/renrenio/renren-generator" target="_blank">代码生成器</a></el-menu-item>
<el-menu-item value="hot" index="2-1"><a href="https://github.com/" target="_blank">前端</a></el-menu-item>
<el-menu-item index="2-3"><a href="http://127.0.0.1:81/" target="_blank">代码生成器</a></el-menu-item>
</el-submenu>
<el-menu-item class="site-navbar__avatar" index="3">
<el-dropdown :show-timeout="0" placement="bottom">

View file

@ -3,7 +3,8 @@
class="site-wrapper"
:class="{ 'site-sidebar--fold': sidebarFold }"
v-loading.fullscreen.lock="loading"
element-loading-text="拼命加载中">
element-loading-text="拼命加载中"
>
<template v-if="!loading">
<main-navbar />
<main-sidebar />
@ -15,76 +16,90 @@
</template>
<script>
import MainNavbar from './main-navbar'
import MainSidebar from './main-sidebar'
import MainContent from './main-content'
export default {
provide () {
return {
//
refresh () {
this.$store.commit('common/updateContentIsNeedRefresh', true)
this.$nextTick(() => {
this.$store.commit('common/updateContentIsNeedRefresh', false)
})
}
import MainNavbar from "./main-navbar";
import MainSidebar from "./main-sidebar";
import MainContent from "./main-content";
export default {
provide() {
return {
//
refresh() {
this.$store.commit("common/updateContentIsNeedRefresh", true);
this.$nextTick(() => {
this.$store.commit("common/updateContentIsNeedRefresh", false);
});
}
};
},
data() {
return {
loading: true
};
},
components: {
MainNavbar,
MainSidebar,
MainContent
},
computed: {
documentClientHeight: {
get() {
return this.$store.state.common.documentClientHeight;
},
set(val) {
this.$store.commit("common/updateDocumentClientHeight", val);
}
},
data () {
return {
loading: true
sidebarFold: {
get() {
return this.$store.state.common.sidebarFold;
}
},
components: {
MainNavbar,
MainSidebar,
MainContent
},
computed: {
documentClientHeight: {
get () { return this.$store.state.common.documentClientHeight },
set (val) { this.$store.commit('common/updateDocumentClientHeight', val) }
userId: {
get() {
return this.$store.state.user.id;
},
sidebarFold: {
get () { return this.$store.state.common.sidebarFold }
},
userId: {
get () { return this.$store.state.user.id },
set (val) { this.$store.commit('user/updateId', val) }
},
userName: {
get () { return this.$store.state.user.name },
set (val) { this.$store.commit('user/updateName', val) }
set(val) {
this.$store.commit("user/updateId", val);
}
},
created () {
this.getUserInfo()
},
mounted () {
this.resetDocumentClientHeight()
},
methods: {
//
resetDocumentClientHeight () {
this.documentClientHeight = document.documentElement['clientHeight']
window.onresize = () => {
this.documentClientHeight = document.documentElement['clientHeight']
}
userName: {
get() {
return this.$store.state.user.name;
},
//
getUserInfo () {
this.$http({
url: this.$http.adornUrl('/sys/user/info'),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.loading = false
this.userId = data.user.userId
this.userName = data.user.username
}
})
set(val) {
this.$store.commit("user/updateName", val);
}
}
},
created() {
this.getUserInfo();
},
mounted() {
this.resetDocumentClientHeight();
},
methods: {
//
resetDocumentClientHeight() {
this.documentClientHeight = document.documentElement["clientHeight"];
window.onresize = () => {
this.documentClientHeight = document.documentElement["clientHeight"];
};
},
//
getUserInfo() {
this.$http({
url: this.$http.adornUrl("/sys/user/info"),
method: "get",
params: this.$http.adornParams()
}).then(({ data }) => {
if (data && data.code === 0) {
this.loading = false;
this.userId = data.user.userId;
this.userName = data.user.username;
}
});
}
}
};
</script>

View file

@ -13,7 +13,7 @@
<script>
//jsjsjson
//import  from '';
//import from '';
export default {
//import使
@ -33,7 +33,7 @@ export default {
subscribe: null
};
},
// data
// data
computed: {},
//data
watch: {
@ -55,9 +55,9 @@ export default {
});
}
},
// - 访this
// - 访this
created() {},
// - 访DOM
// - 访DOM
mounted() {
//
this.subscribe = PubSub.subscribe("catPath", (msg, val) => {
@ -65,16 +65,16 @@ export default {
this.getCatBrands();
});
},
beforeCreate() {}, // - 
beforeMount() {}, // - 
beforeUpdate() {}, // - 
updated() {}, // - 
beforeCreate() {}, // -
beforeMount() {}, // -
beforeUpdate() {}, // -
updated() {}, // -
beforeDestroy() {
PubSub.unsubscribe(this.subscribe); //
}, // - 
destroyed() {}, // - 
}, // -
destroyed() {}, // -
activated() {} //keep-alive
};
</script>
<style scoped>
</style>
<style scoped>
</style>

View file

@ -1,5 +1,5 @@
<template>
<!--
<!--
使用说明
1引入category-cascader.vue
2语法<category-cascader :catelogPath.sync="catelogPath"></category-cascader>
@ -10,7 +10,7 @@
<div>
<el-cascader
filterable
clearable
clearable
placeholder="试试搜索:手机"
v-model="paths"
:options="categorys"
@ -66,11 +66,11 @@ export default {
});
}
},
// - 访this
// - 访this
created() {
this.getCategorys();
}
};
</script>
<style scoped>
</style>
<style scoped>
</style>

View file

@ -31,7 +31,7 @@ export default {
}
};
},
// data
// data
computed: {},
//data
watch: {
@ -60,21 +60,21 @@ export default {
this.$emit("tree-node-click", data, node, component);
}
},
// - 访this
// - 访this
created() {
this.getMenus();
},
// - 访DOM
// - 访DOM
mounted() {},
beforeCreate() {}, // - 
beforeMount() {}, // - 
beforeUpdate() {}, // - 
updated() {}, // - 
beforeDestroy() {}, // - 
destroyed() {}, // - 
beforeCreate() {}, // -
beforeMount() {}, // -
beforeUpdate() {}, // -
updated() {}, // -
beforeDestroy() {}, // -
destroyed() {}, // -
activated() {} //keep-alive
};
</script>
<style scoped>
<style scoped>
</style>
</style>

View file

@ -0,0 +1,182 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('coupon:spubounds:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('coupon:spubounds:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="spuId"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="growBounds"
header-align="center"
align="center"
label="成长积分">
</el-table-column>
<el-table-column
prop="buyBounds"
header-align="center"
align="center"
label="购物积分">
</el-table-column>
<el-table-column
prop="work"
header-align="center"
align="center"
label="优惠生效情况">
<!-- [1111四个状态位从右到左;0 - 无优惠成长积分是否赠送;1 - 无优惠购物积分是否赠送;2 - 有优惠成长积分是否赠送;3 - 有优惠购物积分是否赠送状态位0不赠送1赠送] -->
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './spubounds-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/spubounds/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/spubounds/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View file

@ -0,0 +1,292 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="120px"
>
<el-form-item label="优惠卷类型" prop="couponType">
<el-select v-model="dataForm.couponType" placeholder="请选择">
<el-option label="全场赠券" :value="0"></el-option>
<el-option label="会员赠券" :value="1"></el-option>
<el-option label="购物赠券" :value="2"></el-option>
<el-option label="注册赠券" :value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="优惠券图片" prop="couponImg">
<single-upload v-model="dataForm.couponImg"></single-upload>
</el-form-item>
<el-form-item label="优惠卷名字" prop="couponName">
<el-input v-model="dataForm.couponName" placeholder="优惠卷名字"></el-input>
</el-form-item>
<el-form-item label="数量" prop="num">
<el-input-number :min="0" v-model="dataForm.num"></el-input-number>
</el-form-item>
<el-form-item label="金额" prop="amount">
<el-input-number :min="0" v-model="dataForm.amount" :precision="2"></el-input-number>
</el-form-item>
<el-form-item label="每人限领张数" prop="perLimit">
<el-input-number :min="0" v-model="dataForm.perLimit"></el-input-number>
</el-form-item>
<el-form-item label="使用门槛(最小积分)" prop="minPoint">
<el-input-number :min="0" v-model="dataForm.minPoint"></el-input-number>
</el-form-item>
<el-form-item label="有效时间" prop="useTimeRange">
<el-date-picker
v-model="dataForm.useTimeRange"
type="daterange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
></el-date-picker>
</el-form-item>
<el-form-item label="使用类型" prop="useType">
<el-select v-model="dataForm.useType" placeholder="请选择">
<el-option :value="0" label="全场通用"></el-option>
<el-option :value="1" label="指定分类"></el-option>
<el-option :value="2" label="指定商品"></el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="note">
<el-input v-model="dataForm.note" placeholder="备注"></el-input>
</el-form-item>
<el-form-item label="发行数量" prop="publishCount">
<el-input-number v-model="dataForm.publishCount" :min="0"></el-input-number>
</el-form-item>
<el-form-item label="领取日期" prop="enableStartTime">
<el-date-picker
v-model="dataForm.timeRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="优惠码" prop="code">
<el-input v-model="dataForm.code" placeholder="优惠码"></el-input>
</el-form-item>
<el-form-item label="领取所需等级" prop="memberLevel">
<el-select v-model="dataForm.memberLevel" placeholder="请选择">
<el-option :value="0" label="不限制"></el-option>
<el-option
v-for="item in memberLevels"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import SingleUpload from "@/components/upload/singleUpload";
export default {
components: { SingleUpload },
data() {
return {
visible: false,
memberLevels: [],
dataForm: {
id: 0,
couponType: "",
couponImg: "",
couponName: "",
num: "",
amount: "",
perLimit: "",
minPoint: "",
startTime: "",
endTime: "",
useType: "",
note: "",
publishCount: "",
useCount: "",
receiveCount: "",
enableStartTime: "",
enableEndTime: "",
code: "",
memberLevel: "",
publish: 0,
timeRange: [],
useTimeRange:[]
},
dataRule: {
couponType: [
{
required: true,
message:
"优惠卷类型不能为空",
trigger: "blur"
}
],
couponImg: [
{ required: true, message: "优惠券图片不能为空", trigger: "blur" }
],
couponName: [
{ required: true, message: "优惠卷名字不能为空", trigger: "blur" }
],
num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
amount: [{ required: true, message: "金额不能为空", trigger: "blur" }],
perLimit: [
{ required: true, message: "每人限领张数不能为空", trigger: "blur" }
],
minPoint: [
{ required: true, message: "使用门槛不能为空", trigger: "blur" }
],
useType: [
{
required: true,
message: "使用类型不能为空",
trigger: "blur"
}
],
note: [{ required: true, message: "备注不能为空", trigger: "blur" }],
publishCount: [
{ required: true, message: "发行数量不能为空", trigger: "blur" }
],
enableStartTime: [
{
required: true,
message: "可以领取的开始日期不能为空",
trigger: "blur"
}
],
enableEndTime: [
{
required: true,
message: "可以领取的结束日期不能为空",
trigger: "blur"
}
],
code: [{ required: true, message: "优惠码不能为空", trigger: "blur" }],
memberLevel: [
{
required: true,
message: "可以领取的会员等级不能为空",
trigger: "blur"
}
]
}
};
},
created() {
this.getMemberLevels();
},
methods: {
getMemberLevels() {
//
this.$http({
url: this.$http.adornUrl("/member/memberlevel/list"),
method: "get",
params: this.$http.adornParams({
page: 1,
limit: 500
})
}).then(({ data }) => {
this.memberLevels = data.page.list;
});
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/coupon/info/${this.dataForm.id}`),
method: "get",
params: this.$http.adornParams()
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataForm.couponType = data.coupon.couponType;
this.dataForm.couponImg = data.coupon.couponImg;
this.dataForm.couponName = data.coupon.couponName;
this.dataForm.num = data.coupon.num;
this.dataForm.amount = data.coupon.amount;
this.dataForm.perLimit = data.coupon.perLimit;
this.dataForm.minPoint = data.coupon.minPoint;
this.dataForm.startTime = data.coupon.startTime;
this.dataForm.endTime = data.coupon.endTime;
this.dataForm.useType = data.coupon.useType;
this.dataForm.note = data.coupon.note;
this.dataForm.publishCount = data.coupon.publishCount;
this.dataForm.useCount = data.coupon.useCount;
this.dataForm.receiveCount = data.coupon.receiveCount;
this.dataForm.enableStartTime = data.coupon.enableStartTime;
this.dataForm.enableEndTime = data.coupon.enableEndTime;
this.dataForm.code = data.coupon.code;
this.dataForm.memberLevel = data.coupon.memberLevel;
this.dataForm.publish = data.coupon.publish;
this.dataForm.timeRange = [
this.dataForm.startTime,
this.dataForm.endTime
];
}
});
}
});
},
//
dataFormSubmit() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
this.$http({
url: this.$http.adornUrl(
`/coupon/coupon/${!this.dataForm.id ? "save" : "update"}`
),
method: "post",
data: this.$http.adornData({
id: this.dataForm.id || undefined,
couponType: this.dataForm.couponType,
couponImg: this.dataForm.couponImg,
couponName: this.dataForm.couponName,
num: this.dataForm.num,
amount: this.dataForm.amount,
perLimit: this.dataForm.perLimit,
minPoint: this.dataForm.minPoint,
startTime: this.dataForm.useTimeRange[0],
endTime: this.dataForm.useTimeRange[1],
useType: this.dataForm.useType,
note: this.dataForm.note,
publishCount: this.dataForm.publishCount,
useCount: this.dataForm.useCount,
receiveCount: this.dataForm.receiveCount,
enableStartTime: this.dataForm.timeRange[0],
enableEndTime: this.dataForm.timeRange[1],
code: this.dataForm.code,
memberLevel: this.dataForm.memberLevel,
publish: this.dataForm.publish
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
}
});
} else {
this.$message.error(data.msg);
}
});
}
});
}
}
};
</script>

View file

@ -0,0 +1,227 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button
v-if="isAuth('coupon:coupon:save')"
type="primary"
@click="addOrUpdateHandle()"
>新增</el-button>
<el-button
v-if="isAuth('coupon:coupon:delete')"
type="danger"
@click="deleteHandle()"
:disabled="dataListSelections.length <= 0"
>批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;"
>
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="id" header-align="center" align="center" label="id"></el-table-column>
<el-table-column prop="couponType" header-align="center" align="center" label="优惠卷类型">
<template slot-scope="scope">
<el-tag v-if="scope.row.couponType==0">全场赠券</el-tag>
<el-tag type="info" v-if="scope.row.couponType==1">会员赠券</el-tag>
<el-tag type="success" v-if="scope.row.couponType==2">购物赠券</el-tag>
<el-tag type="warning" v-if="scope.row.couponType==3">注册赠券</el-tag>
</template>
</el-table-column>
<el-table-column prop="couponImg" header-align="center" align="center" label="优惠券图片"></el-table-column>
<el-table-column prop="couponName" header-align="center" align="center" label="优惠卷名字"></el-table-column>
<el-table-column prop="num" header-align="center" align="center" label="数量"></el-table-column>
<el-table-column prop="amount" header-align="center" align="center" label="金额"></el-table-column>
<el-table-column prop="perLimit" header-align="center" align="center" label="每人限领张数"></el-table-column>
<el-table-column prop="minPoint" header-align="center" align="center" label="使用门槛"></el-table-column>
<el-table-column prop="startTime" header-align="center" align="center" label="开始时间"></el-table-column>
<el-table-column prop="endTime" header-align="center" align="center" label="结束时间"></el-table-column>
<el-table-column prop="useType" header-align="center" align="center" label="使用类型">
<template slot-scope="scope">
<el-tag v-if="scope.row.useType==0">全场通用</el-tag>
<el-tag type="info" v-if="scope.row.useType==1">指定分类</el-tag>
<el-tag type="success" v-if="scope.row.useType==2">指定商品</el-tag>
</template>
</el-table-column>
<el-table-column prop="note" header-align="center" align="center" label="备注"></el-table-column>
<el-table-column prop="publishCount" header-align="center" align="center" label="发行数量"></el-table-column>
<el-table-column prop="useCount" header-align="center" align="center" label="已使用数量"></el-table-column>
<el-table-column prop="receiveCount" header-align="center" align="center" label="领取数量"></el-table-column>
<el-table-column label="可以领取的日期">
<el-table-column prop="enableStartTime" header-align="center" align="center" label="开始日期"></el-table-column>
<el-table-column prop="enableEndTime" header-align="center" align="center" label="结束日期"></el-table-column>
</el-table-column>
<el-table-column prop="code" header-align="center" align="center" label="优惠码"></el-table-column>
<el-table-column prop="memberLevel" header-align="center" align="center" label="领取所需等级">
<template slot-scope="scope">
<el-tag v-if="scope.row.memberLevel==0">不限等级</el-tag>
<el-tag type="info" v-else>{{getLevel(scope.row.memberLevel)}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="publish" header-align="center" align="center" label="发布状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.publish==0">未发布</el-tag>
<el-tag type="success" v-else>已发布</el-tag>
</template>
</el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from "./coupon-add-or-update";
export default {
data() {
return {
dataForm: {
key: ""
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false,
memberLevels: {}
};
},
components: {
AddOrUpdate
},
activated() {
this.getDataList();
this.getMemberLevels();
},
methods: {
getLevel(level) {
let name = this.memberLevels["level_" + level];
if (name) {
return name;
} else {
return "";
}
},
getMemberLevels() {
//
this.$http({
url: this.$http.adornUrl("/member/memberlevel/list"),
method: "get",
params: this.$http.adornParams({
page: 1,
limit: 500
})
}).then(({ data }) => {
data.page.list.forEach(item => {
this.memberLevels["level_" + item.id] = item.name;
});
});
},
//
getDataList() {
this.dataListLoading = true;
this.$http({
url: this.$http.adornUrl("/coupon/coupon/list"),
method: "get",
params: this.$http.adornParams({
page: this.pageIndex,
limit: this.pageSize,
key: this.dataForm.key
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.page.list;
this.totalPage = data.page.totalCount;
} else {
this.dataList = [];
this.totalPage = 0;
}
this.dataListLoading = false;
});
},
//
sizeChangeHandle(val) {
this.pageSize = val;
this.pageIndex = 1;
this.getDataList();
},
//
currentChangeHandle(val) {
this.pageIndex = val;
this.getDataList();
},
//
selectionChangeHandle(val) {
this.dataListSelections = val;
},
// /
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
//
deleteHandle(id) {
var ids = id
? [id]
: this.dataListSelections.map(item => {
return item.id;
});
this.$confirm(
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
).then(() => {
this.$http({
url: this.$http.adornUrl("/coupon/coupon/delete"),
method: "post",
data: this.$http.adornData(ids, false)
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
}
});
} else {
this.$message.error(data.msg);
}
});
});
}
}
};
</script>

View file

@ -0,0 +1,102 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
<el-form-item label="优惠券id" prop="couponId">
<el-input v-model="dataForm.couponId" placeholder="优惠券id"></el-input>
</el-form-item>
<el-form-item label="产品分类id" prop="categoryId">
<el-input v-model="dataForm.categoryId" placeholder="产品分类id"></el-input>
</el-form-item>
<el-form-item label="产品分类名称" prop="categoryName">
<el-input v-model="dataForm.categoryName" placeholder="产品分类名称"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
couponId: '',
categoryId: '',
categoryName: ''
},
dataRule: {
couponId: [
{ required: true, message: '优惠券id不能为空', trigger: 'blur' }
],
categoryId: [
{ required: true, message: '产品分类id不能为空', trigger: 'blur' }
],
categoryName: [
{ required: true, message: '产品分类名称不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/couponspucategoryrelation/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.couponId = data.couponSpuCategoryRelation.couponId
this.dataForm.categoryId = data.couponSpuCategoryRelation.categoryId
this.dataForm.categoryName = data.couponSpuCategoryRelation.categoryName
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/couponspucategoryrelation/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'couponId': this.dataForm.couponId,
'categoryId': this.dataForm.categoryId,
'categoryName': this.dataForm.categoryName
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View file

@ -0,0 +1,175 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('coupon:couponspucategoryrelation:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('coupon:couponspucategoryrelation:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="couponId"
header-align="center"
align="center"
label="优惠券id">
</el-table-column>
<el-table-column
prop="categoryId"
header-align="center"
align="center"
label="产品分类id">
</el-table-column>
<el-table-column
prop="categoryName"
header-align="center"
align="center"
label="产品分类名称">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './couponspucategoryrelation-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/couponspucategoryrelation/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/couponspucategoryrelation/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View file

@ -0,0 +1,102 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
<el-form-item label="优惠券id" prop="couponId">
<el-input v-model="dataForm.couponId" placeholder="优惠券id"></el-input>
</el-form-item>
<el-form-item label="spu_id" prop="spuId">
<el-input v-model="dataForm.spuId" placeholder="spu_id"></el-input>
</el-form-item>
<el-form-item label="spu_name" prop="spuName">
<el-input v-model="dataForm.spuName" placeholder="spu_name"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
couponId: '',
spuId: '',
spuName: ''
},
dataRule: {
couponId: [
{ required: true, message: '优惠券id不能为空', trigger: 'blur' }
],
spuId: [
{ required: true, message: 'spu_id不能为空', trigger: 'blur' }
],
spuName: [
{ required: true, message: 'spu_name不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/couponspurelation/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.couponId = data.couponSpuRelation.couponId
this.dataForm.spuId = data.couponSpuRelation.spuId
this.dataForm.spuName = data.couponSpuRelation.spuName
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/couponspurelation/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'couponId': this.dataForm.couponId,
'spuId': this.dataForm.spuId,
'spuName': this.dataForm.spuName
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View file

@ -0,0 +1,175 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('coupon:couponspurelation:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('coupon:couponspurelation:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="couponId"
header-align="center"
align="center"
label="优惠券id">
</el-table-column>
<el-table-column
prop="spuId"
header-align="center"
align="center"
label="spu_id">
</el-table-column>
<el-table-column
prop="spuName"
header-align="center"
align="center"
label="spu_name">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './couponspurelation-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/couponspurelation/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/couponspurelation/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View file

@ -0,0 +1,181 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('coupon:skufullreduction:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('coupon:skufullreduction:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="skuId"
header-align="center"
align="center"
label="spu_id">
</el-table-column>
<el-table-column
prop="fullPrice"
header-align="center"
align="center"
label="满多少">
</el-table-column>
<el-table-column
prop="reducePrice"
header-align="center"
align="center"
label="减多少">
</el-table-column>
<el-table-column
prop="addOther"
header-align="center"
align="center"
label="是否参与其他优惠">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './skufullreduction-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/skufullreduction/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/skufullreduction/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View file

@ -0,0 +1,163 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;"
>
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="id" header-align="center" align="center" label="id"></el-table-column>
<el-table-column prop="couponId" header-align="center" align="center" label="优惠券id"></el-table-column>
<el-table-column prop="memberId" header-align="center" align="center" label="会员id"></el-table-column>
<el-table-column prop="memberNickName" header-align="center" align="center" label="会员名字"></el-table-column>
<el-table-column prop="getType" header-align="center" align="center" label="获取方式">
<template slot-scope="scope">
<el-tag type="primary" v-if="scope.row.getType==0">后台赠送</el-tag>
<el-tag type="success" v-else>主动领取</el-tag>
</template>
</el-table-column>
<el-table-column prop="createTime" header-align="center" align="center" label="创建时间"></el-table-column>
<el-table-column
prop="useType"
header-align="center"
align="center"
label="使用状态"
>
<template slot-scope="scope">
<el-tag type="primary" v-if="scope.row.useType==0">未使用</el-tag>
<el-tag type="success" v-if="scope.row.useType==1">已使用</el-tag>
<el-tag type="warning" v-if="scope.row.useType==2">已过期</el-tag>
</template>
</el-table-column>
<el-table-column prop="useTime" header-align="center" align="center" label="使用时间"></el-table-column>
<el-table-column prop="orderId" header-align="center" align="center" label="订单id"></el-table-column>
<el-table-column prop="orderSn" header-align="center" align="center" label="订单号"></el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<!-- 弹窗, 新增 / 修改 -->
</div>
</template>
<script>
export default {
data() {
return {
dataForm: {
key: ""
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
};
},
components: {
},
activated() {
this.getDataList();
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.$http({
url: this.$http.adornUrl("/coupon/couponhistory/list"),
method: "get",
params: this.$http.adornParams({
page: this.pageIndex,
limit: this.pageSize,
key: this.dataForm.key
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.page.list;
this.totalPage = data.page.totalCount;
} else {
this.dataList = [];
this.totalPage = 0;
}
this.dataListLoading = false;
});
},
//
sizeChangeHandle(val) {
this.pageSize = val;
this.pageIndex = 1;
this.getDataList();
},
//
currentChangeHandle(val) {
this.pageIndex = val;
this.getDataList();
},
//
selectionChangeHandle(val) {
this.dataListSelections = val;
},
// /
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
//
deleteHandle(id) {
var ids = id
? [id]
: this.dataListSelections.map(item => {
return item.id;
});
this.$confirm(
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
).then(() => {
this.$http({
url: this.$http.adornUrl("/coupon/couponhistory/delete"),
method: "post",
data: this.$http.adornData(ids, false)
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
}
});
} else {
this.$message.error(data.msg);
}
});
});
}
}
};
</script>

View file

@ -0,0 +1,174 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
<el-form-item label="名字" prop="name">
<el-input v-model="dataForm.name" placeholder="名字"></el-input>
</el-form-item>
<el-form-item label="图片地址" prop="pic">
<el-input v-model="dataForm.pic" placeholder="图片地址"></el-input>
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-input v-model="dataForm.startTime" placeholder="开始时间"></el-input>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-input v-model="dataForm.endTime" placeholder="结束时间"></el-input>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-input v-model="dataForm.status" placeholder="状态"></el-input>
</el-form-item>
<el-form-item label="点击数" prop="clickCount">
<el-input v-model="dataForm.clickCount" placeholder="点击数"></el-input>
</el-form-item>
<el-form-item label="广告详情连接地址" prop="url">
<el-input v-model="dataForm.url" placeholder="广告详情连接地址"></el-input>
</el-form-item>
<el-form-item label="备注" prop="note">
<el-input v-model="dataForm.note" placeholder="备注"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
<el-form-item label="发布者" prop="publisherId">
<el-input v-model="dataForm.publisherId" placeholder="发布者"></el-input>
</el-form-item>
<el-form-item label="审核者" prop="authId">
<el-input v-model="dataForm.authId" placeholder="审核者"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
name: '',
pic: '',
startTime: '',
endTime: '',
status: '',
clickCount: '',
url: '',
note: '',
sort: '',
publisherId: '',
authId: ''
},
dataRule: {
name: [
{ required: true, message: '名字不能为空', trigger: 'blur' }
],
pic: [
{ required: true, message: '图片地址不能为空', trigger: 'blur' }
],
startTime: [
{ required: true, message: '开始时间不能为空', trigger: 'blur' }
],
endTime: [
{ required: true, message: '结束时间不能为空', trigger: 'blur' }
],
status: [
{ required: true, message: '状态不能为空', trigger: 'blur' }
],
clickCount: [
{ required: true, message: '点击数不能为空', trigger: 'blur' }
],
url: [
{ required: true, message: '广告详情连接地址不能为空', trigger: 'blur' }
],
note: [
{ required: true, message: '备注不能为空', trigger: 'blur' }
],
sort: [
{ required: true, message: '排序不能为空', trigger: 'blur' }
],
publisherId: [
{ required: true, message: '发布者不能为空', trigger: 'blur' }
],
authId: [
{ required: true, message: '审核者不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/homeadv/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.name = data.homeAdv.name
this.dataForm.pic = data.homeAdv.pic
this.dataForm.startTime = data.homeAdv.startTime
this.dataForm.endTime = data.homeAdv.endTime
this.dataForm.status = data.homeAdv.status
this.dataForm.clickCount = data.homeAdv.clickCount
this.dataForm.url = data.homeAdv.url
this.dataForm.note = data.homeAdv.note
this.dataForm.sort = data.homeAdv.sort
this.dataForm.publisherId = data.homeAdv.publisherId
this.dataForm.authId = data.homeAdv.authId
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/homeadv/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'name': this.dataForm.name,
'pic': this.dataForm.pic,
'startTime': this.dataForm.startTime,
'endTime': this.dataForm.endTime,
'status': this.dataForm.status,
'clickCount': this.dataForm.clickCount,
'url': this.dataForm.url,
'note': this.dataForm.note,
'sort': this.dataForm.sort,
'publisherId': this.dataForm.publisherId,
'authId': this.dataForm.authId
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View file

@ -0,0 +1,223 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('coupon:homeadv:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('coupon:homeadv:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="名字">
</el-table-column>
<el-table-column
prop="pic"
header-align="center"
align="center"
label="图片地址">
</el-table-column>
<el-table-column
prop="startTime"
header-align="center"
align="center"
label="开始时间">
</el-table-column>
<el-table-column
prop="endTime"
header-align="center"
align="center"
label="结束时间">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="状态">
</el-table-column>
<el-table-column
prop="clickCount"
header-align="center"
align="center"
label="点击数">
</el-table-column>
<el-table-column
prop="url"
header-align="center"
align="center"
label="广告详情连接地址">
</el-table-column>
<el-table-column
prop="note"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
align="center"
label="排序">
</el-table-column>
<el-table-column
prop="publisherId"
header-align="center"
align="center"
label="发布者">
</el-table-column>
<el-table-column
prop="authId"
header-align="center"
align="center"
label="审核者">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './homeadv-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/homeadv/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/homeadv/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View file

@ -0,0 +1,147 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="120px"
>
<el-form-item label="专题名字" prop="name">
<el-input v-model="dataForm.name" placeholder="专题名字"></el-input>
</el-form-item>
<el-form-item label="专题标题" prop="title">
<el-input v-model="dataForm.title" placeholder="专题标题"></el-input>
</el-form-item>
<el-form-item label="专题副标题" prop="subTitle">
<el-input v-model="dataForm.subTitle" placeholder="专题副标题"></el-input>
</el-form-item>
<el-form-item label="显示状态" prop="status">
<el-switch v-model="dataForm.status" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
</el-form-item>
<el-form-item label="详情连接" prop="url">
<el-input v-model="dataForm.url" placeholder="详情连接"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
<el-form-item label="专题图片地址" prop="img">
<single-upload v-model="dataForm.img"></single-upload>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import SingleUpload from '@/components/upload/singleUpload'
export default {
components:{SingleUpload},
data() {
return {
visible: false,
dataForm: {
id: 0,
name: "",
title: "",
subTitle: "",
status: "",
url: "",
sort: "",
img: ""
},
dataRule: {
name: [
{ required: true, message: "专题名字不能为空", trigger: "blur" }
],
title: [
{ required: true, message: "专题标题不能为空", trigger: "blur" }
],
subTitle: [
{ required: true, message: "专题副标题不能为空", trigger: "blur" }
],
status: [
{ required: true, message: "显示状态不能为空", trigger: "blur" }
],
url: [{ required: true, message: "详情连接不能为空", trigger: "blur" }],
sort: [{ required: true, message: "排序不能为空", trigger: "blur" }],
img: [
{ required: true, message: "专题图片地址不能为空", trigger: "blur" }
]
}
};
},
methods: {
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(
`/coupon/homesubject/info/${this.dataForm.id}`
),
method: "get",
params: this.$http.adornParams()
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataForm.name = data.homeSubject.name;
this.dataForm.title = data.homeSubject.title;
this.dataForm.subTitle = data.homeSubject.subTitle;
this.dataForm.status = data.homeSubject.status;
this.dataForm.url = data.homeSubject.url;
this.dataForm.sort = data.homeSubject.sort;
this.dataForm.img = data.homeSubject.img;
}
});
}
});
},
//
dataFormSubmit() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
this.$http({
url: this.$http.adornUrl(
`/coupon/homesubject/${!this.dataForm.id ? "save" : "update"}`
),
method: "post",
data: this.$http.adornData({
id: this.dataForm.id || undefined,
name: this.dataForm.name,
title: this.dataForm.title,
subTitle: this.dataForm.subTitle,
status: this.dataForm.status,
url: this.dataForm.url,
sort: this.dataForm.sort,
img: this.dataForm.img
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
}
});
} else {
this.$message.error(data.msg);
}
});
}
});
}
}
};
</script>

View file

@ -0,0 +1,111 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
<el-form-item label="专题名字" prop="name">
<el-input v-model="dataForm.name" placeholder="专题名字"></el-input>
</el-form-item>
<el-form-item label="专题id" prop="subjectId">
<el-input v-model="dataForm.subjectId" placeholder="专题id"></el-input>
</el-form-item>
<el-form-item label="spu_id" prop="spuId">
<el-input v-model="dataForm.spuId" placeholder="spu_id"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
name: '',
subjectId: '',
spuId: '',
sort: ''
},
dataRule: {
name: [
{ required: true, message: '专题名字不能为空', trigger: 'blur' }
],
subjectId: [
{ required: true, message: '专题id不能为空', trigger: 'blur' }
],
spuId: [
{ required: true, message: 'spu_id不能为空', trigger: 'blur' }
],
sort: [
{ required: true, message: '排序不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/homesubjectspu/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.name = data.homeSubjectSpu.name
this.dataForm.subjectId = data.homeSubjectSpu.subjectId
this.dataForm.spuId = data.homeSubjectSpu.spuId
this.dataForm.sort = data.homeSubjectSpu.sort
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/homesubjectspu/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'name': this.dataForm.name,
'subjectId': this.dataForm.subjectId,
'spuId': this.dataForm.spuId,
'sort': this.dataForm.sort
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View file

@ -0,0 +1,181 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('coupon:homesubjectspu:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('coupon:homesubjectspu:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="专题名字">
</el-table-column>
<el-table-column
prop="subjectId"
header-align="center"
align="center"
label="专题id">
</el-table-column>
<el-table-column
prop="spuId"
header-align="center"
align="center"
label="spu_id">
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
align="center"
label="排序">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './homesubjectspu-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/homesubjectspu/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/homesubjectspu/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View file

@ -0,0 +1,139 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="120px"
>
<el-form-item label="sku_id" prop="skuId">
<el-input v-model="dataForm.skuId" placeholder="sku_id"></el-input>
</el-form-item>
<el-form-item label="会员等级id" prop="memberLevelId">
<el-input v-model="dataForm.memberLevelId" placeholder="会员等级id"></el-input>
</el-form-item>
<el-form-item label="会员等级名" prop="memberLevelName">
<el-input v-model="dataForm.memberLevelName" placeholder="会员等级名"></el-input>
</el-form-item>
<el-form-item label="会员对应价格" prop="memberPrice">
<el-input v-model="dataForm.memberPrice" placeholder="会员对应价格"></el-input>
</el-form-item>
<el-form-item label="可否叠加其他优惠" prop="addOther">
<el-switch
v-model="dataForm.addOther"
:active-value="1"
inactive-value="0"
active-text="可叠加"
inactive-text="不可叠加"
></el-switch>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data() {
return {
visible: false,
dataForm: {
id: 0,
skuId: "",
memberLevelId: "",
memberLevelName: "",
memberPrice: "",
addOther: ""
},
dataRule: {
skuId: [{ required: true, message: "sku_id不能为空", trigger: "blur" }],
memberLevelId: [
{ required: true, message: "会员等级id不能为空", trigger: "blur" }
],
memberLevelName: [
{ required: true, message: "会员等级名不能为空", trigger: "blur" }
],
memberPrice: [
{ required: true, message: "会员对应价格不能为空", trigger: "blur" }
],
addOther: [
{
required: true,
message: "可否叠加其他优惠[0-不可叠加优惠1-可叠加]不能为空",
trigger: "blur"
}
]
}
};
},
methods: {
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(
`/coupon/memberprice/info/${this.dataForm.id}`
),
method: "get",
params: this.$http.adornParams()
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataForm.skuId = data.memberPrice.skuId;
this.dataForm.memberLevelId = data.memberPrice.memberLevelId;
this.dataForm.memberLevelName = data.memberPrice.memberLevelName;
this.dataForm.memberPrice = data.memberPrice.memberPrice;
this.dataForm.addOther = data.memberPrice.addOther;
}
});
}
});
},
//
dataFormSubmit() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
this.$http({
url: this.$http.adornUrl(
`/coupon/memberprice/${!this.dataForm.id ? "save" : "update"}`
),
method: "post",
data: this.$http.adornData({
id: this.dataForm.id || undefined,
skuId: this.dataForm.skuId,
memberLevelId: this.dataForm.memberLevelId,
memberLevelName: this.dataForm.memberLevelName,
memberPrice: this.dataForm.memberPrice,
addOther: this.dataForm.addOther
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
}
});
} else {
this.$message.error(data.msg);
}
});
}
});
}
}
};
</script>

View file

@ -0,0 +1,173 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button
v-if="isAuth('coupon:memberprice:save')"
type="primary"
@click="addOrUpdateHandle()"
>新增</el-button>
<el-button
v-if="isAuth('coupon:memberprice:delete')"
type="danger"
@click="deleteHandle()"
:disabled="dataListSelections.length <= 0"
>批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;"
>
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="id" header-align="center" align="center" label="id"></el-table-column>
<el-table-column prop="skuId" header-align="center" align="center" label="sku_id"></el-table-column>
<el-table-column prop="memberLevelId" header-align="center" align="center" label="会员等级id"></el-table-column>
<el-table-column prop="memberLevelName" header-align="center" align="center" label="会员等级名"></el-table-column>
<el-table-column prop="memberPrice" header-align="center" align="center" label="会员对应价格"></el-table-column>
<el-table-column
prop="addOther"
header-align="center"
align="center"
label="可否叠加其他优惠"
>
<template slot-scope="scope">
<el-tag type="primary" v-if="scope.row.addOther==0">不可叠加优惠</el-tag>
<el-tag type="success" v-else>可叠加优惠</el-tag>
</template>
</el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from "./memberprice-add-or-update";
export default {
data() {
return {
dataForm: {
key: ""
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
};
},
components: {
AddOrUpdate
},
activated() {
this.getDataList();
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.$http({
url: this.$http.adornUrl("/coupon/memberprice/list"),
method: "get",
params: this.$http.adornParams({
page: this.pageIndex,
limit: this.pageSize,
key: this.dataForm.key
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.page.list;
this.totalPage = data.page.totalCount;
} else {
this.dataList = [];
this.totalPage = 0;
}
this.dataListLoading = false;
});
},
//
sizeChangeHandle(val) {
this.pageSize = val;
this.pageIndex = 1;
this.getDataList();
},
//
currentChangeHandle(val) {
this.pageIndex = val;
this.getDataList();
},
//
selectionChangeHandle(val) {
this.dataListSelections = val;
},
// /
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
//
deleteHandle(id) {
var ids = id
? [id]
: this.dataListSelections.map(item => {
return item.id;
});
this.$confirm(
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
).then(() => {
this.$http({
url: this.$http.adornUrl("/coupon/memberprice/delete"),
method: "post",
data: this.$http.adornData(ids, false)
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
}
});
} else {
this.$message.error(data.msg);
}
});
});
}
}
};
</script>

View file

@ -0,0 +1,193 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('coupon:seckillpromotion:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('coupon:seckillpromotion:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="title"
header-align="center"
align="center"
label="活动标题">
</el-table-column>
<el-table-column
prop="startTime"
header-align="center"
align="center"
label="开始日期">
</el-table-column>
<el-table-column
prop="endTime"
header-align="center"
align="center"
label="结束日期">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="上下线状态">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="userId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './seckillpromotion-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/seckillpromotion/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/seckillpromotion/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View file

@ -0,0 +1,131 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="120px"
>
<el-form-item label="活动标题" prop="title">
<el-input v-model="dataForm.title" placeholder="活动标题"></el-input>
</el-form-item>
<el-form-item label="生效日期" prop="enableStartTime">
<el-date-picker
v-model="dataForm.timeRange"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="上下线状态" prop="status">
<el-select v-model="dataForm.status" placeholder="上下线状态">
<el-option :value="1" label="上线"></el-option>
<el-option :value="0" label="下线"></el-option>
</el-select>
</el-form-item>
<el-form-item label="创建人" prop="userId">
<el-input v-model="dataForm.userId" placeholder="创建人"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data() {
return {
visible: false,
dataForm: {
id: 0,
title: "",
startTime: "",
endTime: "",
status: "",
createTime: "",
userId: "",
timeRange: []
},
dataRule: {
title: [
{ required: true, message: "活动标题不能为空", trigger: "blur" }
]
}
};
},
methods: {
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(
`/coupon/seckillpromotion/info/${this.dataForm.id}`
),
method: "get",
params: this.$http.adornParams()
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataForm.title = data.seckillPromotion.title;
this.dataForm.startTime = data.seckillPromotion.startTime;
this.dataForm.endTime = data.seckillPromotion.endTime;
this.dataForm.status = data.seckillPromotion.status;
this.dataForm.createTime = data.seckillPromotion.createTime;
this.dataForm.userId = data.seckillPromotion.userId;
this.dataForm.timeRange.push(this.dataForm.startTime);
this.dataForm.timeRange.push(this.dataForm.endTime);
}
});
}
});
},
//
dataFormSubmit() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
this.$http({
url: this.$http.adornUrl(
`/coupon/seckillpromotion/${
!this.dataForm.id ? "save" : "update"
}`
),
method: "post",
data: this.$http.adornData({
id: this.dataForm.id || undefined,
title: this.dataForm.title,
startTime: this.dataForm.timeRange[0],
endTime: this.dataForm.timeRange[1],
status: this.dataForm.status
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
}
});
} else {
this.$message.error(data.msg);
}
});
}
});
}
}
};
</script>

View file

@ -0,0 +1,125 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="120px"
>
<el-form-item label="场次名称" prop="name">
<el-input v-model="dataForm.name" placeholder="场次名称"></el-input>
</el-form-item>
<el-form-item label="每日开始时间" prop="startTime">
<el-date-picker type="datetime" placeholder="每日开始时间" v-model="dataForm.startTime"></el-date-picker>
</el-form-item>
<el-form-item label="每日结束时间" prop="endTime">
<el-date-picker type="datetime" placeholder="每日结束时间" v-model="dataForm.endTime"></el-date-picker>
</el-form-item>
<el-form-item label="启用状态" prop="status">
<el-input v-model="dataForm.status" placeholder="启用状态"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data() {
return {
visible: false,
dataForm: {
id: 0,
name: "",
startTime: "",
endTime: "",
status: "",
createTime: ""
},
dataRule: {
name: [
{ required: true, message: "场次名称不能为空", trigger: "blur" }
],
startTime: [
{ required: true, message: "每日开始时间不能为空", trigger: "blur" }
],
endTime: [
{ required: true, message: "每日结束时间不能为空", trigger: "blur" }
],
status: [
{ required: true, message: "启用状态不能为空", trigger: "blur" }
]
}
};
},
methods: {
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(
`/coupon/seckillsession/info/${this.dataForm.id}`
),
method: "get",
params: this.$http.adornParams()
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataForm.name = data.seckillSession.name;
this.dataForm.startTime = data.seckillSession.startTime;
this.dataForm.endTime = data.seckillSession.endTime;
this.dataForm.status = data.seckillSession.status;
this.dataForm.createTime = data.seckillSession.createTime;
}
});
}
});
},
//
dataFormSubmit() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
this.$http({
url: this.$http.adornUrl(
`/coupon/seckillsession/${!this.dataForm.id ? "save" : "update"}`
),
method: "post",
data: this.$http.adornData({
id: this.dataForm.id || undefined,
name: this.dataForm.name,
startTime: this.dataForm.startTime,
endTime: this.dataForm.endTime,
status: this.dataForm.status,
createTime: new Date()
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
}
});
} else {
this.$message.error(data.msg);
}
});
}
});
}
}
};
</script>

View file

@ -0,0 +1,188 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button
v-if="isAuth('coupon:seckillsession:save')"
type="primary"
@click="addOrUpdateHandle()"
>新增</el-button>
<el-button
v-if="isAuth('coupon:seckillsession:delete')"
type="danger"
@click="deleteHandle()"
:disabled="dataListSelections.length <= 0"
>批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;"
>
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="id" header-align="center" align="center" label="id"></el-table-column>
<el-table-column prop="name" header-align="center" align="center" label="场次名称"></el-table-column>
<el-table-column prop="startTime" header-align="center" align="center" label="每日开始时间"></el-table-column>
<el-table-column prop="endTime" header-align="center" align="center" label="每日结束时间"></el-table-column>
<el-table-column prop="status" header-align="center" align="center" label="启用状态"></el-table-column>
<el-table-column prop="createTime" header-align="center" align="center" label="创建时间"></el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="relationProduct(scope.row.id)">关联商品</el-button>
<br/>
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<div>
<el-dialog
append-to-body
:close-on-click-modal="false"
:visible.sync="visible"
title="关联秒杀商品"
width="60%"
>
<seckillsku-relation ref="seckillskuRelation" :sessionId="currentId"></seckillsku-relation>
</el-dialog>
</div>
</div>
</template>
<script>
import AddOrUpdate from "./seckillsession-add-or-update";
import SeckillskuRelation from "./seckillskurelation";
export default {
data() {
return {
dataForm: {
key: ""
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false,
visible: false,
currentId: 0
};
},
components: {
AddOrUpdate,
SeckillskuRelation
},
activated() {
this.getDataList();
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.$http({
url: this.$http.adornUrl("/coupon/seckillsession/list"),
method: "get",
params: this.$http.adornParams({
page: this.pageIndex,
limit: this.pageSize,
key: this.dataForm.key
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.page.list;
this.totalPage = data.page.totalCount;
} else {
this.dataList = [];
this.totalPage = 0;
}
this.dataListLoading = false;
});
},
getRealtionDataList() {},
//
sizeChangeHandle(val) {
this.pageSize = val;
this.pageIndex = 1;
this.getDataList();
},
//
currentChangeHandle(val) {
this.pageIndex = val;
this.getDataList();
},
//
selectionChangeHandle(val) {
this.dataListSelections = val;
},
// /
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
relationProduct(id) {
this.visible = true;
this.currentId = id;
this.$nextTick(() => {
this.$refs.seckillskuRelation.getDataList();
});
},
//
deleteHandle(id) {
var ids = id
? [id]
: this.dataListSelections.map(item => {
return item.id;
});
this.$confirm(
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
).then(() => {
this.$http({
url: this.$http.adornUrl("/coupon/seckillsession/delete"),
method: "post",
data: this.$http.adornData(ids, false)
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
}
});
} else {
this.$message.error(data.msg);
}
});
});
}
}
};
</script>

View file

@ -0,0 +1,147 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="120px"
>
<el-form-item label="member_id" prop="memberId">
<el-input v-model="dataForm.memberId" placeholder="member_id"></el-input>
</el-form-item>
<el-form-item label="sku_id" prop="skuId">
<el-input v-model="dataForm.skuId" placeholder="sku_id"></el-input>
</el-form-item>
<el-form-item label="活动场次id" prop="sessionId">
<el-input v-model="dataForm.sessionId" placeholder="活动场次id"></el-input>
</el-form-item>
<el-form-item label="订阅时间" prop="subcribeTime">
<el-input v-model="dataForm.subcribeTime" placeholder="订阅时间"></el-input>
</el-form-item>
<el-form-item label="发送时间" prop="sendTime">
<el-input v-model="dataForm.sendTime" placeholder="发送时间"></el-input>
</el-form-item>
<el-form-item label="通知方式" prop="noticeType">
<el-select v-model="dataForm.noticeType" placeholder="请选择">
<el-option label="短信" :value="0"></el-option>
<el-option label="邮件" :value="1"></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data() {
return {
visible: false,
dataForm: {
id: 0,
memberId: "",
skuId: "",
sessionId: "",
subcribeTime: "",
sendTime: "",
noticeType: ""
},
dataRule: {
memberId: [
{ required: true, message: "member_id不能为空", trigger: "blur" }
],
skuId: [{ required: true, message: "sku_id不能为空", trigger: "blur" }],
sessionId: [
{ required: true, message: "活动场次id不能为空", trigger: "blur" }
],
subcribeTime: [
{ required: true, message: "订阅时间不能为空", trigger: "blur" }
],
sendTime: [
{ required: true, message: "发送时间不能为空", trigger: "blur" }
],
noticeType: [
{
required: true,
message: "通知方式不能为空",
trigger: "blur"
}
]
}
};
},
methods: {
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(
`/coupon/seckillskunotice/info/${this.dataForm.id}`
),
method: "get",
params: this.$http.adornParams()
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataForm.memberId = data.seckillSkuNotice.memberId;
this.dataForm.skuId = data.seckillSkuNotice.skuId;
this.dataForm.sessionId = data.seckillSkuNotice.sessionId;
this.dataForm.subcribeTime = data.seckillSkuNotice.subcribeTime;
this.dataForm.sendTime = data.seckillSkuNotice.sendTime;
this.dataForm.noticeType = data.seckillSkuNotice.noticeType;
}
});
}
});
},
//
dataFormSubmit() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
this.$http({
url: this.$http.adornUrl(
`/coupon/seckillskunotice/${
!this.dataForm.id ? "save" : "update"
}`
),
method: "post",
data: this.$http.adornData({
id: this.dataForm.id || undefined,
memberId: this.dataForm.memberId,
skuId: this.dataForm.skuId,
sessionId: this.dataForm.sessionId,
subcribeTime: this.dataForm.subcribeTime,
sendTime: this.dataForm.sendTime,
noticeType: this.dataForm.noticeType
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
}
});
} else {
this.$message.error(data.msg);
}
});
}
});
}
}
};
</script>

View file

@ -0,0 +1,193 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('coupon:seckillskunotice:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('coupon:seckillskunotice:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="memberId"
header-align="center"
align="center"
label="member_id">
</el-table-column>
<el-table-column
prop="skuId"
header-align="center"
align="center"
label="sku_id">
</el-table-column>
<el-table-column
prop="sessionId"
header-align="center"
align="center"
label="活动场次id">
</el-table-column>
<el-table-column
prop="subcribeTime"
header-align="center"
align="center"
label="订阅时间">
</el-table-column>
<el-table-column
prop="sendTime"
header-align="center"
align="center"
label="发送时间">
</el-table-column>
<el-table-column
prop="noticeType"
header-align="center"
align="center"
label="通知方式[0-短信1-邮件]">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './seckillskunotice-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/seckillskunotice/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/seckillskunotice/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View file

@ -0,0 +1,151 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
append-to-body
:visible.sync="visible"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="120px"
>
<el-form-item label="活动场次id" prop="promotionSessionId">
<el-input v-model="sessionId" placeholder="活动场次id" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="商品id" prop="skuId">
<el-input v-model="dataForm.skuId" placeholder="商品id"></el-input>
</el-form-item>
<el-form-item label="秒杀价格" prop="seckillPrice">
<el-input-number v-model="dataForm.seckillPrice" :min="0" :precision="2" :step="0.1"></el-input-number>
</el-form-item>
<el-form-item label="秒杀总量" prop="seckillCount">
<el-input-number v-model="dataForm.seckillCount" :min="1" label="秒杀总量"></el-input-number>
</el-form-item>
<el-form-item label="每人限购数量" prop="seckillLimit">
<el-input-number v-model="dataForm.seckillLimit" :min="1" label="每人限购数量"></el-input-number>
</el-form-item>
<el-form-item label="排序" prop="seckillSort">
<el-input v-model="dataForm.seckillSort" placeholder="排序"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data() {
return {
visible: false,
dataForm: {
id: 0,
promotionId: "",
promotionSessionId: "",
skuId: "",
seckillPrice: "",
seckillCount: "",
seckillLimit: 1,
seckillSort: 0
},
dataRule: {
sessionId: [
{ required: true, message: "活动场次id不能为空", trigger: "blur" }
],
skuId: [{ required: true, message: "商品id不能为空", trigger: "blur" }],
seckillPrice: [
{ required: true, message: "秒杀价格不能为空", trigger: "blur" }
],
seckillCount: [
{ required: true, message: "秒杀总量不能为空", trigger: "blur" }
],
seckillLimit: [
{ required: true, message: "每人限购数量不能为空", trigger: "blur" }
],
seckillSort: [
{ required: true, message: "排序不能为空", trigger: "blur" }
]
}
};
},
props: {
sessionId: {
type: Number,
default: 0
}
},
methods: {
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(
`/coupon/seckillskurelation/info/${this.dataForm.id}`
),
method: "get",
params: this.$http.adornParams()
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataForm.promotionId = data.seckillSkuRelation.promotionId;
this.dataForm.promotionSessionId =
data.seckillSkuRelation.promotionSessionId;
this.dataForm.skuId = data.seckillSkuRelation.skuId;
this.dataForm.seckillPrice = data.seckillSkuRelation.seckillPrice;
this.dataForm.seckillCount = data.seckillSkuRelation.seckillCount;
this.dataForm.seckillLimit = data.seckillSkuRelation.seckillLimit;
this.dataForm.seckillSort = data.seckillSkuRelation.seckillSort;
}
});
}
});
},
//
dataFormSubmit() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
this.$http({
url: this.$http.adornUrl(
`/coupon/seckillskurelation/${
!this.dataForm.id ? "save" : "update"
}`
),
method: "post",
data: this.$http.adornData({
id: this.dataForm.id || undefined,
promotionId: this.dataForm.promotionId,
promotionSessionId: this.sessionId,
skuId: this.dataForm.skuId,
seckillPrice: this.dataForm.seckillPrice,
seckillCount: this.dataForm.seckillCount,
seckillLimit: this.dataForm.seckillLimit,
seckillSort: this.dataForm.seckillSort
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
}
});
} else {
this.$message.error(data.msg);
}
});
}
});
}
}
};
</script>

View file

@ -0,0 +1,180 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button
v-if="isAuth('coupon:seckillskurelation:save')"
type="primary"
@click="addOrUpdateHandle()"
>新增</el-button>
<el-button
v-if="isAuth('coupon:seckillskurelation:delete')"
type="danger"
@click="deleteHandle()"
:disabled="dataListSelections.length <= 0"
>批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;"
>
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="id" header-align="center" align="center" label="id"></el-table-column>
<el-table-column
prop="promotionSessionId"
header-align="center"
align="center"
label="场次id"
></el-table-column>
<el-table-column prop="skuId" header-align="center" align="center" label="商品id"></el-table-column>
<el-table-column prop="seckillPrice" header-align="center" align="center" label="秒杀价格"></el-table-column>
<el-table-column prop="seckillCount" header-align="center" align="center" label="秒杀总量"></el-table-column>
<el-table-column prop="seckillLimit" header-align="center" align="center" label="每人限购数量"></el-table-column>
<el-table-column prop="seckillSort" header-align="center" align="center" label="排序"></el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<div>
<add-or-update :sessionId="promotionSessionId" v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</div>
</template>
<script>
import AddOrUpdate from "./seckillskurelation-add-or-update";
export default {
data() {
return {
dataForm: {
key: ""
},
promotionSessionId: '',
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
};
},
props: {
sessionId: {
type: Number,
default: 0
}
},
components: {
AddOrUpdate
},
activated() {
this.getDataList();
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.$http({
url: this.$http.adornUrl("/coupon/seckillskurelation/list"),
method: "get",
params: this.$http.adornParams({
page: this.pageIndex,
limit: this.pageSize,
key: this.dataForm.key,
promotionSessionId: this.sessionId
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.page.list;
this.totalPage = data.page.totalCount;
} else {
this.dataList = [];
this.totalPage = 0;
}
this.dataListLoading = false;
});
},
//
sizeChangeHandle(val) {
this.pageSize = val;
this.pageIndex = 1;
this.getDataList();
},
//
currentChangeHandle(val) {
this.pageIndex = val;
this.getDataList();
},
//
selectionChangeHandle(val) {
this.dataListSelections = val;
},
// /
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.promotionSessionId = this.sessionId;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
//
deleteHandle(id) {
var ids = id
? [id]
: this.dataListSelections.map(item => {
return item.id;
});
this.$confirm(
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
).then(() => {
this.$http({
url: this.$http.adornUrl("/coupon/seckillskurelation/delete"),
method: "post",
data: this.$http.adornData(ids, false)
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
}
});
} else {
this.$message.error(data.msg);
}
});
});
}
}
};
</script>

Some files were not shown because too many files have changed in this diff Show more