Ver código fonte

perf: 优化收藏提示,代码

lizhaocai 1 mês atrás
pai
commit
b2e25edc2a

+ 4 - 3
circlePages/addShare.vue

@@ -35,7 +35,7 @@
 					<uni-forms :modelValue="formData" label-width="0">
 
 						<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>用户昵称:</text>
-						<text class="tn-icon-help" style="color:#999;padding: 4px;" @click="showTips=!showTips"></text>
+						 
 						<uni-forms-item label="用户昵称" name="realName" label-width="0">
 							<uni-easyinput type="text" disabled v-model="formInfo.contactNickName" placeholder="请输入您的昵称" />
 						</uni-forms-item>
@@ -49,7 +49,7 @@
 						</uni-forms-item>
 
 					</uni-forms>
-					<text v-if="showTips" style="font-size: 12px;color:#999;">如要更改个人信息,请在我的=><text>个人信息</text>页面更改</text>
+					<text style="font-size: 13px;color:#999;">如要更改个人信息,请在我的=><text>个人信息</text>页面更改</text>
 				</view>
 
 				<view v-if="selectValue=='公司'" style="padding: 16px">
@@ -139,10 +139,11 @@
 						   <text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>产品品牌:</text>
 						   <uni-easyinput type="text" :clearable="false" required v-model="brand" placeholder="请输入产品品牌" />
 						</view>
-						<view style="margin-top: 16px;line-height: 30px;margin-bottom: 16px;">
+						<view style="margin-top: 16px;margin-bottom: 20px;">
 							<text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text>发布的产品是否属于医疗器械?
 							<uni-data-checkbox :multiple="false" v-model="isMedical" selectedColor="#01BEFF"
 								:localdata="[{text: '是',value: '1'},{text: '否',value: '0'}]" />
+							<text v-if="isMedical==1" style="font-size: 13px;color:#999;">如若产品是医疗器械,请在上传附件步骤上传产品注册证,企业经营许可证等相关信息。</text>
 						</view>
 
 						<view v-for="item,itemIndex in extList">

+ 10 - 10
pages/comm/comm.vue

@@ -234,7 +234,7 @@
 						</view>
 
 		</tn-popup>
-		 
+		 <tn-toast ref="toast"></tn-toast>
 	</view>
 </template>
 
@@ -631,11 +631,11 @@
 				});
 				request.post('/slbCollect/add', params).then(res => {
 					if (res.success) {
-						uni.showToast({
-							title: '信息已收藏,请在我的收藏里查看阅读',
-							duration:2500,
-							icon: 'none'
-						});
+						that.$refs.toast.show({
+						  title: '信息已收藏,请在我的收藏里查看阅读',
+						  image: '',
+						  duration: 4000
+						})
 						that.showSheet = false;
 					} else {
 						uni.showToast({
@@ -651,10 +651,10 @@
 					id: that.collId
 				}).then(res => {
 					if (res.success) {
-						uni.showToast({
-							title: '此供应信息将不会保存在我的收藏里',
-							icon:'none',
-							duration:2500
+						that.$refs.toast.show({
+						  title: '此供应信息将不会保存在我的收藏里',
+						  image: '',
+						  duration: 4000
 						})
 						that.showSheet = false;
 					} else {

+ 16 - 2
pages/discovery/discovery.vue

@@ -94,7 +94,14 @@
 					 
 				}).then(res => {
 					if (res&&res.success) {
-						that.companyList = res.list||[] 
+						let dataList = res.list||[];
+						let newList = [];
+						for(let i=0;i<dataList.length;i++){
+							 if(dataList[i].showFlag=='是'){
+								 newList.push(dataList[i]);
+							 }
+						}
+						that.companyList = newList; 
 					}  
 				})
 			},
@@ -104,7 +111,14 @@
 					 
 				}).then(res => {
 					if (res&&res.success) {
-						 that.prodList = res.list||[] 
+						 let dataList = res.list||[];
+						 let newList = [];
+						 for(let i=0;i<dataList.length;i++){
+							 if(dataList[i].showFlag=='是'){
+								 newList.push(dataList[i]);
+							 }
+						 }
+						 that.prodList = newList;
 					}  
 				})
 			},

+ 9 - 9
pages/home/home.vue

@@ -374,11 +374,11 @@
 				});
 				request.post('/slbCollect/add', params).then(res => {
 					if (res.success) {
-						uni.showToast({
-							title: '信息已收藏,请在我的收藏里查看阅读',
-							duration: 2500,
-							icon: 'none'
-						});
+						that.$refs.toast.show({
+						  title: '信息已收藏,请在我的收藏里查看阅读',
+						  image: '',
+						  duration: 4000
+						})
 						that.showSheet = false;
 					} else {
 						uni.showToast({
@@ -394,10 +394,10 @@
 					id: that.collId
 				}).then(res => {
 					if (res.success) {
-						uni.showToast({
-							title: '此需求信息将不会保存在我的收藏里',
-							icon:'none',
-							duration:2500
+						that.$refs.toast.show({
+						  title: '此需求信息将不会保存在我的收藏里',
+						  image: '',
+						  duration: 4000
 						})
 						that.showSheet = false;
 					} else {

+ 3 - 3
pages/index/autoLogin.vue

@@ -1,9 +1,9 @@
 <template>
-	<view style="display: flex;align-items: center;justify-content: center;height: 100vh;">
-		<!-- <image src="../../static/logo.png" style="width: 90px;height:80px"></image> -->
+	<view></view>
+	<!-- <view style="display: flex;align-items: center;justify-content: center;height: 100vh;">
 		 <tn-loading mode="circle" size="60"></tn-loading>
 
-	</view>
+	</view> -->
 	
 </template>
 

+ 12 - 9
pages/index/detail/detail.vue

@@ -385,11 +385,12 @@
 				});
 				request.post('/slbCollect/add', params).then(res => {
 					if (res.success) {
-						uni.showToast({
-							title: '信息已收藏,请在我的收藏里查看阅读',
-							duration:2500,
-							icon: 'none'
-						});
+						that.$refs.toast.show({
+						  title: '信息已收藏,请在我的收藏里查看阅读',
+						  image: '',
+						  duration: 4000
+						})
+						 
 						that.showSheet = false;
 					} else {
 						uni.showToast({
@@ -405,11 +406,13 @@
 					id: that.collId
 				}).then(res => {
 					if (res.success) {
-						uni.showToast({
-							title: '此'+(that.isNeed==1?'需求':'供应')+'信息将不会保存在我的收藏里',
-							icon:'none',
-							duration:2500
+						
+						that.$refs.toast.show({
+						  title: '此'+(that.isNeed==1?'需求':'供应')+'信息将不会保存在我的收藏里',
+						  image: '',
+						  duration: 4000
 						})
+						 
 						that.showSheet = false;
 					} else {
 						uni.showToast({

+ 20 - 69
pages/index/index.vue

@@ -169,44 +169,16 @@
 			getOpenId(code) {
 				const that = this;
 				request.post('/wxma/code2Session',{
-						code: code,
-						platType: "slb",
-						mpType: "engineer",
-					}).then(res=>{
-						console.error(res);
-						if(res.success){
-							//登录成功
-							uni.setStorageSync('userMap', JSON.stringify(res.resultMap));
-						}
-					
-					})
-				// wx.request({
-				// 	method: 'post',
-				// 	url: 'http://slb-m.dev.ml1993.com/lx-api/wxma/code2Session', //仅为示例,并非真实的接口地址
-				// 	data: {
-				// 		code: code,
-				// 		platType: "slb",
-				// 		mpType: "engineer",
-				// 	},
-				// 	header: {
-				// 		'content-type': 'application/json' ,// 默认值
-				// 		platType: "slb",
-				// 		mpType: "engineer",
-				// 	},
-				// 	success(res) {
-				// 		console.warn(res);
-				// 		//unionid存到本地
-				// 		wx.setStorage({
-				// 			key: "frontlixiangsid",
-				// 			data: res.data.resultMap.frontlixiangsid
-				// 		}, {
-				// 			key: "userId",
-				// 			data: res.data.resultMap.unionid
-				// 		})
-
-						
-				// 	}
-				// })
+					code: code,
+					platType: "slb",
+					mpType: "engineer",
+				}).then(res=>{
+					console.error(res);
+					if(res.success){
+						//登录成功
+						uni.setStorageSync('userMap', JSON.stringify(res.resultMap));
+					}
+				})
 			},
 
 			loginByCode(frontId) {
@@ -250,32 +222,8 @@
 						}
 						console.error(res2);
 					});
-					 // uni.request({
-					 // 	method: 'post',
-					 // 	url: 'http://slb-m.dev.ml1993.com/lx-api/slbMpAutoLogin', //仅为示例,并非真实的接口地址
-					 // 	data: {
-					 // 		code:frontId, 
-					 // 	    appType:'ma',
-						// 	encryptedData:res.encryptedData,
-						// 	iv: res.iv
-					 // 	},
-					 // 	header: {
-					 // 		'content-type': 'application/json', // 默认值
-					 		 
-					 // 		platType: "slb",
-					 // 		mpType: "engineer",
-					 // 	},
-					 // 	success(res2) {
-					 // 		console.error(res2);
-					 // 		//unionid存到本地
-					 		 
-					 // 	}
-					 // })
-					 
 				  }
 				})
-				 
-				
 			},
 
 			// 瀑布流导航页面滚动到底部
@@ -290,13 +238,13 @@
 					
 				}
 			},
-			 onPulling(e) {
-			                console.log("onpulling", e);
-							if(e.detail.deltaY<0){
-								return
-							}
-							this.triggered = true
-			            }, 
+			onPulling(e) {
+				console.log("onpulling", e);
+				if(e.detail.deltaY<0){
+					return
+				}
+				this.triggered = true
+			}, 
 			onRefresh(){
 				if (this._freshing) return;
 				this._freshing = true;
@@ -361,6 +309,9 @@
 					this.tabberPageLoadFlag[index] = true
 				}
 				this.currentIndex = index
+				if (this.currentIndex === 2&&this.$refs.discovery) {
+					this.$refs.discovery.fetchData();
+				}
 			},
 			// 获取canvas实例和ctx画笔
 			  getMyCanvasAndCtx(id) {

+ 14 - 2
pages/mine/coll.vue

@@ -219,7 +219,9 @@ aspectFill		:src="image_item.ftpUrl" mode="aspectFill" @click="showImg(item.imgL
 
 <script>
 	import request from '../../utils/request'
-
+import {
+  	uniShowModal
+  } from '../../utils/uni_api'
 	export default {
 		data() {
 			return {
@@ -352,7 +354,17 @@ aspectFill		:src="image_item.ftpUrl" mode="aspectFill" @click="showImg(item.imgL
 			
 			delColl(item) {
 				this.curItem = item;
-				this.$refs.alertDialog.open()
+				let that = this;
+				// this.$refs.alertDialog.open()
+				uniShowModal('确定取消收藏吗?', '', {
+					showCancel: true,
+					confirmText:'确定',
+					success: (res) => {
+						if(res.confirm){
+							that.dialogConfirm(); 
+						}
+					}
+				})
 				
 			},
 			showImg(items, index) {

+ 0 - 6
pages/mine/mine.vue

@@ -332,17 +332,11 @@
 		  uni.navigateTo({
 		    url: '/pages/login/info?counted=1'
 		  })
-		 // uni.navigateTo({
-		 // 	url:'/pages/webview/web-view?url='+encodeURIComponent('http://slb-m.dev.ml1993.com/webview?title=用户服务协议&url='+'https://test-oss.lx-device.com/userFeedback/1732866523422nfH.docx'),
-		 // })
 	  },
 	  showInfo2() {
 		  uni.navigateTo({
 		  	url:'/pages/webview/web-view?url='+encodeURIComponent('http://slb-m.dev.ml1993.com/webview?title=隐私协议&url='+'https://test-oss.lx-device.com/userFeedback/1732866629261TEn.docx'),
 		  })
-	  	// uni.navigateTo({
-	  	// 	url:'/pages/webview/web-view?url='+'https://test-oss.lx-device.com/userFeedback/1732866629261TEn.docx',
-	  	// })
 	  },
 	  showAbout(){
 		  uni.navigateTo({

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/circlePages/addShare.js.map


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/comm/comm.js.map


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/discovery/discovery.js.map


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/home.js.map


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/mine/coll.js.map


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/mine/mine.js.map


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/mp-weixin/circlePages/addShare.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/mp-weixin/circlePages/addShare.wxml


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/comm/comm.js


+ 2 - 1
unpackage/dist/dev/mp-weixin/pages/comm/comm.json

@@ -11,7 +11,8 @@
     "tn-grid-item": "/tuniao-ui/components/tn-grid-item/tn-grid-item",
     "tn-empty": "/tuniao-ui/components/tn-empty/tn-empty",
     "tn-load-more": "/tuniao-ui/components/tn-load-more/tn-load-more",
-    "tn-popup": "/tuniao-ui/components/tn-popup/tn-popup"
+    "tn-popup": "/tuniao-ui/components/tn-popup/tn-popup",
+    "tn-toast": "/tuniao-ui/components/tn-toast/tn-toast"
   },
   "component": true
 }

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/comm/comm.wxml


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/discovery/discovery.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/home/home.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/index/index.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/mine/coll.js