瀏覽代碼

7.27反馈表bug基本已修改

李万涛 1 年之前
父節點
當前提交
a52a8eb155

+ 19 - 21
pages.json

xqd
@@ -18,29 +18,27 @@
 				"enablePullDownRefresh": true,
 				"backgroundColor": "#F2F2F2"
 			}
-
 		},
-		{
-			"path": "pages/index/index",
-			// "aliasPath": "/",
-			"style": {
-				"navigationBarTextStyle": "black",
-				"navigationBarTitleText": "首页",
-				"navigationBarBackgroundColor": "#F5FFFD",
-				"backgroundColor": "#fff",
-				"onReachBottomDistance": 20,
-				// #ifdef H5
-				"navigationStyle": "custom",
-				// #endif
-				"enablePullDownRefresh": false
-			},
-			"meta": {
-				"auth": false,
-				"title": ""
-			}
-		}
+		// {
+		// 	"path": "pages/index/index",
+		// 	"style": {
+		// 		"navigationBarTextStyle": "black",
+		// 		"navigationBarTitleText": "首页",
+		// 		"navigationBarBackgroundColor": "#F5FFFD",
+		// 		"backgroundColor": "#fff",
+		// 		"onReachBottomDistance": 20,
+		// 		// #ifdef H5
+		// 		"navigationStyle": "custom",
+		// 		// #endif
+		// 		"enablePullDownRefresh": false
+		// 	},
+		// 	"meta": {
+		// 		"auth": false,
+		// 		"title": ""
+		// 	}
+		// }, 
 
-		, {
+		{
 			"path": "pages/user/user",
 			"style": {
 				"navigationBarTitleText": "个人中心",

+ 21 - 5
pages/robot/generate/index.scss

xqd xqd xqd xqd xqd xqd
@@ -235,7 +235,8 @@ page {
 					display: flex;
 					flex-wrap: wrap;
 					.sel{
-						border: 2rpx solid #26b3a0;
+						border:6rpx solid #26b3a0;
+						padding: 5rpx;
 					}
 					image{
 						width: 128rpx;
@@ -276,7 +277,8 @@ page {
 					}
 				}
 				.sel{
-					border: 2rpx solid #26b3a0;
+					border:6rpx solid #26b3a0;
+					padding: 5rpx;
 				}
 			}
 			
@@ -480,7 +482,8 @@ page {
 					display: flex;
 					flex-wrap: wrap;
 					.sel{
-						border: 2rpx solid #26b3a0;
+						border:6rpx solid #26b3a0;
+						padding: 5rpx;
 					}
 					image{
 						width: 128rpx;
@@ -519,7 +522,8 @@ page {
 					}
 				}
 				.sel{
-					border: 2rpx solid #26b3a0;
+					border:6rpx solid #26b3a0;
+					padding: 5rpx;
 				}
 			}
 			
@@ -617,6 +621,7 @@ page {
 		.item{
 			display: flex;
 			align-items: center;
+		
 			.label{
 			}
 			.con{
@@ -639,9 +644,20 @@ page {
 		font-size: 24rpx;
 		color: #999;
 		text-align: center;
+		
+		height: 65rpx;
+		text-overflow: ellipsis;
+		 display: -webkit-box;     /* 弹性盒旧式语法 */
+		  -webkit-box-orient: vertical;    /* 经过个人实测,vertical或horizontal都没问题,只是必须设置该属性 */
+		  -webkit-line-clamp: 2;    /* 限制两行 */
+		  overflow: hidden;
 	}
 	
 	.selTxt{
 		color:#26b3a0 !important;
 		font-weight: 600;
-	}
+	}
+	
+	
+	
+	

+ 3 - 1
pages/robot/generate/index.vue

xqd
@@ -125,7 +125,9 @@
 
 					<view class="filterConList" style="max-height: 500rpx;min-height: 500rpx;overflow-y: scroll;">
 						<view class="item" v-for="(item,index) in allList" @click="handleVoiceSel(item,index)">
-							<image :class="[currTabIndexAll==index?'sel':'']" :src="item.url" mode="">
+							<view class="imgBox">
+								<image :class="[currTabIndexAll==index?'sel':'']" :src="item.url" mode="">
+							</view>
 							</image>
 							<view class="nameDes">
 								{{item.title}}

+ 9 - 7
pages/robot/index.scss

xqd
@@ -86,16 +86,18 @@ page {
 							// width: 320rpx;
 							width: 95%;
 							padding-right: 25rpx;
+							// height: 100rpx;
+							// line-height: 100rpx;
 							.left{
-								
+								font-size: 32rpx;
 							}
 							.delIcon{
-								width: 32rpx;
-								height: 32rpx;
-								image{
-									width: 100%;
-									height: 100%;
-								}
+								// width: 32rpx;
+								// height: 32rpx;
+								// image{
+								// 	width: 100%;
+								// 	height: 100%;
+								// }
 							}
 						}
 					}

+ 44 - 34
pages/robot/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -27,12 +27,12 @@
 							<text class="iconfont icon-caogao" style="color: white;font-size: 46rpx;"></text>
 						</view>
 						<view class="bottom">
-							<view class="left">
+							<view class="left" :style="{fontSize:isPc?'64rpx':'32rpx'}">
 								{{item.name}}
 							</view>
 							<view class="delIcon" @click.stop="delDraft(item,index)">
 								<!-- <image src="/static/images/head.jpg" mode=""></image> -->
-								<text class="iconfont icon-shanchu" style="font-size: 32rpx;"></text>
+								<text class="iconfont icon-shanchu" :style="{fontSize:isPc?'64rpx':'32rpx'}"></text>
 							</view>
 						</view>
 					</view>
@@ -50,14 +50,6 @@
 							</image>
 
 							<view class="tipBox" v-else>
-								<!-- <view class="preloader_1" :style="{left:isPc?'':'40%'}">
-									<view></view>
-									<view></view>
-									<view></view>
-									<view></view>
-									<view></view>
-								</view> -->
-
 								<view class="preloader_1" style="">
 									<view></view>
 									<view></view>
@@ -76,7 +68,7 @@
 
 						</view>
 						<view class="bottom">
-							<view class="left">
+							<view class="left" :style="{fontSize:isPc?'64rpx':'32rpx'}">
 								{{item.name}}
 							</view>
 							<!-- <view class="left">
@@ -84,7 +76,8 @@
 							</view> -->
 							<view class="delIcon" @click.stop="handleShowMoreMenu(item,index)">
 								<!-- <image src="/static/images/head.jpg" mode=""></image> -->
-								<text class="iconfont icon-gengduo-shuxiang" style="font-size: 32rpx;"></text>
+								<text class="iconfont icon-gengduo-shuxiang"
+									:style="{fontSize:isPc?'64rpx':'32rpx'}"></text>
 							</view>
 						</view>
 					</view>
@@ -320,7 +313,7 @@
 			async getIndexData() {
 				let res = await workList({})
 				if (res.code == 0) {
-					uni.stopPullDownRefresh()
+					// uni.stopPullDownRefresh()
 					this.workList = res.data
 					// let parm = {}
 					// res.data.forEach((item, index) => {
@@ -338,7 +331,7 @@
 
 				let res1 = await draftList({})
 				if (res1.code == 0) {
-					uni.stopPullDownRefresh()
+					// uni.stopPullDownRefresh()
 					this.draftList = res1.data
 					console.log('数字人草稿列表返回值:', res1);
 				} else {
@@ -347,6 +340,10 @@
 						icon: 'none'
 					})
 				}
+				if (res1.code == 0 && res.code == 0) {
+					uni.stopPullDownRefresh()
+				}
+
 			},
 			goWorkDetail(item) {
 				if (item.state == 0) {
@@ -372,25 +369,38 @@
 				this.showMoreMenu = true
 			},
 			async handleConfirm(e) {
+				let _this = this
 				this.showMoreMenu = false
 				if (e.value[0] == '删除') {
-					let res = await delWork({
-						id: this.delItem.id
-					})
-					if (res.code == 0) {
-						this.workList.splice(this.delIndex, 1)
+					uni.showModal({
+						title: '提示',
+						confirmColor: '#26b3a0',
+						content: '是否确认删除:' + _this.delItem.name + '?',
+						success: async (res1) => {
+							if (res1.confirm) {
+								let res = await delWork({
+									id: _this.delItem.id
+								})
+								if (res.code == 0) {
+									_this.workList.splice(this.delIndex, 1)
+
+									console.log('删除数字人返回值:', res);
+									uni.showToast({
+										title: '数字人:' + _this.delItem.name + '删除成功!',
+										icon: 'success'
+									})
+								} else {
+									uni.showToast({
+										title: res.msg,
+										icon: 'none'
+									})
+								}
 
-						console.log('删除数字人返回值:', res);
-						uni.showToast({
-							title: '数字人:' + this.delItem.name + '删除成功!',
-							icon: 'success'
-						})
-					} else {
-						uni.showToast({
-							title: res.msg,
-							icon: 'none'
-						})
-					}
+							} else if (res1.cancel) {
+
+							}
+						}
+					});
 
 				} else if (e.value[0] == '复制链接') {
 					uni.setClipboardData({
@@ -445,7 +455,7 @@
 
 							const downloadTask = uni.downloadFile({
 								url: _this.delItem.url, //文件链接
-								timeout:99999999,
+								timeout: 99999999,
 								success: (res) => {
 									if (res.statusCode === 200) {
 										var oA = document.createElement("a");
@@ -493,13 +503,13 @@
 
 							let _this = this
 							// this.delItem.url = 'http://www.liwantao.top/test.mp4'
-							
+
 							var oA = document.createElement("a");
 							oA.download = _this.delItem.name;
-							oA.href =_this.delItem.url; 
+							oA.href = _this.delItem.url;
 							document.body.appendChild(oA);
 							oA.click();
-							oA.remove(); 
+							oA.remove();
 						}
 					}
 				}

+ 109 - 0
pages/robot/workDetail/index.scss

xqd
@@ -23,5 +23,114 @@ page {
 		}
 	}
 	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	/* 全屏轮播  start*/
+	.card-swiper {
+		height: calc(100vh - 85px)!important;
+	}
+	
+	.card-swiper swiper-item {
+		width: 750rpx !important;
+		left: 0rpx;
+		box-sizing: border-box;
+		overflow: initial;
+		background: #000;
+	}
+	
+	.card-swiper swiper-item .swiper-item {
+		// width: 100%;
+		// display: block;
+		// height: 100vh;
+		// border-radius: 0rpx;
+		// transform: scale(0.9);
+		// transition: all 0.2s ease-in 0s;
+		// will-change: transform;
+		// overflow: hidden;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		height: 100%;
+		background: #000;
+	}
+	
+	.card-swiper swiper-item.cur .swiper-item {
+		transform: scale(1);
+		transition: all 0.2s ease-in 0s;
+		will-change: transform;
+	}
+	
+	.image-banner {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+	
+	.image-banner image {
+		width: 100%;
+		// height: 100%;
+	}
+	
+	/* 轮播指示点 start*/
+	.indication {
+		z-index: 9999;
+		width: 100%;
+		height: 36rpx;
+		position: fixed;
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		justify-content: center;
+	}
+	
+	.spot {
+		background-color: #FFFFFF;
+		opacity: 0.6;
+		width: 10rpx;
+		height: 10rpx;
+		border-radius: 20rpx;
+		top: calc(-280rpx - env(safe-area-inset-bottom) / 2);
+		top: calc(-280rpx - constant(safe-area-inset-bottom));
+		margin: 0 8rpx !important;
+		position: relative;
+	}
+	
+	.spot.active {
+		opacity: 1;
+		width: 30rpx;
+		background-color: #FFFFFF;
+	}
+	
+	.lazy-load {
+		background: #000;
+		display: grid;
+		align-items: center;
+		padding-bottom: env(safe-area-inset-bottom);
+		// height: 100%;
+	}
+	
+	.lazy-load view {
+		width: 100%;
+	
+	}
+	
+	.lazy-loading{
+		background: #000;
+		height: 100%;
+		
+	}
 
 	

+ 7 - 1
pages/user/signin.vue

xqd xqd
@@ -390,6 +390,8 @@
 						account: this.accountLogin.account,
 						password: this.accountLogin.password
 					});
+
+					console.log('登录返回值:', res, res.data.token);
 					if (res.code == 0) {
 						uni.setStorageSync('token', res.data.token)
 						uni.showToast({
@@ -401,7 +403,11 @@
 								url: '/pages/robot/index'
 							})
 						}, 1500)
-						console.log('登录返回值:', res, res.data.token);
+					} else {
+						uni.showToast({
+							title: res.msg,
+							icon: 'none'
+						})
 					}
 				}
 				return

+ 335 - 345
tuniao-ui/components/tn-nav-bar/tn-nav-bar.vue

xqd
@@ -1,355 +1,345 @@
 <template>
-  <view
-    class="tn-custom-nav-bar-class tn-custom-nav-bar"
-    :style="[navBarStyle]"
-  >
-  	<view
-      class="tn-custom-nav-bar__bar"
-      :class="[barClass]"
-      :style="[barStyle]"
-    >
-      <view v-if="isBack">
-        <view v-if="customBack">
-          <view 
-            :style="{
+	<view class="tn-custom-nav-bar-class tn-custom-nav-bar" :style="[navBarStyle]">
+		<view class="tn-custom-nav-bar__bar" :class="[barClass]" :style="[barStyle]">
+			<view v-if="isBack">
+				<view v-if="customBack">
+					<view :style="{
               width: customBackStyleInfo.width + 'px',
               height: customBackStyleInfo.height + 'px',
               marginLeft: customBackStyleInfo.left + 'px'
-            }"
-          >
-            <slot name="back"></slot>
-          </view>
-        </view>
-        <view v-else class="tn-custom-nav-bar__bar__action" @tap="handlerBack">
-        	<text class="tn-custom-nav-bar__bar__action--nav-back" :class="[`tn-icon-${backIcon}`]"></text>
-        	<text class="tn-custom-nav-bar__bar__action--nav-back-text" v-if="backTitle">{{ backTitle }}</text>
-        </view>
-      </view>
-  		<view class="tn-custom-nav-bar__bar__content" :style="[contentStyle]">
-  			<slot></slot>
-  		</view>
-  		<view>
-        <slot name="right"></slot>
-      </view>
-  	</view>
-  </view>
+            }">
+						<slot name="back"></slot>
+					</view>
+				</view>
+				<view v-else class="tn-custom-nav-bar__bar__action" @tap="handlerBack">
+					<text class="tn-custom-nav-bar__bar__action--nav-back" :class="[`tn-icon-${backIcon}`]"></text>
+					<text class="tn-custom-nav-bar__bar__action--nav-back-text" v-if="backTitle">{{ backTitle }}</text>
+				</view>
+			</view>
+			<view class="tn-custom-nav-bar__bar__content" :style="[contentStyle]">
+				<slot></slot>
+			</view>
+			<view>
+				<slot name="right"></slot>
+			</view>
+		</view>
+	</view>
 </template>
 
 <script>
-  import componentsColorMixin from '../../libs/mixin/components_color.js'
-  export default {
-    name: 'tn-nav-bar',
-    mixins: [componentsColorMixin],
-    props: {
-      // 层级
-      zIndex: {
-        type: Number,
-        default: 0
-      },
-      // 导航栏的高度
-      height: {
-        type: Number,
-        default: 0
-      },
-      // 高度单位
-      unit: {
-        type: String,
-        default: 'px'
-      },
-      // 是否显示返回按钮
-      isBack: {
-        type: Boolean,
-        default: true
-      },
-      // 返回按钮的图标
-      backIcon: {
-        type: String,
-        default: 'left'
-      },
-      // 返回按钮旁显示的文字
-      backTitle: {
-        type: String,
-        default: '返回'
-      },
-      // 透明状态栏
-      alpha: {
-        type: Boolean,
-        default: false
-      },
-      // 是否固定在顶部
-      fixed: {
-        type: Boolean,
-        default: true
-      },
-      // 是否显示底部阴影
-      bottomShadow: {
-        type: Boolean,
-        default: true
-      },
-      // 是否自定义返回按钮
-      customBack: {
-        type: Boolean,
-        default: false
-      },
-      // 返回前回调
-      beforeBack: {
-        type: Function,
-        default: null
-      }
-    },
-    computed: {
-      navBarStyle() {
-        let style = {}
-        style.height = this.height === 0 ? this.customBarHeight + this.unit : this.height + this.unit
-        if (this.fixed) {
-          style.position = 'fixed'
-        }
-        style.zIndex = this.elZIndex
-        
-        return style
-      },
-      barClass() {
-        let clazz = ''
-        if (this.backgroundColorClass) {
-          clazz += ` ${this.backgroundColorClass}`
-        }
-        if (this.fontColorClass) {
-          clazz += `${this.fontColorClass}`
-        }
-        if (this.fixed) {
-          clazz += ' tn-custom-nav-bar__bar--fixed'
-        }
-        if (this.alpha) {
-          clazz += ' tn-custom-nav-bar__bar--alpha'
-        }
-        if (this.bottomShadow) {
-          clazz += ' tn-custom-nav-bar__bar--bottom-shadow'
-        }
-        
-        return clazz
-      },
-      barStyle() {
-        let style = {}
-        style.height = this.height === 0 ? this.customBarHeight + this.unit : this.height + this.unit
-        
-        if (this.fixed) {
-          style.paddingTop = this.statusBarHeight + 'px'
-        }
-        
-        if(!this.backgroundColorClass) {
-          style.backgroundColor = this.backgroundColor !== '' ? this.backgroundColor : '#FFFFFF'
-        }
-        if (!this.fontColorClass && this.fontColor) {
-          style.color= this.fontColor
-        }
-        
-        style.zIndex = this.elZIndex
-        
-        return style
-      },
-      contentStyle() {
-        let style = {}
-        style.top = this.fixed ? this.statusBarHeight + 'px' : '0px'
-        style.height = this.height === 0 ? (this.customBarHeight - this.statusBarHeight) + this.unit : this.height + this.unit
-        style.lineHeight = style.height
-        
-        if (this.isBack) {
-          if (this.customBack) {
-            const width = (this.customBackStyleInfo.width + this.customBackStyleInfo.left) * 2
-            style.width = `calc(100% - ${width}px)`
-          } else {
-            style.width = 'calc(100% - 340rpx)'
-          }
-        } else {
-          style.width = '100%'
-        }
-        
-        return style
-      },
-      elZIndex() {
-        return this.zIndex ? this.zIndex : this.$t.zIndex.navbar
-      }
-    },
-    data() {
-      return {
-        // 状态栏的高度
-        statusBarHeight: 0,
-        // 自定义导航栏的高度
-        customBarHeight: 0,
-        // 自定义返回按钮时,返回容器的宽高边距信息
-        customBackStyleInfo: {
-          width: 86,
-          height: 32,
-          left: 15
-        }
-      }
-    },
-    mounted() {
-      // 获取vuex中的自定义顶栏的高度
-      this.updateNavBarInfo()
-    },
-    created() {
-      // 获取胶囊信息
-      // #ifdef MP-WEIXIN
-      let custom = wx.getMenuButtonBoundingClientRect()
-      this.customBackStyleInfo.width = custom.width
-      this.customBackStyleInfo.height = custom.height
-      this.customBackStyleInfo.left = uni.upx2px(750) - custom.right
-      // #endif
-    },
-    methods: {
-      // 更新导航栏的高度
-      async updateNavBarInfo() {
-        // 获取vuex中的自定义顶栏的高度
-        let customBarHeight = this.vuex_custom_bar_height
-        let statusBarHeight = this.vuex_status_bar_height
-        // 如果获取失败则重新获取
-        if (!customBarHeight) {
-          try {
-            const navBarInfo = await this.$t.updateCustomBar()
-            customBarHeight = navBarInfo.customBarHeight
-            statusBarHeight = navBarInfo.statusBarHeight
-          } catch(e) {
-            setTimeout(() => {
-              this.updateNavBarInfo()
-            }, 10)
-            return
-          }
-        }
-        
-        // 更新vuex中的导航栏信息
-        this && this.$t.vuex('vuex_status_bar_height', statusBarHeight)
-        this && this.$t.vuex('vuex_custom_bar_height', customBarHeight)
-        
-        this.customBarHeight = customBarHeight
-        this.statusBarHeight = statusBarHeight
-      },
-      // 处理返回事件
-      async handlerBack() {
-        if (this.beforeBack && typeof(this.beforeBack) === 'function') {
-          // 执行回调,同时传入索引当作参数
-          // 在微信,支付宝等环境(H5正常),会导致父组件定义的函数体中的this变成子组件的this
-          // 通过bind()方法,绑定父组件的this,让this的this为父组件的上下文
-          let beforeBack = this.beforeBack.bind(this.$t.$parent.call(this))()
-          // 判断是否返回了Promise
-          if (!!beforeBack && typeof beforeBack.then === 'function') {
-            await beforeBack.then(res => {
-              // Promise返回成功
-              this.navBack()
-            }).catch(err => {})
-          } else if (beforeBack === true) {
-            this.navBack()
-          }
-        } else {
-          this.navBack()
-        }
-      },
-      // 返回上一页
-      navBack() {
-        
-        // 通过判断当前页面的页面栈信息,是否有上一页进行返回,如果没有则跳转到首页
-        const pages = getCurrentPages()
-        if (pages && pages.length > 0) {
-          const firstPage = pages[0]
-          if (pages.length == 1 && (!firstPage.route || firstPage.route != 'pages/index/index')) {
-            uni.reLaunch({
-              url: '/pages/index/index'
-            })
-          } else {
-            uni.navigateBack({
-              delta: 1
-            })
-          }
-        } else {
-          uni.reLaunch({
-            url: '/pages/index/index'
-          })
-        }
-      }
-    }
-  }
+	import componentsColorMixin from '../../libs/mixin/components_color.js'
+	export default {
+		name: 'tn-nav-bar',
+		mixins: [componentsColorMixin],
+		props: {
+			// 层级
+			zIndex: {
+				type: Number,
+				default: 0
+			},
+			// 导航栏的高度
+			height: {
+				type: Number,
+				default: 0
+			},
+			// 高度单位
+			unit: {
+				type: String,
+				default: 'px'
+			},
+			// 是否显示返回按钮
+			isBack: {
+				type: Boolean,
+				default: true
+			},
+			// 返回按钮的图标
+			backIcon: {
+				type: String,
+				default: 'left'
+			},
+			// 返回按钮旁显示的文字
+			backTitle: {
+				type: String,
+				default: '返回'
+			},
+			// 透明状态栏
+			alpha: {
+				type: Boolean,
+				default: false
+			},
+			// 是否固定在顶部
+			fixed: {
+				type: Boolean,
+				default: true
+			},
+			// 是否显示底部阴影
+			bottomShadow: {
+				type: Boolean,
+				default: true
+			},
+			// 是否自定义返回按钮
+			customBack: {
+				type: Boolean,
+				default: false
+			},
+			// 返回前回调
+			beforeBack: {
+				type: Function,
+				default: null
+			}
+		},
+		computed: {
+			navBarStyle() {
+				let style = {}
+				style.height = this.height === 0 ? this.customBarHeight + this.unit : this.height + this.unit
+				if (this.fixed) {
+					style.position = 'fixed'
+				}
+				style.zIndex = this.elZIndex
+
+				return style
+			},
+			barClass() {
+				let clazz = ''
+				if (this.backgroundColorClass) {
+					clazz += ` ${this.backgroundColorClass}`
+				}
+				if (this.fontColorClass) {
+					clazz += `${this.fontColorClass}`
+				}
+				if (this.fixed) {
+					clazz += ' tn-custom-nav-bar__bar--fixed'
+				}
+				if (this.alpha) {
+					clazz += ' tn-custom-nav-bar__bar--alpha'
+				}
+				if (this.bottomShadow) {
+					clazz += ' tn-custom-nav-bar__bar--bottom-shadow'
+				}
+
+				return clazz
+			},
+			barStyle() {
+				let style = {}
+				style.height = this.height === 0 ? this.customBarHeight + this.unit : this.height + this.unit
+
+				if (this.fixed) {
+					style.paddingTop = this.statusBarHeight + 'px'
+				}
+
+				if (!this.backgroundColorClass) {
+					style.backgroundColor = this.backgroundColor !== '' ? this.backgroundColor : '#FFFFFF'
+				}
+				if (!this.fontColorClass && this.fontColor) {
+					style.color = this.fontColor
+				}
+
+				style.zIndex = this.elZIndex
+
+				return style
+			},
+			contentStyle() {
+				let style = {}
+				style.top = this.fixed ? this.statusBarHeight + 'px' : '0px'
+				style.height = this.height === 0 ? (this.customBarHeight - this.statusBarHeight) + this.unit : this
+					.height + this.unit
+				style.lineHeight = style.height
+
+				if (this.isBack) {
+					if (this.customBack) {
+						const width = (this.customBackStyleInfo.width + this.customBackStyleInfo.left) * 2
+						style.width = `calc(100% - ${width}px)`
+					} else {
+						style.width = 'calc(100% - 340rpx)'
+					}
+				} else {
+					style.width = '100%'
+				}
+
+				return style
+			},
+			elZIndex() {
+				return this.zIndex ? this.zIndex : this.$t.zIndex.navbar
+			}
+		},
+		data() {
+			return {
+				// 状态栏的高度
+				statusBarHeight: 0,
+				// 自定义导航栏的高度
+				customBarHeight: 0,
+				// 自定义返回按钮时,返回容器的宽高边距信息
+				customBackStyleInfo: {
+					width: 86,
+					height: 32,
+					left: 15
+				}
+			}
+		},
+		mounted() {
+			// 获取vuex中的自定义顶栏的高度
+			this.updateNavBarInfo()
+		},
+		created() {
+			// 获取胶囊信息
+			// #ifdef MP-WEIXIN
+			let custom = wx.getMenuButtonBoundingClientRect()
+			this.customBackStyleInfo.width = custom.width
+			this.customBackStyleInfo.height = custom.height
+			this.customBackStyleInfo.left = uni.upx2px(750) - custom.right
+			// #endif
+		},
+		methods: {
+			// 更新导航栏的高度
+			async updateNavBarInfo() {
+				// 获取vuex中的自定义顶栏的高度
+				let customBarHeight = this.vuex_custom_bar_height
+				let statusBarHeight = this.vuex_status_bar_height
+				// 如果获取失败则重新获取
+				if (!customBarHeight) {
+					try {
+						const navBarInfo = await this.$t.updateCustomBar()
+						customBarHeight = navBarInfo.customBarHeight
+						statusBarHeight = navBarInfo.statusBarHeight
+					} catch (e) {
+						setTimeout(() => {
+							this.updateNavBarInfo()
+						}, 10)
+						return
+					}
+				}
+
+				// 更新vuex中的导航栏信息
+				this && this.$t.vuex('vuex_status_bar_height', statusBarHeight)
+				this && this.$t.vuex('vuex_custom_bar_height', customBarHeight)
+
+				this.customBarHeight = customBarHeight
+				this.statusBarHeight = statusBarHeight
+			},
+			// 处理返回事件
+			async handlerBack() {
+				if (this.beforeBack && typeof(this.beforeBack) === 'function') {
+					// 执行回调,同时传入索引当作参数
+					// 在微信,支付宝等环境(H5正常),会导致父组件定义的函数体中的this变成子组件的this
+					// 通过bind()方法,绑定父组件的this,让this的this为父组件的上下文
+					let beforeBack = this.beforeBack.bind(this.$t.$parent.call(this))()
+					// 判断是否返回了Promise
+					if (!!beforeBack && typeof beforeBack.then === 'function') {
+						await beforeBack.then(res => {
+							// Promise返回成功
+							this.navBack()
+						}).catch(err => {})
+					} else if (beforeBack === true) {
+						this.navBack()
+					}
+				} else {
+					this.navBack()
+				}
+			},
+			// 返回上一页
+			navBack() {
+
+				// 通过判断当前页面的页面栈信息,是否有上一页进行返回,如果没有则跳转到首页
+				const pages = getCurrentPages()
+				if (pages && pages.length > 0) {
+					const firstPage = pages[0]
+					if (pages.length == 1 && (!firstPage.route || firstPage.route != 'pages/robot/index')) {
+						uni.reLaunch({
+							url: '/pages/robot/index'
+						})
+					} else {
+						uni.navigateBack({
+							delta: 1
+						})
+					}
+				} else {
+					uni.reLaunch({
+						url: '/pages/robot/index'
+					})
+				}
+			}
+		}
+	}
 </script>
 
 <style lang="scss" scoped>
-  
-  .tn-custom-nav-bar {
-    display: block;
-    position: relative;
-    
-    &__bar {
-      display: flex;
-      position: relative;
-      align-items: center;
-      min-height: 100rpx;
-      justify-content: space-between;
-      min-height: 0px;
-      /* #ifdef MP-WEIXIN */
-      padding-right: 220rpx;
-      /* #endif */
-      /* #ifdef MP-ALIPAY */
-      padding-right: 150rpx;
-      /* #endif */
-      box-shadow: 0rpx 0rpx 0rpx;
-      z-index: 9999;
-      
-      &--fixed {
-        position: fixed;
-        width: 100%;
-        top: 0;
-      }
-      
-      &--alpha {
-        background: transparent !important;
-        box-shadow: none !important;
-      }
-      
-      &--bottom-shadow {
-        box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.05);
-      }
-      
-      &__action {
-        display: flex;
-        align-items: center;
-        height: 100%;
-        justify-content: center;
-        max-width: 100%;
-        
-        &--nav-back {
-          /* position: absolute; */
-          /* top: 50%; */
-          /* left: 20rpx; */
-          /* margin-top: -15rpx; */
-          // width: 25rpx;
-          // height: 25rpx;
-          margin-left: 20rpx;
-          font-size: 38rpx;
-          line-height: 100%;
-          // border-width: 0 0 4rpx 4rpx;
-          // border-color: #000000;
-          // border-style: solid;
-          // transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
-        }
-        
-        &--nav-back-text {
-          margin-left: 10rpx;
-        }
-      }
-      
-      &__content {
-        position: absolute;
-        text-align: center;
-        left: 0;
-        right: 0;
-        bottom: 0;
-        margin: auto;
-        font-size: 32rpx;
-        cursor: none;
-        // pointer-events: none;
-        text-overflow: ellipsis;
-        white-space: nowrap;
-        overflow: hidden;
-      }
-    }
-  }
-  
-</style>
+	.tn-custom-nav-bar {
+		display: block;
+		position: relative;
+
+		&__bar {
+			display: flex;
+			position: relative;
+			align-items: center;
+			min-height: 100rpx;
+			justify-content: space-between;
+			min-height: 0px;
+			/* #ifdef MP-WEIXIN */
+			padding-right: 220rpx;
+			/* #endif */
+			/* #ifdef MP-ALIPAY */
+			padding-right: 150rpx;
+			/* #endif */
+			box-shadow: 0rpx 0rpx 0rpx;
+			z-index: 9999;
+
+			&--fixed {
+				position: fixed;
+				width: 100%;
+				top: 0;
+			}
+
+			&--alpha {
+				background: transparent !important;
+				box-shadow: none !important;
+			}
+
+			&--bottom-shadow {
+				box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.05);
+			}
+
+			&__action {
+				display: flex;
+				align-items: center;
+				height: 100%;
+				justify-content: center;
+				max-width: 100%;
+
+				&--nav-back {
+					/* position: absolute; */
+					/* top: 50%; */
+					/* left: 20rpx; */
+					/* margin-top: -15rpx; */
+					// width: 25rpx;
+					// height: 25rpx;
+					margin-left: 20rpx;
+					font-size: 38rpx;
+					line-height: 100%;
+					// border-width: 0 0 4rpx 4rpx;
+					// border-color: #000000;
+					// border-style: solid;
+					// transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+				}
+
+				&--nav-back-text {
+					margin-left: 10rpx;
+				}
+			}
+
+			&__content {
+				position: absolute;
+				text-align: center;
+				left: 0;
+				right: 0;
+				bottom: 0;
+				margin: auto;
+				font-size: 32rpx;
+				cursor: none;
+				// pointer-events: none;
+				text-overflow: ellipsis;
+				white-space: nowrap;
+				overflow: hidden;
+			}
+		}
+	}
+</style>

+ 8 - 13
utils/request/responseInterceptors.js

xqd
@@ -30,21 +30,16 @@ module.exports = (vm) => {
 		/*  对响应错误做点什么 (statusCode !== 200)*/
 		let statusCode = response.statusCode
 		if (statusCode == 401) {
-			console.log('当前接口401----------------------------');
 			uni.clearStorageSync()
-			uni.redirectTo({
-				url: '/pages/user/signin'
-			})
-		} else if (statusCode == 403 && response.data.code == 403 && response.data.msg == '您的账号已被拉黑!') {
-			uni.setStorageSync('hasForbidden', {
-				status: 0,
-				msg: response.data.msg
-			})
-			return uni.showToast({
-				title: response.data.msg,
+			uni.showToast({
+				title: '您的登录已失效,或您已在其他地方登录',
 				icon: 'none'
-			});
-
+			})
+			setTimeout(() => {
+				uni.redirectTo({
+					url: '/pages/user/signin'
+				})
+			}, 1500)
 		} else if (statusCode == 500) {
 			uni.$u.toast('接口报错')
 		}