|
|
@@ -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
|
|
|
+ })
|
|
|
+}
|