Переглянути джерело

新增溯溪营地模块(未发布)

hzj18279462576@163.com 2 місяців тому
батько
коміт
0e2eb3ad1e
6 змінених файлів з 5605 додано та 2073 видалено
  1. 2 1
      .env.production
  2. 171 0
      src/api/rapidCamp.js
  3. 21 5
      src/router/index.js
  4. 2737 0
      src/views/rapidCamp/index.vue
  5. 2668 2063
      src/views/strategyMgr/index.vue
  6. 6 4
      vue.config.js

+ 2 - 1
.env.production

@@ -2,4 +2,5 @@
 ENV = 'production'
 
 # base api
-VUE_APP_BASE_API = 'https://www.jinganrenjiams.com/hotelReservation'
+# VUE_APP_BASE_API = 'https://www.jinganrenjiams.com/hotelReservation'
+VUE_APP_BASE_API = 'http://192.168.161.111:8088'

+ 171 - 0
src/api/rapidCamp.js

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

+ 21 - 5
src/router/index.js

@@ -67,7 +67,7 @@ export const constantRoutes = [{
 			}
 		}]
 	},
-	
+
 	{
 		path: '/stdbookMgr',
 		component: Layout,
@@ -99,7 +99,23 @@ export const constantRoutes = [{
 			}
 		}]
 	},
-	
+
+  {
+		path: '/rapidCamp',
+		component: Layout,
+		redirect: '/rapidCamp',
+		children: [{
+			path: '',
+			name: 'rapidCamp',
+			component: () => import('@/views/rapidCamp/index'),
+			meta: {
+				roles: ['superAdmin'],
+				title: '溯溪营地',
+				icon: 'strategy'
+			}
+		}]
+	},
+
 	{
 		path: '/strategyMgr',
 		component: Layout,
@@ -115,7 +131,7 @@ export const constantRoutes = [{
 			}
 		}]
 	},
-	
+
 	{
 		path: '/perimeterMgr',
 		component: Layout,
@@ -131,7 +147,7 @@ export const constantRoutes = [{
 			}
 		}]
 	},
-	
+
 	{
 		path: '/businessInfo',
 		component: Layout,
@@ -237,4 +253,4 @@ export function resetRouter() {
 	router.matcher = newRouter.matcher // reset router
 }
 
-export default router
+export default router

Різницю між файлами не показано, бо вона завелика
+ 2737 - 0
src/views/rapidCamp/index.vue


Різницю між файлами не показано, бо вона завелика
+ 2668 - 2063
src/views/strategyMgr/index.vue


+ 6 - 4
vue.config.js

@@ -13,7 +13,7 @@ const name = defaultSettings.title || '靖安乡村民宿管理平台' // page t
 // For example, Mac: sudo npm run
 // You can change the port by the following methods:
 // port = 9528 npm run dev OR npm run dev --port = 9528
-const port = process.env.port || process.env.npm_config_port || 9528 // dev port
+const port = process.env.port || process.env.npm_config_port || 8080 // dev port
 
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
@@ -38,14 +38,16 @@ module.exports = {
 		},
 		proxy: {
 			['^' + process.env.VUE_APP_BASE_API]: {
-				target: 'https://www.jinganrenjiams.com/hotelReservation',
+				// target: 'https://www.jinganrenjiams.com/hotelReservation',
+				target: 'http://192.168.161.111:8088',
 				changeOrigin: true,
 				pathRewrite: {
 					['^' + process.env.VUE_APP_BASE_API]: ''
 				}
 			},
 			['^' + process.env.VUE_APP_BASE_FILE]: { // 图片上传
-				target: 'https://www.jinganrenjiams.com/hotelReservation',
+				// target: 'https://www.jinganrenjiams.com/hotelReservation',
+				target: 'http://192.168.161.111:8088',
 				// target: 'https://www.jinganrenjiams.com/hotelReservation/fileload',
 				changeOrigin: true,
 				pathRewrite: {
@@ -135,4 +137,4 @@ module.exports = {
 				}
 			)
 	}
-}
+}