Commit 5a08a58c authored by denghr's avatar denghr

添加海报背景,优惠券列表加一个删除

parent bc52c083
...@@ -80,3 +80,14 @@ export function giveObj(obj) { ...@@ -80,3 +80,14 @@ export function giveObj(obj) {
data: obj data: obj
}); });
} }
/**
* 优惠券列表删除
* @param query
*/
export function delObjOne(id) {
return fetch({
url: '/api/activity/admin/user_coupon/' + id,
method: 'delete'
})
}
\ No newline at end of file
...@@ -76,6 +76,11 @@ ...@@ -76,6 +76,11 @@
<span v-if="scope.row.isUse==0">未使用</span> <span v-if="scope.row.isUse==0">未使用</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="150" fixed="right">
<template scope="scope">
<el-button class="el-button el-button--text el-button--small" style="color:red;" size="small" @click="deleteHandler(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<div v-show="!listLoading" class="pagination-container"> <div v-show="!listLoading" class="pagination-container">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
...@@ -139,7 +144,8 @@ ...@@ -139,7 +144,8 @@
import { import {
getTitle, getTitle,
getCouponList, getCouponList,
giveObj giveObj,
delObjOne
} from 'api/cunponManagements'; } from 'api/cunponManagements';
import Element1 from "../admin/menu/components/element"; import Element1 from "../admin/menu/components/element";
import ElRow from "element-ui/packages/row/src/row"; import ElRow from "element-ui/packages/row/src/row";
...@@ -294,6 +300,32 @@ ...@@ -294,6 +300,32 @@
} }
}); });
}, },
deleteHandler(row){
this.$confirm('确定删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delObjOne(row.id).then(response => {
if (response.status == 200) {
this.$notify({
title: '成功',
message: '删除成功',
type: 'success',
duration: 2000
});
this.getList();
}else{
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
});
}
});
})
},
giveCunpon(){ giveCunpon(){
this.giveDialogVisible = true; this.giveDialogVisible = true;
} }
......
...@@ -148,6 +148,21 @@ ...@@ -148,6 +148,21 @@
<i v-else-if="!imgFlag" class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i> <i v-else-if="!imgFlag" class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="海报背景" :style="{display:'block'}">
<el-upload
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:show-file-list="false"
:on-success="handlePosterSuccess"
:on-progress="uploadPosterProcess"
list-type="picture">
<div slot="tip" class="el-upload__tip"> <span style="color: red;">建议尺寸:320*228px</span></div>
<el-progress v-show="imgPosterFlag == true" type="circle" :percentage="percent_poster" style="margin-top: 20px"></el-progress>
<img v-if="$utils.isString(form.posterBackground) && !$utils.isEmpty(form.posterBackground)&& !imgPosterFlag" :src="form.posterBackground" style="width:300px;max-height:300px;">
<i v-else-if="!imgPosterFlag" class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i>
</el-upload>
</el-form-item>
<el-form-item label="轮播图" :style="{display:'block'}"> <el-form-item label="轮播图" :style="{display:'block'}">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
...@@ -258,6 +273,8 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -258,6 +273,8 @@ import ElRow from "element-ui/packages/row/src/row";
}, },
data() { data() {
return { return {
imgPosterFlag:false,
percent_poster:0,
BASE_API: process.env.BASE_API, BASE_API: process.env.BASE_API,
config: { config: {
initialFrameWidth: null, initialFrameWidth: null,
...@@ -296,6 +313,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -296,6 +313,7 @@ import ElRow from "element-ui/packages/row/src/row";
isMember: "0",//是否是会员商品 isMember: "0",//是否是会员商品
tagDTOS: [],//旅行标签 tagDTOS: [],//旅行标签
bannerDTOS:[],//banner轮播 bannerDTOS:[],//banner轮播
posterBackground:'',//海报背景
}, },
showDestinationVisible: false,//编辑目的地 showDestinationVisible: false,//编辑目的地
showPathWayVisible: false,//编辑途径地 showPathWayVisible: false,//编辑途径地
...@@ -523,7 +541,8 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -523,7 +541,8 @@ import ElRow from "element-ui/packages/row/src/row";
bannerDTOS: this.form.bannerDTOS,//banner轮播图 bannerDTOS: this.form.bannerDTOS,//banner轮播图
siteDTOS: siteDTOS,//出发地type=0,途径地type=1,目的地type=2 siteDTOS: siteDTOS,//出发地type=0,途径地type=1,目的地type=2
priceDTOS: this.form.tourDepartTimeVo,//活动日期 priceDTOS: this.form.tourDepartTimeVo,//活动日期
tagDTOS: tagDTOS//旅游标签 tagDTOS: tagDTOS,//旅游标签
posterBackground:this.form.posterBackground,//海报背景
}; };
console.log(params); console.log(params);
goodsEdit(params).then(response => { goodsEdit(params).then(response => {
...@@ -643,7 +662,8 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -643,7 +662,8 @@ import ElRow from "element-ui/packages/row/src/row";
bannerDTOS: this.form.bannerDTOS,//banner轮播图 bannerDTOS: this.form.bannerDTOS,//banner轮播图
siteDTOS: siteDTOS,//出发地type=0,途径地type=1,目的地type=2 siteDTOS: siteDTOS,//出发地type=0,途径地type=1,目的地type=2
priceDTOS: this.form.tourDepartTimeVo,//活动日期 priceDTOS: this.form.tourDepartTimeVo,//活动日期
tagDTOS: tagDTOS//旅游标签 tagDTOS: tagDTOS,//旅游标签
posterBackground:this.form.posterBackground,//海报背景
}; };
console.log(params); console.log(params);
console.log(this.form); console.log(this.form);
...@@ -931,6 +951,22 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -931,6 +951,22 @@ import ElRow from "element-ui/packages/row/src/row";
this.imgFlag = false; this.imgFlag = false;
this.form.cover = res.data; this.form.cover = res.data;
}, },
/**
* 海报背景上传
* **/
handlePosterSuccess(res, file){
this.percent_poster = 0;
this.imgPosterFlag = false;
this.form.posterBackground = res.data;
},
/**
* 海报背景图上传进度
* */
uploadPosterProcess(event, file, fileList) {
this.imgPosterFlag = true;
console.log(event.percent);
this.percent_poster = Math.floor(event.percent);
},
/** /**
* banner上传 * banner上传
* */ * */
...@@ -973,6 +1009,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -973,6 +1009,7 @@ import ElRow from "element-ui/packages/row/src/row";
tagDTOS: [],//旅行标签 tagDTOS: [],//旅行标签
bannerDTOS:[],//banner轮播 bannerDTOS:[],//banner轮播
tourDepartTimeVo:[],//活动时间 tourDepartTimeVo:[],//活动时间
posterBackground:'',//海报背景
}, },
this.showDestinationVisible= false,//编辑目的地 this.showDestinationVisible= false,//编辑目的地
this.showPathWayVisible= false,//编辑途径地 this.showPathWayVisible= false,//编辑途径地
......
...@@ -149,6 +149,21 @@ ...@@ -149,6 +149,21 @@
<i v-else-if="!imgFlag" class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i> <i v-else-if="!imgFlag" class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="海报背景" :style="{display:'block'}">
<el-upload
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:show-file-list="false"
:on-success="handlePosterSuccess"
:on-progress="uploadPosterProcess"
list-type="picture">
<div slot="tip" class="el-upload__tip"> <span style="color: red;">建议尺寸:320*228px</span></div>
<el-progress v-show="imgPosterFlag == true" type="circle" :percentage="percent_poster" style="margin-top: 20px"></el-progress>
<img v-if="$utils.isString(form.posterBackground) && !$utils.isEmpty(form.posterBackground)&& !imgPosterFlag" :src="form.posterBackground" style="width:300px;max-height:300px;">
<i v-else-if="!imgPosterFlag" class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i>
</el-upload>
</el-form-item>
<el-form-item label="轮播图" :style="{display:'block'}"> <el-form-item label="轮播图" :style="{display:'block'}">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
...@@ -256,6 +271,8 @@ import UE from '../../modal/Ueditor';//百度ue富文本 ...@@ -256,6 +271,8 @@ import UE from '../../modal/Ueditor';//百度ue富文本
}, },
data() { data() {
return { return {
imgPosterFlag:false,
percent_poster:0,
BASE_API: process.env.BASE_API, BASE_API: process.env.BASE_API,
percent: 0,//上传进度 percent: 0,//上传进度
imgFlag: false, imgFlag: false,
...@@ -429,13 +446,29 @@ import UE from '../../modal/Ueditor';//百度ue富文本 ...@@ -429,13 +446,29 @@ import UE from '../../modal/Ueditor';//百度ue富文本
console.log(event.percent); console.log(event.percent);
this.percent = Math.floor(event.percent); this.percent = Math.floor(event.percent);
}, },
/**
* 海报背景图上传进度
* */
uploadPosterProcess(event, file, fileList) {
this.imgPosterFlag = true;
console.log(event.percent);
this.percent_poster = Math.floor(event.percent);
},
/** /**
* 封面图上传 * 封面图上传
* **/ * **/
handleAvatarSuccess(res, file){ handleAvatarSuccess(res, file){
this.percent = 0; this.percent = 0;
this.imgFlag = false; this.imgFlag = false;
this.form.cover_pic = res.data; this.form.coverPic = res.data;
},
/**
* 海报背景上传
* **/
handlePosterSuccess(res, file){
this.percent_poster = 0;
this.imgPosterFlag = false;
this.form.posterBackground = res.data;
}, },
/** /**
* 创建 * 创建
...@@ -451,6 +484,7 @@ import UE from '../../modal/Ueditor';//百度ue富文本 ...@@ -451,6 +484,7 @@ import UE from '../../modal/Ueditor';//百度ue富文本
modelParam: JSON.stringify(this.form.modelParam),//房车参数 modelParam: JSON.stringify(this.form.modelParam),//房车参数
picture: this.form.picture,//轮播图 picture: this.form.picture,//轮播图
coverPic: this.form.coverPic,//封面图 coverPic: this.form.coverPic,//封面图
posterBackground: this.form.posterBackground,//海报背景
price: this.form.price,//租车价格 price: this.form.price,//租车价格
deposit: this.form.deposit,//总押金 deposit: this.form.deposit,//总押金
vioDeposit: this.form.vioDeposit, vioDeposit: this.form.vioDeposit,
...@@ -498,6 +532,7 @@ import UE from '../../modal/Ueditor';//百度ue富文本 ...@@ -498,6 +532,7 @@ import UE from '../../modal/Ueditor';//百度ue富文本
picture: this.form.picture,//轮播图 picture: this.form.picture,//轮播图
price: this.form.price,//租车价格 price: this.form.price,//租车价格
coverPic: this.form.coverPic,//封面图 coverPic: this.form.coverPic,//封面图
posterBackground: this.form.posterBackground,//海报背景
deposit: this.form.deposit,//总押金 deposit: this.form.deposit,//总押金
vioDeposit: this.form.vioDeposit, vioDeposit: this.form.vioDeposit,
hotSign: this.form.hotSign,//热门车型 hotSign: this.form.hotSign,//热门车型
...@@ -835,6 +870,7 @@ import UE from '../../modal/Ueditor';//百度ue富文本 ...@@ -835,6 +870,7 @@ import UE from '../../modal/Ueditor';//百度ue富文本
rentDiscountStatus:"0",//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值 rentDiscountStatus:"0",//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
rentDiscountPrice: "",//租车优惠价格 固定优化价格 rentDiscountPrice: "",//租车优惠价格 固定优化价格
buyPrice: 0,//购买价格 buyPrice: 0,//购买价格
posterBackground:'',//海报背景
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment