浏览代码

fix 当事人保存/评分计算 bug

xieyunhui 4 年之前
父节点
当前提交
a60ca068e7

+ 13 - 13
App.vue

@@ -10,20 +10,20 @@
 			// 	});
 			// }
 			// console.log(uni.getSystemInfoSync());
-			// const {platform,windowWidth} = uni.getSystemInfoSync();
-			// if (platform === 'android'&&windowWidth>768){
-			// 	//pad下锁死竖屏适配布局
-			// 	// #ifdef APP-PLUS
-			// 	   plus.screen.lockOrientation('portrait-primary');
-			// 	// #endif
-			// }
-			
-			if (uni.getSystemInfoSync().platform === 'android'){
-			                //pad下锁死竖屏适配布局
-			                // #ifdef APP-PLUS
-			                   plus.screen.lockOrientation('portrait-primary');
-			                // #endif
+			const {platform,windowWidth} = uni.getSystemInfoSync();
+			if (platform === 'android'&&windowWidth>400){
+				//pad下锁死竖屏适配布局
+				// #ifdef APP-PLUS
+				   plus.screen.lockOrientation('portrait-primary');
+				// #endif
 			}
+			console.log(uni.getSystemInfoSync());
+			// if (uni.getSystemInfoSync().platform === 'android'){
+			//                 //pad下锁死竖屏适配布局
+			//                 // #ifdef APP-PLUS
+			//                    plus.screen.lockOrientation('portrait-primary');
+			//                 // #endif
+			// }
 			
 			
 			

+ 4 - 3
components/app-update/app-update.vue

@@ -196,7 +196,8 @@
 							vm.update_ing = true;
 							break;
 						case 3: // 已接收到数据  
-							vm.downloadedSize = task.downloadedSize;
+							vm.downloadedSize = task.downloadedSize;
+							console.log(task.downloadedSize);
 							let totalSize = 0;
 							if (task.totalSize) {
 								totalSize = task.totalSize //服务器须返回正确的content-length才会有长度
@@ -326,7 +327,7 @@
 
 	.uodate-content {
 		color: #333;
-		font-size: 18px;
+		font-size: 22rpx;
 		padding: 0px 50rpx;
 		margin-top: 80rpx;
 		/*#ifndef APP-NVUE*/
@@ -337,7 +338,7 @@
 	.current-version {
 		text-align: center;
 		margin-top: 10rpx;
-		font-size: 24rpx;
+		font-size: 20rpx;
 		color: #666;
 		/*#ifndef APP-NVUE*/
 		z-index: 1;

+ 88 - 40
components/index-list/index-list.vue

@@ -1,9 +1,10 @@
 <template>
 	<view class="container">
-		<!-- <view class="indexPosition">
-			<view class="activeKey" v-for="(item,index) in keyList"  @click="activeKeyHandle(item)">{{item}}
+		<view class="indexPosition">
+			<view :class="[currentKey==item.name?'activeKey on':'activeKey']" v-for="(item,index) in keyList"  @click="activeKeyHandle(item.name)">{{item.name}}
 			</view>
-		</view> -->
+		</view>
+		<view v-if="ifShowKeyTip" :animation="animationData" class="pop">{{tipText}}</view>
 		<scroll-view scroll-y="true" class="scroll-Y" :scroll-top="top" scroll-with-animation="true" @scroll="scroll">
 			<view :class="[`box ${item.letter}`]" v-for="item in options">
 				<view class="letter">{{item.letter}}</view>
@@ -34,10 +35,13 @@
 				checkedList: [],
 				checkedListIds: [],
 				isSelectAll: false,
-				keyList: [
-					'A', 'B', 'C', 'D'
-				],
-				top:0
+				keyList: [],
+				top:0,
+				scrollTop:0,
+				currentKey:'',
+				animationData:{},
+				tipText:'',
+				ifShowKeyTip:false
 			};
 		},
 		computed: {
@@ -51,46 +55,68 @@
 					this.checkedList = JSON.parse(JSON.stringify(newVal));
 					this.$emit("listClick", this.checkedList);
 				}
-
 			},
 			options:function(){
-			    this.checkedList=[];
-				this.checkedListIds = JSON.parse(JSON.stringify(this.checkedResponsibleList)).map(item => item.id);
-				this.checkedList = JSON.parse(JSON.stringify(this.checkedResponsibleList));
-			}
+				this.initKeyIndex();
+	            this.top=0;
+			 //    this.checkedList=[];
+				// this.checkedListIds = JSON.parse(JSON.stringify(this.checkedResponsibleList)).map(item => item.id);
+				// this.checkedList = JSON.parse(JSON.stringify(this.checkedResponsibleList));
+			},
 		},
 		mounted() {
 			this.checkedListIds = JSON.parse(JSON.stringify(this.checkedResponsibleList)).map(item => item.id);
-			this.checkedList = JSON.parse(JSON.stringify(this.checkedResponsibleList));
-			// console.log(this.checkedListIds);
+			this.checkedList = JSON.parse(JSON.stringify(this.checkedResponsibleList));
+			this.initKeyIndex();
 		},
 		methods: {
+			showKeyTip(){
+				 var animation = uni.createAnimation({
+				       duration: 1000,
+				         timingFunction: 'ease',
+				     })
+				 
+				     this.animation = animation
+				 
+				     animation.opacity(1).step();
+					 this.animationData = animation.export();
+			},
+			initKeyIndex(){
+				this.keyList = [];
+				this.currentKey='';
+				this.options.map(item=>{
+					  // console.log('item.letter',item.letter);
+					  if(!item.letter)return null;
+					  this.getDescBox(`.${item.letter}`).then(res=>{
+						    // console.log(res);
+						    this.keyList.push({
+								name:item.letter,
+								num:res
+							});
+					  })
+					  
+				});
+			},
 			scroll(event){
 				const {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} = event.detail;
-				console.log({scrollTop});
+				this.scrollTop = scrollTop;
+				// console.log(this.keyList);
+				const tempArr = this.keyList.filter(item=>scrollTop>=item.num-90);
+				const needArr = tempArr.pop();
+				// console.log({tempArr});
+				this.currentKey = needArr?needArr.name:'';
 			},
-			activeKeyHandle(key) {
+			activeKeyHandle(key) {
+				this.ifShowKeyTip=true;
+				this.tipText = key.toUpperCase();
 				this.getDescBox(`.${key.toLowerCase()}`).then(res=>{
-					   console.log({res});
-					   console.log(`.${key.toLowerCase()}`);
-					   if(!res||res-80<=0||res == this.top-80)return;
-					   this.top = res-80;
-					   
-					   // let timer = setInterval(()=>{
-						  //    this.top = this.top + 500;
-							 // if(this.top >=res-100 ){
-								//  clearInterval(timer);
-							 // }
-					   // },60);
-					   // uni.pageScrollTo({
-					   //     duration:500, // 毫秒
-					   // 	  scrollTop:100, // 位置
-						  //  complete:()=>{
-							 //   console.log('done');
-						  //  }
-					   // });
-
-				});
+					   // console.log({res});
+					   // console.log(`.${key.toLowerCase()}`);
+					   if(!res||Math.abs(res)-90<=0||res == this.top-90)return;
+					   this.top = Math.abs(res+this.scrollTop-90);
+				});
+				this.showKeyTip();
+				setTimeout(()=>this.ifShowKeyTip = false,1000);
 			},
 			// 获取元素距离顶部的高度
 			getDescBox(className) {
@@ -155,20 +181,42 @@
 			align-items: center;
 			position: absolute;
 			z-index: 10;
-			right: 0;
+			right: 12.5rpx;
 			width: 50rpx;
 			height: 100%;
-			background-color: red;
 
 			.activeKey {
 				display: flex;
 				justify-content: center;
 				align-items: center;
 				flex: 1;
-				width: 100%;
+				width: 100%;
+				font-size: 17.5rpx;
+				font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+				font-weight: 400;
+				color: #7B8599;
+				
+				&.on {
+					color: #3377FF;
+				}
 			}
 		}
-
+        .pop {
+			position: fixed;
+			z-index: 100;
+			left:50%;
+			top:50%;
+			width: 125rpx;
+			height: 125rpx;
+			margin-left: -62.5rpx;
+			margin-top: -62.5rpx;
+			text-align: center;
+			line-height:125rpx;
+			font-size: 35rpx;
+			color: #FFFFFF;
+			border-radius: 50%;
+			background: rgba(0,0,0,0.6);
+		}
 		.scroll-Y {
 
 			height: 100%;

+ 1 - 1
manifest.json

@@ -2,7 +2,7 @@
     "name" : "追踪方法学",
     "appid" : "__UNI__03C4C69",
     "description" : "",
-    "versionName" : "0.6.5",
+    "versionName" : "0.6.4",
     "versionCode" : 100,
     "transformPx" : false,
     "app-plus" : {

+ 1 - 1
pages.json

@@ -198,7 +198,7 @@
         }
     ],
 	"globalStyle": {
-		"navigationStyle": "custom",
+		"navigationStyle": "default",
 		"autoBackButton": true,
 		// "homeButton": true,
 		"navigationBarTextStyle": "black",

+ 8 - 7
pages/checkMainPoints/checkMainPoints.vue

@@ -147,17 +147,18 @@
 			
 		},
 		onShow: function() {	
-			
-			if(this.ifFromChildPage){
+			const {checkMainPoints:{ifUpdate}} = this.$store.state;
+			console.log({ifUpdate});
+			if(ifUpdate){
 				//页面重新拉取数据
 				this.checkTaskDetailList({
 					'deptId':this.deptId,
 					'checkId':this.checkId
 				});
-				uni.pageScrollTo({
-				    scrollTop: this.currentScrollHeight,
-				    duration: 300
-				});
+				// uni.pageScrollTo({
+				//     scrollTop: this.currentScrollHeight,
+				//     duration: 300
+				// });
 			}
 		},
 		beforeDestroy(){
@@ -229,7 +230,7 @@
 					deptId
 				}).then((data) => {
 					if (data) {
-						// console.log({data});
+						console.log({data});
 						const nowPermission = JSON.parse(uni.getStorageSync('nowPermission'));
 						console.log({nowPermission});
 						this.$store.commit('checkMainPoints/comChangeState',{key:'detailList',data:data.checkDetailMapResponses});

+ 1 - 0
pages/checkMainPoints/model.js

@@ -6,6 +6,7 @@ export default {
      // 查核列表
      checkList: [],
 	 detailList:[],//查核项集合
+	 ifUpdate:false,
   },
   mutations: {
 		comChangeState(state, {key, data}) {

+ 4 - 3
pages/mainPointsDetail/mainPointsDetail.vue

@@ -507,7 +507,7 @@ export default {
 				   main:item,
 				   id:parseInt(tempResponsibleUserId[index])
 			  }));
-			  console.log({arr});
+			  // console.log({arr});
 			  this.$store.commit('responsibleList/updateCheckedResponsibleList',arr);
 		  }else{
 			  this.checkedResponsibleList = [];
@@ -515,7 +515,7 @@ export default {
 		  }
 		  
           if (res) {
-			console.log({res});
+			// console.log({res});
             this.data = res;			
             if (res && res.lastResult == "不适用") {
               // this.lastIndex = 1;
@@ -717,10 +717,11 @@ export default {
 					 console.log('改善条件为false');
 				}
               }
-			  console.log('w');
+
 			  if(key=='back'){
 				  //点完成时返回
 				  console.log('开始返回');
+				  this.$store.commit('checkMainPoints/comChangeState',{'key':'ifUpdate','data':true});
 				  _goBackFresh('pages/checkMainPoints/checkMainPoints');
 			  }
 			  // _goBackFresh('pages/checkMainPoints/checkMainPoints');

+ 6 - 5
pages/responsibleList/responsibleList.vue

@@ -138,12 +138,14 @@
 					this.checkedResponsibleListTemp_dept = checkedList;
 				}
 				
-				console.log(this.currentTabIndex,this.checkedResponsibleListTemp_all,this.checkedResponsibleListTemp_dept)
+				// console.log(this.currentTabIndex,this.checkedResponsibleListTemp_all,this.checkedResponsibleListTemp_dept)
 				
 			},
 			sureCheck(){
+	
 				const responsibleUserIds = this.currentTabIndex == 0?this.checkedResponsibleListTemp_all.map(item=>item.id):this.checkedResponsibleListTemp_dept.map(item=>item.id);
 				const responsibleUserNames = this.currentTabIndex == 0?this.checkedResponsibleListTemp_all.map(item=>item.main):this.checkedResponsibleListTemp_dept.map(item=>item.main);
+				// console.log(this.currentTabIndex,this.checkedResponsibleListTemp_all,this.checkedResponsibleListTemp_dept)
 				// console.log({responsibleUserIds,responsibleUserNames});
 				// return;
 				if(this.isFromCheckMainPoints){
@@ -157,8 +159,7 @@
 					}
 					const tempCheckIds = detailListFlat(detailList,0);
 					const checkIds = tempCheckIds.map(item=>item.id);
-					console.log({tempCheckIds});
-				
+					
 					this.$store.dispatch({
 					    type: "responsibleList/commActions",
 					    payload: {
@@ -230,7 +231,7 @@
 		flex-direction: column;
 		.top {   position: relative;
 		         z-index: 10;
-				 height: 200rpx;
+				 height:170rpx;
 				 padding: 0 25rpx;
 				 padding-top: 18.75rpx;
 				 background-color: #FFFFFF;
@@ -296,7 +297,7 @@
 				 }
 		}
 		.content {
-				 flex-grow: 1;
+				 flex: 1;
 				 overflow: hidden;
 		}
 		.bottom {

+ 5 - 2
pages/situationDetail/situationDetail.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="detail-page">
+	<view :class="[isAdmin?'detail-page isAdmin':'detail-page']">
 		<tm-top-menu v-if="isAdmin">
 			<button class="copy-btn" @click="editSituation('POST')">复制创建</button>
 		</tm-top-menu>
@@ -265,7 +265,6 @@
 <style lang="less">
 	.detail-page{
 		position: relative;
-		padding-top: 50rpx;
 		height: 100%;
 		.copy-btn {
 			border: 0;
@@ -274,6 +273,10 @@
 				border: 0;
 			}
 		}
+		
+		&.isadmin {
+			padding-top: 50rpx;
+		}
 		.content-info{
 			background-color: #FFFFFF;
 			.top-box{

+ 4 - 4
utils/compatible.js

@@ -17,19 +17,19 @@ export const _stopPropagation = (e) => {
 /* 
    在需要回退刷新的页面配置ifFromChildPage
  */
-export const _goBackFresh = (pathName)=>{
+export const _goBackFresh = (pathName,bool)=>{
 	const pages = getCurrentPages();
 	const reversed = pages.reverse();
 	const currentPageIndex = 0;
-	console.log({reversed,pages});
+	// console.log({reversed,pages});
 
 	if(true){
 		pages.some((item,index)=>{
 			  // console.log('循环');
-			  console.log({item});
+			  // console.log({item});
 			  if(item.route == pathName){
 				  let needdelta =index-currentPageIndex;
-				  console.log({needdelta,index,currentPageIndex});
+				  // console.log({needdelta,index,currentPageIndex});
 				  //通知返回目标页面刷新数据
 				  item.ifFromChildPage=true;
 				  uni.navigateBack({

+ 3 - 0
utils/request.js

@@ -45,6 +45,7 @@ function creatRequest(obj, data) {
 function request(url, options, additional) {
   if (additional.needLoading === undefined) additional.needLoading = true;
   // 加载中提示打开
+  // console.log({url, options, additional});
   openCloseLoading(additional, true);
   // 模拟token,做登录的同学将这行代码移到登录成功函数中.
 
@@ -73,6 +74,7 @@ function request(url, options, additional) {
 
 // 加载中提示打开/关闭
 function openCloseLoading(additional, isOpen) {
+  console.log({additional, isOpen});
   if (additional.needLoading) {
     if (isOpen) { // 打开(如果已经打开不必重复打开)
       if (AllRequestNum === 0)
@@ -108,6 +110,7 @@ function LoginExpired(msg) {
 }
 
 function notifyException(resArr, additional) {
+console.log('openCloseLoading');
   openCloseLoading(additional, false);
   const [error, res] = resArr;
   if (error) {