Browse Source

微信模板消息,及其他修正

wgl 4 years ago
parent
commit
06b3be532f

+ 5 - 2
src/projects/business/apis/Master/health.js

@@ -5,9 +5,12 @@ import Qs from 'qs';
 //疫情上报
 export function report(params) {
 	return request({
-		url: '/mobile/messageReportApi/add',
-		data: Qs.stringify(params),
+		url: '/mobile/epidemicReportApi/add',
+		data: params,
 		method: 'post',
+		headers: {
+		    "Content-Type": "application/json"
+		}
 	})
 }
 

+ 43 - 10
src/projects/business/main.js

@@ -3,6 +3,8 @@ import App from './App.vue'
 import router from './router'
 import store from '$project/store'
 
+import * as API_User from '$project/apis/user'
+
 //引入mui
 import mui from '$project/assets/js/mui.js'
 import '$project/assets/css/mui.min.css'
@@ -46,9 +48,24 @@ import Viewer from 'v-viewer'
 import 'viewerjs/dist/viewer.css'
 Vue.use(Viewer)
 Viewer.setDefaults({
-	Options: { "inline": true, "button": true, "navbar": false, "title": true, "toolbar": false, "tooltip": true, "movable": true, "zoomable": true, "rotatable": true, "scalable": true, "transition": true, "fullscreen": true, "keyboard": true, "url": "data-source" }
+	Options: {
+		"inline": true,
+		"button": true,
+		"navbar": false,
+		"title": true,
+		"toolbar": false,
+		"tooltip": true,
+		"movable": true,
+		"zoomable": true,
+		"rotatable": true,
+		"scalable": true,
+		"transition": true,
+		"fullscreen": true,
+		"keyboard": true,
+		"url": "data-source"
+	}
 });
-  
+
 //获取纯权限路由数组,由函数每次获取
 function getFunList() {
 	let funList = [];
@@ -69,14 +86,7 @@ function getFunList() {
 }
 //console.log(funList)
 
-
-router.beforeEach((to, from, next) => {
-	if (to.query.test) {
-		if (to.query.test == 'test') {
-			let vConsole = new Vconsole()
-		}
-	}
-
+const auth = (to, from, next) => {
 	if (to.meta != null && to.meta.requireAuth) {
 		if (store.state.person_data) {
 
@@ -105,6 +115,29 @@ router.beforeEach((to, from, next) => {
 	} else {
 		next();
 	}
+}
+
+
+router.beforeEach((to, from, next) => {
+	if (to.query.test) {
+		if (to.query.test == 'test') {
+			let vConsole = new Vconsole()
+		}
+	}
+
+	//切换当前场景
+	if (to.query.exchange == '1' && to.query.role_id) {
+		API_User.exchangePopedom({
+			id: to.query.role_id
+		}).then(response => {
+			auth(to, from, next)
+		}).catch(error => {
+			mui.toast(error);
+		})
+	} else {
+		auth(to, from, next)
+	}
+
 })
 
 new Vue({

+ 2 - 4
src/projects/business/views/Master/Health/ReportInfo.vue

@@ -21,7 +21,7 @@
 					<div class="mui-input-row padd10">
 						<label>上报内容</label>
 						<span class="vongi-span vongi-meform-pho" v-text="detail.content"></span>
-						<span class="vongi-span vongi-wordcard vongi-meform-pho">
+						<span v-if="detail.img" class="vongi-span vongi-wordcard vongi-meform-pho">
 							<div class="fyy-upphoto flew">
 								<div v-for="(item,index) in detail.img.split(',')" class="mui-col-xs-3">
 									<img :src="item" />
@@ -90,10 +90,8 @@
 				this.id = id || this.id;
 				this.isLoading = true;
 				API_Health.getReportInfo(this.id).then(response => {
-
-					this.detail = response;
-
 					this.isLoading = false;
+					this.detail = response;
 				}).catch(error => {
 					this.isLoading = false;
 					mui.toast(error);

+ 1 - 1
src/projects/business/views/Master/Health/ReportList.vue

@@ -11,7 +11,7 @@
 						<div class="mui-media-body">
 							{{item.content}}
 						</div>
-						<span class="vongi-wordcard">
+						<span class="vongi-wordcard" v-if="item.img">
 							<div class="fyy-upphoto flew">
 								<div v-for="(iten,inden) in item.img.split(',')" class="mui-col-xs-3">
 									<img :src="iten" />

+ 23 - 8
src/projects/pension/main.js

@@ -61,14 +61,7 @@ function getFunList() {
 }
 //console.log(funList)
 
-
-router.beforeEach((to, from, next) => {
-	if (to.query.test) {
-		if (to.query.test == 'test') {
-			let vConsole = new Vconsole()
-		}
-	}
-
+const auth = (to, from, next) => {
 	if (to.meta != null && to.meta.requireAuth) {
 		if (store.state.person_data) {
 
@@ -97,6 +90,28 @@ router.beforeEach((to, from, next) => {
 	} else {
 		next();
 	}
+}
+
+router.beforeEach((to, from, next) => {
+	if (to.query.test) {
+		if (to.query.test == 'test') {
+			let vConsole = new Vconsole()
+		}
+	}
+
+	//切换当前场景
+	if (to.query.exchange == '1' && to.query.role_id) {
+		API_User.exchangePopedom({
+			id: to.query.role_id
+		}).then(response => {
+			auth(to, from, next)
+		}).catch(error => {
+			mui.toast(error);
+		})
+	} else {
+		auth(to, from, next)
+	}
+
 })
 
 new Vue({

+ 4 - 2
src/projects/pension/views/Master/Health/Archives.vue

@@ -54,7 +54,7 @@
 					</div>
 				</li>
 				<li class="mui-table-view-cell mui-col-xs-12">
-					<div class="vongi-color-block block-green" @click="goToInfo({name:'MasterHealthChartMap',query:{type:'lbs',title:'活动轨迹',day:healthData.lbs.time.substr(0,10)}})">
+					<div class="vongi-color-block block-green" @click="goToInfo({name:'MasterHealthChartMap',query:{type:'lbs',title:'活动轨迹',day:healthData.lbs.time?healthData.lbs.time.substr(0,10):''}})">
 						<span class="vongi-color-unit"></span>
 						<div class="mui-h1" v-text="address"></div>
 						<div class="mui-media-body">定位</div>
@@ -105,6 +105,7 @@
 					temperature: {},
 					time: {}
 				},
+				backResult: {},
 
 				address: '暂无',
 			}
@@ -119,6 +120,7 @@
 
 					if (JSON.stringify(response) != "{}" && response) {
 						this.healthData = response;
+						this.backResult = response;
 						if (response.lbs.value) {
 							let lbsArr = response.lbs.value.split(',');
 							//获取定位地址
@@ -160,7 +162,7 @@
 			},
 			//点击获取详情
 			goToInfo(obj) {
-				if (JSON.stringify(this.healthData) != "{}") {
+				if (JSON.stringify(this.backResult) != "{}") {
 					this.$router.push(obj);
 				}
 			},