|
@@ -0,0 +1,171 @@
|
|
|
|
|
+import request from "@/utils/request";
|
|
|
|
|
+
|
|
|
|
|
+// 获取表格分页数据
|
|
|
|
|
+export function getCampTableData(forData) {
|
|
|
|
|
+ let data = new FormData();
|
|
|
|
|
+ if (typeof forData.page !== "undefined") {
|
|
|
|
|
+ data.append("page", forData.page);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (typeof forData.rows !== "undefined") {
|
|
|
|
|
+ data.append("rows", forData.rows);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (typeof forData.key !== "undefined") {
|
|
|
|
|
+ data.append("keyWord", forData.key);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (typeof forData.townId !== "undefined") {
|
|
|
|
|
+ data.append("townId", forData.townId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return request({
|
|
|
|
|
+ url: "/mhotel/raftlistPage.action",
|
|
|
|
|
+ method: "post",
|
|
|
|
|
+ data,
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 置顶攻略
|
|
|
|
|
+export function setCampTop(id, istop) {
|
|
|
|
|
+ // let data = {}
|
|
|
|
|
+ // if (typeof id !== 'undefined') {
|
|
|
|
|
+ // data.id = id
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (typeof istop !== 'undefined') {
|
|
|
|
|
+ // data.isTop = istop
|
|
|
|
|
+ // }
|
|
|
|
|
+ let data = new FormData();
|
|
|
|
|
+ if (typeof id !== "undefined") {
|
|
|
|
|
+ data.append("id", id);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (typeof istop !== "undefined") {
|
|
|
|
|
+ data.append("isTop", istop);
|
|
|
|
|
+ }
|
|
|
|
|
+ return request({
|
|
|
|
|
+ url: "/mhotel/raftupdateTopStatus.action",
|
|
|
|
|
+ method: "post",
|
|
|
|
|
+ data,
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 添加营地
|
|
|
|
|
+export function insertCampStrategy(forData) {
|
|
|
|
|
+ let data = {};
|
|
|
|
|
+ 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.post_video !== "undefined" && forData.post_video !== "") {
|
|
|
|
|
+ data.video = forData.post_video;
|
|
|
|
|
+ }
|
|
|
|
|
+ // if (typeof forData.hotelIds !== 'undefined' && forData.hotelIds !== '') {
|
|
|
|
|
+ // data.hotelIds = forData.hotelIds
|
|
|
|
|
+ // }
|
|
|
|
|
+ if (typeof forData.rtownId !== "undefined" && forData.rtownId !== "") {
|
|
|
|
|
+ data.locationId = forData.rtownId;
|
|
|
|
|
+ }
|
|
|
|
|
+ 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;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(data, "营地新增参数");
|
|
|
|
|
+
|
|
|
|
|
+ return request({
|
|
|
|
|
+ url: "/mhotel/raftinsert.action",
|
|
|
|
|
+ method: "post",
|
|
|
|
|
+ data,
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 上传文件
|
|
|
|
|
+export function uploadFiles(file) {
|
|
|
|
|
+ let data = new FormData();
|
|
|
|
|
+ if (typeof file !== "undefined") {
|
|
|
|
|
+ data.append("files", file);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return request({
|
|
|
|
|
+ url: "/file/cos/upload",
|
|
|
|
|
+ method: "post",
|
|
|
|
|
+ data,
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 修改攻略
|
|
|
|
|
+export function updateCampStrategy(forData) {
|
|
|
|
|
+ let data = {};
|
|
|
|
|
+ if (typeof forData.id !== "undefined" && forData.id !== "") {
|
|
|
|
|
+ data.id = forData.id;
|
|
|
|
|
+ }
|
|
|
|
|
+ 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.post_video !== "undefined" && forData.post_video !== "") {
|
|
|
|
|
+ data.video = forData.post_video;
|
|
|
|
|
+ }
|
|
|
|
|
+ // if (typeof forData.hotelIds !== "undefined" && forData.hotelIds !== "") {
|
|
|
|
|
+ // data.hotelIds = forData.hotelIds;
|
|
|
|
|
+ // }
|
|
|
|
|
+ if (typeof forData.rtownId !== "undefined" && forData.rtownId !== "") {
|
|
|
|
|
+ data.locationId = forData.rtownId;
|
|
|
|
|
+ }
|
|
|
|
|
+ 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;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(data,"修改营地参数");
|
|
|
|
|
+
|
|
|
|
|
+ return request({
|
|
|
|
|
+ url: "/mhotel/raftupdate.action",
|
|
|
|
|
+ method: "post",
|
|
|
|
|
+ data,
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 删除攻略
|
|
|
|
|
+export function delCampStrategy(id) {
|
|
|
|
|
+ // let data = {};
|
|
|
|
|
+ // if (typeof id !== "undefined" && id != "") {
|
|
|
|
|
+ // data.id = id;
|
|
|
|
|
+ // }
|
|
|
|
|
+ let data = new FormData();
|
|
|
|
|
+ if (typeof id !== "undefined" && id != "") {
|
|
|
|
|
+ data.append("id", id);
|
|
|
|
|
+ }
|
|
|
|
|
+ return request({
|
|
|
|
|
+ url: "/mhotel/raftdel.action",
|
|
|
|
|
+ method: "post",
|
|
|
|
|
+ data,
|
|
|
|
|
+ });
|
|
|
|
|
+}
|