gjy 2 jaren geleden
bovenliggende
commit
bddc05e982
3 gewijzigde bestanden met toevoegingen van 30 en 5 verwijderingen
  1. 9 2
      pages/erpbusiness/quality_testing.vue
  2. 11 1
      pages/task/my_task.vue
  3. 10 2
      pages/user/user.vue

+ 9 - 2
pages/erpbusiness/quality_testing.vue

@@ -248,8 +248,15 @@
 			this.managementType = options.managementType
 		},
 		onShow() {
-			console.log(uni.getStorageSync('compName1'),11111111)
-			this.compName = uni.getStorageSync('compName1').company
+			var that =this
+			// console.log(uni.getStorageSync('compName1'),11111111)
+			uni.getStorage({
+				key: 'compName1',
+				success: function (res) {
+					that.compName=res.data.company
+					console.log(res.data);
+				}
+			});
 			// this.companyList=uni.getStorageSync('companyList')
 			uni.setStorageSync('isClick', false)
 			uni.showLoading({

+ 11 - 1
pages/task/my_task.vue

@@ -220,7 +220,17 @@
 		},
 		onShow() {
 			var that =this
-			that.compName = uni.getStorageSync('compName1').company
+			// setTimeout(()=>{
+				
+				uni.getStorage({
+					key: 'compName1',
+					success: function (res) {
+						that.compName=res.data.company
+						console.log(res.data);
+					}
+				});
+				 // = uni.getStorageSync('compName1').company
+			// },1000)
 			if(this.statusFlag==1){
 				this.taskInfo=[]
 				this.pages=1

+ 10 - 2
pages/user/user.vue

@@ -396,6 +396,10 @@
 			this.scrollTop = e.scrollTop;
 		},
 		onShow() {
+			uni.showLoading({
+				title: '加载中',
+				mask: true
+			})
 			// console.log(111111111)
 			if (uni.getStorageSync('pcUserInfo')) {
 				// console.log(2222222)
@@ -483,22 +487,26 @@
 
 				// 	}
 				// });
+				console.log(uni.getStorageSync('compName1'))
 				if(uni.getStorageSync('compName1')){
+					console.log(11111111)
 					that.compName = uni.getStorageSync('compName1').company
 				}
 				that.$api.doRequest('get', '/commonUser/getCompOwn', {
 					phone: that.userInfo.phone
 				}).then(res => {
 					if (res.data.data) {
+						uni.hideLoading()
 						that.companyList = res.data.data
-						uni.setStorageSync('companyList', that.companyList)
+						// uni.setStorageSync('companyList', that.companyList)
 						console.log("that.3333")
 						console.log(that.companyList)
 						if (that.companyList.length > 0) {
 							if (!that.compName) {
+								console.log(111111111111)
 								that.compName = that.companyList[0].compName
 								uni.setStorageSync('compName1', {company:that.companyList[0].compName})
-							}
+								}
 							console.log("this.compName")
 							console.log(that.compName)
 							that.haveCompany = true