Browse Source

新增页面

bobo04052021@163.com 1 year ago
parent
commit
54c0ec168f
7 changed files with 391 additions and 535 deletions
  1. 124 130
      common/router/modules/routes.js
  2. 1 1
      common/service/service.js
  3. 46 60
      main.js
  4. 216 191
      pages.json
  5. 4 3
      pages/home/home.vue
  6. 0 55
      pages/test1/firstmodel.vue
  7. 0 95
      pages/test1/test1.vue

+ 124 - 130
common/router/modules/routes.js

@@ -1,131 +1,125 @@
 const routes = [
-	{
-	 path: "/pages/login/login",
-	 name: 'login',
-		 meta: {
-			 title: '登录',
-		 },
-	},
-	{
-        //注意:path必须跟pages.json中的地址对应,最前面别忘了加'/'哦
-      path: '/pages/index/index',
-      name: 'index',
-        meta: {
-	        title: '主页',
-	    },
-    },
-	{
-	    //注意:path必须跟pages.json中的地址对应,最前面别忘了加'/'哦
-	  path: '/pages/home/home',
-	  //aliasPath:'/',  //对于h5端你必须在首页加上aliasPath并设置为/
-	  name: 'home',
-	    meta: {
-	        title: '首页',
-	    },
-	},
-	{
-	  path: '/pages/test1/test1',
-	  name: 'test1',
-	    meta: {
-	        title: '测试1',
-	    },
-	},
-    {
-	    path: '/pages/user/people',
-        name: 'people',
-        meta: {
-	        title: '个人中心',
-	    },
-	},
-	{
-	    path: '/pages/user/userdetail',
-	    name: 'userdetail',
-	    meta: {
-	        title: '个人详情',
-	    },
-	},
-	{
-	    path: '/pages/user/useredit',
-	    name: 'useredit',
-	    meta: {
-	        title: '个人编辑',
-	    },
-	},
-	{
-	    path: '/pages/user/userexit',
-	    name: 'userexit',
-	    meta: {
-	        title: '退出',
-	    },
-	},
-	{
-	    path: '/pages/user/location',
-	    name: 'location',
-	    meta: {
-	        title: '定位',
-	    },
-	},
-	{
-	    path: '/pages/common/exit',
-	    name: 'exit',
-	    meta: {
-	        title: '退出',
-	    },
-	},
-	{
-	    path: '/pages/common/success',
-	    name: 'success',
-	    meta: {
-	        title: 'success',
-	    },
-	},{
-	  path: '/pages/addressbook/address-book',
-	  name: 'addressBook',
-	    meta: {
-	        title: 'addressBook',
-	    },
-	},
-	{
-	  path: '/pages/addressbook/level-address-book',
-	  name: 'levelAddressBook',
-	    meta: {
-	        title: 'levelAddressBook',
-	    },
-	},
-	{
-	  path: '/pages/addressbook/member',
-	  name: 'member',
-	    meta: {
-	        title: 'member',
-	    },
-	},
-	{
-	  path: '/pages/addressbook/address-detail',
-	  name: 'addressDetail',
-	    meta: {
-	        title: 'addressDetail',
-	    },
-	},
-	{
-	    path: '/pages/annotation/annotationList',
-	    name: 'annotationList',
-	    meta: {
-	        title: '通知公告',
-	    },
-	},
-	{
-	    path: '/pages/annotation/annotationDetail',
-	    name: 'annotationDetail',
-	    meta: {
-	        title: '通知详情',
-	    },
-	},
-	{
-	    path: '/pages/common/helloWorld',
-	    name: 'helloWorld',
-	    meta: {
-	        title: 'helloWorld',
-	    },
-	},
-]
-export default routes
+  {
+    path: "/pages/login/login",
+    name: "login",
+    meta: {
+      title: "登录",
+    },
+  },
+  {
+    //注意:path必须跟pages.json中的地址对应,最前面别忘了加'/'哦
+    path: "/pages/index/index",
+    name: "index",
+    meta: {
+      title: "主页",
+    },
+  },
+  {
+    //注意:path必须跟pages.json中的地址对应,最前面别忘了加'/'哦
+    path: "/pages/home/home",
+    //aliasPath:'/',  //对于h5端你必须在首页加上aliasPath并设置为/
+    name: "home",
+    meta: {
+      title: "首页",
+    },
+  },
+  {
+    path: "/pages/user/people",
+    name: "people",
+    meta: {
+      title: "个人中心",
+    },
+  },
+  {
+    path: "/pages/user/userdetail",
+    name: "userdetail",
+    meta: {
+      title: "个人详情",
+    },
+  },
+  {
+    path: "/pages/user/useredit",
+    name: "useredit",
+    meta: {
+      title: "个人编辑",
+    },
+  },
+  {
+    path: "/pages/user/userexit",
+    name: "userexit",
+    meta: {
+      title: "退出",
+    },
+  },
+  {
+    path: "/pages/user/location",
+    name: "location",
+    meta: {
+      title: "定位",
+    },
+  },
+  {
+    path: "/pages/common/exit",
+    name: "exit",
+    meta: {
+      title: "退出",
+    },
+  },
+  {
+    path: "/pages/common/success",
+    name: "success",
+    meta: {
+      title: "success",
+    },
+  },
+  {
+    path: "/pages/addressbook/address-book",
+    name: "addressBook",
+    meta: {
+      title: "addressBook",
+    },
+  },
+  {
+    path: "/pages/addressbook/level-address-book",
+    name: "levelAddressBook",
+    meta: {
+      title: "levelAddressBook",
+    },
+  },
+  {
+    path: "/pages/addressbook/member",
+    name: "member",
+    meta: {
+      title: "member",
+    },
+  },
+  {
+    path: "/pages/addressbook/address-detail",
+    name: "addressDetail",
+    meta: {
+      title: "addressDetail",
+    },
+  },
+  {
+    path: "/pages/annotation/annotationList",
+    name: "annotationList",
+    meta: {
+      title: "通知公告",
+    },
+  },
+  {
+    path: "/pages/annotation/annotationDetail",
+    name: "annotationDetail",
+    meta: {
+      title: "通知详情",
+    },
+  },
+  {
+    path: "/pages/common/helloWorld",
+    name: "helloWorld",
+    meta: {
+      title: "helloWorld",
+    },
+  },
+];
+export default routes;

+ 1 - 1
common/service/service.js

@@ -9,7 +9,7 @@ let apiUrl = configService.apiUrl;
 const getTokenStorage = () => {
 	let token = ''
 	try{
-		token = uni.getStorageSync(ACCESS_TOKEN)
+		token = uni.getStorageSync('token')
 	}catch(e){
 		//TODO handle the exception
 		console.log("getTokenStorage",token)

+ 46 - 60
main.js

@@ -1,92 +1,78 @@
-import Vue from 'vue'
-import App from './App'
-import store from './store'
-import MinCache from'./common/util/MinCache.js'
-import tip from'./common/util/tip.js'
-import configService from'./common/service/config.service.js'
-import router from './common/router'
-import {RouterMount} from './plugin/uni-simple-router/index.js'
+import Vue from "vue";
+import App from "./App";
+import store from "./store";
+import MinCache from "./common/util/MinCache.js";
+import tip from "./common/util/tip.js";
+import configService from "./common/service/config.service.js";
+import router from "./common/router";
+import { RouterMount } from "./plugin/uni-simple-router/index.js";
 
 // 注册缓存器
-Vue.use(MinCache,{timeout: 6})
+Vue.use(MinCache, { timeout: 6 });
 
 // store
-Vue.prototype.$store=store;
+Vue.prototype.$store = store;
 // tip
-Vue.prototype.$tip=tip;
+Vue.prototype.$tip = tip;
 // config
-Vue.prototype.$config=configService;
+Vue.prototype.$config = configService;
 
 // request请求
-import { http } from '@/common/service/service.js' 
-Vue.prototype.$http = http
+import { http } from "@/common/service/service.js";
+Vue.prototype.$http = http;
 
-import home from './pages/home/home.vue'
-Vue.component('home',home)
+import home from "./pages/home/home.vue";
+Vue.component("home", home);
 
-import test1 from './pages/test1/test1.vue'
-Vue.component('test1',test1)
+import people from "./pages/user/people.vue";
+Vue.component("people", people);
 
-
-import people from './pages/user/people.vue'
-Vue.component('people',people)
-
-import camera from './pages/camera/camera.vue'
-Vue.component('camera',camera)
-import history from './pages/history/history.vue'
-Vue.component('history',history)
-import warndata from './pages/warndata/warndata.vue'
-Vue.component('warndata',warndata)
+import camera from "./pages/camera/camera.vue";
+Vue.component("camera", camera);
+import history from "./pages/history/history.vue";
+Vue.component("history", history);
+import warndata from "./pages/warndata/warndata.vue";
+Vue.component("warndata", warndata);
 // 自定义组件
-import mySelect from './components/my-componets/my-select.vue'
-Vue.component('mySelect',mySelect)
-
-import myImageUpload from './components/my-componets/my-image-upload.vue'
-Vue.component('myImageUpload',myImageUpload)
+import mySelect from "./components/my-componets/my-select.vue";
+Vue.component("mySelect", mySelect);
 
+import myImageUpload from "./components/my-componets/my-image-upload.vue";
+Vue.component("myImageUpload", myImageUpload);
 
-import myPage from './components/my-componets/my-page.vue'
-Vue.component('myPage',myPage)
+import myPage from "./components/my-componets/my-page.vue";
+Vue.component("myPage", myPage);
 
+import basics from "./pages/basics/home.vue";
+Vue.component("basics", basics);
 
+import components from "./pages/component/home.vue";
+Vue.component("components", components);
 
-import basics from './pages/basics/home.vue'
-Vue.component('basics',basics)
+import plugin from "./pages/plugin/home.vue";
+Vue.component("plugin", plugin);
 
-import components from './pages/component/home.vue'
-Vue.component('components',components)
-
-import plugin from './pages/plugin/home.vue'
-Vue.component('plugin',plugin)
-
-import cuCustom from './plugin/colorui/components/cu-custom.vue'
-Vue.component('cu-custom',cuCustom)
+import cuCustom from "./plugin/colorui/components/cu-custom.vue";
+Vue.component("cu-custom", cuCustom);
 
 // import VConsole from './js_sdk/vconsole.min'
 
 //   var vConsole = new VConsole();
 
-Vue.config.productionTip = false
+Vue.config.productionTip = false;
 
-App.mpType = 'app'
+App.mpType = "app";
 
 const app = new Vue({
-	store,
-	MinCache,
-    ...App
-})
+  store,
+  MinCache,
+  ...App,
+});
 //v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
 // #ifdef H5
-	RouterMount(app,'#app');
+RouterMount(app, "#app");
 // #endif
 
 // #ifndef H5
-	app.$mount(); //为了兼容小程序及app端必须这样写才有效果
+app.$mount(); //为了兼容小程序及app端必须这样写才有效果
 // #endif
-
-
-
- 
-
-
-

+ 216 - 191
pages.json

@@ -1,194 +1,219 @@
 {
-	"pages": [
-		//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
-		{
-			"path": "pages/index/index",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/layout",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/background",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/text",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/icon",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/button",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/design",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/tag",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/avatar",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/progress",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/shadow",
-			"style": {}
-		},
-		{
-			"path": "pages/basics/loading",
-			"style": {}
-		},
-		{
-			"path": "pages/component/bar",
-			"style": {}
-		},
-		{
-			"path": "pages/component/nav",
-			"style": {}
-		},
-		{
-			"path": "pages/component/list",
-			"style": {}
-		},
-		{
-			"path": "pages/component/card",
-			"style": {}
-		},
-		{
-			"path": "pages/component/form",
-			"style": {}
-		},
-		{
-			"path": "pages/component/timeline",
-			"style": {}
-		},
-		{
-			"path": "pages/component/chat",
-			"style": {}
-		},
-		{
-			"path": "pages/component/swiper",
-			"style": {}
-		},
-		{
-			"path": "pages/component/modal",
-			"style": {}
-		},
-		{
-			"path": "pages/component/steps",
-			"style": {}
-		}, 
-		{
-			"path": "pages/plugin/indexes",
-			"style": {}
-		},
-		{
-			"path": "pages/plugin/animation",
-			"style": {}
-		}, 
-		{
-			"path": "pages/plugin/drawer",
-			"style": {}
-		}, 
-		{
-			"path": "pages/plugin/verticalnav",
-			"style": {}
-		}, 
-		{
-			"path": "pages/home/home",
-			"style": {}
-		}, 
-		{
-			"path": "pages/login/login",
-			"style": {}
-		}, 
-		{
-			"path": "pages/user/userexit",
-			"style": {}
-		}, 
-		{
-			"path": "pages/user/userdetail",
-			"style": {}
-		},
-		{
-			"path": "pages/user/useredit",
-			"style": {}
-		},
-		{
-			"path": "pages/user/people",
-			"style": {}
-		},
-		{
-			"path": "pages/camera/camera",
-			"style": {}
-		},
-		{
-			"path": "pages/common/exit",
-			"style": {}
-		},
-		{
-			"path": "pages/common/success",
-			"style": {}
-		},
-		{
-			"path": "pages/addressbook/address-book",
-			"style": {}
-		},
-		{
-			"path": "pages/addressbook/level-address-book",
-			"style": {}
-		},
-		{
-			"path": "pages/addressbook/member",
-			"style": {}
-		},
-		{
-			"path": "pages/addressbook/address-detail",
-			"style": {}
-		},
-		{
-			"path": "pages/test1/test1",
-			"style": {}
-		},
-		{
-			"path": "pages/history/history",
-			"style": {}
-		},
-		{
-			"path": "pages/warndata/warndata",
-			"style": {}
-		}
+  "pages": [
+    //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+    {
+      "path": "pages/index/index",
+      "style": {}
+    },
+    {
+      "path": "pages/basics/layout",
+      "style": {}
+    },
+    {
+      "path": "pages/basics/background",
+      "style": {}
+    },
+    {
+      "path": "pages/basics/text",
+      "style": {}
+    },
+    {
+      "path": "pages/basics/icon",
+      "style": {}
+    },
+    {
+      "path": "pages/basics/button",
+      "style": {}
+    },
+    {
+      "path": "pages/basics/design",
+      "style": {}
+    },
+    {
+      "path": "pages/basics/tag",
+      "style": {}
+    },
+    {
+      "path": "pages/basics/avatar",
+      "style": {}
+    },
+    {
+      "path": "pages/basics/progress",
+      "style": {}
+    },
+    {
+      "path": "pages/basics/shadow",
+      "style": {}
+    },
+    {
+      "path": "pages/basics/loading",
+      "style": {}
+    },
+    {
+      "path": "pages/component/bar",
+      "style": {}
+    },
+    {
+      "path": "pages/component/nav",
+      "style": {}
+    },
+    {
+      "path": "pages/component/list",
+      "style": {}
+    },
+    {
+      "path": "pages/component/card",
+      "style": {}
+    },
+    {
+      "path": "pages/component/form",
+      "style": {}
+    },
+    {
+      "path": "pages/component/timeline",
+      "style": {}
+    },
+    {
+      "path": "pages/component/chat",
+      "style": {}
+    },
+    {
+      "path": "pages/component/swiper",
+      "style": {}
+    },
+    {
+      "path": "pages/component/modal",
+      "style": {}
+    },
+    {
+      "path": "pages/component/steps",
+      "style": {}
+    },
+    {
+      "path": "pages/plugin/indexes",
+      "style": {}
+    },
+    {
+      "path": "pages/plugin/animation",
+      "style": {}
+    },
+    {
+      "path": "pages/plugin/drawer",
+      "style": {}
+    },
+    {
+      "path": "pages/plugin/verticalnav",
+      "style": {}
+    },
+    {
+      "path": "pages/home/home",
+      "style": {}
+    },
+    {
+      "path": "pages/login/login",
+      "style": {}
+    },
+    {
+      "path": "pages/user/userexit",
+      "style": {}
+    },
+    {
+      "path": "pages/user/userdetail",
+      "style": {}
+    },
+    {
+      "path": "pages/user/useredit",
+      "style": {}
+    },
+    {
+      "path": "pages/user/people",
+      "style": {}
+    },
+    {
+      "path": "pages/camera/camera",
+      "style": {}
+    },
+    {
+      "path": "pages/common/exit",
+      "style": {}
+    },
+    {
+      "path": "pages/common/success",
+      "style": {}
+    },
+    {
+      "path": "pages/addressbook/address-book",
+      "style": {}
+    },
+    {
+      "path": "pages/addressbook/level-address-book",
+      "style": {}
+    },
+    {
+      "path": "pages/addressbook/member",
+      "style": {}
+    },
+    {
+      "path": "pages/addressbook/address-detail",
+      "style": {}
+    },
+    {
+      "path": "pages/history/history",
+      "style": {}
+    },
+    {
+      "path": "pages/warndata/warndata",
+      "style": {}
+    }
+      ,{
+            "path" : "pages/history/history",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/warndata/warndata",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/camera/camera",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
-	"globalStyle": {
-		"mp-alipay": {
-			/* 支付宝小程序特有相关 */
-			"transparentTitle": "always",
-			"allowsBounceVertical": "NO"
-		},
-		"navigationBarBackgroundColor": "#0081ff",
-		"navigationBarTitleText": "JEECG BOOT",
-		"navigationStyle": "custom",
-		"navigationBarTextStyle": "white"
-	},
-	"usingComponts": true,
-	"condition": { //模式配置,仅开发期间生效
-		"current": 0, //当前激活的模式(list 的索引项)
-		"list": [{
-			"name": "表单", //模式名称
-			"path": "pages/index/index", //启动页面
-			"query": "" //启动参数
-		}]
-	}
-
+  "globalStyle": {
+    "mp-alipay": {
+      /* 支付宝小程序特有相关 */
+      "transparentTitle": "always",
+      "allowsBounceVertical": "NO"
+    },
+    "navigationBarBackgroundColor": "#0081ff",
+    "navigationBarTitleText": "JEECG BOOT",
+    "navigationStyle": "custom",
+    "navigationBarTextStyle": "white"
+  },
+  "usingComponts": true,
+  "condition": {
+    //模式配置,仅开发期间生效
+    "current": 0, //当前激活的模式(list 的索引项)
+    "list": [
+      {
+        "name": "表单", //模式名称
+        "path": "pages/index/index", //启动页面
+        "query": "" //启动参数
+      }
+    ]
+  }
 }

+ 4 - 3
pages/home/home.vue

@@ -62,9 +62,10 @@
 				uni.request({
 					url:'http://182.92.126.35:9999/ventanaly-device/safety/ventanalyDeviceInfo/DeviceKind/queryBySystem',
 					method:'GET',
-					success:function(data){
-					console.log(data);
-					}
+					data:{},
+					success:res=>{
+						console.log('sssssssss');
+					},
 					})
 				}
 		},

+ 0 - 55
pages/test1/firstmodel.vue

@@ -1,55 +0,0 @@
-<template>
-	<view>
-		<cu-custom><block slot="content">导航栏</block></cu-custom>
-		<view  scroll-x class="bg-white nav">
-			<view class="flex text-center">
-				<view class="cu-item flex-sub" :class="index==TabCur?'text-orange cur':''" v-for="(item,index) in 4" :key="index" @tap="tabSelect" :data-id="index">
-					Tab{{index}}
-				</view>
-			</view>
-		</view>
-		<scroll-view scroll-x class="bg-white nav">
-			<view class="flex text-center">
-				<view class="cu-item flex-sub" :class="index==TabCur?'text-orange cur':''" v-for="(item,index) in 4" :key="index" @tap="tabSelect" :data-id="index">
-					Tab{{index}}
-				</view>
-			</view>
-		</scroll-view>
-		<view class="main">
-			<view class="card" v-for="(item,index) in 4" :key="index">
-				Tab{{index}}
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				TabCur: 0,
-				scrollLeft: 0
-			};
-		},
-		methods: {
-			tabSelect(e) {
-				this.TabCur = e.currentTarget.dataset.id;
-				this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
-			}
-		}
-	}
-</script>
-
-<style>
-	.main{
-		display: flex;
-		flex-direction: column;
-	}
-	.card{
-		margin: auto;
-		margin-top: 20rpx;
-		width: 90%;
-		height: 280rpx;
-		border:1rpx solid #000000;
-	}
-</style>

+ 0 - 95
pages/test1/test1.vue

@@ -1,95 +0,0 @@
-<template name="home">
-	<view>
-		    <!-- 其他页面内容 -->
-		<view v-if="currentTab === 0">
-		     <Firstmodel></Firstmodel>
-		</view>
-		<scroll-view>
-		</scroll-view>
-		<view class="cu-tabbar-height margin-top"></view>
-	</view>
-</template>
-
-<script>
-	import Firstmodel from './firstmodel.vue'
-	import { us,os } from '@/common/util/work.js'
-	import socket from '@/common/js-sdk/socket/socket.js'
-	import { mapActions } from "vuex"
-	export default {
-		components: {
-		    Firstmodel,
-		},
-		name: 'test1',
-		watch: {
-		},
-		data() {
-			return {
-				usList:us.data,
-				osList:os.data,
-				msgCount:0,
-				dot:{
-				  mailHome:false
-				},
-				currentTab: 0, // 当前选中的选项卡索引
-			}
-		},
-		methods: {
-			// 启动webSocket
-			onSocketOpen() {
-				socket.init('websocket');
-			},
-			onSocketReceive() {
-				var _this=this
-				socket.acceptMessage = function(res){
-					// console.log("页面收到的消息", res);
-					if(res.cmd == "topic"){
-					  //系统通知
-					  _this.loadCount('1')
-					}else if(res.cmd == "user"){
-					  //用户消息
-					  _this.loadCount('2')
-					} else if(res.cmd == 'email'){
-					 //邮件消息
-					  _this.loadEmailCount()
-					}
-				}
-			},
-			switchTab(index) {
-			      // 切换选项卡时触发的事件
-			      this.currentTab = index;
-			}
-		},
-		onLoad() {
-		}
-	}
-</script>
-
-<style scoped>
-	.cu-list.grid>.cu-item {
-	  padding: 0px 0px; 
-	}
-    .line2-icon {
-	  width: 60px;
-	  height: 60px;
-    }
-	.tab-bar {
-	  display: flex;
-	  justify-content: space-around;
-	  padding: 10px;
-	  background-color: #eee;
-	}
-	
-	.tab-bar view {
-	  flex: 1;
-	  text-align: center;
-	  padding: 10px;
-	  border-radius: 5px;
-	  cursor: pointer;
-	}
-	
-	.tab-bar view.active {
-	  background-color: #007BFF;
-	  color: #fff;
-	}
-	
-</style>