achao há 2 anos atrás
pai
commit
1deddfba72

+ 4 - 0
App.vue

@@ -20,6 +20,9 @@
 				version: "",
 			}
 		},
+		globalData: {
+			userRelease: true
+		},
 		methods: {
 			...mapMutations(['login']),
 			nvueRequst: function(method, url, data, header) {
@@ -178,6 +181,7 @@
 			// },
 		},
 		onLaunch: function() {
+			console.log(this.$scope.globalData.userRelease);
 			// #ifdef APP-PLUS
 			let type = uni.getSystemInfoSync().platform
 			console.log(type)

+ 1 - 1
components/search.vue

@@ -119,7 +119,7 @@
 			//加载热门搜索
 			loadHotKeyword() {
 				//定义热门搜索关键字,可以自己实现ajax请求数据再赋值
-				this.hotKeywordList = ['键盘', '鼠标', '显示器', '电脑主机', '蓝牙音箱', '笔记本电脑', '鼠标垫', 'USB', 'USB3.0'];
+				this.hotKeywordList = ['大豆', '玉米', '高粱', '白小麦', '混合麦', '水稻', '玉米淀粉', '豆粕', '大麦', '小麦'];
 			},
 			//监听输入
 			inputChange(event) {

+ 18 - 2
components/selectAddress.vue

@@ -2,7 +2,8 @@
 	<view>
 		<picker @change="bindPickerChange" :value="multiIndex" :range="multiArray" range-key='label'
 			mode="multiSelector" @columnchange='columnchange'>
-			<view class="text" :style="textStyle">{{searchPlace}}</view>
+			<view class="text" :style="textStyleEmpty" v-if="searchPlace=='请选交货地区'">{{searchPlace}}</view>
+			<view class="text" :style="textStyle" v-else>{{searchPlace}}</view>
 		</picker>
 	</view>
 </template>
@@ -14,6 +15,18 @@
 	export default {
 		name: 'selectAddress',
 		props: {
+			searchPlace: {
+				type: String,
+				default: '全国'
+			},
+			edit: {
+				value: Boolean,
+				default: false
+			},
+			text: {
+				type: String,
+				default: ''
+			},
 			series: {
 				type: String,
 				default: '1'
@@ -44,7 +57,10 @@
 		},
 		data() {
 			return {
-				searchPlace: '全国',
+				textStyleEmpty: {
+					"color": '#C5CAD4',
+					"font-size": '32rpx'
+				},
 				multiIndex: [0, 0, 0],
 				multiArray: [
 					[],

+ 10 - 1
pages.json

@@ -1687,7 +1687,16 @@
 			}
 
 		}
-	],
+	    ,{
+            "path" : "pages/business/editRelease",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "发布",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+    ],
 	"subpackages": [{
 			"root": "pageA",
 			"pages": [{

+ 67 - 30
pages/business/businessNew.vue

@@ -86,12 +86,16 @@
 				<u-icon name="plus" color="#fff" size="34" bold></u-icon>
 			</view>
 			<u-modal v-model="show" content="确定不在关注?" :show-title='false' :show-cancel-button='true'
-				:content-style="contentStyle" showCancelButton='true'></u-modal>
+				:content-style="contentStyle" showCancelButton='true' @confirm="cancelFollow" @cancel="show=false">
+			</u-modal>
 		</view>
 		<search v-if="isShowSearch" @searchVal='searchVal'></search>
 		<u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
 			:content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
 			showCancelButton='false' content="尚未登录,是否立即登录" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
+		<u-modal v-model="isSHowReleaseAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
+			:content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='我知道了'
+			title='温馨提示' content="交易信息为用户自由发布,正式签订合同前切勿进行任何付款操作,以免给您的财产造成损失。" @confirm="releaseAlertbtn"></u-modal>
 		<u-toast ref="uToast" />
 	</view>
 </template>
@@ -116,6 +120,7 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data() {
 			return {
+				isSHowReleaseAlert: null,
 				canReset: false,
 				selectPlace: '',
 				mescroll: null,
@@ -130,7 +135,7 @@
 				inputStyle: {
 					// "padding-left": '30rpx'
 				},
-				content: '上半年,普陀区开展“绿剑”系列执法行动二次,共计出动执法人员120余人次,检有关经营主体87余家次,发放宣传资料等200余份;加强农产品和农业…上半年,普陀区开展“绿剑”系列执法行动二次,共计出动执法人员120余人次,检有关经营主体87余家次,发放宣传资料等200余份;加强农产品和农业…',
+				content: '',
 				upOption: {
 					// page: {
 					// 	num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
@@ -138,8 +143,9 @@
 					// },
 					noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
 					empty: {
-						tip: '~ 搜索无数据 ~', // 提示
-						btnText: '去看看'
+						icon: '/static/empty.png',
+						tip: '暂无内容', // 提示
+						// btnText: '去看看'
 					}
 				},
 				goods: [], //列表数据
@@ -164,6 +170,8 @@
 		},
 
 		onShow() {
+			this.isSHowReleaseAlert = getApp().globalData.userRelease
+			console.log("this.isSHowReleaseAlert", this.isSHowReleaseAlert)
 			uni.showTabBar()
 			uni.hideKeyboard()
 			var userInfo = uni.getStorageSync("userInfo")
@@ -211,12 +219,37 @@
 		onLoad(options) {},
 		onNavigationBarButtonTap(e) {
 			console.log(e)
-			uni.navigateTo({
-				url: 'myAttention'
-			})
+			if (!this.hasLogin) {
+				this.isShowAlert = true;
+			} else {
+				uni.navigateTo({
+					url: 'myAttention'
+				})
+			}
+
 		},
 
 		methods: {
+			releaseAlertbtn() {
+				getApp().globalData.userRelease = false
+				this.isSHowReleaseAlert = false
+			},
+			cancelFollow() {
+				let _obj = {
+					id: this.selectItem.followInformation.id
+				}
+				console.log()
+				this.$api.doRequest('post', '/followInformation/api/deleteInfo', _obj).then(res => {
+					if (res.data.code == 200) {
+						this.$refs.uToast.show({
+							title: '取关成功',
+							type: 'success',
+						})
+						this.mescroll.resetUpScroll()
+					}
+					uni.hideLoading()
+				})
+			},
 			mescrollInit(mescroll) {
 				console.log("mescroll", mescroll)
 				this.mescroll = mescroll;
@@ -239,30 +272,35 @@
 			},
 			follow(val, type) {
 				// 2关注
-				this.selectItem = val
-				if (type == 1) {
-					this.show = true
+				if (!this.hasLogin) {
+					this.isShowAlert = true;
 				} else {
-					let _obj = {
-						userId: this.userInfo.id,
-						followedId: val.userId
-					}
-					uni.showLoading({
-						title: '数据加载中',
-						mask: true
-					})
-					this.$api.doRequest('post', '/followInformation/api/addInfo', _obj).then(res => {
-						if (res.data.code == 200) {
-							this.$refs.uToast.show({
-								title: '关注成功',
-								type: 'success',
-							})
-							this.mescroll.resetUpScroll()
+					this.selectItem = val
+					if (type == 1) {
+						this.show = true
+					} else {
+						let _obj = {
+							userId: this.userInfo.id,
+							followedId: val.userId
 						}
-						uni.hideLoading()
-					})
+						uni.showLoading({
+							title: '数据加载中',
+							mask: true
+						})
+						this.$api.doRequest('post', '/followInformation/api/addInfo', _obj).then(res => {
+							if (res.data.code == 200) {
+								this.$refs.uToast.show({
+									title: '关注成功',
+									type: 'success',
+								})
+								this.mescroll.resetUpScroll()
+							}
+							uni.hideLoading()
+						})
+					}
 				}
 
+
 			},
 			selectAddress(val) {
 				this.selectPlace = val
@@ -308,7 +346,8 @@
 						currentPage: page.num,
 						placeDelivery: this.selectPlace,
 						tranType: this.selectType,
-						nowUserId: this.userInfo.id
+						nowUserId: this.userInfo.id,
+						searchKeyWord: this.keyword
 					}
 				}
 				this.$api.doRequest('get', '/transactionExchangeInfo/selectTransactionExchangeInfo', _obj).then(res => {
@@ -338,8 +377,6 @@
 			// 切换菜单
 			tabChange(e) {
 				this.goods = [] // 先置空列表,显示加载进度
-
-
 				if (this.tabs[e].name == '全部') {
 					this.selectType = ''
 				} else {

+ 355 - 0
pages/business/editRelease.vue

@@ -0,0 +1,355 @@
+<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>
+			</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"
+					:size-type="['compressed']" @on-success="getImgUrl" @on-remove="onRemove"
+					:before-upload="filterFileType"></upload>
+			</view>
+		</view>
+		<view class="content2">
+			<u-cell-group class='wrap'>
+				<u-cell-item title="交易类型" :arrow="false" :title-style="titleStyle">
+					<u-radio-group v-model="dataObj.tranType">
+						<u-radio @change="radioChange" v-for="(item, index) in list" :key="index" :name="item.name"
+							:disabled="item.disabled" active-color="#303030">
+							{{item.name}}
+						</u-radio>
+					</u-radio-group>
+				</u-cell-item>
+				<u-cell-item title="交易地" :title-style="titleStyle">
+					<selectAddress @selectAddress='selectAddress' series='3' :textStyle='textStyle' :edit='true'
+						:text='dataObj.placeDelivery'></selectAddress>
+				</u-cell-item>
+				<u-cell-item title="发布者昵称" :title-style="titleStyle" :border-bottom='false' @click="editNicknamee">
+					<view :style='textStyle'>
+						{{dataObj.publisher}}
+					</view>
+					<!-- <selectAddress @selectAddress='selectAddress' series='3' :textStyle='textStyle'></selectAddress> -->
+				</u-cell-item>
+			</u-cell-group>
+		</view>
+		<view class="submit" @click="submit">
+			发布
+		</view>
+		<u-popup v-model="showNickname" mode='center' border-radius="14" width='70%' @close='closePopup'>
+			<view class="edit-nickname">
+				<view>昵称长度限制在2-24个字符内</view>
+				<u-input v-model="dataObj.publisher" border class='nickname-input' />
+				<view style="text-align: center;">
+					<u-button type="success" size="medium" class="nickname-btn" @click="nickNamesubmit">保存</u-button>
+				</view>
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+	import upload from '@/components/upload_small.vue';
+	import selectAddress from "@/components/selectAddress.vue"
+	import {
+		mapState
+	} from 'vuex';
+	export default {
+		components: {
+			upload,
+			selectAddress
+		},
+		data() {
+			return {
+				id: '',
+				imgList: [],
+				showNickname: false,
+				dataObj: {
+					userId: '',
+					tranType: '采购',
+					placeDelivery: '',
+					urlImg: '',
+					publishingContent: '',
+					publisher: '',
+				},
+				titleStyle: {
+					"font-size": "28rpx",
+					"color": "#333333",
+					// "font-weight": 700
+				},
+				textStyle: {
+					"font-size": "32rpx",
+					"font-weight": 700,
+					"color": "#333333",
+					"margin-right": '27rpx'
+				},
+				list: [{
+						name: '采购',
+						disabled: false
+					},
+					{
+						name: '销售',
+						disabled: false
+					}
+				],
+				businesslicense: [],
+				value: '',
+				action: this.$uploadUrl,
+				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
+				isAdd: false,
+			};
+		},
+		onLoad(options) {
+			this.id = options.id
+			console.log(this.id)
+			this.init()
+			// this.dataObj.userId = this.userInfo.id
+			// this.dataObj.publisher = this.userInfo.wechatNo
+		},
+		onNavigationBarButtonTap(e) {
+			console.log(e)
+			uni.navigateTo({
+				url: 'record'
+			})
+		},
+		computed: {
+			...mapState(['hasLogin', 'userInfo', 'clientId']),
+		},
+
+		methods: {
+			init() {
+				let _obj = {
+					id: this.id
+				}
+				uni.showLoading({
+					title: '数据加载中',
+					mask: true
+				})
+				this.$api.doRequest('get', '/transactionExchangeInfo/selectExchangeInfo', _obj).then(res => {
+					console.log(res.data)
+					if (res.data.code == 200) {
+						this.dataObj = res.data.data
+
+						this.imgList = res.data.data.urlImg.split(',')
+						for (let i = 0; i < this.imgList.length; i++) {
+							this.businesslicense.push({
+								url: this.imgList[i]
+							})
+						}
+						console.log("this.businesslicense", this.businesslicense)
+					}
+					uni.hideLoading()
+				})
+			},
+			closePopup() {
+				this.dataObj.publisher = this.userInfo.wechatNo
+			},
+			nickNamesubmit() {
+				if (this.dataObj.publisher == null || this.dataObj.publisher == "") {
+					this.$api.msg('请输入昵称!')
+					return
+				}
+				if (this.dataObj.publisher.length < 2 || this.dataObj.publisher.length > 24) {
+					this.$api.msg('请正确输入昵称!')
+					return
+				}
+				let _obj = {
+					wechatNo: this.dataObj.publisher,
+					id: this.userInfo.id
+				}
+				uni.showLoading({
+					title: '数据加载中',
+					mask: true
+				})
+				let that = this
+				that.$api.doRequest('post', '/commonUser/editUserInfo', _obj).then(
+						res => {
+							if (res.data.code == 200) {
+								uni.showToast({
+									title: '修改成功!',
+									icon: 'success',
+									duration: 2000,
+									success() {
+										setTimeout(() => {
+											var _student = uni.getStorageSync('userInfo');
+											_student.wechatNo = that.dataObj.publisher;
+											uni.setStorageSync('userInfo', _student);
+											var name = 'userInfo';
+											var value = _student;
+											that.$store.commit('$uStore', {
+												name,
+												value
+											});
+											uni.hideLoading()
+											that.showNickname = false
+										}, 2000)
+									}
+								})
+							}
+						})
+					.catch(res => {
+						if (res.errmsg) {
+							uni.showToast({
+								title: res.errmsg,
+								icon: 'none',
+								duration: 2000
+							})
+						} else {
+							uni.showToast({
+								title: "系统异常,请联系管理员",
+								icon: 'none',
+								duration: 2000
+							})
+						}
+					});
+			},
+			editNicknamee() {
+				this.showNickname = true
+			},
+			submit() {
+				uni.showLoading({
+					title: '数据加载中',
+					mask: true
+
+				})
+
+				this.dataObj.urlImg = this.imgList.toString()
+				this.$api.doRequest('post', '/transactionExchangeInfo/editInfo', this.dataObj).then(res => {
+					console.log(res)
+					if (res.data.code == 200) {
+						uni.navigateBack({
+							delta: 1
+						})
+					} else {
+						uni.showToast({
+							title: "系统异常,请联系管理员",
+							icon: 'none',
+							duration: 2000
+						})
+					}
+				})
+			},
+			selectAddress(val) {
+				console.log(val)
+				this.dataObj.placeDelivery = val
+			},
+			radioChange(e) {
+				// console.log(e);
+			},
+			filterFileType(index, lists) {
+				if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
+					lists.splice(index, 1);
+					// 当前文件不支持
+					uni.showModal({
+						title: '暂不支持当前图片类型',
+						showCancel: false
+					});
+				} else {
+					this.isAdd = false;
+				}
+			},
+			onRemove(index) {
+				console.log("index", index)
+				this.imgList.splice(index, 1)
+				console.log(this.imgList)
+			},
+			getImgUrl(res) {
+				console.log("this.businesslicense", this.businesslicense)
+				console.log(res)
+				console.log('------------res-----------')
+				this.imgList.push(res)
+				console.log(this.imgList)
+
+			},
+			onUploaded(lists) {
+				this.filesArr = lists;
+				let res = lists[0];
+				if (res.response === undefined) {
+					uni.showToast({
+						title: '文件错误',
+						icon: 'none'
+					})
+				}
+			},
+		},
+	}
+</script>
+
+<style lang="scss" scoped>
+	.content {
+		// overflow: hidden;
+	}
+
+	.content1 {
+		background: #fff;
+		margin: 20rpx;
+		border-radius: 20rpx;
+		padding-bottom: 40rpx;
+
+	}
+
+	/deep/.placeholder-class {
+		color: #C5CAD4;
+		font-size: 28rpx;
+	}
+
+	.textarea {
+		padding: 20rpx 20rpx 50rpx 20rpx;
+		width: 100%;
+		font-size: 28rpx;
+	}
+
+	.top {
+		position: relative;
+
+		.number {
+			position: absolute;
+			right: 32rpx;
+			bottom: 0;
+			color: #C5CAD4;
+			font-size: 26rpx;
+		}
+	}
+
+	.content2 {
+		padding: 20rpx;
+	}
+
+	/deep/.u-cell-item-box,
+	/deep/.u-cell-box {
+		border-radius: 20rpx;
+	}
+
+	.submit {
+		width: 654rpx;
+		height: 92rpx;
+		background: #22C572;
+		border-radius: 46rpx;
+		font-size: 34rpx;
+		font-weight: 400;
+		color: #FFFFFF;
+		line-height: 92rpx;
+		text-align: center;
+		position: fixed;
+		bottom: 76rpx;
+		left: 0;
+		right: 0;
+		margin: auto;
+	}
+
+	.edit-nickname {
+		padding: 40rpx 80rpx;
+	}
+
+	.nickname-input {
+		margin: 20rpx 0;
+	}
+
+	.nickname-btn {
+		margin-top: 20rpx;
+	}
+</style>

+ 67 - 52
pages/business/myAttention.vue

@@ -10,14 +10,15 @@
 			<view class="list" v-if="goods.length!=0">
 				<view class="list-item" v-for="(item,index) in goods">
 					<view class="left">
-						<image src="../../static/img/face/27.png" mode="aspectFill" class="head-img"></image>
+						<image :src="item.commonUser.avatarUrl?item.commonUser.avatarUrl:'../../static/img/face/27.png'"
+							mode="aspectFill" class="head-img"></image>
 						<view class="name">
-							李师傅1334248520
+							{{item.commonUser.wechatNo}}
 						</view>
 					</view>
-					<view class="right">
+					<!-- <view class="right">
 						<u-icon name="plus" color="#333333" size="17" bold></u-icon><text class="case">关注</text>
-					</view>
+					</view> -->
 					<view class="right" @click="follow(item)">
 						<text class="case" style="color:#878C9C;">已关注</text>
 					</view>
@@ -25,8 +26,9 @@
 			</view>
 		</mescroll-body>
 		<u-modal v-model="show" :content="content" :show-title='false' :show-cancel-button='true'
-			:content-style="contentStyle"></u-modal>
-
+			:content-style="contentStyle" showCancelButton='true' @confirm="cancelFollow" @cancel="show=false">
+		</u-modal>
+		<u-toast ref="uToast" />
 	</view>
 </template>
 
@@ -60,8 +62,9 @@
 					// },
 					noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
 					empty: {
-						tip: '~ 搜索无数据 ~', // 提示
-						btnText: '去看看'
+						icon: '/static/empty.png',
+						tip: '暂无内容', // 提示
+						// btnText: '去看看'
 					}
 				},
 				goods: [], //列表数据
@@ -75,43 +78,29 @@
 			var userInfo = uni.getStorageSync("userInfo")
 			var that = this
 			console.log("userInfo", userInfo)
-			// setTimeout(function() {
-			// 	that.$api.doRequest('get', '/appVersion/test', {
-			// 		userId: "7e83070d05fc4d50aaa46e00a3ee03d8"
-			// 	}).then(res => {
-
-			// 	})
-			// }, 500);
-			uni.removeTabBarBadge({
-				index: 4
-			})
-			this.$api.doRequest('get', '/newNoticeTask/query/noticeTasks').then(res => {
-				if (res.data.data) {
-					let name = 'myTip';
-					let value = res.data.data.total;
-					that.$store.commit('$uStore', {
-						name,
-						value
-					});
-					if (value != 0 && value) {
-						uni.setTabBarBadge({
-							index: 4,
-							text: value + ""
-						})
-					}
-					name = 'taskTip';
-					value = res.data.data.total;
-					that.$store.commit('$uStore', {
-						name,
-						value
-					});
-				}
-			})
+
 		},
 		onLoad(options) {},
 
 
 		methods: {
+			cancelFollow() {
+				let _obj = {
+					id: this.selectItem.id
+				}
+				console.log()
+				this.$api.doRequest('post', '/followInformation/api/deleteInfo', _obj).then(res => {
+					console.log(res.data)
+					if (res.data.code == 200) {
+						this.$refs.uToast.show({
+							title: '取关成功',
+							type: 'success',
+						})
+						this.mescroll.resetUpScroll()
+					}
+					uni.hideLoading()
+				})
+			},
 			follow(val) {
 				this.selectItem = val
 				this.show = true
@@ -128,16 +117,43 @@
 			},
 			/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
 			upCallback(page) {
-				apiGoods(page.num, page.size).then(res => {
-					//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
-					this.mescroll.endSuccess(res.list.length);
-					//设置列表数据
-					if (page.num == 1) this.goods = []; //如果是第一页需手动制空列表
-					this.goods = this.goods.concat(res.list); //追加新数据
-					this.co
-				}).catch(() => {
-					//联网失败, 结束加载
-					this.mescroll.endErr();
+				uni.showLoading({
+					title: '数据加载中',
+					mask: true
+				})
+				console.log("this.selectPlace", this.selectPlace)
+				console.log("this.selectType", this.selectType)
+				let _obj = {
+
+				}
+				if (this.selectType == '关注') {
+					_obj = {
+						pageSize: page.size,
+						currentPage: page.num,
+						placeDelivery: this.selectPlace,
+						tranType: this.selectType,
+						userIdFollow: this.userInfo.id,
+						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) {
+						let curPageData = res.data.data.records;
+						let curPageLen = curPageData.length;
+						let totalPage = res.data.data.total;
+						if (page.num == 1) this.goods = [];
+						this.goods = this.goods.concat(curPageData);
+						console.log(curPageLen, totalPage)
+						this.mescroll.endByPage(curPageLen, totalPage);
+					}
+					uni.hideLoading()
 				})
 			},
 			//点击空布局按钮的回调
@@ -161,7 +177,6 @@
 	.head-img {
 		width: 76rpx;
 		height: 76rpx;
-		background: red;
 		border-radius: 50%;
 	}
 
@@ -207,7 +222,7 @@
 			display: flex;
 			justify-content: space-between;
 			align-items: center;
-			padding: 34rpx 0;
+			padding: 34rpx 31rpx;
 			border-bottom: 1px solid #E6E6E6;
 		}
 	}

+ 100 - 63
pages/business/record.vue

@@ -8,25 +8,25 @@
 					<view class="row1 flex jcsb alc">
 						<view class="left flex alc">
 							<view class="bottom" style="margin-top: 6rpx;">
-								<text class="color1">采购</text>
-								<text class="color2">销售</text>
-								<text class="color3">2022.09.01 08:28</text>
+								<text class="color1" v-if="item.tranType=='采购'">采购</text>
+								<text class="color2" v-if="item.tranType=='销售'">销售</text>
+								<text class="color3">{{item.updateDate}}</text>
 							</view>
 						</view>
-						<view class="right" style="color: #FE6430;">审核中</view>
-						<view class="right" style="color: #FB2323;">已驳回</view>
-						<view class="right" style="color: #22C572;">已通过</view>
+						<view class="right" style="color: #FE6430;" v-if="item.status=='待审核'">审核中</view>
+						<view class="right" style="color: #FB2323;" v-if="item.status=='已驳回'">已驳回</view>
+						<view class="right" style="color: #22C572;" v-if="item.status=='审核通过'">已通过</view>
 					</view>
 					<view class="row2">
-						<mote-lines-divide :dt="content" :line="3" expandText="展开" foldHint="收起" />
+						<mote-lines-divide :dt="item.publishingContent" :line="3" expandText="展开" foldHint="收起" />
 					</view>
 					<view class="row3">
-						<image src="../../static/img/splash3.png" mode="aspectFill" v-for="(item,index) in 9"
-							class="img"></image>
+						<image :src="item1" mode="aspectFill" v-for="(item1,index) in item.imgList" class="img">
+						</image>
 					</view>
 					<view class="row4">
 						<u-icon name="map-fill" color="#AFB3BF" size="28" bold></u-icon>
-						<text class="text">辽宁省营口市鲅鱼圈区xx路108号</text>
+						<text class="text">{{item.placeDelivery}}</text>
 					</view>
 					<view class="row5">
 						<view class="del btn" @click="del(item)">
@@ -35,6 +35,9 @@
 						<view class="edit btn" @click="edit(item)">
 							编辑
 						</view>
+						<view class="edit btn" @click="refresh(item)">
+							刷新
+						</view>
 					</view>
 				</view>
 			</view>
@@ -42,7 +45,7 @@
 		<view class="add" @click="release">
 			<u-icon name="plus" color="#fff" size="34" bold></u-icon>
 		</view>
-
+		<u-toast ref="uToast" />
 	</view>
 </template>
 
@@ -61,7 +64,7 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data() {
 			return {
-
+				canReset: false,
 				keyword: '',
 				inputStyle: {
 					// "padding-left": '30rpx'
@@ -74,8 +77,9 @@
 					// },
 					noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
 					empty: {
-						tip: '~ 搜索无数据 ~', // 提示
-						btnText: '去看看'
+						icon: '/static/empty.png',
+						tip: '暂无内容', // 提示
+						// btnText: '去看看'
 					}
 				},
 				goods: [], //列表数据
@@ -103,45 +107,63 @@
 			var userInfo = uni.getStorageSync("userInfo")
 			var that = this
 			console.log("userInfo", userInfo)
-			// setTimeout(function() {
-			// 	that.$api.doRequest('get', '/appVersion/test', {
-			// 		userId: "7e83070d05fc4d50aaa46e00a3ee03d8"
-			// 	}).then(res => {
-
-			// 	})
-			// }, 500);
-			uni.removeTabBarBadge({
-				index: 4
-			})
-			this.$api.doRequest('get', '/newNoticeTask/query/noticeTasks').then(res => {
-				if (res.data.data) {
-					let name = 'myTip';
-					let value = res.data.data.total;
-					that.$store.commit('$uStore', {
-						name,
-						value
-					});
-					if (value != 0 && value) {
-						uni.setTabBarBadge({
-							index: 4,
-							text: value + ""
-						})
-					}
-					name = 'taskTip';
-					value = res.data.data.total;
-					that.$store.commit('$uStore', {
-						name,
-						value
-					});
-				}
-			})
+			this.$nextTick(function() {
+				this.canReset && this.mescroll.resetUpScroll() // 重置列表数据为第一页  
+				this.canReset && this.mescroll.scrollTo(0, 0) // 重置列表数据为第一页时,建议把滚动条也重置到顶部,避免无法再次翻页的问题  
+				this.canReset = true // 过滤第一次的onShow事件,避免初始化界面时重复触发upCallback, 无需配置auto:false
+			});
+
 		},
 		onLoad(options) {},
 
 
 		methods: {
-			edit() {},
-			del() {},
+			refresh(val) {
+				let _obj = {
+					id: val.id,
+					flag: 0
+				}
+				uni.showLoading({
+					title: '数据加载中',
+					mask: true
+				})
+				this.$api.doRequest('post', '/transactionExchangeInfo/editInfo', _obj).then(res => {
+					console.log(res.data)
+					if (res.data.code == 200) {
+						this.$refs.uToast.show({
+							title: '刷新成功成功',
+							type: 'success',
+						})
+						this.mescroll.resetUpScroll()
+					}
+					uni.hideLoading()
+				})
+			},
+			edit(val) {
+				uni.navigateTo({
+					url: '/pages/business/editRelease?id=' + val.id
+				})
+			},
+			del(val) {
+				let _obj = {
+					id: val.id,
+				}
+				uni.showLoading({
+					title: '数据加载中',
+					mask: true
+				})
+				this.$api.doRequest('post', '/transactionExchangeInfo/deleteInfo', _obj).then(res => {
+					console.log(res.data)
+					if (res.data.code == 200) {
+						this.$refs.uToast.show({
+							title: '删除成功',
+							type: 'success',
+						})
+						this.mescroll.resetUpScroll()
+					}
+					uni.hideLoading()
+				})
+			},
 			selectAddress(val) {
 				console.log(val)
 			},
@@ -153,18 +175,26 @@
 			/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
 			upCallback(page) {
 				//联网加载数据
-				let curTab = this.tabs[this.tabIndex]
-				let keyword = curTab.name // 具体项目中,您可能取的是tab中的type,status等字段
-				apiGoods(page.num, page.size, keyword).then(res => {
-					//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
-					this.mescroll.endSuccess(res.list.length);
-					//设置列表数据
-					if (page.num == 1) this.goods = []; //如果是第一页需手动制空列表
-					this.goods = this.goods.concat(res.list); //追加新数据
-					this.co
-				}).catch(() => {
-					//联网失败, 结束加载
-					this.mescroll.endErr();
+				let _obj = {
+					pageSize: page.size,
+					currentPage: page.num,
+					userId: this.userInfo.id,
+				}
+				this.$api.doRequest('get', '/transactionExchangeInfo/selectTransactionExchangeInfo', _obj).then(res => {
+					console.log(res.data)
+					if (res.data.code == 200) {
+						let curPageData = res.data.data.records;
+						let curPageLen = curPageData.length;
+						let totalPage = res.data.data.total;
+						if (page.num == 1) this.goods = [];
+						this.goods = this.goods.concat(curPageData);
+						console.log(curPageLen, totalPage)
+						this.mescroll.endByPage(curPageLen, totalPage);
+						for (let i = 0; i < this.goods.length; i++) {
+							this.goods[i].imgList = this.goods[i].urlImg.split(',')
+						}
+					}
+					uni.hideLoading()
 				})
 			},
 			//点击空布局按钮的回调
@@ -303,7 +333,7 @@
 				margin-top: 18rpx;
 				display: flex;
 				align-items: center;
-				justify-content: space-between;
+				/* justify-content: space-between; */
 				flex-wrap: wrap;
 				/* background: #bbb; */
 
@@ -312,12 +342,19 @@
 					display: flex;
 					align-items: center;
 					justify-content: center;
-					width: 32%;
-					height: 210rpx;
+					width: 214rpx;
+					height: 214rpx;
 					margin-bottom: 20rpx;
 					background: lightblue;
 					list-style: none;
 					border-radius: 10rpx;
+					margin-right: 16rpx;
+				}
+
+				.img:nth-of-type(3),
+				.img:nth-of-type(6),
+				.img:nth-of-type(9) {
+					margin-right: 0;
 				}
 			}
 

+ 11 - 4
pages/business/release.vue

@@ -26,7 +26,9 @@
 					</u-radio-group>
 				</u-cell-item>
 				<u-cell-item title="交易地" :title-style="titleStyle">
-					<selectAddress @selectAddress='selectAddress' series='3' :textStyle='textStyle'></selectAddress>
+					<selectAddress @selectAddress='selectAddress' series='3' :textStyle='textStyle'
+						searchPlace='请选交货地区'>
+					</selectAddress>
 				</u-cell-item>
 				<u-cell-item title="发布者昵称" :title-style="titleStyle" :border-bottom='false' @click="editNicknamee">
 					<view :style='textStyle'>
@@ -81,7 +83,7 @@
 				},
 				textStyle: {
 					"font-size": "32rpx",
-					"font-weight": 700,
+					// "font-weight": 700,
 					"color": "#333333",
 					"margin-right": '27rpx'
 				},
@@ -105,6 +107,7 @@
 			console.log("user", this.userInfo)
 			this.dataObj.userId = this.userInfo.id
 			this.dataObj.publisher = this.userInfo.wechatNo
+			this.dataObj.remark = this.userInfo.phone
 		},
 		onNavigationBarButtonTap(e) {
 			console.log(e)
@@ -198,7 +201,7 @@
 						})
 					} else {
 						uni.showToast({
-							title: "系统异常,请联系管理员",
+							title: res.message,
 							icon: 'none',
 							duration: 2000
 						})
@@ -224,7 +227,11 @@
 					this.isAdd = false;
 				}
 			},
-			onRemove(index) {},
+			onRemove(index) {
+				console.log("index", index)
+				this.imgList.splice(index, 1)
+				console.log(this.imgList)
+			},
 			getImgUrl(res) {
 				console.log(res)
 				console.log('------------res-----------')

BIN
static/empty.png