From 82a7eba143cc761b303b99889193f7aad2dc9d08 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期一, 28 八月 2023 08:56:08 +0800
Subject: [PATCH] 修改bug,称重页面增加历史和异常原因填写

---
 pages/customer-page/customer-my/customer-my.vue |   89 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 84 insertions(+), 5 deletions(-)

diff --git a/pages/customer-page/customer-my/customer-my.vue b/pages/customer-page/customer-my/customer-my.vue
index a2d91a3..2a9bcf2 100644
--- a/pages/customer-page/customer-my/customer-my.vue
+++ b/pages/customer-page/customer-my/customer-my.vue
@@ -75,6 +75,12 @@
 					type="primary"
 					@click="userManage"
 					v-if="roleType == 1 && userEntity.isHostUser === '0'"></u-button></view>
+			<view class="logout"><u-button text="淇敼瀵嗙爜"
+					type="primary"
+					@click="modifyPwd"></u-button></view>
+			<view class="logout"><u-button text="閲嶇疆瀵嗙爜"
+					type="primary"
+					@click="initPwd"></u-button></view>
 			<view class="logout"><u-button text="閫�鍑虹櫥褰�"
 					type="primary"
 					@click="logout()"></u-button></view>
@@ -103,9 +109,6 @@
 								border="none"
 								placeholder="璇疯緭鍏ヨ溅闃熷悕绉�"></u--input>
 						</u-form-item>
-						<!-- <u-form-item label="杞︾墝" borderBottom ref="cars" labelWidth="80">
-              <u--textarea maxlength="2000" v-model="addGroupForm.carNums" placeholder="璇疯緭鍏ヨ溅鐗�" height="150"></u--textarea>
-            </u-form-item> -->
 					</u--form>
 				</view>
 				<view class="addCarButton"><u-button text="娣诲姞"
@@ -138,7 +141,7 @@
 				<view class="slot-content"><rich-text :nodes="deleteFleetContent"></rich-text></view>
 			</u-modal>
 		</view>
-
+		<!-- 閫�鍑虹櫥褰曞脊鍑烘 -->
 		<view class="logoutModel">
 			<u-modal :show="logoutShow"
 				:title="logoutTitle"
@@ -146,6 +149,30 @@
 				:content="logoutContent"
 				@confirm="logoutConfirm"
 				@cancel="logoutCancel"></u-modal>
+		</view>
+		<!-- 閲嶇疆瀵嗙爜寮瑰嚭妗� -->
+		<view class="initPwdModal">
+			<u-modal :show="initPwdShow"
+				title="閲嶇疆瀵嗙爜"
+				showCancelButton
+				content="鍒濆瀵嗙爜灏嗗彉鏇翠负123456,鏄惁纭閲嶇疆"
+				@confirm="initPwdConfirm"
+				@cancel="initPwdCancel"></u-modal>
+		</view>
+		<!-- 淇敼瀵嗙爜寮瑰嚭妗� -->
+		<view class="modifyPwdModal">
+			<u-modal :show="modifyPwdShow"
+				title="淇敼瀵嗙爜"
+				showCancelButton
+				@confirm="modifyPwdConfirm"
+				@cancel="modifyPwdCancel">
+				<view class="modifyPwd">
+					<u-input v-model="passwordModified"
+						placeholder="璇疯緭鍏ヤ慨鏀瑰悗鐨勫瘑鐮�"
+						border="surround"
+						type="password"></u-input>
+				</view>
+			</u-modal>
 		</view>
 	</view>
 </template>
@@ -185,7 +212,10 @@
 				logoutTitle: '鎻愮ず',
 				logoutContent: '鏄惁纭閫�鍑�',
 				// 鐢ㄦ埛淇℃伅瀵硅薄
-				userEntity: {}
+				userEntity: {},
+				initPwdShow: false,
+				modifyPwdShow: false,
+				passwordModified: ''
 			};
 		},
 		computed: {
@@ -355,6 +385,50 @@
 					url: `/pages/customer-page/fleet-management/fleet-management?id=${id}`
 				});
 			},
+			updateInfo() {
+				this.$reqPost('updateUser', this.userEntity, 'json').then(res => {
+					uni.hideLoading()
+					if (res.code == 0) {
+						uni.showToast({
+							title: '閲嶇疆鎴愬姛',
+							duration: 2000,
+							icon: 'success'
+						})
+					} else {
+						this.$u.toast(res.msg ? res.msg : '淇敼澶辫触');
+					}
+				}).catch(err => {
+					this.$u.toast('淇敼澶辫触');
+				});
+			},
+			initPwd() {
+				this.initPwdShow = true
+			},
+			initPwdConfirm() {
+				this.initPwdShow = false
+				uni.showLoading({
+					title: '鍔犺浇涓�'
+				})
+				this.userEntity.password = '123456'
+				this.updateInfo()
+			},
+			initPwdCancel() {
+				this.initPwdShow = false
+			},
+			modifyPwd() {
+				this.modifyPwdShow = true
+			},
+			modifyPwdConfirm() {
+				if (this.passwordModified.length === 0) {
+					return this.$u.toast('瀵嗙爜涓嶈兘涓虹┖')
+				}
+				this.modifyPwdShow = false
+				this.userEntity.password = this.passwordModified
+				this.updateInfo()
+			},
+			modifyPwdCancel() {
+				this.modifyPwdShow = false
+			},
 			logout() {
 				this.logoutShow = true;
 			},
@@ -515,5 +589,10 @@
 				}
 			}
 		}
+
+		.modifyPwd {
+			width: 100%;
+			border: 1rpx solid rgb(220, 223, 230);
+		}
 	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1