Просмотр исходного кода

perf: 优化页面文案显示

lizhaocai недель назад: 3
Родитель
Сommit
0be2638c83

+ 12 - 2
pages/comm/comm.vue

@@ -80,7 +80,7 @@
 						 
 							<!-- 不用限制长度了,因为发布的时候限制长度了-->
 							<tn-tag margin="-4px 4px 0 0" backgroundColor="#3a96d733" v-if="item.brand"
-								fontColor="#3a96d7" shape="circle" :fontSize="wxFontSize+11">{{ item.brand }}</tn-tag>
+								fontColor="#3a96d7" shape="circle" :fontSize="wxFontSize+11" @click="showBrand(item.brand)">{{ item.brand }}</tn-tag>
 							<tn-tag margin="-4px 4px 0 0" backgroundColor="#3a96d733" v-if="!item.company"
 								fontColor="#3a96d7" shape="circle" :fontSize="wxFontSize+11">个人</tn-tag>
 
@@ -289,7 +289,7 @@
 
 				}, {
 					fieldName: 'prodSpec',
-					fieldDesc: '规格型号',
+					fieldDesc: '产品型号',
 
 				}, {
 					fieldName: 'prodDesc',
@@ -500,9 +500,13 @@
 				this.curIndex = curIndex;
 				if (uni.getStorageSync('searchProdValue')) {
 					that.searchProdValue = uni.getStorageSync('searchProdValue');
+				}else{
+					that.searchProdValue = ''
 				}
 				if (uni.getStorageSync('searchProdValue2')) {
 					that.searchProdValue2 = uni.getStorageSync('searchProdValue2');
+				}else{
+					that.searchProdValue2 = ''
 				}
 				request.post('/slbResourceShare/query', {
 					type: that.currentTab == 1 ? '2' : '1',
@@ -610,6 +614,12 @@
 					}
 				})
 			},
+			showBrand(text){
+				uni.showToast({
+					title: '品牌:'+text,
+					icon: 'none'
+				})
+			},
 			addColl() {
 				if (!uni.getStorageSync('userNo')) {
 					uni.showToast({

+ 1 - 1
pages/index/detail/detail.vue

@@ -212,7 +212,7 @@
 				
 				}, {
 					fieldName: 'prodSpec',
-					fieldDesc: '规格型号',
+					fieldDesc: '产品型号',
 				
 				}, {
 					fieldName: 'prodDesc',

+ 3 - 50
pages/index/index.vue

@@ -130,10 +130,10 @@
 			if (this.currentIndex === 3&&this.$refs.mine) {
 				this.$refs.mine.fetchData();
 			}
-			if (this.currentIndex === 1&&this.$refs.comm) {
+			if (this.currentIndex === 2&&this.$refs.comm) {
 				this.$refs.comm.fetchData();
 			}
-			if (this.currentIndex === 2&&this.$refs.discovery) {
+			if (this.currentIndex === 0&&this.$refs.discovery) {
 				this.$refs.discovery.fetchData();
 			}
 			if(uni.getStorageSync('lastTime')){	
@@ -147,20 +147,6 @@
 			}else{
 				uni.setStorageSync('lastTime',new Date().getTime())
 			}
-			if(uni.getStorageSync('version')!='2.0.6'){
-				uni.showModal({
-				  title: '更新提示',
-				  content: '新版本已经准备好,是否重启应用?\r\n 更新内容:优化产品体验,修复已知问题',
-				  success: (res) => {
-				    if (res.confirm) {
-				      uni.setStorageSync('version','2.0.6');
-					  uni.reLaunch({
-					  	url:'/pages/index/index'
-					  })
-				    }
-				  }
-				})
-			}
 			if(uni.getStorageSync('nextPage')&&uni.getStorageSync('userNo')){
 				let nextPage = uni.getStorageSync('nextPage')
 				uni.removeStorageSync('nextPage');
@@ -170,39 +156,6 @@
 			}else{
 				uni.removeStorageSync('nextPage')
 			}
-
-			if (wx.canIUse('getUpdateManager')) {
-			  const updateManager = wx.getUpdateManager();
-			  updateManager && updateManager.onCheckForUpdate((res) => {
-			    if (res.hasUpdate) {
-			      updateManager.onUpdateReady(() => {
-			        uni.showModal({
-			          title: '更新提示',
-			          content: '新版本已经准备好,是否重启应用?',
-			          success: (res) => {
-			            if (res.confirm) {
-			              uni.clearStorageSync() // 更新完成后刷新storage的数据
-			              updateManager.applyUpdate()
-			            }
-			          }
-			        })
-			      })
-			
-			      updateManager.onUpdateFailed(() => {
-			    //     uni.showModal({
-			    //       title: '已有新版本上线',
-			    //       content: '小程序自动更新失败,请删除该小程序后重新搜索打开哟~~~',
-			    // showCancel: false
-			    //     })
-					uni.reLaunch({
-						url:'/pages/index/index'
-					})
-			      })
-			    } else {
-			      //没有更新
-			    }
-			  })
-			}
 		},
 		methods: {
 			// 切换导航
@@ -374,7 +327,7 @@
 				const that = this;
 				let params= {
 					bisNo:shareData.bisNo,
-					bisType:this.currentIndex === 0?'1':'2',
+					bisType:this.currentIndex === 1?'1':'2',
 					userNo:uni.getStorageSync('userNo')
 				};
 				

+ 0 - 2
pages/mine/addFeed.vue

@@ -146,13 +146,11 @@
 			},
 			upfile(file) {
 				let that = this;
-				console.warn(file);
 				uni.uploadFile({
 					url: 'https://slb-m.lx-device.com/oss/upload/userFeedback', //仅为示例,非真实的接口地址
 					filePath: file.url,
 					name: 'file',
 					success: (uploadFileRes) => {
-						console.warn(JSON.parse(uploadFileRes.data));
 						let resultMap = JSON.parse(uploadFileRes.data).resultMap;
 						that.fileDetailList.push({
 							name: file.name,

+ 1 - 1
pages/mine/coll.vue

@@ -244,7 +244,7 @@ import {
 				
 				}, {
 					fieldName: 'prodSpec',
-					fieldDesc: '规格型号',
+					fieldDesc: '产品型号',
 				
 				}, {
 					fieldName: 'prodDesc',

+ 7 - 7
pages/mine/mine.vue

@@ -180,7 +180,7 @@
           <button class="tn-flex tn-flex-col-center tn-button--clear-style" @click="showFeedback">
             <view
               class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center" style="color: #7C8191;">
-              <view class="tn-icon-message-fill" :style="{fontSize:(wxFontSize)+'px'}"></view>
+              <view class="tn-icon-message-fill" :style="{fontSize:(wxFontSize+1)+'px'}"></view>
             </view>
             <view class="tn-flex tn-flex-row-between" style="width: 100%;">
               <view class="tn-margin-left-sm" :style="{fontSize:(wxFontSize-1)+'px'}">我有问题</view>
@@ -192,7 +192,7 @@
 		  <view class="tn-flex tn-flex-col-center">
 		    <view
 		      class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center" style="color: #7C8191;">
-		      <view class="tn-icon-safe-fill" :style="{fontSize:(wxFontSize)+'px'}"></view>
+		      <view class="tn-icon-safe-fill" :style="{fontSize:(wxFontSize+1)+'px'}"></view>
 		    </view>
 		    <view class="tn-margin-left-sm tn-flex-1" :style="{fontSize:(wxFontSize-1)+'px'}">用户声明</view>
 		    <view class="tn-color-gray tn-icon-right"></view>
@@ -202,7 +202,7 @@
 		  <view class="tn-flex tn-flex-col-center">
 		    <view
 		      class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center" style="color: #7C8191;">
-		      <view class="tn-icon-lock" :style="{fontSize:(wxFontSize)+'px'}"></view>
+		      <view class="tn-icon-lock" :style="{fontSize:(wxFontSize+1)+'px'}"></view>
 		    </view>
 		    <view class="tn-margin-left-sm tn-flex-1" :style="{fontSize:(wxFontSize-1)+'px'}">隐私协议</view>
 		    <view class="tn-color-gray tn-icon-right"></view>
@@ -212,7 +212,7 @@
 		  <view class="tn-flex tn-flex-col-center">
 		    <view
 		      class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center" style="color: #7C8191;">
-		      <view class="tn-icon-help" :style="{fontSize:(wxFontSize)+'px'}"></view>
+		      <view class="tn-icon-help" :style="{fontSize:(wxFontSize+1)+'px'}"></view>
 		    </view>
 		    <view class="tn-margin-left-sm tn-flex-1" :style="{fontSize:(wxFontSize-1)+'px'}">了解速立保</view>
 		    <view class="tn-color-gray tn-icon-right"></view>
@@ -222,7 +222,7 @@
 		  <view class="tn-flex tn-flex-col-center">
 		    <view
 		      class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center" style="color: #7C8191;">
-		      <view class="tn-icon-font" :style="{fontSize:(wxFontSize)+'px'}"></view>
+		      <view class="tn-icon-font" :style="{fontSize:(wxFontSize+1)+'px'}"></view>
 		    </view>
 		    <view class="tn-margin-left-sm tn-flex-1" :style="{fontSize:(wxFontSize-1)+'px'}">字体大小</view>
 		    <view class="tn-color-gray tn-icon-right"></view>
@@ -232,7 +232,7 @@
 		  <view class="tn-flex tn-flex-col-center">
 		    <view
 		      class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center" style="color: #7C8191;">
-		      <view class="tn-icon-my-reduce" :style="{fontSize:(wxFontSize)+'px'}"></view>
+		      <view class="tn-icon-my-reduce" :style="{fontSize:(wxFontSize+1)+'px'}"></view>
 		    </view>
 		    <view class="tn-margin-left-sm tn-flex-1" :style="{fontSize:(wxFontSize-1)+'px'}">注销账户</view>
 		    <view class="tn-color-gray tn-icon-right"></view>
@@ -247,7 +247,7 @@
 	  		  <view class="tn-flex tn-flex-col-center">
 	  		    <view
 	  		      class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center" style="color: #7C8191;">
-	  		      <view class="tn-icon-logout" :style="{fontSize:(wxFontSize)+'px'}"></view>
+	  		      <view class="tn-icon-logout" :style="{fontSize:(wxFontSize+1)+'px'}"></view>
 	  		    </view>
 	  		    <view class="tn-margin-left-sm tn-flex-1" :style="{fontSize:(wxFontSize-1)+'px'}">退出登录</view>
 	  		    <view class="tn-color-gray tn-icon-right"></view>

+ 19 - 1
pages/mine/need.vue

@@ -253,7 +253,16 @@
 				})
 			},
 			goBack() {
-				uni.navigateBack();
+				const pages = getCurrentPages()
+				// 有可返回的页面则直接返回,uni.navigateBack 默认返回失败之后会自动刷新页面 ,无法继续返回
+				if (pages.length > 1) {
+					uni.navigateBack()
+					return;
+				}else{
+					uni.navigateTo({
+						url: '/pages/index/index'
+					})
+				}
 			},
 			tabChange(index) {
 				this.current = index;
@@ -290,6 +299,15 @@
 						} else {
 							that.showEmpty = false;
 						}
+					}else{
+						if(res._redirect){
+							uni.showToast({
+								title: '操作过期,请重试',
+								duration: 2000,
+								icon:'none'
+							});
+							that.goBack();
+						}
 					}
 
 					console.warn(res);

+ 20 - 5
pages/mine/share.vue

@@ -238,7 +238,7 @@
 				
 				}, {
 					fieldName: 'prodSpec',
-					fieldDesc: '规格型号',
+					fieldDesc: '产品型号',
 				
 				}, {
 					fieldName: 'prodDesc',
@@ -288,7 +288,16 @@
 		},
 		methods: {
 			goBack() {
-				uni.navigateBack();
+				const pages = getCurrentPages()
+				// 有可返回的页面则直接返回,uni.navigateBack 默认返回失败之后会自动刷新页面 ,无法继续返回
+				if (pages.length > 1) {
+					uni.navigateBack()
+					return;
+				}else{
+					uni.navigateTo({
+						url: '/pages/index/index'
+					})
+				}
 			},
 			change(index) {
 				this.current = index;
@@ -328,10 +337,16 @@
 						} else {
 							that.showEmpty = false;
 						}
+					}else{
+						if(res._redirect){
+							uni.showToast({
+								title: '操作过期,请重试',
+								duration: 2000,
+								icon:'none'
+							});
+							that.goBack();
+						}
 					}
-
-
-					console.warn(res);
 				})
 			},
 			showImg(items, index) {