zhanghui 2 lat temu
rodzic
commit
8ee2647ece

+ 23 - 6
common/js/request.js

@@ -17,12 +17,29 @@ function service(options = {}) {
 			if (res.data.code !== 200) {
 				// 非成功状态码弹窗
 				console.log('错误信息:+++',res.data.msg)
-				uni.showToast({
-					icon: 'none',
-					duration: 3000,
-					title: '错误信息:'+`${res.data.msg}`
-				});
+
 				// 这里可以做一些状态码判断以及操作
+				if(res.data.code === 401){
+					uni.showToast({
+						icon: 'none',
+						duration: 3000,
+						title: '登录过期,即将跳转登录页'
+					});
+
+					setTimeout(()=>{
+						uni.navigateTo({
+							url:'/pages/login/login'
+						})
+					},3000)
+
+				}else{
+					uni.showToast({
+						icon: 'none',
+						duration: 3000,
+						title:'系统繁忙,请重试!'
+						// title: '错误信息:'+`${res.data.msg}`
+					});
+				}
 				// 返回错误信息
 				rejected(res)
 			} else {
@@ -36,7 +53,7 @@ function service(options = {}) {
 			uni.showToast({
 				icon: 'none',
 				duration: 3000,
-				title: err.errMsg
+				title: '服务器连接失败,请检查网络'
 			});
 			rejected(err);
 		};

+ 1 - 1
orderPages/bookService/index.vue

@@ -247,7 +247,7 @@ export default {
     },
 
     payItem(num) {
-      if (this.userInfo.balance < this.price) {
+      if (this.userInfo.balance*1 < this.price*1) {
         return
       }
       this.curServiceTab = num

+ 1 - 5
orderPages/serviceObject/index.vue

@@ -48,11 +48,7 @@
                 this.$api.listServiceObject(this.reqParm).then((res)=>{
                     console.log('++++++++++listServiceObject+++++++++++',res)
                     this.getImgUrlByOssId(res.data.data);
-                }).catch(() =>{
-                    uni.showToast({
-                        title: "操作失败"
-                    })
-                });
+                })
             },
             // 获取图片
              getImgUrlByOssId(data){

+ 2 - 12
orderPages/serviceTeacher/index.vue

@@ -59,12 +59,7 @@
 					console.log(res)
 					this.workPersonList = res.data.rows;
 					this.getImgUrlByOssId(res.data.rows)
-				}).catch((err) => {
-					console.log('+++++++++++++err++++++++++++++',err)
-					uni.showToast({
-						title: "操作失败"
-					})
-				});
+				})
 			},
       // 查询服务工作人员列表
       getServicePerson() {
@@ -72,12 +67,7 @@
           console.log(res)
           this.workPersonList = res.data.data;
           this.getImgUrlByOssId(res.data.data)
-        }).catch((err) => {
-          console.log('+++++++++++++err++++++++++++++',err)
-          uni.showToast({
-            title: "操作失败"
-          })
-        });
+        })
       },
 			// 获取图片
 			getImgUrlByOssId(data){

+ 1 - 1
pages.json

@@ -42,7 +42,7 @@
 		{
 			"path": "pages/login/login",
 			"style": {
-				"navigationBarTitleText": "",
+				"navigationBarTitleText": "登录",
 				"enablePullDownRefresh": false
 			}
 		}

+ 4 - 0
pages/login/login.vue

@@ -165,6 +165,10 @@
 										}
 									}
 								})
+							}else {
+								uni.switchTab({
+									url: '/pages/index/index',
+								})
 							}
 
 						})

+ 1 - 3
pages/order/index.vue

@@ -1,7 +1,6 @@
 <template>
 	<view class="content">
 
-		<u-sticky>
 <!--			<view ref="hContentWrap" class="hContentWrap h-content-wrap">-->
 <!--				<view class="tab-bar">-->
 <!--					<view class="tab-item" :class="{ active: currentTab === 0 }" @click="changeTab(0)">-->
@@ -19,7 +18,6 @@
             					transform: 'scale(1.05)'
        							 }" :current="tabIndex" @click="clickTab"></u-tabs>
 			</View>
-		</u-sticky>
 
 		<!-- 订单列表 -->
 		<view :style="{'height':windowHeight}">
@@ -313,7 +311,7 @@
 			},
 
 			payItem(num){
-				if (this.userInfo.balance < this.price){
+				if (this.userInfo.balance*1 < this.price*1){
 					return
 				}
 				this.curServiceTab = num