master
parent
9505fd0431
commit
e08cc9bb4e
@ -0,0 +1,59 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function index(params,isLoading=true){
|
||||
return request({
|
||||
isLoading,
|
||||
method:'get',
|
||||
url:'/api/admin/common-service/index',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function show(params){
|
||||
return request({
|
||||
method:'get',
|
||||
url:'/api/admin/common-service/show',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function store(data){
|
||||
return request({
|
||||
method:'post',
|
||||
url:'/api/admin/common-service/store',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function save(data){
|
||||
return request({
|
||||
method:'post',
|
||||
url:'/api/admin/common-service/save',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function destroy(data){
|
||||
return request({
|
||||
method:'post',
|
||||
url:'/api/admin/common-service/destroy',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function getMerchantItems(params){
|
||||
return request({
|
||||
method:'get',
|
||||
url:'/api/admin/common-service/get-merchant-items',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getPicture(params){
|
||||
return request({
|
||||
method:'get',
|
||||
url:'/api/admin/common-service/get-picture',
|
||||
params
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function index(params){
|
||||
return request({
|
||||
method:'get',
|
||||
url:'/api/admin/common-product/index',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function show(params){
|
||||
return request({
|
||||
method:'get',
|
||||
url:'/api/admin/common-product/show',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function store(data){
|
||||
return request({
|
||||
method:'post',
|
||||
url:'/api/admin/common-product/store',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function save(data){
|
||||
return request({
|
||||
method:'post',
|
||||
url:'/api/admin/common-product/save',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function destroy(data){
|
||||
return request({
|
||||
method:'post',
|
||||
url:'/api/admin/common-product/destroy',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getPicture(params){
|
||||
return request({
|
||||
method:'get',
|
||||
url:'/api/admin/common-product/get-picture',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getCombo(params){
|
||||
return request({
|
||||
method:'get',
|
||||
url:'/api/admin/common-product/get-combo',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<div style="padding: 0 20px">
|
||||
<div ref="lxHeader">
|
||||
<lx-header icon="md-apps" :text="pageTitle" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content"></div>
|
||||
<slot>
|
||||
<div style="display: flex">
|
||||
<Input clearable v-model="select.keywords" style="width: 200px; margin-right: 10px" placeholder="关键字搜索" />
|
||||
|
||||
|
||||
<Button type="primary" @click="getClubs">查询</Button>
|
||||
<Button type="primary" style="margin-left: 10px" @click="$refs['addCommonService'].type = 'add',$refs['addCommonService'].isShow = true">新增</Button>
|
||||
</div>
|
||||
</slot>
|
||||
</lx-header>
|
||||
</div>
|
||||
|
||||
<xy-table
|
||||
:total="total"
|
||||
:list="list"
|
||||
:table-item="table"
|
||||
@pageSizeChange="e => select.pageSize = e"
|
||||
@pageIndexChange="pageChange">
|
||||
<template v-slot:btns>
|
||||
<el-table-column fixed="right" label="操作" :width="130" align="left" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<Button size="small" type="primary" @click="editorClub(scope.row)" style="margin: 0 6px 4px 0">编辑</Button>
|
||||
<Poptip confirm transfer title="确认要删除吗" @on-ok="clubDelete(scope.row)">
|
||||
<Button ghost size="small" type="primary" style="margin: 0 6px 4px 0">删除</Button>
|
||||
</Poptip>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</xy-table>
|
||||
|
||||
<addCommonService ref="addCommonService" @refresh="getClubs"></addCommonService>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {index,destroy} from '@/api/productService/commonService'
|
||||
import {parseTime} from '@/utils'
|
||||
import { Message } from 'element-ui'
|
||||
|
||||
import addCommonService from '@/views/productService/components/common/addCommonService'
|
||||
export default {
|
||||
components:{
|
||||
addCommonService
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageTitle:"",
|
||||
select:{
|
||||
page:1,
|
||||
page_size:10,
|
||||
keywords:'',
|
||||
type:'maternity'
|
||||
},
|
||||
total:0,
|
||||
list:[],
|
||||
table:[
|
||||
{
|
||||
prop:'name',
|
||||
label:'名称',
|
||||
minWidth:220,
|
||||
align:'left'
|
||||
},
|
||||
{
|
||||
prop:'reach',
|
||||
label:'是否到店',
|
||||
width: 120,
|
||||
customFn:(row)=>{
|
||||
return (
|
||||
<div style={{'color': row.reach === 1 ? 'green' : 'red'}}>{row.reach === 1 ? '已到店' : '未到店'}</div>
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
label:'特色标签',
|
||||
width: 260,
|
||||
align:'left',
|
||||
prop:'featured_label',
|
||||
customFn:(row) => {
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
row.featured_label ?
|
||||
row.featured_label?.split(',').map(item => {
|
||||
return <el-tag type="border" style={{'margin':'0 6px 4px 0'}}>{item}</el-tag>
|
||||
}) : <div style={{'text-align':'center'}}>无</div>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
label:'排序',
|
||||
width: 90,
|
||||
prop:'sort_number'
|
||||
},
|
||||
{
|
||||
label:'提交人',
|
||||
prop:'admin.name',
|
||||
width:180
|
||||
},
|
||||
{
|
||||
label:'提交日期',
|
||||
prop:'created_at',
|
||||
width: 140,
|
||||
formatter:(cell,data,value)=>{
|
||||
return parseTime(new Date(value),'{y}-{m}-{d}')
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getClubs(){
|
||||
const res = await index(this.select)
|
||||
console.log(res)
|
||||
this.list = res.data
|
||||
this.total = res.total
|
||||
},
|
||||
pageChange(e){
|
||||
this.select.page = e
|
||||
this.getClubs()
|
||||
},
|
||||
|
||||
clubDelete(row){
|
||||
destroy({
|
||||
id:row.id
|
||||
}).then(res => {
|
||||
Message({
|
||||
type:'success',
|
||||
message:'删除成功'
|
||||
})
|
||||
this.getClubs()
|
||||
})
|
||||
},
|
||||
editorClub(row){
|
||||
this.$refs['addCommonService'].type = 'editor'
|
||||
this.$refs['addCommonService'].id = row.id
|
||||
this.$refs['addCommonService'].isShow = true
|
||||
this.$refs['addCommonService'].form.type= this.select.type
|
||||
|
||||
|
||||
},
|
||||
showInfo(row){
|
||||
this.$refs['addClubInfo'].id = row.id
|
||||
this.$refs['addClubInfo'].isShow = true
|
||||
},
|
||||
showPic(row){
|
||||
this.$refs['addClubPic'].id = row.id
|
||||
this.$refs['addClubPic'].isShow = true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getClubs();
|
||||
|
||||
this.pageTitle=this.$route.meta.title;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
@ -0,0 +1,8 @@
|
||||
<template>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@ -0,0 +1,8 @@
|
||||
<template>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0">
|
||||
<title>温馨提示</title>
|
||||
</head>
|
||||
<body>
|
||||
<div style="text-align: center;margin-top: 100px;font-size:18px ;line-height: 40px;">
|
||||
您的手机暂时不支持小程序的显示
|
||||
<br/>请更换设备重新尝试
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in new issue