Browse Source

广告阶段性提交

soft5566 2 years ago
parent
commit
7b612baafe

+ 1 - 0
package.json

@@ -26,6 +26,7 @@
 		"echarts": "^5.4.3",
 		"element-ui": "2.13.2",
 		"js-cookie": "2.2.0",
+		"moment": "^2.30.1",
 		"normalize.css": "7.0.0",
 		"nprogress": "0.2.0",
 		"path-to-regexp": "2.4.0",

+ 154 - 0
src/api/adMgr.js

@@ -0,0 +1,154 @@
+import request from '@/utils/request'
+
+// 获取表格分页数据
+export function getTableData(forData) {
+	let data = ''
+	data += '?page=' + forData.page + '&rows=' + forData.rows
+
+	if (typeof forData.status !== 'undefined') {
+		data += '&state=' + forData.status
+	}
+	if (typeof forData.title !== 'undefined') {
+		data += '&title=' + forData.title
+	}
+	if (forData.search_datatime !== undefined && forData.search_datatime !== null) {
+		data += '&startTime=' + forData.search_datatime[0]
+		data += '&endTime=' + forData.search_datatime[1]
+	}
+
+	return request({
+		url: '/mhotel/advertiselistPage.action' + data,
+		method: 'get',
+		data
+	})
+}
+
+// 添加广告
+export function addAD(forData) {
+	console.log(forData);
+	let data = {};
+	if (typeof forData.adTitle !== 'undefined') {
+		data.title = forData.adTitle
+	}
+	if (typeof forData.imageUrl !== 'undefined') {
+		data.imageUrl = forData.imageUrl
+	}
+	if (typeof forData.logoStyle !== 'undefined') {
+		data.logoUrl = forData.logoStyle
+	}
+	if (typeof forData.checkedTypes !== 'undefined') {
+		if (forData.checkedTypes == 1) {
+			data.jumpWay = '网页'
+			data.jumpDirection = forData.adLink
+			data.jumpPoint = forData.adLink
+		} else if (forData.checkedTypes == 2) {
+			data.jumpWay = '小程序'
+			data.jumpDirection = forData.jumpDirection
+			data.jumpPoint = forData.adPageId
+		} else {
+			data.jumpWay = '不跳转'
+			data.jumpDirection = '无'
+			data.jumpPoint = ''
+		}
+	}
+	if (typeof forData.adStatus !== 'undefined') {
+		if (forData.adStatus == true) {
+			data.state = 1
+		} else{
+			data.state = 0
+		}
+	}
+	if (typeof forData.adOrder !== 'undefined') {
+		data.sortLevel = forData.adOrder
+	}
+	console.log(data);
+	// return
+	return request({
+		url: '/mhotel/advertiseinsert.action',
+		method: 'post',
+		data
+	})
+}
+
+// 删除广告
+export function delAD(id) {
+	let param = '';
+	if (typeof id !== 'undefined') {
+		param = '?id=' + id
+	}
+	
+	return request({
+		url: '/mhotel/advertisedel.action' + param,
+		method: 'get',
+	})
+}
+
+// 获取民宿列表数据
+export function getMinsuTableData(forData) {
+	let query = '?page=' + forData.page + '&rows=' + forData.rows
+
+	if (typeof forData.adminName !== 'undefined') {
+		query += '&adminName=' + forData.adminName
+	}
+
+	return request({
+		url: '/mhotel/managerAdminqueryPage.action' + query,
+		method: 'get'
+	});
+};
+
+// 优惠券列表
+export function getYouhuiquanTableData(forData) {
+	let data = ''
+	data += '?page=' + forData.page + '&rows=' + forData.rows + '&status=1'
+
+	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,
+		method: 'get',
+		data
+	})
+}
+
+// 攻略(推文)列表
+export function getGonglueTableData(forData) {
+	let data = ''
+	data += '?page=' + forData.page + '&rows=' + forData.rows
+
+	if (typeof forData.title !== 'undefined') {
+		data += '&key=' + forData.title
+	}
+	if (forData.search_datatime !== undefined && forData.search_datatime !== null) {
+		data += '&startTime=' + forData.search_datatime[0]
+		data += '&endTime=' + forData.search_datatime[1]
+	}
+
+	return request({
+		url: '/mhotel/articlewalkthroughPage.action' + data,
+		method: 'get',
+		data
+	})
+}
+
+// 商品列表
+export function getShangpinTableData(forData) {
+	let data = ''
+	data += '?page=' + forData.page + '&rows=' + forData.rows
+
+	if (typeof forData.key !== 'undefined') {
+		data += '&key=' + forData.key
+	}
+
+	return request({
+		url: '/mhotel/articleproductPage.action' + data,
+		method: 'get',
+		data
+	})
+}

BIN
src/icons/images/ad/fang.jpg


BIN
src/icons/images/ad/yuan.png


File diff suppressed because it is too large
+ 1 - 0
src/icons/svg/ad.svg


+ 18 - 2
src/router/index.js

@@ -37,6 +37,22 @@ export const constantRoutes = [{
 	},
 
 	{
+		path: '/ad',
+		component: Layout,
+		redirect: '/ad',
+		children: [{
+			path: '',
+			name: 'Ad',
+			component: () => import('@/views/ad/index'),
+			meta: {
+				roles: ['admin', 'superAdmin'],
+				title: '广告管理',
+				icon: 'ad'
+			}
+		}]
+	},
+
+	{
 		path: '/',
 		component: Layout,
 		redirect: '/data',
@@ -51,7 +67,7 @@ export const constantRoutes = [{
 			}
 		}]
 	},
-
+	
 	{
 		path: '/stdbookMgr',
 		component: Layout,
@@ -101,7 +117,7 @@ export const constantRoutes = [{
 	},
 	
 	{
-		path: '/businessInfo;',
+		path: '/businessInfo',
 		component: Layout,
 		redirect: '/businessInfo',
 		children: [{

File diff suppressed because it is too large
+ 1887 - 0
src/views/ad/index.vue


+ 1 - 1
src/views/perimeterMgr/index.vue

@@ -1290,7 +1290,7 @@
 								that.dialogAddVisible = false
 								that.$message.success('周边添加成功!')
 							} else {
-								that.$message.err(res.message)
+								that.$message.error(res.message)
 							}
 						})
 					}