feat: 轮播图功能开发
parent
fd0627c470
commit
907b2b7582
|
@ -5,7 +5,7 @@ ENV = 'development'
|
|||
VUE_APP_TITLE = 创盈商户管理系统
|
||||
|
||||
# 芋道管理系统/开发环境
|
||||
VUE_APP_BASE_API = 'http://192.168.2.71:48080'
|
||||
VUE_APP_BASE_API = 'http://192.168.1.147:48080'
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
|
|
@ -38,8 +38,8 @@ export function getBanner(id) {
|
|||
export function getBannerPage(query) {
|
||||
return request({
|
||||
url: '/market/banner/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -63,3 +63,12 @@ export function exportTenantExcel(query) {
|
|||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 创建租户
|
||||
export function setCommission(data) {
|
||||
return request({
|
||||
url: '/system/tenant/update-commission',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,22 +1,10 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<doc-alert title="功能开启" url="https://doc.iocoder.cn/mall/build/" />
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="queryParams.title" placeholder="请输入标题" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)"
|
||||
:key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
|
@ -27,7 +15,7 @@
|
|||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['market:banner:create']">新增
|
||||
v-hasPermi="['system:banner:create']">新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
|
@ -43,13 +31,6 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="跳转链接" align="center" prop="url"/>
|
||||
<el-table-column label="排序" align="center" prop="sort"/>
|
||||
<el-table-column label="描述" align="center" prop="memo"/>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
|
@ -58,10 +39,10 @@
|
|||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['market:banner:update']">修改
|
||||
v-hasPermi="['system:banner:update']">修改
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['market:banner:delete']">删除
|
||||
v-hasPermi="['system:banner:delete']">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -77,24 +58,11 @@
|
|||
<el-input v-model="form.title" placeholder="请输入标题"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="缩略图" prop="picUrl">
|
||||
<imageUpload v-model="form.picUrl" :limit="1"/>
|
||||
<imageUpload v-model="form.picUrl" :limit="5"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="跳转链接" prop="url">
|
||||
<el-input v-model="form.url" placeholder="请输入跳转链接"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="form.sort" placeholder="请输入排序"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="memo">
|
||||
<el-input v-model="form.memo" type="textarea" placeholder="请输入描述"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)"
|
||||
:key="dict.value" :label="parseInt(dict.value)">{{ dict.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
@ -139,8 +107,8 @@ export default {
|
|||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
title: null,
|
||||
status: null,
|
||||
title: '',
|
||||
id: '',
|
||||
createTime: []
|
||||
},
|
||||
// 商品分类树选项
|
||||
|
@ -151,9 +119,7 @@ export default {
|
|||
rules: {
|
||||
title: [{required: true, message: "标题不能不空", trigger: "blur"}],
|
||||
picUrl: [{required: true, message: "图片地址不能为空", trigger: "blur"}],
|
||||
url: [{required: true, message: "跳转地址不能为空", trigger: "blur"}],
|
||||
sort: [{required: true, message: "排序不能为空", trigger: "blur"}],
|
||||
status: [{required: true, message: "状态不能为空", trigger: "change"}],
|
||||
url: [{required: true, message: "跳转地址不能为空", trigger: "blur"}]
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -165,6 +131,7 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
this.queryParams.id = this.$route.query.id
|
||||
getBannerPage(this.queryParams).then(response => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
|
@ -178,15 +145,7 @@ export default {
|
|||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
title: undefined,
|
||||
link: undefined,
|
||||
imgUrl: undefined,
|
||||
sort: undefined,
|
||||
memo: undefined,
|
||||
status: undefined,
|
||||
};
|
||||
this.form = {}
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
|
@ -231,6 +190,7 @@ export default {
|
|||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.form.tenantId = this.$route.query.id
|
||||
createBanner(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<template>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'bannerSetting'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
|
@ -0,0 +1,117 @@
|
|||
<template>
|
||||
<el-dialog title="提成设置" :visible.sync="show" width="500px" append-to-body @close="cancel">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="充值提成" prop="memberCommission">
|
||||
<el-input v-model="form.memberCommission" placeholder="请输入">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="商品提成" prop="goodsCommission">
|
||||
<el-input v-model="form.goodsCommission" placeholder="请输入">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" :loading="loading" :disable="loading">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import {setCommission} from '@/api/system/tenant';
|
||||
|
||||
export default {
|
||||
name: 'commissionSetting',
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const numberCheck = (rule, value, callback) => {
|
||||
if (value === '') {
|
||||
callback(new Error('请输入值'));
|
||||
return false
|
||||
}
|
||||
if (!/(^[0-9]\d*$)/.test(value)) {
|
||||
callback(new Error('值只能为正整数'));
|
||||
return false
|
||||
}
|
||||
if (value < 0 || value > 100) {
|
||||
callback(new Error('值范围在0~100之间'));
|
||||
return false
|
||||
}
|
||||
callback()
|
||||
}
|
||||
return {
|
||||
form: this.data,
|
||||
loading: false,
|
||||
rules: {
|
||||
goodsCommission: [{
|
||||
required: true,
|
||||
validator: numberCheck,
|
||||
trigger: 'blur'
|
||||
}],
|
||||
memberCommission: [{
|
||||
required: true,
|
||||
validator: numberCheck,
|
||||
trigger: 'blur'
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
show: function (newVal) {
|
||||
if (newVal) {
|
||||
this.form = this.data
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
const {
|
||||
id,
|
||||
goodsCommission,
|
||||
memberCommission
|
||||
} = this.form
|
||||
this.loading = true
|
||||
setCommission({
|
||||
id,
|
||||
goodsCommission: parseInt(goodsCommission),
|
||||
memberCommission: parseInt(memberCommission)
|
||||
}).then(response => {
|
||||
this.$emit('refersh')
|
||||
this.$modal.msgSuccess('设置成功');
|
||||
this.cancel()
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.form = {}
|
||||
this.$emit('update:show', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
|
@ -55,7 +55,7 @@
|
|||
<el-table-column label="编号" align="center" prop="id"/>
|
||||
<el-table-column label="店铺LOGO" align="center" prop="logo">
|
||||
<template v-slot="scope">
|
||||
<img :src="scope.row.logo" width="50" height="50" />
|
||||
<img :src="scope.row.logo" width="50" height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="店铺名称" align="center" prop="name"/>
|
||||
|
@ -79,6 +79,15 @@
|
|||
<el-button size="mini" type="text" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:tenant:delete']">禁用
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" @click="handleCommission(scope.row)"
|
||||
v-hasPermi="['system:tenant:delete']">提成设置
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" @click="handleNotice(scope.row)"
|
||||
v-hasPermi="['system:tenant:delete']">通知公告
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" @click="handleBanner(scope.row)"
|
||||
v-hasPermi="['system:tenant:delete']">轮播图
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -128,7 +137,8 @@
|
|||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="店铺LOGO图片" prop="logo">
|
||||
<el-input v-model="form.logo" placeholder="请输入"/>
|
||||
<ImageUpload v-model="form.logo" :limit="1" :isShowTip="false"
|
||||
class="upload-image"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
@ -164,6 +174,10 @@
|
|||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 提成设置 -->
|
||||
<CommissionSetting :show.sync="commissionSetting.show" :data="commissionSetting.data" @refersh="getList"/>
|
||||
<!-- 通知公告 -->
|
||||
<NoticeSetting :show.sync="noticeSetting.show" :data="noticeSetting.data" @refersh="getList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -178,10 +192,17 @@ import {
|
|||
} from '@/api/system/tenant';
|
||||
import {CommonStatusEnum} from '@/utils/constants'
|
||||
import {getTenantPackageList} from '@/api/system/tenantPackage';
|
||||
import ImageUpload from '@/components/ImageUpload/index.vue';
|
||||
import CommissionSetting from '@/views/system/tenant/commissionSetting.vue';
|
||||
import NoticeSetting from '@/views/system/tenant/noticeSetting.vue';
|
||||
|
||||
export default {
|
||||
name: 'SystemTenant',
|
||||
components: {},
|
||||
components: {
|
||||
NoticeSetting,
|
||||
CommissionSetting,
|
||||
ImageUpload
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
@ -200,6 +221,21 @@ export default {
|
|||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
commissionSetting: {
|
||||
show: false,
|
||||
data: {
|
||||
id: '',
|
||||
goodsCommission: '',
|
||||
memberCommission: ''
|
||||
}
|
||||
},
|
||||
noticeSetting: {
|
||||
show: false,
|
||||
data: {
|
||||
id: '',
|
||||
notice: ''
|
||||
}
|
||||
},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
|
@ -292,7 +328,23 @@ export default {
|
|||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
handleLook(row){
|
||||
handleCommission(row) {
|
||||
Object.assign(this.commissionSetting.data, row)
|
||||
this.commissionSetting.show = true
|
||||
},
|
||||
handleNotice(row) {
|
||||
Object.assign(this.noticeSetting.data, row)
|
||||
this.noticeSetting.show = true
|
||||
},
|
||||
handleBanner(row) {
|
||||
this.$router.push({
|
||||
path: '/system/tenant/banner',
|
||||
query: {
|
||||
id: row.id
|
||||
}
|
||||
})
|
||||
},
|
||||
handleLook(row) {
|
||||
this.form = row
|
||||
this.open = true
|
||||
this.isLook = true
|
||||
|
@ -370,3 +422,17 @@ export default {
|
|||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.upload-image {
|
||||
:deep(.el-upload--picture-card) {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
line-height: 90px;
|
||||
}
|
||||
|
||||
:deep(.el-upload-list__item) {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
<template>
|
||||
<el-dialog title="通知公告" :visible.sync="show" width="500px" append-to-body @close="cancel">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="通知公告" prop="notice">
|
||||
<el-input v-model="form.notice" type="textarea"
|
||||
:rows="2" placeholder="请输入">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" :loading="loading" :disable="loading">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import {updateTenant} from '@/api/system/tenant';
|
||||
|
||||
export default {
|
||||
name: 'noticeSetting',
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: this.data,
|
||||
loading: false,
|
||||
rules: {
|
||||
notice: [{
|
||||
required: true,
|
||||
message: '请输入通知公告',
|
||||
trigger: 'blur'
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
show: function (newVal) {
|
||||
if (newVal) {
|
||||
this.form = this.data
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
updateTenant(this.form).then(response => {
|
||||
this.$emit('refersh')
|
||||
this.$modal.msgSuccess('设置成功');
|
||||
this.cancel()
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.form = {}
|
||||
this.$emit('update:show', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue