linweizeng 3 ani în urmă
părinte
comite
1037b7b0b3
3 a modificat fișierele cu 26 adăugiri și 39 ștergeri
  1. 11 1
      common/util/meth.js
  2. 7 3
      pages/user/editpassword.vue
  3. 8 35
      pages/user/userdetail.vue

+ 11 - 1
common/util/meth.js

@@ -29,5 +29,15 @@ export default {
 				title = '必填'
 		}
 		this.getPrompt(val1 + title)
-	}
+	},
+	//弹出提示
+	getShowLoading(title = '加载中', mask = true) {
+		uni.showLoading({
+			title: title,
+			mask: mask
+		})
+		setTimeout(() => {
+			uni.hideLoading()
+		}, 1000 * 10)
+	},
 }

+ 7 - 3
pages/user/editpassword.vue

@@ -99,6 +99,7 @@
 					return false
 				}
 
+
 				let data = {
 					"userIds": [
 						this.id,
@@ -108,15 +109,18 @@
 					"primitivePassword": "",
 					"reset": 1
 				};
+				this.$methCommon.getShowLoading()
 				let that = this;
 				this.$http.post("/ibps/platform/v3/user/change/passwd", data).then(res => {
 					if (res.data.state == 200) {
 						that.$tip.toast("修改成功")
-						uni.navigateTo({
+						uni.reLaunch({
 							url: "/pages/index/index"
 						})
+						uni.hideLoading()
 					} else {
-						this.$tip.toast("发送异常");
+						this.$methCommon.getPrompt('修改失败!', 'fail')
+						uni.hideLoading()
 					}
 				})
 			}
@@ -168,4 +172,4 @@
 		font-size: 14px;
 		color: #333;
 	}
-</style>
+</style>

+ 8 - 35
pages/user/userdetail.vue

@@ -35,8 +35,6 @@
 					<u-button class="u-m-t-40 btn-back-color" type="error" @click="sumbit">提交</u-button>
 				</view>
 			</uni-card>
-
-
 		</scroll-view>
 	</view>
 </template>
@@ -83,6 +81,7 @@
 								'&access_token=' +
 								token + '&tenantId='
 						}
+						uni.hideLoading()
 					}
 				}).catch(e => {})
 			},
@@ -95,28 +94,15 @@
 				return true
 			},
 			sumbit() {
-				uni.showLoading({
-					mask: true,
-					title: "加载中"
-				})
 				if (this.user.name == '') {
-					uni.showToast({
-						title: '请填写姓名',
-						icon: 'none',
-						duration: 2000
-					})
-					uni.hideLoading()
+					this.$methCommon.getPrompt('请填写姓名')
 					return
 				}
 				if (!this.checkPhone(this.user.mobile)) {
-					uni.showToast({
-						title: '请填写正确的手机号码',
-						icon: 'none',
-						duration: 2000
-					})
-					uni.hideLoading()
+					this.$methCommon.getPrompt('请填写正确的手机号码')
 					return
 				}
+				this.$methCommon.getShowToast()
 				this.$http.post('ibps/platform/v3/employee/update', {
 					partyEmployeePo: this.user,
 					user: this.user,
@@ -127,12 +113,7 @@
 				}).then(res => {
 					if (res.data.state == '200') {
 						let datas = res.data
-						uni.showToast({
-							title: datas.message,
-							icon: 'none',
-							duration: 2000
-						})
-
+						this.$methCommon.getPrompt(datas.message)
 						let info = uni.getStorageSync(USER_INFO);
 						info.user = this.user
 						uni.setStorage({
@@ -141,20 +122,12 @@
 						})
 					} else {
 						let datas = res.data
-						uni.showToast({
-							title: datas.cause,
-							icon: 'none',
-							duration: 2000
-						})
+						this.$methCommon.getPrompt(datas.cause)
 					}
 					uni.hideLoading()
 				}).catch(res => {
 					let datas = res.data
-					uni.showToast({
-						title: datas.cause,
-						icon: 'none',
-						duration: 2000
-					})
+					this.$methCommon.getPrompt(datas.cause)
 					uni.hideLoading()
 				})
 			},
@@ -249,4 +222,4 @@
 	/deep/ .u-form-item--left__content__label {
 		color: #8799a3;
 	}
-</style>
+</style>