修改抽奖

This commit is contained in:
闵宪瑞 2024-12-06 14:06:53 +08:00
parent 59382a146a
commit d84b7923a0
6 changed files with 226 additions and 234 deletions

View File

@ -69,24 +69,23 @@
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949"> inactive-color="#ff4949">
</el-switch> </el-switch>
</template>
</el-table-column>
<el-table-column
prop="isBanner"
header-align="center"
align="center"
label="是否轮播图">
<template slot-scope="scope">
<el-switch
@change='changeStatus($event,scope.row,"banner")'
v-model="scope.row.isBanner"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column--> <!-- <el-table-column-->
<!-- prop="isBanner"-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- label="是否轮播图">-->
<!-- <template slot-scope="scope">-->
<!-- <el-switch-->
<!-- @change='changeStatus($event,scope.row,"banner")'-->
<!-- v-model="scope.row.isBanner"-->
<!-- active-color="#13ce66"-->
<!-- inactive-color="#ff4949">-->
<!-- </el-switch>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- prop="content"--> <!-- prop="content"-->
<!-- header-align="center"--> <!-- header-align="center"-->
<!-- align="center"--> <!-- align="center"-->
@ -107,12 +106,12 @@
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column-->
prop="visit" <!-- prop="visit"-->
header-align="center" <!-- header-align="center"-->
align="center" <!-- align="center"-->
label="浏览次数"> <!-- label="浏览次数">-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <el-table-column
prop="sort" prop="sort"
header-align="center" header-align="center"

View File

@ -17,10 +17,11 @@
<!-- <el-input v-model="dataForm.authorType" placeholder="作者类型1管理员2游客"></el-input>--> <!-- <el-input v-model="dataForm.authorType" placeholder="作者类型1管理员2游客"></el-input>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="上传视频" prop="imageInput"> <el-form-item label="上传视频" prop="imageInput">
<div style="width: 300px;height: 300px"> <div style="width: 300px;height: 300px" class="video-container">
<div class="upLoadPicBox" @click="modalPicTap('1')" > <div class="upLoadPicBox" @click="modalPicTap('1')" >
<div v-if="dataForm.imageInput" class="pictrue"> <div v-if="dataForm.imageInput" class="pictrue">
<video width="300" height="300" :src="dataForm.imageInput" type="video/mp4" autoplay="false" controls> </video> <video width="300" height="300" :src="dataForm.imageInput" type="video/mp4" controls></video>
</div> </div>
<div v-else class="upLoad"> <div v-else class="upLoad">
<i class="el-icon-camera cameraIconfont"/> <i class="el-icon-camera cameraIconfont"/>
@ -31,26 +32,25 @@
<el-form-item label="视频简介" prop="synopsis"> <el-form-item label="视频简介" prop="synopsis">
<el-input v-model="dataForm.synopsis" placeholder="视频简介"></el-input> <el-input v-model="dataForm.synopsis" placeholder="视频简介"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="详细内容" prop="content"> <el-form-item label="详细内容" prop="content">
<Tinymce v-model="dataForm.content"></Tinymce> <Tinymce v-model="dataForm.content"></Tinymce>
</el-form-item> </el-form-item>
<el-form-item label="关联商品" prop="productId"> <el-form-item label="关联商品" prop="productId">
<el-button v-if="storeList.length == 0" type="primary" round size="small" @click="store()">点击关联商品</el-button> <div class="acea-row">
<el-table <template v-if="checked.length">
v-else <div class="pictrue" v-for="(item, index) in checked" :key="index">
:data="storeList" <img :src="item.image">
style="width: 100%"> <i class="el-icon-error btndel" @click="handleRemove(index)" />
</div>
</template>
<div class="upLoadPicBox" @click="changeGood">
<div class="upLoad">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</div>
<el-table-column prop="id" label="商品编号" width="80">
</el-table-column>
<el-table-column prop="storeName" label="商品名称"></el-table-column>
<el-table-column width="80" label="操作">
<el-button type="text" size="small" @click="del">移除</el-button>
</el-table-column>
</el-table>
</el-form-item> </el-form-item>
<el-form-item label="是否热门" prop="isHot"> <el-form-item label="是否热门" prop="isHot">
<el-switch <el-switch
@ -59,101 +59,29 @@
inactive-color="#ff4949"> inactive-color="#ff4949">
</el-switch> </el-switch>
</el-form-item> </el-form-item>
<el-form-item label="是否轮播图" prop="isBanner"> <!-- <el-form-item label="是否轮播图" prop="isBanner">-->
<el-switch <!-- <el-switch-->
v-model="dataForm.isBanner" <!-- v-model="dataForm.isBanner"-->
active-color="#13ce66" <!-- active-color="#13ce66"-->
inactive-color="#ff4949"> <!-- inactive-color="#ff4949">-->
</el-switch> <!-- </el-switch>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="是否隐藏" prop="hide"> <el-form-item label="是否隐藏" prop="hide">
<el-switch <el-switch
v-model="dataForm.hide" v-model="dataForm.hide"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949"> inactive-color="#ff4949">
</el-switch> </el-switch>
</el-form-item> </el-form-item>
<el-form-item label="排序" prop="sort"> <el-form-item label="排序" prop="sort">
<el-input-number v-model="dataForm.sort" :min="0" :max="9999" label="排序"></el-input-number> <el-input-number v-model="dataForm.sort" :min="0" :max="9999" label="排序"></el-input-number>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button> <el-button @click="quit">取消</el-button>
<el-button type="primary" @click="dataSubmit()">确定</el-button> <el-button type="primary" @click="dataSubmit()">确定</el-button>
</span> </span>
<el-dialog
title="关联商品"
:visible.sync="storeVisible"
width="80%"
append-to-body
>
<el-table
:data="tableData.data"
style="width: 100%"
size="mini"
:highlight-current-row="true"
:header-cell-style=" {fontWeight:'bold'}"
>
<el-table-column
prop="id"
label="ID"
min-width="50"
/>
<el-table-column label="商品图" min-width="80">
<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 label="商品名称"
prop="storeName"
min-width="300"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="price"
label="商品售价"
min-width="90"
align="center"
/>
<el-table-column
prop="sales"
label="销量"
min-width="90"
align="center"
/>
<el-table-column
prop="stock"
label="库存"
min-width="90"
align="center"
/>
<el-table-column label="操作" min-width="150" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleSave(scope.row)" >选中</el-button>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
:page-sizes="[20, 40, 60, 80]"
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-dialog>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
@ -164,7 +92,7 @@ export default {
components: {Tinymce }, components: {Tinymce },
data() { data() {
return { return {
storeList:[], checked:[],
tableData: { tableData: {
data: [], data: [],
total: 0 total: 0
@ -217,34 +145,45 @@ export default {
} }
}, },
methods: { methods: {
del(){ quit(){
this.storeList = [] this.visible = false
this.dataForm.productId = "" this.resetForm()
this.$router.go(0); //
},
handleRemove (i) {
this.checked.splice(i, 1)
},
changeGood(){
const _this = this
this.$modalGoodList(function(row) {
_this.checked = row
},'many',_this.checked)
}, },
handleClose(done) { handleClose(done) {
this.$confirm('确认关闭?') this.$confirm('确认关闭?')
.then(_ => { .then(_ => {
done() done()
this.storeList = [] this.resetForm()
this.tableFrom = { this.$router.go(0); //
title:"",
imageInput:"",
synopsis:"",
content:"",
sort:1,
isHot:false,
isBanner:false,
hide:false,
}
}) })
.catch(_ => { .catch(_ => {
}); });
}, },
// resetForm() {
handleSave(row){ //
this.storeList.push(row) this.dataForm = {
this.storeVisible = false title: "",
imageInput: "",
synopsis: "",
content: "",
sort: 1,
isHot: false,
isBanner: false,
hide: false,
};
this.checked = []; //
}, },
store(){ store(){
this.getList() this.getList()
this.storeVisible = true this.storeVisible = true
@ -268,7 +207,6 @@ export default {
modalPicTap(tit, num, i, status) { modalPicTap(tit, num, i, status) {
const _this = this; const _this = this;
this.$modalUpload(function (img) { this.$modalUpload(function (img) {
if (tit === '1' && !num) { if (tit === '1' && !num) {
_this.dataForm.imageInput = img[0].sattDir _this.dataForm.imageInput = img[0].sattDir
} }
@ -284,11 +222,15 @@ export default {
// //
if (res.productId){ if (res.productId){
productDetailApi(res.productId).then(res =>{ productDetailApi(res.productId).then(res =>{
this.storeList.push(res) this.checked = []
this.checked.push(res)
}) })
} }
this.dataForm = res; this.dataForm = res;
}) })
}else {
//
this.resetForm();
} }
}) })
}, },
@ -296,26 +238,66 @@ export default {
dataSubmit() { dataSubmit() {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
if (this.storeList.length > 0){ if (this.checked.length >= 2){
this.dataForm.productId = this.storeList[0].id this.$message.error("最多只能添加1个关联商品");
return;
}
if (this.checked.length == 0){
this.dataForm.productId = ''
} else {
this.dataForm.productId = this.checked[0].id
} }
if (this.dataForm.id){ if (this.dataForm.id){
videoUpdateApi(this.dataForm).then(res => { videoUpdateApi(this.dataForm).then(res => {
this.visible = false this.visible = false
this.$message.success("修改成功!"); this.$message.success("修改成功!");
this.$emit('refreshDataList'); this.$emit('refreshDataList');
this.resetForm(); //
}) })
}else { }else {
videoCreateApi(this.dataForm).then(res => { videoCreateApi(this.dataForm).then(res => {
this.visible = false this.visible = false
this.$message.success("添加成功!"); this.$message.success("添加成功!");
this.$emit('refreshDataList'); this.$emit('refreshDataList');
this.resetForm(); //
}); });
} }
this.$router.go(0); //
} }
}) })
} }
} }
} }
</script> </script>
<style scoped lang="scss">
.pictrue{
width: 60px;
height: 60px;
border: 1px dotted rgba(0,0,0,0.1);
margin-right: 10px;
position: relative;
cursor: pointer;
img{
width: 100%;
height: 100%;
}
}
.btndel{
position: absolute;
z-index: 1;
width :20px !important;
height: 20px !important;
left: 46px;
top: -4px;
}
.video-container {
width: 300px;
height: 300px;
border: 2px solid #ccc; /* 边框颜色和宽度 */
border-radius: 10px; /* 圆角 */
overflow: hidden; /* 防止视频溢出容器 */
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* 为容器添加阴影 */
background-color: #f9f9f9; /* 背景色 */
}
</style>

View File

@ -41,8 +41,9 @@
header-align="center" header-align="center"
align="center" align="center"
label="预约编号"> label="预约编号">
</el-table-column> <el-table-column </el-table-column>
width="150" <el-table-column
width="80"
prop="userName" prop="userName"
header-align="center" header-align="center"
align="center" align="center"
@ -50,23 +51,19 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="cellPhone" prop="cellPhone"
width="180"
header-align="center" header-align="center"
align="center" align="center"
label="预约手机号"> label="预约手机号">
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column-->
width="180" <!-- width="180"-->
prop="createDate" <!-- prop="createDate"-->
header-align="center" <!-- header-align="center"-->
align="center" <!-- align="center"-->
label="报名时间"> <!-- label="报名时间">-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column
prop="attendNum"
header-align="center"
align="center"
label="参与人数">
</el-table-column>
<el-table-column <el-table-column
width="180" width="180"
prop="subscribeDate" prop="subscribeDate"
@ -74,7 +71,12 @@
align="center" align="center"
label="预约指定日期"> label="预约指定日期">
</el-table-column> </el-table-column>
<el-table-column
prop="attendNum"
header-align="center"
align="center"
label="参与人数">
</el-table-column>
<el-table-column <el-table-column
prop="remark" prop="remark"
header-align="center" header-align="center"
@ -95,7 +97,6 @@
<el-tag v-else>类型错误</el-tag> <el-tag v-else>类型错误</el-tag>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
width="180" width="180"
@ -103,7 +104,6 @@
header-align="center" header-align="center"
align="center" align="center"
label="取消时间"> label="取消时间">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="demo-image__preview"> <div class="demo-image__preview">
<span v-if="scope.row.cancelData === null"> - </span> <span v-if="scope.row.cancelData === null"> - </span>
@ -123,7 +123,6 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
fixed="right" fixed="right"
header-align="center" header-align="center"
@ -131,7 +130,7 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.status == 0" type="text" size="small" @click="mobile(scope.row)">电话联系</el-button> <el-button v-if="scope.row.status == 0" type="text" size="small" @click="mobile(scope.row)">确定预约</el-button>
<!-- <el-button v-hasPermi="['admin:activity:update']" type="text" size="small"--> <!-- <el-button v-hasPermi="['admin:activity:update']" type="text" size="small"-->
<!-- @click="activityLog(scope.row.id)">预约记录--> <!-- @click="activityLog(scope.row.id)">预约记录-->
<!-- </el-button>--> <!-- </el-button>-->
@ -194,8 +193,8 @@
</el-dialog> </el-dialog>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="innerVisible = true">取消预约</el-button>
<el-button type="primary" @click="userok" >确认预约</el-button> <el-button type="primary" @click="userok" >确认预约</el-button>
<el-button type="primary" @click="innerVisible = true">取消预约</el-button>
</div> </div>
</el-dialog> </el-dialog>

View File

@ -70,70 +70,69 @@
</div> </div>
</el-card> </el-card>
<div class="mt20"></div> <div class="mt20"></div>
<div slot="header" class="clearfix"> <!-- <div slot="header" class="clearfix">-->
<el-button size="small" type="primary" @click="add()">添加茶株</el-button> <!-- <el-button size="small" type="primary" @click="add()">添加茶株</el-button>-->
</div> <!-- </div>-->
<div class="mt20"> <div class="mt20">
<!-- <cards-data :cardLists="cardLists" v-if="checkPermi(['admin:order:list:data'])"></cards-data> --> <!-- <cards-data :cardLists="cardLists" v-if="checkPermi(['admin:order:list:data'])"></cards-data> -->
</div> </div>
<el-table <el-table
:data="specsData.items" :data="specsData.items"
style="width: 100%;"> style="width: 100%;">
<!-- <el-table-column-->
<!-- width="150"-->
<!-- prop="productName"-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- label="认领标题">-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- width="150"-->
<!-- prop="title"-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- label="认领副标题">-->
<!-- </el-table-column>-->
<el-table-column <!-- <el-table-column-->
width="150" <!-- prop="productImage"-->
prop="productName" <!-- header-align="center"-->
header-align="center" <!-- align="center"-->
align="center" <!-- label="茶株封面">-->
label="认领标题"> <!-- <template slot-scope="scope">-->
</el-table-column> <!-- <div class="demo-image__preview">-->
<el-table-column <!-- <el-image-->
width="150" <!-- style="width: 36px; height: 36px"-->
prop="title" <!-- :src="scope.row.productImage"-->
header-align="center" <!-- :preview-src-list="[scope.row.productImage]"-->
align="center" <!-- />-->
label="认领副标题"> <!-- </div>-->
</el-table-column> <!-- </template>-->
<!-- </el-table-column>-->
<el-table-column <!-- <el-table-column-->
prop="productImage" <!-- prop="productPrice"-->
header-align="center" <!-- header-align="center"-->
align="center" <!-- align="center"-->
label="茶株封面"> <!-- label="茶株价格">-->
<template slot-scope="scope"> <!-- </el-table-column>-->
<div class="demo-image__preview"> <!-- <el-table-column-->
<el-image <!-- prop="gardener"-->
style="width: 36px; height: 36px" <!-- header-align="center"-->
:src="scope.row.productImage" <!-- align="center"-->
:preview-src-list="[scope.row.productImage]" <!-- label="养护人">-->
/> <!-- </el-table-column>-->
</div> <!-- <el-table-column-->
</template> <!-- prop="soil"-->
</el-table-column> <!-- header-align="center"-->
<el-table-column <!-- align="center"-->
prop="productPrice" <!-- label="土壤">-->
header-align="center" <!-- </el-table-column>-->
align="center" <!-- <el-table-column-->
label="茶株价格"> <!-- prop="humidity"-->
</el-table-column> <!-- header-align="center"-->
<el-table-column <!-- align="center"-->
prop="gardener" <!-- label="温度">-->
header-align="center" <!-- </el-table-column>-->
align="center"
label="养护人">
</el-table-column>
<el-table-column
prop="soil"
header-align="center"
align="center"
label="土壤">
</el-table-column>
<el-table-column
prop="humidity"
header-align="center"
align="center"
label="温度">
</el-table-column>
<el-table-column <el-table-column
prop="smallImage" prop="smallImage"
header-align="center" header-align="center"
@ -180,25 +179,25 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
prop="allNum"
header-align="center"
align="center"
label="领养总数">
</el-table-column>
<!-- <el-table-column--> <!-- <el-table-column-->
<!-- prop="fruitNum"--> <!-- prop="allNum"-->
<!-- header-align="center"--> <!-- header-align="center"-->
<!-- align="center"--> <!-- align="center"-->
<!-- label="果实数量">--> <!-- label="领养总数">-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column <el-table-column
prop="treePlace" prop="fruitNum"
header-align="center" header-align="center"
align="center" align="center"
label="种植地点"> label="果实数量">
</el-table-column> </el-table-column>
<!-- <el-table-column-->
<!-- prop="treePlace"-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- label="种植地点">-->
<!-- </el-table-column>-->
<el-table-column <el-table-column
fixed="right" fixed="right"
header-align="center" header-align="center"

View File

@ -131,12 +131,10 @@
<!-- </div>--> <!-- </div>-->
<div class="mt20"></div> <div class="mt20"></div>
<el-button type="primary" @click="submit()">提交修改</el-button> <el-button type="primary" @click="submit()">提交修改</el-button>
<el-dialog <el-dialog
title="添加奖品" title="修改奖品"
:visible.sync="visible" :visible.sync="visible"
width="50%" width="50%"
> >
@ -153,6 +151,21 @@
<el-form-item v-if="teaPlants.id == 7" label="优惠券"> <el-form-item v-if="teaPlants.id == 7" label="优惠券">
<el-input v-model="teaPlants.productId"/> <el-input v-model="teaPlants.productId"/>
</el-form-item> </el-form-item>
<el-form-item label="奖品">
<el-select
v-model="teaPlants.productType"
placeholder="Select"
size="large"
style="width: 240px"
>
<el-option
v-for="item in typeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="奖品名称"> <el-form-item label="奖品名称">
<el-input v-model="teaPlants.productName"/> <el-input v-model="teaPlants.productName"/>

View File

@ -195,7 +195,7 @@
</el-dialog> </el-dialog>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="userok" >确认预约</el-button> <el-button type="primary" @click="userok" >确认预约</el-button>
<el-button type="primary" @click="innerVisible = true">取消预约</el-button> <el-button @click="innerVisible = true">取消预约</el-button>
</div> </div>
</el-dialog> </el-dialog>