achao 2 anni fa
parent
commit
1b61513133
2 ha cambiato i file con 52 aggiunte e 33 eliminazioni
  1. 26 11
      pages/business/businessNew.vue
  2. 26 22
      pages/business/myAttention.vue

+ 26 - 11
pages/business/businessNew.vue

@@ -17,6 +17,9 @@
 					<u-search placeholder="请输入作物名称或用户名称" v-model="keyword" :input-style='inputStyle'
 						:show-action="false" disabled @click='toSearch'>
 					</u-search>
+					<view class="del" @click.stop='delIcon' v-if="keyword">
+						<u-icon name="close-circle" size="40" color="#999"></u-icon>
+					</view>
 				</view>
 				<me-tabs v-model="tabIndex" :tabs="tabs" @change="tabChange"></me-tabs>
 			</view>
@@ -60,9 +63,10 @@
 							<image :src="item1" mode="aspectFill" v-for="(item1,index) in item.imgList"
 								@tap="previewImage(item,index)" class="img">
 							</image>
-							<image v-if='item.imgList&&item.imgList.length%3==1||item.imgList&&item.imgList.length%3==2' class="img"
-								style='background:#fff;'></image>
-							<image v-if='item.imgList&&item.imgList.length%3==1' class="img" style='background:#fff;'></image>
+							<image v-if='item.imgList&&item.imgList.length%3==1||item.imgList&&item.imgList.length%3==2'
+								class="img" style='background:#fff;'></image>
+							<image v-if='item.imgList&&item.imgList.length%3==1' class="img" style='background:#fff;'>
+							</image>
 							<!-- 	<u-row justify="space-between" gutter="10">
 								<u-col span="4">
 									<view class="demo-layout bg-purple">
@@ -253,14 +257,18 @@
 				this.isShowAlert = true;
 			} else {
 				uni.navigateTo({
-					url: 'myAttention?selectType='+'关注'
-					
+					url: 'myAttention?selectType=' + '关注'
+
 				})
 			}
 
 		},
 
 		methods: {
+			delIcon() {
+				this.keyword = ''
+				this.mescroll.resetUpScroll()
+			},
 			previewImage(item, index) {
 				console.log(111111111)
 				var i = item.imgList; //获取当前页面的轮播图数据
@@ -309,8 +317,8 @@
 			},
 			toSearch() {
 
-				this.keyword1=this.keyword
-				uni.setStorageSync('jiaoyikeyword',this.keyword)
+				this.keyword1 = this.keyword
+				uni.setStorageSync('jiaoyikeyword', this.keyword)
 				this.isShowSearch = true
 			},
 			follow(val, type) {
@@ -362,14 +370,15 @@
 					this.isShowAlert = true;
 
 				} else {
-					if(!uni.getStorageSync('userInfo').transactionStatus||uni.getStorageSync('userInfo').transactionStatus&&uni.getStorageSync('userInfo').transactionStatus!='禁止发布'){
+					if (!uni.getStorageSync('userInfo').transactionStatus || uni.getStorageSync('userInfo')
+						.transactionStatus && uni.getStorageSync('userInfo').transactionStatus != '禁止发布') {
 						uni.navigateTo({
 							url: 'release'
 						})
-					}else{
-						
+					} else {
+
 					}
-					
+
 				}
 
 			},
@@ -649,6 +658,7 @@
 		align-items: center;
 		position: relative;
 		margin: 20rpx 28rpx 20rpx 28rpx;
+		position: relative;
 
 		.text {
 			width: 90rpx;
@@ -657,6 +667,11 @@
 			text-overflow: ellipsis;
 
 		}
+
+		.del {
+			position: absolute;
+			right: 20rpx;
+		}
 	}
 
 	/deep/.u-content {

+ 26 - 22
pages/business/myAttention.vue

@@ -1,7 +1,8 @@
 <template>
 	<view>
 		<view class="content1">
-			<u-search placeholder="搜索用户名称" v-model="keyword" :show-action='false' @search='keywordsearch' bg-color="#F5F6FA"></u-search>
+			<u-search placeholder="搜索用户名称" v-model="keyword" :show-action='false' @search='keywordsearch'
+				bg-color="#F5F6FA"></u-search>
 		</view>
 
 		<mescroll-body ref="mescrollRef" @init="mescrollInit" top="0" @down="downCallback" :up="upOption"
@@ -59,7 +60,7 @@
 				inputStyle: {
 					// "padding-left": '30rpx'
 				},
-				selectType:'',
+				selectType: '',
 				upOption: {
 					// page: {
 					// 	num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
@@ -86,7 +87,7 @@
 
 		},
 		onLoad(options) {
-			this.selectType=options.selectType
+			this.selectType = options.selectType
 		},
 
 
@@ -122,9 +123,12 @@
 					url: 'release'
 				})
 			},
-			keywordsearch(e){
-				this.keyword=e
-				this.upCallback({size:10,num:1})
+			keywordsearch(e) {
+				this.keyword = e
+				this.upCallback({
+					size: 10,
+					num: 1
+				})
 			},
 			/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
 			upCallback(page) {
@@ -137,23 +141,23 @@
 				let _obj = {
 
 				}
-				if (this.selectType == '关注') {
-					_obj = {
-						pageSize: page.size,
-						currentPage: page.num,
-						placeDelivery: this.selectPlace,
-						tranType: this.selectType,
-						userIdFollow: this.userInfo.id,
-						followedId:this.keyword,
-						nowUserId: this.userInfo.id
-					}
-				} else {
-					_obj = {
-						pageSize: page.size,
-						currentPage: page.num,
-						userId: this.userInfo.id,
-					}
+				// if (this.selectType == '关注') {
+				// 	_obj = {
+				// 		pageSize: page.size,
+				// 		currentPage: page.num,
+				// 		placeDelivery: this.selectPlace,
+				// 		tranType: this.selectType,
+				// 		userIdFollow: this.userInfo.id,
+				// 		followedId: this.keyword,
+				// 		nowUserId: this.userInfo.id
+				// 	}
+				// } else {
+				_obj = {
+					pageSize: page.size,
+					currentPage: page.num,
+					userId: this.userInfo.id,
 				}
+				// }
 				this.$api.doRequest('get', '/followInformation/getInfo', _obj).then(res => {
 					console.log(res.data.data.records)
 					if (res.data.code == 200) {