Selaa lähdekoodia

表单插槽兼容性问题处理

@dongkboy 3 kuukautta sitten
vanhempi
commit
05362bcc60

+ 7 - 3
components/commonFormItem/ApplicantInfoForm.vue

@@ -27,9 +27,8 @@
 			<u-form-item v-if="policyHolderInfo.property==0" label="注册资金" borderBottom>
 				<u--input v-model="policyHolderInfo.registeredCapital" border="none" clearable placeholder="请输入注册资金"
 					placeholderStyle="text-align:right;">
-					<template slot="suffix">
-						<text style="font-size: 30rpx;">万元</text>
-					</template></u--input>
+				</u--input>
+				<text class="suffixClass">万元</text>
 			</u-form-item>
 			<u-form-item label="手机号" prop="mobile" borderBottom>
 				<u-input v-model="policyHolderInfo.mobile" border="none" clearable placeholder="请输入手机号" maxlength="11"
@@ -283,4 +282,9 @@
 		border-radius: 100rpx 100rpx 100rpx 100rpx;
 
 	}
+
+	.suffixClass {
+		margin-left: 10rpx;
+		font-size: 30rpx;
+	}
 </style>

+ 9 - 3
components/commonFormItem/InsuredInfoForm.vue

@@ -30,9 +30,10 @@
 			<u-form-item v-if="insuredPersonInfo.property==0" label="注册资金" borderBottom>
 				<u--input v-model="insuredPersonInfo.registeredCapital" border="none" clearable placeholder="请输入注册资金"
 					placeholderStyle="text-align:right;">
-					<template slot="suffix">
-						<text style="font-size: 30rpx;">万元</text>
-					</template></u--input>
+				</u--input>
+				<view class="suffixClass">
+					万元
+				</view>
 			</u-form-item>
 			<u-form-item label="手机号" prop="mobile" borderBottom>
 				<u-input v-model="insuredPersonInfo.mobile" border="none" clearable placeholder="请输入手机号" maxlength="11"
@@ -294,4 +295,9 @@
 		border-radius: 100rpx 100rpx 100rpx 100rpx;
 
 	}
+
+	.suffixClass {
+		margin-left: 10rpx;
+		font-size: 30rpx;
+	}
 </style>

+ 9 - 3
components/commonFormItem/OwnerInfoForm.vue

@@ -28,9 +28,10 @@
 			<u-form-item v-if="ownerInfo.property==0" label="注册资金" borderBottom>
 				<u--input v-model="ownerInfo.registeredCapital" border="none" clearable placeholder="请输入注册资金"
 					placeholderStyle="text-align:right;">
-					<template slot="suffix">
-						<text style="font-size: 30rpx;">万元</text>
-					</template></u--input>
+				</u--input>
+				<view class="suffixClass">
+					万元
+				</view>
 			</u-form-item>
 			<u-form-item label="手机号" prop="mobile" borderBottom>
 				<u-input v-model="ownerInfo.mobile" border="none" clearable placeholder="请输入手机号" maxlength="11"
@@ -267,4 +268,9 @@
 		border-radius: 100rpx 100rpx 100rpx 100rpx;
 
 	}
+
+	.suffixClass {
+		margin-left: 10rpx;
+		font-size: 30rpx;
+	}
 </style>

+ 9 - 4
pages/login/bindPhoneNumber.vue

@@ -19,11 +19,11 @@
 				<view class="codemodal">
 					<u--input v-model="info.captcha" border="bottom" clearable placeholder="请输入图形验证码" maxlength="5"
 						placeholderStyle="color:#999" style="padding: 34rpx 0;box-sizing: border-box;">
-						<template slot="suffix">
-							<image :src="imgcodesrc" mode="" @tap="refreshCaptcha" style="width: 146rpx;height: 52rpx;">
-							</image>
-						</template>
 					</u--input>
+					<view class="suffixClass">
+						<image :src="imgcodesrc" mode="" @tap="refreshCaptcha" style="width: 146rpx;height: 52rpx;">
+						</image>
+					</view>
 					<view class="dis a-c j-end mt-1">
 						<text style="font-size: 26rpx; color: #666;" @tap="refreshCaptcha">看不清?换一张</text>
 					</view>
@@ -210,4 +210,9 @@
 		font-weight: bold;
 
 	}
+
+	.suffixClass {
+		margin-left: 10rpx;
+		font-size: 30rpx;
+	}
 </style>

+ 15 - 10
pages/login/forgotPassword.vue

@@ -15,22 +15,22 @@
 				<u-form-item label="验证码" borderBottom>
 					<u--input v-model="info.smsCode" border="none" clearable placeholder="请输入手机验证码" maxlength="6"
 						placeholderStyle="color:#999">
-						<template slot="suffix">
-							<u-code ref="uCode2" @change="codeChange2" keep-running start-text="发送验证码"
-								style="color: #F9E000;" uniqueKey="forgotPassword"></u-code>
-							<view @tap="getCode2" :text="tips2" class="u-page__code-text">{{tips2}}</view>
-						</template>
 					</u--input>
+					<view class="suffixClass dis">
+						<u-code ref="uCode2" @change="codeChange2" keep-running start-text="发送验证码"
+							style="color: #F9E000;" uniqueKey="forgotPassword"></u-code>
+						<view @tap="getCode2" :text="tips2" class="u-page__code-text">{{tips2}}</view>
+					</view>
 				</u-form-item>
 				<u-form-item label="新密码" borderBottom>
 					<u--input v-model="info.password" border="none" clearable placeholder="请输入密码"
 						placeholderStyle="color:#999" :password="isHidePassword">
-						<template slot="suffix">
-							<image class="icon-img"
-								:src="isHidePassword?'/static/image/login/icon-hide.png':'/static/image/login/icon-show.png'"
-								mode="" @tap="isHidePassword=!isHidePassword"></image>
-						</template>
 					</u--input>
+					<view class="suffixClass">
+						<image class="icon-img"
+							:src="isHidePassword?'/static/image/login/icon-hide.png':'/static/image/login/icon-show.png'"
+							mode="" @tap="isHidePassword=!isHidePassword"></image>
+					</view>
 				</u-form-item>
 			</u--form>
 			<view class="performLogin">
@@ -241,6 +241,11 @@
 		font-size: 26rpx;
 	}
 
+	.suffixClass {
+		margin-left: 10rpx;
+		font-size: 30rpx;
+	}
+
 	::v-deep {
 		.u-form-item__body {
 			padding: 34rpx 0;

+ 11 - 0
pages/login/login.vue

@@ -77,6 +77,7 @@
 			mode="center" width="90%">
 			<template #content>
 				<view class="codemodal">
+					<!-- #ifdef H5 -->
 					<u--input v-model="info.captcha" border="bottom" clearable placeholder="请输入图形验证码" maxlength="5"
 						placeholderStyle="color:#999" style="padding: 34rpx 0;box-sizing: border-box;">
 						<template slot="suffix">
@@ -84,6 +85,16 @@
 							</image>
 						</template>
 					</u--input>
+					<!-- #endif -->
+					<!-- #ifdef APP-PLUS -->
+					<u-input v-model="info.captcha" border="bottom" clearable placeholder="请输入图形验证码" maxlength="5"
+						placeholderStyle="color:#999" style="padding: 34rpx 0;box-sizing: border-box;">
+						<template slot="suffix">
+							<image :src="imgcodesrc" mode="" @tap="refreshCaptcha" style="width: 146rpx;height: 52rpx;">
+							</image>
+						</template>
+					</u-input>
+					<!-- #endif -->
 					<view class="dis a-c j-end mt-1">
 						<text style="font-size: 26rpx; color: #666;" @tap="refreshCaptcha">看不清?换一张</text>
 					</view>

+ 13 - 1
pages/login/smsCode.vue

@@ -6,6 +6,7 @@
 			<text class="title">验证码已发送至:+86 {{this.info.userName || mobile}}</text>
 		</view>
 		<view class="info ">
+			<!-- #ifdef H5 -->
 			<u--input v-model="info.smsCode" border="bottom" clearable maxlength="6" placeholderStyle="color:#999"
 				style="padding: 34rpx 0;box-sizing: border-box;" :focus="true">
 				<template slot="suffix">
@@ -14,8 +15,19 @@
 					<view @tap="getCode2" :text="tips2" class="u-page__code-text">{{tips2}}</view>
 				</template>
 			</u--input>
+			<!-- #endif -->
+			<!-- #ifdef APP-PLUS -->
+			<u-input v-model="info.smsCode" border="bottom" clearable maxlength="6" placeholderStyle="color:#999"
+				style="padding: 34rpx 0;box-sizing: border-box;" :focus="true">
+				<template slot="suffix">
+					<u-code ref="uCode2" @change="codeChange2" keep-running start-text="发送验证码" style="color: #F9E000;"
+						uniqueKey="smsCode"></u-code>
+					<view @tap="getCode2" :text="tips2" class="u-page__code-text">{{tips2}}</view>
+				</template>
+			</u-input>
+			<!-- #endif -->
 		</view>
-		<view v-if="routepage == 'pages/set/accountCancellation'" class=" btn dis a-c j-c  " @click="confirmLogout">
+		<view v-if="routepage == 'pages/set/accountCancellation'" class=" btn dis a-c j-c " @click="confirmLogout">
 			确定注销
 		</view>
 	</view>

+ 12 - 0
pages/my/changePhoneNumber.vue

@@ -8,6 +8,7 @@
 						placeholderStyle="color:#999"></u--input>
 				</u-form-item>
 				<u-form-item label="验证码" borderBottom>
+					<!-- #ifdef H5 -->
 					<u--input v-model="info.smsCode" border="none" clearable placeholder="请输入手机验证码" maxlength="6"
 						placeholderStyle="color:#999">
 						<template slot="suffix">
@@ -16,6 +17,17 @@
 							<view @tap="getCode2" :text="tips2" class="u-page__code-text">{{tips2}}</view>
 						</template>
 					</u--input>
+					<!-- #endif -->
+					<!-- #ifdef APP-PLUS -->
+					<u-input v-model="info.smsCode" border="none" clearable placeholder="请输入手机验证码" maxlength="6"
+						placeholderStyle="color:#999">
+						<template slot="suffix">
+							<u-code ref="uCode2" @change="codeChange2" uniqueKey="changePhoneNumber" keep-running
+								start-text="发送验证码" style="color: #F9E000;"></u-code>
+							<view @tap="getCode2" :text="tips2" class="u-page__code-text">{{tips2}}</view>
+						</template>
+					</u-input>
+					<!-- #endif -->
 				</u-form-item>
 			</u--form>
 		</view>

+ 9 - 4
pages/quote/modules/customPlan.vue

@@ -57,11 +57,11 @@
 								disabledColor="transparent" clearable :holdKeyboard="true" placeholder="请选择"
 								placeholderStyle="text-align:right;font-size:28rpx;" border="none"
 								style="pointer-events: none;">
-								<template slot="suffix">
-									<image src="/static/icon/quote/dateIcon.png" mode="">
-									</image>
-								</template>
 							</u--input>
+							<view class="suffixClass">
+								<image src="/static/icon/quote/dateIcon.png" mode="">
+								</image>
+							</view>
 						</u-form-item>
 						<u-form-item v-show="vehicleAndVesselTaxVo.taxRelifFlag == 4" label="完税凭证地区"
 							@click="taxPaidAreaCodeShow=true">
@@ -805,4 +805,9 @@
 		background-color: #FDE935;
 		border: 1rpx solid #FDE935;
 	}
+
+	.suffixClass {
+		margin-left: 10rpx;
+		font-size: 30rpx;
+	}
 </style>

+ 9 - 4
pages/quote/modules/standardPlan.vue

@@ -57,11 +57,11 @@
 								disabledColor="transparent" clearable :holdKeyboard="true" placeholder="请选择"
 								placeholderStyle="text-align:right;font-size:28rpx;" border="none"
 								style="pointer-events: none;">
-								<template slot="suffix">
-									<image src="/static/icon/quote/dateIcon.png" mode="">
-									</image>
-								</template>
 							</u--input>
+							<view class="suffixClass ml-1">
+								<image src="/static/icon/quote/dateIcon.png" mode="">
+								</image>
+							</view>
 						</u-form-item>
 						<u-form-item v-show="vehicleAndVesselTaxVo.taxRelifFlag == 4" label="完税凭证地区"
 							@click="taxPaidAreaCodeShow=true">
@@ -522,4 +522,9 @@
 			}
 		}
 	}
+
+	.suffixClass {
+		margin-left: 10rpx;
+		font-size: 30rpx;
+	}
 </style>

+ 9 - 4
pages/quote/premiumCalc1.vue

@@ -89,11 +89,11 @@
 						<u--input v-model="carInfo.transferDate" disabled disabledColor="#ffffff" clearable
 							suffixIconStyle="color:#333;font-size:40rpx" placeholder="请选择起保日期"
 							placeholderStyle="text-align:right;" border="none" style="pointer-events: none">
-							<template slot="suffix">
-								<image src="/static/icon/quote/dateIcon.png" mode="">
-								</image>
-							</template>
 						</u--input>
+						<view class="suffixClass">
+							<image src="/static/icon/quote/dateIcon.png" mode="">
+							</image>
+						</view>
 					</u-form-item>
 				</u--form>
 			</view>
@@ -1281,4 +1281,9 @@
 		padding: 30rpx 40rpx;
 		box-sizing: border-box;
 	}
+
+	.suffixClass {
+		margin-left: 10rpx;
+		font-size: 30rpx;
+	}
 </style>

+ 24 - 0
pages/registr/h5Registr.vue

@@ -20,6 +20,7 @@
 					<u--input v-model="info.mobile" border="none" clearable placeholder="请输入手机号" maxlength="11"
 						placeholderStyle="color:#999"></u--input>
 				</u-form-item>
+				<!-- #ifdef H5 -->
 				<u-form-item label="验证码" borderBottom>
 					<u--input v-model="info.smsCode" border="none" clearable placeholder="请输入手机验证码" maxlength="6"
 						placeholderStyle="color:#999">
@@ -40,6 +41,29 @@
 						</template>
 					</u--input>
 				</u-form-item>
+				<!-- #endif -->
+				<!-- #ifdef APP-PLUS -->
+				<u-form-item label="验证码" borderBottom>
+					<u-input v-model="info.smsCode" border="none" clearable placeholder="请输入手机验证码" maxlength="6"
+						placeholderStyle="color:#999">
+						<template slot="suffix">
+							<u-code ref="uCode2" @change="codeChange2" keep-running start-text="发送验证码"
+								style="color: #F9E000;" uniqueKey="h5Registr"></u-code>
+							<view @tap="getCode2" :text="tips2" class="u-page__code-text">{{tips2}}</view>
+						</template>
+					</u-input>
+				</u-form-item>
+				<u-form-item label="新密码" borderBottom>
+					<u-input v-model="info.password" border="none" clearable placeholder="请输入密码"
+						placeholderStyle="color:#999" :password="isHidePassword">
+						<template slot="suffix">
+							<image class="icon-img"
+								:src="isHidePassword?'/static/image/login/icon-hide.png':'/static/image/login/icon-show.png'"
+								mode="" @tap="isHidePassword=!isHidePassword"></image>
+						</template>
+					</u-input>
+				</u-form-item>
+				<!-- #endif -->
 			</u--form>
 			<view class="btn dis a-c j-c " @click="submitRegistr">
 				立即加入

+ 25 - 6
store/modules/user.js

@@ -1,11 +1,30 @@
+// 从持久化存储中读取初始值
+const getStorageItem = (key, defaultValue = "") => {
+	// #ifdef H5
+	try {
+		const item = window.sessionStorage.getItem(key);
+		return item ? JSON.parse(item) : defaultValue;
+	} catch (e) {
+		return defaultValue;
+	}
+	// #endif
+	// #ifndef H5
+	try {
+		return uni.getStorageSync(key) || defaultValue;
+	} catch (e) {
+		return defaultValue;
+	}
+	// #endif
+};
+
 export const state = {
 	//用户数据
-	userInfo: {},
-	userCheckInfo: {},
-	userLoginId: "",
-	token: "",
-	avatar: "",
-	userStatus: ""
+	userInfo: getStorageItem('userInfo', {}),
+	userCheckInfo: getStorageItem('userCheckInfo', {}),
+	userLoginId: getStorageItem('userLoginId', ""),
+	token: getStorageItem('token', ""),
+	avatar: getStorageItem('avatar', ""),
+	userStatus: getStorageItem('userStatus', "")
 };
 export const mutations = {
 	setUserModules(state, obj = {}) {