Browse Source

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-app

wangchao 3 năm trước cách đây
mục cha
commit
f742b07210

+ 2 - 2
config/index.js

@@ -1,6 +1,6 @@
 const dev = {
-	// baseUrl: 'https://www.zthymaoyi.com',
-	baseUrlNew: 'http://192.168.1.110:8090/',
+	baseUrl: 'https://www.zthymaoyi.com',
+	baseUrlNew: 'http://192.168.1.107:8090/',
 	//baseUrlNew: 'http://api.eliangeyun.com/',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false

+ 19 - 19
pageB/contract/contract.vue

@@ -245,26 +245,26 @@
 			},
 			commit(item) {
 				console.log(item)
-				var list = item.addressUrl.toString().split(',')
-				if(list.length > 0){
-					uni.downloadFile({
-					  url: list[0],
-					  success: function (res) {
-					    var filePath = res.tempFilePath;
-					    uni.openDocument({
-					      filePath: filePath,
-					      success: function (res) {
-							  uni.hideLoading()
-					        console.log('打开文档成功');
-					      }
-					    });
-					  },
-					})
-				}
+				// var list = item.addressUrl.toString().split(',')
+				// if(list.length > 0){
+				// 	uni.downloadFile({
+				// 	  url: list[0],
+				// 	  success: function (res) {
+				// 	    var filePath = res.tempFilePath;
+				// 	    uni.openDocument({
+				// 	      filePath: filePath,
+				// 	      success: function (res) {
+				// 			  uni.hideLoading()
+				// 	        console.log('打开文档成功');
+				// 	      }
+				// 	    });
+				// 	  },
+				// 	})
+				// }
 				
-				// uni.navigateTo({
-				// 	url: `/pageB/contract/enclosures?addressUrl=${item.addressUrl}`
-				// })
+				uni.navigateTo({
+					url: `/pageB/contract/enclosures?addressUrl=${item.addressUrl}`
+				})
 			},
 			commit1(item) {
 				uni.navigateTo({

+ 2 - 2
pageD/myRelease/buyEdit.vue

@@ -501,11 +501,11 @@
 						}
 					}
 				}else if(this.deptList.procurementPlanType == '期货'){
-					if (!this.deptList.basisPrice) {
+					if (!String(this.deptList.basisPrice)) {
 						this.$api.msg('基差不能为空')
 						return
 					}
-					if (this.deptList.basisPrice>10000||this.deptList.basisPrice<1) {
+					if (this.deptList.basisPrice>10000||this.deptList.basisPrice<0) {
 						this.$api.msg('基差输入错误')
 						return
 					}

+ 2 - 2
pageD/myRelease/buyGrain.vue

@@ -465,11 +465,11 @@
 						}
 					}
 				} else if (this.deptList.procurementPlanType == '期货') {
-					if (!this.deptList.basisPrice) {
+					if (!String(this.deptList.basisPrice)) {
 						this.$api.msg('基差(元/吨)不能为空')
 						return
 					}
-					if (this.deptList.basisPrice > 10000 || this.deptList.basisPrice < 1) {
+					if (this.deptList.basisPrice > 10000 || this.deptList.basisPrice < 0) {
 						this.$api.msg('基差输入错误')
 						return
 					}

+ 1 - 1
pageD/myRelease/sellEdit.vue

@@ -497,7 +497,7 @@
 						}
 					}
 				} else if (this.deptList.salePlanType == '期货') {
-					if (!this.deptList.basisPrice) {
+					if (!String(this.deptList.basisPrice)) {
 						this.$api.msg('基差(元/吨)不能为空')
 						return
 					}

+ 2 - 2
pageD/myRelease/sellGrain.vue

@@ -497,11 +497,11 @@
 						}
 					}
 				} else if (this.deptList.salePlanType == '期货') {
-					if (!this.deptList.basisPrice) {
+					if (!String(this.deptList.basisPrice)) {
 						this.$api.msg('基差(元/吨)不能为空')
 						return
 					}
-					if (this.deptList.basisPrice > 10000 || this.deptList.basisPrice < 1) {
+					if (this.deptList.basisPrice > 10000 || this.deptList.basisPrice < 0) {
 						this.$api.msg('基差输入错误')
 						return
 					}

+ 31 - 21
pages/grain_pulse/dynamic.vue

@@ -14,8 +14,6 @@
 				<view style="color: #656765;">记录</view>
 			</view>
 		</view>
-
-
 		<view v-for="(item,index) in releaseList">
 			<view class="modular">
 				<view class="flex">
@@ -29,7 +27,12 @@
 				</view>
 				<view class="title">{{item.title}}</view>
 				<view class="titleText">
-					{{item.content}}
+					<!-- {{item.content}} -->
+					<u-read-more show-height="200" :toggle="true" close-text="展开">
+						<!-- <rich-text :nodes="item.content"></rich-text> -->
+						 <!-- @load="parseLoaded" -->
+						<u-parse :html="item.content" ></u-parse>
+					</u-read-more>
 				</view>
 				<view class="imgList flex" v-if="item.address != ''">
 					<view v-for="(items,count) in item.imgList" style="width: 30%;margin-left: 20rpx;">
@@ -46,10 +49,10 @@
 			</view>
 		</view>
 		<view v-show="isLoadMore">
-			<uni-load-more :status="loadStatus"></uni-load-more>
-				<!-- <u-loadmore :status="status" /> -->
+			<!-- <uni-load-more :status="loadStatus" icon icon-type></uni-load-more> -->
+			<u-loadmore :status="loadStatus" icon icon-type="circle" margin-bottom="200"/>
 		</view>
-		<view style='height:12vh;background:#F5F6FA;line-height:24vh;text-align:center;' v-if='releaseInfo.length == 0'>
+		<view style='height:12vh;background:#F5F6FA;line-height:12vh;text-align:center;' v-if='releaseList.length == 0'>
 			当前暂无结果
 		</view>
 	</view>
@@ -64,11 +67,11 @@
 			return {
 				keyword: "",
 				releaseList: [],
-				 releaseInfo:[],
+				releaseInfo: [],
 				currentPage: 1,
 				pageSize: 10,
-				isLoadMore:false,
-				loadStatus:"loading"
+				isLoadMore: false,
+				loadStatus: "loading"
 			}
 		},
 		computed: {
@@ -82,13 +85,15 @@
 			}, 1000);
 		},
 		onReachBottom() { //上拉触底函数
+		var that = this
 			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
 				this.isLoadMore = true
 				this.currentPage += 1
 				setTimeout(function() {
-					uni.stopPullDownRefresh();
+					 uni.stopPullDownRefresh();
+					 that.getrelease()
 				}, 1000);
-				this.getrelease()
+				
 			}
 		},
 		onShow() {
@@ -97,6 +102,9 @@
 			this.getrelease()
 		},
 		methods: {
+			// parseLoaded() {
+			// 	this.$refs.uReadMore.init();
+			// },
 			getrelease() {
 				this.$api.doRequest('get', '/settledCompanyDynamics/selectSettledCompanyDynamicsPage', {
 						currentPage: this.currentPage,
@@ -105,17 +113,20 @@
 					})
 					.then(res => {
 						if (res.data.code == 200) {
-							 this.releaseInfo = res.data.data.records
-							if(res.data.data.records.length > 0){
-								this.releaseList=this.releaseList.concat(this.releaseInfo)
+							this.releaseInfo = res.data.data.records
+							if (this.releaseInfo.length > 0) {
+								this.releaseList = this.releaseList.concat(this.releaseInfo)
 								this.isLoadMore = false
 								for (let i = 0; i < this.releaseList.length; i++) {
-									this.releaseList[i].imgList = this.releaseList[i].address.split(",")
+									if (this.releaseList[i].address != null) {
+										this.releaseList[i].imgList = this.releaseList[i].address.split(",")
+									}
+
 								}
-							}else{
+							} else {
 								this.loadStatus = 'nomore'
 							}
-							
+
 						}
 					})
 			},
@@ -155,15 +166,14 @@
 		height: 40rpx;
 		margin-top: 40rpx;
 		text-align: center;
-
 	}
 
 	.modular {
 		width: 94%;
-		margin: 20rpx auto;
+		margin: 40rpx auto;
 		background-color: #FFFFFF;
 		border-radius: 40rpx;
-		margin-top: 40rpx;
+		// margin-top: 40rpx;
 	}
 
 	.touxiang {
@@ -180,7 +190,7 @@
 	}
 
 	.titleText {
-		font-size: 34rpx;
+		font-size: 30rpx;
 		margin-left: 30rpx;
 		margin-top: 10rpx;
 	}

+ 92 - 13
pages/grain_pulse/record.vue

@@ -31,10 +31,12 @@
 						<view style="color: #AFB3BF; margin-top: 4rpx;">{{item.updateDate}}</view>
 					</view>
 					<view class="flex" style="width: 40%; justify-content: flex-end;margin: 40rpx;">
-						<view style="color: #FE6430;" v-if="item.status == '审核中' || item.status == '未审核'|| item.status == '待审核'">{{item.status}}</view>
+						<view style="color: #FE6430;"
+							v-if="item.status == '审核中' || item.status == '未审核'|| item.status == '待审核'">{{item.status}}
+						</view>
 						<view style="color: #22C572;" v-if="item.status == '已通过'">{{item.status}}</view>
 						<view style="color: #FB1E1E;" v-if="item.status == '已驳回'">{{item.status}}</view>
-						
+
 					</view>
 				</view>
 				<view class="title">{{item.title}}</view>
@@ -61,6 +63,14 @@
 				</view>
 			</view>
 		</view>
+		<view v-show="isLoadMore">
+			<!-- <uni-load-more :status="loadStatus"></uni-load-more> -->
+			<!-- <u-loadmore :status="status" /> -->
+			<u-loadmore :status="loadStatus" icon icon-type="circle" margin-bottom="80" margin-top="60rpx" />
+		</view>
+		<view style='height:12vh;background:#F5F6FA;line-height:12vh;text-align:center;' v-if='release.length == 0'>
+			当前暂无结果
+		</view>
 	</view>
 </template>
 
@@ -99,14 +109,16 @@
 						changeCss: "label",
 					}
 				],
-				release: [{
-					imgList: [],
-				}],
+				release: [],
+				releaseInfo: [],
 				currentPage: 1,
 				pageSize: 10,
 				imgList: [],
 				userName: "",
 				searchType: "",
+				searchTypeInfo: "",
+				isLoadMore: false,
+				loadStatus: "loading",
 
 			}
 		},
@@ -118,6 +130,25 @@
 			this.portraits = this.userInfo.avatarUrl
 			this.getRelease()
 		},
+		//下拉刷新
+		onPullDownRefresh() {
+			this.getRelease()
+			setTimeout(function() {
+				uni.stopPullDownRefresh();
+			}, 1000);
+		},
+		onReachBottom() { //上拉触底函数
+			var that = this
+			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
+				this.isLoadMore = true
+				this.currentPage += 1
+				setTimeout(function() {
+					uni.stopPullDownRefresh();
+					that.getRelease()
+				}, 1000);
+				// this.getRelease()
+			}
+		},
 		methods: {
 			navBack() {
 				uni.navigateBack(1)
@@ -138,7 +169,7 @@
 					this.searchType = "2"
 				} else if (item.name == "未通过") {
 					this.searchType = "3"
-				} else{
+				} else {
 					this.searchType = ""
 				}
 				this.getRelease()
@@ -152,12 +183,53 @@
 					})
 					.then(res => {
 						if (res.data.code == 200) {
+							if (!this.searchType) {
+								this.releaseInfo = res.data.data.records
+								if (this.releaseInfo.length > 0) {
+									this.release = this.release.concat(this.releaseInfo)
+									this.count = this.release.length
+									this.isLoadMore = false
+									for (let i = 0; i < this.release.length; i++) {
+										this.release[i].imgList = this.release[i].address.split(",")
+									}
+								} else {
+									this.loadStatus = 'nomore'
+								}
+							} else {
+								debugger
+								if (this.searchTypeInfo == this.searchType) {
+									this.releaseInfo = res.data.data.records
+									if (this.releaseInfo.length > 0) {
+										this.release = this.release.concat(this.releaseInfo)
+										this.count = this.release.length
+										this.isLoadMore = false
+										for (let i = 0; i < this.release.length; i++) {
+											this.release[i].imgList = this.release[i].address.split(",")
+										}
+									} else {
+										this.loadStatus = 'nomore'
+									}
+								}else{
+										this.release = []
+										this.releaseInfo = res.data.data.records
+										if (this.releaseInfo.length > 0) {
+											this.release = this.release.concat(this.releaseInfo)
+											this.count = this.release.length
+											this.isLoadMore = false
+											for (let i = 0; i < this.release.length; i++) {
+												this.release[i].imgList = this.release[i].address.split(",")
+											}
+										} else {
+											this.loadStatus = 'nomore'
+										}
+								}
+								this.searchTypeInfo = this.searchType
 
-							this.release = res.data.data.records
-							this.count = this.release.length
-							for (let i = 0; i < this.release.length; i++) {
-								this.release[i].imgList = this.release[i].address.split(",")
 							}
+
+
+
+
 						}
 					})
 			},
@@ -222,11 +294,18 @@
 
 	.modular {
 		width: 94%;
-		margin: 0 auto;
+		margin: 40rpx auto;
 		background-color: #FFFFFF;
 		border-radius: 40rpx;
-		margin-top: 40rpx;
+		// margin-top: 40rpx;
+	}
 
+	.modular {
+		width: 94%;
+		margin: 20rpx auto;
+		background-color: #FFFFFF;
+		border-radius: 40rpx;
+		margin-top: 40rpx;
 	}
 
 	.introduce {
@@ -286,7 +365,7 @@
 	}
 
 	.titleText {
-		font-size: 34rpx;
+		font-size: 30rpx;
 		margin-left: 30rpx;
 		margin-top: 10rpx;
 	}

+ 69 - 34
pages/grain_pulse/release.vue

@@ -5,18 +5,18 @@
 				<view class="c-row b-b ">
 					<view style="width: 30%;color: #71747C;font-size: 30rpx;">发布主体</view>
 					<view class="flex" style="width: 70%;justify-content: flex-end;">
-						<picker :range="companyType" @change="companyChange($event)" style="margin-right: 0px;">
-							<view>{{companyIndex > -1?companyType[companyIndex]:'请选择发布主体'}}</view>
+						<picker :range="companyType" @change="companyChange($event)"
+							style="margin-right: 6rpx;font-size: 30rpx;">
+							<view>{{companyIndex > -1?companyType[companyIndex] :'请选择发布主体'}}</view>
 						</picker>
 						<u-icon name="arrow-right" color="#AFB3BF" :custom-style="{'marginRight':'10rpx'}"></u-icon>
 					</view>
-
 				</view>
-				<view class="c-row">
+				<view class="c-row" @click="location">
 					<view style="width: 30%;color: #71747C;font-size: 30rpx;">城市</view>
-					<view class="flex" style="width: 70%;justify-content: flex-end;">
-						{{chengshi == null || chengshi == "" ? "请选择城市": chengshi}}
-
+					<view class="flex"
+						style="width: 70%;justify-content: flex-end;margin-right: 6rpx;font-size: 30rpx;">
+						{{release.city == null || release.city == "" ? "请选择城市": release.city}}
 					</view>
 					<u-icon name="arrow-right" color="#AFB3BF" :custom-style="{'marginRight':'10rpx'}"></u-icon>
 				</view>
@@ -28,8 +28,8 @@
 				</view>
 				<view class="inputText">
 					<u-input v-model="release.content" type="textarea" :border="border" :height="height"
-						:auto-height="autoHeight" class="a" maxlength="200"
-						placeholder="请发布粮食类商品交易信息,建议包含联系方式、地址等信息,不超过200个字" @input="wordJiSuan" :clearable="clear" />
+						:auto-height="autoHeight" maxlength="200" placeholder="请发布粮食类商品交易信息,建议包含联系方式、地址等信息,不超过200个字"
+						@input="wordJiSuan" :clearable="clear" />
 				</view>
 				<view style="text-align: right;color: #C5CAD4;font-size: 30rpx;margin-right: 20rpx;">{{wordCount}}/200字
 				</view>
@@ -54,7 +54,7 @@
 		data() {
 			return {
 				deptList: {},
-				chengshi: "", //城市
+				chengshi: [], //城市
 				clear: false,
 				border: false,
 				height: 300,
@@ -69,15 +69,21 @@
 				companyType: [],
 				release: {},
 				address: [],
-				getCompany: {}
+				getCompany: {},
+				companyType1: [],
 			}
 		},
-		onShow() {
-			this.companyList()
-		},
 		computed: {
 			...mapState(['hasLogin', 'userInfo'])
 		},
+		onShow() {
+			this.chengshi = uni.getStorageSync("Visit_key")
+			if (this.chengshi.length > 0) {
+				this.release.city = this.chengshi[0].cityName
+			}
+			this.companyList()
+		},
+
 		methods: {
 			companyList() {
 				this.getCompany.loginPhone = this.userInfo.phone
@@ -140,33 +146,62 @@
 					}
 				}
 				if (!this.release.content && this.address.length == 0) {
-					console.log("进入")
 					this.$api.msg("动态内容和图片不能同时为空")
 					return
 				}
-				this.release.city = "营口"
-				this.release.address = this.address.toString()
-				this.release.phone = this.userInfo.phone
-				var that = this
-				uni.showModal({
-					content: "确定发布动态?",
-					showCancel: true,
-					confirmText: '确定',
-					success: function(res) {
-						if (res.confirm) {
-							that.$api.doRequest('post',
-									'/settledCompanyDynamics/api/addSettledCompanyDynamics', that.release)
-								.then(res => {
-									if (res.data.code == 200) {
-										uni.navigateBack(1)
-									}
+				if (this.companyType.length == 0) {
+					uni.showModal({
+						content: "您还没有入驻粮脉,不能发布,是否前去完善入驻信息!",
+						showCancel: true,
+						confirmText: '前往',
+						success: function(res) {
+							if (res.confirm) {
+								uni.navigateTo({
+									url: `/pages/grain_pulse/enter`
 								})
+							}
 						}
-					}
-				})
-			}
+					})
+					return
+				} else {
+					this.release.address = this.address.toString()
+					this.release.phone = this.userInfo.phone
+					var that = this
+					uni.showModal({
+						content: "确定发布动态?",
+						showCancel: true,
+						confirmText: '确定',
+						success: function(res) {
+							if (res.confirm) {
+								that.$api.doRequest('post',
+										'/settledCompanyDynamics/api/addSettledCompanyDynamics', that.release)
+									.then(res => {
+										if (res.data.code == 200) {
+											uni.showToast({
+												title: '发布成功!',
+												icon: 'none',
+												duration: 2000,
+												success() {
+													setTimeout(function() {
+														uni.navigateBack(1)
+													}, 1000);
+												}
+											})
+
+										}
+									})
+							}
+						}
+					})
+				}
 
 
+			},
+			location() {
+				uni.navigateTo({
+					url: `/pages/grain_pulse/position/position`
+				})
+			}
 		}
 	}
 </script>