Qukatie 4 týždňov pred
rodič
commit
9b96d5f11d

+ 40 - 2
http/api.js

@@ -10,7 +10,36 @@ import {
 } from '@/utils/base64.js';
 import Request from '@/utils/luch-request/index.js';
 const http = new Request(options);
-http.interceptors.request.use((config) => { // 可使用async await 做异步操作
+let isTokenExpired = false;
+// 检查网络状态函数
+const checkNetworkStatus = () => {
+	return new Promise((resolve, reject) => {
+		uni.getNetworkType({
+			success: (res) => {
+				console.log(res)
+				if (res.networkType === 'none') {
+					reject(new Error('网络连接已断开'));
+				} else {
+					resolve(true);
+				}
+			},
+			fail: () => {
+				reject(new Error('网络状态检测失败'));
+			}
+		});
+	});
+};
+http.interceptors.request.use(async(config) => { // 可使用async await 做异步操作
+	try {
+		await checkNetworkStatus();
+	} catch (error) {
+		uni.showToast({
+			title: error.message,
+			icon: 'none',
+			duration: 3000
+		});
+		return Promise.reject(config);
+	}
 	// 假设有token值需要在头部需要携带
 	let accessToken = uni.getStorageSync('accessToken');
 	if (accessToken) {
@@ -83,15 +112,24 @@ http.interceptors.response.use((response) => {
 	}
 	return response.data;
 }, (response) => {
-	
+	if (response.statusCode === 0 || !response.statusCode) {
+		uni.showToast({
+			title: '网络连接中断,请检查网络设置',
+			icon: 'none',
+			duration: 3000
+		});
+		return Promise.reject(response);
+	}
 	/*  对响应错误做点什么 (statusCode !== 200)*/
 	if (response.data.code === 401) {
+		isTokenExpired = true;
 		uni.showModal({
 			title: '提示',
 			content: '登录状态失效,点击确定重新登录',
 			showCancel: false,
 			success: function(res) {
 				if (res.confirm) {
+					isTokenExpired = false;
 					uni.reLaunch({
 						url: '/pages/login/index'
 					});

+ 57 - 9
pages/home/claim/details.vue

@@ -49,8 +49,8 @@
 				</uni-forms-item>
 				<uni-forms-item name="claimReason" label="理赔原因">
 					<uni-easyinput v-model="form.claimReason" class="right-align" type="textarea"
-						placeholder-class="placeholder-right" :placeholder="form.auditStatus>0?' ':'请输入内容'" :inputBorder="false"
-						:disabled="form.auditStatus>0"></uni-easyinput>
+						placeholder-class="placeholder-right" :placeholder="form.auditStatus>0?' ':'请输入内容'"
+						:inputBorder="false" :disabled="form.auditStatus>0"></uni-easyinput>
 				</uni-forms-item>
 			</uni-forms>
 		</uni-section>
@@ -132,14 +132,23 @@
 		<!-- <view style="height: 200rpx;display: flex;align-items: center;justify-content: center;">
 			<debounce-button style="color:#ffffff;backgroundColor:#03803B;width: 400rpx;" @click="submit">提交材料</debounce-button>
 		</view> -->
-		<view style="padding:30rpx 20rpx;">
+		<!-- <view style="padding:30rpx 20rpx;">
 			<debounce-button v-if="!form.id" bgColor='#03803B' @click="submit">保存</debounce-button>
-			<view v-if="form.auditStatus==0"  style="display: flex;justify-content:space-around;width: 100%;">
+			<view v-if="form.auditStatus==0" style="display: flex;justify-content:space-around;width: 100%;">
 				<debounce-button bgColor='#03803B' style="width: 260rpx;" @click="submit">保存</debounce-button>
-				<debounce-button type="warn"  style="width: 260rpx;"
-					@click="approval">提交</debounce-button>
+				<debounce-button type="warn" style="width: 260rpx;" @click="approval">提交</debounce-button>
 			</view>
 			<debounce-button type="warn" v-if="form.auditStatus==1" @click="revoke">撤销审核</debounce-button>
+		</view> -->
+		<view  class="nav-bottom-height">
+		</view>
+		<view class="goods-nav-bottom">
+			<uni-goods-nav v-if="!form.id" :fill="true" :options="[]" :buttonGroup="buttonGroup"
+				@buttonClick="buttonClick" />
+			<uni-goods-nav v-if="form.auditStatus==0" :fill="true" :options="[]" :buttonGroup="buttonGroup2"
+				@buttonClick="buttonClick2" />
+			<uni-goods-nav v-if="form.auditStatus==1" :fill="true" :options="[]" :buttonGroup="buttonGroup3"
+				@buttonClick="buttonClick3" />
 		</view>
 	</view>
 </template>
@@ -160,6 +169,27 @@
 	export default {
 		data() {
 			return {
+				buttonGroup: [{
+					text: '保存',
+					backgroundColor: '#03803B',
+					color: '#fff'
+				}],
+				buttonGroup2: [{
+						text: '保存',
+						backgroundColor: '#03803B',
+						color: '#fff'
+					},
+					{
+						text: '提交',
+						backgroundColor: '#e64340',
+						color: '#fff'
+					}
+				],
+				buttonGroup3: [{
+					text: '撤销审核',
+					backgroundColor: '#e64340',
+					color: '#fff'
+				}],
 				form: {
 					file1: null,
 					file2: null,
@@ -180,7 +210,6 @@
 					value: 'code',
 					children: 'children'
 				},
-				addressData: [],
 				labelList: [],
 				corpsTypeList: [],
 				storeAttributesList: [],
@@ -189,12 +218,29 @@
 			}
 		},
 		onLoad(option) {
-			// this.addressData = JSON.parse(uni.getStorageSync("addressData"))
 			if (option && option.id) {
 				this.getDetail(option.id)
 			}
 		},
 		methods: {
+			buttonClick(e) {
+				if (e.index == 0) {
+					this.submit()
+				}
+			},
+			buttonClick2(e) {
+				if (e.index == 0) {
+					this.submit()
+				}
+				if (e.index == 1) {
+					this.approval()
+				}
+			},
+			buttonClick3(e) {
+				if (e.index == 0) {
+					this.revoke()
+				}
+			},
 			removeByIdFilter(arr, id) {
 				return arr.filter(item => item.id !== id);
 			},
@@ -844,9 +890,11 @@
 			}
 		}
 	}
-	::v-deep .uni-section{
+
+	::v-deep .uni-section {
 		padding: 0 62rpx;
 	}
+
 	::v-deep .file-picker__box {
 		width: 280rpx !important;
 		height: 280rpx !important;

+ 9 - 8
pages/home/index.vue

@@ -42,13 +42,13 @@
 						</view>
 					</view>
 				</uni-grid-item>
-				<!-- 			<uni-grid-item>
-					<view class="grid-item-box" @click="allClick('注册')">
+				<!-- <uni-grid-item>
+					<view class="grid-item-box" @click="allClick('新建轮胎保')">
 						<view class="grid-item-box-img">
 							<image style="width: 100rpx;height: 80rpx;" src="@/static/images/home/home (17).png" />
 						</view>
 						<view class="grid-item-box-text">
-							注册
+							新建
 						</view>
 					</view>
 				</uni-grid-item> -->
@@ -143,7 +143,7 @@
 			allClick(name) {
 				if (name == '新建轮胎保') {
 					uni.navigateTo({
-						url: '/pages/home/insurance/rules'
+						url: '/pages/home/insurance/details'
 					});
 				}
 				if (name == '轮胎保') {
@@ -167,18 +167,18 @@
 						onlyFromCamera: true,
 						success: function(res) {
 							let obj = JSON.parse(res.result)
-							if(obj.phone==uni.getStorageSync('phoneInfo')){
+							if (obj.phone == uni.getStorageSync('phoneInfo')) {
 								uni.navigateTo({
 									url: '/pages/home/insurance/details?id=' + obj.tireInsuranceId
 								});
-							}else{
+							} else {
 								uni.showToast({
 									title: '轮胎保车主身份识别不正确',
 									icon: 'none',
 									duration: 2000
 								});
 							}
-							
+
 						}
 					});
 				}
@@ -198,7 +198,7 @@
 		.background-image {
 			position: absolute;
 			/* 将图片置于组件后面 */
-			top:-100rpx
+			top: -100rpx
 		}
 
 		::v-deep .uni-searchbar {
@@ -257,6 +257,7 @@
 				flex-direction: column;
 				align-items: center;
 				padding: 50rpx 0;
+
 				.uni-grid-item__box {
 					justify-content: center;
 				}

+ 25 - 12
pages/home/insurance/details.vue

@@ -17,14 +17,12 @@
 			<uni-forms ref="form1" :modelValue="form" :border="true" label-width="80">
 				<uni-forms-item name="consumerName" label="联系人" required>
 					<uni-easyinput v-model="form.consumerName" class="right-align" placeholder-class="placeholder-right"
-						placeholder="请输入内容" :inputBorder="false" :disabled="true"
-						:clearable="false"></uni-easyinput>
+						placeholder="请输入内容" :inputBorder="false" :disabled="true" :clearable="false"></uni-easyinput>
 				</uni-forms-item>
 				<uni-forms-item name="consumerPhone" label="电话" required>
 					<uni-easyinput v-model="form.consumerPhone" class="right-align" type="number"
-						placeholder-class="placeholder-right" placeholder="请输入内容" :inputBorder="false"
-						:disabled="true" :clearable="false" maxlength="11"
-						@change="photoChange"></uni-easyinput>
+						placeholder-class="placeholder-right" placeholder="请输入内容" :inputBorder="false" :disabled="true"
+						:clearable="false" maxlength="11" @change="photoChange"></uni-easyinput>
 				</uni-forms-item>
 				<!-- <uni-forms-item name="vehicleNumber" label="车牌号" required>
 					<uni-easyinput v-model="form.vehicleNumber" class="right-align"
@@ -75,8 +73,8 @@
 					<uni-forms-item name="tyreNo" label="胎号">
 						<view style="display: flex;align-items: center;">
 							<uni-easyinput v-model="item.tyreNo" class="right-align"
-								placeholder-class="placeholder-right" :placeholder="form.status>0?' ':'请输入胎号'" :inputBorder="false"
-								:disabled="true" :clearable="false"
+								placeholder-class="placeholder-right" :placeholder="form.status>0?' ':'请输入胎号'"
+								:inputBorder="false" :disabled="true" :clearable="false"
 								@change="getMaterialDetail($event,activeTab)"></uni-easyinput>
 							<!-- <uni-icons v-if="!form.status>0" type="scan" size="24" color='#03803B'
 								@click="allClick('识别胎号',activeTab)"></uni-icons> -->
@@ -137,12 +135,16 @@
 		<u-keyboard ref="uKeyboard" mode="car" :show="carShow" @change="carChange" @backspace="backspace"
 			:showCancel="false" :showConfirm="false" @close="carShow=false" :safeAreaInsetBottom="true"
 			:autoChange="true"></u-keyboard>
-		<view style="padding:30rpx 20rpx;">
-			<!-- <debounce-button v-if="!form.id" bgColor='#03803B' @click="submit">保存</debounce-button> -->
-
+	<!-- 	<view style="padding:30rpx 20rpx;">
 			<view v-if="form.status==0" style="display: flex;">
-				<debounce-button type="warn"  @click="approval" style="width: 100%;">提交</debounce-button>
+				<debounce-button type="warn" @click="approval" style="width: 100%;">提交</debounce-button>
 			</view>
+		</view> -->
+		<view v-if="form.status==0" class="nav-bottom-height">
+		</view>
+		<view class="goods-nav-bottom" v-if="form.status==0">
+			<uni-goods-nav  :fill="true" :options="[]" :buttonGroup="buttonGroup"
+				@buttonClick="buttonClick" />
 		</view>
 	</view>
 </template>
@@ -166,6 +168,11 @@
 	export default {
 		data() {
 			return {
+				buttonGroup: [{
+					text: '提交',
+					backgroundColor: '#e64340',
+					color: '#fff'
+				}],
 				carShow: false,
 				form: {
 					consumerName: null,
@@ -276,6 +283,11 @@
 			}
 		},
 		methods: {
+			buttonClick(e) {
+				if (e.index == 0) {
+					this.approval()
+				}
+			},
 			// 处理输入框聚焦事件
 			handleInputFocus() {
 				// if (this.form.status > 0) return
@@ -782,6 +794,7 @@
 											duration: 2000
 										});
 									}, 10);
+									uni.setStorageSync('isUpdate', true)
 									_this.getDetail(res.data.id)
 								})
 								.catch(() => {
@@ -1011,4 +1024,4 @@
 		pointer-events: none !important;
 		touch-action: none !important;
 	}
-</style>
+</style>

+ 2 - 4
pages/home/insurance/index.vue

@@ -42,11 +42,9 @@
 								</view>
 							</view>
 							<view class="list-item">
-								<view>
+								<view  style="display: flex;">
 									联系人: <uni-icons type="person" size="20" color="#03803B"></uni-icons>{{item.storeContact||'暂无数据'}}
-								</view>
-								<view style="display: flex;align-items: center;" @click.stop="makeTel(item.storePhone)">
-									<uni-icons type="phone" size="20" color="#03803B"></uni-icons>
+									<uni-icons style="margin-left: 20rpx;" type="phone" size="20" color="#03803B"></uni-icons>
 									<view class="">
 										{{item.storePhone||'暂无数据'}}
 									</view>

+ 25 - 7
static/customicons.css

@@ -1,20 +1,38 @@
 @font-face {
-  font-family: "customicons"; /* Project id 2878519 */
-  src:url('/static/customicons.ttf') format('truetype');
+	font-family: "customicons";
+	/* Project id 2878519 */
+	src: url('/static/customicons.ttf') format('truetype');
 }
+.nav-bottom-height {
+	height: calc(50px + env(safe-area-inset-bottom)) !important;
+	background-color: #ffffff;
+}
+.goods-nav-bottom {
+	// display: flex;
+	// flex-direction: column;
+	position: fixed;
+	z-index: 1000;
+	left: 0;
+	right: 0;
+	bottom: 0;
+	/* height: calc(50px + env(safe-area-inset-bottom)); */
 
+}
+.uni-tab__cart-box{
+	padding-bottom:env(safe-area-inset-bottom);
+}
 .customicons {
-  font-family: "customicons" !important;
+	font-family: "customicons" !important;
 }
 
 .youxi:before {
-  content: "\e60e";
+	content: "\e60e";
 }
 
 .wenjian:before {
-  content: "\e60f";
+	content: "\e60f";
 }
 
 .zhuanfa:before {
-  content: "\e610";
-}
+	content: "\e610";
+}