bibi 3 years ago
parent 553e108b46
commit c5a24b17bc

@ -8,3 +8,35 @@ export function topicList(params) {
params: params,
})
}
// 话题新增
export function topicInsert(params) {
return httpService({
url: `/user/topic/insert`,
method: 'post',
data: params,
})
}
// 话题信息
export function topicInfo(params) {
return httpService({
url: `/user/topic/findById`,
method: 'get',
params: params,
})
}
// 话题修改
export function topicUpdate(params) {
return httpService({
url: `/user/topic/update`,
method: 'post',
data: params,
})
}
// 话题删除
export function topicDelete(params) {
return httpService({
url: `/user/topic/delete`,
method: 'post',
data: params,
})
}

@ -0,0 +1,35 @@
import httpService from "@/request"
// 轮播图列表
export function swiperList(params) {
return httpService({
url: `/user/homepageCarousel/list`,
method: 'get',
params: params,
})
}
// 删除
export function swiperDel(params) {
return httpService({
url: `/user/homepageCarousel/delete`,
method: 'get',
params: params,
})
}
// 新增
export function swiperInsert(params) {
return httpService({
url: `/user/homepageCarousel/insert`,
method: 'get',
params: params,
})
}
// 修改
export function swiperUpdate(params) {
return httpService({
url: `/user/homepageCarousel/update`,
method: 'get',
params: params,
})
}

@ -2,9 +2,9 @@ import httpService from "@/request"
// 商品
// list
export function goodsList(params) {
export function shopPushList(params) {
return httpService({
url: `/user/shop/jcookGoodsList`,
url: `/user/shop/shopPushList`,
method: 'get',
params: params,
})

@ -46,7 +46,7 @@ export default {
this.form = obj;
},
immediate: true
}
},
},
data() {
return {
@ -56,6 +56,7 @@ export default {
},
methods: {
getSearch() {
console.log(this.form);
this.$emit('getSearch', this.form)
},
resetForm() {

@ -9,7 +9,7 @@
@preview="handlePreview"
@change="handleChange"
>
<div v-if="fileList.length < 1">
<div v-if="fileList.length < limit">
<a-icon type="plus" />
<div class="ant-upload-text">上传图片</div>
</div>
@ -33,13 +33,19 @@ export default {
components:{
imgModal
},
props:{
fileList:Array,
limit:{
type:Number,
default:1
}
},
data() {
return{
previewVisible: false,
previewImage: '',
fileList: [],
uploadHeaders: {
"admin-login-token": store.getters.getToken
"manage-login-token": store.getters.getToken
}
}
},
@ -55,10 +61,8 @@ export default {
this.previewVisible = false;
},
handleChange({ fileList }) {
this.fileList = fileList
if(fileList[0].status==='done'){
console.log(fileList);
this.$emit('handleChange',fileList)
}
},
}
};

@ -1,14 +1,14 @@
export default [
{
path: '/Console',
name: "Console",
title: "控制台",
hide: false,
icon: 'container',
component: resolve => require(['@/views/Basic/Console'], resolve),
meta: {title: '控制台'}
},
// {
// path: '/Console',
// name: "Console",
// title: "控制台",
// hide: false,
// icon: 'container',
// component: resolve => require(['@/views/Basic/Console'], resolve),
// meta: {title: '控制台'}
// },
{
path: '/Employee',
name: "Employee",

@ -35,7 +35,7 @@ const router = [
name: "basic",
title: "基础",
component: Layout,
redirect: '/Console',
redirect: '/Employee',
meta: {title: '首页'},
children: [
...basic,
@ -68,7 +68,7 @@ const router = [
name: "operation",
title: "运营管理",
component: Layout,
redirect: '/taskManage',
redirect: '/clientSet',
meta: {title: '运营管理'},
children: [
...operation,

@ -7,6 +7,15 @@
* @FilePath: /LittleBeeSaas/src/router/operation.js
*/
export default [
{
path: '/clientSet',
name: "clientSet",
title: "用户端设置",
icon: 'setting',
hide: false,
component: resolve => require(['@/views/Operation/clientSet'], resolve),
meta: {title: '用户端设置'},
},
{
path: '/TaskManage',
name: "TaskManage",

@ -7,16 +7,12 @@
<a-row>
<a-col class="text-content">{{ detailData.content }}</a-col>
<a-col class="img-box">
<!-- <img
<img
:src="$ImgUrl(img.url)"
class="contentImg"
v-for="(img, index) in detailData.imgList"
:key="index"
/> -->
<img src="https://img0.baidu.com/it/u=2560936835,1792581374&fm=253&fmt=auto&app=138&f=JPEG?w=658&h=403" class="contentImg" alt="">
<img src="https://img0.baidu.com/it/u=2560936835,1792581374&fm=253&fmt=auto&app=138&f=JPEG?w=658&h=403" class="contentImg" alt="">
<img src="https://img0.baidu.com/it/u=2560936835,1792581374&fm=253&fmt=auto&app=138&f=JPEG?w=658&h=403" class="contentImg" alt="">
<img src="https://img0.baidu.com/it/u=2560936835,1792581374&fm=253&fmt=auto&app=138&f=JPEG?w=658&h=403" class="contentImg" alt="">
/>
</a-col>
<a-col :span="4">
<span class="title">发布者</span>

@ -38,6 +38,12 @@ export const columns = [
dataIndex: "content",
width: "16%",
},
{
title: "图片",
dataIndex: "imgpic",
width: "16%",
scopedSlots: { customRender: "imgpic"}
},
{
title: "状态",
dataIndex: "status",

@ -0,0 +1,26 @@
export const form = {
id:null,
title:undefined,
content:undefined,
status:undefined,
isPublic:undefined,
isRating:undefined,
imgUrls:[]
}
export const rules = {
title:[{required:true,message:'请输入标题',trigger:'blur'}],
content:[{required:true,message:'请输入内容',trigger:'blur'}],
status:[{required:true,message:'请选择',trigger:'change'}],
isPublic:[{required:true,message:'请选择',trigger:'change'}],
isRating:[{required:true,message:'请选择',trigger:'change'}],
}
export const options = {
isTrue:[
{ id:1, name:'是' },
{ id:0, name:'否' },
],
status: [
{ id:1, name:'启用中' },
{ id:2, name:'禁用中' },
]
}

@ -0,0 +1,188 @@
<template>
<div>
<a-drawer
:title="title"
:width="720"
:visible="show"
:body-style="{ paddingBottom: '80px' }"
@close="addClose"
>
<div class="drawer-content">
基本信息
<a-divider></a-divider>
<a-form-model
ref="ruleForm"
:model="form"
:rules="rules"
layout="vertical"
>
<a-form-model-item prop="title" label="标题">
<a-input
v-model="form.title"
placeholder="请输入标题"
style="width: 60%"
></a-input>
</a-form-model-item>
<a-form-model-item prop="content" label="内容">
<a-input
v-model="form.content"
placeholder="请输入标题"
style="width: 60%"
></a-input>
</a-form-model-item>
<a-form-model-item prop="status" label="状态">
<a-select
v-model="form.status"
placeholder="请选择"
style="width: 60%"
>
<a-select-option
v-for="item in options.status"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
<a-form-model-item prop="isPublic" label="是否公开">
<a-select
v-model="form.isPublic"
placeholder="请选择"
style="width: 60%"
>
<a-select-option
v-for="item in options.isTrue"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
<a-form-model-item prop="isRating" label="是否可以评论">
<a-select
v-model="form.isRating"
placeholder="请选择"
style="width: 60%"
>
<a-select-option
v-for="item in options.isTrue"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
话题图片
<commonUpload :fileList='fileList' @handleChange="handleChange" />
</a-form-model>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="addClose">
关闭
</a-button>
<a-button type="primary" @click="submit"> </a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import { form, rules, options } from "./form.js";
import { topicInsert,topicUpdate, topicInfo } from '@/api/operation/dynamic/topic'
export default {
props: {
show: {
type: Boolean,
default: false,
},
editId:Number
},
data() {
return {
title: "新增话题",
form,
rules,
options,
fileList:[]
};
},
methods: {
addClose() {
this.$refs.ruleForm.resetFields();
this.fileList = []
this.$emit('addClose');
},
success() {
this.$emit('success');
this.addClose()
},
submit() {
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
if(this.editId === null) {
let res = await topicInsert(this.form)
if(res.code===200){
this.$message.success(res.msg)
this.success()
}else{
this.$message.error(res.msg)
}
}else{
let res = await topicUpdate(this.form)
if(res.code===200){
this.$message.success(res.msg)
this.success()
}else{
this.$message.error(res.msg)
}
}
}
});
},
handleChange(data) {
this.fileList = data
if(data[0].status==='done'){
this.form.imgUrls.push(data[0].response.data)
}
},
},
watch: {
editId:{
handler(val){
if(val!==null){
this.title = '修改话题'
this.form.id = val
topicInfo({topicId:val}).then(res=>{
let data = res.data
this.form.title = data.title
this.form.content = data.content
this.form.status = data.status
this.form.isPublic = data.isPublic
this.form.isRating = data.isRating
if(data.imgList.length>0){
console.log(data.imgList);
const pic = []
for(let item of data.imgList){
let obj = {
name:item.url.split('_')[0] +'.'+ item.url.split('.')[1],
url: this.$ImgUrl(item.url),
uid:item.url.split('_')[1],
status:'done',
thumbUrl: this.$ImgUrl(item.url),
}
pic.push(obj)
}
this.fileList = pic
}
})
}else{
this.title = '新增话题'
}
},
immediate: true
}
}
};
</script>
<style></style>

@ -1,7 +1,8 @@
<template>
<div>
<div class="cardTitle">社区话题</div>
<searchForm :formItem="formItem" @getSearch="getData"></searchForm>
<searchForm :formItem="formItem" @getSearch="getData($event)"></searchForm>
<a-button style='margin:10px' class='add-btn' @click='drawer.show=true'>新增话题</a-button>
<a-table
:columns="columns"
:data-source="tableData"
@ -20,9 +21,14 @@
>
<span slot="action" slot-scope="text, row">
<a-space>
<a class="ant-dropdown-link" @click="edit(row.id)"></a>
<a class="ant-dropdown-link" @click="del([row.id])"></a>
</a-space>
</span>
<span slot="imgpic" slot-scope="text, row">
<img v-if="row.imgList.length>0" :src="$ImgUrl(row.imgList[0].url)" class="table-img" alt="">
<span v-else></span>
</span>
<span slot="switch" slot-scope="switchV, row">
<a-switch
:checked="switchV === 1"
@ -33,8 +39,7 @@
<div class="action">
<a-dropdown :disabled='!hasSelected'>
<a-menu slot="overlay" @click="handleMenuClick">
<a-menu-item key="1"> 批量删除 </a-menu-item>
<a-menu-item key="2"> 2nd item </a-menu-item>
<a-menu-item key="del"> 批量删除 </a-menu-item>
</a-menu>
<a-button> 批量操作 <a-icon type="down" /> </a-button>
</a-dropdown>
@ -44,17 +49,31 @@
</template>
</span>
</div>
<addForm :show='drawer.show' @success='success' @addClose='addClose' :editId="editId"></addForm>
</div>
</template>
<script>
import { topicList } from "@/api/operation/dynamic/topic.js";
import { topicList, topicDelete} from "@/api/operation/dynamic/topic.js";
import { formItem, columns, pagination } from "./depend/config";
import addForm from "./depend/form";
export default {
components: {
addForm
},
data() {
return {
drawer:{
show:false
},
editId:null,
tableData: [],
searchForm: {},
searchForm: {
title:'',
status:undefined,
isPublic:undefined,
isRating:undefined,
},
formItem,
columns,
pagination,
@ -67,20 +86,52 @@ export default {
},
methods: {
async getData(data) {
if(data!==undefined){
console.log(data);
this.searchForm = data;
console.log(this.searchForm);
}
let res = await topicList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
title:this.searchForm.title,
status:this.searchForm.status,
isPublic:this.searchForm.isPublic,
isRating:this.searchForm.isRating,
});
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
},
edit(id){
this.editId = id;
this.drawer.show = true;
},
del(ids) {
console.log(ids);
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "delete",
onOk: async () => {
let res = await topicDelete({ topicIds: ids });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
},
});
},
selectionChoosed(data) {
console.log(data);
this.selectedRowKeys = data;
},
handleMenuClick(data) {
console.log(data);
if(data.key === 'del'){
this.del(this.selectedRowKeys)
}
},
handleTableChange(pagination) {
console.log(pagination);
@ -90,6 +141,13 @@ export default {
this.pagination = pager;
this.getData();
},
addClose() {
this.drawer.show = false;
this.editId = null
},
success(){
this.getData();
}
},
computed: {
hasSelected() {
@ -99,4 +157,8 @@ export default {
};
</script>
<style lang="less" scoped>
.table-img{
width: 40px;
height: 40px;
}
</style>

@ -0,0 +1,53 @@
<template>
<div>
<a-table
:columns="columns"
:data-source="tableData"
:pagination="pagination"
:scroll="{ x: 1400 }"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed,
}"
:row-key="
(record, index) => {
return record.id;
}
"
>
</a-table>
</div>
</template>
<script>
import { columns } from "./tableConfig.js";
import { shopPushList } from "@/api/shop/goods";
export default {
props:{
type
},
data() {
return{
columns,
tableData:[]
}
},
watch:{
type:{
handler(val){
if(val===2){
shopPushList().then(res=>{
this.tableData = res.data
})
}
},
immediate: true
}
}
}
</script>
<style>
</style>

@ -0,0 +1,78 @@
export const columns = {
shop:[
{
title: "商品名称",
width: "12%",
dataIndex: "skuName",
},
{
title: "sku编码",
width: "12%",
dataIndex: "skuId",
},
{
title: "商品类型",
width: "7%",
dataIndex: "mallType",
customRender: function (mallType) {
switch (mallType) {
case 1:
return 'Jcook'
break;
default:
break;
}
}
},
{
title: "店铺名",
width: "8%",
dataIndex: "shopName",
},
{
title: "品牌名",
width: "8%",
dataIndex: "brandName",
},
{
title: "供应商名",
width: "8%",
dataIndex: "vendorName",
},
{
title: "一级分类名称",
width: "8%",
dataIndex: "categoryFirstName",
},
{
title: "二级分类名称",
width: "8%",
dataIndex: "categorySecondName",
},
{
title: "三级分类名称",
width: "8%",
dataIndex: "categoryThirdName",
},
{
title: "主图url",
width: "8%",
dataIndex: "mainPhoto",
},
{
title: "售卖价",
width: "8%",
dataIndex: "sellPrice",
},
{
title: "折扣价",
width: "8%",
dataIndex: "discountPrice",
},
{
title: "浏览量",
width: "8%",
dataIndex: "viewsNum",
},
]
}

@ -0,0 +1,140 @@
<template>
<div>
<div class="cardTitle">首页轮播图设置</div>
<a-divider></a-divider>
<a-button class="add-btn" style="margin: 10px" @click="addCard = true"
>添加轮播图</a-button
>
<!-- 新增 -->
<a-card style="width: 70%; margin-top: 10px" @close="del" v-if="addCard">
<span class="card-close" @click="addCard = false">×</span>
<a-row>
<a-col :span="9">
<div style="color: #00000073; padding-bottom: 10px">
上传图片尺寸: 750*300
</div>
<commonUpload
:fileList="fileList"
@handleChange="handleChange"
></commonUpload>
</a-col>
<a-col :span="11">
<a-descriptions layout="vertical" :column="1">
<a-descriptions-item label="链接设置">
<a-input-group compact>
<a-select
style="width: 120px"
v-model="form.type"
placeholder="请选择类型"
>
<a-select-option :value="1"> 自定义链接 </a-select-option>
<a-select-option :value="2"> 商城 </a-select-option>
<a-select-option :value="3"> 资讯 </a-select-option>
<a-select-option :value="4"> 公告 </a-select-option>
<a-select-option :value="5"> 活动 </a-select-option>
</a-select>
<a-input
v-if="form.type === 1"
style="width: 200px; background: #0000000f"
placeholder="请输入链接"
></a-input>
<a-button
v-else-if="form.type !== 1 && form.customizeUrl === ''"
style="width: 100px; background: #0000000f"
@click='checkList(form.type)'
>请选择链接
</a-button>
<a-input
v-else
v-model="form.customizeUrl"
style="width: 300px; background: #0000000f"
disabled
></a-input>
</a-input-group>
</a-descriptions-item>
<a-descriptions-item label="是否显示在用户端">
<a-switch v-model="form.isShow"></a-switch>
</a-descriptions-item>
<a-descriptions-item label="显示权重">
<a-input
type="number"
v-model.number="form.showWeights"
></a-input>
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :span="4">
<a-button class="add-btn">保存设置</a-button>
</a-col>
</a-row>
</a-card>
</div>
</template>
<script>
import { swiperList } from "@/api/operation/swiper";
export default {
data() {
return {
fileList: [],
cardList: [],
addCard: true,
form: {
id: undefined,
type: undefined,
showWeights: 0,
customizeUrl: "",
isShow: false,
associationId: undefined,
imgUrls: [],
},
};
},
mounted() {
// this.getData()
},
methods: {
async getData() {
let res = await swiperList();
this.cardList = res.data;
},
checkList(type){
if(type===2){
}else if(type===3){
}else if(type===4){
}else if(type===5){
}
},
del(id) {},
handleChange(data) {
this.fileList = data;
if (data[0].status === "done") {
// this.form.imgUrls.push(data[0].response.data);
}
},
},
};
</script>
<style lang="less" scoped>
/deep/.ant-upload.ant-upload-select-picture-card {
width: 90%;
height: 200px;
}
/deep/.ant-upload-list-picture-card .ant-upload-list-item {
width: 90%;
height: 200px;
}
.card-close {
position: absolute;
right: 10px;
top: -3px;
cursor: pointer;
font-size: 20px;
}
</style>

@ -0,0 +1,14 @@
<template>
<div></div>
</template>
<script>
export default {
data() {
return {};
},
methods: {},
};
</script>
<style lang="less" scoped></style>

@ -0,0 +1,14 @@
<template>
<div></div>
</template>
<script>
export default {
data() {
return {};
},
methods: {},
};
</script>
<style lang="less" scoped></style>

@ -0,0 +1,76 @@
export const columns = [
{
title: "商品名称",
width: "12%",
dataIndex: "skuName",
},
{
title: "sku编码",
width: "12%",
dataIndex: "skuId",
},
{
title: "商品类型",
width: "7%",
dataIndex: "mallType",
customRender: function (mallType) {
switch (mallType) {
case 1:
return 'Jcook'
break;
default:
break;
}
}
},
{
title: "店铺名",
width: "8%",
dataIndex: "shopName",
},
{
title: "品牌名",
width: "8%",
dataIndex: "brandName",
},
{
title: "供应商名",
width: "8%",
dataIndex: "vendorName",
},
{
title: "一级分类名称",
width: "8%",
dataIndex: "categoryFirstName",
},
{
title: "二级分类名称",
width: "8%",
dataIndex: "categorySecondName",
},
{
title: "三级分类名称",
width: "8%",
dataIndex: "categoryThirdName",
},
{
title: "主图url",
width: "8%",
dataIndex: "mainPhoto",
},
{
title: "售卖价",
width: "8%",
dataIndex: "sellPrice",
},
{
title: "折扣价",
width: "8%",
dataIndex: "discountPrice",
},
{
title: "浏览量",
width: "8%",
dataIndex: "viewsNum",
},
]

@ -0,0 +1,14 @@
<template>
<div></div>
</template>
<script>
export default {
data() {
return {};
},
methods: {},
};
</script>
<style lang="less" scoped></style>
Loading…
Cancel
Save