修改抽奖

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"
inactive-color="#ff4949">
</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>
</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"-->
<!-- header-align="center"-->
<!-- align="center"-->
@ -107,12 +106,12 @@
</el-switch>
</template>
</el-table-column>
<el-table-column
prop="visit"
header-align="center"
align="center"
label="浏览次数">
</el-table-column>
<!-- <el-table-column-->
<!-- prop="visit"-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- label="浏览次数">-->
<!-- </el-table-column>-->
<el-table-column
prop="sort"
header-align="center"

View File

@ -17,10 +17,11 @@
<!-- <el-input v-model="dataForm.authorType" placeholder="作者类型1管理员2游客"></el-input>-->
<!-- </el-form-item>-->
<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 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 v-else class="upLoad">
<i class="el-icon-camera cameraIconfont"/>
@ -31,26 +32,25 @@
<el-form-item label="视频简介" prop="synopsis">
<el-input v-model="dataForm.synopsis" placeholder="视频简介"></el-input>
</el-form-item>
<el-form-item label="详细内容" prop="content">
<Tinymce v-model="dataForm.content"></Tinymce>
</el-form-item>
<el-form-item label="关联商品" prop="productId">
<el-button v-if="storeList.length == 0" type="primary" round size="small" @click="store()">点击关联商品</el-button>
<el-table
v-else
:data="storeList"
style="width: 100%">
<div class="acea-row">
<template v-if="checked.length">
<div class="pictrue" v-for="(item, index) in checked" :key="index">
<img :src="item.image">
<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 label="是否热门" prop="isHot">
<el-switch
@ -59,101 +59,29 @@
inactive-color="#ff4949">
</el-switch>
</el-form-item>
<el-form-item label="是否轮播图" prop="isBanner">
<el-switch
v-model="dataForm.isBanner"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
<!-- <el-form-item label="是否轮播图" prop="isBanner">-->
<!-- <el-switch-->
<!-- v-model="dataForm.isBanner"-->
<!-- active-color="#13ce66"-->
<!-- inactive-color="#ff4949">-->
<!-- </el-switch>-->
<!-- </el-form-item>-->
<el-form-item label="是否隐藏" prop="hide">
<el-switch
v-model="dataForm.hide"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number v-model="dataForm.sort" :min="0" :max="9999" label="排序"></el-input-number>
</el-form-item>
</el-form>
<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>
</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>
</template>
<script>
@ -164,7 +92,7 @@ export default {
components: {Tinymce },
data() {
return {
storeList:[],
checked:[],
tableData: {
data: [],
total: 0
@ -217,34 +145,45 @@ export default {
}
},
methods: {
del(){
this.storeList = []
this.dataForm.productId = ""
quit(){
this.visible = false
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) {
this.$confirm('确认关闭?')
.then(_ => {
done()
this.storeList = []
this.tableFrom = {
title:"",
imageInput:"",
synopsis:"",
content:"",
sort:1,
isHot:false,
isBanner:false,
hide:false,
}
this.resetForm()
this.$router.go(0); //
})
.catch(_ => {
});
},
//
handleSave(row){
this.storeList.push(row)
this.storeVisible = false
resetForm() {
//
this.dataForm = {
title: "",
imageInput: "",
synopsis: "",
content: "",
sort: 1,
isHot: false,
isBanner: false,
hide: false,
};
this.checked = []; //
},
store(){
this.getList()
this.storeVisible = true
@ -268,7 +207,6 @@ export default {
modalPicTap(tit, num, i, status) {
const _this = this;
this.$modalUpload(function (img) {
if (tit === '1' && !num) {
_this.dataForm.imageInput = img[0].sattDir
}
@ -284,11 +222,15 @@ export default {
//
if (res.productId){
productDetailApi(res.productId).then(res =>{
this.storeList.push(res)
this.checked = []
this.checked.push(res)
})
}
this.dataForm = res;
})
}else {
//
this.resetForm();
}
})
},
@ -296,26 +238,66 @@ export default {
dataSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
if (this.storeList.length > 0){
this.dataForm.productId = this.storeList[0].id
if (this.checked.length >= 2){
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){
videoUpdateApi(this.dataForm).then(res => {
this.visible = false
this.$message.success("修改成功!");
this.$emit('refreshDataList');
this.resetForm(); //
})
}else {
videoCreateApi(this.dataForm).then(res => {
this.visible = false
this.$message.success("添加成功!");
this.$emit('refreshDataList');
this.resetForm(); //
});
}
this.$router.go(0); //
}
})
}
}
}
</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"
align="center"
label="预约编号">
</el-table-column> <el-table-column
width="150"
</el-table-column>
<el-table-column
width="80"
prop="userName"
header-align="center"
align="center"
@ -50,23 +51,19 @@
</el-table-column>
<el-table-column
prop="cellPhone"
width="180"
header-align="center"
align="center"
label="预约手机号">
</el-table-column>
<el-table-column
width="180"
prop="createDate"
header-align="center"
align="center"
label="报名时间">
</el-table-column>
<el-table-column
prop="attendNum"
header-align="center"
align="center"
label="参与人数">
</el-table-column>
<!-- <el-table-column-->
<!-- width="180"-->
<!-- prop="createDate"-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- label="报名时间">-->
<!-- </el-table-column>-->
<el-table-column
width="180"
prop="subscribeDate"
@ -74,7 +71,12 @@
align="center"
label="预约指定日期">
</el-table-column>
<el-table-column
prop="attendNum"
header-align="center"
align="center"
label="参与人数">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
@ -95,7 +97,6 @@
<el-tag v-else>类型错误</el-tag>
</div>
</template>
</el-table-column>
<el-table-column
width="180"
@ -103,7 +104,6 @@
header-align="center"
align="center"
label="取消时间">
<template slot-scope="scope">
<div class="demo-image__preview">
<span v-if="scope.row.cancelData === null"> - </span>
@ -123,7 +123,6 @@
</div>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
@ -131,7 +130,7 @@
width="150"
label="操作">
<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"-->
<!-- @click="activityLog(scope.row.id)">预约记录-->
<!-- </el-button>-->
@ -194,8 +193,8 @@
</el-dialog>
<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="innerVisible = true">取消预约</el-button>
</div>
</el-dialog>

View File

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

View File

@ -131,12 +131,10 @@
<!-- </div>-->
<div class="mt20"></div>
<el-button type="primary" @click="submit()">提交修改</el-button>
<el-dialog
title="添加奖品"
title="修改奖品"
:visible.sync="visible"
width="50%"
>
@ -153,6 +151,21 @@
<el-form-item v-if="teaPlants.id == 7" label="优惠券">
<el-input v-model="teaPlants.productId"/>
</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-input v-model="teaPlants.productName"/>

View File

@ -195,7 +195,7 @@
</el-dialog>
<div slot="footer" class="dialog-footer">
<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>
</el-dialog>