From b85e774f58609cb9e975731e355bdfa5ab679236 Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期五, 19 一月 2024 17:34:38 +0800
Subject: [PATCH] feat:小程序验质页面提交新功能(拆分净重、扣罚种类改为多选、品名规格支持手动输入)

---
 pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue |   93 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 92 insertions(+), 1 deletions(-)

diff --git a/pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue b/pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue
index b0fc123..1cb61fa 100644
--- a/pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue
+++ b/pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue
@@ -75,6 +75,12 @@
 
 		<!-- <view class="statistics"><u-button text="鍙戣繍缁熻" type="primary" @click="statistics"></u-button></view> -->
 		<view class="utils-button">
+			<view class="utils"><u-button text="淇敼瀵嗙爜"
+					type="primary"
+					@click="modifyPwd"></u-button></view>
+			<view class="utils"><u-button text="閲嶇疆瀵嗙爜"
+					type="primary"
+					@click="initPwd"></u-button></view>
 			<view class="utils"><u-button text="閫�鍑虹櫥褰�"
 					type="primary"
 					@click="logout"></u-button></view>
@@ -99,6 +105,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>
@@ -126,7 +156,12 @@
 				// 閫�鍑烘ā鎬佹
 				logoutShow: false,
 				logoutTitle: '鎻愮ず',
-				logoutContent: '鏄惁纭閫�鍑�'
+				logoutContent: '鏄惁纭閫�鍑�',
+				initPwdShow: false,
+				modifyPwdShow: false,
+				passwordModified: '',
+				// 鐢ㄦ埛淇℃伅瀵硅薄
+				userEntity: {},
 			};
 		},
 		onShow() {
@@ -135,6 +170,13 @@
 		methods: {
 			init() {
 				this.getFleet();
+				this.getUserEntity();
+			},
+			// 鑾峰彇鐢ㄦ埛淇℃伅
+			getUserEntity() {
+				this.$reqGet('getUserEntity').then(res => {
+					this.userEntity = res.data;
+				});
 			},
 			// 鑾峰彇杞﹂槦
 			getFleet() {
@@ -204,6 +246,50 @@
 				uni.navigateTo({
 					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;
@@ -348,5 +434,10 @@
 				}
 			}
 		}
+
+		.modifyPwd {
+			width: 100%;
+			border: 1rpx solid rgb(220, 223, 230);
+		}
 	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1