|
|
@@ -20,6 +20,19 @@ export function getTableData(forData) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// 获取发布人
|
|
|
+export function getPublisher() {
|
|
|
+ let data = new FormData()
|
|
|
+ data.append('page', 1)
|
|
|
+ data.append('rows', 10000)
|
|
|
+
|
|
|
+ return request({
|
|
|
+ url: '/mhotel/articlegetUserContactList.action',
|
|
|
+ method: 'post',
|
|
|
+ data
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// 置顶攻略
|
|
|
export function setTop(id, istop) {
|
|
|
let data = {}
|
|
|
@@ -29,7 +42,7 @@ export function setTop(id, istop) {
|
|
|
if (typeof istop !== 'undefined') {
|
|
|
data.isTop = istop
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return request({
|
|
|
url: '/mhotel/articletopArticle.action',
|
|
|
method: 'post',
|
|
|
@@ -37,46 +50,63 @@ export function setTop(id, istop) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// 获取乡镇
|
|
|
+export function getTown() {
|
|
|
+ return request({
|
|
|
+ url: '/mhotel/articletownShips.action',
|
|
|
+ method: 'get'
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 获取民宿
|
|
|
+export function getHotels(townId) {
|
|
|
+ var queryString = '?townId=' + townId + '&page=&rows=';
|
|
|
+
|
|
|
+ return request({
|
|
|
+ url: '/mhotel/articlehotelByid.action' + queryString,
|
|
|
+ method: 'get'
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// 添加攻略
|
|
|
-export function appinsertArounds(forData) {
|
|
|
+export function insertStrategy(forData) {
|
|
|
let data = {}
|
|
|
- if (typeof forData.rtype !== 'undefined' && forData.rtype !== '') {
|
|
|
- data.rtype = forData.rtype
|
|
|
- }
|
|
|
- if (typeof forData.rtown !== 'undefined' && forData.rtown !== '') {
|
|
|
- data.rtown = forData.rtown
|
|
|
- }
|
|
|
- if (typeof forData.rname !== 'undefined' && forData.rname !== '') {
|
|
|
- data.rname = forData.rname
|
|
|
- }
|
|
|
- if (typeof forData.rphone !== 'undefined' && forData.rphone !== '') {
|
|
|
- data.rphone = forData.rphone
|
|
|
+ if (typeof forData.title !== 'undefined' && forData.title !== '') {
|
|
|
+ data.title = forData.title
|
|
|
+ }
|
|
|
+ if (typeof forData.content !== 'undefined' && forData.content !== '') {
|
|
|
+ data.content = forData.content
|
|
|
+ }
|
|
|
+ if (typeof forData.imgs !== 'undefined' && forData.imgs.length !== 0) {
|
|
|
+ data.images = []
|
|
|
+ for (let i = 0; i < forData.imgs.length; i++) {
|
|
|
+ if (forData.imgs[i].img != '') {
|
|
|
+ data.images.push(forData.imgs[i].img);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- if (typeof forData.radress !== 'undefined' && forData.radress !== '') {
|
|
|
- data.radress = forData.radress
|
|
|
+ if (typeof forData.post_video !== 'undefined' && forData.post_video !== '') {
|
|
|
+ data.video = forData.post_video
|
|
|
}
|
|
|
- if (typeof forData.detail !== 'undefined' && forData.detail !== '') {
|
|
|
- data.detail = forData.detail
|
|
|
+ if (typeof forData.hotelIds !== 'undefined' && forData.hotelIds !== '') {
|
|
|
+ data.hotelIds = forData.hotelIds
|
|
|
}
|
|
|
- if (typeof forData.first_img !== 'undefined' && forData.first_img !== '') {
|
|
|
- data.first_img = forData.first_img
|
|
|
+ if (typeof forData.rtownId !== 'undefined' && forData.rtownId !== '') {
|
|
|
+ data.townId = forData.rtownId
|
|
|
}
|
|
|
- if (typeof forData.post_video !== 'undefined' && forData.post_video !== '') {
|
|
|
- data.show_video = forData.post_video
|
|
|
+ if (typeof forData.create_id !== 'undefined' && forData.create_id !== '') {
|
|
|
+ data.createId = forData.create_id
|
|
|
}
|
|
|
- if (typeof forData.detail_img !== 'undefined' && forData.detail_img !== '' && forData.detail_img.length > 0) {
|
|
|
- var tmpStr = ''
|
|
|
- for (var i = 0; i < forData.detail_img.length; i++) {
|
|
|
- tmpStr += forData.detail_img[i] + ','
|
|
|
+ if (typeof forData.istop !== 'undefined' && forData.istop !== '') {
|
|
|
+ if (forData.istop == true) {
|
|
|
+ data.isTop = 1
|
|
|
+ } else {
|
|
|
+ data.isTop = 0
|
|
|
}
|
|
|
- data.detail_img = tmpStr.substring(0, tmpStr.length - 1)
|
|
|
}
|
|
|
- if (typeof forData.jingwei !== 'undefined' && forData.jingwei !== '') {
|
|
|
- data.jingwei = forData.jingwei
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
return request({
|
|
|
- url: '/mhotel/appinsertArounds.action',
|
|
|
+ url: '/mhotel/articleinsertArticleTweetMana.action',
|
|
|
method: 'post',
|
|
|
data
|
|
|
})
|
|
|
@@ -88,7 +118,7 @@ export function uploadFiles(file) {
|
|
|
if (typeof file !== 'undefined') {
|
|
|
data.append('files', file)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return request({
|
|
|
url: '/file/cos/upload',
|
|
|
method: 'post',
|
|
|
@@ -96,49 +126,82 @@ export function uploadFiles(file) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-// 修改攻略
|
|
|
-export function appupdateArounds(forData) {
|
|
|
+// 修改攻略-增加附件
|
|
|
+export function addImgOrVideo(formData) {
|
|
|
let data = {}
|
|
|
if (typeof forData.id !== 'undefined' && forData.id !== '') {
|
|
|
data.id = forData.id
|
|
|
}
|
|
|
- if (typeof forData.rtype !== 'undefined' && forData.rtype !== '') {
|
|
|
- data.rtype = forData.rtype
|
|
|
+ if (typeof forData.img !== 'undefined' && forData.img !== '') {
|
|
|
+ data.images = forData.img
|
|
|
}
|
|
|
- if (typeof forData.rtown !== 'undefined' && forData.rtown !== '') {
|
|
|
- data.rtown = forData.rtown
|
|
|
+ if (typeof forData.video !== 'undefined' && forData.video !== '') {
|
|
|
+ data.video = forData.video
|
|
|
}
|
|
|
- if (typeof forData.rname !== 'undefined' && forData.rname !== '') {
|
|
|
- data.rname = forData.rname
|
|
|
+
|
|
|
+ return request({
|
|
|
+ url: '/mhotel/articleaddFile.action',
|
|
|
+ method: 'post',
|
|
|
+ data
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 修改攻略-删除附件
|
|
|
+export function delImgOrVideo(formData) {
|
|
|
+ let data = {}
|
|
|
+ if (typeof forData.id !== 'undefined' && forData.id !== '') {
|
|
|
+ data.id = forData.id
|
|
|
}
|
|
|
- if (typeof forData.rphone !== 'undefined' && forData.rphone !== '') {
|
|
|
- data.rphone = forData.rphone
|
|
|
+
|
|
|
+ return request({
|
|
|
+ url: '/mhotel/articledelFile.action',
|
|
|
+ method: 'post',
|
|
|
+ data
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 修改攻略
|
|
|
+export function updateStrategy(forData) {
|
|
|
+ let data = {}
|
|
|
+ if (typeof forData.id !== 'undefined' && forData.id !== '') {
|
|
|
+ data.id = forData.id
|
|
|
}
|
|
|
- if (typeof forData.radress !== 'undefined' && forData.radress !== '') {
|
|
|
- data.radress = forData.radress
|
|
|
+ if (typeof forData.title !== 'undefined' && forData.title !== '') {
|
|
|
+ data.title = forData.title
|
|
|
}
|
|
|
- if (typeof forData.detail !== 'undefined' && forData.detail !== '') {
|
|
|
- data.detail = forData.detail
|
|
|
+ if (typeof forData.content !== 'undefined' && forData.content !== '') {
|
|
|
+ data.content = forData.content
|
|
|
}
|
|
|
- if (typeof forData.first_img !== 'undefined' && forData.first_img !== '') {
|
|
|
- data.first_img = forData.first_img
|
|
|
+ if (typeof forData.imgs !== 'undefined' && forData.imgs.length !== 0) {
|
|
|
+ data.images = []
|
|
|
+ for (let i = 0; i < forData.imgs.length; i++) {
|
|
|
+ if (forData.imgs[i].img != '') {
|
|
|
+ data.images.push(forData.imgs[i].img);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
if (typeof forData.post_video !== 'undefined' && forData.post_video !== '') {
|
|
|
- data.show_video = forData.post_video
|
|
|
+ data.video = forData.post_video
|
|
|
}
|
|
|
- if (typeof forData.detail_img !== 'undefined' && forData.detail_img !== '' && forData.detail_img.length > 0) {
|
|
|
- var tmpStr = ''
|
|
|
- for (var i = 0; i < forData.detail_img.length; i++) {
|
|
|
- tmpStr += forData.detail_img[i] + ','
|
|
|
- }
|
|
|
- data.detail_img = tmpStr.substring(0, tmpStr.length - 1)
|
|
|
+ if (typeof forData.hotelIds !== 'undefined' && forData.hotelIds !== '') {
|
|
|
+ data.hotelIds = forData.hotelIds
|
|
|
+ }
|
|
|
+ if (typeof forData.rtownId !== 'undefined' && forData.rtownId !== '') {
|
|
|
+ data.townId = forData.rtownId
|
|
|
}
|
|
|
- if (typeof forData.jingwei !== 'undefined' && forData.jingwei !== '') {
|
|
|
- data.jingwei = forData.jingwei
|
|
|
+ if (typeof forData.create_id !== 'undefined' && forData.create_id !== '') {
|
|
|
+ data.createId = forData.create_id
|
|
|
+ }
|
|
|
+ if (typeof forData.istop !== 'undefined' && forData.istop !== '') {
|
|
|
+ if (forData.istop == true) {
|
|
|
+ data.isTop = 1
|
|
|
+ } else {
|
|
|
+ data.isTop = 0
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return request({
|
|
|
- url: '/mhotel/appupdateArounds.action',
|
|
|
+ url: '/mhotel/articleupdateArticleTweetMana.action',
|
|
|
method: 'post',
|
|
|
data
|
|
|
})
|
|
|
@@ -146,10 +209,10 @@ export function appupdateArounds(forData) {
|
|
|
|
|
|
|
|
|
// 删除攻略
|
|
|
-export function delArticle(id) {
|
|
|
- let data = new FormData()
|
|
|
- if (typeof id !== 'undefined' && forData != '') {
|
|
|
- data.append('id', forData)
|
|
|
+export function delStrategy(id) {
|
|
|
+ let data = {};
|
|
|
+ if (typeof id !== 'undefined' && id != '') {
|
|
|
+ data.id = id;
|
|
|
}
|
|
|
|
|
|
return request({
|
|
|
@@ -157,4 +220,4 @@ export function delArticle(id) {
|
|
|
method: 'post',
|
|
|
data
|
|
|
})
|
|
|
-}
|
|
|
+}
|