瀏覽代碼

优惠券接口修改

soft5566 2 年之前
父節點
當前提交
e1264a59b2
共有 2 個文件被更改,包括 64 次插入65 次删除
  1. 2 6
      src/api/adMgr.js
  2. 62 59
      src/views/ad/index.vue

+ 2 - 6
src/api/adMgr.js

@@ -158,18 +158,14 @@ export function getMinsuTableData(forData) {
 // 优惠券列表
 export function getYouhuiquanTableData(forData) {
 	let data = ''
-	data += '?page=' + forData.page + '&rows=' + forData.rows + '&status=1'
+	data += '?page=' + forData.page + '&rows=' + forData.rows
 
 	if (typeof forData.title !== 'undefined') {
 		data += '&name=' + forData.title
 	}
-	if (forData.search_datatime !== undefined && forData.search_datatime !== null) {
-		data += '&grantStartDate=' + forData.search_datatime[0]
-		data += '&grantEndDate=' + forData.search_datatime[1]
-	}
 
 	return request({
-		url: '/mhotel/CoupomqueryPage.action' + data,
+		url: '/mhotel/CoupomadvertisingCouponPage.action' + data,
 		method: 'get',
 		data
 	})

+ 62 - 59
src/views/ad/index.vue

@@ -39,41 +39,44 @@
 									<span>{{ scope.row.sortLevel }}</span>
 								</template>
 							</el-table-column>
-							<el-table-column label="标题" align="center" width="200">
+							<el-table-column label="标题" align="center">
 								<template slot-scope="scope">
 									<span>{{ scope.row.title }}</span>
 								</template>
 							</el-table-column>
-							<el-table-column label="图片" align="center" width="300">
+							<el-table-column label="图片" align="center">
 								<template slot-scope="scope">
 									<viewer>
 										<img style="height: 130px; cursor: pointer;" :src="scope.row.imageUrl" fit="contain" />
 									</viewer>
 								</template>
 							</el-table-column>
-							<el-table-column label="跳转类型" align="center" width="90">
+							<el-table-column label="跳转类型" align="center">
 								<template slot-scope="scope">
 									<span>{{ scope.row.jumpWay }}</span>
 								</template>
 							</el-table-column>
 							<el-table-column label="页面链接" align="center">
 								<template slot-scope="scope">
-									<span v-if="scope.row.jumpPoint === ''">无</span>
-									<span v-else>{{ scope.row.jumpPoint }}</span>
+									<span v-if="scope.row.subTitle === ''">
+										<span v-if="scope.row.jumpPoint === ''">无</span>
+										<span v-else>{{ scope.row.jumpPoint }}</span>
+									</span>
+									<span v-else>{{ scope.row.subTitle }}</span>
 								</template>
 							</el-table-column>
-							<el-table-column label="状态" align="center" width="80">
+							<el-table-column label="状态" align="center">
 								<template slot-scope="scope">
 									<span v-if="scope.row.state == 1">开启</span>
 									<span v-else>禁用</span>
 								</template>
 							</el-table-column>
-							<el-table-column label="创建时间" align="center" width="168">
+							<el-table-column label="创建时间" align="center">
 								<template slot-scope="scope">
 									<span>{{ scope.row.createTime }}</span>
 								</template>
 							</el-table-column>
-							<el-table-column fixed="right" label="操作" width="160">
+							<el-table-column label="操作" width="160">
 								<template slot-scope="scope">
 									<el-button type="text" size="small" @click="modifyAd(scope.row)">修改</el-button>
 									<el-button type="text" size="small" @click="delAd(scope.row)">删除</el-button>
@@ -134,7 +137,7 @@
 						:required="formModifyAD.checkedTypes == 2">
 						<div id="panel" style="width: 100%;">
 							<el-input placeholder="请选择民宿、优惠券、攻略、商品" v-model="formModifyAD.adPage" maxlength="20" style="width: 70%; margin-right: 20px;"
-								clearable @clear="clearSelectClass"></el-input>
+								readonly="" @clear="clearSelectClass"></el-input>
 							<el-dropdown @command="handleCommand" style="cursor: pointer;">
 								<span class="el-dropdown-link">
 									{{ formModifyAD.adSelectClass }}<i class="el-icon-arrow-down el-icon--right"></i>
@@ -201,7 +204,7 @@
 					</el-form-item>
 					<el-form-item :label="formAD.adSelectClass" prop="adPage" v-if="formAD.checkedTypes == 2" :required="formAD.checkedTypes == 2">
 						<div id="panel" style="width: 100%;">
-							<el-input placeholder="请选择民宿、优惠券、攻略、商品" v-model="formAD.adPage" maxlength="20" style="width: 70%; margin-right: 20px;" clearable
+							<el-input placeholder="请选择民宿、优惠券、攻略、商品" v-model="formAD.adPage" maxlength="20" style="width: 70%; margin-right: 20px;" readonly=""
 								@clear="clearSelectClass"></el-input>
 							<el-dropdown @command="handleCommand" style="cursor: pointer;">
 								<span class="el-dropdown-link">
@@ -233,9 +236,6 @@
 		<el-dialog width="1200px" style="height: 760px;" title="民宿" :visible.sync="minsuVisible" append-to-body :close-on-click-modal="false"
 			:close-on-press-escape="false">
 			<div style="display: flex; justify-content: space-around;">
-				<div>
-					<el-button type="primary" class="btn-search" @click="select_minsu_OK">确定</el-button>
-				</div>
 				<el-form :inline="true" :model="minsuFormInline" class="demo-form-inline">
 					<el-form-item label="民宿名称">
 						<el-input v-model="minsuFormInline.adminName" style="width: 200px;" prefix-icon="el-icon-search" clearable
@@ -245,6 +245,9 @@
 						<el-button type="primary" class="btn-search" @click="minsu_btn_search">查询</el-button>
 					</el-form-item>
 				</el-form>
+				<div>
+					<el-button type="primary" class="btn-search" @click="select_minsu_OK">确定</el-button>
+				</div>
 			</div>
 			<el-table ref="multipleTable" id="minsu_table" :data="minsuTableData" height="396" style="width: 100%" :cell-style="cell_style"
 				v-loading="minsuLoading" :header-cell-style="header_cell_style" @selection-change="minsuSelectionChange">
@@ -298,26 +301,26 @@
 		<el-dialog width="1200px" style="height: 760px;" title="优惠券/代金券" :visible.sync="youhuiquanVisible" append-to-body :close-on-click-modal="false"
 			:close-on-press-escape="false">
 			<div style="display: flex; justify-content: space-around;">
-				<div>
-					<el-button type="primary" class="btn-search" @click="select_youhuiquan_OK">确定</el-button>
-				</div>
 				<el-form :inline="true" :model="youhuiquanFormInline" class="demo-form-inline">
 					<el-form-item label="名称">
 						<el-input v-model="youhuiquanFormInline.title" style="width: 200px;" prefix-icon="el-icon-search" clearable
 							placeholder="请输入优惠券名称"></el-input>
 					</el-form-item>
-					<el-form-item label="发放时间">
+					<!-- <el-form-item label="发放时间">
 						<el-date-picker v-model="youhuiquanFormInline.search_datatime" type="daterange" align="right" start-placeholder="开始日期"
 							end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd">
-						</el-date-picker>
+						</el-date-picker> -->
 					</el-form-item>
 					<el-form-item>
 						<el-button type="primary" class="btn-search" @click="youhuiquan_btn_search">查询</el-button>
 					</el-form-item>
 				</el-form>
+				<div>
+					<el-button type="primary" class="btn-search" @click="select_youhuiquan_OK">确定</el-button>
+				</div>
 			</div>
-			<el-table ref="multipleTable" id="youhuiquan_table" :data="youhuiquanTableData" height="396" style="width: 100%" :cell-style="cell_style" v-loading="youhuiquanLoading"
-				:header-cell-style="header_cell_style" @selection-change="youhuiquanSelectionChange">
+			<el-table ref="multipleTable" id="youhuiquan_table" :data="youhuiquanTableData" height="396" style="width: 100%" :cell-style="cell_style"
+				v-loading="youhuiquanLoading" :header-cell-style="header_cell_style" @selection-change="youhuiquanSelectionChange">
 				<el-table-column type="selection" width="50" :selectable="youhuiquanIsSelectable">
 				</el-table-column>
 				<el-table-column label="序号" align="center" fixed width="70">
@@ -362,12 +365,7 @@
 		<!-- 攻略(推文) -->
 		<el-dialog width="1300px" style="height: 860px;" title="攻略(推文)" :visible.sync="gonglueVisible" append-to-body :close-on-click-modal="false"
 			:close-on-press-escape="false">
-			<div style="display: flex; justify-content: space-around;">
-				<div style="display: flex; justify-content: space-between; align-items: center;">
-					<el-checkbox v-model="gonglue_index_page" :disabled="!(gonglueSelectedRow === null || gonglueSelectedRow === row)"
-						style="margin-right: 10px;">攻略首页</el-checkbox>
-					<el-button type="primary" class="btn-search" @click="select_gonglue_OK">确定</el-button>
-				</div>
+			<div style="display: flex; justify-content: space-around; align-items: flex-start;">
 				<el-form :inline="true" :model="gonglueFormInline" class="demo-form-inline">
 					<el-form-item label="标题或发布人">
 						<el-input v-model="gonglueFormInline.title" style="width: 200px;" prefix-icon="el-icon-search" clearable
@@ -382,9 +380,14 @@
 						<el-button type="primary" class="btn-search" @click="gonglue_btn_search">查询</el-button>
 					</el-form-item>
 				</el-form>
+				<div style="display: flex; justify-content: space-between; align-items: center;">
+					<el-checkbox v-model="gonglue_index_page" :disabled="!(gonglueSelectedRow === null || gonglueSelectedRow === row)"
+						style="margin-right: 10px;">攻略首页</el-checkbox>
+					<el-button type="primary" class="btn-search" @click="select_gonglue_OK">确定</el-button>
+				</div>
 			</div>
-			<el-table ref="multipleTable" id="gonglue_table" :data="gonglueTableData" height="500" style="width: 100%" :cell-style="cell_style" v-loading="gonglueLoading"
-				:header-cell-style="header_cell_style" @selection-change="gonglueSelectionChange">
+			<el-table ref="multipleTable" id="gonglue_table" :data="gonglueTableData" height="500" style="width: 100%" :cell-style="cell_style"
+				v-loading="gonglueLoading" :header-cell-style="header_cell_style" @selection-change="gonglueSelectionChange">
 				<el-table-column type="selection" width="50" :selectable="gonglueIsSelectable">
 				</el-table-column>
 				<el-table-column label="序号" align="center" fixed width="70">
@@ -409,23 +412,23 @@
 				<el-table-column label="图片" align="center" width="280px">
 					<template slot-scope="scope">
 						<div v-if="typeof scope.row.urls != 'string'">
-							<viewer :images="viewerImage.gonglue_imgs">
-								<div id="showImgVideo" v-if="typeof scope.row.urls !== 'string'">
-									<div v-if="scope.row.urls[0].split(',')[0].endsWith('.jpg') || scope.row.urls[0].split(',')[0].endsWith('.png')"
-										style="cursor: pointer;">
+							<div id="showImgVideo" v-if="typeof scope.row.urls !== 'string'">
+								<div v-if="scope.row.urls[0].split(',')[0].endsWith('.jpg') || scope.row.urls[0].split(',')[0].endsWith('.png')"
+									style="cursor: pointer;">
+									<viewer :images="viewerImage.gonglue_imgs">
 										<el-carousel indicator-position="inside" :interval="4000">
 											<el-carousel-item v-for="(url, index) in scope.row.urls[0].split(',')" :key="index">
 												<img :src="url" style="height: 180px;">
 											</el-carousel-item>
 										</el-carousel>
-									</div>
-									<div v-else-if="scope.row.urls[0].split(',')[0].endsWith('.mp4')">
-										<video controls style="height: 180px; width: 100%;">
-											<source :src="scope.row.urls[0].split(',')[0]" type="video/mp4">
-										</video>
-									</div>
+									</viewer>
 								</div>
-							</viewer>
+								<div v-else-if="scope.row.urls[0].split(',')[0].endsWith('.mp4')">
+									<video controls style="height: 180px; width: 100%;">
+										<source :src="scope.row.urls[0].split(',')[0]" type="video/mp4">
+									</video>
+								</div>
+							</div>
 						</div>
 					</template>
 				</el-table-column>
@@ -449,12 +452,7 @@
 		<!-- 商品 -->
 		<el-dialog width="1300px" style="height: 860px;" title="商品" :visible.sync="shangpinVisible" append-to-body :close-on-click-modal="false"
 			:close-on-press-escape="false">
-			<div style="display: flex; justify-content: space-around;">
-				<div style="display: flex; justify-content: space-between; align-items: center;">
-					<el-checkbox v-model="shangpin_index_page" :disabled="!(shangpinSelectedRow === null || shangpinSelectedRow === row)"
-						style="margin-right: 10px;">商品首页</el-checkbox>
-					<el-button type="primary" class="btn-search" @click="select_shangpin_OK">确定</el-button>
-				</div>
+			<div style="display: flex; justify-content: space-around; align-items: flex-start;">
 				<el-form :inline="true" :model="shangpinFormInline" class="demo-form-inline">
 					<el-form-item label="商品名称">
 						<el-input v-model="shangpinFormInline.key" style="width: 200px;" prefix-icon="el-icon-search" clearable placeholder="商品名称"></el-input>
@@ -463,9 +461,14 @@
 						<el-button type="primary" class="btn-search" @click="shangpin_btn_search">查询</el-button>
 					</el-form-item>
 				</el-form>
+				<div style="display: flex; justify-content: space-between; align-items: center;">
+					<el-checkbox v-model="shangpin_index_page" :disabled="!(shangpinSelectedRow === null || shangpinSelectedRow === row)"
+						style="margin-right: 10px;">商品首页</el-checkbox>
+					<el-button type="primary" class="btn-search" @click="select_shangpin_OK">确定</el-button>
+				</div>
 			</div>
-			<el-table ref="multipleTable" id="shangpin_table" :data="shangpinTableData" height="500" style="width: 100%" :cell-style="cell_style" v-loading="shangpinLoading"
-				:header-cell-style="header_cell_style" @selection-change="shangpinSelectionChange">
+			<el-table ref="multipleTable" id="shangpin_table" :data="shangpinTableData" height="500" style="width: 100%" :cell-style="cell_style"
+				v-loading="shangpinLoading" :header-cell-style="header_cell_style" @selection-change="shangpinSelectionChange">
 				<el-table-column type="selection" width="50" :selectable="shangpinIsSelectable">
 				</el-table-column>
 				<el-table-column label="序号" align="center" width="70">
@@ -712,6 +715,7 @@
 					url2: require('../../icons/images/ad/yuan.png'), // LOGO样式图片:圆形
 					showImageUrl: '', // 预览图片
 					logoStyle: '', // 样式的值
+					logoStyleValue: '', // 样式的值
 					checkedTypes: 1, // 跳转类型
 					adStatus: true, // 广告状态
 					adOrder: 1, // 排序
@@ -729,6 +733,7 @@
 					url2: require('../../icons/images/ad/yuan.png'), // LOGO样式图片:圆形
 					showImageUrl: '', // 预览图片
 					logoStyle: '', // 样式的值
+					logoStyleValue: '', // 样式的值
 					checkedTypes: 1, // 跳转类型
 					adStatus: true, // 广告状态
 					adOrder: 1, // 排序
@@ -1118,10 +1123,6 @@
 					rows: this.youhuiquanPagination.pageSize
 				}
 
-				if (this.youhuiquanFormInline.search_datatime !== '') {
-					data.search_datatime = this.youhuiquanFormInline.search_datatime
-				}
-
 				if (this.youhuiquanFormInline.title !== '') {
 					data.title = this.youhuiquanFormInline.title
 				}
@@ -1418,7 +1419,7 @@
 			},
 			// 重置修改广告参数
 			resetModifyADForm() {
-				this.formAD = {
+				this.formModifyAD = {
 					id: '', // id
 					adTitle: '', // 广告标题
 					imageUrl: '', // 上传成功的图片
@@ -1432,6 +1433,7 @@
 					adOrder: 1, // 排序
 					adLink: '', // 网页链接
 					adPage: '', // 小程序页面
+					adPageId: '', // 页面id
 					jumpDirection: '', // 跳转产品,值有:民宿、优惠券、攻略、商品
 					adSelectClass: '请选择'
 				};
@@ -1478,6 +1480,7 @@
 					adOrder: 1, // 排序
 					adLink: '', // 网页链接
 					adPage: '', // 小程序页面
+					adPageId: '', // 页面id
 					jumpDirection: '', // 跳转产品,值有:民宿、优惠券、攻略、商品
 					adSelectClass: '请选择'
 				};
@@ -1996,20 +1999,20 @@
 	#showImgVideo {
 		height: 180px;
 	}
-	
+
 	#minsu_table table:first-child tr:first-child th:first-child {
 		pointer-events: none;
 	}
-	
-	#youhuiquan_table  table:first-child tr:first-child th:first-child {
+
+	#youhuiquan_table table:first-child tr:first-child th:first-child {
 		pointer-events: none;
 	}
-	
-	#gonglue_table  table:first-child tr:first-child th:first-child {
+
+	#gonglue_table table:first-child tr:first-child th:first-child {
 		pointer-events: none;
 	}
-	
-	#shangpin_table  table:first-child tr:first-child th:first-child {
+
+	#shangpin_table table:first-child tr:first-child th:first-child {
 		pointer-events: none;
 	}
 </style>