202404-新增免责声明页面
This commit is contained in:
4
.npmrc
4
.npmrc
@@ -1,3 +1,3 @@
|
|||||||
phantomjs_cdnurl=http://cnpmjs.org/downloads
|
phantomjs_cdnurl=http://cnpmjs.org/downloads
|
||||||
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
|
sass_binary_site=https://cdn.npmmirror.com/binaries/node-sass
|
||||||
registry=https://registry.npm.taobao.org
|
registry=https://registry.npmmirror.com
|
||||||
|
|||||||
@@ -23,12 +23,14 @@
|
|||||||
"js-cookie": "2.1.4",
|
"js-cookie": "2.1.4",
|
||||||
"jsonlint": "1.6.2",
|
"jsonlint": "1.6.2",
|
||||||
"less-loader": "^4.0.5",
|
"less-loader": "^4.0.5",
|
||||||
|
"marked": "^12.0.2",
|
||||||
"merge": "^1.2.0",
|
"merge": "^1.2.0",
|
||||||
"mockjs": "1.0.1-beta3",
|
"mockjs": "1.0.1-beta3",
|
||||||
"moment": "^2.22.0",
|
"moment": "^2.22.0",
|
||||||
"normalize.css": "7.0.0",
|
"normalize.css": "7.0.0",
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
"querystring": "^0.2.0",
|
"querystring": "^0.2.0",
|
||||||
|
"scandir": "^0.1.2",
|
||||||
"screenfull": "3.2.2",
|
"screenfull": "3.2.2",
|
||||||
"showdown": "1.7.1",
|
"showdown": "1.7.1",
|
||||||
"simplemde": "1.11.2",
|
"simplemde": "1.11.2",
|
||||||
|
|||||||
15
src/api/disclaimers/edit.js
Normal file
15
src/api/disclaimers/edit.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import http from '@/utils/http'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询免责声明
|
||||||
|
*/
|
||||||
|
export function find() {
|
||||||
|
return http.post('/notice/disclaimers')
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存免责声明
|
||||||
|
*/
|
||||||
|
export function save(params) {
|
||||||
|
return http.post('/notice/disclaimers/save', params)
|
||||||
|
}
|
||||||
139
src/views/disclaimers/edit.vue
Normal file
139
src/views/disclaimers/edit.vue
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<sticky className="sub-navbar">
|
||||||
|
<div style="text-align:right;">
|
||||||
|
<el-button type="success" :loading="onSubmit" @click="handleSave">保存</el-button>
|
||||||
|
<!-- <el-button @click="handleCancel">取消</el-button> -->
|
||||||
|
</div>
|
||||||
|
</sticky>
|
||||||
|
<div class="app-container app-edit">
|
||||||
|
<el-form class="small-space" :model="form" :rules="rules" ref="form" label-position="right" label-width="120px" style="width: 700px;">
|
||||||
|
<!-- 简介 -->
|
||||||
|
<el-form-item label="简介" prop="description">
|
||||||
|
<tinymce :height="300" v-model="form.description" id='tinymce' style="width:900px"></tinymce>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Sticky from '@/components/Sticky'
|
||||||
|
import { find, save } from '@/api//about/us'
|
||||||
|
import Tinymce from '@/components/Tinymce'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { Tinymce, Sticky },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
id: undefined,
|
||||||
|
image: '',
|
||||||
|
description: '',
|
||||||
|
platformId: ''
|
||||||
|
},
|
||||||
|
|
||||||
|
onSubmit: false,
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
rules: {
|
||||||
|
// mobile: [
|
||||||
|
// { required: true, message: '请输入手机号码', trigger: 'blur' }
|
||||||
|
// ],
|
||||||
|
// username: [
|
||||||
|
// { required: true, message: '请输入姓名', trigger: 'blur' },
|
||||||
|
// { max: 15, message: '姓名长度不能超过15个字符', trigger: 'blur' }
|
||||||
|
// ],
|
||||||
|
// email: [
|
||||||
|
// { required: true, message: '请输入邮箱', trigger: 'blur' },
|
||||||
|
// { type: 'email', message: '您输入的邮箱格式不正确', trigger: 'blur' }
|
||||||
|
// ],
|
||||||
|
// password: [
|
||||||
|
// { required: true, message: '请输入密码', trigger: 'blur' },
|
||||||
|
// { min: 6, message: '密码长度不能少于6个字符', trigger: 'blur' }
|
||||||
|
// ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.form.id = 1
|
||||||
|
this.findById(this.form.id)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 查询关于我们
|
||||||
|
*/
|
||||||
|
findById(id) {
|
||||||
|
find(id).then(response => {
|
||||||
|
this.form.image = response.aboutUs.image
|
||||||
|
this.form.description = response.aboutUs.description
|
||||||
|
this.form.platformId = response.aboutUs.platformId
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存关于我们
|
||||||
|
*/
|
||||||
|
handleSave() {
|
||||||
|
this.$refs.form.validate(valid => {
|
||||||
|
if (!valid) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
this.onSubmit = true
|
||||||
|
save(this.form).then(response => {
|
||||||
|
this.$router.go(-1)
|
||||||
|
}).finally(() => {
|
||||||
|
this.onSubmit = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeAvatarUpload(file) {
|
||||||
|
// const isLt2M = file.size / 1024 / 1024 < 2
|
||||||
|
|
||||||
|
// if (!isLt2M) {
|
||||||
|
// this.$message.error('上传头像图片大小不能超过 2MB!')
|
||||||
|
// }
|
||||||
|
// return isLt2M
|
||||||
|
},
|
||||||
|
|
||||||
|
// 处理头像上传成功
|
||||||
|
handleAvatarSuccess(res, file) {
|
||||||
|
this.form.image = res.img
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消
|
||||||
|
*/
|
||||||
|
handleCancel() {
|
||||||
|
this.$router.go(-1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.avatar-uploader .el-upload {
|
||||||
|
border: 1px dashed #d9d9d9;
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.avatar-uploader .el-upload:hover {
|
||||||
|
border-color: #409EFF;
|
||||||
|
}
|
||||||
|
.avatar-uploader-icon {
|
||||||
|
font-size: 28px;
|
||||||
|
color: #8c939d;
|
||||||
|
width: 148px;
|
||||||
|
height: 148px;
|
||||||
|
line-height: 148px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.avatar {
|
||||||
|
width: 148px;
|
||||||
|
height: 148px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user