From 5386f47f55ecb9ad2189998f9dda6d682b6be7e0 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期二, 12 九月 2023 13:56:43 +0800
Subject: [PATCH] 修改空数据提示

---
 pages/driver-page/drvier-my/drvier-my.vue |   68 ++++++++++++++++++++++++++++------
 1 files changed, 56 insertions(+), 12 deletions(-)

diff --git a/pages/driver-page/drvier-my/drvier-my.vue b/pages/driver-page/drvier-my/drvier-my.vue
index c03d621..1c53bf5 100644
--- a/pages/driver-page/drvier-my/drvier-my.vue
+++ b/pages/driver-page/drvier-my/drvier-my.vue
@@ -183,7 +183,7 @@
 		<!-- 鍥剧墖棰勮寮瑰嚭妗� -->
 		<view class="previewImage-container">
 			<previewImage ref="previewImage"
-				:imgs="TourImgList"
+				:imgs="driverTourImgList"
 				:saveBtn='false'></previewImage>
 		</view>
 
@@ -349,13 +349,21 @@
 				@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>
 </template>
 
 <script>
 	import { customerId, userInfo, redirectLogin } from '@/utils/status';
 	import { BaseUrl } from '@/api/publicInterface.js';
-	import { mapMutations } from 'vuex';
+	import { mapMutations, mapState } from 'vuex';
 	import { onlineurl } from '@/api/request.js'
 	import combinedTitle from '@/components/combined-title/combined-title.vue';
 	import previewImage from '@/components/kxj-previewImage/kxj-previewImage.vue';
@@ -363,6 +371,9 @@
 		components: {
 			combinedTitle,
 			previewImage
+		},
+		computed: {
+			...mapState(['driverTourImgList']),
 		},
 		data() {
 			return {
@@ -425,8 +436,19 @@
 					weight: {
 						type: 'number',
 						required: true,
-						message: '璇峰~鍐欎綋閲�',
-						trigger: ['blur', 'change']
+						trigger: ['blur', 'change'],
+						transform(value) {
+							return Number(value);
+						},
+						validator: (rule, value, callback) => {
+							if (!value) {
+								callback(new Error('璇峰~鍐欎綋閲�'))
+							} else if (value > 200) {
+								callback(new Error('璇峰~鍐欏悎鐞嗕綋閲�'))
+							} else {
+								callback()
+							}
+						}
 					},
 					password: {
 						required: false,
@@ -513,14 +535,7 @@
 						value: '钃濊壊'
 					}
 				],
-				TourImgList: ['https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj1.jpg',
-					'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj2.jpg',
-					'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj3.jpg',
-					'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj4.jpg',
-					'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj5.jpg',
-					'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj6.jpg',
-					'https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj7.jpg'
-				],
+				initPwdShow: false
 			};
 		},
 		onShow() {
@@ -706,6 +721,35 @@
 						this.$u.toast('淇敼澶辫触');
 					});
 			},
+			initPwd() {
+				this.initPwdShow = true
+			},
+			initPwdConfirm() {
+				this.initPwdShow = false
+				uni.showLoading({
+					title: '鍔犺浇涓�...'
+				});
+				this.editUserInfo.password = '123456';
+				this.editUserInfo.carImg = uni.getStorageSync('carImg');
+				this.editUserInfo.drivingImg = uni.getStorageSync('drivingImg')
+				this.$reqPost('updateUser', this.editUserInfo, '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('淇敼澶辫触');
+				});
+			},
+			initPwdCancel() {
+				this.initPwdShow = false
+			},
 			logout() {
 				this.logoutShow = true;
 			},

--
Gitblit v1.9.1