康菊菊 10 months ago
parent a4958279e7
commit 5733f309d2

@ -0,0 +1,12 @@
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"]
}

@ -0,0 +1,9 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

@ -0,0 +1,25 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files`
`
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

@ -0,0 +1,10 @@
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}

@ -0,0 +1,41 @@
'use strict'
require('./check-versions')()
process.env.NODE_ENV = 'production'
const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')
const spinner = ora('building for production...')
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, (err, stats) => {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
chunks: false,
chunkModules: false
}) + '\n\n')
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}
console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
})

@ -0,0 +1,54 @@
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')
function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
}
const versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
}
]
if (shell.which('npm')) {
versionRequirements.push({
name: 'npm',
currentVersion: exec('npm --version'),
versionRequirement: packageConfig.engines.npm
})
}
module.exports = function () {
const warnings = []
for (let i = 0; i < versionRequirements.length; i++) {
const mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
}
}
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (let i = 0; i < warnings.length; i++) {
const warning = warnings[i]
console.log(' ' + warning)
}
console.log()
process.exit(1)
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

@ -0,0 +1,101 @@
'use strict'
const path = require('path')
const config = require('../config')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const packageConfig = require('../package.json')
exports.assetsPath = function (_path) {
const assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
const cssLoader = {
loader: 'css-loader',
options: {
sourceMap: options.sourceMap
}
}
const postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) {
const output = []
const loaders = exports.cssLoaders(options)
for (const extension in loaders) {
const loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
exports.createNotifierCallback = () => {
const notifier = require('node-notifier')
return (severity, errors) => {
if (severity !== 'error') return
const error = errors[0]
const filename = error.file && error.file.split('!').pop()
notifier.notify({
title: packageConfig.name,
message: severity + ': ' + error.name,
subtitle: filename || '',
icon: path.join(__dirname, 'logo.png')
})
}
}

@ -0,0 +1,22 @@
'use strict'
const utils = require('./utils')
const config = require('../config')
const isProduction = process.env.NODE_ENV === 'production'
const sourceMapEnabled = isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap
module.exports = {
loaders: utils.cssLoaders({
sourceMap: sourceMapEnabled,
extract: isProduction
}),
cssSourceMap: sourceMapEnabled,
cacheBusting: config.dev.cacheBusting,
transformToRequire: {
video: ['src', 'poster'],
source: 'src',
img: 'src',
image: 'xlink:href'
}
}

@ -0,0 +1,82 @@
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
},
node: {
// prevent webpack from injecting useless setImmediate polyfill because Vue
// source contains it (although only uses it if it's native).
setImmediate: false,
// prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty'
}
}

@ -0,0 +1,95 @@
'use strict'
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const path = require('path')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const portfinder = require('portfinder')
const HOST = process.env.HOST
const PORT = process.env.PORT && Number(process.env.PORT)
const devWebpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
},
// cheap-module-eval-source-map is faster for development
devtool: config.dev.devtool,
// these devServer options should be customized in /config/index.js
devServer: {
clientLogLevel: 'warning',
historyApiFallback: {
rewrites: [
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
],
},
hot: true,
contentBase: false, // since we use CopyWebpackPlugin.
compress: true,
host: HOST || config.dev.host,
port: PORT || config.dev.port,
open: config.dev.autoOpenBrowser,
overlay: config.dev.errorOverlay
? { warnings: false, errors: true }
: false,
publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable,
quiet: true, // necessary for FriendlyErrorsPlugin
watchOptions: {
poll: config.dev.poll,
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/dev.env')
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.dev.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
module.exports = new Promise((resolve, reject) => {
portfinder.basePort = process.env.PORT || config.dev.port
portfinder.getPort((err, port) => {
if (err) {
reject(err)
} else {
// publish the new Port, necessary for e2e tests
process.env.PORT = port
// add port to devServer config
devWebpackConfig.devServer.port = port
// Add FriendlyErrorsPlugin
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
compilationSuccessInfo: {
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
},
onErrors: config.dev.notifyOnErrors
? utils.createNotifierCallback()
: undefined
}))
resolve(devWebpackConfig)
}
})
})

@ -0,0 +1,145 @@
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const env = require('../config/prod.env')
const webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true,
usePostCSS: true
})
},
devtool: config.build.productionSourceMap ? config.build.devtool : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new UglifyJsPlugin({
uglifyOptions: {
compress: {
warnings: false
}
},
sourceMap: config.build.productionSourceMap,
parallel: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css'),
// Setting the following option to `false` will not extract CSS from codesplit chunks.
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
allChunks: true,
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: config.build.productionSourceMap
? { safe: true, map: { inline: false } }
: { safe: true }
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// keep module.id stable when vendor modules does not change
new webpack.HashedModuleIdsPlugin(),
// enable scope hoisting
new webpack.optimize.ModuleConcatenationPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks (module) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
minChunks: Infinity
}),
// This instance extracts shared chunks from code splitted chunks and bundles them
// in a separate chunk, similar to the vendor chunk
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
new webpack.optimize.CommonsChunkPlugin({
name: 'app',
async: 'vendor-async',
children: true,
minChunks: 3
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
const CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.bundleAnalyzerReport) {
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig

@ -0,0 +1,7 @@
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})

@ -0,0 +1,70 @@
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-module-eval-source-map',
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,
cssSourceMap: true
},
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
// 打包后访问返回 404/ 改为 ./
assetsPublicPath: './',
/**
* Source Maps
*/
productionSourceMap: true,
// https://webpack.js.org/configuration/devtool/#production
devtool: '#source-map',
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
}
};

@ -0,0 +1,4 @@
'use strict'
module.exports = {
NODE_ENV: '"production"'
}

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>花卉市场</title>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,66 @@
{
"name": "flower-mall",
"version": "1.0.0",
"description": "a project for nursing home ",
"author": "hide",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js"
},
"dependencies": {
"axios": "^0.21.1",
"element-ui": "^2.15.2",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vue-wechat-title": "^2.0.7",
"vuex": "^3.6.2"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}

@ -0,0 +1,25 @@
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
export default {
name: 'App',
data() {
return {
}
},
methods: {
},
}
</script>
<style scoped>
.el-input {
width: 180px;
}
</style>

@ -0,0 +1,108 @@
html, body, #app {
height: 100%;
margin: 0;
}
.el-card {
margin-top: 15px;
}
.el-pagination {
margin-top: 45px;
}
.el-table {
font-size: 18px;
}
.my-left {
float: left;
padding: 20px;
margin-top: -10px;
}
/* 标签 */
.el-tag {
font-size: 15px;
}
.my-title {
color: cornflowerblue;
float: left;
margin: 10px;
}
.create-btn {
float: right;
margin-top: -5px;
margin-right: 10px;
}
.small-input {
width: 150px;
float: left;
}
.search {
float: left;
margin-top: 80px;
margin-left: -100px;
margin-bottom: 20px;
}
.create {
float: right;
margin-right: 20px;
margin-top: 80px;
}
.mid-input {
width: 240px;
float: left;
}
.my-mid-input {
width: 240px;
}
.logout {
float: right;
margin-right: 30px;
margin-top: 10px;
}
.info-first-card {
margin: 20px;
margin-bottom: 20px;
}
.el-form-item {
margin-left: 30%;
}
.create-dialog-btn {
text-align: center;
}
.long-text {
margin-left: 20%;
}
.long-text-input {
float: left;
width: 400px;
}
.my-time-select {
float: left;
}
.detail {
margin-top: 40px;
text-align: center;
color: cornflowerblue;
font-size: 20px;
font-weight: bold;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

@ -0,0 +1,158 @@
<!--
* 用户购买首页
*
* @Author: ShanZhu
* @Date: 2024-01-24
-->
<template>
<div>
<!-- 操作面板 -->
<el-card class="goods-card">
<div>
<el-input v-model="param.searchKey" style="width: 240px" @keyup.enter.native="refresh(1)"
placeholder="内容"></el-input>
<el-button type="primary" icon="el-icon-search" @click="refresh(1)"></el-button>
</div>
</el-card>
<el-card class="main-card">
<el-row>
<el-col :span="8" v-for="(o, index) in list" :key="o" :offset="0.1">
<el-card style="padding:0px;margin:2px">
<img :src="list[index].img_guid">
<div style="padding: 14px;">
<div>
<el-tag>{{list[index].name}}</el-tag>
<br><br>
<span style="font-size: 20px;">价格</span><span style="color: #ff6a00;font-size: 20px;">{{list[index].price}}</span>
</div>
<br>
<div style="color: #d39696">{{list[index].detail}}</div>
<div class="bottom clearfix">
<el-button class="button button-add-cart" icon="el-icon-shopping-cart-1" type="success"
@click="addCart(list[index])">购买</el-button>
</div>
</div>
</el-card>
</el-col>
</el-row>
<!-- 分页 -->
<div>
<el-pagination
background
layout="prev, pager, next"
:total="pagination.total"
:page-size="pagination.pageSize"
:current-page="pagination.currentPage"
@current-change="pageChange">
</el-pagination>
</div>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
types: [],
param: {
page: 1,
searchKey: '',
searchType: '',
},
addParam: {
fid: 1,
flower: '',
account: window.sessionStorage.getItem("token"),
},
list: [],
pagination: {
total: 1,
pageSize: 9,
currentPage: 1,
},
}
},
methods: {
pageChange(page) {
this.refresh(page);
},
addCart(flower) {
this.addParam.fid = flower.id;
this.addParam.flower = flower.name;
console.log(this.addParam)
this.$http.post("/cart/create", this.addParam).then(result => {
let R = result.data; // R
if (R.code === 2000) {
this.$message.success(R.msg);
} else {
this.$message.error(R.msg);
}
});
},
refresh(page) {
if (page === undefined) {
page = 1;
}
//window.sessionStorage.getItem('token')
this.$http.get("/flower/find?page=" + page + "&searchKey=" + this.param.searchKey
+ "&searchType=" + this.param.searchType
).then(result => {
let R = result.data;
this.list = R.data.items;
console.log(this.list);
this.pagination.total = R.data.len;
this.pagination.currentPage = page;
})
},
},
created() {
this.refresh(1);
}
}
</script>
<style scoped>
.search-input {
width: 300px;
}
.updateForm {
width: 80%;
}
.btn-release {
float: right;
margin-top: 10px;
margin-right: 50px;
}
.form-releaseTask {
height: 300px;
}
.input-content-task {
width: 500px;
}
img {
margin-top: 10px;
width: 160px;
height: 160px;
}
.main-card {
background: #B3C0D1;
}
.button-add-cart {
float: right;
margin: 5px;
}
</style>

@ -0,0 +1,123 @@
<!--
* 网站首页
*
* @Author: ShanZhu
* @Date: 2024-01-24
-->
<template>
<div>
<!-- 操作面板 -->
<el-card class="goods-card">
<div>
<el-input v-model="param.searchKey" style="width: 240px" @keyup.enter.native="refresh(1)"
placeholder="内容"></el-input>
<el-button type="primary" icon="el-icon-search" @click="refresh(1)"></el-button>
</div>
</el-card>
<el-card class="main-card">
<el-row>
<el-col :span="8" v-for="(o, index) in list" :key="o" :offset="0.1">
<el-card style="padding:0px;margin:2px">
<img v-if=" list[index].img_guid==='static/imgs/'" src="static/imgs/back.jpg">
<img v-if=" list[index].img_guid.indexOf('.jpg') !== -1" :src="list[index].img_guid">
<div style="padding: 14px;">
<div><el-tag>{{list[index].name}}</el-tag>
<br><br>
<span style="font-size: 20px;">价格</span><span style="color: #ff6a00;font-size: 20px;">{{list[index].price}}</span>
</div>
<br>
<div style="color: #d39696">{{list[index].detail}}</div>
</div>
</el-card>
</el-col>
</el-row>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
types: [],
param: {
page: 1,
searchKey: '',
searchType: '',
},
list: [],
pagination: {
total: 1,
pageSize: 9,
currentPage: 1,
},
}
},
methods: {
pageChange(page) {
this.refresh(page);
},
refresh(page) {
if (page === undefined) {
page = 1;
}
this.$http.get("/flower/find?page=" + page + "&searchKey=" + this.param.searchKey
+ "&searchType=" + this.param.searchType
).then(result => {
let R = result.data;
this.list = R.data.items;
this.pagination.total = R.data.len;
this.pagination.currentPage = page;
})
},
},
created() {
this.refresh(1);
}
}
</script>
<style scoped>
.search-input {
width: 300px;
}
.updateForm {
width: 80%;
}
.btn-release {
float: right;
margin-top: 10px;
margin-right: 50px;
}
.form-releaseTask {
height: 300px;
}
.input-content-task {
width: 500px;
}
img {
margin-top: 10px;
width: 160px;
height: 160px;
}
.main-card {
background: #B3C0D1;
}
.button-add-cart{
float: right;
margin: 5px;
}
</style>

@ -0,0 +1,204 @@
<!--
* 登录页面
*
* @Author: ShanZhu
* @Date: 2024-01-24
-->
<template>
<div class="whole">
<div class="login">
<div class="title" style="color: #ff6a00">
<img src="../assets/imgs/logo.png" style="width: 40px;position: relative; top: 13px;right: 0px"/>
<span style="font-size: 20px">鲜花管理系统</span>
</div>
<div class="my-form">
<el-form :model="loginForm" status-icon size="small">
<el-form-item prop="account">
<el-input type="text" prefix-icon="el-icon-user-solid" v-model="loginForm.account"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input type="password" prefix-icon="el-icon-s-cooperation" v-model="loginForm.password"
autocomplete="off"></el-input>
</el-form-item>
<el-form-item class="btns">
<el-radio v-model="loginForm.role" label="user"></el-radio>
<el-radio v-model="loginForm.role" label="admin"></el-radio>
</el-form-item>
<el-form-item class="btns">
<el-button type="primary" @click="login()"></el-button>
<el-button type="warning" @click="reset()"></el-button>
<el-button type="success" @click="create"></el-button>
</el-form-item>
</el-form>
</div>
</div>
<!-- 注册 -->
<div >
<el-dialog
title="注册用户"
:visible.sync="createDialogVisible"
width="30%"
center
>
<div >
<el-form :model="addUser" label-width="80px" size="small">
<el-form-item label="账号">
<el-input class="mid-input" v-model="addUser.account"></el-input>
</el-form-item>
<el-form-item label="姓名">
<el-input class="mid-input" v-model="addUser.name"></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input class="mid-input" v-model="addUser.password"></el-input>
</el-form-item>
<el-form-item label="手机号">
<el-input class="mid-input" type="number" v-model="addUser.phone"></el-input>
</el-form-item>
<el-form-item label="地址">
<el-input class="mid-input" v-model="addUser.address"></el-input>
</el-form-item>
<div class="create-dialog-btn">
<el-button type="primary" @click="doCreate"></el-button>
<el-button type="warning" @click="cancel"></el-button>
</div>
</el-form>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
// import backImg from '../assets/imgs/1.jpg'
export default {
name: 'Login',
data() {
return {
createDialogVisible: false,
addUser: {
account: '',
name: '',
password: '',
phone: '',
address: ''
},
loginForm: {
account: '',
password: '',
role: 'user',
},
}
},
methods: {
changePage(path) {
this.$router.push(path)
},
create() {
this.reset();
this.createDialogVisible = true;
},
verify(user) {
return true;
},
doCreate() {
let flag = this.verify(this.addUser);
if (flag) {
this.$http.post("/user/create", this.addUser).then(result => {
let R = result.data; // R
if (R.code === 2000) {
this.$message.success(R.msg);
this.refresh(1);
} else {
this.$message.error(R.msg);
}
this.createDialogVisible = false;
});
}
},
cancel() {
this.createDialogVisible = false;
},
login() {
this.$http.post("/login/doLogin", this.loginForm).then(result => {
// result.data = R
let R = result.data;
let user = R.data;
if (R.code === 2000) {
window.sessionStorage.setItem('token', user.account);// account
window.sessionStorage.setItem('role', user.role);// account
this.$message.success(R.msg);
if (user.role === 'admin') {
this.$router.push('/home');
} else if (user.role === 'user') {
this.$router.push('/user');
} else {
this.$router.push('/404');
}
} else {
this.$message.error(R.msg);
}
})
},
reset() {
this.loginForm = {
account: '',
password: '',
role: 'user',
};
}
}
}
</script>
<style scoped>
body{
}
.whole {
background-image: url("~@/assets/imgs/bghalf-2.jpg") ;
background-size:100%;
height: 100%;
}
.login {
width: 450px;
height: 300px;
background-color: #fff;
border-radius: 3px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
opacity: 0.95;
}
.my-form {
margin-top: 75px;
width: 300px;
position: absolute;
left: 50%;
top: 36%;
transform: translate(-50%, -50%);
}
.btns {
text-align: center;
}
.title {
margin-top: 20px;
text-align: center;
color: dodgerblue;
}
.el-form-item {
margin-left: 5%;
}
</style>

@ -0,0 +1,161 @@
<template>
<div class="whole">
<el-container>
<el-header><div><b style="float: left;margin-top: -20px"><h2 style="color: #c09494">鲜花后台管理系统</h2></b>
<el-button class="logout" type="warning" @click="logout">退</el-button>
</div></el-header>
<el-container>
<el-aside width="200px">
<!-- #575757 -->
<el-menu
router
default-active="index"
class="el-menu-vertical-demo"
background-color="#545c64"
text-color="#fff"
active-text-color="#c09494">
<el-menu-item index="index">
<i class="el-icon-menu"></i>
网站首页
</el-menu-item>
<el-menu-item index="users">
<i class="el-icon-document"></i>
<span>用户管理</span>
</el-menu-item>
<el-menu-item index="flowers">
<i class="el-icon-document"></i>
<span>商品管理</span>
</el-menu-item>
<el-menu-item index="flower_type">
<i class="el-icon-document"></i>
<span>种类管理</span>
</el-menu-item>
<el-menu-item index="orders">
<i class="el-icon-document"></i>
<span>订单管理</span>
</el-menu-item>
</el-menu>
</el-aside>
<el-container>
<!-- 主体区域 -->
<el-main>
<router-view></router-view>
</el-main>
</el-container>
</el-container>
</el-container>
</div>
</template>
<script>
export default {
name: 'App',
data() {
return {
activeIndex: 1,
}
},
methods: {
changePage(path) {
this.$router.push(path)
},
logout(){
this.$router.push('/login');
},
},
}
</script>
<style scoped>
.whole {
height: 100%;
}
.el-header, .el-footer {
background-color: #B3C0D1;
color: #333;
text-align: center;
line-height: 60px;
}
.el-aside {
background-color: #D3DCE6;
color: #333;
text-align: center;
line-height: 200px;
}
.el-menu {
border-right: none;
}
.el-main {
background-color: #E9EEF3;
color: #333;
text-align: center;
line-height: 20px;
}
body > .el-container {
margin-bottom: 40px;
}
.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
line-height: 260px;
}
.el-container .el-aside {
line-height: 320px;
}
.my-menu {
position: absolute;
margin-top: 10px;
margin-left: 10px;
}
.main {
height: 80%;
}
.el-container {
height: 100%;
}
.el-header {
background-color: #ffffff;
}
.el-aside {
height: 100%;
background-color: #545c64;
}
.el-main {
background-color: #efe8e8;
}
.menu-child-item {
margin-left: 20px;
}
.el-footer {
background-color: cornflowerblue;
}
.welcome {
float: left;
color: cornflowerblue;
}
</style>

@ -0,0 +1,474 @@
<!--
* 鲜花管理页面
*
* @Author: ShanZhu
* @Date: 2024-01-24
-->
<template>
<div>
<!-- 操作面板 -->
<el-card>
<div>
<h2 class="my-title">商品管理</h2>
</div>
<div class="search">
<el-input v-model="param" style="width: 240px" @keyup.enter.native="refresh(1)"
placeholder="名称"></el-input>
<el-button type="primary" icon="el-icon-search" @click="refresh(1)"></el-button>
</div>
<div class="create">
<el-button type="success" @click="create"></el-button>
</div>
</el-card>
<!-- 表格面板 -->
<el-card>
<el-table
:data="list"
>
<el-table-column
label="#"
align="center"
width="200">
<template slot-scope="scope">
<img v-if="scope.row.img_guid.indexOf('.jpg') === -1" src="static/imgs/img.jpg">
<img v-if="scope.row.img_guid.indexOf('.jpg') !== -1" :src="scope.row.img_guid">
</template>
</el-table-column>
<el-table-column
prop="name"
label="名称"
align="center"
>
</el-table-column>
<el-table-column
prop="species_name"
label="分类"
align="center"
>
</el-table-column>
<el-table-column
prop="price"
label="价格"
align="center"
>
</el-table-column>
<el-table-column
prop="detail"
label="详细介绍"
align="center"
>
</el-table-column>
<el-table-column
prop="species_name"
label="状态"
align="center"
>
<template slot-scope="scope">
<el-switch
v-model="scope.row.state === 1"
@change="changeState(scope.row)"
>
</el-switch>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="300px"
>
<template slot-scope="scope">
<el-button type="primary" @click="update(scope.row)"></el-button>
<el-button type="success" @click="updateImg(scope.row)"></el-button>
<el-popconfirm
title="确定删除吗?"
@confirm="doDelete"
>
<el-button type="danger" slot="reference" @click="del(scope.row.id)"></el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<div>
<el-pagination
background
layout="prev, pager, next"
:total="pagination.total"
:page-size="pagination.pageSize"
:current-page="pagination.currentPage"
@current-change="pageChange">
</el-pagination>
</div>
</el-card>
<!-- 修改 -->
<div>
<el-dialog
title="修改商品信息"
:visible.sync="updateDialogVisible"
width="50%"
>
<div>
<el-form :model="updateFlower" label-width="80px" size="small">
<el-form-item label="名称">
<el-input class="small-input" v-model="updateFlower.name"></el-input>
</el-form-item>
<el-form-item label="分类">
<el-select v-model="updateFlower.species_name" placeholder="请选择">
<el-option
:key="key"
v-for="item in species"
:label="item.species_name"
:value="item.species_name"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="价格">
<el-input class="small-input" type="number" v-model="updateFlower.price"></el-input>
</el-form-item>
<el-form-item label="详情">
<el-input class="small-input" v-model="updateFlower.detail"></el-input>
</el-form-item>
<div class="create-dialog-btn">
<el-button type="primary" @click="doUpdate"></el-button>
<el-button type="warning" @click="cancel"></el-button>
</div>
</el-form>
</div>
</el-dialog>
</div>
<!-- 更新商品图片 -->
<div>
<el-dialog
title="更新图片"
:visible.sync="imgDialogVisible"
width="50%"
>
<div>
<el-form :model="addFlower" label-width="80px" size="small">
<el-upload
class="upload-demo"
action="http://localhost:8081/flower/updateImg"
:on-change="handleChange"
:on-success="uploadImgOK"
:file-list="fileList"
accept=".jpg,.jpeg,.png,.gif,.bmp,.pdf,.JPG,.JPEG,.PBG,.GIF,.BMP,.PDF"
>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-form>
</div>
</el-dialog>
</div>
<!-- 新增 -->
<div>
<el-dialog
title="新建商品"
:visible.sync="createDialogVisible"
width="50%"
>
<div>
<el-form :model="addFlower" label-width="80px" size="small">
<el-form-item label="名称">
<el-input class="small-input" v-model="addFlower.name"></el-input>
</el-form-item>
<el-form-item label="分类">
<el-select v-model="addFlower.species_name" placeholder="请选择">
<el-option
:key="key"
v-for="item in species"
:label="item.species_name"
:value="item.species_name"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="价格">
<el-input class="small-input" type="number" v-model="addFlower.price"></el-input>
</el-form-item>
<el-form-item label="详情">
<el-input class="small-input" v-model="addFlower.detail"></el-input>
</el-form-item>
<div class="create-dialog-btn">
<el-button type="primary" @click="doCreate"></el-button>
<el-button type="warning" @click="cancel"></el-button>
</div>
</el-form>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
export default {
data() {
return {
fileList: [],
updateImgId: 0,
param: '',
imgDialogVisible: false,
updateDialogVisible: false,
createDialogVisible: false,
//
species:[
{
id: 1,
species_name: '春日'
},
{
id: 1,
species_name: '夏日'
},
{
id: 1,
species_name: '秋日'
}
],
updateFlower: {
id: '',
name: '',
species_name: '',
price: '',
detail: '',
},
addFlower: {
name: '',
species_name: '',
price: '',
detail: '',
},
leader_accounts: [],
list: [],
delId: 0,
pagination: {
total: 1,
pageSize: 5,
currentPage: 1,
},
file: '',
}
},
methods: {
handleChange(file, fileList) {
// this.$refs
// this.fileList = fileList.slice(0);
},
// {code: 2000
// data: "1a8b9301f2744833ad48529fba672198.jpg"
// msg: ""}
uploadImgOK(response, file, fileList) {
this.$http.put("/flower/updateImgGuid?guid="+response.data + "&id="+this.updateImgId).then(result => {
let R = result.data; // R
this.imgDialogVisible = false;
if (R.code === 2000) {
this.$message.success(R.msg);
this.refresh(this.pagination.currentPage);
} else {
this.$message.error(R.msg);
}
})
},
// updateFile(event) {
// let file = event.target.files;
// event.preventDefault();
// let formData = new FormData();
// formData.append('id',this.updateImgId);
// formData.append('file', file);
// let config = {
// headers: {
// 'Content-Type': 'multipart/form-data'
// }
// };
// this.$http.post('/flower/updateImg', formData, config).then(function (response) {
// let R = result.data; // R
// if (R.code === 2000) {
// this.$message.success(R.msg);
// this.refresh(this.pagination.currentPage);
// } else {
// this.$message.error(R.msg);
// }});
// this.imgDialogVisible = false;
// // (console.logfile)
// // let file = event.target.files;
// // console.log(file);
// // this.file = file;
// // do something...
// },
cancel() {
this.imgDialogVisible = false;
this.updateDialogVisible = false;
this.createDialogVisible = false;
},
updateImg(row) {
this.updateImgId = row.id;
this.imgDialogVisible = true;
},
changeState(row) {
let obj = {
id: row.id,
state: row.state===0?1:0
};
this.$http.put("/flower/changeState", obj).then(result => {
let R = result.data; // R
if (R.code === 2000) {
this.$message.success(R.msg);
this.refresh(this.pagination.currentPage);
} else {
this.$message.error(R.msg);
}
})
},
update(row) {
this.updateDialogVisible = true;
this.updateFlower.id = row.id;
this.updateFlower.name = row.name;
this.updateFlower.price = row.price;
this.updateFlower.species_name = row.species_name;
this.updateFlower.detail = row.detail;
},
doUpdate() {
this.$http.put("/flower/update", this.updateFlower).then(result => {
let R = result.data; // R
if (R.code === 2000) {
this.$message.success(R.msg);
this.refresh(this.pagination.currentPage);
} else {
this.$message.error(R.msg);
}
this.updateDialogVisible = false;
})
},
del(id) {
this.delId = id;
},
doDelete() {
this.$http.delete("/flower/delete?id=" + this.delId).then(result => {
let R = result.data; // R
if (R.code === 2000) {
this.$message.success(R.msg);
this.refresh(1);
} else {
this.$message.error(R.msg);
}
})
},
create() {
this.reset();
this.$http.get("/species/findAll").then(result => {
let R = result.data;
this.species = R.data;
});
this.createDialogVisible = true;
},
verify(flower) {
if (flower.name.length < 2 || flower.species_name === undefined || flower.price.length < 1 || flower.detail.length < 2) {
this.$message.warning('商品名称至少为 2 个字符,请修改');
return false;
}
return true;
},
reset() {
this.addFlower = {
id: '',
name: '',
price: '',
detail: '',
};
},
doCreate() {
console.log(this.addFlower);
let flag = this.verify(this.addFlower);
if (flag) {
this.$http.post("/flower/create", this.addFlower).then(result => {
let R = result.data; // R
if (R.code === 2000) {
this.$message.success(R.msg);
this.createDialogVisible = false;
this.refresh(1);
} else {
this.$message.error(R.msg);
}
});
}
},
pageChange(page) {
this.refresh(page);
},
refresh(page) {
if (page === undefined) {
page = 1;
}
//window.sessionStorage.getItem('token')
this.$http.get("/flower/findAll?page=" + page + "&searchKey=" + this.param).then(result => {
let R = result.data;
this.list = R.data.items;
this.pagination.total = R.data.len * this.pagination.pageSize;
this.pagination.currentPage = page;
})
},
},
created() {
this.refresh();
}
}
</script>
<style scoped>
img{
width: 200px;
height: 200px;
}
.search-input {
width: 300px;
}
.updateForm {
width: 80%;
}
.btn-release {
float: right;
margin-top: 10px;
margin-right: 50px;
}
.form-releaseTask {
height: 300px;
}
.input-content-task {
width: 500px;
}
.my-el-table {
text-align: center;
}
.el-select{
margin-left: -53%;
}
</style>

@ -0,0 +1,194 @@
<!--
* 订单管理页面
*
* @Author: ShanZhu
* @Date: 2024-01-24
-->
<template>
<div>
<!-- 操作面板 -->
<el-card>
<div>
<h2 class="my-title">订单管理</h2>
</div>
<div class="search">
<el-input v-model="searchKey" style="width: 240px" @keyup.enter.native="refresh(1)"
placeholder="商品名称"></el-input>
<el-button type="primary" icon="el-icon-search" @click="refresh(1)"></el-button>
</div>
</el-card>
<!-- 表格面板 -->
<el-card>
<el-table
:data="list"
class="my-el-table"
>
<el-table-column
label="#"
type="index"
width="150">
</el-table-column>
<el-table-column
prop="username"
label="买家"
>
</el-table-column>
<el-table-column
prop="flower"
label="商品"
>
</el-table-column>
<el-table-column
prop="amount"
label="数量"
>
</el-table-column>
<el-table-column
prop="price"
label="价格(元)"
>
</el-table-column>
<el-table-column
prop="phone"
label="联系电话"
>
</el-table-column>
<el-table-column
prop="address"
label="地址"
>
</el-table-column>
<el-table-column
label="状态"
>
<template slot-scope="scope">
<el-switch
v-model="scope.row.state === 1"
@change="changeState(scope.row)"
>
</el-switch>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
>
<template slot-scope="scope">
<el-popconfirm
title="确定删除吗?"
@confirm="doDelete"
>
<el-button type="danger" slot="reference" @click="del(scope.row.id)"></el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination
background
layout="prev, pager, next"
:total="pagination.total"
:page-size="pagination.pageSize"
:current-page="pagination.currentPage"
@current-change="pageChange">
</el-pagination>
</div>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
searchKey: '',
accounts: [],
list: [],
delId: 0,
pagination: {
total: 1,
pageSize: 5,
currentPage: 1,
},
}
},
methods: {
pageChange(page) {
this.refresh(page);
},
changeState(order) {
let obj = {
id: order.id,
state: order.state===0?1:0
};
this.$http.put("/order/changeState", obj).then(result => {
let R = result.data; // R
if (R.code === 2000) {
this.$message.success(R.msg);
this.refresh(this.pagination.currentPage);
} else {
this.$message.error(R.msg);
}
})
},
refresh(page) {
if (page === undefined) {
page = 1;
}
this.$http.get("/order/findAll?page=" + page + "&searchKey=" + this.searchKey ).then(result => {
let R = result.data;
this.list = R.data.items;
this.pagination.total = R.data.len;
this.pagination.currentPage = page;
})
},
del(id) {
this.delId = id;
},
doDelete() {
this.$http.delete("/order/delete?id=" + this.delId).then(result => {
let R = result.data;
this.$message.success(R.msg);
this.refresh(1);
})
},
},
created() {
this.refresh();
}
}
</script>
<style scoped>
.search-input {
width: 300px;
}
.updateForm {
width: 80%;
}
.btn-release {
float: right;
margin-top: 10px;
margin-right: 50px;
}
.form-releaseTask {
height: 300px;
}
.input-content-task {
width: 500px;
}
</style>

@ -0,0 +1,274 @@
<!--
* 鲜花类型管理
*
* @Author: ShanZhu
* @Date: 2024-01-24
-->
<template>
<div>
<!-- 操作面板 -->
<el-card>
<div>
<h2 class="my-title">类型管理</h2>
</div>
<div class="search">
<el-input v-model="param" style="width: 240px" @keyup.enter.native="refresh(1)"
placeholder="名称"></el-input>
<el-button type="primary" icon="el-icon-search" @click="refresh(1)"></el-button>
</div>
<div class="create">
<el-button type="success" @click="create"></el-button>
</div>
</el-card>
<!-- 表格面板 -->
<el-card>
<el-table
:data="list"
>
<el-table-column
label="#"
type="index"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="species_name"
label="名称"
align="center"
>
</el-table-column>
<el-table-column
label="操作"
align="center"
>
<template slot-scope="scope">
<el-button type="primary" @click="update(scope.row)"></el-button>
<el-popconfirm
title="确定删除吗?"
@confirm="doDelete"
>
<el-button type="danger" slot="reference" @click="del(scope.row.id)"></el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<div>
<el-pagination
background
layout="prev, pager, next"
:total="pagination.total"
:page-size="pagination.pageSize"
:current-page="pagination.currentPage"
@current-change="pageChange">
</el-pagination>
</div>
</el-card>
<!-- 修改 -->
<div>
<el-dialog
title="修改类型信息"
:visible.sync="updateDialogVisible"
width="50%"
>
<div>
<el-form :model="updateSpecies" label-width="80px" size="small">
<el-form-item label="">
<el-input class="small-input" type="hidden" v-model="updateSpecies.id"></el-input>
</el-form-item>
<el-form-item label="类型">
<el-input class="small-input" v-model="updateSpecies.species_name"></el-input>
</el-form-item>
<div class="create-dialog-btn">
<el-button type="primary" @click="doUpdate"></el-button>
<el-button type="warning" @click="cancel"></el-button>
</div>
</el-form>
</div>
</el-dialog>
</div>
<!-- 新增 -->
<div>
<el-dialog
title="新建类型"
:visible.sync="createDialogVisible"
width="50%"
>
<div>
<el-form :model="addSpecies" label-width="80px" size="small">
<el-form-item label="类型">
<el-input class="small-input" v-model="addSpecies.species_name"></el-input>
</el-form-item>
<div class="create-dialog-btn">
<el-button type="primary" @click="doCreate"></el-button>
<el-button type="warning" @click="cancel"></el-button>
</div>
</el-form>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
export default {
data() {
return {
param: '',
updateDialogVisible: false,
createDialogVisible: false,
updateSpecies: {
id: '',
species_name: '',
},
addSpecies: {
id: 0,
species_name: '',
},
leader_accounts: [],
list: [],
delId: 0,
pagination: {
total: 1,
pageSize: 5,
currentPage: 1,
},
}
},
methods: {
cancel() {
this.updateDialogVisible = false;
this.createDialogVisible = false;
},
update(row) {
this.updateDialogVisible = true;
this.updateSpecies.id = row.id;
this.updateSpecies.species_name = row.species_name;
},
doUpdate() {
this.$http.put("/species/update", this.updateSpecies).then(result => {
let R = result.data; // R
if (R.code === 2000) {
this.updateDialogVisible = false;
this.$message.success(R.msg);
this.refresh(this.pagination.currentPage);
} else {
this.$message.error(R.msg);
}
this.updateDialogVisible = false;
})
},
del(id) {
this.delId = id;
},
doDelete() {
this.$http.delete("/species/delete?id=" + this.delId).then(result => {
let R = result.data; // R
if (R.code === 2000) {
this.$message.success(R.msg);
this.refresh(1);
} else {
this.$message.error(R.msg);
}
})
},
create() {
this.reset();
this.createDialogVisible = true;
},
verify() {
if (this.addSpecies.species_name === undefined || this.addSpecies.species_name.length < 2) {
this.$message.warning('类型名称至少为 2 个字符,请修改');
return false;
}
return true;
},
reset() {
this.addSpecies = {
account: '',
password: '',
name: '',
phone: '',
address: ''
};
},
doCreate() {
let flag = this.verify();
if (flag) {
this.$http.post("/species/create", this.addSpecies).then(result => {
let R = result.data; // R
if (R.code === 2000) {
this.$message.success(R.msg);
this.createDialogVisible = false;
this.refresh(1);
} else {
this.$message.error(R.msg);
}
});
}
},
pageChange(page) {
this.refresh(page);
},
refresh(page) {
if (page === undefined) {
page = 1;
}
//window.sessionStorage.getItem('token')
this.$http.get("/species/find?page=" + page + "&searchKey=" + this.param).then(result => {
let R = result.data;
this.list = R.data.items;
this.pagination.total = R.data.len * this.pagination.pageSize;
this.pagination.currentPage = page;
})
},
},
created() {
this.refresh();
}
}
</script>
<style scoped>
.search-input {
width: 300px;
}
.updateForm {
width: 80%;
}
.btn-release {
float: right;
margin-top: 10px;
margin-right: 50px;
}
.form-releaseTask {
height: 300px;
}
.input-content-task {
width: 500px;
}
.my-el-table {
text-align: center;
}
</style>

@ -0,0 +1,336 @@
<!--
* 用户管理
*
* @Author: ShanZhu
* @Date: 2024-01-24
-->
<template>
<div>
<!-- 操作面板 -->
<el-card>
<div>
<h2 class="my-title">用户管理</h2>
</div>
<div class="search">
<el-input v-model="param" style="width: 240px" @keyup.enter.native="refresh(1)"
placeholder="账号 / 姓名"></el-input>
<el-button type="primary" icon="el-icon-search" @click="refresh(1)"></el-button>
</div>
<div class="create">
<el-button type="success" @click="create"></el-button>
</div>
</el-card>
<!-- 表格面板 -->
<el-card>
<el-table
:data="list"
>
<el-table-column
label="#"
type="index"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="account"
label="账号"
align="center"
>
</el-table-column>
<el-table-column
prop="name"
label="姓名"
align="center"
>
</el-table-column>
<el-table-column
prop="password"
label="密码"
align="center"
>
</el-table-column>
<el-table-column
prop="phone"
label="电话"
width="150"
align="center"
>
</el-table-column>
<el-table-column
prop="address"
label="地址"
width="300"
align="center"
>
</el-table-column>
<el-table-column
label="操作"
align="center"
>
<template slot-scope="scope">
<el-button type="primary" @click="update(scope.row)"></el-button>
<el-popconfirm
title="确定删除吗?"
@confirm="doDelete"
>
<el-button type="danger" slot="reference" @click="del(scope.row.id)"></el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<div>
<el-pagination
background
layout="prev, pager, next"
:total="pagination.total"
:page-size="pagination.pageSize"
:current-page="pagination.currentPage"
@current-change="pageChange">
</el-pagination>
</div>
</el-card>
<!-- 修改 -->
<div>
<el-dialog
title="修改用户信息"
:visible.sync="updateDialogVisible"
width="50%"
>
<div>
<el-form :model="updateUser" label-width="80px" size="small">
<el-form-item label="">
<el-input class="small-input" type="hidden" v-model="updateUser.id"></el-input>
</el-form-item>
<el-form-item label="账号">
<el-input class="small-input" readonly="readonly" v-model="updateUser.account"></el-input>
</el-form-item>
<el-form-item label="姓名">
<el-input class="small-input" v-model="updateUser.name"></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input class="small-input" v-model="updateUser.password"></el-input>
</el-form-item>
<el-form-item label="手机号">
<el-input class="small-input" type="number" v-model="updateUser.phone"></el-input>
</el-form-item>
<el-form-item label="地址">
<el-input class="small-input" v-model="updateUser.address"></el-input>
</el-form-item>
<div class="create-dialog-btn">
<el-button type="primary" @click="doUpdate"></el-button>
<el-button type="warning" @click="cancel"></el-button>
</div>
</el-form>
</div>
</el-dialog>
</div>
<!-- 新增 -->
<div>
<el-dialog
title="新建用户"
:visible.sync="createDialogVisible"
width="50%"
>
<div>
<el-form :model="addUser" label-width="80px" size="small">
<el-form-item label="账号">
<el-input class="small-input" v-model="addUser.account"></el-input>
</el-form-item>
<el-form-item label="姓名">
<el-input class="small-input" v-model="addUser.name"></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input class="small-input" v-model="addUser.password"></el-input>
</el-form-item>
<el-form-item label="手机号">
<el-input class="small-input" type="number" v-model="addUser.phone"></el-input>
</el-form-item>
<el-form-item label="地址">
<el-input class="small-input" v-model="addUser.address"></el-input>
</el-form-item>
<div class="create-dialog-btn">
<el-button type="primary" @click="doCreate"></el-button>
<el-button type="warning" @click="cancel"></el-button>
</div>
</el-form>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
export default {
data() {
return {
param: '',
createDialogVisible: false,
updateDialogVisible: false,
updateUser: {
id: '',
account: '',
name: '',
password: '',
phone: '',
address: ''
},
addUser: {
account: '',
name: '',
password: '',
phone: '',
address: ''
},
list: [],
delId: 0,
pagination: {
total: 1,
pageSize: 5,
currentPage: 1,
},
}
},
methods: {
cancel() {
this.updateDialogVisible = false;
this.createDialogVisible = false;
},
update(row) {
this.updateDialogVisible = true;
this.updateUser = row;
},
doUpdate() {
this.$http.put("/user/update", this.updateUser).then(result => {
let R = result.data; // R
if (R.code === 2000) {
this.updateDialogVisible = false;
this.$message.success(R.msg);
this.refresh(this.pagination.currentPage);
} else {
this.$message.error(R.msg);
}
})
},
del(id) {
this.delId = id;
},
doDelete() {
this.$http.delete("/user/delete?id=" + this.delId).then(result => {
let R = result.data; // R
if (R.code === 2000) {
this.$message.success(R.msg);
this.refresh(1);
} else {
this.$message.error(R.msg);
}
})
},
create() {
this.reset();
this.createDialogVisible = true;
},
verify(user) {
return true;
},
reset() {
this.addUser = {
account: '',
password: '',
name: '',
phone: '',
address: ''
};
},
doCreate() {
let flag = this.verify(this.addUser);
if (flag) {
this.$http.post("/user/create", this.addUser).then(result => {
let R = result.data; // R
if (R.code === 2000) {
this.$message.success(R.msg);
this.createDialogVisible = false;
this.refresh(1);
} else {
this.$message.error(R.msg);
}
});
}
},
pageChange(page) {
this.refresh(page);
},
refresh(page) {
if (page === undefined) {
page = 1;
}
//window.sessionStorage.getItem('token')
this.$http.get("/user/find?page=" + page + "&searchKey=" + this.param).then(result => {
let R = result.data;
this.list = R.data.items;
this.pagination.total = R.data.len * this.pagination.pageSize;
this.pagination.currentPage = page;
})
},
},
created() {
this.refresh();
}
}
</script>
<style scoped>
.search-input {
width: 300px;
}
.updateForm {
width: 80%;
}
.btn-release {
float: right;
margin-top: 10px;
margin-right: 50px;
}
.form-releaseTask {
height: 300px;
}
.input-content-task {
width: 500px;
}
.my-el-table {
text-align: center;
}
</style>

@ -0,0 +1,168 @@
<template>
<div class="whole">
<el-container>
<el-header>
<div><b style="float: left;margin-top: -20px"><h2 style="color: #d79797">鲜花管理系统</h2></b>
<el-button class="logout" type="warning" @click="logout">退</el-button>
</div>
</el-header>
<el-container>
<el-aside width="200px">
<el-menu
router
:default-active="defaultUrl"
class="el-menu-vertical-demo"
background-color="#545c64"
text-color="#fff"
active-text-color="#d79797"
>
<el-menu-item index="goods">
<i class="el-icon-menu"></i>
商品列表
</el-menu-item>
<el-menu-item index="cart">
<i class="el-icon-document"></i>
<span>购物车</span>
</el-menu-item>
<el-menu-item index="order">
<i class="el-icon-document"></i>
<span>我的订单</span>
</el-menu-item>
<el-menu-item index="updateInfo">
<i class="el-icon-document"></i>
<span>个人信息</span>
</el-menu-item>
</el-menu>
</el-aside>
<el-container>
<!-- 主体区域 -->
<el-main>
<router-view></router-view>
</el-main>
</el-container>
</el-container>
</el-container>
</div>
</template>
<script>
export default {
data() {
return {
activeIndex: 1,
defaultUrl: 'goods',
}
},
//
watch: {
'$route': 'getPath'
},
methods: {
getPath() {
this.defaultUrl = this.$route.path.replace('/', '');
console.log(this.defaultUrl)
},
changePage(path) {
this.$router.push(path)
},
logout() {
this.$router.push('/login');
},
},
}
</script>
<style scoped>
.whole {
height: 100%;
}
.el-header, .el-footer {
background-color: #B3C0D1;
color: #333;
text-align: center;
line-height: 60px;
}
.el-aside {
background-color: #D3DCE6;
color: #333;
text-align: center;
line-height: 200px;
}
.el-menu {
border-right: none;
}
.el-main {
background-color: #E9EEF3;
color: #333;
text-align: center;
line-height: 20px;
}
body > .el-container {
margin-bottom: 40px;
}
.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
line-height: 260px;
}
.el-container .el-aside {
line-height: 320px;
}
.my-menu {
position: absolute;
margin-top: 10px;
margin-left: 10px;
}
.main {
height: 80%;
}
.el-container {
height: 100%;
}
.el-header {
background-color: #ffffff;
}
.el-aside {
height: 100%;
background-color: #545c64;
}
.el-main {
background-color: #efe8e8;
}
.menu-child-item {
margin-left: 20px;
}
.el-footer {
background-color: cornflowerblue;
}
.welcome {
float: left;
color: cornflowerblue;
}
</style>

@ -0,0 +1,156 @@
<!--
* 购物车挂历页面
*
* @Author: ShanZhu
* @Date: 2024-01-24
-->
<template>
<div>
<!-- 操作面板 -->
<el-card>
<div>
<h2 class="my-title" style="margin-bottom: 20px">我的购物车</h2>
<el-popconfirm
:title="orderMsg"
@confirm="doBuy"
>
<el-button class="buy" type="primary" slot="reference" @click="buy()"></el-button>
</el-popconfirm>
</div>
</el-card>
<!-- 表格面板 -->
<el-card>
<el-table
:data="list"
class="my-el-table"
>
<el-table-column
label="#"
type="index"
width="150">
</el-table-column>
<el-table-column
prop="flower"
label="商品"
>
</el-table-column>
<el-table-column
prop="amount"
label="数量"
>
</el-table-column>
<el-table-column
prop="price"
label="价格(元)"
>
</el-table-column>
<el-table-column
label="操作"
align="center"
>
<template slot-scope="scope">
<el-popconfirm
title="确定删除吗?"
@confirm="doDelete"
>
<el-button type="danger" slot="reference" @click="del(scope.row.id)"></el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
list: [],
orderMsg: '',
delId: 0,
}
},
methods: {
pageChange(page) {
this.refresh(page);
},
refresh(page) {
if (page === undefined) {
page = 1;
}
//window.sessionStorage.getItem('token')
this.$http.get("/cart/queryByAccount?account=" + window.sessionStorage.getItem('token')).then(result => {
let R = result.data;
this.list = R.data;
})
},
del(id){
this.delId = id;
},
buy(){
let amount = 0;
for (let i = 0; i < this.list.length; i++) {
amount = amount + this.list[i].price;
}
this.orderMsg = '总计 ' + amount +' 元,确认购买?';
},
doDelete(){
this.$http.delete("/cart/delete?id=" + this.delId).then(result => {
let R = result.data;
this.$message.success(R.msg);
this.refresh(1);
})
},
doBuy(){
this.$http.get("/cart/buy?account=" + window.sessionStorage.getItem("token")).then(result => {
let R = result.data;
this.$message.success(R.msg);
this.refresh(1);
})
},
},
created() {
this.refresh();
}
}
</script>
<style scoped>
.buy{
float: right;
margin-right: 20px;
margin-bottom: 10px;
}
.search-input {
width: 300px;
}
.updateForm {
width: 80%;
}
.btn-release {
float: right;
margin-top: 10px;
margin-right: 50px;
}
.form-releaseTask {
height: 300px;
}
.input-content-task {
width: 500px;
}
</style>

@ -0,0 +1,148 @@
<!--
* 我的订单
*
* @Author: ShanZhu
* @Date: 2024-01-24
-->
<template>
<div>
<!-- 操作面板 -->
<el-card>
<div>
<h2 class="my-title">我的订单</h2>
</div>
<div class="search">
<el-input v-model="searchKey" style="width: 240px" @keyup.enter.native="refresh(1)"
placeholder="账号 / 姓名"></el-input>
<el-button type="primary" icon="el-icon-search" @click="refresh(1)"></el-button>
</div>
</el-card>
<!-- 表格面板 -->
<el-card>
<el-table
:data="list"
class="my-el-table"
>
<el-table-column
label="#"
type="index"
width="150">
</el-table-column>
<el-table-column
prop="flower"
label="商品"
>
</el-table-column>
<el-table-column
prop="amount"
label="数量"
>
</el-table-column>
<el-table-column
prop="price"
label="价格(元)"
>
</el-table-column>
<el-table-column
label="状态"
>
<template slot-scope="scope">
<el-tag v-if="scope.row.state === 1" type="success"></el-tag>
<el-tag v-if="scope.row.state === 0" type="warning"></el-tag>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
>
<template slot-scope="scope">
<el-popconfirm
title="确定删除吗?"
@confirm="doDelete"
>
<el-button type="danger" slot="reference" @click="del(scope.row.id)"></el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
searchKey: '',
accounts: [],
list: [],
delId: 0,
pagination: {
total: 1,
pageSize: 5,
currentPage: 1,
},
}
},
methods: {
pageChange(page) {
this.refresh(page);
},
refresh(page) {
if (page === undefined) {
page = 1;
}
this.$http.get("/order/find?page=" + page + "&searchKey=" + this.searchKey + "&account=" + window.sessionStorage.getItem('token')).then(result => {
let res = result.data;
this.list = res.data.items;
this.pagination.total = res.data.len;
this.pagination.currentPage = page;
})
},
del(id) {
this.delId = id;
},
doDelete() {
this.$http.delete("/order/delete?id=" + this.delId).then(result => {
let R = result.data;
this.$message.success(R.msg);
this.refresh(1);
})
},
},
created() {
this.refresh();
}
}
</script>
<style scoped>
.search-input {
width: 300px;
}
.updateForm {
width: 80%;
}
.btn-release {
float: right;
margin-top: 10px;
margin-right: 50px;
}
.form-releaseTask {
height: 300px;
}
.input-content-task {
width: 500px;
}
</style>

@ -0,0 +1,182 @@
<!--
* 个人信息修改页面
*
* @Author: ShanZhu
* @Date: 2024-01-24
-->
<template>
<div>
<el-card>
<div class="info-first-card">
<h2 class="user-info-title">我的个人信息</h2>
<el-button class="save" @click="update" type="primary" style="margin-bottom: 20px">修改</el-button>
</div>
</el-card>
<el-card class="box-card user-info-card">
<div>
<div class="user-info-data">
<el-form :model="user" label-width="120px">
<el-form-item label="姓名:">
{{user.name}}
</el-form-item>
<el-form-item label="账号:">
{{user.account}}
</el-form-item>
<el-form-item label="密码:">
{{user.password}}
</el-form-item>
<el-form-item label="手机:">
{{user.phone}}
</el-form-item>
<el-form-item label="地址:">
{{user.address}}
</el-form-item>
</el-form>
</div>
</div>
<div>
<el-dialog
title="修改用户信息"
:visible.sync="updateDialogVisible"
width="50%"
>
<div>
<el-form :model="updateUser" label-width="80px" size="small">
<el-form-item label="">
<el-input class="small-input" type="hidden" v-model="updateUser.id"></el-input>
</el-form-item>
<el-form-item label="账号">
<el-input class="small-input" readonly="readonly" v-model="updateUser.account"></el-input>
</el-form-item>
<el-form-item label="姓名">
<el-input class="small-input" v-model="updateUser.name"></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input class="small-input" v-model="updateUser.password"></el-input>
</el-form-item>
<el-form-item label="手机号">
<el-input class="small-input" type="number" v-model="updateUser.phone"></el-input>
</el-form-item>
<el-form-item label="地址">
<el-input class="small-input" v-model="updateUser.address"></el-input>
</el-form-item>
<div class="create-dialog-btn">
<el-button type="primary" @click="doUpdate"></el-button>
<el-button type="warning" @click="cancel"></el-button>
</div>
</el-form>
</div>
</el-dialog>
</div>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
user: {
id: "",
account: window.sessionStorage.getItem('token'),
name: '',
password: '',
phone: '',
address: '',
},
updateDialogVisible: false,
updateUser: {
id: '',
account: '',
name: '',
password: '',
phone: '',
address: ''
},
}
},
methods: {
cancel() {
this.updateDialogVisible = false;
this.createDialogVisible = false;
},
update() {
this.updateDialogVisible = true;
this.updateUser.id = this.user.id;
this.updateUser.name = this.user.name;
this.updateUser.account = this.user.account;
this.updateUser.password = this.user.password;
this.updateUser.phone = this.user.phone;
this.updateUser.address = this.user.address;
},
doUpdate() {
this.$http.put("/user/update", this.updateUser).then(res => {
let ans = res.data;
if (ans.code === 2000) {
this.freshPage();
this.updateDialogVisible = false;
this.$message.success(ans.msg);
} else {
this.$message.error(ans.msg);
}
})
},
freshPage() {
this.$http.get("/user/queryInfoByAccount?account=" + window.sessionStorage.getItem('token')).then(res => {
let R = res.data; // R
this.user = R.data;
})
},
},
created() {
this.freshPage();
}
}
</script>
<style scoped>
.user-info-card {
margin-top: 60px;
}
.user-info-title {
color: cornflowerblue;
float: left;
margin-top: -5px;
}
.user-info-data {
margin-top: 15px;
margin-left: 45%;
}
br {
margin-top: 10px;
}
b {
margin-left: 100px;
}
.el-form-item {
width: 300px;
}
.save {
float: right;
margin-right: 10px;
margin-top: -10px;
}
.el-form-item{
margin-left: -5%;
}
</style>

@ -0,0 +1,29 @@
<template>
<div>
<el-card>
<h1>403</h1>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
refresh() {
},
},
created() {
this.refresh();
}
}
</script>
<style scoped>
</style>

@ -0,0 +1,29 @@
<template>
<div>
<el-card>
<h1>404</h1>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
refresh() {
},
},
created() {
this.refresh();
}
}
</script>
<style scoped>
</style>

@ -0,0 +1,57 @@
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import Vuex from 'vuex';
import axios from 'axios'
import global from './assets/css/global.css'
import VueWechatTitle from 'vue-wechat-title';
Vue.use(Vuex);
Vue.use(VueWechatTitle);
// axios 请求拦截器
axios.interceptors.request.use(config => {
config.headers.Authorization = window.sessionStorage.getItem('token');
return config;
});
// 配置页面标题
router.afterEach(function (to, from) {
if(to.meta.title){
document.title = to.meta.title;
}
});
Vue.prototype.$http = axios;
const store = new Vuex.Store({
state: {
// 存储token
Authorization: localStorage.getItem('Authorization') ? localStorage.getItem('Authorization') : ''
},
mutations: {
// 修改token并将token存入localStorage
changeLogin(state, user) {
state.Authorization = user.Authorization;
localStorage.setItem('Authorization', user.Authorization);
}
}
});
export default store;
Vue.use(ElementUI);
Vue.config.productionTip = false;
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
render: h => h(App),
components: {App},
template: '<App/>'
});
axios.defaults.baseURL = 'http://localhost:8081';

@ -0,0 +1,105 @@
import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import Index from '@/components/Index'
import Error from '@/components/utils/404'
import Forbidden from '@/components/utils/403'
import Goods from '@/components/Goods'
// admin/menu
import Home from '@/components/admin/Home'
import UserList from '@/components/admin/menu/UserList'
import TypeList from '@/components/admin/menu/TypeList'
import FlowerList from '@/components/admin/menu/FlowerList'
import OrderList from '@/components/admin/menu/OrderList'
// user
import UserHome from '@/components/user/UserHome'
import UpdateInfo from '@/components/user/menu/UpdateInfo'
import Cart from '@/components/user/menu/Cart'
import Order from '@/components/user/menu/Order'
Vue.use(Router);
export default new Router({
routes: [
{
path: '/',
redirect: 'login',
},
{
path: '/404',
meta: {title: "页面走丢了"},
component: Error
},
{
path: '/403',
meta: {title: "没有权限"},
component: Forbidden
},
{
path: '/login',
meta: {title: "登录"},
component: Login
},
// 用户页面
{
path: '/user',
component: UserHome,
redirect: '/goods',
children: [
{
path: '/goods',
meta: {title: "商品列表"},
component: Goods
}, {
path: '/updateInfo',
meta: {title: "个人信息"},
component: UpdateInfo
},
{
path: '/order',
meta: {title: "我的订单"},
component: Order
},
{
path: '/cart',
meta: {title: "购物车"},
component: Cart
},
]
},
// 管理员页面
{
path: '/home',
component: Home,
// 为 Home 页创建子路由,并默认跳转。
redirect: '/index',
children: [
{
path: '/index',
meta: {title: "网站首页"},
component: Index
},
{
path: '/users',
meta: {title: "用户管理"},
component: UserList
},
{
path: '/flowers',
meta: {title: "商品管理"},
component: FlowerList
},
{
path: '/flower_type',
meta: {title: "种类管理"},
component: TypeList
},
{
path: '/orders',
meta: {title: "订单管理"},
component: OrderList
},
]
}
]
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Loading…
Cancel
Save