From eec82b55813387e20087989536cd32810b59cd48 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期五, 13 十月 2023 09:42:49 +0800
Subject: [PATCH] 大部分按钮增加loading 放空操作逻辑修改

---
 pages/driver-page/drvier-my/drvier-my.vue |  238 +++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 164 insertions(+), 74 deletions(-)

diff --git a/pages/driver-page/drvier-my/drvier-my.vue b/pages/driver-page/drvier-my/drvier-my.vue
index f3ce250..f369ae6 100644
--- a/pages/driver-page/drvier-my/drvier-my.vue
+++ b/pages/driver-page/drvier-my/drvier-my.vue
@@ -1,17 +1,30 @@
 <template>
 	<view class="driver-my">
-		<view class="driver-banner">
-			<view class="navgation">鎴戠殑</view>
-			<view class="avatar">
-				<view class="avatar-imgage"
-					style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/driverava.png')no-repeat;background-size: cover;">
+		<view class=""
+			style="height: 446rpx;width: 100%;">
+			<view class="driver-banner">
+				<view class="navgation">鎴戠殑</view>
+				<view class="avatar">
+					<view class="avatar-imgage"
+						style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/driverava.png')no-repeat;background-size: cover;">
+					</view>
+					<view class="avatar-name">{{ userInfo.name || '' }}</view>
+					<view class="edit-button"><u-button type="primary"
+							@click="editBtnClick"
+							shape="circle"
+							plain>缂栬緫涓汉璧勬枡</u-button></view>
 				</view>
-				<view class="avatar-name">{{ userInfo.name || '' }}</view>
-				<view class="edit-button"><u-button type="primary"
-						@click="editBtnClick"
-						shape="circle"
-						plain>缂栬緫涓汉璧勬枡</u-button></view>
 			</view>
+		</view>
+		<view class="process-state">
+			<view class="state-text">
+				瀹℃牳鐘舵��
+			</view>
+			<u--text :type="userInfo.isRegister===0?'primary':userInfo.isRegister===1?'error':'success'"
+				:text="userInfo.isRegister===0?'寰呭鏍�':userInfo.isRegister===1?'鏈�氳繃':'宸插鏍�'"
+				size="32"></u--text>
+		</view>
+		<view class="information-block">
 			<view class="personal-information">
 				<view class="personal-information-block">
 					<view class="block-main">
@@ -24,7 +37,6 @@
 							</view>
 							<view class="information-value">
 								{{ userInfo.idCard || '' }}
-								<!-- <u-icon name="arrow-right" color="#999999" size="30" v-if="userInfo.idCard"></u-icon> -->
 							</view>
 						</view>
 						<view class="information-line">
@@ -35,7 +47,6 @@
 							</view>
 							<view class="information-value">
 								{{ userInfo.phone || '' }}
-								<!-- <u-icon name="arrow-right" color="#999999" size="30" v-if="userInfo.phone"></u-icon> -->
 							</view>
 						</view>
 						<view class="information-line">
@@ -46,7 +57,6 @@
 							</view>
 							<view class="information-value">
 								{{ userInfo.carNo || '' }}
-								<!-- <u-icon name="arrow-right" color="#999999" size="30" v-if="userInfo.carNo"></u-icon> -->
 							</view>
 						</view>
 						<view class="information-line">
@@ -57,7 +67,6 @@
 							</view>
 							<view class="information-value">
 								{{ userInfo.axleNum || '' }}
-								<!-- <u-icon name="arrow-right" color="#999999" size="30" v-if="userInfo.axleNum"></u-icon> -->
 							</view>
 						</view>
 						<view class="information-line last">
@@ -68,7 +77,6 @@
 							</view>
 							<view class="information-value">
 								{{ userInfo.weight || '' }}
-								<!-- <u-icon name="arrow-right" color="#999999" size="30" v-if="userInfo.weight"></u-icon> -->
 							</view>
 						</view>
 					</view>
@@ -116,50 +124,36 @@
 			</view>
 		</view>
 		<view class="loginout">
+			<!-- <view class="loginout-main"><u-button text="閲嶇疆瀵嗙爜"
+					type="primary"
+					@click="initPwd"
+					shape="circle"
+					plain></u-button></view> -->
 			<view class="loginout-main"><u-button text="閫�鍑虹櫥褰�"
 					type="primary"
 					@click="logout"
 					shape="circle"
 					plain></u-button></view>
 		</view>
-		<!-- <view class="personal-information-form">
-			<u--form labelPosition="left" :model="userInfo" ref="form1">
-				<u-form-item labelWidth="20%" label="濮撳悕" ref="item1">
-					<u--input v-model="userInfo.name" border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
-				</u-form-item>
-				<u-form-item labelWidth="20%" label="韬唤璇佸彿" ref="item1">
-					<u--input v-model="userInfo.idCard" border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
-				</u-form-item>
-				<u-form-item labelWidth="20%" label="鎵嬫満鍙�" ref="item1">
-					<u--input v-model="userInfo.phone" border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
-				</u-form-item>
-				<u-form-item labelWidth="20%" label="杞︾墝鍙�" ref="item1">
-					<u--input v-model="userInfo.carNo" border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
-				</u-form-item>
-				<u-form-item labelWidth="20%" label="浣撻噸" ref="item1">
-					<u--input v-model="userInfo.weight" border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
-				</u-form-item>
-				<u-form-item v-model="userInfo.axleNum" labelWidth="20%" label="杞﹁酱鏁�" ref="item1">
-					<u--input border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
-				</u-form-item>
-				<u-form-item labelWidth="20%" label="杞﹁締鐓х墖" ref="item1">
-					<u--image :showLoading="true" :src="userInfo.carImg != null ? BaseUrl + userInfo.carImg : ''" width="80px" height="80px" @click="imageClick(1)">
-						<view slot="error" style="font-size: 24rpx;">鍔犺浇澶辫触</view>
-					</u--image>
-				</u-form-item>
-				<u-form-item labelWidth="25%" label="琛岄┒璇佺収鐗�" ref="item1">
-					<u--image :showLoading="true" :src="userInfo.drivingImg != null ? BaseUrl + userInfo.drivingImg : ''" width="80px" height="80px" @click="imageClick(2)">
-						<view slot="error" style="font-size: 24rpx;">鍔犺浇澶辫触</view>
-					</u--image>
-				</u-form-item>
-			</u--form>
-			<view class="push-information-button">
-				<u-button text="淇敼涓汉璧勬枡" type="primary" @click="editBtnClick"></u-button>
-				<u-button text="閫�鍑虹櫥褰�" type="primary" @click="logout"></u-button>
-			</view> -->
-		<!-- <view class="statistics"><u-button text="鍙戣繍缁熻" type="primary" @click="statistics"></u-button></view> -->
-		<!-- </view> -->
-
+		<!-- 寮曞椤� -->
+		<view class="noob-tour"
+			style="margin-top: 80rpx;">
+			<combined-title title="鎿嶄綔鎸囧紩"></combined-title>
+			<u-cell-group>
+				<u-cell title="鏂版墜鎸囧紩"
+					name='1'
+					:clickable="true"
+					@click="noobTour">
+					<u-badge type="primary"
+						value="01"
+						slot='icon'></u-badge>
+					<u-icon slot="value"
+						name="arrow-right"
+						size="30"
+						color="#b8b8b8"></u-icon>
+				</u-cell>
+			</u-cell-group>
+		</view>
 		<!-- 鍥剧墖棰勮寮瑰嚭妗� -->
 		<view class="previewImage-container">
 			<u-popup :show="previewImageShow"
@@ -171,7 +165,12 @@
 					height="400px"></u--image>
 			</u-popup>
 		</view>
-
+		<!-- 寮曞鍥剧墖寮瑰嚭 -->
+		<view class="previewImage-container">
+			<previewImage ref="previewImage"
+				:imgs="driverTourImgList"
+				:saveBtn='false'></previewImage>
+		</view>
 		<!-- 淇敼寮瑰嚭妗� -->
 		<view class="editDriverPopup-container">
 			<u-popup :show="editDriverPopupShow"
@@ -194,6 +193,14 @@
 								inputAlign="left"></u--input>
 						</u-form-item>
 						<u-form-item labelWidth="20%"
+							label="瀵嗙爜"
+							prop="password"
+							required>
+							<u--input v-model="editUserInfo.password"
+								border="none"
+								inputAlign="left"></u--input>
+						</u-form-item>
+						<u-form-item labelWidth="20%"
 							label="韬唤璇佸彿"
 							prop="idCard"
 							required>
@@ -209,14 +216,14 @@
 								border="none"
 								inputAlign="left"></u--input>
 						</u-form-item>
-						<u-form-item labelWidth="20%"
+						<!-- <u-form-item labelWidth="20%"
 							label="杞︾墝鍙�"
 							prop="carNo"
 							required>
 							<u--input v-model="editUserInfo.carNo"
 								border="none"
 								inputAlign="left"></u--input>
-						</u-form-item>
+						</u-form-item> -->
 						<u-form-item labelWidth="20%"
 							label="浣撻噸"
 							prop="weight"
@@ -280,14 +287,30 @@
 				@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 { redirectLogin } from '@/utils/status';
 	import { BaseUrl } from '@/api/publicInterface.js';
-	import { mapMutations } from 'vuex';
+	import previewImage from '@/components/kxj-previewImage/kxj-previewImage.vue';
+	import { mapMutations, mapState } from 'vuex';
 	export default {
+		components: { previewImage },
+		computed: {
+			...mapState(['driverTourImgList']),
+			roleType() {
+				return uni.getStorageSync('roleType');
+			},
+		},
 		data() {
 			return {
 				// 鑾峰彇鐨勫徃鏈鸿鎯�
@@ -304,7 +327,9 @@
 					drivingImg: '',
 					axleNum: '',
 					weight: '',
-					userId: ''
+					userId: '',
+					password: "",
+					isRegister: ''
 				},
 				rules: {
 					name: {
@@ -346,8 +371,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()
+							}
+						}
 					},
 					carNo: [{
 							type: 'string',
@@ -401,7 +437,9 @@
 				logoutShow: false,
 				logoutTitle: '鎻愮ず',
 				logoutContent: '鏄惁纭閫�鍑�',
-				BaseUrl
+				BaseUrl,
+				initPwdShow: false
+
 			};
 		},
 		onShow() {
@@ -439,6 +477,7 @@
 							this.editUserInfo[item] = res.data[item];
 						}
 					});
+					this.editUserInfo.password = ''
 				});
 			},
 			// 淇敼鎸夐挳鐐瑰嚮
@@ -538,7 +577,8 @@
 				this.editUserInfo = {
 					...this.editUserInfo,
 					carImg: uni.getStorageSync('carImg'),
-					drivingImg: uni.getStorageSync('drivingImg')
+					drivingImg: uni.getStorageSync('drivingImg'),
+					isRegister: 0
 				};
 				this.$refs.editRef
 					.validate()
@@ -562,11 +602,42 @@
 						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;
 			},
 			logoutConfirm() {
 				redirectLogin();
+				this.$store.commit('changeisLogin', false)
+				this.$store.dispatch('websocketOnClose')
 			},
 			logoutCancel() {
 				this.logoutShow = false;
@@ -576,7 +647,10 @@
 				uni.navigateTo({
 					url: '/pages/customer-page/customer-my/faYunstatistics/faYunstatistics'
 				});
-			}
+			},
+			noobTour() {
+				this.$refs.previewImage.open('https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj1.png')
+			},
 		}
 	};
 </script>
@@ -589,15 +663,11 @@
 		align-items: center;
 	}
 
-	.statistics {
-		margin-top: vww(10);
-		margin-bottom: vww(10);
-	}
 
 	::v-deep.driver-my {
 		width: 100%;
 		margin: 0 auto;
-		padding-bottom: vww(60);
+		padding-bottom: vww(100);
 
 		.driver-banner {
 			width: 100%;
@@ -650,13 +720,32 @@
 					top: vww(4);
 				}
 			}
+		}
+
+		.process-state {
+			width: 300rpx;
+			height: 50rpx;
+			margin: 0 auto;
+			position: fixed;
+			top: 284rpx;
+			left: 37rpx;
+			display: flex;
+			align-items: center;
+
+			.state-text {
+				margin-right: vww(6);
+			}
+		}
+
+		.information-block {
+			width: 100%;
 
 			.personal-information {
 				width: 100%;
 				display: flex;
 				justify-content: center;
 				position: relative;
-				top: vww(20);
+				top: vww(-30);
 
 				&-block {
 					width: 690rpx;
@@ -716,7 +805,6 @@
 		.car-information {
 			width: 100%;
 			position: relative;
-			top: vww(410);
 			@include flex justify-content: center;
 
 			.information-main {
@@ -760,11 +848,13 @@
 
 		.loginout {
 			width: 100%;
-			height: 74rpx;
+			height: 200rpx;
 			@include flex;
-			justify-content: center;
+			justify-content: space-around;
+			flex-direction: column;
+			align-items: center;
 			position: relative;
-			bottom: vww(-430);
+			top: vww(20);
 
 			.loginout-main {
 				width: 84%;

--
Gitblit v1.9.1