fix
This commit is contained in:
parent
bb0b33a830
commit
0c6859987f
@ -15,6 +15,12 @@ export default {
|
|||||||
return fetch('/badge/list', params,'post','json')
|
return fetch('/badge/list', params,'post','json')
|
||||||
},
|
},
|
||||||
|
|
||||||
|
addCategory(params){
|
||||||
|
return fetch('/badge/class/add',params,'post','json')
|
||||||
|
},
|
||||||
|
|
||||||
|
listCategory(params){
|
||||||
|
return fetch('/badge/class/list',params,'post','json')
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,6 +26,17 @@ export default {
|
|||||||
|
|
||||||
inviteList(params){
|
inviteList(params){
|
||||||
return fetch('/personal/inviteCode/records',params,'post','json')
|
return fetch('/personal/inviteCode/records',params,'post','json')
|
||||||
|
},
|
||||||
|
|
||||||
|
wechat(params){
|
||||||
|
return fetch('/config/qrcode/add',params,'post','json')
|
||||||
|
},
|
||||||
|
wechatUpdate(params){
|
||||||
|
return fetch('/config/qrcode/update',params,'post','json')
|
||||||
|
},
|
||||||
|
|
||||||
|
wechatList(params){
|
||||||
|
return fetch('/config/qrcode/list',params,'post','json')
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
<icon-loading v-if="loading" />
|
<icon-loading v-if="loading" />
|
||||||
<icon-upload v-else />
|
<icon-upload v-else />
|
||||||
</template>
|
</template>
|
||||||
<template #default> 上传文件</template>
|
<template #default>{{title}}</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
@ -25,6 +25,10 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
|
title : {
|
||||||
|
type:String,
|
||||||
|
default:'上传文件'
|
||||||
|
},
|
||||||
action: {
|
action: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '/api/oss/upload'
|
default: '/api/oss/upload'
|
||||||
|
|||||||
@ -101,13 +101,12 @@ export default {
|
|||||||
fetchMenu() {
|
fetchMenu() {
|
||||||
this.$api.sys.menus().then(res => {
|
this.$api.sys.menus().then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.list = res.data.reverse()
|
this.list = res.data
|
||||||
|
if (this.list.length > 0) {
|
||||||
|
const path = this.list[0]
|
||||||
|
this.keys[0] = path.id + "@" + path.permission
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (this.list.length > 0) {
|
|
||||||
const path = this.list[0]
|
|
||||||
this.keys[0] = path.id + "@" + path.permission
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goPath(res) {
|
goPath(res) {
|
||||||
|
|||||||
45
src/views/flower/badge/components/category.vue
Normal file
45
src/views/flower/badge/components/category.vue
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<a-button type="text" @click="show = true">添加分类</a-button>
|
||||||
|
<a-modal v-model:visible="show" title="添加徽章分类" @before-ok="submit">
|
||||||
|
<a-textarea v-model="from" :auto-size="{minRows:6}"></a-textarea>
|
||||||
|
</a-modal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: false,
|
||||||
|
from:{
|
||||||
|
desc:'',
|
||||||
|
name:''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.from = JSON.stringify(this.from, null, 4)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
submit(done) {
|
||||||
|
const data = JSON.parse(this.from)
|
||||||
|
this.$api.badge.addCategory(data).then((res) => {
|
||||||
|
if (res.code === 200){
|
||||||
|
this.$message.success(res.msg)
|
||||||
|
this.$emit('ok')
|
||||||
|
done()
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg)
|
||||||
|
done(false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -1,112 +1,140 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<a-button type="text" @click="show = true">{{ type === 'add' ? '新增':'编辑'}}</a-button>
|
<a-button type="text" @click="show = true">{{
|
||||||
<a-modal v-model:visible="show" @before-ok="submit">
|
type === 'add' ? '新增' : '编辑'
|
||||||
<a-form :model="form" auto-label-width ref="form">
|
}}</a-button>
|
||||||
<a-form-item label="徽章类别" field="category" required>
|
<a-modal v-model:visible="show" @before-ok="submit" @close="this.$refs.form.resetFields()">
|
||||||
<a-select placeholder="请选择徽章类型" v-model="form.category">
|
<a-form :model="form" auto-label-width ref="form">
|
||||||
<a-option>养护徽章</a-option>
|
<a-form-item label="徽章类别" field="categoryId" required>
|
||||||
<a-option>成长徽章</a-option>
|
<a-select
|
||||||
<a-option>收藏徽章</a-option>
|
placeholder="请选择徽章类型"
|
||||||
<a-option>挑战徽章</a-option>
|
v-model="form.categoryId"
|
||||||
</a-select>
|
>
|
||||||
</a-form-item>
|
<a-option v-for="item in options" :value="item.id">{{
|
||||||
<a-form-item label="徽章名称" field="name" required>
|
item.name
|
||||||
<a-input placeholder="请输入徽章名称" v-model="form.name"></a-input>
|
}}</a-option>
|
||||||
</a-form-item>
|
</a-select>
|
||||||
<a-form-item label="徽章说明" field="desc" required>
|
</a-form-item>
|
||||||
<a-textarea placeholder="请输入徽章名称" v-model="form.desc"></a-textarea>
|
<a-form-item label="徽章名称" field="name" required>
|
||||||
</a-form-item>
|
<a-input
|
||||||
<a-form-item label="上传徽章" field="ossId" required>
|
placeholder="请输入徽章名称"
|
||||||
<div class="">
|
v-model="form.name"
|
||||||
<a-image class="mb-10" v-if="form.ossId" :src="form.oss.url" width="160" height="160" ></a-image>
|
></a-input>
|
||||||
<upload @ok="upload"/>
|
</a-form-item>
|
||||||
<div class="font-14 primary mt-10">徽章大小为 400* 400</div>
|
<a-form-item label="徽章获取条件" field="countLimit" required>
|
||||||
</div>
|
<a-input-number
|
||||||
</a-form-item>
|
placeholder="请输入徽章获取的条件"
|
||||||
</a-form>
|
v-model="form.countLimit"
|
||||||
</a-modal>
|
></a-input-number>
|
||||||
</div>
|
</a-form-item>
|
||||||
|
<a-form-item label="徽章说明" field="desc" required>
|
||||||
|
<a-textarea
|
||||||
|
placeholder="请输入徽章名称"
|
||||||
|
v-model="form.desc"
|
||||||
|
></a-textarea>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="上传徽章" field="ossId" required>
|
||||||
|
<div class="">
|
||||||
|
<a-image
|
||||||
|
class="mb-10"
|
||||||
|
v-if="form.oss"
|
||||||
|
:src="form.oss.url"
|
||||||
|
width="160"
|
||||||
|
height="160"
|
||||||
|
></a-image>
|
||||||
|
<upload @ok="upload" />
|
||||||
|
<div class="font-14 primary mt-10">
|
||||||
|
徽章大小为 400* 400
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</a-modal>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import upload from '@/components/upload/index.vue'
|
import upload from '@/components/upload/index.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
upload,
|
upload
|
||||||
},
|
|
||||||
props: {
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: "add"
|
|
||||||
},
|
},
|
||||||
info:{
|
props: {
|
||||||
type:Object,
|
type: {
|
||||||
default:null
|
type: String,
|
||||||
}
|
default: 'add'
|
||||||
},
|
},
|
||||||
watch: {
|
options: {
|
||||||
info:{
|
type: Array,
|
||||||
handler(val){
|
default: []
|
||||||
this.form = {...val}
|
},
|
||||||
},
|
info: {
|
||||||
immediate: true
|
type: Object,
|
||||||
}
|
default: null
|
||||||
},
|
}
|
||||||
data() {
|
},
|
||||||
return {
|
watch: {
|
||||||
show: false,
|
info: {
|
||||||
form:{
|
handler(val) {
|
||||||
"category": "",
|
this.form = { ...val }
|
||||||
"desc": "",
|
},
|
||||||
"name": "",
|
immediate: true
|
||||||
"ossId": "",
|
}
|
||||||
ossUrl:''
|
},
|
||||||
}
|
data() {
|
||||||
}
|
return {
|
||||||
},
|
show: false,
|
||||||
methods: {
|
form: {
|
||||||
upload(file) {
|
categoryId: '',
|
||||||
this.form.ossId = file.id
|
countLimit:0,
|
||||||
this.form.ossUrl = file.url
|
desc: '',
|
||||||
},
|
keyword:'',
|
||||||
submit(done){
|
name: '',
|
||||||
this.$refs.form.validate(err => {
|
ossId: '',
|
||||||
if (err === undefined) {
|
ossUrl: ''
|
||||||
if (this.form.id ){
|
}
|
||||||
this.$api.badge.update(this.form).then(res => {
|
}
|
||||||
if (res.code === 200){
|
},
|
||||||
this.$emit('ok')
|
methods: {
|
||||||
this.$message.success(res.msg)
|
upload(file) {
|
||||||
done()
|
this.form.oss = file
|
||||||
} else {
|
this.form.ossId = file.id
|
||||||
this.$message.error(res.msg)
|
this.form.ossUrl = file.url
|
||||||
done(false)
|
},
|
||||||
}
|
submit(done) {
|
||||||
})
|
this.$refs.form.validate(err => {
|
||||||
} else {
|
if (err === undefined) {
|
||||||
this.$api.badge.save(this.form).then(res => {
|
if (this.form.id) {
|
||||||
if (res.code === 200){
|
this.$api.badge.update(this.form).then(res => {
|
||||||
this.$emit('ok')
|
if (res.code === 200) {
|
||||||
this.$message.success(res.msg)
|
this.$emit('ok')
|
||||||
done()
|
this.$message.success(res.msg)
|
||||||
} else {
|
done()
|
||||||
this.$message.error(res.msg)
|
} else {
|
||||||
done(false)
|
this.$message.error(res.msg)
|
||||||
}
|
done(false)
|
||||||
})
|
}
|
||||||
}
|
})
|
||||||
|
} else {
|
||||||
} else {
|
this.$api.badge.save(this.form).then(res => {
|
||||||
done(false)
|
if (res.code === 200) {
|
||||||
|
this.$emit('ok')
|
||||||
|
this.$message.success(res.msg)
|
||||||
|
done()
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg)
|
||||||
|
done(false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
done(false)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
@ -4,18 +4,19 @@
|
|||||||
<a-card>
|
<a-card>
|
||||||
<div >
|
<div >
|
||||||
<div class="flex flex-center flex-justify-start">
|
<div class="flex flex-center flex-justify-start">
|
||||||
<edit @ok="fetchList"/>
|
<edit :options="categoryList" @ok="fetchList"/>
|
||||||
|
<category @ok="fetchCategory"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-20">
|
<div class="mt-20">
|
||||||
<a-table :data="list" :columns="columns" :pagination="page">
|
<a-table :data="list" :columns="columns" :pagination="page">
|
||||||
<template #name="{record}">
|
<template #name="{record}">
|
||||||
<div class="flex flex-center flex-justify-start">
|
<div class="flex flex-center flex-justify-start">
|
||||||
<a-image :src="record.oss.url" width="40px"></a-image>
|
<a-image v-if="record.oss" :src="record.oss.url" width="40px"></a-image>
|
||||||
<div class="ml-10">{{record.name}}</div>
|
<div class="ml-10">{{record.name}}</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #category="{record}">
|
<template #category="{record}">
|
||||||
<a-tag color="blue">{{record.category}}</a-tag>
|
<a-tag color="blue">{{record.category.name}}</a-tag>
|
||||||
</template>
|
</template>
|
||||||
<template #menu="{record}">
|
<template #menu="{record}">
|
||||||
<div class="flex flex-center flex-justify-start">
|
<div class="flex flex-center flex-justify-start">
|
||||||
@ -35,10 +36,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import navbar from '@/components/navbar/index.vue'
|
import navbar from '@/components/navbar/index.vue'
|
||||||
import edit from './components/edit.vue'
|
import edit from './components/edit.vue'
|
||||||
|
import category from "./components/category.vue";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
navbar,
|
navbar,
|
||||||
edit
|
edit,
|
||||||
|
category
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -47,6 +50,7 @@ export default {
|
|||||||
pageSize:10,
|
pageSize:10,
|
||||||
total:0,
|
total:0,
|
||||||
},
|
},
|
||||||
|
categoryList:[],
|
||||||
list: [],
|
list: [],
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
@ -70,6 +74,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.fetchList();
|
this.fetchList();
|
||||||
|
this.fetchCategory()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchList() {
|
fetchList() {
|
||||||
@ -79,6 +84,18 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
fetchCategory(){
|
||||||
|
const data = {
|
||||||
|
current:0,
|
||||||
|
pageSize:999,
|
||||||
|
total:0,
|
||||||
|
}
|
||||||
|
this.$api.badge.listCategory(data).then(res=>{
|
||||||
|
if (res.code === 200){
|
||||||
|
this.categoryList = res.data.list
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
remove(id){
|
remove(id){
|
||||||
this.$api.badge.delete({ ids: [id] }).then(res=>{
|
this.$api.badge.delete({ ids: [id] }).then(res=>{
|
||||||
if (res.code === 200){
|
if (res.code === 200){
|
||||||
|
|||||||
@ -89,6 +89,7 @@ export default {
|
|||||||
const ids = {ids:[item.id],isHot: item.isHot === 0 ? 1 :0}
|
const ids = {ids:[item.id],isHot: item.isHot === 0 ? 1 :0}
|
||||||
this.$api.flower.changeHot(ids).then(res => {
|
this.$api.flower.changeHot(ids).then(res => {
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
|
this.$message.success(res.msg)
|
||||||
this.fetchList()
|
this.fetchList()
|
||||||
}else {
|
}else {
|
||||||
this.$message.error(res.msg);
|
this.$message.error(res.msg);
|
||||||
|
|||||||
@ -1,17 +1,72 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<navbar title="植趣微信群"/>
|
<navbar title="植趣微信群"/>
|
||||||
<a-card>
|
<a-card >
|
||||||
|
<div class="flex flex-center flex-justify-start font-18 bold">植趣微信群,需要每7天更新一次</div>
|
||||||
|
<div v-if="from.id === ''" style="height: 300px" class="flex flex-center">
|
||||||
|
<a-empty >
|
||||||
|
</a-empty>
|
||||||
|
</div>
|
||||||
|
<a-image v-else :src="from.url" width="380"></a-image>
|
||||||
|
<upload class="mt-20" @ok="upload" title="配置二维码"/>
|
||||||
</a-card>
|
</a-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import navbar from '@/components/navbar/index.vue'
|
import navbar from '@/components/navbar/index.vue'
|
||||||
|
import upload from "../../../components/upload/index.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
navbar,
|
navbar,
|
||||||
|
upload
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
from: {
|
||||||
|
id:'',
|
||||||
|
name:'植趣群二维码',
|
||||||
|
ossId:'',
|
||||||
|
url:''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetchList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fetchList(){
|
||||||
|
this.$api.flower.wechatList().then(res => {
|
||||||
|
if (res.code === 200){
|
||||||
|
console.log(res)
|
||||||
|
const tmps = res.data
|
||||||
|
if (tmps.length > 0) {
|
||||||
|
this.from = tmps[0]
|
||||||
|
}
|
||||||
|
console.log(this.from)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
upload(file) {
|
||||||
|
this.from.url = file.url
|
||||||
|
this.from.ossId = file.id
|
||||||
|
|
||||||
|
if (this.from.id === ''){
|
||||||
|
this.$api.flower.wechat(this.from).then(res => {
|
||||||
|
if (res.code === 200){
|
||||||
|
this.$message.success(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$api.flower.wechatUpdate(this.from).then(res => {
|
||||||
|
if (res.code === 200){
|
||||||
|
this.$message.success(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user