Browse Source

调整拼团秒杀后台页面

master
xuwenbo 4 years ago
parent
commit
117a3dca56
  1. 81
      src/views/activity/bargain/form.vue
  2. 9
      src/views/activity/bargain/index.vue
  3. 22
      src/views/activity/combination/form.vue
  4. 171
      src/views/activity/seckill/form.vue

81
src/views/activity/bargain/form.vue

@ -1,6 +1,11 @@
<template> <template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '开启砍价'" width="900px"> <el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '开启砍价'" width="900px">
<el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px"> <el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px">
<el-col :span="24">
<el-form-item label="选择商品:" prop="good">
<cgood v-model="form1.good":disabled="true" ></cgood>
</el-form-item>
</el-col>
<el-form-item label="砍价名称"> <el-form-item label="砍价名称">
<el-input v-model="form.title" style="width: 500px;" /> <el-input v-model="form.title" style="width: 500px;" />
</el-form-item> </el-form-item>
@ -10,7 +15,6 @@
<el-form-item label="单位"> <el-form-item label="单位">
<el-input v-model="form.unitName" style="width: 500px;" /> <el-input v-model="form.unitName" style="width: 500px;" />
</el-form-item> </el-form-item>
<el-form-item label="活动开始时间"> <el-form-item label="活动开始时间">
<template> <template>
<el-date-picker <el-date-picker
@ -30,7 +34,7 @@
</template> </template>
</el-form-item> </el-form-item>
<el-form-item label="砍价产品主图片"> <el-form-item label="砍价产品主图片">
<MaterialList v-model="form.imageArr" style="width: 500px" type="image" :num="1" :width="150" :height="150" /> <single-pic v-model="form.imageArr" style="width: 500px" type="image" :num="1" :width="150" :height="150" />
</el-form-item> </el-form-item>
<el-form-item label="砍价产品轮播图"> <el-form-item label="砍价产品轮播图">
<MaterialList v-model="form.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" /> <MaterialList v-model="form.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
@ -69,13 +73,16 @@
<el-form-item label="排序"> <el-form-item label="排序">
<el-input-number v-model="form.sort" /> <el-input-number v-model="form.sort" />
</el-form-item> </el-form-item>
<el-form-item label="是否包邮"> <el-col :span="24">
<el-radio v-model="form.isPostage" :label="1"></el-radio> <el-form-item label="运费模板:" prop="temp_id">
<el-radio v-model="form.isPostage" :label="0" style="width: 110px;"></el-radio> <div class="acea-row">
</el-form-item> <el-select v-model="form.temp_id" class="mr20" :disabled="true">
<el-form-item v-if="form.isPostage ===0" label="邮费"> <el-option v-for="(item,index) in templateList" :value="item.id" :key="index" :label="item.name">
<el-input-number v-model="form.postage" /> </el-option>
</el-form-item> </el-select>
</div>
</el-form-item>
</el-col>
<el-form-item label="砍价规则"> <el-form-item label="砍价规则">
<editor v-model="form.rule" /> <editor v-model="form.rule" />
</el-form-item> </el-form-item>
@ -91,11 +98,14 @@
</template> </template>
<script> <script>
import cgood from '@/views/components/good'
import { add, edit } from '@/api/yxStoreBargain' import { add, edit } from '@/api/yxStoreBargain'
import editor from '../../components/Editor' import editor from '../../components/Editor'
import MaterialList from '@/components/material' import MaterialList from '@/components/material'
import singlePic from '@/components/singlematerial'
import { getInfo } from '@/api/yxStoreProduct'
export default { export default {
components: { editor, MaterialList }, components: { editor, MaterialList,cgood,singlePic },
props: { props: {
isAdd: { isAdd: {
type: Boolean, type: Boolean,
@ -105,6 +115,11 @@ export default {
data() { data() {
return { return {
loading: false, dialog: false, loading: false, dialog: false,
templateList: [],
form1: {
good:{
}
},
form: { form: {
id: '', id: '',
productId: '', productId: '',
@ -125,7 +140,7 @@ export default {
bargainMaxPrice: '', bargainMaxPrice: '',
bargainMinPrice: '', bargainMinPrice: '',
bargainNum: '', bargainNum: '',
status: '', status: 1,
description: '', description: '',
giveIntegral: '', giveIntegral: '',
info: '', info: '',
@ -140,7 +155,8 @@ export default {
look: '', look: '',
share: '', share: '',
startTimeDate: '', startTimeDate: '',
endTimeDate: '' endTimeDate: '',
temp_id: ''
}, },
rules: { rules: {
} }
@ -156,9 +172,43 @@ export default {
if (val) { if (val) {
this.form.images = val.join(',') this.form.images = val.join(',')
} }
} },
'form1.good': {
handler(val,oldVal){
this.getInfoChooseGood (val.cform.id)
},
deep:true//
},
}, },
methods: { methods: {
//
getInfoChooseGood (id) {
let that = this;
getInfo(id).then(async res => {
let data = res.productInfo;
console.log('data:'+data)
if(data){
let cate_id = parseInt(data.cate_id) || 0;
that.form = data;
that.form.productId = data.id
that.form.cate_id = cate_id;
that.form.title = data.store_name
that.form.info = data.store_info
that.form.unitName = data.unit_name
that.form.imageArr = data.image
that.form.sliderImageArr = data.slider_image
that.form.status = 1
}
that.templateList = res.tempList;
}).catch(res => {
console.log('err:'+res)
return this.$message({
message:res.msg,
type: 'error'
});
})
},
cancel() { cancel() {
this.resetForm() this.resetForm()
}, },
@ -221,7 +271,7 @@ export default {
bargainMaxPrice: '', bargainMaxPrice: '',
bargainMinPrice: '', bargainMinPrice: '',
bargainNum: '', bargainNum: '',
status: '', status: 1,
description: '', description: '',
giveIntegral: '', giveIntegral: '',
info: '', info: '',
@ -234,7 +284,8 @@ export default {
postage: '', postage: '',
rule: '', rule: '',
look: '', look: '',
share: '' share: '',
temp_id: '',
} }
} }
} }

9
src/views/activity/bargain/index.vue

@ -2,6 +2,15 @@
<div class="app-container"> <div class="app-container">
<!--工具栏--> <!--工具栏-->
<div class="head-container" > <div class="head-container" >
<div style="display: inline-block;margin: 0px 2px;">
<el-button
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
<el-button <el-button
type="danger" type="danger"
class="filter-item" class="filter-item"

22
src/views/activity/combination/form.vue

@ -4,6 +4,11 @@
<el-form ref="formValidate" :rules="ruleValidate" :model="formValidate" label-width="130px" > <el-form ref="formValidate" :rules="ruleValidate" :model="formValidate" label-width="130px" >
<el-row :gutter="24"> <el-row :gutter="24">
<!-- 商品信息--> <!-- 商品信息-->
<el-col :span="24">
<el-form-item label="选择商品:" prop="good">
<cgood v-model="form1.good":disabled="true" ></cgood>
</el-form-item>
</el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="拼团名称" prop="title"> <el-form-item label="拼团名称" prop="title">
<el-input v-model="formValidate.title" style="width: 500px;" placeholder="请输入拼团名称"/> <el-input v-model="formValidate.title" style="width: 500px;" placeholder="请输入拼团名称"/>
@ -62,21 +67,12 @@
<el-input-number v-model="formValidate.effectiveTime" style="width: 500px;" /> <el-input-number v-model="formValidate.effectiveTime" style="width: 500px;" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24">
<el-form-item label="拼团价" prop="price">
<el-input-number v-model="formValidate.price" />
</el-form-item>
</el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="拼团人数" prop="people"> <el-form-item label="拼团人数" prop="people">
<el-input-number v-model="formValidate.people" /> <el-input-number v-model="formValidate.people" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24">
<el-form-item label="选择商品:" prop="good">
<cgood v-model="form1.good":disabled="true" ></cgood>
</el-form-item>
</el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="商品规格:" props="spec_type"> <el-form-item label="商品规格:" props="spec_type">
<el-radio-group v-model="formValidate.spec_type" @change="changeSpec" :disabled="true"> <el-radio-group v-model="formValidate.spec_type" @change="changeSpec" :disabled="true">
@ -464,7 +460,7 @@ export default {
stock: '', stock: '',
addTime: '', addTime: '',
isHost: '', isHost: '',
isShow: '', isShow: 1,
isDel: 0, isDel: 0,
merUse: '', merUse: '',
isPostage: '', isPostage: '',
@ -720,6 +716,10 @@ export default {
that.id = that.combinationId that.id = that.combinationId
that.formValidate.productId = data.id that.formValidate.productId = data.id
that.formValidate.cate_id = cate_id; that.formValidate.cate_id = cate_id;
that.formValidate.title = data.store_name
that.formValidate.info = data.store_info
that.formValidate.unitName = data.unit_name
that.formValidate.isShow = 1
that.oneFormValidate = [data.attr]; that.oneFormValidate = [data.attr];
that.formValidate.header = []; that.formValidate.header = [];
that.generate(null); that.generate(null);

171
src/views/activity/seckill/form.vue

@ -3,68 +3,92 @@
<el-card :bordered="false"> <el-card :bordered="false">
<el-form ref="formValidate" :rules="ruleValidate" :model="formValidate" label-width="130px" > <el-form ref="formValidate" :rules="ruleValidate" :model="formValidate" label-width="130px" >
<el-row :gutter="24"> <el-row :gutter="24">
<!-- 商品信息--> <!-- 商品信息-->
<el-form-item label="秒杀名称">
<el-input v-model="formValidate.title" style="width: 500px;" />
</el-form-item>
<el-form-item label="秒杀简介">
<el-input v-model="formValidate.info" style="width: 500px;" />
</el-form-item>
<el-form-item label="单位">
<el-input v-model="formValidate.unitName" style="width: 500px;" />
</el-form-item>
<el-form-item label="秒杀开始时间">
<template>
<el-date-picker
v-model="formValidate.startTime"
type="date"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<el-form-item label="秒杀结束时间">
<template>
<el-date-picker
v-model="formValidate.stopTime"
type="date"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<el-form-item label="开始时间" prop="storeId">
<el-select v-model="formValidate.timeId" style="width: 178px" placeholder="请先选择开始时间">
<el-option
v-for="(item, index) in myTimes"
:key="index"
:label="item.map.time + '点开始,持续' + item.map.continued + '小时'"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="产品主图片">
<MaterialList v-model="formValidate.imageArr" style="width: 500px" type="image" :num="1" :width="150" :height="150" />
</el-form-item>
<el-form-item label="产品轮播图">
<MaterialList v-model="formValidate.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
</el-form-item>
<el-form-item label="秒杀价">
<el-input-number v-model="formValidate.price" />
</el-form-item>
<el-form-item label="返积分">
<el-input-number v-model="formValidate.giveIntegral" />
</el-form-item>
<el-form-item label="活动状态">
<el-radio v-model="formValidate.status" :label="1">开启</el-radio>
<el-radio v-model="formValidate.status" :label="0" style="width: 200px;">关闭</el-radio>
</el-form-item>
<el-form-item label="限购">
<el-input-number v-model="formValidate.num" />
</el-form-item>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="选择商品:" prop="image"> <el-form-item label="选择商品:" prop="good">
<cgood v-model="form1.good":disabled="true" ></cgood> <cgood v-model="form1.good":disabled="true" ></cgood>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24">
<el-form-item label="秒杀名称">
<el-input v-model="formValidate.title" style="width: 500px;" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="秒杀简介">
<el-input v-model="formValidate.info" style="width: 500px;" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="单位">
<el-input v-model="formValidate.unitName" style="width: 500px;" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="秒杀开始时间">
<template>
<el-date-picker
v-model="formValidate.startTime"
type="date"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="秒杀结束时间">
<template>
<el-date-picker
v-model="formValidate.stopTime"
type="date"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="开始时间" prop="storeId">
<el-select v-model="formValidate.timeId" style="width: 178px" placeholder="请先选择开始时间">
<el-option
v-for="(item, index) in myTimes"
:key="index"
:label="item.map.time + '点开始,持续' + item.map.continued + '小时'"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="产品主图片">
<single-pic v-model="formValidate.imageArr" style="width: 500px" type="image" :num="1" :width="150" :height="150" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="产品轮播图">
<MaterialList v-model="formValidate.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="秒杀价">
<el-input-number v-model="formValidate.price" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="返积分">
<el-input-number v-model="formValidate.giveIntegral" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="活动状态">
<el-radio v-model="formValidate.status" :label="1">开启</el-radio>
<el-radio v-model="formValidate.status" :label="0" style="width: 200px;">关闭</el-radio>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="限购">
<el-input-number v-model="formValidate.num" />
</el-form-item>
</el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="商品规格:" props="spec_type"> <el-form-item label="商品规格:" props="spec_type">
<el-radio-group v-model="formValidate.spec_type" @change="changeSpec" :disabled="true"> <el-radio-group v-model="formValidate.spec_type" @change="changeSpec" :disabled="true">
@ -413,34 +437,10 @@ export default {
} }
}, },
formValidate: { formValidate: {
// id: '',
// productId: '',
// image: '',
// images: '',
// imageArr: [],
// sliderImageArr: [],
// title: '',
// info: '',
// price: '',
// cost: '',
otPrice: '', otPrice: '',
giveIntegral: '', giveIntegral: '',
// sort: '',
// stock: '',
// sales: '',
// unitName: '',
// postage: '',
// description: '',
// startTime: '',
// stopTime: '',
// addTime: '',
status: '', status: '',
// isPostage: '',
// isHot: '',
// isDel: '',
num: '', num: '',
// isShow: ''
id: 0, id: 0,
timeId: null, timeId: null,
seckillId: 0, seckillId: 0,
@ -709,10 +709,15 @@ export default {
let cate_id = parseInt(data.cate_id) || 0; let cate_id = parseInt(data.cate_id) || 0;
that.attrs = data.items || []; that.attrs = data.items || [];
that.formValidate = data; that.formValidate = data;
that.id = that.combinationId
that.formValidate.productId = data.id that.formValidate.productId = data.id
that.formValidate.cate_id = cate_id; that.formValidate.cate_id = cate_id;
that.oneFormValidate = [data.attr]; that.oneFormValidate = [data.attr];
that.formValidate.title = data.store_name
that.formValidate.info = data.store_info
that.formValidate.unitName = data.unit_name
that.formValidate.imageArr = data.image
that.formValidate.sliderImageArr = data.slider_image
that.formValidate.status = 1
that.formValidate.header = []; that.formValidate.header = [];
that.generate(null); that.generate(null);
that.manyFormValidate = data.attrs; that.manyFormValidate = data.attrs;

Loading…
Cancel
Save