Commit bcd85003 by baihong

管理后台

parent 40fd0e01
......@@ -6,8 +6,8 @@
<script>
export default {
name: "App"
};
name: 'App'
}
</script>
<style lang="less">
......
......@@ -53,38 +53,38 @@ export default {
mounted () {
this.editor = new Editor(`#${this.editorId}`)
this.editor.customConfig.uploadImgServer = 'https://applet.mwcx.cn/bg/survey/uploadFile'
this.editor.customConfig.uploadFileName = 'imgFile'
this.editor.customConfig.uploadImgHooks = {
this.editor.customConfig.uploadFileName = 'imgFile'
this.editor.customConfig.uploadImgHooks = {
// 上传图片之前
before: function(xhr) {
before: function (xhr) {
console.log(xhr)
},
// 图片上传并返回了结果,图片插入已成功
success: function(xhr) {
},
// 图片上传并返回了结果,图片插入已成功
success: function (xhr) {
console.log('success', xhr)
},
// 图片上传并返回了结果,但图片插入时出错了
fail: function(xhr, editor, resData) {
},
// 图片上传并返回了结果,但图片插入时出错了
fail: function (xhr, editor, resData) {
console.log('fail', resData)
},
// 上传图片出错,一般为 http 请求的错误
error: function(xhr, editor, resData) {
},
// 上传图片出错,一般为 http 请求的错误
error: function (xhr, editor, resData) {
console.log('error', xhr, resData)
},
// 上传图片超时
timeout: function(xhr) {
},
// 上传图片超时
timeout: function (xhr) {
console.log('timeout')
},
// 图片上传并返回了结果,想要自己把图片插入到编辑器中
// 例如服务器端返回的不是 { errno: 0, data: [...] } 这种格式,可使用 customInsert
customInsert: function(insertImgFn, result) {
},
// 图片上传并返回了结果,想要自己把图片插入到编辑器中
// 例如服务器端返回的不是 { errno: 0, data: [...] } 这种格式,可使用 customInsert
customInsert: function (insertImgFn, result) {
// result 即服务端返回的接口
console.log('customInsert', result)
// insertImgFn 可把图片插入到编辑器,传入图片 src ,执行函数即可
insertImgFn(result.data[0])
}
}
}
this.editor.customConfig.onchange = (html) => {
let text = this.editor.txt.text()
if (this.cache) localStorage.editorCache = html
......
......@@ -64,7 +64,7 @@ export default {
},
data () {
return {
id:null,
id: null,
modalVisible: false,
editMode: false,
formTitle: '',
......@@ -74,9 +74,9 @@ export default {
paddingBottom: '53px',
position: 'static'
},
moodType:null,
mood:null,
content:''
moodType: null,
mood: null,
content: ''
}
},
watch: {
......@@ -99,7 +99,7 @@ export default {
} else {
this.editMode = true
this.formTitle = '编辑回复'
// this.content=val.content
// this.content=val.content
this.id = val.id
}
},
......@@ -107,12 +107,12 @@ export default {
}
},
methods: {
submit () {
submit () {
let params = {
content:this.content
content: this.content
}
if (this.editMode) {
params.id=this.id
params.id = this.id
relayTreeHole(params).then((res) => {
if (res.status === 200) {
this.$Message.success(res.msg)
......@@ -123,8 +123,8 @@ export default {
}
})
} else {
params.mood = this.mood
params.moodType = this.moodType
params.mood = this.mood
params.moodType = this.moodType
addTreeHole(params).then((res) => {
if (res.status === 200) {
this.$Message.success('新增成功')
......
......@@ -57,13 +57,13 @@ export default {
},
data () {
return {
types: [{id:0,name:'留言'},{id:1,name:'评论'}],
orderTypes:[{id:0,name:'创建时间'},{id:1,name:'热度'}],
searchParams: {
types: [{ id: 0, name: '留言' }, { id: 1, name: '评论' }],
orderTypes: [{ id: 0, name: '创建时间' }, { id: 1, name: '热度' }],
searchParams: {
page: 1,
rows: 10,
type: 0,
orderType:0
orderType: 0
},
config: { total: 0, size: 10, current: 1 },
selectList: [],
......@@ -74,9 +74,9 @@ export default {
}
},
methods: {
selectChange(p) {
console.log(p);
this.search(this.searchParams);
selectChange (p) {
console.log(p)
this.search(this.searchParams)
},
handlePager (pager) {
this.searchParams.page = pager.current
......
......@@ -58,11 +58,11 @@ export default {
},
data () {
return {
id:null,
type:0,
content:'',
dznum:null,
showModal:false,
id: null,
type: 0,
content: '',
dznum: null,
showModal: false,
selectList: [],
columns: [
{
......@@ -84,7 +84,7 @@ export default {
title: '属性',
slot: 'enable'
},
{
{
title: '用户点赞数',
key: 'greatNum'
},
......@@ -97,7 +97,7 @@ export default {
title: '情绪值',
key: 'mood'
},
{
{
title: '热度',
key: 'sore'
},
......@@ -120,25 +120,24 @@ export default {
edit (row) {
this.$emit('edit', row)
},
editly(val,type){
this.showModal=true;
this.type=type
this.id = val.id
this.content = val.content
editly (val, type) {
this.showModal = true
this.type = type
this.id = val.id
this.content = val.content
},
submit(){
submit () {
if (this.type) {
updateContent({id:this.id,content:this.content}).then((res) => {
updateContent({ id: this.id, content: this.content }).then((res) => {
this.$Message.success(res.msg)
this.$emit('refresh')
})
this.$emit('refresh')
})
} else {
pretendGreate({id:this.id,num:this.dznum}).then((res) => {
pretendGreate({ id: this.id, num: this.dznum }).then((res) => {
this.$Message.success(res.msg)
this.$emit('refresh')
})
this.$emit('refresh')
})
}
},
onSelect (val) {
this.selectList = val.map((p) => {
......@@ -153,7 +152,7 @@ export default {
this.$emit('select', this.selectList)
},
setTops (id) {
setTop({id}).then((res) => {
setTop({ id }).then((res) => {
if (res.status === 200) {
this.$Message.success('操作成功')
this.$emit('refresh')
......
......@@ -64,11 +64,11 @@ export default {
},
data () {
return {
type:null,
id:null,
pxnum:null,
salePrice:null,
showModal:false,
type: null,
id: null,
pxnum: null,
salePrice: null,
showModal: false,
selectList: [],
columns: [
{
......@@ -102,7 +102,7 @@ export default {
title: '测试图片',
slot: 'enable'
},
{
{
title: '是否设置为推荐',
slot: 'recommend'
},
......@@ -125,12 +125,12 @@ export default {
edit (row) {
this.$emit('edit', row)
},
pxedit(id,type){
this.pxnum=null
this.salePrice=null
this.showModal = true
this.id = id
this.type = type
pxedit (id, type) {
this.pxnum = null
this.salePrice = null
this.showModal = true
this.id = id
this.type = type
},
onSelect (val) {
this.selectList = val.map((p) => {
......@@ -144,23 +144,23 @@ export default {
})
this.$emit('select', this.selectList)
},
submit(){
submit () {
if (this.type) {
this.setSores()
} else {
updateSalePrice({ id:this.id,salePrice:this.salePrice }).then((res) => {
if (res.status === 200) {
this.$Message.success('操作成功')
this.$emit('getlist')
}
})
updateSalePrice({ id: this.id, salePrice: this.salePrice }).then((res) => {
if (res.status === 200) {
this.$Message.success('操作成功')
this.$emit('getlist')
}
})
}
},
setSores () {
setSore({ id:this.id,sore:this.pxnum }).then((res) => {
setSore({ id: this.id, sore: this.pxnum }).then((res) => {
if (res.status === 200) {
this.$Message.success('操作成功')
this.$emit('getlist')
this.$emit('getlist')
}
})
},
......@@ -182,8 +182,8 @@ export default {
console.log('开关状态:' + status + row)
let falg = status ? 1 : 0
recommend({
id:row.id,
recommend:falg
id: row.id,
recommend: falg
}).then((res) => {
if (res.status === 200) {
this.$Message.success('设置成功')
......
......@@ -36,92 +36,92 @@
</template>
<script>
import Stable from "@/view/components/theme/table.vue";
import Forms from "@/view/components/theme/form.vue";
import draggableList from "@/view/common/draggable.vue";
import { getThemes, delThemes, editThemes } from "@/api/themes";
import Stable from '@/view/components/theme/table.vue'
import Forms from '@/view/components/theme/form.vue'
import draggableList from '@/view/common/draggable.vue'
import { getThemes, delThemes, editThemes } from '@/api/themes'
export default {
components: {
Stable,
Forms,
draggableList
},
data() {
data () {
return {
types: [{id:0,name:'留言'},{id:1,name:'评论'}],
types: [{ id: 0, name: '留言' }, { id: 1, name: '评论' }],
seleted: null,
selectList: [],
visible: false,
draggableVisible: false,
row: {},
data: []
};
}
},
methods: {
edit(row) {
this.visible = true;
this.row = row;
edit (row) {
this.visible = true
this.row = row
},
add() {
this.visible = true;
add () {
this.visible = true
this.row = {
id: "add"
};
id: 'add'
}
},
selectChange(p) {
console.log(p);
selectChange (p) {
console.log(p)
this.search({
scene: p
});
})
},
select(val) {
this.selectList = val;
select (val) {
this.selectList = val
},
seq() {
this.draggableVisible = true;
seq () {
this.draggableVisible = true
},
ok(list) {
ok (list) {
editThemes(list).then(res => {
if (res.code === 200 && res.data.length > 0) {
this.$Message.success("操作成功");
this.draggableVisible = false;
this.search();
this.$Message.success('操作成功')
this.draggableVisible = false
this.search()
}
});
})
},
del() {
del () {
delThemes(this.selectList).then(res => {
if (res.code === 200) {
this.$Message.success("删除成功");
this.search();
this.$Message.success('删除成功')
this.search()
} else {
this.$Message.error("删除失败");
this.$Message.error('删除失败')
}
});
})
},
onSearch(p) {
onSearch (p) {
this.search({
keyword: p
});
})
},
search(p) {
search (p) {
getThemes(p).then(res => {
this.data = res.data;
});
this.data = res.data
})
}
},
mounted() {
this.seleted = this.$route.query.row && this.$route.query.row.id;
mounted () {
this.seleted = this.$route.query.row && this.$route.query.row.id
let parmas = {
scene: this.seleted
};
}
if (parmas) {
this.search(parmas);
this.search(parmas)
} else {
this.search({});
this.search({})
}
}
};
}
</script>
<style lang="less"></style>
......@@ -100,15 +100,15 @@ export default {
},
methods: {
random_string (len) {
len = len || 32
var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'
var maxPos = chars.length
var pwd = ''
for (let i = 0; i < len; i++) {
pwd += chars.charAt(Math.floor(Math.random() * maxPos))
}
return pwd
},
len = len || 32
var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'
var maxPos = chars.length
var pwd = ''
for (let i = 0; i < len; i++) {
pwd += chars.charAt(Math.floor(Math.random() * maxPos))
}
return pwd
},
handleRemove (file) {
const fileList = this.$refs['upload'].fileList
......
......@@ -72,55 +72,55 @@
</template>
<script>
import { getScenes, delScenes, editScenes } from "@/api/scenes";
import { getScenes, delScenes, editScenes } from '@/api/scenes'
export default {
name: "categories",
name: 'categories',
components: {},
data() {
data () {
return {
tab: "1",
tab: '1',
data: [],
yhqcolumns: [
{
title: "优惠卷名称",
key: "created_at"
title: '优惠卷名称',
key: 'created_at'
},
{
title: "获奖时间",
slot: "name"
title: '获奖时间',
slot: 'name'
}
],
columns: [
{
title: "签到日期",
key: "created_at"
title: '签到日期',
key: 'created_at'
},
{
title: "获得收益",
slot: "name"
title: '获得收益',
slot: 'name'
},
{
title: "签到时间",
slot: "title"
title: '签到时间',
slot: 'title'
},
{
title: "分享收益",
key: "created_at"
title: '分享收益',
key: 'created_at'
},
{
title: "总收益",
slot: "enable"
title: '总收益',
slot: 'enable'
},
{
title: "操作",
slot: "action"
title: '操作',
slot: 'action'
}
]
};
}
},
methods: {},
mounted() {}
};
mounted () {}
}
</script>
<style lang="less" scoped>
......
......@@ -46,16 +46,16 @@
</template>
<script>
import { getScenes, delScenes, editScenes } from "@/api/scenes";
import { getScenes, delScenes, editScenes } from '@/api/scenes'
export default {
name: "categories",
name: 'categories',
components: {
},
data() {
data () {
return {
data:[],
columns: [
data: [],
columns: [
{
title: '用户ID',
key: 'created_at'
......@@ -66,7 +66,7 @@ export default {
},
{
title: '姓名',
slot: 'title',
slot: 'title'
},
{
title: '手机号',
......@@ -81,17 +81,17 @@ export default {
slot: 'action'
}
]
};
}
},
methods: {
goDetail(){
this.$router.push({ path: "/signIn/detail", query: { id: "new" } });
}
goDetail () {
this.$router.push({ path: '/signIn/detail', query: { id: 'new' } })
}
},
mounted() {
mounted () {
}
};
}
</script>
<style lang="less"></style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment