gjy 2 năm trước cách đây
mục cha
commit
79c72843bf

+ 27 - 1
components/selectAddress.vue

@@ -20,9 +20,25 @@
 			},
 			textStyle: {
 				type: Object,
+			},
+			placeHolder:{
+				type: String,
+				default: '全国'
+			},
+			forbid:{
+				type: Boolean,
+				default: false
 			}
 		},
 		watch: {
+			placeHolder:{
+				handler(val){
+					console.log(val)
+					this.searchPlace=val
+					this.placeHolder=val
+				},
+				deep:true
+			}
 			// keyword:function(val){
 			// 	let arr = this.tList;
 			// 	if(val!=''){
@@ -44,7 +60,7 @@
 		},
 		data() {
 			return {
-				searchPlace: '全国',
+				searchPlace: this.placeHolder,
 				multiIndex: [0, 0, 0],
 				multiArray: [
 					[],
@@ -62,6 +78,7 @@
 		},
 		methods: {
 			columnchange(e) {
+				
 				console.log('picker发送选择改变', e.detail)
 				this.multiIndex[e.detail.column] = e.detail.value
 				console.log("this.multiIndex", this.multiIndex)
@@ -83,6 +100,15 @@
 			},
 			bindPickerChange: function(e) {
 				console.log('picker发送选择改变,携带值为', e.detail.value)
+				console.log(e.detail.value[0])
+				if(this.forbid&&e.detail.value[0]==0){
+					uni.showToast({
+						title: "请选择除全国外的其他区域!",
+						icon: 'none',
+						duration: 2000
+					})
+					return
+				}
 				this.index = e.detail.value
 				console.log(this.multiArray)
 				//判断全部

+ 1 - 1
pages.json

@@ -716,7 +716,7 @@
 		{
 			"path": "pages/business/businessNew",
 			"style": {
-				"navigationStyle": "custom",
+				// "navigationStyle": "custom",
 				"navigationBarTitleText": "交易",
 				"enablePullDownRefresh": true,
 				"titleNView": {

+ 9 - 5
pages/business/businessNew.vue

@@ -22,7 +22,7 @@
 				<!-- 数据列表 -->
 				<view class="list" v-if="goods.length!=0">
 					<view class="list-item" v-for="(item,index) in goods">
-						<view class="row1 flex jcsb alc">
+						<view class="row1 jcsb alc flex">
 							<view class="left flex alc">
 								<image
 									:src="item.commonUser.avatarUrl?item.commonUser.avatarUrl:'../../static/img/face/27.png'"
@@ -139,7 +139,7 @@
 					noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
 					empty: {
 						tip: '~ 搜索无数据 ~', // 提示
-						btnText: '去看看'
+						// btnText: '去看看'
 					}
 				},
 				goods: [], //列表数据
@@ -214,6 +214,10 @@
 			uni.navigateTo({
 				url: 'myAttention'
 			})
+			setTimeout(()=>{
+			uni.stopPullDownRefresh()	
+			},1000)
+
 		},
 
 		methods: {
@@ -273,7 +277,8 @@
 				if (!this.hasLogin) {
 					this.isShowAlert = true;
 				} else {
-					if(uni.getStorageInfoSync('userInfo')&&uni.getStorageInfoSync('userInfo').status==1){
+					console.log(1111111,uni.getStorageSync('userInfo'))
+					if(uni.getStorageSync('userInfo')&&uni.getStorageSync('userInfo').status==1){
 						uni.navigateTo({
 							url: 'release'
 						})
@@ -285,7 +290,6 @@
 						})
 					}
 				}
-
 			},
 			downCallback() {
 				this.mescroll.resetUpScroll();
@@ -360,7 +364,7 @@
 	}
 </script>
 
-<style lang='scss'>
+<style lang='scss' scoped>
 	page,
 	.content {
 		background: #F5F6FA;

+ 50 - 4
pages/business/release.vue

@@ -2,10 +2,10 @@
 	<view class="content">
 		<view class="content1">
 			<view class="top">
-				<textarea v-model="dataObj.publishingContent" placeholder="请发布粮食类商品交易信息,建议包含联系方" maxlength='200'
+				<textarea v-model="dataObj.publishingContent" placeholder="请发布粮食类商品交易信息,建议包含联系方" maxlength='2000'
 					placeholder-class='placeholder-class' class="textarea" />
 				<view class="number">
-					{{dataObj.publishingContent.length}}/200个字
+					{{dataObj.publishingContent.length}}/2000个字
 				</view>
 			</view>
 			<view style="padding-left: 10rpx;">
@@ -25,8 +25,8 @@
 						</u-radio>
 					</u-radio-group>
 				</u-cell-item>
-				<u-cell-item title="交易地" :title-style="titleStyle">
-					<selectAddress @selectAddress='selectAddress' series='3' :textStyle='textStyle'></selectAddress>
+				<u-cell-item :title="dataObj.tranType=='采购'?'交易地':'货源地'" :title-style="titleStyle">
+					<selectAddress forbid='false' :placeHolder='dataObj.tranType=="采购"?"选择交货地区":"选择货源地区"' @selectAddress='selectAddress' series='3' :textStyle='textStyle'></selectAddress>
 				</u-cell-item>
 				<u-cell-item title="发布者昵称" :title-style="titleStyle" :border-bottom='false' @click="editNicknamee">
 					<view :style='textStyle'>
@@ -106,6 +106,11 @@
 			this.dataObj.userId = this.userInfo.id
 			this.dataObj.publisher = this.userInfo.wechatNo
 		},
+		onShow() {
+			if(uni.getStorageSync('placeDelivery')){
+				this.dataObj.placeDelivery=uni.getStorageSync('placeDelivery')
+			}
+		},
 		onNavigationBarButtonTap(e) {
 			console.log(e)
 			uni.navigateTo({
@@ -183,6 +188,46 @@
 				this.showNickname = true
 			},
 			submit() {
+				if(!this.dataObj.publishingContent&&this.imgList.length==0){
+					uni.showToast({
+						title: "发布内容不能为空!",
+						icon: 'none',
+						duration: 2000
+					})
+					return
+				}
+				if(this.dataObj.publishingContent.length>2000){
+					uni.showToast({
+						title: "交易信息字数不超过2000字!",
+						icon: 'none',
+						duration: 2000
+					})
+					return
+				}
+				if(!this.dataObj.publisher){
+					uni.showToast({
+						title: "昵称不能为空!",
+						icon: 'none',
+						duration: 2000
+					})
+					return
+				}
+				if(!this.dataObj.placeDelivery&&this.dataObj.tranType=='采购'){
+					uni.showToast({
+						title: "交易地不能为空!",
+						icon: 'none',
+						duration: 2000
+					})
+					return
+				}
+				if(!this.dataObj.placeDelivery&&this.dataObj.tranType=='销售'){
+					uni.showToast({
+						title: "货源地不能为空!",
+						icon: 'none',
+						duration: 2000
+					})
+					return
+				}
 				uni.showLoading({
 					title: '数据加载中',
 					mask: true
@@ -193,6 +238,7 @@
 				this.$api.doRequest('post', '/transactionExchangeInfo/addInfo', this.dataObj).then(res => {
 					console.log(res)
 					if (res.data.code == 200) {
+						uni.setStorageSync('placeDelivery',this.dataObj.placeDelivery)
 						uni.navigateBack({
 							delta: 1
 						})

+ 4 - 4
pages/user/newReport.vue

@@ -2,7 +2,7 @@
 	<view class="content">
 		<view class="status_bar"></view>
 		<view class="top-nav">
-			<u-icon name="arrow-left" size="38" class="back" @click="back"></u-icon>
+			<uni-icons class="back" type="back" size="25" @click="back"></uni-icons>
 			<view class="right" :class="index==2?'nav-active':''" @click="navClick(2)">
 				新季
 			</view>
@@ -530,7 +530,7 @@
 				},
 				opts2: {
 					color: ["#D2F3E2", "#22C572"],
-					padding: [15, 30, 0, 5],
+					padding: [15, 20, 0, 5],
 					legend: {
 						fontSize: 12,
 						position: 'top',
@@ -1068,7 +1068,7 @@
 					}
 				} else {
 					if (val[1].biViewInfoList && val[1].biViewInfoList.length > 0) {
-
+						this.ym1Change = val[1].biViewInfoList[val[1].biViewInfoList.length - 1].name.replace(/-/g, ".");
 						this.ym1 = val[1].biViewInfoList[val[1].biViewInfoList.length - 1].name
 						this.sr = val[1].biViewInfoList[val[1].biViewInfoList.length - 1].weight
 						this.zc = val[3].biViewInfoList[val[3].biViewInfoList.length - 1].weight
@@ -1706,7 +1706,7 @@
 	.back {
 		position: absolute;
 		left: 20rpx;
-		top: 0;
+		top: 25%;
 		bottom: 0;
 		margin: auto;
 	}