achao 2 سال پیش
والد
کامیت
2ab5a22ff4

+ 3 - 3
components/search.vue

@@ -25,7 +25,7 @@
 							<rich-text :nodes="row.htmlStr"></rich-text>
 						</view>
 						<view class="keyword-img" @tap.stop="setKeyword(keywordList[index].keyword)">
-							<image src="/static/HM-search/back.png"></image>
+							<image src="/static/back.png"></image>
 						</view>
 					</view>
 				</block>
@@ -36,7 +36,7 @@
 					<view class="keyword-list-header">
 						<view style="font-size: 32rpx; font-weight: 700;">最近搜索</view>
 						<view>
-							<image @tap="oldDelete" src="/static/HM-search/delete.png"></image>
+							<image @tap="oldDelete" src="/static/delete.png"></image>
 						</view>
 					</view>
 					<view class="keyword">
@@ -136,7 +136,7 @@
 					url: 'https://suggest.taobao.com/sug?code=utf-8&q=' + keyword, //仅为示例
 					success: (res) => {
 						this.keywordList = [];
-						this.keywordList = this.drawCorrelativeKeyword(res.data.result, keyword);
+						// this.keywordList = this.drawCorrelativeKeyword(res.data.result, keyword);
 
 					}
 				});

+ 34 - 29
components/selectAddress.vue

@@ -2,8 +2,10 @@
 	<view>
 		<picker @change="bindPickerChange" :value="multiIndex" :range="multiArray" range-key='label'
 			mode="multiSelector" @columnchange='columnchange'>
-			<view class="text" :style="textStyleEmpty" v-if="searchPlace=='请选交货地区'">{{searchPlace}}</view>
-			<view class="text" :style="textStyle" v-else>{{searchPlace}}</view>
+			<view class="text" :style="textStyleEmpty" v-if="place=='选择地区'">
+				{{place}}
+			</view>
+			<view class="text" :style="textStyle" v-else>{{edit?text:place}}</view>
 		</picker>
 	</view>
 </template>
@@ -36,27 +38,18 @@
 			}
 		},
 		watch: {
-			// keyword:function(val){
-			// 	let arr = this.tList;
-			// 	if(val!=''){
-			// 		this.list = arr.filter(v => {
-			// 			let flag = false
-			// 			if(v.members.length>0){
-			// 				v.members.forEach(m=>{
-			// 					if(m.groupNickName.includes(val)){
-			// 						flag = true
-			// 					}
-			// 				})
-			// 			}
-			// 			return flag
-			// 		})
-			// 	}else {
-			// 		this.list = this.tList
-			// 	}
+			// searchPlace(oldValue, newValue) {
+			// 	console.log(123)
+			// 	console.log(oldValue, newValue)
+			// 	// if (val != '') {
+			// 	// 	this.place = val
+			// 	// }
 			// }
 		},
 		data() {
 			return {
+				check: false,
+				place: '',
 				textStyleEmpty: {
 					"color": '#C5CAD4',
 					"font-size": '32rpx'
@@ -70,6 +63,8 @@
 			}
 		},
 		mounted() {
+			this.place = this.searchPlace
+			console.log("this.series", this.series)
 			for (let i = 0; i < address.length; i++) {
 				this.multiArray[0].push(address[i])
 
@@ -98,6 +93,7 @@
 
 			},
 			bindPickerChange: function(e) {
+				this.check = false
 				console.log('picker发送选择改变,携带值为', e.detail.value)
 				this.index = e.detail.value
 				console.log(this.multiArray)
@@ -105,32 +101,41 @@
 				let _address = ''
 				let _showVal = ''
 				if (this.multiArray[0][e.detail.value[0]].label == '全国') {
-					_address = "全国"
-					_showVal = '全国'
+					_address = ''
+					this.place = '全国'
 				} else if (this.multiArray[1][e.detail.value[1]]
 					.label == '全部') {
 					_address = this.multiArray[0][e.detail.value[0]].label
-					this.searchPlace = this.multiArray[0][e.detail.value[0]].label
+					this.place = this.multiArray[0][e.detail.value[0]].label
 				} else if (this.multiArray[2][e.detail.value[2]].label == '全部') {
 					_address = this.multiArray[0][e.detail.value[0]].label + this.multiArray[1][e.detail.value[1]]
 						.label
-					this.searchPlace = this.multiArray[1][e.detail.value[1]].label
+					this.place = this.multiArray[1][e.detail.value[1]].label
 				} else {
 					_address = this.multiArray[0][e.detail.value[0]].label + this.multiArray[1][e.detail.value[1]]
 						.label + this.multiArray[2][e.detail.value[2]].label
-					this.searchPlace = this.multiArray[2][e.detail.value[2]].label
+					this.place = this.multiArray[2][e.detail.value[2]].label
+					this.check = true
 				}
 				if (this.series == 3) {
 					if (!_address) {
-						this.searchPlace = '全国'
-						return
+						this.place = '全国'
+					}
+					if (this.check) {
+						this.place = _address
+					} else {
+						this.place = this.searchPlace
 					}
-					this.searchPlace = _address
 
 				}
-				console.log("_showVal", _showVal)
+				console.log("_showVal", this.place)
 				console.log("_address", _address)
-				this.$emit('selectAddress', _address)
+				console.log("this.check", this.check)
+				this.$emit('selectAddress', {
+					showVal: this.place,
+					address: _address,
+					check: this.check
+				})
 			}
 		},
 	}

+ 1 - 1
config/index.js

@@ -4,7 +4,7 @@ const dev = {
 	// baseUrlNew: 'http://192.168.110.67:9100/',
 	// baseUrlNew: 'http://192.168.1.118:8090/',
 	// baseUrlNew: 'http://192.168.110.9:9100/',
-	baseUrlNew: 'http://192.168.110.138:8090/',
+	baseUrlNew: 'http://192.168.110.82:8090/',
 	// baseUrlNew: 'http://192.168.110.202:8090/',
 	// baseUrlNew: 'http://192.168.110.138:8090/',
 	// 上传图片的

+ 31 - 8
pages/business/businessNew.vue

@@ -4,7 +4,7 @@
 			<view class="top-warp">
 				<view class="search">
 					<view class="place">
-						<selectAddress @selectAddress='selectAddress'></selectAddress>
+						<selectAddress @selectAddress='selectAddress' :searchPlace='searchPlace'></selectAddress>
 						<!-- 					<picker @change="bindPickerChange" :value="multiIndex" :range="multiArray" range-key='label'
 							mode="multiSelector" @columnchange='columnchange'>
 							<view class="text">{{searchPlace}}</view>
@@ -18,7 +18,7 @@
 				<me-tabs v-model="tabIndex" :tabs="tabs" @change="tabChange"></me-tabs>
 			</view>
 			<mescroll-body ref="mescrollRef" @init="mescrollInit" top="180" @down="downCallback" :up="upOption"
-				@up="upCallback" @emptyclick="emptyClick">
+				@up="upCallback" @emptyclick="emptyClick" :bottombar="false">
 				<!-- 数据列表 -->
 				<view class="list" v-if="goods.length!=0">
 					<view class="list-item" v-for="(item,index) in goods">
@@ -120,6 +120,8 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data() {
 			return {
+				searchPlace: '全国',
+				selectType: '',
 				isSHowReleaseAlert: null,
 				canReset: false,
 				selectPlace: '',
@@ -146,7 +148,12 @@
 						icon: '/static/empty.png',
 						tip: '暂无内容', // 提示
 						// btnText: '去看看'
-					}
+					},
+					textNoMore: '没有更多了~',
+					textColor: '#878C9C',
+					toTop: {
+						src: "",
+					},
 				},
 				goods: [], //列表数据
 				tabs: [{
@@ -170,6 +177,13 @@
 		},
 
 		onShow() {
+			let _tl = uni.getStorageSync('transactionLocation')
+			if (_tl) {
+				this.searchPlace = _tl.showVal
+				this.selectPlace = _tl.address
+			} else {
+
+			}
 			this.isSHowReleaseAlert = getApp().globalData.userRelease
 			console.log("this.isSHowReleaseAlert", this.isSHowReleaseAlert)
 			uni.showTabBar()
@@ -303,8 +317,15 @@
 
 			},
 			selectAddress(val) {
-				this.selectPlace = val
-				this.mescroll.resetUpScroll() // 再刷新列表数据
+				console.log(val)
+				try {
+					uni.setStorageSync('transactionLocation', val);
+					this.selectPlace = val.address
+					this.searchPlace = val.showVal
+				} catch (e) {
+					// error
+				}
+				this.mescroll.resetUpScroll()
 				console.log(val)
 			},
 			release() {
@@ -338,7 +359,8 @@
 						placeDelivery: this.selectPlace,
 						tranType: this.selectType,
 						userIdFollow: this.userInfo.id,
-						nowUserId: this.userInfo.id
+						nowUserId: this.userInfo.id,
+						pcphone: 'mobile'
 					}
 				} else {
 					_obj = {
@@ -347,7 +369,8 @@
 						placeDelivery: this.selectPlace,
 						tranType: this.selectType,
 						nowUserId: this.userInfo.id,
-						searchKeyWord: this.keyword
+						searchKeyWord: this.keyword,
+						pcphone: 'mobile'
 					}
 				}
 				this.$api.doRequest('get', '/transactionExchangeInfo/selectTransactionExchangeInfo', _obj).then(res => {
@@ -553,7 +576,7 @@
 
 	.add {
 		position: fixed;
-		bottom: 250rpx;
+		bottom: 150rpx;
 		right: 32rpx;
 		background: #22C572;
 		z-index: 999;

+ 140 - 10
pages/business/editRelease.vue

@@ -1,13 +1,31 @@
 <template>
 	<view class="content">
 		<view class="content1">
-			<view class="top">
+			<!-- 		<view class="top">
 				<textarea v-model="dataObj.publishingContent" placeholder="请发布粮食类商品交易信息,建议包含联系方" maxlength='200'
 					placeholder-class='placeholder-class' class="textarea" />
 				<view class="number">
 					{{dataObj.publishingContent.length}}/200个字
 				</view>
+			</view> -->
+			<view class='row'>
+				<view class="textarea">
+					<textarea placeholder-style="color:#AFB3BF;" placeholder="请发布粮食类商品交易信息,建议包含联系方式" maxlength="2000"
+						v-model="dataObj.publishingContent"></textarea>
+					<view class="textarea-left">
+						<view class="clear" @click="clear()">清除全部</view>
+					</view>
+					<view class="textarea-bottom">
+						{{dataObj.publishingContent?dataObj.publishingContent.length:'0'}}/2000字
+					</view>
+				</view>
+
+				<!-- <view class="number">
+					{{dataObj.publishingContent.length}}/2000个字
+				</view> -->
 			</view>
+
+
 			<view style="padding-left: 10rpx;">
 				<upload :file-list='businesslicense' class="upload" ref="upload" :action="action" :max-size="maxSize"
 					delIconSize='30' delBgColor='rgba(0,0,0,0.4)' delIcon="trash" :max-count="9"
@@ -25,7 +43,7 @@
 						</u-radio>
 					</u-radio-group>
 				</u-cell-item>
-				<u-cell-item title="交易地" :title-style="titleStyle">
+				<u-cell-item :title="placeTitle" :title-style="titleStyle">
 					<selectAddress @selectAddress='selectAddress' series='3' :textStyle='textStyle' :edit='true'
 						:text='dataObj.placeDelivery'></selectAddress>
 				</u-cell-item>
@@ -65,6 +83,8 @@
 		},
 		data() {
 			return {
+				searchPlaceHolder: '选择交货地区',
+				placeTitle: '交货地',
 				id: '',
 				imgList: [],
 				showNickname: false,
@@ -83,7 +103,6 @@
 				},
 				textStyle: {
 					"font-size": "32rpx",
-					"font-weight": 700,
 					"color": "#333333",
 					"margin-right": '27rpx'
 				},
@@ -119,8 +138,18 @@
 		computed: {
 			...mapState(['hasLogin', 'userInfo', 'clientId']),
 		},
+		onShow() {
+			let _tl = uni.getStorageSync('transactionPlace')
+			if (_tl) {
+				this.dataObj.placeDelivery = _tl.address
+			} else {
 
+			}
+		},
 		methods: {
+			clear() {
+				this.dataObj.publishingContent = ''
+			},
 			init() {
 				let _obj = {
 					id: this.id
@@ -133,7 +162,13 @@
 					console.log(res.data)
 					if (res.data.code == 200) {
 						this.dataObj = res.data.data
-
+						if (this.dataObj.tranType == '销售') {
+							this.placeTitle = '货源地'
+							this.searchPlaceHolder = '选择货源地区'
+						} else {
+							this.placeTitle = '交货地'
+							this.searchPlaceHolder = '选择交货地区'
+						}
 						this.imgList = res.data.data.urlImg.split(',')
 						for (let i = 0; i < this.imgList.length; i++) {
 							this.businesslicense.push({
@@ -218,6 +253,7 @@
 				})
 
 				this.dataObj.urlImg = this.imgList.toString()
+				this.dataObj.flag = 3
 				this.$api.doRequest('post', '/transactionExchangeInfo/editInfo', this.dataObj).then(res => {
 					console.log(res)
 					if (res.data.code == 200) {
@@ -235,10 +271,32 @@
 			},
 			selectAddress(val) {
 				console.log(val)
-				this.dataObj.placeDelivery = val
+				console.log(this.dataObj.tranType)
+				if (!val.check) {
+					uni.showToast({
+						title: '地点必须选到区县一级',
+						icon: 'none',
+						duration: 2000
+					})
+					return
+				}
+				try {
+					uni.setStorageSync('transactionPlace', val);
+					this.dataObj.placeDelivery = val.address
+				} catch (e) {
+					// error
+				}
 			},
 			radioChange(e) {
 				// console.log(e);
+				console.log(e);
+				if (e == '销售') {
+					this.placeTitle = '货源地'
+					this.searchPlaceHolder = '选择货源地区'
+				} else {
+					this.placeTitle = '交货地'
+					this.searchPlaceHolder = '选择交货地区'
+				}
 			},
 			filterFileType(index, lists) {
 				if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
@@ -282,6 +340,7 @@
 <style lang="scss" scoped>
 	.content {
 		// overflow: hidden;
+		padding-bottom: 100rpx;
 	}
 
 	.content1 {
@@ -325,6 +384,7 @@
 	}
 
 	.submit {
+		margin: 40rpx auto;
 		width: 654rpx;
 		height: 92rpx;
 		background: #22C572;
@@ -334,11 +394,11 @@
 		color: #FFFFFF;
 		line-height: 92rpx;
 		text-align: center;
-		position: fixed;
-		bottom: 76rpx;
-		left: 0;
-		right: 0;
-		margin: auto;
+		// position: fixed;
+		// bottom: 76rpx;
+		// left: 0;
+		// right: 0;
+		// margin: auto;
 	}
 
 	.edit-nickname {
@@ -352,4 +412,74 @@
 	.nickname-btn {
 		margin-top: 20rpx;
 	}
+
+	.row {
+		display: flex;
+		justify-content: space-between;
+		position: relative;
+		background: #fff;
+
+		border-radius: 20rpx;
+
+		input {
+			font-size: 28rpx;
+			// color: #333333;
+		}
+
+		.left {
+			display: flex;
+			align-items: center;
+			color: #333333;
+			font-size: 34rpx;
+			font-weight: 600;
+		}
+	}
+
+	.row_css {
+		font-size: 26rpx;
+		color: #333333;
+		margin-top: 60rpx;
+		font-weight: 500;
+	}
+
+	.textarea {
+		background: #F9F9FA;
+		font-size: 28rpx;
+		text-align: left;
+		width: 100%;
+		padding: 30rpx 30rpx;
+		border-radius: 5px;
+		margin: 30rpx;
+		height: 46vh;
+		padding-bottom: 20rpx;
+		color: #333;
+	}
+
+	.textarea textarea {
+		height: 90%;
+	}
+
+	.textarea-left {
+		position: absolute;
+		bottom: 40rpx;
+		left: 50rpx;
+		color: #606266;
+	}
+
+	.textarea-bottom {
+		position: absolute;
+		bottom: 40rpx;
+		right: 40rpx;
+		color: #AFB3BF;
+	}
+
+	.clear {
+		/* width: 90%; */
+		// background: #ffffff;
+		color: #22C572;
+		// border: 1px solid #22C572;
+		// border-radius: 50rpx;
+		// font-size: 28rpx;
+		// padding: 9rpx 24rpx;
+	}
 </style>

+ 10 - 0
pages/business/myAttention.vue

@@ -24,7 +24,11 @@
 					</view>
 				</view>
 			</view>
+			<view class="total" v-if="goods.length>=10">
+				共关注{{goods.length}}人
+			</view>
 		</mescroll-body>
+
 		<u-modal v-model="show" :content="content" :show-title='false' :show-cancel-button='true'
 			:content-style="contentStyle" showCancelButton='true' @confirm="cancelFollow" @cancel="show=false">
 		</u-modal>
@@ -226,4 +230,10 @@
 			border-bottom: 1px solid #E6E6E6;
 		}
 	}
+
+	.total {
+		display: flex;
+		justify-content: center;
+		margin: 40rpx 0;
+	}
 </style>

+ 152 - 19
pages/business/release.vue

@@ -1,12 +1,21 @@
 <template>
 	<view class="content">
 		<view class="content1">
-			<view class="top">
-				<textarea v-model="dataObj.publishingContent" placeholder="请发布粮食类商品交易信息,建议包含联系方" maxlength='200'
-					placeholder-class='placeholder-class' class="textarea" />
-				<view class="number">
-					{{dataObj.publishingContent.length}}/200个字
+			<view class='row'>
+				<view class="textarea">
+					<textarea placeholder-style="color:#AFB3BF;" placeholder="请发布粮食类商品交易信息,建议包含联系方式" maxlength="2000"
+						v-model="dataObj.publishingContent"></textarea>
+					<view class="textarea-left">
+						<view class="clear" @click="clear()">清除全部</view>
+					</view>
+					<view class="textarea-bottom">
+						{{dataObj.publishingContent?dataObj.publishingContent.length:'0'}}/2000字
+					</view>
 				</view>
+
+				<!-- <view class="number">
+					{{dataObj.publishingContent.length}}/2000个字
+				</view> -->
 			</view>
 			<view style="padding-left: 10rpx;">
 				<upload :file-list='businesslicense' class="upload" ref="upload" :action="action" :max-size="maxSize"
@@ -25,10 +34,11 @@
 						</u-radio>
 					</u-radio-group>
 				</u-cell-item>
-				<u-cell-item title="交易地" :title-style="titleStyle">
+				<u-cell-item :title="placeTitle" :title-style="titleStyle">
 					<selectAddress @selectAddress='selectAddress' series='3' :textStyle='textStyle'
-						searchPlace='请选交货地区'>
+						:searchPlace='searchPlaceHolder'>
 					</selectAddress>
+
 				</u-cell-item>
 				<u-cell-item title="发布者昵称" :title-style="titleStyle" :border-bottom='false' @click="editNicknamee">
 					<view :style='textStyle'>
@@ -66,6 +76,8 @@
 		},
 		data() {
 			return {
+				searchPlaceHolder: '选择地区',
+				placeTitle: '交货地',
 				imgList: [],
 				showNickname: false,
 				dataObj: {
@@ -103,6 +115,14 @@
 				isAdd: false,
 			};
 		},
+		onShow() {
+			let _tl = uni.getStorageSync('transactionPlace')
+			if (_tl) {
+				this.dataObj.placeDelivery = _tl.address
+			} else {
+
+			}
+		},
 		onLoad() {
 			console.log("user", this.userInfo)
 			this.dataObj.userId = this.userInfo.id
@@ -120,6 +140,9 @@
 		},
 
 		methods: {
+			clear() {
+				this.dataObj.publishingContent = ''
+			},
 			closePopup() {
 				this.dataObj.publisher = this.userInfo.wechatNo
 			},
@@ -183,9 +206,18 @@
 					});
 			},
 			editNicknamee() {
+				console.log(this.dataObj)
 				this.showNickname = true
 			},
 			submit() {
+
+				if (!this.dataObj.publishingContent && this.businesslicense.length == 0) {
+					uni.showToast({
+						title: "图片和文字不能同时为空,错误提示“发布内容不能为空",
+						icon: 'none',
+						duration: 2000
+					})
+				}
 				uni.showLoading({
 					title: '数据加载中',
 					mask: true
@@ -210,10 +242,32 @@
 			},
 			selectAddress(val) {
 				console.log(val)
-				this.dataObj.placeDelivery = val
+				console.log(this.dataObj.tranType)
+				if (!val.check) {
+					uni.showToast({
+						title: '地点必须选到区县一级',
+						icon: 'none',
+						duration: 2000
+					})
+					return
+				}
+				try {
+					uni.setStorageSync('transactionPlace', val);
+					this.dataObj.placeDelivery = val.address
+				} catch (e) {
+					// error
+				}
 			},
 			radioChange(e) {
-				// console.log(e);
+				console.log(e);
+				if (e == '销售') {
+					this.placeTitle = '货源地'
+					// this.searchPlaceHolder = '选择货源地区'
+				} else {
+					this.placeTitle = '交货地'
+					// this.searchPlaceHolder = '选择交货地区'
+				}
+
 			},
 			filterFileType(index, lists) {
 				if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
@@ -256,6 +310,7 @@
 <style lang="scss" scoped>
 	.content {
 		// overflow: hidden;
+		padding-bottom: 100rpx;
 	}
 
 	.content1 {
@@ -271,11 +326,12 @@
 		font-size: 28rpx;
 	}
 
-	.textarea {
-		padding: 20rpx 20rpx 50rpx 20rpx;
-		width: 100%;
-		font-size: 28rpx;
-	}
+	// .textarea {
+	// 	padding: 20rpx 20rpx 50rpx 20rpx;
+	// 	width: 100%;
+	// 	font-size: 28rpx;
+	// 	background: red
+	// }
 
 	.top {
 		position: relative;
@@ -299,6 +355,7 @@
 	}
 
 	.submit {
+		margin: 40rpx auto;
 		width: 654rpx;
 		height: 92rpx;
 		background: #22C572;
@@ -308,11 +365,11 @@
 		color: #FFFFFF;
 		line-height: 92rpx;
 		text-align: center;
-		position: fixed;
-		bottom: 76rpx;
-		left: 0;
-		right: 0;
-		margin: auto;
+		// position: fixed;
+		// bottom: 76rpx;
+		// left: 0;
+		// right: 0;
+		// margin: auto;
 	}
 
 	.edit-nickname {
@@ -326,4 +383,80 @@
 	.nickname-btn {
 		margin-top: 20rpx;
 	}
+
+	.row {
+		display: flex;
+		justify-content: space-between;
+		position: relative;
+		background: #fff;
+
+		border-radius: 20rpx;
+
+		input {
+			font-size: 28rpx;
+			// color: #333333;
+		}
+
+		.left {
+			display: flex;
+			align-items: center;
+			color: #333333;
+			font-size: 34rpx;
+			font-weight: 600;
+		}
+	}
+
+	.row_css {
+		font-size: 26rpx;
+		color: #333333;
+		margin-top: 60rpx;
+		font-weight: 500;
+	}
+
+	.textarea {
+		background: #F9F9FA;
+		font-size: 28rpx;
+		text-align: left;
+		width: 100%;
+		padding: 30rpx 30rpx;
+		border-radius: 5px;
+		margin: 30rpx;
+		height: 46vh;
+		padding-bottom: 20rpx;
+		color: #333;
+	}
+
+	.textarea textarea {
+		height: 90%;
+	}
+
+	.textarea-left {
+		position: absolute;
+		bottom: 40rpx;
+		left: 50rpx;
+		color: #606266;
+	}
+
+	.textarea-bottom {
+		position: absolute;
+		bottom: 40rpx;
+		right: 40rpx;
+		color: #AFB3BF;
+	}
+
+	.clear {
+		/* width: 90%; */
+		// background: #ffffff;
+		color: #22C572;
+		// border: 1px solid #22C572;
+		// border-radius: 50rpx;
+		// font-size: 28rpx;
+		// padding: 9rpx 24rpx;
+	}
+
+	.bottom-btn {
+		position: fixed;
+		bottom: 30rpx;
+		width: 90%;
+	}
 </style>

BIN
static/delete.png