Skip to content
This repository has been archived by the owner on Mar 12, 2022. It is now read-only.

Commit

Permalink
fix: #32, 管理后台手机端
Browse files Browse the repository at this point in the history
  • Loading branch information
klren0312 committed Sep 26, 2019
1 parent e252bc2 commit 51ee86f
Show file tree
Hide file tree
Showing 40 changed files with 2,247 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@
- 2018.10 - 2019.03 开发, 上线, 迭代
- 2019.06 管理后台添加权限
- 2019.07 小程序登录位置调整, 广告位添加
- 2019.09 管理后台手机端

## 项目目录

- [ApiServer API服务端](https://github.com/klren0312/ironInfoWeapp/tree/master/ApiServer)
- [ServerWeb WEB管理前端](https://github.com/klren0312/ironInfoWeapp/tree/master/ServerWeb)
- [ServerWeb WEB管理后台PC端](https://github.com/klren0312/ironInfoWeapp/tree/master/ServerWeb)
- [ServerWebMobile WEB管理后台手机端](https://github.com/klren0312/ironInfoWeapp/tree/master/ServerWebMobile)
- [Weapp 小程序与H5端](https://github.com/klren0312/ironInfoWeapp/tree/master/Weapp)
- [相关文档](https://github.com/klren0312/ironInfoWeapp/tree/master/doc)

## 开源计划

* [x] API服务端
* [x] 管理前端
* [x] API服务端
* [x] 管理后台PC端
* [x] 管理后台手机端
* [x] 小程序与H5
* [x] 文档: 需求文档
* [x] 文档: API文档
Expand Down Expand Up @@ -64,6 +67,9 @@
# 管理后台
![](./Weapp/img/backend.png)

# 管理后台手机端
![](./ServerWebMobile/imgs/mobile.jpg)

## Stargazers over time

[![Stargazers over time](https://starchart.cc/klren0312/ironInfoWeapp.svg)](https://starchart.cc/klren0312/ironInfoWeapp)
17 changes: 17 additions & 0 deletions ServerWebMobile/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'@vue/standard'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
}
}
25 changes: 25 additions & 0 deletions ServerWebMobile/.gitignore
Original file line number Diff line number Diff line change
@@ -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*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*

# lock
package-lock.json
yarn.lock
9 changes: 9 additions & 0 deletions ServerWebMobile/.postcssrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
plugins: {
'autoprefixer': {},
'postcss-pxtorem': {
'rootValue': 100,
'propWhiteList': []
}
}
}
46 changes: 46 additions & 0 deletions ServerWebMobile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# tlgc

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn run serve
```

### Compiles and minifies for production
```
yarn run build
```

### Run your tests
```
yarn run test
```

### Lints and fixes files
```
yarn run lint
```

### 使用相关库

- "vue": "^2.6.6",
- "vue-router": "^3.0.1",
- "vuex": "^3.0.1",
- "axios": "^0.18.0",
- "echarts": "^4.1.0",
- "element-ui": "^2.5.4",
- "normalize.css": "^8.0.1",
- "nprogress": "^0.2.0",
- "sortablejs": "^1.8.3",
- "v-charts": "^1.19.0",
- "vm-markdown": "^0.2.8",
- "zstorage": "^1.0.4"

### 注意:
1. api全部封装在`src\api`中, 每个页面一个`*.api.js`
2. 后端地址配在`public\index.html`
3. 登录态维护使用`localStorage`
14 changes: 14 additions & 0 deletions ServerWebMobile/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
presets: [
'@vue/app'
],
plugins: [
[
'import',
{
libraryName: 'mand-mobile',
libraryDirectory: 'lib'
}
]
]
}
Binary file added ServerWebMobile/imgs/mobile.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions ServerWebMobile/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "tlgc",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"axios": "^0.18.0",
"echarts": "^4.1.0",
"element-ui": "^2.5.4",
"lz-string": "^1.4.4",
"normalize.css": "^8.0.1",
"nprogress": "^0.2.0",
"sortablejs": "^1.8.3",
"v-charts": "^1.19.0",
"vm-markdown": "^0.2.8",
"vue": "^2.6.6",
"vue-router": "^3.0.1",
"vuex": "^3.0.1",
"zstorage": "^1.0.4"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.5",
"@vue/cli-service": "^3.0.5",
"node-sass": "^4.9.0",
"sass-loader": "^7.1.0",
"vue-template-compiler": "^2.5.21"
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
Binary file added ServerWebMobile/public/favicon.ico
Binary file not shown.
25 changes: 25 additions & 0 deletions ServerWebMobile/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="full-screen" content="yes">
<meta name="browsermode" content="application">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="stylesheet" href="//at.alicdn.com/t/font_1364019_pr44xxo5sb.css">
<title>治电管理后台</title>
</head>
<body>
<noscript>
<strong>We're sorry but vue-cli3-example doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script>
/* 后台地址 */
var apiServer = 'http://118.24.195.108:7001/api/v1'
// var apiServer = 'http://localhost:7001/api/v1'
</script>
</body>
</html>
24 changes: 24 additions & 0 deletions ServerWebMobile/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<div id="app">
<transition name="md-slide-left">
<router-view></router-view>
</transition>
</div>
</template>

<script>
export default {
name: 'app'
}
</script>

<style lang="stylus">
#app
font-family 'Avenir', Helvetica, Arial, sans-serif
-webkit-font-smoothing antialiased
-moz-osx-font-smoothing grayscale
color #2c3e50
.the-list
padding 20px
background rgb(249, 250, 251)
</style>
41 changes: 41 additions & 0 deletions ServerWebMobile/src/apis/article.api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import request from './request'

export function getArticle (queryString) {
return request.get(`/article?${queryString}`)
}

export function getArticleById (id) {
return request.get(`/article?id=${id}`)
}

export function updateArticleStatus (id, status) {
return request.patch('/article', {
id: id,
status: status
})
}

export function updateArticle (id, title, content) {
return request.put('/article', {
id: id,
title: title,
content: content
})
}

export function publishArticle (title, content) {
return request.post('/article', {
title: title,
content: content
})
}

export function deleteArticle (id) {
return request({
method: 'DELETE',
url: '/article',
data: {
id: id
}
})
}
9 changes: 9 additions & 0 deletions ServerWebMobile/src/apis/home.api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import request from './request'

export function getHomeSum () {
return request.get('/homeSum')
}

export function getWxSum () {
return request.get('/wechatUser')
}
32 changes: 32 additions & 0 deletions ServerWebMobile/src/apis/hot.api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import request from './request'

export function getHot () {
return request({
url: `/hot`,
method: 'GET'
})
}

export function updateSort (hot) {
return request.put('/hot', {
list: hot
})
}

export function deleteHot (id) {
return request({
url: '/hot',
method: 'DELETE',
data: {
id: id
}
})
}

export function createHot (hotForm) {
return request({
url: '/hot',
method: 'post',
data: hotForm
})
}
49 changes: 49 additions & 0 deletions ServerWebMobile/src/apis/iron.api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import request from './request'

export function getIron (queryString) {
return request({
url: `/iron?${queryString}`,
method: 'GET'
})
}

export function getAllIron () {
return request.get('/iron/all')
}

export function updateIron (iron) {
return request({
method: 'PATCH',
url: '/iron',
data: iron
})
}

export function createIron (ironForm) {
return request({
url: '/iron',
method: 'post',
data: ironForm
})
}

export function addNewPrice (id, value) {
return request({
url: `/iron/price`,
method: 'POST',
data: {
id: id,
price: parseFloat(value)
}
})
}

export function deleteIron (id) {
return request({
url: '/iron',
method: 'DELETE',
data: {
id: id
}
})
}
8 changes: 8 additions & 0 deletions ServerWebMobile/src/apis/log.api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import request from './request'

export function getLog (queryString) {
return request({
url: `/log?${queryString}`,
method: 'GET'
})
}
Loading

0 comments on commit 51ee86f

Please sign in to comment.