秒杀,全折扣秒杀

This commit is contained in:
faiz 2024-11-20 09:19:12 +08:00
parent 56dbecb21f
commit fa55cb9f8d
7 changed files with 4472 additions and 866 deletions

View File

@ -163,6 +163,37 @@ const marketingRouter =
}
]
},
{
path: 'allDiscount',
name: 'allDiscount',
meta: {
title: '全折扣秒杀管理',
noCache: true
},
redirect: 'noRedirect',
component: () => import('@/views/marketing/allDiscount/index'),
children: [
{
path: 'list',
name: 'SpikeGoods',
meta: {
title: '全折扣秒杀商品',
noCache: true
},
component: () => import('@/views/marketing/allDiscount/seckillGoods/index')
},
{
path: 'createGoods/:id?/:edit?',
name: 'CreateSpikeGoods',
meta: {
title: '添加秒杀商品',
noCache: true,
activeMenu: `${roterPre}/marketing/allDiscount/list`
},
component: () => import('@/views/marketing/allDiscount/seckillGoods/createGoods')
}
]
},
{
path: 'presell',
name: 'preSell',

View File

@ -0,0 +1,3 @@
<template>
<router-view />
</template>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,191 @@
<template>
<el-dialog v-if="dialogVisible" title="商品信息" :visible.sync="dialogVisible" width="900px">
<div class="divBox">
<div class="container">
<el-form size="small" inline label-width="85px">
<el-form-item label="商品分类:">
<el-select
v-model="tableFrom.mer_cate_id"
placeholder="请选择"
class="dialogWidth"
clearable
@change="getList()"
>
<el-option
v-for="item in merCateList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="商品搜索:">
<el-input
v-model="tableFrom.keyword"
placeholder="请输入商品名称,关键字,产品编号"
class="dialogWidth"
clearable
@keyup.enter.native="getList"
>
</el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getList">查询</el-button>
</el-form-item>
</el-form>
</div>
<div v-if="resellShow" class="mb10">
<el-alert
title="注:添加为预售商品后,原普通商品会下架;如该商品已开启其它营销活动,请勿选择!"
type="warning"
v-if="resellShow"
show-icon>
</el-alert>
</div>
<el-table v-loading="listLoading" :data="tableData.data" size="small">
<el-table-column width="55">
<template slot-scope="scope">
<el-radio
v-model="templateRadio"
:label="scope.row.product_id"
@change.native="getTemplateRow(scope.row)"
>&nbsp</el-radio>
</template>
</el-table-column>
<el-table-column prop="product_id" label="ID" min-width="50" />
<el-table-column label="商品图" min-width="70">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image
style="width: 36px; height: 36px"
:src="scope.row.image"
:preview-src-list="[scope.row.image]"
/>
</div>
</template>
</el-table-column>
<el-table-column prop="store_name" label="商品名称" min-width="230" />
<el-table-column prop="stock" label="库存" min-width="70" />
</el-table>
<div class="block">
<el-pagination
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</div>
</el-dialog>
</template>
<script>
import { goodLstApi, categorySelectApi } from '@/api/product'
import { roterPre } from '@/settings'
export default {
name: 'GoodsList',
props:{
resellShow:{
type:Boolean,
default:false
},
isSeckill: {
type:Boolean,
default:false
}
},
data() {
return {
dialogVisible: false,
templateRadio: 0,
merCateList: [],
roterPre: roterPre,
listLoading: true,
tableData: {
data: [],
total: 0
},
tableFrom: {
page: 1,
limit: 6,
cate_id: '',
store_name: '',
keyword: '',
is_gift_bag: 0,
status: 1,
is_ficti: this.isSeckill ? '' : 0,
is_action: this.isSeckill ? '' : 1
},
multipleSelection: {},
checked: []
}
},
mounted() {
this.getList()
this.getCategorySelect()
window.addEventListener('unload', (e) => this.unloadHandler(e))
},
methods: {
getTemplateRow(row) {
this.multipleSelection = { src: row.image, id: row.product_id }
this.dialogVisible = false
this.$emit('getProduct', this.multipleSelection)
},
//
getCategorySelect() {
categorySelectApi()
.then((res) => {
this.merCateList = res.data
})
.catch((res) => {
this.$message.error(res.message)
})
},
//
getList() {
this.listLoading = true
goodLstApi(this.tableFrom)
.then((res) => {
this.tableData.data = res.data.list
this.tableData.total = res.data.count
// this.checked =
// window.form_create_helper.get(this.$route.query.field) || [];
// this.tableData.data.forEach((item) => {
// this.checked.forEach((element) => {
// if (Number(item.product_id) === Number(element.id)) {
// this.$nextTick(() => {
// this.$refs.multipleTable.toggleRowSelection(item, true);
// });
// }
// });
// });
this.listLoading = false
})
.catch((res) => {
this.listLoading = false
this.$message.error(res.message)
})
},
pageChange(page) {
this.tableFrom.page = page
this.getList()
},
handleSizeChange(val) {
this.tableFrom.limit = val
this.getList()
}
}
}
</script>
<style scoped lang="scss">
.seachTiele {
line-height: 35px;
}
.fr {
float: right;
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff