This commit is contained in:
kahu474
2021-07-12 16:08:45 +08:00
parent 0c28de8318
commit e315565338
3 changed files with 176 additions and 143 deletions

View File

@ -2,7 +2,7 @@ ENV = 'development'
# 接口地址
# VUE_APP_BASE_API = 'http://8.129.208.109:8001'
VUE_APP_BASE_API = 'http://www.itxzz.top'
VUE_APP_BASE_API = 'http://itxzz.51vip.biz'
VUE_APP_WS_API = 'ws://8.129.208.109:8001'

View File

@ -24,6 +24,12 @@
<el-input v-model="formValidate.unitName" @input="onInput()" style="width: 500px;" placeholder="请输入单位"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品原价">
<!-- oneFormValidate[0].cost-->
<el-input type="text" style="width: 500px;" disabled v-model="formValidate.productPrice" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="拼团开始时间" prop="startTime">
<template>
@ -54,12 +60,14 @@
</el-col>
<el-col :span="24">
<el-form-item label="产品主图片" prop="image">
<single-pic v-model="formValidate.image" style="width: 500px" type="image" :num="1" :width="150" :height="150" />
<single-pic v-model="formValidate.image" style="width: 500px" type="image" :num="1" :width="150"
:height="150"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="产品轮播图" prop="slider_image">
<MaterialList v-model="formValidate.slider_image" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
<MaterialList v-model="formValidate.slider_image" style="width: 500px" type="image" :num="4" :width="150"
:height="150"/>
</el-form-item>
</el-col>
<el-col :span="24">
@ -82,15 +90,18 @@
</el-form-item>
</el-col>
<!-- 多规格设置-->
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" v-if="manyFormValidate.length && formValidate.header.length!==0 && attrs.length!==0">
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24"
v-if="manyFormValidate.length && formValidate.header.length!==0 && attrs.length!==0">
<!-- 多规格表格-->
<el-col :span="24">
<el-form-item label="商品属性:" class="labeltop">
<el-table :data="manyFormValidate" size="small" style="width: 90%;">
<el-table-column type="myindex" v-for="(item,index) in formValidate.header" :key="index" :label="item.title" :property="item.slot" align="center">
<el-table-column type="myindex" v-for="(item,index) in formValidate.header" :key="index"
:label="item.title" :property="item.slot" align="center">
<template slot-scope="scope">
<div v-if="scope.column.property == 'pic'">
<single-pic v-model="scope.row[scope.column.property]" type="image" :num="1" :width="60" :height="60" align="center"/>
<single-pic v-model="scope.row[scope.column.property]" type="image" :num="1" :width="60"
:height="60" align="center"/>
</div>
<div v-else-if="scope.column.property.indexOf('value') != -1">
{{ scope.row[scope.column.property] }}
@ -187,7 +198,8 @@
<el-row>
<el-col :span="24">
<el-form-item label="商品详情:">
<ueditor-wrap v-model="formValidate.description" :config="myConfig" @beforeInit="addCustomDialog" style="width: 90%;"></ueditor-wrap>
<ueditor-wrap v-model="formValidate.description" :config="myConfig" @beforeInit="addCustomDialog"
style="width: 90%;"></ueditor-wrap>
</el-form-item>
</el-col>
</el-row>
@ -211,6 +223,7 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import MaterialList from '@/components/material'
import singlePic from '@/components/singlematerial'
import UeditorWrap from 'vue-ueditor-wrap';
export default {
components: {editor, picUpload, mulpicUpload, Treeselect, MaterialList, UeditorWrap, singlePic, cgood},
data() {
@ -267,6 +280,7 @@ export default {
images: '',
imageArr: [],
sliderImageArr: [],
productPrice:0,
title: '',
attr: '',
people: 1,
@ -543,6 +557,7 @@ export default {
// that.formValidate.people = 0
// that.formValidate.effectiveTime = 0
that.oneFormValidate = [data.attr];
that.formValidate.productPrice = that.oneFormValidate[0].cost
that.formValidate.header = [];
that.generate(null);
that.manyFormValidate = data.attrs;
@ -592,6 +607,7 @@ export default {
that.formValidate = data;
that.formValidate.cate_id = cate_id;
that.oneFormValidate = [data.attr];
that.formValidate.productPrice = that.oneFormValidate[0].cost
that.formValidate.header = [];
that.generate(data.productId);
that.manyFormValidate = data.attrs;
@ -709,9 +725,11 @@ export default {
<style scoped lang="stylus">
.submission
margin-left 10px;
.color-list .tip {
color: #c9c9c9;
}
.color-list .color-item {
height: 30px;
line-height: 30px;
@ -719,22 +737,29 @@ export default {
color: #fff;
margin-right: 10px;
}
.color-list .color-item.blue {
background-color: #1E9FFF;
}
.color-list .color-item.yellow {
background-color: rgb(254, 185, 0);
}
.color-list .color-item.green {
background-color: #009688;
}
.columnsBox
margin-right 10px
.priceBox
width 100%
.rulesBox
display flex
flex-wrap: wrap;
.curs
cursor pointer
</style>

View File

@ -51,6 +51,10 @@ export default {
} else this.doEdit()
},
doAdd() {
if(this.form.continued + this.form.time > 24){
this.loading = false
return this.$message.error("开启+持续时间不能超过24小时")
}
add(this.form).then(res => {
this.resetForm()
this.$notify({
@ -66,6 +70,10 @@ export default {
})
},
doEdit() {
if(this.form.continued + this.form.time > 24){
this.loading = false
return this.$message.error("开启+持续时间不能超过24小时")
}
edit(this.form).then(res => {
this.resetForm()
this.$notify({