装起全部商城菜单
This commit is contained in:
@@ -0,0 +1,205 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="标题">
|
||||
<el-input v-model="form.title" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="作者">
|
||||
<el-input v-model="form.author" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="封面">
|
||||
<MaterialList v-model="form.imageArr" style="width: 370px" type="image" :num="1" :width="150" :height="150" />
|
||||
</el-form-item>
|
||||
<el-form-item label="简介">
|
||||
<el-input v-model="form.synopsis" style="width: 370px;" rows="5" type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="正文">
|
||||
<!--<editor v-model="form.content" />-->
|
||||
<ueditor-wrap v-model="form.content" :config="myConfig" @beforeInit="addCustomDialog" style="width: 90%;"></ueditor-wrap>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<!--<el-button type="text" @click="cancel">取消</el-button>-->
|
||||
<el-button :loading="loading" type="primary" @click="doSubmit">保存</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!--<div slot="footer" class="dialog-footer">-->
|
||||
<!--<el-button type="text" @click="cancel">取消</el-button>-->
|
||||
<!--<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { add, edit, get } from '@/api/bxg/yxArticle'
|
||||
import picUpload from '@/components/pic-upload'
|
||||
import editor from '../../components/Editor'
|
||||
import yamedit from '@/components/YamlEdit'
|
||||
import MaterialList from '@/components/material'
|
||||
import UeditorWrap from 'vue-ueditor-wrap';
|
||||
export default {
|
||||
components: { editor, picUpload, yamedit, MaterialList, UeditorWrap },
|
||||
// props: {
|
||||
// isAdd: {
|
||||
// type: Boolean,
|
||||
// required: true
|
||||
// }
|
||||
// },
|
||||
data() {
|
||||
return {
|
||||
loading: false, dialog: false,
|
||||
form: {
|
||||
id: '',
|
||||
cid: '',
|
||||
title: '',
|
||||
author: '',
|
||||
imageInput: '',
|
||||
imageArr: [],
|
||||
synopsis: '',
|
||||
content: '',
|
||||
shareTitle: '',
|
||||
shareSynopsis: '',
|
||||
visit: '',
|
||||
sort: '',
|
||||
url: '',
|
||||
status: '',
|
||||
addTime: '',
|
||||
hide: '',
|
||||
merId: '',
|
||||
productId: '',
|
||||
isHot: '',
|
||||
isBanner: ''
|
||||
},
|
||||
rules: {
|
||||
},
|
||||
myConfig: {
|
||||
autoHeightEnabled: false, // 编辑器不自动被内容撑高
|
||||
initialFrameHeight: 500, // 初始容器高度
|
||||
initialFrameWidth: '100%', // 初始容器宽度
|
||||
UEDITOR_HOME_URL: '/UEditor/',
|
||||
serverUrl: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
created() {
|
||||
this.form.id = this.$route.params.id
|
||||
this.$nextTick(() => {
|
||||
//this.init()
|
||||
if(this.form.id){
|
||||
get(this.form.id).then(data => {
|
||||
this.form = data
|
||||
this.form.imageArr = [data.imageInput]
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
addCustomDialog () {
|
||||
window.UE.registerUI('yshop', function (editor, uiName) {
|
||||
let dialog = new window.UE.ui.Dialog({
|
||||
iframeUrl: '/yshop/materia/index',
|
||||
editor: editor,
|
||||
name: uiName,
|
||||
title: '上传图片',
|
||||
cssRules: 'width:1200px;height:500px;padding:20px;'
|
||||
});
|
||||
this.dialog = dialog;
|
||||
|
||||
var btn = new window.UE.ui.Button({
|
||||
name: 'dialog-button',
|
||||
title: '上传图片',
|
||||
cssRules: `background-image: url(../../../assets/images/icons.png);background-position: -726px -77px;`,
|
||||
onclick: function () {
|
||||
dialog.render();
|
||||
dialog.open();
|
||||
}
|
||||
});
|
||||
|
||||
return btn;
|
||||
}, 37);
|
||||
},
|
||||
cancel() {
|
||||
this.resetForm()
|
||||
},
|
||||
doSubmit() {
|
||||
this.loading = true
|
||||
if(this.form.imageArr.length > 0){
|
||||
this.form.imageInput = this.form.imageArr.join(',')
|
||||
}else{
|
||||
this.form.imageInput = ''
|
||||
}
|
||||
|
||||
if (!this.form.id) {
|
||||
this.doAdd()
|
||||
} else this.doEdit()
|
||||
},
|
||||
doAdd() {
|
||||
add(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '添加成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
// this.$parent.init()
|
||||
setTimeout(() => {
|
||||
this.$router.push({ path: '/wechat/wearticle' });
|
||||
}, 500);
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
doEdit() {
|
||||
edit(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
// this.$parent.init()
|
||||
setTimeout(() => {
|
||||
this.$router.push({ path: '/wechat/wearticle' });
|
||||
}, 500);
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
this.dialog = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = {
|
||||
id: '',
|
||||
cid: '',
|
||||
title: '',
|
||||
author: '',
|
||||
imageInput: '',
|
||||
synopsis: '',
|
||||
shareTitle: '',
|
||||
shareSynopsis: '',
|
||||
visit: '',
|
||||
sort: '',
|
||||
url: '',
|
||||
status: '',
|
||||
addTime: '',
|
||||
hide: '',
|
||||
adminId: '',
|
||||
merId: '',
|
||||
productId: '',
|
||||
isHot: '',
|
||||
isBanner: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,183 @@
|
||||
<template>
|
||||
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="1000px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="标题">
|
||||
<el-input v-model="form.title" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="作者">
|
||||
<el-input v-model="form.author" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="封面">
|
||||
<MaterialList v-model="form.imageArr" style="width: 370px" type="image" :num="1" :width="150" :height="150" />
|
||||
</el-form-item>
|
||||
<el-form-item label="简介">
|
||||
<el-input v-model="form.synopsis" style="width: 370px;" rows="5" type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="正文">
|
||||
<!--<editor v-model="form.content" />-->
|
||||
<ueditor-wrap v-model="form.content" :config="myConfig" @beforeInit="addCustomDialog" style="width: 90%;"></ueditor-wrap>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取消</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { add, edit } from '@/api/bxg/yxArticle'
|
||||
import picUpload from '@/components/pic-upload'
|
||||
import editor from '../../components/Editor'
|
||||
import yamedit from '@/components/YamlEdit'
|
||||
import MaterialList from '@/components/material'
|
||||
import UeditorWrap from 'vue-ueditor-wrap';
|
||||
export default {
|
||||
components: { editor, picUpload, yamedit, MaterialList, UeditorWrap },
|
||||
props: {
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false, dialog: false,
|
||||
form: {
|
||||
id: '',
|
||||
cid: '',
|
||||
title: '',
|
||||
author: '',
|
||||
imageInput: '',
|
||||
imageArr: [],
|
||||
synopsis: '',
|
||||
content: '',
|
||||
shareTitle: '',
|
||||
shareSynopsis: '',
|
||||
visit: '',
|
||||
sort: '',
|
||||
url: '',
|
||||
status: '',
|
||||
addTime: '',
|
||||
hide: '',
|
||||
merId: '',
|
||||
productId: '',
|
||||
isHot: '',
|
||||
isBanner: ''
|
||||
},
|
||||
rules: {
|
||||
},
|
||||
myConfig: {
|
||||
autoHeightEnabled: false, // 编辑器不自动被内容撑高
|
||||
initialFrameHeight: 500, // 初始容器高度
|
||||
initialFrameWidth: '100%', // 初始容器宽度
|
||||
UEDITOR_HOME_URL: '/UEditor/',
|
||||
serverUrl: 'http://35.201.165.105:8000/controller.php'
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
methods: {
|
||||
addCustomDialog (editorId) {
|
||||
window.UE.registerUI('test-dialog', function (editor, uiName) {
|
||||
let dialog = new window.UE.ui.Dialog({
|
||||
iframeUrl: '/admin/widget.images/index.html?fodder=dialog',
|
||||
editor: editor,
|
||||
name: uiName,
|
||||
title: '上传图片',
|
||||
cssRules: 'width:1200px;height:500px;padding:20px;'
|
||||
});
|
||||
this.dialog = dialog;
|
||||
// 参考上面的自定义按钮
|
||||
var btn = new window.UE.ui.Button({
|
||||
name: 'dialog-button',
|
||||
title: '上传图片',
|
||||
cssRules: `background-image: url(../../../assets/images/icons.png);background-position: -726px -77px;`,
|
||||
onclick: function () {
|
||||
// 渲染dialog
|
||||
dialog.render();
|
||||
dialog.open();
|
||||
}
|
||||
});
|
||||
|
||||
return btn;
|
||||
}, 37);
|
||||
},
|
||||
cancel() {
|
||||
this.resetForm()
|
||||
},
|
||||
doSubmit() {
|
||||
this.loading = true
|
||||
if(this.form.imageArr.length > 0){
|
||||
this.form.imageInput = this.form.imageArr.join(',')
|
||||
}else{
|
||||
this.form.imageInput = ''
|
||||
}
|
||||
|
||||
if (this.isAdd) {
|
||||
this.doAdd()
|
||||
} else this.doEdit()
|
||||
},
|
||||
doAdd() {
|
||||
add(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '添加成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
doEdit() {
|
||||
edit(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
this.dialog = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = {
|
||||
id: '',
|
||||
cid: '',
|
||||
title: '',
|
||||
author: '',
|
||||
imageInput: '',
|
||||
synopsis: '',
|
||||
shareTitle: '',
|
||||
shareSynopsis: '',
|
||||
visit: '',
|
||||
sort: '',
|
||||
url: '',
|
||||
status: '',
|
||||
addTime: '',
|
||||
hide: '',
|
||||
adminId: '',
|
||||
merId: '',
|
||||
productId: '',
|
||||
isHot: '',
|
||||
isBanner: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 新增 -->
|
||||
<div style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button
|
||||
v-permission="['admin','YXARTICLE_ALL','YXARTICLE_CREATE']"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
>
|
||||
<router-link :to="'/wechat/artadd'">
|
||||
新增
|
||||
</router-link>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<!--<eForm ref="form" :is-add="isAdd" />-->
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column prop="id" label="ID" />
|
||||
<el-table-column prop="title" label="标题" />
|
||||
<el-table-column prop="author" label="作者" />
|
||||
<el-table-column ref="table" prop="imageInput" label="封面">
|
||||
<template slot-scope="scope">
|
||||
<a :href="scope.row.imageInput" style="color: #42b983" target="_blank"><img :src="scope.row.imageInput" alt="点击打开" class="el-avatar"></a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['admin','YXARTICLE_ALL','YXARTICLE_EDIT','YXARTICLE_DELETE'])" label="操作" width="220px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['admin','YXARTICLE_ALL','YXARTICLE_EDIT']" size="mini"
|
||||
type="primary" icon="el-icon-edit"
|
||||
>
|
||||
<router-link :to="'/wechat/artadd/'+scope.row.id">
|
||||
编辑
|
||||
</router-link>
|
||||
</el-button>
|
||||
<el-popover
|
||||
:ref="scope.row.id"
|
||||
v-permission="['admin','YXARTICLE_ALL','YXARTICLE_DELETE']"
|
||||
placement="top"
|
||||
width="180"
|
||||
>
|
||||
<p>确定删除本条数据吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
|
||||
</div>
|
||||
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
|
||||
</el-popover>
|
||||
<el-popover
|
||||
:ref="'item'+scope.row.id"
|
||||
v-permission="['admin','YXARTICLE_ALL','YXARTICLE_DELETE']"
|
||||
placement="top"
|
||||
width="180"
|
||||
>
|
||||
<p>确定发布本条数据吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="$refs['item'+scope.row.id].doClose()">取消</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="subPublish(scope.row.id)">确定</el-button>
|
||||
</div>
|
||||
<el-button slot="reference" type="primary" size="mini">发布</el-button>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:total="total"
|
||||
:current-page="page + 1"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del, publish } from '@/api/bxg/yxArticle'
|
||||
import eForm from './form'
|
||||
import { formatTime } from '@/utils/index'
|
||||
export default {
|
||||
components: { eForm },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
formatTime,
|
||||
checkPermission,
|
||||
beforeInit() {
|
||||
this.url = 'bxg/api/yxArticle'
|
||||
const sort = 'id,desc'
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
return true
|
||||
},
|
||||
subDelete(id) {
|
||||
this.delLoading = true
|
||||
del(id).then(res => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
this.dleChangePage()
|
||||
this.init()
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
}).catch(err => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
subPublish(id) {
|
||||
this.delLoading = true
|
||||
publish(id).then(res => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
this.dleChangePage()
|
||||
this.init()
|
||||
this.$notify({
|
||||
title: '发布成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
}).catch(err => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.isAdd = true
|
||||
this.$refs.form.dialog = true
|
||||
},
|
||||
edit(data) {
|
||||
this.isAdd = false
|
||||
const _this = this.$refs.form
|
||||
_this.form = {
|
||||
id: data.id,
|
||||
cid: data.cid,
|
||||
title: data.title,
|
||||
author: data.author,
|
||||
imageInput: data.imageInput,
|
||||
imageArr: data.imageInput.split(','),
|
||||
synopsis: data.synopsis,
|
||||
content: data.content,
|
||||
shareTitle: data.shareTitle,
|
||||
shareSynopsis: data.shareSynopsis,
|
||||
visit: data.visit,
|
||||
sort: data.sort,
|
||||
url: data.url,
|
||||
status: data.status,
|
||||
addTime: data.addTime,
|
||||
hide: data.hide,
|
||||
adminId: data.adminId,
|
||||
merId: data.merId,
|
||||
productId: data.productId,
|
||||
isHot: data.isHot,
|
||||
isBanner: data.isBanner
|
||||
}
|
||||
_this.dialog = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
|
||||
<el-form-item label="开启">
|
||||
<el-radio v-model="form.exp_enable" :label="1">开启</el-radio>
|
||||
<el-radio v-model="form.exp_enable" :label="2">关闭</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="appId">
|
||||
<el-input v-model="form.exp_appId" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="appKey">
|
||||
<el-input v-model="form.exp_appKey" style="width: 370px;" type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button type="primary" @click="doSubmit">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del, add, get } from '@/api/bxg/yxSystemConfig'
|
||||
import eForm from './form'
|
||||
import picUpload from '@/components/pic-upload'
|
||||
import { Message } from 'element-ui'
|
||||
export default {
|
||||
components: { eForm, picUpload },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false,
|
||||
form: {
|
||||
exp_enable: 2,
|
||||
exp_appId: '',
|
||||
exp_appKey: ''
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
get().then(rese => {
|
||||
const that = this;
|
||||
rese.content.map(function(key, value) {
|
||||
const keyName = key.menuName
|
||||
const newValue = key.value
|
||||
if(keyName in that.form){
|
||||
that.form[keyName] = newValue
|
||||
}
|
||||
})
|
||||
|
||||
this.form.exp_enable = parseInt(this.form.exp_enable)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
doSubmit() {
|
||||
add(this.form).then(res => {
|
||||
Message({ message: '设置成功', type: 'success' })
|
||||
}).catch(err => {
|
||||
// this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,154 @@
|
||||
<template>
|
||||
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="字段名称">
|
||||
<el-input v-model="form.menuName" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型(文本框,单选按钮...)">
|
||||
<el-input v-model="form.type" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="表单类型">
|
||||
<el-input v-model="form.inputType" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="配置分类id">
|
||||
<el-input v-model="form.configTabId" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规则 单选框和多选框">
|
||||
<el-input v-model="form.parameter" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="上传文件格式1单图2多图3文件">
|
||||
<el-input v-model="form.uploadType" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规则">
|
||||
<el-input v-model="form.required" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="多行文本框的宽度">
|
||||
<el-input v-model="form.width" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="多行文框的高度">
|
||||
<el-input v-model="form.high" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="默认值">
|
||||
<el-input v-model="form.value" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="配置名称">
|
||||
<el-input v-model="form.info" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="配置简介">
|
||||
<el-input v-model="form.desc" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序">
|
||||
<el-input v-model="form.sort" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否隐藏">
|
||||
<el-input v-model="form.status" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取消</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { add, edit } from '@/api/bxg/yxSystemConfig'
|
||||
export default {
|
||||
props: {
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false, dialog: false,
|
||||
form: {
|
||||
id: '',
|
||||
menuName: '',
|
||||
type: '',
|
||||
inputType: '',
|
||||
configTabId: '',
|
||||
parameter: '',
|
||||
uploadType: '',
|
||||
required: '',
|
||||
width: '',
|
||||
high: '',
|
||||
value: '',
|
||||
info: '',
|
||||
desc: '',
|
||||
sort: '',
|
||||
status: ''
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.resetForm()
|
||||
},
|
||||
doSubmit() {
|
||||
this.loading = true
|
||||
if (this.isAdd) {
|
||||
this.doAdd()
|
||||
} else this.doEdit()
|
||||
},
|
||||
doAdd() {
|
||||
add(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '添加成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
doEdit() {
|
||||
edit(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
this.dialog = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = {
|
||||
id: '',
|
||||
menuName: '',
|
||||
type: '',
|
||||
inputType: '',
|
||||
configTabId: '',
|
||||
parameter: '',
|
||||
uploadType: '',
|
||||
required: '',
|
||||
width: '',
|
||||
high: '',
|
||||
value: '',
|
||||
info: '',
|
||||
desc: '',
|
||||
sort: '',
|
||||
status: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
|
||||
<el-form-item label="AppID">
|
||||
<el-input v-model="form.wechat_appid" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="AppSecret">
|
||||
<el-input v-model="form.wechat_appsecret" style="width: 370px;" type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item label="微信验证TOKEN">
|
||||
<el-input v-model="form.wechat_token" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="EncodingAESKey">
|
||||
<el-input v-model="form.wechat_encodingaeskey" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="微信服务器地址">
|
||||
<el-input v-model="form.api" :disabled="true" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="微信分享图片">
|
||||
<MaterialList v-model="imageArr" style="width: 370px" type="image" :num="1" :width="150" :height="150" />
|
||||
</el-form-item>
|
||||
<el-form-item label="关注二维码">
|
||||
<MaterialList
|
||||
v-model="wechat_follow_imgArr"
|
||||
style="width: 500px"
|
||||
type="image"
|
||||
:num="1"
|
||||
:width="150"
|
||||
:height="150"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="微信分享标题">
|
||||
<el-input v-model="form.wechat_share_title" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="微信分享简介">
|
||||
<el-input v-model="form.wechat_share_synopsis" style="width: 370px;" rows="5" type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button type="primary" @click="doSubmit">提交</el-button>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del, add, get } from '@/api/bxg/yxSystemConfig'
|
||||
import eForm from './form'
|
||||
import picUpload from '@/components/pic-upload'
|
||||
import { Message } from 'element-ui'
|
||||
import MaterialList from '@/components/material'
|
||||
export default {
|
||||
components: { eForm, picUpload, MaterialList },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
wechat_follow_imgArr:[],
|
||||
imageArr: [],
|
||||
delLoading: false,
|
||||
form: {
|
||||
wechat_name: '',
|
||||
wechat_id: '',
|
||||
wechat_sourceid: '',
|
||||
wechat_appid: '',
|
||||
wechat_appsecret: '',
|
||||
wechat_token: '',
|
||||
wechat_encode: '',
|
||||
wechat_encodingaeskey: '',
|
||||
wechat_share_img: '',
|
||||
wechat_follow_img: '',
|
||||
wechat_qrcode: '',
|
||||
wechat_type: '',
|
||||
wechat_share_title: '',
|
||||
wechat_share_synopsis: '',
|
||||
api: 'http://你的域名/api/wechat/serve',
|
||||
wechat_avatar: ''
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
imageArr: function(val) {
|
||||
if (val) {
|
||||
this.form.wechat_share_img = val.join(',')
|
||||
}
|
||||
},wechat_follow_imgArr: function(val) {
|
||||
if (val) {
|
||||
this.form.wechat_follow_img = val.join(',')
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
get().then(rese => {
|
||||
const that = this
|
||||
rese.content.map(function(key, value) {
|
||||
const keyName = key.menuName
|
||||
const newValue = key.value
|
||||
if(keyName in that.form){
|
||||
that.form[keyName] = newValue
|
||||
}
|
||||
})
|
||||
|
||||
this.imageArr = this.form.wechat_share_img.split(',')
|
||||
this.wechat_follow_imgArr = this.form.wechat_follow_img.split(',')
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
doSubmit() {
|
||||
add(this.form).then(res => {
|
||||
Message({ message: '设置成功', type: 'success' })
|
||||
}).catch(err => {
|
||||
// this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,79 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
|
||||
<el-form-item label="微信APP支付AppID">
|
||||
<el-input v-model="form.wx_native_app_appId" style="width: 370px;" />
|
||||
<p style="color: red">微信开放平台审核通过的应用APPID(请登录open.weixin.qq.com查看,注意与公众号的APPID不同)</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="商户id">
|
||||
<el-input v-model="form.wxpay_mchId" style="width: 370px;" type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商户密钥">
|
||||
<el-input v-model="form.wxpay_mchKey" style="width: 370px;" type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item label="微信证书">
|
||||
<file-upload v-model="form.wxpay_keyPath" style="width: 500px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button type="primary" @click="doSubmit">提交</el-button>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del, add, get } from '@/api/bxg/yxSystemConfig'
|
||||
import eForm from './form'
|
||||
import picUpload from '@/components/pic-upload'
|
||||
import { Message } from 'element-ui'
|
||||
import fileUpload from '@/components/file-upload'
|
||||
export default {
|
||||
components: { eForm, picUpload, fileUpload },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false,
|
||||
form: {
|
||||
wx_native_app_appId: '',
|
||||
wxpay_mchId: '',
|
||||
wxpay_mchKey: '',
|
||||
wxpay_keyPath: ''
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
get().then(rese => {
|
||||
const that = this
|
||||
rese.content.map(function(key, value) {
|
||||
const keyName = key.menuName
|
||||
const newValue = key.value
|
||||
if(keyName in that.form){
|
||||
that.form[keyName] = newValue
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
doSubmit() {
|
||||
add(this.form).then(res => {
|
||||
Message({ message: '设置成功', type: 'success' })
|
||||
}).catch(err => {
|
||||
// this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
|
||||
<el-form-item label="积分抵用比例">
|
||||
<el-input v-model="form.integral_ratio" style="width: 370px;" />
|
||||
<p style="color: red">积分抵用比例(1积分抵多少金额)</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="满多少可以抵扣">
|
||||
<el-input v-model="form.integral_full" style="width: 370px;" />
|
||||
<p style="color: red">消费必须满一定额度才可使用,0代表无限制</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="单次最大抵扣积分">
|
||||
<el-input v-model="form.integral_max" style="width: 370px;" />
|
||||
<p style="color: red">限制一次只能使用多少积分,0代表无限制</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button type="primary" @click="doSubmit">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del, add, get } from '@/api/bxg/yxSystemConfig'
|
||||
import eForm from './form'
|
||||
import picUpload from '@/components/pic-upload'
|
||||
import { Message } from 'element-ui'
|
||||
export default {
|
||||
components: { eForm, picUpload },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false,
|
||||
form: {
|
||||
integral_ratio: '',
|
||||
integral_full: 0,
|
||||
integral_max: 0
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
get().then(rese => {
|
||||
const that = this
|
||||
rese.content.map(function(key, value) {
|
||||
const keyName = key.menuName
|
||||
const newValue = key.value
|
||||
if(keyName in that.form){
|
||||
that.form[keyName] = newValue
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
doSubmit() {
|
||||
add(this.form).then(res => {
|
||||
Message({ message: '设置成功', type: 'success' })
|
||||
}).catch(err => {
|
||||
// this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
|
||||
<el-form-item label="邮费基础价">
|
||||
<el-input v-model="form.store_postage" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="满额包邮">
|
||||
<el-input v-model="form.store_free_postage" style="width: 370px;" />
|
||||
<p style="color: red">0表示包邮,大于0表示满多少包邮</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button type="primary" @click="doSubmit">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del, add, get } from '@/api/bxg/yxSystemConfig'
|
||||
import eForm from './form'
|
||||
import picUpload from '@/components/pic-upload'
|
||||
import { Message } from 'element-ui'
|
||||
export default {
|
||||
components: { eForm, picUpload },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false,
|
||||
form: {
|
||||
store_postage: '',
|
||||
store_free_postage: ''
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
get().then(rese => {
|
||||
const that = this
|
||||
rese.content.map(function(key, value) {
|
||||
const keyName = key.menuName
|
||||
const newValue = key.value
|
||||
if(keyName in that.form){
|
||||
that.form[keyName] = newValue
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
doSubmit() {
|
||||
add(this.form).then(res => {
|
||||
Message({ message: '设置成功', type: 'success' })
|
||||
}).catch(err => {
|
||||
// this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
|
||||
<el-form-item label="分销开关">
|
||||
<el-radio v-model="form.store_brokerage_open" :label="1">开启</el-radio>
|
||||
<el-radio v-model="form.store_brokerage_open" :label="2">关闭</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="一级返佣比例">
|
||||
<el-input v-model="form.store_brokerage_ratio" style="width: 370px;" />
|
||||
<p style="color: red">金额乘以百分比,如果商品设置了单独分销,最终金额:固定返佣 + 比例返佣 = 总返佣金额</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="二级返佣比例">
|
||||
<el-input v-model="form.store_brokerage_two" style="width: 370px;" />
|
||||
<p style="color: red">金额乘以百分比,如果商品设置了单独分销,最终金额:固定返佣 + 比例返佣 = 总返佣金额<</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="提现最低金额">
|
||||
<el-input v-model="form.user_extract_min_price" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button type="primary" @click="doSubmit">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del, add, get } from '@/api/bxg/yxSystemConfig'
|
||||
import eForm from './form'
|
||||
import picUpload from '@/components/pic-upload'
|
||||
import { Message } from 'element-ui'
|
||||
export default {
|
||||
components: { eForm, picUpload },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false,
|
||||
form: {
|
||||
store_brokerage_open: 1,
|
||||
store_brokerage_ratio: 0,
|
||||
store_brokerage_two: 0,
|
||||
user_extract_min_price: 100
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
get().then(rese => {
|
||||
const that = this;
|
||||
rese.content.map(function(key, value) {
|
||||
const keyName = key.menuName
|
||||
const newValue = key.value
|
||||
if(keyName in that.form){
|
||||
that.form[keyName] = newValue
|
||||
}
|
||||
})
|
||||
|
||||
this.form.store_brokerage_open = parseInt(this.form.store_brokerage_open)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
doSubmit() {
|
||||
add(this.form).then(res => {
|
||||
Message({ message: '设置成功', type: 'success' })
|
||||
}).catch(err => {
|
||||
// this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
|
||||
<el-form-item label="移动端H5地址">
|
||||
<el-input v-model="form.site_url" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="uniapp-H5地址">
|
||||
<el-input v-model="form.uni_site_url" style="width: 370px;" />
|
||||
<span style="color: red">主要用于兼容单独h5</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="移动端API地址">
|
||||
<el-input v-model="form.api_url" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="后台API地址">
|
||||
<el-input v-model="form.admin_api_url" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件存储方式">
|
||||
<el-radio v-model="form.file_store_mode" :label="1">本地存储</el-radio>
|
||||
<el-radio v-model="form.file_store_mode" :label="2">云存储</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="包邮金额">
|
||||
<el-input v-model="form.store_free_postage" style="width: 370px;" />
|
||||
<p style="color: red">如果设置满包邮0 表示全局包邮,如果设置大于0表示满这价格包邮,否则走运费模板算法</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="隐藏充值按钮">
|
||||
<el-radio v-model="form.yshop_show_recharge" :label="0">显示</el-radio>
|
||||
<el-radio v-model="form.yshop_show_recharge" :label="1">隐藏</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button type="primary" @click="doSubmit">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del, add, get } from '@/api/bxg/yxSystemConfig'
|
||||
import eForm from './form'
|
||||
import picUpload from '@/components/pic-upload'
|
||||
import { Message } from 'element-ui'
|
||||
export default {
|
||||
components: { eForm, picUpload },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false,
|
||||
form: {
|
||||
yshop_show_recharge: 1,
|
||||
file_store_mode: 2,
|
||||
site_url: '',
|
||||
api_url: '',
|
||||
uni_site_url: '',
|
||||
admin_api_url: '',
|
||||
store_free_postage: ''
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
get().then(rese => {
|
||||
const that = this;
|
||||
rese.content.map(function(key, value) {
|
||||
const keyName = key.menuName
|
||||
const newValue = key.value
|
||||
if(keyName in that.form){
|
||||
that.form[keyName] = newValue
|
||||
}
|
||||
})
|
||||
|
||||
this.form.file_store_mode = parseInt(this.form.file_store_mode)
|
||||
this.form.yshop_show_recharge = parseInt(this.form.yshop_show_recharge)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
doSubmit() {
|
||||
add(this.form).then(res => {
|
||||
Message({ message: '设置成功', type: 'success' })
|
||||
}).catch(err => {
|
||||
// this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
|
||||
<el-form-item label="开启短信">
|
||||
<el-radio v-model="form.sms_enable" :label="1">开启</el-radio>
|
||||
<el-radio v-model="form.sms_enable" :label="2">关闭</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="签名">
|
||||
<el-input v-model="form.sms_sign" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="模板id">
|
||||
<el-input v-model="form.sms_templateId" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="region">
|
||||
<el-input v-model="form.sms_region" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="accessKey">
|
||||
<el-input v-model="form.sms_access_key" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="accessKeySecret">
|
||||
<el-input v-model="form.sms_access_secret" style="width: 370px;" type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button type="primary" @click="doSubmit">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del, add, get } from '@/api/bxg/yxSystemConfig'
|
||||
import eForm from './form'
|
||||
import picUpload from '@/components/pic-upload'
|
||||
import { Message } from 'element-ui'
|
||||
export default {
|
||||
components: { eForm, picUpload },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false,
|
||||
form: {
|
||||
sms_enable: 2,
|
||||
sms_sign: '',
|
||||
sms_templateId: '',
|
||||
sms_region: '',
|
||||
sms_access_key: '',
|
||||
sms_access_secret: ''
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
get().then(rese => {
|
||||
const that = this;
|
||||
rese.content.map(function(key, value) {
|
||||
const keyName = key.menuName
|
||||
const newValue = key.value
|
||||
if(keyName in that.form){
|
||||
that.form[keyName] = newValue
|
||||
}
|
||||
})
|
||||
|
||||
this.form.sms_enable = parseInt(this.form.sms_enable)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
doSubmit() {
|
||||
add(this.form).then(res => {
|
||||
Message({ message: '设置成功', type: 'success' })
|
||||
}).catch(err => {
|
||||
// this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
|
||||
<el-form-item label="AppID">
|
||||
<el-input v-model="form.wxapp_appId" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="小程序密钥">
|
||||
<el-input v-model="form.wxapp_secret" style="width: 370px;" type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button type="primary" @click="doSubmit">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del, add, get } from '@/api/bxg/yxSystemConfig'
|
||||
import eForm from './form'
|
||||
import picUpload from '@/components/pic-upload'
|
||||
import { Message } from 'element-ui'
|
||||
export default {
|
||||
components: { eForm, picUpload },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false,
|
||||
form: {
|
||||
wxapp_appId: '',
|
||||
wxapp_secret: '',
|
||||
wechat_ma_token: '',
|
||||
wechat_ma_encodingaeskey: '',
|
||||
wxapi: 'http://你的H5api端域名/api/wxapp/serve',
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
get().then(rese => {
|
||||
const that = this
|
||||
rese.content.map(function(key, value) {
|
||||
const keyName = key.menuName
|
||||
const newValue = key.value
|
||||
if(keyName in that.form){
|
||||
that.form[keyName] = newValue
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
doSubmit() {
|
||||
add(this.form).then(res => {
|
||||
Message({ message: '设置成功', type: 'success' })
|
||||
}).catch(err => {
|
||||
// this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,317 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
|
||||
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
|
||||
</el-select>
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-tooltip slot="right" class="item" effect="dark" content="数据库中表字段变动时使用该功能" placement="top-start">
|
||||
<el-button
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="success"
|
||||
icon="el-icon-refresh"
|
||||
:loading="syncLoading"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="sync"
|
||||
>同步</el-button>
|
||||
</el-tooltip>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="140px">
|
||||
<el-form-item label="选择商品" prop="coverImgeUrl" >
|
||||
<cgood v-model="form.good":disabled="isdisabled" ></cgood>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品封面图:" prop="coverImgeUrl">
|
||||
<single-pic v-model="form.coverImgeUrl" type="image" :num="1" :width="150" :height="150" />
|
||||
<p style="color: #cf0f0f">图片规则:图片尺寸最大300像素*300像素;</p>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="商品小程序路径" prop="url" >
|
||||
<el-input v-model="form.url" style="width: 370px;" :disabled="true"/>
|
||||
</el-form-item>
|
||||
<!-- 1:一口价(只需要传入price,price2不传)-->
|
||||
<!-- 2:价格区间(price字段为左边界,price2字段为右边界,price和price2必传)-->
|
||||
<!-- 3:显示折扣价(price字段为原价,price2字段为现价, price和price2必传)-->
|
||||
<el-form-item label="商品名称" prop="name" >
|
||||
<el-input v-model="form.name" style="width: 370px;" :disabled="isdisabled"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="价格类型" prop="priceType" >
|
||||
<el-radio-group v-model="form.priceType" >
|
||||
<el-radio :label="'1'" class="radio">一口价</el-radio>
|
||||
<el-radio :label="'2'" class="radio">价格区间</el-radio>
|
||||
<el-radio :label="'3'" class="radio">显示折扣价</el-radio>
|
||||
</el-radio-group>
|
||||
<p v-if="isdisabled" style="color: #cf0f0f">商品审核通过已入库,只能修改价格</p>
|
||||
</el-form-item>
|
||||
<el-col v-if="form.priceType=='1'" v-bind="grid">
|
||||
<el-form-item label="一口价" prop="price" >
|
||||
<el-input v-model="form.price" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.priceType=='2'" v-bind="grid">
|
||||
<el-form-item label="最低价格" prop="price" >
|
||||
<el-input v-model="form.price" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.priceType=='2'" v-bind="grid">
|
||||
<el-form-item label="最高价格" prop="price2" >
|
||||
<el-input v-model="form.price2" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.priceType=='3'" v-bind="grid">
|
||||
<el-form-item label="市场价" prop="price" >
|
||||
<el-input v-model="form.price" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.priceType=='3'" v-bind="grid">
|
||||
<el-form-item label="现价" prop="price2" >
|
||||
<el-input v-model="form.price2" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="columns.visible('goodsId')" prop="goodsId" label="直播商品id" />
|
||||
<el-table-column v-if="columns.visible('name')" prop="name" label="商品名称" />
|
||||
<el-table-column v-if="columns.visible('productId')" prop="productId" label="关联商品id" />
|
||||
<el-table-column v-if="columns.visible('coverImgeUrl')" prop="coverImgUrl" label="商品图片" >
|
||||
<template slot-scope="scope">
|
||||
<a :href="scope.row.coverImgeUrl" style="color: #42b983" target="_blank"><img :src="scope.row.coverImgeUrl" alt="点击打开" class="el-avatar"></a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="columns.visible('url')" prop="url" label="商品小程序路径" />
|
||||
<el-table-column v-if="columns.visible('priceType')" prop="priceType" label="价格类型" >
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.priceType == 1" :type="''">一口价</el-tag>
|
||||
<el-tag v-else-if="scope.row.priceType == 2" :type="''">价格区间</el-tag>
|
||||
<el-tag v-else-if="scope.row.priceType == 3" :type="''">显示折扣价</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column v-if="columns.visible('price')" prop="price" label="price" />-->
|
||||
<!-- <el-table-column v-if="columns.visible('price2')" prop="price2" label="price2" />-->
|
||||
<el-table-column v-if="columns.visible('auditStatus')" prop="auditStatus" label="审核状态" >
|
||||
<!-- //0:未审核,1:审核中,2:审核通过,3审核失败-->
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.auditStatus === 0" :type="''">未审核</el-tag>
|
||||
<el-tag v-else-if="scope.row.auditStatus === 1" :type="''">审核中</el-tag>
|
||||
<el-tag v-else-if="scope.row.auditStatus === 2" :type="''">审核通过</el-tag>
|
||||
<el-tag v-else-if="scope.row.auditStatus === 3" :type="''">审核失败</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 1, 2:表示是为api添加商品,否则是直播控制台添加的商品-->
|
||||
<el-table-column v-if="columns.visible('thirdPartyTag')" prop="thirdPartyTag" label="添加途径" >
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.thirdPartyTag == 0" :type="''">api添加</el-tag>
|
||||
<el-tag v-else-if="scope.row.thirdPartyTag == 2" :type="''">控制台</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column v-permission="['admin','yxWechatLiveGoods:edit','yxWechatLiveGoods:del']" label="操作" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { sync } from '@/api/bxg/yxWechatLiveGoods'
|
||||
import crudYxWechatLiveGoods from '@/api/bxg/yxWechatLiveGoods'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import cgood from '@/views/components/good'
|
||||
import singlePic from '@/components/singlematerial'
|
||||
// crud交由presenter持有
|
||||
const defaultCrud = CRUD({ title: '直播商品', url: 'api/yxWechatLiveGoods', sort: 'goods_id,desc', crudMethod: { ...crudYxWechatLiveGoods }})
|
||||
const defaultForm = { good: {productId: null,storeName: null,image: null,price: null,otPrice: null}, goodsId: null, productId: null, coverImgeUrl: '', url: null, priceType: null, price: null, price2: null, name: null, thirdPartyTag: null, auditId: null, auditStatus: null }
|
||||
export default {
|
||||
name: 'YxWechatLiveGoods',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation ,cgood,singlePic},
|
||||
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
return {
|
||||
isdisabled: false,
|
||||
syncLoading: false,
|
||||
grid: {
|
||||
xl: 8,
|
||||
lg: 12,
|
||||
md: 12,
|
||||
sm: 24,
|
||||
xs: 24
|
||||
},
|
||||
permission: {
|
||||
add: ['admin', 'yxWechatLiveGoods:add'],
|
||||
edit: ['admin', 'yxWechatLiveGoods:edit'],
|
||||
del: ['admin', 'yxWechatLiveGoods:del']
|
||||
},
|
||||
rules: {
|
||||
coverImgUrl: [
|
||||
{ required: true, message: '商品图片不能为空', trigger: 'blur' }
|
||||
],
|
||||
priceType: [
|
||||
{ required: true, message: '价格类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
price: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '商品名称不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'name', display_name: '商品名称' }
|
||||
]
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'form.good': {
|
||||
handler(val,oldVal){
|
||||
this.form.productId = val.productId
|
||||
this.form.name = val.storeName
|
||||
this.form.price = val.price
|
||||
this.form.price2 = val.otPrice
|
||||
this.form.priceType = '3'
|
||||
if(val.productId){
|
||||
this.form.url="/pages/shop/GoodsCon/index?id="+val.productId
|
||||
}
|
||||
this.isdisabled=false;
|
||||
},
|
||||
deep:true//对象内部的属性监听,也叫深度监听
|
||||
},
|
||||
},
|
||||
computed:{
|
||||
disable(){
|
||||
if(this.form.auditStatus=="2"){
|
||||
return this.isdisabled=true;
|
||||
}else{
|
||||
return this.isdisabled=false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
sync() {
|
||||
const ids = []
|
||||
this.crud.selections.forEach(val => {
|
||||
ids.push(val.goodsId)
|
||||
})
|
||||
this.crud.selections.forEach(val => {
|
||||
})
|
||||
this.syncLoading = true
|
||||
sync(ids).then(() => {
|
||||
this.crud.refresh()
|
||||
this.crud.notify('同步成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.syncLoading = false
|
||||
}).then(() => {
|
||||
this.syncLoading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 执行删除
|
||||
* @param {*} data 数据项
|
||||
*/
|
||||
doDelete(data) {
|
||||
let delAll = false
|
||||
let dataStatus
|
||||
const ids = []
|
||||
if (data instanceof Array) {
|
||||
delAll = true
|
||||
data.forEach(val => {
|
||||
ids.push(val.goodsId)
|
||||
})
|
||||
} else {
|
||||
ids.push(data.goodsId)
|
||||
dataStatus = crud.getDataStatus(data.goodsId)
|
||||
}
|
||||
if (!callVmHook(crud, CRUD.HOOK.beforeDelete, data)) {
|
||||
return
|
||||
}
|
||||
if (!delAll) {
|
||||
dataStatus.delete = CRUD.STATUS.PROCESSING
|
||||
}
|
||||
return crud.crudMethod.del(ids).then(() => {
|
||||
if (delAll) {
|
||||
crud.delAllLoading = false
|
||||
} else dataStatus.delete = CRUD.STATUS.PREPARED
|
||||
crud.dleChangePage(1)
|
||||
crud.delSuccessNotify()
|
||||
callVmHook(crud, CRUD.HOOK.afterDelete, data)
|
||||
crud.refresh()
|
||||
}).catch(() => {
|
||||
if (delAll) {
|
||||
crud.delAllLoading = false
|
||||
} else dataStatus.delete = CRUD.STATUS.PREPARED
|
||||
})
|
||||
},
|
||||
// 获取数据前设置好接口地址
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
const query = this.query
|
||||
if (query.type && query.value) {
|
||||
this.crud.params[query.type] = query.value
|
||||
}else{
|
||||
delete this.crud.params.name
|
||||
}
|
||||
return true
|
||||
}, // 新增与编辑前做的操作
|
||||
[CRUD.HOOK.beforeToCU](crud, form) {
|
||||
this.form.good.productId = form.productId
|
||||
this.form.good.storeName = form.name
|
||||
this.form.good.image = form.coverImgeUrl
|
||||
this.form.good.price = form.price
|
||||
this.form.good.otPrice = form.price2
|
||||
this.form.good.auditStatus = form.auditStatus
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.table-img {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
background: #ccc;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
vertical-align: middle;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,383 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-tooltip slot="right" class="item" effect="dark" content="同步小程序控制台直播间数据" placement="top-start">
|
||||
<el-button
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="success"
|
||||
icon="el-icon-refresh"
|
||||
:loading="syncLoading"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="sync"
|
||||
>同步</el-button>
|
||||
</el-tooltip>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="140px">
|
||||
<el-form-item label="直播间标题" prop="name">
|
||||
<el-input v-model="form.name" style="width: 370px;" :disabled="isDisabled" />
|
||||
</el-form-item>
|
||||
<el-form-item label="直播间背景图" prop="coverImg" >
|
||||
<MaterialList v-model="form.coverImgArr" style="width: 370px" type="image" :num="1" :width="150" :height="150":disabled="isDisabled" />
|
||||
</el-form-item>
|
||||
<el-form-item label="直播间分享图片" prop="shareImg" >
|
||||
<MaterialList v-model="form.shareImgArr" style="width: 370px" type="image" :num="1" :width="150" :height="150":disabled="isDisabled" />
|
||||
</el-form-item>
|
||||
<el-form-item label="封面图" prop="feedsImg" >
|
||||
<MaterialList v-model="form.feedsImgArr" style="width: 370px" type="image" :num="1" :width="150" :height="150":disabled="isDisabled" />
|
||||
<p style="color: #cf0f0f">购物直播封面图 ,建议尺寸800*800</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划直播开始时间" prop="startDate" >
|
||||
<el-date-picker v-model="form.startDate" type="datetime" style="width: 370px;" :disabled="isDisabled"/>
|
||||
<p style="color: #cf0f0f">开播时间需要在当前时间的10分钟后,并且开始时间不能在6个月后</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划直播结束时间" prop="endDate" >
|
||||
<el-date-picker v-model="form.endDate" type="datetime" style="width: 370px;" :disabled="isDisabled"/>
|
||||
<p style="color: #cf0f0f">开播时间和结束时间间隔不得短于30分钟,不得超过24小时</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="主播昵称" prop="anchorName" :disabled="isDisabled">
|
||||
<el-input v-model="form.anchorName" style="width: 370px;" :disabled="isDisabled"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="主播微信号" prop="anchorWechat" :disabled="isDisabled">
|
||||
<el-input v-model="form.anchorWechat" style="width: 370px;" :disabled="isDisabled"/>
|
||||
<p style="color: #cf0f0f">主播微信号需要实名,搜索微信官方小程序【小程序直播】进行认证</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="主播头像" prop="anchorImg" >
|
||||
<MaterialList v-model="form.anchorImgArr" style="width: 370px" type="image" :num="1" :width="150" :height="150" :disabled="isDisabled"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="直播间类型" prop="type" >
|
||||
<el-radio-group v-model="form.type":disabled="isDisabled" >
|
||||
<el-radio :label="1" class="radio">推流</el-radio>
|
||||
<el-radio :label="0">手机直播</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="横屏、竖屏" prop="screenType" >
|
||||
<el-radio-group v-model="form.screenType" :disabled="isDisabled">
|
||||
<el-radio :label="1" class="radio">横屏</el-radio>
|
||||
<el-radio :label="0">竖屏</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否关闭点赞" prop="closeLike" >
|
||||
<el-radio-group v-model="form.closeLike" :disabled="isDisabled">
|
||||
<el-radio :label="1" class="radio">关闭</el-radio>
|
||||
<el-radio :label="0">开启</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否关闭货架" prop="closeGoods" >
|
||||
<el-radio-group v-model="form.closeGoods" :disabled="isDisabled">
|
||||
<el-radio :label="1" class="radio">关闭</el-radio>
|
||||
<el-radio :label="0">开启</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否关闭评论" prop="closeComment" >
|
||||
<el-radio-group v-model="form.closeComment" :disabled="isDisabled">
|
||||
<el-radio :label="1" class="radio">关闭</el-radio>
|
||||
<el-radio :label="0">开启</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否关闭回放" prop="closeLike" >
|
||||
<el-radio-group v-model="form.closeReplay" :disabled="isDisabled">
|
||||
<el-radio :label="1" class="radio">关闭</el-radio>
|
||||
<el-radio :label="0">开启</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否关闭分享" prop="closeGoods" >
|
||||
<el-radio-group v-model="form.closeShare" :disabled="isDisabled">
|
||||
<el-radio :label="1" class="radio">关闭</el-radio>
|
||||
<el-radio :label="0">开启</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否关闭客服" prop="closeComment" >
|
||||
<el-radio-group v-model="form.closeKf" :disabled="isDisabled">
|
||||
<el-radio :label="1" class="radio">关闭</el-radio>
|
||||
<el-radio :label="0">开启</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU" :disabled="isDisabled">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog title="修改直播间商品信息"
|
||||
:visible.sync="closeDialogVisible"
|
||||
width="40%">
|
||||
<el-form :model="form"
|
||||
label-width="150px">
|
||||
<el-form-item label="选择入库商品" >
|
||||
<LiveGoods :product="form.product" @selectGoods="getGoods" > </LiveGoods>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeDialog()">取 消</el-button>
|
||||
<el-button type="primary" @click="handleCloseOrder">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="columns.visible('roomId')" prop="roomId" label="直播间id" />
|
||||
<el-table-column v-if="columns.visible('name')" prop="name" label="直播间标题" />
|
||||
<el-table-column v-if="columns.visible('coverImge')" prop="coverImge" label="背景图">
|
||||
<template slot-scope="scope">
|
||||
<a :href="scope.row.coverImge" style="color: #42b983" target="_blank"><img :src="scope.row.coverImge" alt="点击打开" class="el-avatar"></a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="columns.visible('shareImge')" prop="shareImge" label="分享图片" >
|
||||
<template slot-scope="scope">
|
||||
<a :href="scope.row.shareImge" style="color: #42b983" target="_blank"><img :src="scope.row.shareImge" alt="点击打开" class="el-avatar"></a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 101:直播中,102:未开始,103 已结束,104 禁播,105:暂停,106:异常,107:已过期-->
|
||||
<el-table-column v-if="columns.visible('liveStatus')" prop="liveStatus" label="直播间状态" >
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.liveStatus === 101" :type="''">直播中</el-tag>
|
||||
<el-tag v-if="scope.row.liveStatus === 102" :type="''">未开始</el-tag>
|
||||
<el-tag v-if="scope.row.liveStatus === 103" :type="''">已结束</el-tag>
|
||||
<el-tag v-if="scope.row.liveStatus === 104" :type="''">禁播</el-tag>
|
||||
<el-tag v-if="scope.row.liveStatus === 105" :type="''">暂停</el-tag>
|
||||
<el-tag v-if="scope.row.liveStatus === 106" :type="''">异常</el-tag>
|
||||
<el-tag v-if="scope.row.liveStatus === 107" :type="''">已过期</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="startTime" label="开始时间" width="200" >
|
||||
<template slot-scope="scope" width="200">
|
||||
<span>{{ formatTimeThree(scope.row.startTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="endTime" label="预计结束时间" width="200">
|
||||
<template slot-scope="scope" width="200">
|
||||
<span>{{ formatTimeThree(scope.row.endTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="columns.visible('anchorName')" prop="anchorName" label="主播昵称" />
|
||||
<el-table-column v-if="columns.visible('anchorWechat')" prop="anchorWechat" label="主播微信号" />
|
||||
<el-table-column v-if="columns.visible('anchorImge')" prop="anchorImge" label="主播头像" >
|
||||
<template slot-scope="scope">
|
||||
<a :href="scope.row.anchorImge" style="color: #42b983" target="_blank"><img :src="scope.row.anchorImge" alt="点击打开" class="el-avatar"></a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="columns.visible('type')" prop="type" label="直播类型" >
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.type === 1" :type="''">推流</el-tag>
|
||||
<el-tag v-else :type="''">手机直播</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="columns.visible('closeReplay')" prop="closeReplay" label="回放" >
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.closeReplay === 1" :type="''">关闭</el-tag>
|
||||
<el-tag v-else :type=" '' ">开启</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-permission="['admin','yxWechatLive:edit','yxWechatLive:del']" label="操作" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
>
|
||||
</udOperation>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="success"
|
||||
@click="showCloseOrderDialog(scope.row)"
|
||||
>
|
||||
添加商品
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { sync } from '@/api/bxg/yxWechatLive'
|
||||
import crudYxWechatLive from '@/api/bxg/yxWechatLive'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import MaterialList from '@/components/material'
|
||||
import LiveGoods from '@/views/components/livegoods'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import {formatTimeThree} from '@/utils/index'
|
||||
import { addGoods } from '@/api/bxg/yxWechatLive'
|
||||
// crud交由presenter持有
|
||||
const defaultCrud = CRUD({ optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: true
|
||||
},title: '直播房间', url: 'api/yxWechatLive', sort: 'room_id,desc', crudMethod: { ...crudYxWechatLive }})
|
||||
const defaultForm = { product: [],roomId: null,productId: null,feedsImg: null, name: null, coverImge: null, startDate: null, endDate : null,shareImge: null, liveStatus: null, coverImgArr: [],shareImgArr: [],anchorImgArr: [],feedsImgArr:[],startTime: null, endTime: null, anchorName: null, anchorWechat: null, anchorImge: null, type: 0, screenType: 0, closeLike: 0,closeGoods: 0, closeComment: 0,closeReplay: 0,closeShare:0,closeKf:0 }
|
||||
export default {
|
||||
name: 'YxWechatLive',
|
||||
components: { pagination, crudOperation, rrOperation ,MaterialList,udOperation,LiveGoods},
|
||||
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
return {
|
||||
closeDialogVisible:false,
|
||||
disabled: false,
|
||||
syncLoading: false,
|
||||
permission: {
|
||||
add: ['admin', 'yxWechatLive:add'],
|
||||
edit: ['admin', 'yxWechatLive:edit'],
|
||||
del: ['admin', 'yxWechatLive:del']
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '直播间标题不能为空', trigger: 'blur' }
|
||||
],
|
||||
coverImge: [
|
||||
{ required: true, message: '背景图不能为空', trigger: 'blur' }
|
||||
],
|
||||
shareImge: [
|
||||
{ required: true, message: '分享图片不能为空', trigger: 'blur' }
|
||||
],
|
||||
startDate: [
|
||||
{ required: true, message: '开始时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
endDate: [
|
||||
{ required: true, message: '预计结束时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
anchorName: [
|
||||
{ required: true, message: '主播昵称不能为空', trigger: 'blur' }
|
||||
],
|
||||
anchorWechat: [
|
||||
{ required: true, message: '主播微信号不能为空', trigger: 'blur' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '直播间类型 1:推流 0:手机直播不能为空', trigger: 'blur' }
|
||||
],
|
||||
screenType: [
|
||||
{ required: true, message: '横屏、竖屏 【1:横屏,0:竖屏】不能为空', trigger: 'blur' }
|
||||
],
|
||||
closeLike: [
|
||||
{ required: true, message: '是否关闭货架 【0:开启,1:关闭】不能为空', trigger: 'blur' }
|
||||
],
|
||||
closeComment: [
|
||||
{ required: true, message: '是否关闭评论 【0:开启,1:关闭】不能为空', trigger: 'blur' }
|
||||
]
|
||||
} }
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
computed:{
|
||||
isDisabled(){
|
||||
if(this.disabled){
|
||||
return this.isdisabled=true;
|
||||
}else{
|
||||
return this.isdisabled=false;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
closeDialog(){
|
||||
this.form.product = []
|
||||
this.closeDialogVisible=false;
|
||||
},
|
||||
showCloseOrderDialog(row){
|
||||
this.closeDialogVisible=true;
|
||||
this.form.roomId = row.id;
|
||||
this.form.product = row.product
|
||||
},
|
||||
handleCloseOrder(){
|
||||
this.$confirm('是否提交?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let params ={
|
||||
"roomId": this.form.roomId,
|
||||
"productId": this.form.productId
|
||||
}
|
||||
addGoods(params).then(res=>{
|
||||
this.closeDialogVisible=false;
|
||||
this.$message.success("添加成功");
|
||||
}).catch(err => {
|
||||
this.$message.error(res.msg);
|
||||
})
|
||||
});
|
||||
},
|
||||
formatTimeThree,
|
||||
getGoods(p) {
|
||||
var ids = []
|
||||
p.forEach((item,index) => {
|
||||
ids.push(item.id)
|
||||
})
|
||||
this.form.productId = ids.join(",")
|
||||
},
|
||||
sync() {
|
||||
this.crud.selections.forEach(val => {
|
||||
})
|
||||
this.syncLoading = true
|
||||
sync().then(() => {
|
||||
this.crud.refresh()
|
||||
this.crud.notify('同步成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.syncLoading = false
|
||||
}).then(() => {
|
||||
this.syncLoading = false
|
||||
})
|
||||
},
|
||||
// 获取数据前设置好接口地址
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}, // 新增与编辑前做的操作
|
||||
// 添加后 coverImgArr: [],shareImgArr: [],anchorImgArr: []
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
//console.log('hah:'+this.form.imageArr)
|
||||
this.form.coverImge = this.form.coverImgArr.join(',')
|
||||
this.form.shareImge = this.form.shareImgArr.join(',')
|
||||
this.form.anchorImge = this.form.anchorImgArr.join(',')
|
||||
this.form.feedsImg = this.form.feedsImgArr.join(',')
|
||||
},
|
||||
// 新增与编辑前做的操作
|
||||
[CRUD.HOOK.beforeToAdd](crud, form) {
|
||||
this.disabled = false;
|
||||
},
|
||||
// 编辑前
|
||||
[CRUD.HOOK.beforeToEdit](crud, form) {
|
||||
form.coverImgArr = [form.coverImge]
|
||||
form.shareImgArr = [form.shareImge]
|
||||
form.anchorImgArr = [form.anchorImge]
|
||||
form.product = form.product
|
||||
this.disabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.table-img {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
background: #ccc;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
vertical-align: middle;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="缓存数据">
|
||||
<el-input v-model="form.result" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="缓存时间">
|
||||
<el-input v-model="form.addTime" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取消</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { add, edit } from '@/api/bxg/YxWechatMenu'
|
||||
export default {
|
||||
props: {
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false, dialog: false,
|
||||
form: {
|
||||
key: '',
|
||||
result: '',
|
||||
addTime: ''
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.resetForm()
|
||||
},
|
||||
doSubmit() {
|
||||
this.loading = true
|
||||
if (this.isAdd) {
|
||||
this.doAdd()
|
||||
} else this.doEdit()
|
||||
},
|
||||
doAdd() {
|
||||
add(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '添加成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
doEdit() {
|
||||
edit(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
this.dialog = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = {
|
||||
key: '',
|
||||
result: '',
|
||||
addTime: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,671 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="wechat-reply-wrapper wechat-menu">
|
||||
<div class="ibox-content clearfix">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<div class="view-wrapper col-sm-4">
|
||||
<div class="mobile-header">公众号</div>
|
||||
<section class="view-body">
|
||||
<div class="time-wrapper"><span class="time">9:36</span></div>
|
||||
</section>
|
||||
<div class="menu-footer">
|
||||
<ul class="flex">
|
||||
<li v-for="(menu, index) in menus" :class="{active:menu === checkedMenu}">
|
||||
<span @click="activeMenu(menu,index,null)"><i class="icon-sub" />{{ menu.name || '一级菜单' }}</span>
|
||||
<div class="sub-menu">
|
||||
<ul>
|
||||
<li v-for="(child, cindex) in menu.subButtons" :class="{active:child === checkedMenu}">
|
||||
<span @click="activeMenu(child,cindex,index)">{{ child.name || '二级菜单' }}</span>
|
||||
</li>
|
||||
<li v-if="menu.subButtons.length < 5" @click="addChild(menu,index)"><i class="icon-add" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li v-if="menus.length < 3" @click="addMenu()"><i class="icon-add" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div v-show="checkedMenuId !== null" class="control-wrapper menu-control col-sm-8">
|
||||
<section>
|
||||
<div class="control-main">
|
||||
<h3 class="popover-title">菜单名称 <a class="fr" href="javascript:void(0);" @click="delMenu">删除</a></h3>
|
||||
<p class="tips-txt">已添加子菜单,仅可设置菜单名称。</p>
|
||||
<div class="menu-content control-body">
|
||||
<form action="">
|
||||
<div class="form-group clearfix">
|
||||
<label for="" class="el-form-item__label" style="width: 80px;">菜单名称</label>
|
||||
<div class="col-sm-9 group-item">
|
||||
<input v-model="checkedMenu.name" type="text" placeholder="菜单名称" style="width: 370px;" class="el-input__inner">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group clearfix">
|
||||
<label class="el-form-item__label" style="width: 80px;" for="">规则状态</label>
|
||||
<div class="group-item col-sm-9">
|
||||
<select id="" v-model="checkedMenu.type" style="width: 370px;" class="el-input__inner" name="">
|
||||
<option value="click">关键字</option>
|
||||
<option value="view">跳转网页</option>
|
||||
<option value="miniprogram">小程序</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu-control-box">
|
||||
<!-- 关键字 -->
|
||||
<div class="keywords item" :class="{show:checkedMenu.type=='click'}">
|
||||
<span class="el-form-item__label">关键字</span>
|
||||
<input v-model="checkedMenu.key" type="text" placeholder="请输入关键字" class="form-control">
|
||||
|
||||
</div>
|
||||
<!-- 跳转地址 -->
|
||||
<div class="url item" :class="{show:checkedMenu.type=='view'}">
|
||||
<span class="el-form-item__label">跳转地址</span>
|
||||
<input v-model="checkedMenu.url" type="text" placeholder="请输入跳转地址" class="form-control">
|
||||
<p class="text-left" />
|
||||
</div>
|
||||
<!-- 小程序 -->
|
||||
<div class="wrchat-app item" :class="{show:checkedMenu.type=='miniprogram'}">
|
||||
<div class="list">
|
||||
<span class="el-form-item__label">appId</span>
|
||||
<input v-model="checkedMenu.appId" class="form-control" type="text">
|
||||
</div>
|
||||
<div class="list">
|
||||
<span class="el-form-item__label">备用网页url</span>
|
||||
<input v-model="checkedMenu.url" class="form-control" type="text">
|
||||
</div>
|
||||
<div class="list">
|
||||
<span class="el-form-item__label">小程序路径</span>
|
||||
<input v-model="checkedMenu.pagePath" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 多客服 -->
|
||||
<div class="service item">
|
||||
<p>回复内容</p>
|
||||
<textarea cols="60" rows="10" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="ibox-content submit">
|
||||
<button class="el-button el-button--primary" @click="submit">保存发布</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del, add, get } from '@/api/bxg/YxWechatMenu'
|
||||
import eForm from './form'
|
||||
import { Message } from 'element-ui'
|
||||
export default {
|
||||
components: { eForm },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false,
|
||||
menus: [],
|
||||
checkedMenu: {
|
||||
type: 'click',
|
||||
name: ''
|
||||
},
|
||||
checkedMenuId: null,
|
||||
parentMenuId: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
get().then(res => {
|
||||
this.menus = JSON.parse(res.result)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
beforeInit() {
|
||||
this.url = 'bxg/api/YxWechatMenu'
|
||||
const sort = 'key,desc'
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
return true
|
||||
},
|
||||
subDelete(key) {
|
||||
this.delLoading = true
|
||||
del(key).then(res => {
|
||||
this.delLoading = false
|
||||
this.$refs[key].doClose()
|
||||
this.dleChangePage()
|
||||
this.init()
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
}).catch(err => {
|
||||
this.delLoading = false
|
||||
this.$refs[key].doClose()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.isAdd = true
|
||||
this.$refs.form.dialog = true
|
||||
},
|
||||
edit(data) {
|
||||
this.isAdd = false
|
||||
const _this = this.$refs.form
|
||||
_this.form = {
|
||||
key: data.key,
|
||||
result: data.result,
|
||||
addTime: data.addTime
|
||||
}
|
||||
_this.dialog = true
|
||||
},
|
||||
defaultMenusData: function() {
|
||||
return {
|
||||
type: 'click',
|
||||
name: '',
|
||||
subButtons: []
|
||||
}
|
||||
},
|
||||
defaultChildData: function() {
|
||||
return {
|
||||
type: 'click',
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
addMenu: function() {
|
||||
if (!this.check()) return false
|
||||
var data = this.defaultMenusData(); var id = this.menus.length
|
||||
this.menus.push(data)
|
||||
this.checkedMenu = data
|
||||
this.checkedMenuId = id
|
||||
this.parentMenuId = null
|
||||
},
|
||||
addChild: function(menu, index) {
|
||||
if (!this.check()) return false
|
||||
var data = this.defaultChildData(); var id = menu.subButtons.length
|
||||
menu.subButtons.push(data)
|
||||
this.checkedMenu = data
|
||||
this.checkedMenuId = id
|
||||
this.parentMenuId = index
|
||||
},
|
||||
delMenu: function() {
|
||||
console.log(this.parentMenuId)
|
||||
this.parentMenuId === null
|
||||
? this.menus.splice(this.checkedMenuId, 1) : this.menus[this.parentMenuId].subButtons.splice(this.checkedMenuId, 1)
|
||||
this.parentMenuId = null
|
||||
this.checkedMenu = {}
|
||||
this.checkedMenuId = null
|
||||
},
|
||||
activeMenu: function(menu, index, pid) {
|
||||
if (!this.check()) return false
|
||||
pid === null
|
||||
? (this.checkedMenu = menu) : (this.checkedMenu = this.menus[pid].subButtons[index], this.parentMenuId = pid)
|
||||
this.checkedMenuId = index
|
||||
},
|
||||
check: function() {
|
||||
if (this.checkedMenuId === null) return true
|
||||
if (!this.checkedMenu.name) {
|
||||
// $eb.message('请输入按钮名称!');
|
||||
this.$message({
|
||||
message: '请输入按钮名称',
|
||||
type: 'error',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
// this.init()
|
||||
}
|
||||
})
|
||||
return false
|
||||
}
|
||||
if (this.checkedMenu.type == 'click' && !this.checkedMenu.key) {
|
||||
// $eb.message('请输入关键字!');
|
||||
this.$message({
|
||||
message: '请输入关键字',
|
||||
type: 'error',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
// this.init()
|
||||
}
|
||||
})
|
||||
return false
|
||||
}
|
||||
if (this.checkedMenu.type == 'view' && !this.checkedMenu.url) {
|
||||
this.$message({
|
||||
message: '请输入跳转地址',
|
||||
type: 'error',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
// this.init()
|
||||
}
|
||||
})
|
||||
|
||||
return false
|
||||
}
|
||||
if (this.checkedMenu.type == 'miniprogram' &&
|
||||
(!this.checkedMenu.appId ||
|
||||
!this.checkedMenu.pagePath ||
|
||||
!this.checkedMenu.url)) {
|
||||
// $eb.message('请填写完整小程序配置!');
|
||||
this.$message({
|
||||
message: '请填写完整小程序配置',
|
||||
type: 'error',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
// this.init()
|
||||
}
|
||||
})
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
submit: function() {
|
||||
// this.$message.error('错了哦,这是一条错误消息')
|
||||
// return false;
|
||||
if (!this.check()) return false
|
||||
// console.log(this.menus.length)
|
||||
if (!this.menus.length) {
|
||||
this.$message({
|
||||
message: '请添加菜单',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
})
|
||||
return false
|
||||
}
|
||||
add({ buttons: this.menus }).then(function(res) {
|
||||
console.log(555)
|
||||
Message({ message: '添加成功', type: 'success' })
|
||||
}).catch(function(err) {
|
||||
// $eb.message('error',err);
|
||||
// this.$message.error('错了哦,这是一条错误消息');
|
||||
// Message({message: "2222",type: 'error'})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" scoped>
|
||||
|
||||
body {
|
||||
font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
color: #676a6c;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
font-size: 12px
|
||||
}
|
||||
|
||||
.form-control {
|
||||
background-color: #FFF;
|
||||
background-image: none;
|
||||
border: 1px solid #e5e6e7;
|
||||
border-radius: 1px;
|
||||
color: inherit;
|
||||
display: block;
|
||||
padding: 6px 12px;
|
||||
-webkit-transition: border-color .15s ease-in-out 0s, box-shadow .15s ease-in-out 0s;
|
||||
transition: border-color .15s ease-in-out 0s, box-shadow .15s ease-in-out 0s;
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: -webkit-box;
|
||||
display: -moz-box;
|
||||
display: -webkit-flex;
|
||||
display: -moz-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#app .layout-ceiling-main a {
|
||||
color: #9ba7b5
|
||||
}
|
||||
|
||||
|
||||
#table-list .mp-header-wrapper h1 {
|
||||
padding-left: 15px;
|
||||
float: left;
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
padding-bottom: 20px;
|
||||
font-weight: 400;
|
||||
color: #464c5b;
|
||||
}
|
||||
|
||||
|
||||
.mp-form .ivu-tree li {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
.mp-form .demo-upload-list img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
.mp-form .demo-upload-list-cover i {
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
|
||||
.wechat-reply-wrapper .fr {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .clearfix:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 0;
|
||||
visibility: hidden;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-title p {
|
||||
border-left: 2px solid #2494f2;
|
||||
text-indent: 8px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content {
|
||||
padding: 15px;
|
||||
font-size: 12 ox
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .view-wrapper {
|
||||
position: relative;
|
||||
width: 317px;
|
||||
background-image: url(../../../../assets/wechat/mobile_head.png);
|
||||
background-repeat: no-repeat;
|
||||
background-position: left top;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .view-wrapper .mobile-header {
|
||||
position: relative;
|
||||
left: 0;
|
||||
top: 36px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .view-wrapper .view-body {
|
||||
margin-top: 65px;
|
||||
background-color: #f5f5f5;
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .view-wrapper .view-body .time-wrapper {
|
||||
margin-bottom: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .view-wrapper .view-body .time-wrapper .time {
|
||||
display: inline-block;
|
||||
color: #f5f5f5;
|
||||
display: inline-block;
|
||||
color: #f5f5f5;
|
||||
background: rgba(0, 0, 0, .3);
|
||||
padding: 3px 8px;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
||||
.wechat-reply-wrapper .view-wrapper .view-body .view-item .avatar img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
|
||||
.wechat-reply-wrapper .submit {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 图文 */
|
||||
|
||||
/* 音乐 */
|
||||
|
||||
.view-wrapper .view-body .view-item.music-box .box-content p {
|
||||
width: 75%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
|
||||
/* 右侧控制器 */
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper {
|
||||
position: relative;
|
||||
width: 535px;
|
||||
height: 565px;
|
||||
padding: 0;
|
||||
margin-left: 20px;
|
||||
border: 1px solid #e2e2e2;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body {
|
||||
margin-top: 40px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .form-group label {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .form-group .tips:after {
|
||||
content: '*';
|
||||
color: red;
|
||||
position: absolute;
|
||||
margin-left: 4px;
|
||||
font-weight: bold;
|
||||
line-height: 1.8em;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .form-group .group-item {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .form-group .group-item .file-btn {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 0;
|
||||
display: block;
|
||||
width: 66px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
padding: .5rem;
|
||||
background-color: #18a689;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
line-height: 23px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .form-group .group-item textarea {
|
||||
resize: none;
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .tips-info {
|
||||
padding-left: 100px;
|
||||
font-size: 12px;
|
||||
color: #737373;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .control-main .control-item {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .control-main .control-item.show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* 微信菜单定制 */
|
||||
.wechat-menu {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wechat-menu ul {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -10px;
|
||||
width: 100%;
|
||||
padding-left: 43px;
|
||||
background: url("../../../../assets/wechat/mobile_foot.png") no-repeat 0px 20px;
|
||||
border-top: 1px solid #e7e7eb;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer span {
|
||||
display: block;
|
||||
font-size: 12px
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer .icon-add {
|
||||
background: url(../../../../assets/wechat/index.png) 0 0 no-repeat;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
margin-top: -2px;
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer li {
|
||||
position: relative;
|
||||
-webkit-flex: 1;
|
||||
-moz-flex: 1;
|
||||
-ms-flex: 1;
|
||||
flex: 1;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
border: 1px solid transparent;
|
||||
border-right: 1px solid #e7e7eb;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer .icon-sub {
|
||||
background: url(../../../../assets/wechat/index.png) 0 -48px no-repeat;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
margin-right: 2px;
|
||||
margin-top: -2px;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer .sub-menu {
|
||||
position: absolute;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #d0d0d0;
|
||||
display: block;
|
||||
bottom: 60px;
|
||||
width: 100%;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer .sub-menu:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background: #fafafa;
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-ms-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
bottom: -5px;
|
||||
border-bottom: 1px solid #d0d0d0;
|
||||
border-right: 1px solid #d0d0d0;
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer .sub-menu li {
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid #d0d0d0;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer .sub-menu li:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer .active {
|
||||
border: 1px solid #44b549;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer .sub-menu li.active {
|
||||
border: 1px solid #44b549 !important;
|
||||
}
|
||||
|
||||
/* 右侧 */
|
||||
.wechat-menu .menu-control .popover-title {
|
||||
padding: 8px 14px;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
background-color: #f7f7f7;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
border-radius: 5px 5px 0 0;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-control .popover-title a {
|
||||
color: #06C;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-control .tips-txt {
|
||||
line-height: 40px;
|
||||
padding: 0 20px;
|
||||
font-size: 12px
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body.menu-content {
|
||||
padding: 0 20px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body.menu-content .radio {
|
||||
display: inline-block !important;
|
||||
width: 45%;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body.menu-content .menu-control-box {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body.menu-content .menu-control-box .radio {
|
||||
display: block !important;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.menu-control-box .item {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.menu-control-box .show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,112 @@
|
||||
<template>
|
||||
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="关键字" prop="key">
|
||||
<el-input v-model="form.key" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="回复类型">
|
||||
<el-input v-model="form.type" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="回复数据">
|
||||
<el-input v-model="form.data" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="0=不可用 1 =可用">
|
||||
<el-input v-model="form.status" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否隐藏">
|
||||
<el-input v-model="form.hide" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取消</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { add, edit } from '@/api/bxg/yxWechatReply'
|
||||
export default {
|
||||
props: {
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false, dialog: false,
|
||||
form: {
|
||||
id: '',
|
||||
key: '',
|
||||
type: '',
|
||||
data: '',
|
||||
status: '',
|
||||
hide: ''
|
||||
},
|
||||
rules: {
|
||||
key: [
|
||||
{ required: true, message: 'please enter', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.resetForm()
|
||||
},
|
||||
doSubmit() {
|
||||
this.loading = true
|
||||
if (this.isAdd) {
|
||||
this.doAdd()
|
||||
} else this.doEdit()
|
||||
},
|
||||
doAdd() {
|
||||
add(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '添加成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
doEdit() {
|
||||
edit(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
this.dialog = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = {
|
||||
id: '',
|
||||
key: '',
|
||||
type: '',
|
||||
data: '',
|
||||
status: '',
|
||||
hide: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,785 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="wechat-reply-wrapper">
|
||||
<div class="ibox-title"><p>{{ msg }}</p></div>
|
||||
<div class="ibox-content clearfix">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<div class="view-wrapper col-sm-4">
|
||||
<div class="mobile-header">公众号</div>
|
||||
<section class="view-body" style="overflow:scroll;">
|
||||
<div class="time-wrapper"><span class="time">9:36</span></div>
|
||||
<div class="view-item text-box clearfix" :class="{show:type=='text'}">
|
||||
<div class="avatar fl"><img src="@/assets/wechat/head.gif"></div>
|
||||
<div class="box-content fl">
|
||||
{{ dataGroup.text.content }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="dataGroup.news.length >0" class="view-item news-box" :class="{show:type=='news'}">
|
||||
<div v-if="dataGroup.news.length ==1" class="vn-content">
|
||||
<div class="vn-title">{{ dataGroup.news[0].title }}</div>
|
||||
<div class="vn-time">{{ dataGroup.news[0].date }}</div>
|
||||
<div class="vn-picture" :style="{backgroundImage: 'url('+dataGroup.news[0].image+')'}" />
|
||||
<div class="vn-picture-info">{{ dataGroup.news[0].description }}</div>
|
||||
<div class="vn-more">
|
||||
<a :href="dataGroup.news[0].url">阅读原文</a>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="vn-content">
|
||||
<div class="con-item-box">
|
||||
<div class="vn-picture" :style="{backgroundImage: 'url('+dataGroup.news[0].image+')'}" />
|
||||
<div class="first-title">{{ dataGroup.news[0].title }}</div>
|
||||
</div>
|
||||
<div v-for="(newinfos,index) in dataGroup.news" v-if="index>0" class="con-item-list clearfix">
|
||||
<div class="list-tit-info fl">{{ newinfos.title }}</div>
|
||||
<div class="list-pic fr" :style="{backgroundImage: 'url('+newinfos.image+')'}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="view-item text-box clearfix" :class="{show:type=='image'}">
|
||||
<div class="avatar fl"><img src="@/assets/wechat/head.gif"></div>
|
||||
<div class="box-content fl">
|
||||
<img class="picbox" :src="dataGroup.image.src" alt="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="control-wrapper col-sm-8">
|
||||
<section>
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
<div class="control-title">{{ msg }}</div>
|
||||
<div class="control-body">
|
||||
<div class="form-group clearfix">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4">
|
||||
<label class="col-sm-2 control-label tips" for="">规则状态</label>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<div class="group-item">
|
||||
<div class="radio i-checks" style="display:inline;margin-left: 5px;">
|
||||
<label class="" style="padding-left: 0;">
|
||||
<input v-model="status" style="position: relative;top: 1px;left: 3px;" checked="checked" type="radio" value="1" name="status">
|
||||
启用</label>
|
||||
</div>
|
||||
<div class="radio i-checks" style="display:inline;margin-left: 10px;">
|
||||
<label class="" style="padding-left: 0;">
|
||||
<input v-model="status" style="position: relative;top: 1px;left: 3px;" type="radio" value="0" name="status">
|
||||
禁用
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="form-group clearfix">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4">
|
||||
<label class="col-sm-2 tips" for="">消息类型</label>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<div class="col-sm-10 group-item">
|
||||
<select v-model="type" class="form-control m-b" name="account">
|
||||
<option value="text">文字消息</option>
|
||||
</select>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="control-main">
|
||||
<!-- 文字 -->
|
||||
<div class="control-item control-main-txt" :class="{show:type=='text'}">
|
||||
<div class="form-group clearfix">
|
||||
<label class="col-sm-2 tips" for="">规则内容</label>
|
||||
<div class="col-sm-10 group-item">
|
||||
<textarea id="" v-model="dataGroup.text.content" name="" cols="30" rows="10" placeholder="请输入内容" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 图片 -->
|
||||
<div class="control-item control-main-picture" :class="{show:type=='image'}">
|
||||
<div class="form-group clearfix">
|
||||
<pic-upload v-model="dataGroup.image.src" style="width: 500px;" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: center;"><button type="button" class="el-button el-button--primary" @click="submit">提交</button></div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del, add, get } from '@/api/bxg/yxWechatReply'
|
||||
import eForm from './form'
|
||||
import picUpload from '@/components/pic-upload'
|
||||
import { Message } from 'element-ui'
|
||||
export default {
|
||||
components: { eForm, picUpload },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false,
|
||||
status: 1,
|
||||
msg: '',
|
||||
type: 'text',
|
||||
textBox: '',
|
||||
pic: '',
|
||||
key: '',
|
||||
dataGroup: {
|
||||
text: {
|
||||
content: ''
|
||||
},
|
||||
image: {
|
||||
src: ''
|
||||
},
|
||||
voice: {
|
||||
src: ''
|
||||
},
|
||||
news: []
|
||||
},
|
||||
uploadColl: function() {
|
||||
},
|
||||
uploadLink: '',
|
||||
result: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
mounted: function() {
|
||||
this.key = 'subscribe'
|
||||
this.msg = '编辑关注回复'
|
||||
get().then(rese => {
|
||||
this.result = rese
|
||||
this.type = rese.type
|
||||
this.status = rese.status
|
||||
const newData = JSON.parse(rese.data)
|
||||
if (rese.type == 'image') {
|
||||
this.dataGroup.image.src = newDatasrc
|
||||
} else if (rese.type == 'text') {
|
||||
this.dataGroup.text.content = newData.content
|
||||
}
|
||||
if (this.used_key) {
|
||||
this.keyword = this.result.key
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
beforeInit() {
|
||||
this.url = 'bxg/api/yxWechatReply'
|
||||
const sort = 'id,desc'
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
return true
|
||||
},
|
||||
subDelete(id) {
|
||||
this.delLoading = true
|
||||
del(id).then(res => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
this.dleChangePage()
|
||||
this.init()
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
}).catch(err => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.isAdd = true
|
||||
this.$refs.form.dialog = true
|
||||
},
|
||||
edit(data) {
|
||||
this.isAdd = false
|
||||
const _this = this.$refs.form
|
||||
_this.form = {
|
||||
id: data.id,
|
||||
key: data.key,
|
||||
type: data.type,
|
||||
data: data.data,
|
||||
status: data.status,
|
||||
hide: data.hide
|
||||
}
|
||||
_this.dialog = true
|
||||
},
|
||||
submit: function() {
|
||||
if (!this.check()) return false
|
||||
|
||||
add({ key: this.key, status: this.status, data: this.dataGroup[this.type], type: this.type }).then(function(res) {
|
||||
Message({ message: '设置成功', type: 'success' })
|
||||
}).catch(function(err) {
|
||||
// Message({message: err,type: 'error'})
|
||||
})
|
||||
},
|
||||
check: function() {
|
||||
var dataGroup = this.dataGroup
|
||||
switch (this.type) {
|
||||
case 'text':
|
||||
if (dataGroup.text.content == '') { return this.returnError('请输入文字消息内容') }
|
||||
break
|
||||
case 'image':
|
||||
if (dataGroup.image.src == '') { return this.returnError('请上传图片') }
|
||||
break
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.form-control {
|
||||
background-color: #FFF;
|
||||
background-image: none;
|
||||
border: 1px solid #e5e6e7;
|
||||
border-radius: 1px;
|
||||
color: inherit;
|
||||
display: block;
|
||||
padding: 6px 12px;
|
||||
-webkit-transition: border-color .15s ease-in-out 0s, box-shadow .15s ease-in-out 0s;
|
||||
transition: border-color .15s ease-in-out 0s, box-shadow .15s ease-in-out 0s;
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
#app .layout-ceiling-main a {
|
||||
color: #9ba7b5
|
||||
}
|
||||
|
||||
#table-list .mp-header-wrapper h1 {
|
||||
padding-left: 15px;
|
||||
float: left;
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
padding-bottom: 20px;
|
||||
font-weight: 400;
|
||||
color: #464c5b;
|
||||
}
|
||||
|
||||
.mp-form .ivu-tree li {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.mp-form .demo-upload-list img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.mp-form .demo-upload-list-cover i {
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .fl {
|
||||
float: left;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .fr {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .clearfix:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 10px;
|
||||
visibility: hidden;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-title {
|
||||
padding: 0px;
|
||||
font-size: 16px;
|
||||
border-bottom: 1px solid #e7eaec;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-title p {
|
||||
border-left: 2px solid #2494f2;
|
||||
text-indent: 8px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content {
|
||||
padding: 15px;
|
||||
font-size: 12px
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .view-wrapper {
|
||||
position: relative;
|
||||
width: 317px;
|
||||
background-image: url('../../../../assets/wechat/mobile_head.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: left top;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .view-wrapper .mobile-header {
|
||||
position: relative;
|
||||
left: 0;
|
||||
top: 36px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .view-wrapper .view-body {
|
||||
margin-top: 65px;
|
||||
background-color: #f5f5f5;
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .view-wrapper .view-body .time-wrapper {
|
||||
margin-bottom: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .view-wrapper .view-body .time-wrapper .time {
|
||||
display: inline-block;
|
||||
color: #f5f5f5;
|
||||
display: inline-block;
|
||||
color: #f5f5f5;
|
||||
background: rgba(0, 0, 0, .3);
|
||||
padding: 3px 8px;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .view-wrapper .view-body .view-item {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .view-wrapper .view-body .view-item.show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .view-wrapper .view-body .view-item .avatar {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .view-wrapper .view-body .view-item .avatar img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .view-wrapper .view-body .view-item .box-content {
|
||||
position: relative;
|
||||
max-width: 60%;
|
||||
min-height: 40px;
|
||||
margin-left: 15px;
|
||||
padding: 10px;
|
||||
border: 1px solid #ccc;
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
line-height: 1.5;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .view-wrapper .view-body .view-item .box-content .picbox {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .view-wrapper .view-body .view-item .box-content:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: -13px;
|
||||
top: 11px;
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 8px solid transparent;
|
||||
border-right: 8px solid transparent;
|
||||
border-top: 10px solid #ccc;
|
||||
-webkit-transform: rotate(90deg);
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .view-wrapper .view-body .view-item .box-content:after {
|
||||
content: '';
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: -12px;
|
||||
top: 11px;
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 8px solid transparent;
|
||||
border-right: 8px solid transparent;
|
||||
border-top: 10px solid #f5f5f5;
|
||||
-webkit-transform: rotate(90deg);
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .submit {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 图文 */
|
||||
.view-wrapper .view-body .view-item.news-box {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item .vn-content {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item .vn-content .vn-title {
|
||||
line-height: 1.5;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item .vn-content .vn-time {
|
||||
padding: 5px 0;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item .vn-content .vn-picture {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
background-size: cover;
|
||||
background-position: center center;
|
||||
border-radius: 5px 5px 0 0;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item .vn-content .vn-picture-info {
|
||||
line-height: 22px;
|
||||
color: #7b7b7b;
|
||||
padding: 0;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
word-break: break-all;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item .vn-more {
|
||||
display: block;
|
||||
padding: 10px 0 0;
|
||||
border-top: 1px solid #dddddd;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item .vn-content .con-item-box {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item .vn-content .con-item-box .first-title {
|
||||
width: 100%;
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
font-size: 14px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap; /*background: rgba(0,0,0,.8);*/
|
||||
color: #fff;
|
||||
text-indent: 1em;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item .vn-content .con-item-list {
|
||||
margin-top: 10px;
|
||||
margin: 6px 10px 0 10px;
|
||||
border-top: 1px solid #FBFBFB;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item .vn-content .con-item-list .list-tit-info {
|
||||
width: 70%;
|
||||
line-height: 1.5;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item .vn-content .con-item-list .list-pic {
|
||||
width: 20%;
|
||||
min-height: 50px;
|
||||
background-size: cover;
|
||||
background-position: center center;
|
||||
}
|
||||
|
||||
/* 音乐 */
|
||||
.view-wrapper .view-body .view-item.music-box .box-content {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
background: #080;
|
||||
color: #fff;
|
||||
border-color: #080;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item.music-box .box-content p {
|
||||
width: 75%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item.music-box .box-content .music-icon {
|
||||
position: absolute;
|
||||
right: 11px;
|
||||
top: 50%;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background: #0a0;
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
margin-top: -15px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item.music-box .box-content:after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item.music-box .box-content:before {
|
||||
border-top: 10px solid #080;
|
||||
}
|
||||
|
||||
/* 视频 */
|
||||
.view-wrapper .view-body .view-item.video-box {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.view-wrapper .view-body .view-item.video-box .vn-title {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* 右侧控制器 */
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper {
|
||||
position: relative;
|
||||
width: 535px;
|
||||
height: 565px;
|
||||
padding: 0;
|
||||
margin-left: 20px;
|
||||
border: 1px solid #e2e2e2;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-title {
|
||||
position: absolute;
|
||||
left: 71px;
|
||||
top: -12px;
|
||||
width: auto;
|
||||
padding: 0 10px;
|
||||
font-size: 20px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body {
|
||||
margin-top: 40px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .form-group label {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .form-group .tips:after {
|
||||
content: '*';
|
||||
color: red;
|
||||
position: absolute;
|
||||
margin-left: 4px;
|
||||
font-weight: bold;
|
||||
line-height: 1.8em;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .form-group .group-item {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .form-group .group-item .file-btn {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 0;
|
||||
display: block;
|
||||
width: 66px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
padding: .5rem;
|
||||
background-color: #18a689;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
line-height: 23px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .form-group .group-item textarea {
|
||||
resize: none;
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .tips-info {
|
||||
padding-left: 100px;
|
||||
font-size: 12px;
|
||||
color: #737373;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .control-main .control-item {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body .control-main .control-item.show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* 微信菜单定制 */
|
||||
.wechat-menu ul {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer span {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer li {
|
||||
position: relative;
|
||||
-webkit-flex: 1;
|
||||
-moz-flex: 1;
|
||||
-ms-flex: 1;
|
||||
flex: 1;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
border: 1px solid transparent;
|
||||
border-right: 1px solid #e7e7eb;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer .icon-sub {
|
||||
background: url(../../../../assets/wechat/index.png) 0 -48px no-repeat;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
margin-right: 2px;
|
||||
margin-top: -2px;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer .sub-menu {
|
||||
position: absolute;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #d0d0d0;
|
||||
display: block;
|
||||
bottom: 60px;
|
||||
width: 100%;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer .sub-menu:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background: #fafafa;
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-ms-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
bottom: -5px;
|
||||
border-bottom: 1px solid #d0d0d0;
|
||||
border-right: 1px solid #d0d0d0;
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer .sub-menu li {
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid #d0d0d0;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer .sub-menu li:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer .active {
|
||||
border: 1px solid #44b549;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-footer .sub-menu li.active {
|
||||
border: 1px solid #44b549 !important;
|
||||
}
|
||||
|
||||
/* 右侧 */
|
||||
.wechat-menu .menu-control .popover-title {
|
||||
padding: 8px 14px;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
background-color: #f7f7f7;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
border-radius: 5px 5px 0 0;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-control .popover-title a {
|
||||
color: #06C;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.wechat-menu .menu-control .tips-txt {
|
||||
line-height: 40px;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body.menu-content {
|
||||
padding: 0 20px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body.menu-content .radio {
|
||||
display: inline-block !important;
|
||||
width: 45%;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body.menu-content .menu-control-box {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.wechat-reply-wrapper .ibox-content .control-wrapper .control-body.menu-content .menu-control-box .radio {
|
||||
display: block !important;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.menu-control-box .item {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.menu-control-box .show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="状态">
|
||||
<el-radio v-model="form.type" :label="'template'">模板消息</el-radio>
|
||||
<el-radio v-model="form.type" :label="'subscribe'">订阅消息</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="模板编号">
|
||||
<el-input v-model="form.tempkey" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="模板名">
|
||||
<el-input v-model="form.name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="模板ID">
|
||||
<el-input v-model="form.tempid" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-radio v-model="form.status" :label="1">可用</el-radio>
|
||||
<el-radio v-model="form.status" :label="0">禁用</el-radio>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取消</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { add, edit } from '@/api/bxg/yxWechatTemplate'
|
||||
export default {
|
||||
props: {
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false, dialog: false,
|
||||
form: {
|
||||
id: '',
|
||||
tempkey: '',
|
||||
name: '',
|
||||
content: '',
|
||||
tempid: '',
|
||||
addTime: '',
|
||||
status: 1
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.resetForm()
|
||||
},
|
||||
doSubmit() {
|
||||
this.loading = true
|
||||
if (this.isAdd) {
|
||||
this.doAdd()
|
||||
} else this.doEdit()
|
||||
},
|
||||
doAdd() {
|
||||
add(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '添加成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
doEdit() {
|
||||
edit(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
this.dialog = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = {
|
||||
id: '',
|
||||
tempkey: '',
|
||||
name: '',
|
||||
content: '',
|
||||
tempid: '',
|
||||
addTime: '',
|
||||
status: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 新增 -->
|
||||
<div style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button
|
||||
v-permission="['admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_CREATE']"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="add"
|
||||
>新增</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<eForm ref="form" :is-add="isAdd" />
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column prop="status" label="消息类型">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.type == 'template'" :type="''">模板消息</el-tag>
|
||||
<el-tag v-else :type=" 'info' ">订阅消息</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="id" label="模板id" />
|
||||
<el-table-column prop="tempkey" label="模板编号" />
|
||||
<el-table-column prop="name" label="模板名" />
|
||||
<el-table-column prop="tempid" label="模板ID" />
|
||||
<el-table-column prop="status" label="状态">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.status === 1" :type="''">可用</el-tag>
|
||||
<el-tag v-else :type=" 'info' ">禁用</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_EDIT','YXWECHATTEMPLATE_DELETE'])" label="操作" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
|
||||
<el-popover
|
||||
:ref="scope.row.id"
|
||||
v-permission="['admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_DELETE']"
|
||||
placement="top"
|
||||
width="180"
|
||||
>
|
||||
<p>确定删除本条数据吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
|
||||
</div>
|
||||
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:total="total"
|
||||
:current-page="page + 1"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del } from '@/api/bxg/yxWechatTemplate'
|
||||
import eForm from './form'
|
||||
|
||||
export default {
|
||||
components: { eForm },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
beforeInit() {
|
||||
this.url = 'bxg/api/yxWechatTemplate'
|
||||
const sort = 'id,desc'
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
return true
|
||||
},
|
||||
subDelete(id) {
|
||||
this.delLoading = true
|
||||
del(id).then(res => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
this.dleChangePage()
|
||||
this.init()
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
}).catch(err => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.isAdd = true
|
||||
this.$refs.form.dialog = true
|
||||
},
|
||||
edit(data) {
|
||||
this.isAdd = false
|
||||
const _this = this.$refs.form
|
||||
_this.form = {
|
||||
id: data.id,
|
||||
tempkey: data.tempkey,
|
||||
name: data.name,
|
||||
content: data.content,
|
||||
tempid: data.tempid,
|
||||
addTime: data.addTime,
|
||||
status: data.status,
|
||||
type: data.type
|
||||
}
|
||||
_this.dialog = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段">
|
||||
<el-input v-model="form.unionid" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户的标识,对当前公众号唯一">
|
||||
<el-input v-model="form.openid" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="小程序唯一身份ID">
|
||||
<el-input v-model="form.routineOpenid" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户的昵称">
|
||||
<el-input v-model="form.nickname" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户头像">
|
||||
<el-input v-model="form.headimgurl" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户的性别,值为1时是男性,值为2时是女性,值为0时是未知">
|
||||
<el-input v-model="form.sex" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户所在城市">
|
||||
<el-input v-model="form.city" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户的语言,简体中文为zh_CN">
|
||||
<el-input v-model="form.language" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户所在省份">
|
||||
<el-input v-model="form.province" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户所在国家">
|
||||
<el-input v-model="form.country" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注">
|
||||
<el-input v-model="form.remark" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户所在的分组ID(兼容旧的用户分组接口)">
|
||||
<el-input v-model="form.groupid" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户被打上的标签ID列表">
|
||||
<el-input v-model="form.tagidList" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户是否订阅该公众号标识">
|
||||
<el-input v-model="form.subscribe" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="关注公众号时间">
|
||||
<el-input v-model="form.subscribeTime" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="添加时间">
|
||||
<el-input v-model="form.addTime" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="一级推荐人">
|
||||
<el-input v-model="form.stair" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="二级推荐人">
|
||||
<el-input v-model="form.second" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="一级推荐人订单">
|
||||
<el-input v-model="form.orderStair" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="二级推荐人订单">
|
||||
<el-input v-model="form.orderSecond" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="佣金">
|
||||
<el-input v-model="form.nowMoney" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="小程序用户会话密匙">
|
||||
<el-input v-model="form.sessionKey" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户类型">
|
||||
<el-input v-model="form.userType" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取消</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { add, edit } from '@/api/bxg/yxWechatUser'
|
||||
export default {
|
||||
props: {
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false, dialog: false,
|
||||
form: {
|
||||
uid: '',
|
||||
unionid: '',
|
||||
openid: '',
|
||||
routineOpenid: '',
|
||||
nickname: '',
|
||||
headimgurl: '',
|
||||
sex: '',
|
||||
city: '',
|
||||
language: '',
|
||||
province: '',
|
||||
country: '',
|
||||
remark: '',
|
||||
groupid: '',
|
||||
tagidList: '',
|
||||
subscribe: '',
|
||||
subscribeTime: '',
|
||||
addTime: '',
|
||||
stair: '',
|
||||
second: '',
|
||||
orderStair: '',
|
||||
orderSecond: '',
|
||||
nowMoney: '',
|
||||
sessionKey: '',
|
||||
userType: ''
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.resetForm()
|
||||
},
|
||||
doSubmit() {
|
||||
this.loading = true
|
||||
if (this.isAdd) {
|
||||
this.doAdd()
|
||||
} else this.doEdit()
|
||||
},
|
||||
doAdd() {
|
||||
add(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '添加成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
doEdit() {
|
||||
edit(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
this.dialog = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = {
|
||||
uid: '',
|
||||
unionid: '',
|
||||
openid: '',
|
||||
routineOpenid: '',
|
||||
nickname: '',
|
||||
headimgurl: '',
|
||||
sex: '',
|
||||
city: '',
|
||||
language: '',
|
||||
province: '',
|
||||
country: '',
|
||||
remark: '',
|
||||
groupid: '',
|
||||
tagidList: '',
|
||||
subscribe: '',
|
||||
subscribeTime: '',
|
||||
addTime: '',
|
||||
stair: '',
|
||||
second: '',
|
||||
orderStair: '',
|
||||
orderSecond: '',
|
||||
nowMoney: '',
|
||||
sessionKey: '',
|
||||
userType: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 新增 -->
|
||||
<div style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button
|
||||
v-permission="['admin','YXWECHATUSER_ALL','YXWECHATUSER_CREATE']"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="add"
|
||||
>新增</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<eForm ref="form" :is-add="isAdd" />
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column prop="uid" label="微信用户id" />
|
||||
<el-table-column prop="unionid" label="只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段" />
|
||||
<el-table-column prop="openid" label="用户的标识,对当前公众号唯一" />
|
||||
<el-table-column prop="routineOpenid" label="小程序唯一身份ID" />
|
||||
<el-table-column prop="nickname" label="用户的昵称" />
|
||||
<el-table-column prop="headimgurl" label="用户头像" />
|
||||
<el-table-column prop="sex" label="用户的性别,值为1时是男性,值为2时是女性,值为0时是未知" />
|
||||
<el-table-column prop="city" label="用户所在城市" />
|
||||
<el-table-column prop="language" label="用户的语言,简体中文为zh_CN" />
|
||||
<el-table-column prop="province" label="用户所在省份" />
|
||||
<el-table-column prop="country" label="用户所在国家" />
|
||||
<el-table-column prop="remark" label="公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注" />
|
||||
<el-table-column prop="groupid" label="用户所在的分组ID(兼容旧的用户分组接口)" />
|
||||
<el-table-column prop="tagidList" label="用户被打上的标签ID列表" />
|
||||
<el-table-column prop="subscribe" label="用户是否订阅该公众号标识" />
|
||||
<el-table-column prop="subscribeTime" label="关注公众号时间" />
|
||||
<el-table-column prop="addTime" label="添加时间" />
|
||||
<el-table-column prop="stair" label="一级推荐人" />
|
||||
<el-table-column prop="second" label="二级推荐人" />
|
||||
<el-table-column prop="orderStair" label="一级推荐人订单" />
|
||||
<el-table-column prop="orderSecond" label="二级推荐人订单" />
|
||||
<el-table-column prop="nowMoney" label="佣金" />
|
||||
<el-table-column prop="sessionKey" label="小程序用户会话密匙" />
|
||||
<el-table-column prop="userType" label="用户类型" />
|
||||
<el-table-column v-if="checkPermission(['admin','YXWECHATUSER_ALL','YXWECHATUSER_EDIT','YXWECHATUSER_DELETE'])" label="操作" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['admin','YXWECHATUSER_ALL','YXWECHATUSER_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
|
||||
<el-popover
|
||||
:ref="scope.row.uid"
|
||||
v-permission="['admin','YXWECHATUSER_ALL','YXWECHATUSER_DELETE']"
|
||||
placement="top"
|
||||
width="180"
|
||||
>
|
||||
<p>确定删除本条数据吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="$refs[scope.row.uid].doClose()">取消</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.uid)">确定</el-button>
|
||||
</div>
|
||||
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:total="total"
|
||||
:current-page="page + 1"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del } from '@/api/bxg/yxWechatUser'
|
||||
import eForm from './form'
|
||||
export default {
|
||||
components: { eForm },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
beforeInit() {
|
||||
this.url = 'bxg/api/yxWechatUser'
|
||||
const sort = 'uid,desc'
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
return true
|
||||
},
|
||||
subDelete(uid) {
|
||||
this.delLoading = true
|
||||
del(uid).then(res => {
|
||||
this.delLoading = false
|
||||
this.$refs[uid].doClose()
|
||||
this.dleChangePage()
|
||||
this.init()
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
}).catch(err => {
|
||||
this.delLoading = false
|
||||
this.$refs[uid].doClose()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.isAdd = true
|
||||
this.$refs.form.dialog = true
|
||||
},
|
||||
edit(data) {
|
||||
this.isAdd = false
|
||||
const _this = this.$refs.form
|
||||
_this.form = {
|
||||
uid: data.uid,
|
||||
unionid: data.unionid,
|
||||
openid: data.openid,
|
||||
routineOpenid: data.routineOpenid,
|
||||
nickname: data.nickname,
|
||||
headimgurl: data.headimgurl,
|
||||
sex: data.sex,
|
||||
city: data.city,
|
||||
language: data.language,
|
||||
province: data.province,
|
||||
country: data.country,
|
||||
remark: data.remark,
|
||||
groupid: data.groupid,
|
||||
tagidList: data.tagidList,
|
||||
subscribe: data.subscribe,
|
||||
subscribeTime: data.subscribeTime,
|
||||
addTime: data.addTime,
|
||||
stair: data.stair,
|
||||
second: data.second,
|
||||
orderStair: data.orderStair,
|
||||
orderSecond: data.orderSecond,
|
||||
nowMoney: data.nowMoney,
|
||||
sessionKey: data.sessionKey,
|
||||
userType: data.userType
|
||||
}
|
||||
_this.dialog = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user