浏览代码

fix 当事人页面滚动

xieyunhui 4 年之前
父节点
当前提交
86b5c00848
共有 8 个文件被更改,包括 56 次插入47 次删除
  1. 二进制
      .DS_Store
  2. 1 1
      App.vue
  3. 7 4
      components/index-list/index-list.vue
  4. 1 1
      manifest.json
  5. 15 10
      pages/login/login.vue
  6. 5 9
      pages/mainPointsDetail/mainPointsDetail.vue
  7. 20 1
      pages/responsibleList/responsibleList.vue
  8. 7 21
      utils/request.js

二进制
.DS_Store


+ 1 - 1
App.vue

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

+ 7 - 4
components/index-list/index-list.vue

@@ -28,7 +28,8 @@
 		name: "index-list",
 		props: {
 			checkedResponsibleList: Array,
-			options: Array,
+			options: Array,
+			padding:Number,
 		},
 		data() {
 			return {
@@ -98,22 +99,24 @@
 				});
 			},
 			scroll(event){
+				const padding = this.padding;
 				const {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} = event.detail;
 				this.scrollTop = scrollTop;
 				// console.log(this.keyList);
-				const tempArr = this.keyList.filter(item=>scrollTop>=item.num-90);
+				const tempArr = this.keyList.filter(item=>scrollTop>=item.num-padding);
 				const needArr = tempArr.pop();
 				// console.log({tempArr});
 				this.currentKey = needArr?needArr.name:'';
 			},
 			activeKeyHandle(key) {
+				const padding = this.padding;
 				this.ifShowKeyTip=true;
 				this.tipText = key.toUpperCase();
 				this.getDescBox(`.${key.toLowerCase()}`).then(res=>{
 					   // 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);
+					   if(!res||Math.abs(res)-padding<=0||res == this.top - padding)return;
+					   this.top = Math.abs(res+this.scrollTop-padding);
 				});
 				this.showKeyTip();
 				setTimeout(()=>this.ifShowKeyTip = false,1000);

+ 1 - 1
manifest.json

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

+ 15 - 10
pages/login/login.vue

@@ -39,7 +39,7 @@
 		data() {
 			return {
 				index:0,
-				appHospSign:'tYAoFaa20yCAgaiy',//app端更新hospSign
+				appHospSign:'8CJYqxlGIdLEIwaG',//app端更新hospSign
 				showInputModal:false,
 				hospSign: '', // 医院标识
 				username: '', // 用户名
@@ -60,15 +60,20 @@
 			
 		},
 		mounted(){
-              // console.log('login mounted');
-			  // try {
-			  //     const value = uni.getStorageSync('hospSign');
-			  //     if (value) {
-			          
-			  //     }
-			  // } catch (e) {
-			  //     // error
-			  // }
+			const info = uni.getSystemInfoSync();
+			
+			// uni.showModal({
+			//     title: 'info',
+			//     content: JSON.stringify(info),
+			//     success: function (res) {
+			//         if (res.confirm) {
+			//             console.log('用户点击确定');
+			//         } else if (res.cancel) {
+			//             console.log('用户点击取消');
+			//         }
+			//     }
+			// });
+
 			  
 		},
 		methods: {

+ 5 - 9
pages/mainPointsDetail/mainPointsDetail.vue

@@ -254,9 +254,6 @@ export default {
   	this.checkedResponsibleList = responsibleList.checkedResponsibleList.map(item=>item.main);
   },
   computed:{
-	  // currentScore:function(){
-		 //   return (this.totalScore-this.selectedScore-this.checkItemScore).toFixed(2);
-	  // },
 	  currentScore:{
 		 get: function () {
 			 // console.log(this.inputScore);
@@ -268,10 +265,7 @@ export default {
 		       return (this.totalScore-this.selectedScore-this.checkItemScore-this.deductPointFromRes).toFixed(2);
 		 },
 		 set:function(newValue){
-			 // const everyCount = Math.abs((newValue)/2);
-			 // this.selectedScore = everyCount;
-			 // this.checkItemScore = everyCount;
-			 // this.inputScore = this.inputScore + newValue;
+		
 		 },
 		 
 	  },
@@ -335,6 +329,8 @@ export default {
 		// console.log(this.deptId);
 		uni.navigateTo({
 		  url: `/pages/responsibleList/responsibleList?deptId=${this.deptId}&checkId=${this.id}`,
+		  // animationType: 'pop-in',
+		  // animationDuration: 200
 		});
 	},
 	onInputScore(e){
@@ -923,8 +919,8 @@ export default {
 		   .comfirmBtn {
 			   font-size: 22rpx;
 			   color: #FFFFFF;
-			   height: 80rpx;
-			   line-height: 80rpx;
+			   height: 85rpx;
+			   line-height: 85rpx;
 			   text-align: center;
 			   background-color: #3377FF;
 		   }

+ 20 - 1
pages/responsibleList/responsibleList.vue

@@ -13,7 +13,7 @@
 			</view>
 		</view>
 		<view class="content">
-			<index-list v-on:listClick="listClickHandle" :checkedResponsibleList='checkedResponsibleList' :options="list"></index-list>
+			<index-list :padding='padding' v-on:listClick="listClickHandle" :checkedResponsibleList='checkedResponsibleList' :options="list"></index-list>
 		</view>
 		<view class="bottom">
 			<view class="selectAll" @click="selectAllHandle">
@@ -39,6 +39,7 @@
 				checkedResponsibleList:[],//已选择的当事人列表
 				list:[],
 				checkId:'',
+				padding:0,
 				// list:[{
 				// 	"letter": "A",
 				// 	"data": [
@@ -77,9 +78,27 @@
 			// console.log({responsibleList});
 			this.checkedResponsibleList = responsibleList.checkedResponsibleList;
 		},
+		computed:{
+		},
 		mounted(){
 			
 			this.getResponsibleList();
+			//设置当事人页面滚动距离顶部距离
+			uni
+				.createSelectorQuery()
+				.in(this)
+				.select('.top')
+				.boundingClientRect()
+				.exec(res => {
+					if (res[0]) {
+						this.padding = res[0].height;
+						// resolve(res[0].top);
+					} else {
+						that.$nextTick(() => {
+							++count <= 8 ? getHeight() : this.padding = 0;
+						});
+					}
+				});
 		},
 		methods:{
 			bindClick(){

+ 7 - 21
utils/request.js

@@ -74,7 +74,6 @@ function request(url, options, additional) {
 
 // 加载中提示打开/关闭
 function openCloseLoading(additional, isOpen) {
-  console.log({additional, isOpen});
   if (additional.needLoading) {
     if (isOpen) { // 打开(如果已经打开不必重复打开)
       if (AllRequestNum === 0)
@@ -97,20 +96,20 @@ function LoginExpired(msg) {
   AllRequestNum = 0;
   uni.showModal({
     title: '提示',
-    content:msg,
-	showCancel:false,
+    content: '登录过期,请重新登录!',
     success: function (_res) {
       if (_res.confirm) {
-          uni.navigateTo({
-            url: '/pages/login/login'
-          });
+        uni.navigateTo({
+          url: '/pages/login/login'
+        });
+      } else if (_res.cancel) {
+        console.log('用户点击取消');
       }
     }
   });
 }
 
 function notifyException(resArr, additional) {
-console.log('openCloseLoading');
   openCloseLoading(additional, false);
   const [error, res] = resArr;
   if (error) {
@@ -123,21 +122,8 @@ console.log('openCloseLoading');
     return false;
   } else if (res.data.code !== 'SUCCESS') {
     const { code, msg } = res.data;
-	console.log('res.data',res.data);
-    if (code === '410' || code === '401') {
+    if (code === '410' || code === '401'||code === '403') {
       LoginExpired(msg);
-    } else if (code === '403') {
-      uni.showModal({
-        title: '提示',
-        content: '登录过期,请重新登录!',
-        success: function (_res) {
-          if (_res.confirm) {
-            LoginExpired();
-          } else if (_res.cancel) {
-            console.log('用户点击取消');
-          }
-        }
-      });
     } else {
       uni.showModal({
         title: '错误提示',