Browse Source

Signed-off-by: liuboyan <632697560@qq.com>
整洁的提交注释

liuboyan 4 years ago
parent
commit
b909437555

+ 7 - 1
config/api.js

@@ -50,7 +50,7 @@ module.exports = {
 	//  获取商品详情
 	getCommonGoodDetail: WX_API_BASE + 'app/product/user/productDetail',
 	//  获取商品评价
-	getAssessList: WX_API_BASE + 'app/product/user/productDetail/evaluateList',
+	getAssessList: WX_API_BASE + 'app/product/user/productDetail/evaluateList/',
 	//  查询拍卖商品详情
 	getAuctionDetail: WX_API_BASE + 'app/product/user/auctionProductDetail/biddingHall/',
 	
@@ -89,6 +89,12 @@ module.exports = {
 	evaluateOrder: WX_API_BASE + 'app/order/user/my/orderList/addOrderEvaluateByEva',
 	//  申请售后
 	applyService: WX_API_BASE + 'app/order/user/my/orderList/getApplyAfterSale',
+	//  获取订单详情
+	getOrderDetail: WX_API_BASE + 'app/order/user/my/orderList/orderDetail',
+	//  获取留言列表
+	getMessageList: WX_API_BASE + 'app/order/user/my/orderList/orderDetail/leaMsgList/',
+	//  发布留言
+	addMessage: WX_API_BASE + 'app/order/user/my/orderList/orderDetail/leaMsgList/addLeaMsg',
 	
 	
 	//  查询共享种植委托列表

+ 26 - 0
pages.json

@@ -25,6 +25,12 @@
 			"style": {
 				"navigationBarTitleText": "个人"
 			}
+		},
+		{
+			"path": "pages/index/login",
+			"style": {
+				"navigationBarTitleText": "登录"
+			}
 		}
 	],
 	"subPackages": [{
@@ -54,6 +60,11 @@
 			"style": {
 				"navigationBarTitleText": "填写订单"
 			}
+		}, {
+			"path": "evaluateList",
+			"style": {
+				"navigationBarTitleText": "评价列表"
+			}
 		}, {
 			"path": "videoList",
 			"style": {
@@ -122,6 +133,11 @@
 			"style": {
 				"navigationBarTitleText": "订单中心"
 			}
+		}, {
+			"path": "orderDetail",
+			"style": {
+				"navigationBarTitleText": "订单详情"
+			}
 		}, {
 			"path": "logisticsDeatil",
 			"style": {
@@ -132,6 +148,16 @@
 			"style": {
 				"navigationBarTitleText": "评价订单"
 			}
+		}, {
+			"path": "messageList",
+			"style": {
+				"navigationBarTitleText": "留言列表"
+			}
+		}, {
+			"path": "messageForm",
+			"style": {
+				"navigationBarTitleText": "发布留言"
+			}
 		}, {
 			"path": "paySuccess",
 			"style": {

+ 1 - 2
pages/index/login.vue

@@ -11,14 +11,13 @@
 		data() {
 			return {}
 		},
-		onLoad() {
+		onReady() {
 			this.appLoginWx()
 		},
 		methods: {
 			//  获取个人数据
 			getUserInfo(info) {
 				NET.request(API.WxLogin, uni.getStorageSync("wxLoginData"), 'POST').then(res => {
-					console.log(res)
 					uni.setStorage({
 						key: 'token',
 						data: res.data.token

+ 1 - 1
pages/shop/index.vue

@@ -16,7 +16,7 @@
 				 :key="index" @click="checkSecondSort(item)">{{item.cateValue}}</view>
 			</scroll-view>
 			<k-scroll-view @onPullDown="handlePullDown" @onPullUp="handleLoadMore" class="goods-box">
-				<view class="goods-row" v-for="item in goodsList" @click="goToGoodDetails(item)">
+				<view class="goods-row" v-for="(item, index) in goodsList" :key="index" @click="goToGoodDetails(item)">
 					<cover-image class="goods-img" :src="item.imgPath"></cover-image>
 					<view class="goods-info">
 						<view class="goods-name">{{item.productName}}</view>

+ 165 - 0
pagesGood/evaluateList.vue

@@ -0,0 +1,165 @@
+<template>
+	<view class="container">
+		<scroll-view class="message-list-box" scroll-y="true" @scrolltolower="handleLoadMore()">
+			<view class="assess-row" v-for="(item,index) in assessList" :key="index">
+				<cover-image class="assess-head" :src="item.headimg"></cover-image>
+				<view class="assess-info">
+					<view class="assess-name">{{item.nickname}}</view>
+					<view class="assess-date">{{item.replyTime}}</view>
+					<view class="assess-sore-box">
+						<u-rate v-model="item.score" active-color="#FFAE21"></u-rate>
+					</view>
+					<view class="assess-text">{{item.replyContent}}</view>
+					<view class="assess-img-box">
+						<cover-image class="img-col" v-for="site in item.evaluateImgs" :key="site" :src="site.imgUrl"></cover-image>
+					</view>
+				</view>
+			</view>
+		</scroll-view>
+		<u-top-tips ref="uTips"></u-top-tips>
+	</view>
+</template>
+
+<script>
+	const NET = require('@/utils/request')
+	const API = require('@/config/api')
+	export default {
+		data() {
+			return {
+				goodId: '',
+				pageIndex: 1,
+				isOver: false,
+				assessList: [],
+			}
+		},
+		onLoad(options) {
+			this.goodId = options.goodId
+		},
+		onShow() {
+			this.getMessageList()
+		},
+		methods: {
+			//  懒加载
+			handleLoadMore() {
+				if (!this.isOver) {
+					this.pageIndex++
+					this.getMessageList()
+				}
+			},
+			//  获取全部留言
+			getMessageList() {
+				NET.request(API.getAssessList + this.goodId + '/' + this.pageIndex + '/10', {}, 'GET').then(res => {
+					this.isOver = res.data.list.length != 10
+					this.assessList = this.assessList.concat(res.data.list)
+				}).catch(error => {
+					this.$refs.uTips.show({
+						title: error.data.msg,
+						type: 'warning',
+					})
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	page {
+		width: 100%;
+		height: 100%;
+	}
+
+	.container {
+		width: 100%;
+		height: 100%;
+		float: left;
+		position: relative;
+
+		.message-list-box {
+			width: 100%;
+			height: 100%;
+			float: left;
+
+			.assess-row {
+				width: calc(100% - 30px);
+				margin: 0 15px;
+				float: left;
+				border-top: 1px solid #F6F6F6;
+				padding: 12px 0;
+				display: flex;
+
+				.assess-head {
+					width: 50px;
+					height: 50px;
+					object-fit: cover;
+					border-radius: 50%;
+				}
+
+				.assess-info {
+					width: calc(100% - 62px);
+					margin-left: 12px;
+
+					.assess-name {
+						height: 18px;
+						float: left;
+						line-height: 18px;
+						font-size: 15px;
+						font-family: PingFang SC;
+						font-weight: bold;
+						color: #343434;
+					}
+
+					.assess-date {
+						height: 18px;
+						float: right;
+						line-height: 18px;
+						font-size: 12px;
+						font-family: PingFang SC;
+						font-weight: bold;
+						color: #666666;
+					}
+
+					.assess-sore-box {
+						width: 100%;
+						height: 16px;
+						float: left;
+						margin: 6px 0;
+					}
+
+					.assess-text {
+						width: 100%;
+						float: left;
+						font-size: 12px;
+						font-family: PingFang SC;
+						font-weight: bold;
+						color: #666666;
+						line-height: 16px;
+						margin: 8px 0 10px 0;
+						overflow: hidden;
+						text-overflow: ellipsis;
+						display: -webkit-box;
+						-webkit-line-clamp: 2;
+						-webkit-box-orient: vertical;
+						word-wrap: break-word;
+					}
+
+					.assess-img-box {
+						width: 100%;
+						float: left;
+						display: flex;
+
+						.img-col {
+							height: 60px;
+							width: 60px;
+							object-fit: cover;
+							margin: 0 10px 10px 0;
+						}
+					}
+				}
+			}
+
+			.assess-row:first-child {
+				border-top: none;
+			}
+		}
+	}
+</style>

+ 30 - 15
pagesGood/goodDetails.vue

@@ -44,7 +44,7 @@
 					<view class="assess-name">{{item.nickname}}</view>
 					<view class="assess-date">{{item.replyTime}}</view>
 					<view class="assess-sore-box">
-						<view class="sore-col" v-for="site in item.score" :key="site"></view>
+						<u-rate v-model="item.score" active-color="#FFAE21"></u-rate>
 					</view>
 					<view class="assess-text">{{item.replyContent}}</view>
 					<view class="assess-img-box">
@@ -52,7 +52,7 @@
 					</view>
 				</view>
 			</view>
-			<view class="assess-more" @click="">显示全部</view>
+			<view class="assess-more" @click="goToEvaluate()">显示全部</view>
 		</view>
 		<view class="good-recommend">
 			<view class="recommend-title">为您推荐</view>
@@ -77,8 +77,6 @@
 					</view>
 					<view class="popup-good-close"></view>
 				</view>
-				<!-- <view class="popup-good-info">单位</view>
-				<view class="popup-good-unit">{{goodData.unit}}</view> -->
 				<view class="popup-good-info">数量</view>
 				<view class="popup-good-number-box">
 					<uni-icons type="minus-filled" size="20" color="#A67A54" @click="number>1?number--:''"></uni-icons>
@@ -176,7 +174,7 @@
 						type: 'warning',
 					})
 				})
-				NET.request(API.getAssessList + '/' + this.goodId + '/1/3', {}, 'GET').then(res => {
+				NET.request(API.getAssessList + this.goodId + '/1/3', {}, 'GET').then(res => {
 					this.assessList = res.data.list
 				}).catch(res => {
 					this.$refs.uTips.show({
@@ -204,6 +202,12 @@
 					url: '/pagesGood/shopDetails?goodId=' + this.goodId
 				});
 			},
+			//  跳转评价页
+			goToEvaluate() {
+				uni.navigateTo({
+					url: '/pagesGood/evaluateList?goodId=' + this.goodId
+				});
+			},
 			//  获取为你推荐
 			getGoodsList() {
 				NET.request(API.getPreferGoods, {}, 'GET').then(res => {
@@ -481,13 +485,15 @@
 			padding: 12px 16px 18px 16px;
 
 			.assess-row {
-				border-bottom: 1px solid #F6F6F6;
-				padding-bottom: 18px;
+				border-top: 1px solid #F6F6F6;
+				padding: 12px 0;
 				display: flex;
 
 				.assess-head {
 					width: 50px;
 					height: 50px;
+					object-fit: cover;
+					border-radius: 50%;
 				}
 
 				.assess-info {
@@ -515,38 +521,47 @@
 					}
 
 					.assess-sore-box {
+						width: 100%;
 						height: 16px;
-						margin-top: 6px;
-
-						.sore-col {
-							margin-right: 4px;
-						}
+						float: left;
+						margin: 6px 0;
 					}
 
 					.assess-text {
+						width: 100%;
+						float: left;
 						font-size: 12px;
 						font-family: PingFang SC;
 						font-weight: bold;
 						color: #666666;
 						line-height: 16px;
 						margin: 8px 0 10px 0;
+						overflow: hidden;
+						text-overflow: ellipsis;
+						display: -webkit-box;
+						-webkit-line-clamp: 2;
+						-webkit-box-orient: vertical;
+						word-wrap: break-word;
 					}
 
 					.assess-img-box {
+						width: 100%;
+						float: left;
 						display: flex;
 
 						.img-col {
 							height: 60px;
 							width: 60px;
 							object-fit: cover;
-							margin-right: 10px;
+							margin: 0 10px 10px 0;
 						}
 					}
 				}
 			}
 
-			.assess-row:last-child {
-				border-bottom: none;
+			.assess-row:first-child {
+				border-top: none;
+				padding-top: 0;
 			}
 
 			.assess-more {

+ 1 - 1
pagesGood/goodList.vue

@@ -5,7 +5,7 @@
 			 bgColor="#ffffff" @confirm="search" class="search-bar" />
 		</view>
 		<k-scroll-view @onPullDown="handlePullDown" @onPullUp="handleLoadMore" class="goods-box">
-			<view class="goods-row" v-for="item in goodsList" @click="goToGoodDetails(item)">
+			<view class="goods-row" v-for="(item, index) in goodsList" :key="index" @click="goToGoodDetails(item)">
 				<cover-image class="goods-img" :src="item.imgPath"></cover-image>
 				<view class="goods-info">
 					<view class="goods-name">{{item.productName}}</view>

+ 1 - 1
pagesGood/liveDetail.vue

@@ -7,7 +7,7 @@
 			<view class="popup-box">
 				<view class="popup-close" @click="closeGoods()">收起</view>
 				<scroll-view scroll-y="true" class="good-box">
-					<view class="goods-row" v-for="item in goodsList" @click="goToGoodDetails(item)">
+					<view class="goods-row" v-for="(item, index) in goodsList" :key="index" @click="goToGoodDetails(item)">
 						<cover-image class="goods-img" :src="item.imgPath"></cover-image>
 						<view class="goods-info">
 							<view class="goods-name">{{item.productName}}</view>

+ 1 - 1
pagesGood/videoDetail.vue

@@ -7,7 +7,7 @@
 			<view class="popup-box">
 				<view class="popup-close" @click="closeGoods()">收起</view>
 				<scroll-view scroll-y="true" class="good-box">
-					<view class="goods-row" v-for="item in goodsList" @click="goToGoodDetails(item)">
+					<view class="goods-row" v-for="(item, index) in goodsList" :key="index" @click="goToGoodDetails(item)">
 						<cover-image class="goods-img" :src="item.imgPath"></cover-image>
 						<view class="goods-info">
 							<view class="goods-name">{{item.productName}}</view>

+ 1 - 1
pagesGood/videoList.vue

@@ -5,7 +5,7 @@
 			 @confirm="search" class="search-bar" />
 		</view>
 		<k-scroll-view @onPullDown="handlePullDown" @onPullUp="handleLoadMore" class="video-box">
-			<view class="video-col" v-for="item in videoList" @click="goToVideoDetail(item)">
+			<view class="video-col" v-for="(item, index) in videoList" :key="index" @click="goToVideoDetail(item)">
 				<cover-image class="video-img" :src="videoType == 1 ? item.imgUrl : item.coverUrl"></cover-image>
 				<view class="video-title">{{videoType == 1 ? item.liveName : item.videoName}}</view>
 				<view class="video-date" v-if="videoType == 1">直播时间:{{item.liveStartTime}}-{{item.liveEndTime}}</view>

+ 0 - 1
pagesMain/addressList.vue

@@ -119,7 +119,6 @@
 		height: 100%;
 	}
 
-
 	.container {
 		width: 100%;
 		height: 100%;

+ 1 - 1
pagesMain/entrustList.vue

@@ -3,7 +3,7 @@
 		<view class="entrust-info">
 			<view class="entrust-info-text">共{{entrustTotle}}个委托订单</view>
 		</view>
-		<view class="entrust-row" v-for="item in entrustList">
+		<view class="entrust-row" v-for="(item, index) in entrustList" :key="index">
 			<view class="entrust-title">已委托订单</view>
 			<view class="entrust-text">委托开始时间:{{item.entrustStartTime}}</view>
 			<view class="entrust-text">委托时长:{{item.entrustDurationTime}}小时</view>

+ 139 - 0
pagesMain/messageForm.vue

@@ -0,0 +1,139 @@
+<template>
+	<view class="container">
+		<view class="message-form">
+			<u-cell-group :border="false">
+				<u-field type="textarea" placeholder="请对商品进行回复" v-model="formData.leaMsgContent" label-width="0"></u-field>
+			</u-cell-group>
+			<u-upload :action="uploadUrl" :form-data="uploadData" @on-success="uploadSuccess" @on-error="uploadError" @on-remove="uploadRemove"></u-upload>
+		</view>
+		<view class="form-handle">
+			<u-button type="success" shape="circle" :ripple="true" @click="submitData" class="handle-custom">发布</u-button>
+		</view>
+		<u-top-tips ref="uTips"></u-top-tips>
+	</view>
+</template>
+
+<script>
+	const NET = require('@/utils/request')
+	const API = require('@/config/api')
+	export default {
+		data() {
+			return {
+				formData: {
+					orderId: '',
+					tenantCode: '',
+					leaMsgContent: '',
+				},
+				uploadData: {
+					folderId: 0,
+				},
+				uploadUrl: '',
+				fileList: []
+			}
+		},
+		onLoad(options) {
+			this.uploadUrl = API.uploadFile
+			this.formData.orderId = options.orderId
+			this.formData.tenantCode = options.tenantCode
+		},
+		methods: {
+			//  文件上传成功回调
+			uploadSuccess(res, index, lists, name) {
+				this.fileList.push(res.data.url)
+				this.$refs.uTips.show({
+					title: '文件上传成功',
+					type: 'success',
+				})
+				return true
+			},
+			//  文件上传失败回调
+			uploadError(res, index, lists, name) {
+				this.$refs.uTips.show({
+					title: '文件上传失败',
+					type: 'warning',
+				})
+			},
+			//  移除文件回调
+			uploadRemove(index, lists, name) {
+				this.fileList.splice(index, 1)
+			},
+			//  提交数据
+			submitData() {
+				NET.request(API.addMessage, {
+						...this.formData,
+						leaMsgType: 1,
+						mid: uni.getStorageSync("userData").userId,
+						orderLeaImgResVOs: this.fileList.map((site, index) => {
+							return {
+								fileType: 1,
+								imgUrl: site,
+								sortOrder: index + 1,
+							}
+						})
+					},
+					'POST').then(res => {
+					this.$refs.uTips.show({
+						title: '留言成功',
+						type: 'success',
+					})
+					setTimeout(() => {
+						uni.navigateBack()
+					}, 1000)
+				}).catch(error => {
+					this.modalShow = false
+					this.$refs.uTips.show({
+						title: error.data.msg,
+						type: 'warning',
+					})
+				})
+			},
+		},
+	}
+</script>
+
+<style lang="less" scoped>
+	page {
+		width: 100%;
+		height: 100%;
+	}
+
+	.container {
+		width: 100%;
+		height: 100%;
+		float: left;
+		box-sizing: border-box;
+		background-color: #FFFFFF;
+		padding-bottom: 70px;
+		overflow-y: auto;
+
+		.message-form {
+			width: 100%;
+			float: left;
+			box-sizing: border-box;
+			padding: 0 15px;
+			background-color: #ffffff;
+
+			/deep/.u-field {
+				padding-left: 0px;
+				padding-right: 0px;
+			}
+
+			/deep/.u-cell {
+				padding-left: 0px;
+				padding-right: 0px;
+			}
+		}
+
+		.form-handle {
+			width: calc(100% - 30px);
+			height: 40px;
+			position: fixed;
+			bottom: 20px;
+			left: 15px;
+
+			.handle-custom {
+				background-color: #51A539;
+			}
+		}
+	}
+</style>

+ 185 - 0
pagesMain/messageList.vue

@@ -0,0 +1,185 @@
+<template>
+	<view class="container">
+		<scroll-view class="message-list-box" scroll-y="true" @scrolltolower="handleLoadMore()">
+			<view class="message-row" v-for="(item, index1) in messageList" :key="index1">
+				<cover-image class="message-head" :src="item.imgUrl"></cover-image>
+				<view class="message-info-box">
+					<view class="message-name">{{item.leaMsgType}}xx</view>
+					<view class="message-date">{{item.leaMsgTime}}xx</view>
+					<view class="message-text">{{item.leaMsgContent}}xx</view>
+					<view class="message-img-box" v-for="(site, index2) in item.orderLeaImgResVOs" :key="index2">
+						<cover-image class="message-img" :src="site.imgUrl"></cover-image>
+					</view>
+				</view>
+			</view>
+		</scroll-view>
+		<view class="message-handle">
+			<u-button type="success" shape="circle" :ripple="true" @click="addMessage" class="handle-custom">发布留言</u-button>
+		</view>
+		<u-top-tips ref="uTips"></u-top-tips>
+	</view>
+</template>
+
+<script>
+	const NET = require('@/utils/request')
+	const API = require('@/config/api')
+	export default {
+		data() {
+			return {
+				orderId: '',
+				tenantCode: '',
+				pageIndex: 1,
+				isOver: false,
+				messageList: [{
+					orderLeaImgResVOs: []
+				}, {
+					orderLeaImgResVOs: []
+				}],
+			}
+		},
+		onLoad(options) {
+			this.orderId = options.orderId
+			this.tenantCode = options.tenantCode
+		},
+		onShow() {
+			this.getMessageList()
+		},
+		methods: {
+			//  懒加载
+			handleLoadMore() {
+				if (!this.isOver) {
+					this.pageIndex++
+					this.getMessageList()
+				}
+			},
+			//  获取全部留言
+			getMessageList() {
+				NET.request(API.getMessageList + this.pageIndex + '/10', {
+					flag: 1,
+					orderId: this.orderId
+				}, 'GET').then(res => {
+					this.isOver = res.data.list.length != 10
+					this.messageList = this.messageList.concat(res.data.list)
+				}).catch(error => {
+					this.$refs.uTips.show({
+						title: error.data.msg,
+						type: 'warning',
+					})
+				})
+			},
+			//  新增留言
+			addMessage() {
+				uni.navigateTo({
+					url: '/pagesMain/messageForm?orderId=' + this.orderId + '&tenantCode=' + this.tenantCode
+				});
+			},
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	page {
+		width: 100%;
+		height: 100%;
+	}
+
+	.container {
+		width: 100%;
+		height: 100%;
+		float: left;
+		position: relative;
+
+		.message-list-box {
+			width: 100%;
+			height: calc(100% - 70px);
+			float: left;
+
+			.message-row {
+				width: calc(100% - 30px);
+				float: left;
+				padding-bottom: 15px;
+				border-bottom: 1px solid #F6F6F6;
+				margin: 0 15px 15px 15px;
+
+				.message-head {
+					width: 50px;
+					height: 50px;
+					object-fit: cover;
+					float: left;
+					border-radius: 50%;
+					overflow: hidden;
+				}
+
+				.message-info-box {
+					width: calc(100% - 75px);
+					float: right;
+
+					.message-name {
+						width: 50%;
+						height: 30px;
+						float: left;
+						font-size: 15px;
+						font-family: PingFang SC;
+						color: #333333;
+						line-height: 30px;
+						overflow: hidden;
+						text-overflow: ellipsis;
+						white-space: nowrap;
+					}
+
+					.message-date {
+						width: 50%;
+						height: 30px;
+						float: left;
+						font-size: 12px;
+						font-family: PingFang SC;
+						color: #666666;
+						text-align: right;
+						line-height: 30px;
+						overflow: hidden;
+						text-overflow: ellipsis;
+						white-space: nowrap;
+					}
+
+					.message-text {
+						width: 100%;
+						height: 20px;
+						float: left;
+						font-size: 12px;
+						font-family: PingFang SC;
+						color: #666666;
+						line-height: 20px;
+						overflow: hidden;
+						text-overflow: ellipsis;
+						white-space: nowrap;
+					}
+
+					.message-img-box {
+						width: 100%;
+						float: left;
+
+						.message-img {
+							width: 76px;
+							height: 76px;
+							object-fit: cover;
+							float: left;
+							margin: 0 10px 10px 0;
+						}
+					}
+				}
+			}
+		}
+
+		.message-handle {
+			width: calc(100% - 30px);
+			height: 40px;
+			position: fixed;
+			bottom: 20px;
+			left: 15px;
+
+			.handle-custom {
+				background-color: #51A539;
+			}
+		}
+	}
+</style>

+ 797 - 0
pagesMain/orderDetail.vue

@@ -0,0 +1,797 @@
+<template>
+	<view class="container">
+		<view class="order-type-info">
+			<view class="order-type-title">{{orderType.title}}</view>
+			<view class="order-type-text">{{orderType.text}}</view>
+		</view>
+		<view class="address-info-box">
+			<view class="address-icon">
+				<text class="iconfont icondizhi"></text>
+			</view>
+			<view class="address-content">
+				<text class="address-info">
+					<text class="address-name">{{orderData.recName}}</text>
+					<text class="address-phone">{{orderData.recMobile}}</text>
+				</text>
+				<view class="address-detail">{{orderData.address}}</view>
+			</view>
+		</view>
+		<view class="goods-info-box">
+			<view class="shop-info">
+				<text class="iconfont icondianpu"></text>
+				<text class="shop-name">{{orderData.merchantInfoResVO.supplierName}}</text>
+				<text class="iconfont iconfangxiang"></text>
+			</view>
+			<view class="goods-list">
+				<view class="goods-row" v-for="(item, index) in orderData.merchantInfoResVO.products" :key="index">
+					<cover-image class="goods-img" :src="item.imgUrl"></cover-image>
+					<view class="goods-info">
+						<view class="goods-name">{{item.productName}}</view>
+						<view class="goods-type">
+							类型:{{item.productType == 1 ? '普通商品' : (item.productType == 2 ? '拍卖商品' : (item.productType == 3 ? '自助采摘' : '共享种植'))}}
+						</view>
+						<view class="plant-area" v-if="item.productType == 4">面积:{{item.areaSize}}㎡</view>
+						<view class="goods-price-number">
+							<text class="goods-unit">¥</text>
+							<text class="goods-price">{{item.bizPrice}}</text>
+							<text class="goods-number">x{{item.buyNum}}</text>
+							<text class="plant-text" v-if="item.productType == 4">有效期:{{item.term}}天</text>
+						</view>
+					</view>
+				</view>
+			</view>
+			<view class="order-info">
+				<u-cell-group :border="false">
+					<u-cell-item title="商品金额" :value="'¥' + orderData.orderSum" :arrow="false" :border-bottom="false"></u-cell-item>
+					<u-cell-item title="积分抵扣" :value="'-¥' + orderData.integralAmount" :arrow="false" :border-bottom="false" v-if="goodType == 1"></u-cell-item>
+					<u-cell-item title="优惠卷" :value="'-¥' + orderData.couponDiscountAmount" :arrow="false" :border-bottom="false" v-if="goodType == 1"></u-cell-item>
+					<u-cell-item title="备注" :value="orderData.notes" :arrow="false" :border-bottom="false"></u-cell-item>
+				</u-cell-group>
+			</view>
+			<view class="pay-info">
+				<text class="pay-text">实付款</text>
+				<text class="pay-price">¥{{orderData.paySum}}</text>
+			</view>
+		</view>
+		<view class="order-info-box" @click="goToMessage()">
+			<view class="info-title-box">
+				<view class="info-title">留言板</view>
+				<text class="iconfont iconfangxiang"></text>
+			</view>
+			<view class="info-content-box">
+				<view class="message-row" v-for="(item, index1) in orderData.leas" :key="index1">
+					<cover-image class="message-head" :src="item.imgUrl"></cover-image>
+					<view class="message-info-box">
+						<view class="message-name">{{item.leaMsgType}}</view>
+						<view class="message-date">{{item.leaMsgTime}}</view>
+						<view class="message-text">{{item.leaMsgContent}}</view>
+						<view class="message-img-box" v-for="(site, index2) in item.orderLeaImgResVOs" :key="index2">
+							<cover-image class="message-img" :src="site.imgUrl"></cover-image>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="order-info-box">
+			<view class="info-title-box">
+				<view class="info-title">订单信息</view>
+			</view>
+			<view class="info-content-box">
+				<view class="order-info-row">订单编号:{{orderData.orderCode}}</view>
+				<view class="order-info-row">创建时间:{{orderData.addOrderTime}}</view>
+				<view class="order-info-row" v-if="orderData.orderStatus > 1 && orderData.orderStatus != 6">支付时间:{{orderData.payTime}}</view>
+				<view class="order-info-row" v-if="orderData.orderStatus > 2 && orderData.orderStatus != 6">发货时间:{{orderData.sendTime}}</view>
+				<view class="order-info-row" v-if="orderData.orderStatus > 3 && orderData.orderStatus != 6">收货时间:{{orderData.confirmTime}}</view>
+				<view class="order-info-row" v-if="orderData.orderStatus == 6">取消时间:{{orderData.cancelTime}}</view>
+			</view>
+		</view>
+		<uni-goods-nav :fill="true" :options="[]" @click="" @buttonClick="orderHandle" class="order-handle" :buttonGroup="buttonGroup" />
+		<u-modal v-model="modalShow" :content="modalContent" @confirm="submitHandle" :async-close="true" :show-cancel-button="true"></u-modal>
+		<u-top-tips ref="uTips"></u-top-tips>
+	</view>
+</template>
+
+<script>
+	const NET = require('@/utils/request')
+	const API = require('@/config/api')
+	export default {
+		data() {
+			return {
+				orderType: {
+					title: '',
+					text: '',
+				},
+				orderData: {
+					orderId: '',
+					orderStatus: 1,
+					addOrderTime: '',
+					recName: '',
+					recMobile: '',
+					address: '',
+					merchantInfoResVO: {
+						supplierName: '',
+						products: [],
+					},
+					orderSum: 0,
+					integralAmount: 0,
+					couponDiscountAmount: 0,
+					notes: 'xxxxx',
+					paySum: 0,
+					leas: [],
+					orderCode: '',
+					payTime: '',
+					sendTime: '',
+					confirmTime: '',
+					cancelTime: '',
+					tenantCode: '',
+					evaluateReplyStatus: 1,
+				},
+				goodType: 1,
+				buttonGroup: [],
+				modalShow: false,
+				handleType: '',
+				modalContent: '',
+			}
+		},
+		onLoad(options) {
+			this.userData = uni.getStorageSync("userData")
+			this.orderStatus = options.orderStatus
+			switch (this.orderStatus) {
+				case '1':
+					this.buttonGroup = [{
+						text: '取消订单',
+						backgroundColor: '#75BD60',
+						color: '#fff'
+					}, {
+						text: '立即支付',
+						backgroundColor: '#52A63A',
+						color: '#fff'
+					}]
+					break;
+				case '2':
+					this.buttonGroup = [{
+						text: '申请售后',
+						backgroundColor: '#75BD60',
+						color: '#fff'
+					}, {
+						text: '自助采摘',
+						backgroundColor: '#52A63A',
+						color: '#fff'
+					}]
+					break;
+				case '3':
+					this.buttonGroup = [{
+						text: '申请售后',
+						backgroundColor: '#52A63A',
+						color: '#fff'
+					}, {
+						text: '确认收货',
+						backgroundColor: '#52A63A',
+						color: '#fff'
+					}, {
+						text: '追踪物流',
+						backgroundColor: '#52A63A',
+						color: '#fff'
+					}]
+					break;
+				case '4':
+					this.buttonGroup = [{
+						text: '申请售后',
+						backgroundColor: '#75BD60',
+						color: '#fff'
+					}]
+					break;
+				default:
+					this.buttonGroup = [{
+						text: '申请售后',
+						backgroundColor: '#52A63A',
+						color: '#fff'
+					}]
+			}
+			NET.request(API.getOrderDetail, {
+				flag: 1,
+				orderId: options.orderId,
+				orderStatus: options.orderStatus,
+			}, 'GET').then(res => {
+				this.orderData = res.data
+				if (this.orderData.merchantInfoResVO.products.length && this.orderData.merchantInfoResVO.products[0].productType !=
+					2 && this.orderData.merchantInfoResVO.products[0].productType != 4) {
+					this.goodType = 1
+				} else {
+					this.goodType = 2
+				}
+				if (this.orderStatus == 4 && this.orderData.evaluateReplyStatus == 1) {
+					this.buttonGroup.push({
+						text: '评价',
+						backgroundColor: '#52A63A',
+						color: '#fff'
+					})
+				}
+			}).catch(error => {
+				this.$refs.uTips.show({
+					title: error.data.msg,
+					type: 'warning',
+				})
+			})
+			this.getOrderType()
+		},
+		onShow() {},
+		methods: {
+			//  获取订单类型
+			getOrderType() {
+				switch (this.orderData.orderStatus) {
+					case 1:
+						this.orderType = {
+							title: '等待买家付款',
+							text: '订单将于' + this.orderData.addOrderTime + '关闭',
+						}
+						break;
+					case 2:
+						this.orderType = {
+							title: '等待卖家发货',
+							text: '您的商品正在打包等待发货',
+						}
+						break;
+					case 3:
+						this.orderType = {
+							title: '等待商品送达',
+							text: '您的商品已发出正在路上,请耐心等待',
+						}
+						break;
+					case 4:
+						this.orderType = {
+							title: '商品已送达',
+							text: '',
+						}
+						break;
+					case 5:
+						this.orderType = {
+							title: '交易已完成',
+							text: '',
+						}
+						break;
+					default:
+						this.orderType = {
+							title: '交易已取消',
+							text: '',
+						}
+				}
+			},
+			//  操作
+			orderHandle(e) {
+				if (this.orderStatus == 1) {
+					if (e.index == 0) {
+						//  取消订单
+						this.modalContent = '请确定是否取消订单'
+						this.handleType = 1
+						this.modalShow = true
+					} else if (e.index == 1) {
+						//  立即支付
+						this.modalContent = '请确定是否立即支付'
+						this.handleType = 2
+						this.modalShow = true
+					}
+				} else {
+					if (e.index == 0) {
+						//  申请售后
+						NET.request(API.applyService, {
+							tenantCode: this.orderData.tenantCode
+						}, 'GET').then(res => {
+							uni.makePhoneCall({
+								phoneNumber: res.data.contactTel
+							});
+						}).catch(error => {
+							this.$refs.uTips.show({
+								title: error.data.msg,
+								type: 'warning',
+							})
+						})
+					} else {
+						if (this.orderStatus == 2) {
+							//  自助采摘
+							uni.navigateTo({
+								url: '/pagesGood/pickVideo?orderId=' + this.orderData.orderId
+							});
+						} else if (this.orderStatus == 3) {
+							if (e.index == 1) {
+								//  确认收货
+								this.modalContent = '请确定是否确认收货'
+								this.handleType = 3
+								this.modalShow = true
+							} else {
+								//  追踪物流
+								uni.navigateTo({
+									url: '/pagesMain/logisticsDeatil?orderId=' + this.orderData.orderId
+								});
+							}
+						} else {
+							//  评价
+							uni.navigateTo({
+								url: '/pagesMain/evaluateForm?orderId=' + this.orderData.orderId + '&tenantCode=' + this.orderData.tenantCode +
+									'&productIds=' + this.orderData.merchantInfoResVO.products.map(site => {
+										return site.productId
+									}).join(',')
+							});
+						}
+					}
+				}
+			},
+			//  状态流转
+			submitHandle() {
+				if (this.handleType == 1) {
+					//  取消订单
+					NET.request(API.cancelOrder, {
+						orderId: this.orderData.orderId
+					}, 'GET').then(res => {
+						this.modalShow = false
+						this.$refs.uTips.show({
+							title: '取消订单成功',
+							type: 'success',
+						})
+						setTimeout(() => {
+							uni.reLaunch({
+								url: '/pagesMain/orderList?type=' + 1
+							});
+						}, 1000)
+					}).catch(error => {
+						this.modalShow = false
+						this.$refs.uTips.show({
+							title: error.data.msg,
+							type: 'warning',
+						})
+					})
+				} else if (this.handleType == 2) {
+					//  立即支付
+					this.modalShow = false
+					setTimeout(() => {
+						uni.reLaunch({
+							url: '/pagesMain/orderList?type=' + 3
+						});
+					}, 1000)
+				} else if (this.handleType == 3) {
+					//  确认收货
+					NET.request(API.confirmOrder, {
+						orderId: this.orderData.orderId
+					}, 'GET').then(res => {
+						this.modalShow = false
+						this.$refs.uTips.show({
+							title: '确认收货成功',
+							type: 'success',
+						})
+						setTimeout(() => {
+							uni.reLaunch({
+								url: '/pagesMain/orderList?type=' + 5
+							});
+						}, 1000)
+					}).catch(error => {
+						this.modalShow = false
+						this.$refs.uTips.show({
+							title: error.data.msg,
+							type: 'warning',
+						})
+					})
+				}
+			},
+			//  跳转留言列表
+			goToMessage(){
+				uni.navigateTo({
+					url: '/pagesMain/messageList?orderId=' + this.orderData.orderId + '&tenantCode=' + this.orderData.tenantCode
+				});
+			}
+		}
+	}
+</script>
+<style lang="less" scoped>
+	page {
+		width: 100%;
+		height: 100%;
+	}
+
+	.container {
+		width: 100%;
+		height: 100%;
+		float: left;
+		background-color: #f7f7f7;
+		box-sizing: border-box;
+		padding-bottom: 50px;
+		overflow-y: auto;
+
+		.order-type-info {
+			width: 100%;
+			height: 115px;
+			float: left;
+			box-sizing: border-box;
+			padding: 22px 100px 0 15px;
+			background: #52A63A;
+			border-radius: 0px 0px 20px 20px;
+			background-size: 62px;
+			background-position: calc(100% - 48px) 12px;
+			background-repeat: no-repeat;
+			background-image: url(@/static/images/orderDetail.png);
+
+			.order-type-title {
+				width: 100%;
+				float: left;
+				height: 20px;
+				line-height: 20px;
+				font-size: 15px;
+				font-family: PingFang SC;
+				color: #FFFFFF;
+				margin-bottom: 4px;
+			}
+
+			.order-type-text {
+				width: 100%;
+				float: left;
+				height: 20px;
+				line-height: 20px;
+				font-size: 12px;
+				font-family: PingFang SC;
+				color: #FFFFFF;
+			}
+		}
+
+		.address-info-box {
+			width: calc(100% - 30px);
+			float: left;
+			box-sizing: border-box;
+			padding: 16px 18px 16px 16px;
+			margin: -34px 15px 10px 15px;
+			background: #FFFFFF;
+			border-radius: 10px;
+
+			.address-icon {
+				width: 36px;
+				height: 40px;
+				float: left;
+				align-items: center;
+				display: flex;
+
+				.iconfont {
+					color: #52A63A;
+					font-size: 36px;
+				}
+			}
+
+			.address-content {
+				width: calc(100% - 56px);
+				height: 40px;
+				float: left;
+				margin: 0 8px 0 12px;
+
+				.address-info {
+					height: 20px;
+					font-family: PingFang SC;
+					line-height: 20px;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					white-space: nowrap;
+
+					.address-name {
+						font-size: 16px;
+						color: #333333;
+						margin-right: 14px;
+					}
+
+					.address-phone {
+						font-size: 12px;
+						color: #666666;
+					}
+				}
+
+				.address-detail {
+					height: 20px;
+					font-size: 16px;
+					font-family: PingFang SC;
+					color: #333333;
+					line-height: 20px;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					white-space: nowrap;
+				}
+			}
+		}
+
+		.goods-info-box {
+			width: calc(100% - 30px);
+			float: left;
+			margin: 0 15px 10px 15px;
+			background: #FFFFFF;
+			border-radius: 10px;
+
+			.shop-info {
+				width: 100%;
+				height: 48px;
+				float: left;
+				box-sizing: border-box;
+				padding: 13px 15px 12px 15px;
+				border-bottom: 1px solid #EEEEEE;
+				line-height: 22px;
+
+				.icondianpu {
+					font-size: 22px;
+					color: #333333;
+				}
+
+				.shop-name {
+					font-size: 15px;
+					font-family: PingFang SC;
+					color: #333333;
+					margin: 0 8px 0 10px;
+				}
+
+				.iconshangjia {
+					font-size: 12px;
+					color: #999999;
+				}
+			}
+
+			.goods-list {
+				width: 100%;
+				float: left;
+				box-sizing: border-box;
+				padding: 10px 15px 0 15px;
+
+				.goods-row {
+					width: 100%;
+					height: 90px;
+					float: left;
+					display: flex;
+					margin-bottom: 10px;
+
+					.goods-img {
+						width: 90px;
+						height: 90px;
+						border-radius: 5px;
+						object-fit: cover;
+					}
+
+					.goods-info {
+						width: calc(100% - 106px);
+						height: 90px;
+						margin-left: 16px;
+
+						.goods-name {
+							width: 100%;
+							height: 36px;
+							float: left;
+							font-size: 14px;
+							font-family: PingFang SC;
+							color: #333333;
+							line-height: 18px;
+							overflow: hidden;
+							text-overflow: ellipsis;
+							display: -webkit-box;
+							-webkit-line-clamp: 2;
+							-webkit-box-orient: vertical;
+							word-wrap: break-word;
+						}
+
+						.goods-type {
+							height: 20px;
+							float: left;
+							background: #F0F0F0;
+							border-radius: 4px;
+							padding: 0 8px;
+							margin: 6px 0;
+							font-size: 10px;
+							font-family: PingFang SC;
+							color: #666666;
+							line-height: 20px;
+						}
+
+						.plant-area {
+							height: 20px;
+							float: right;
+							margin: 6px 0;
+							font-size: 12px;
+							font-family: PingFang SC;
+							color: #333333;
+						}
+
+						.goods-price-number {
+							width: 100%;
+							height: 20px;
+							float: left;
+							line-height: 20px;
+							font-family: PingFang SC;
+							color: #333333;
+
+							.goods-unit {
+								font-size: 12px;
+							}
+
+							.goods-price {
+								font-size: 15px;
+								margin-right: 6px;
+							}
+
+							.goods-number {
+								font-size: 12px;
+							}
+						}
+
+						.plant-text {
+							float: right;
+							font-size: 12px;
+							font-family: PingFang SC;
+							color: #333333;
+						}
+					}
+				}
+			}
+
+			.order-info {
+				width: 100%;
+				float: left;
+
+				/deep/.u-cell {
+					padding: 6px 16px;
+				}
+			}
+
+			.pay-info {
+				width: 100%;
+				height: 46px;
+				float: left;
+				box-sizing: border-box;
+				border-top: 1px solid #EEEEEE;
+				padding-right: 15px;
+				line-height: 44px;
+				font-family: PingFang SC;
+				font-size: 14px;
+				text-align: right;
+				white-space: nowrap;
+
+				.pay-text {
+					float: left;
+					color: #333333;
+					margin-left: 15px;
+				}
+
+				.pay-price {
+					color: #52A63A;
+				}
+			}
+		}
+
+		.order-info-box {
+			width: calc(100% - 30px);
+			float: left;
+			margin: 0 15px 10px 15px;
+			background: #FFFFFF;
+			border-radius: 10px;
+
+			.info-title-box {
+				width: 100%;
+				height: 48px;
+				float: left;
+				box-sizing: border-box;
+				padding: 15px 15px 14px 15px;
+				border-bottom: 1px solid #EEEEEE;
+				line-height: 18px;
+				white-space: nowrap;
+
+				.info-title {
+					height: 18px;
+					float: left;
+					font-size: 15px;
+					font-family: PingFang SC;
+					color: #333333;
+					margin-right: 8px;
+					padding-left: 10px;
+					border-left: 2px solid #74BD60;
+				}
+
+				.iconfangxiang {
+					float: right;
+					font-size: 12px;
+					color: #999999;
+				}
+			}
+
+			.info-content-box {
+				width: 100%;
+				float: left;
+				padding: 15px 0;
+
+				.message-row {
+					width: 100%;
+					float: left;
+					box-sizing: border-box;
+					padding: 0 15px;
+					margin-bottom: 15px;
+
+					.message-head {
+						width: 50px;
+						height: 50px;
+						object-fit: cover;
+						float: left;
+						border-radius: 50%;
+						overflow: hidden;
+					}
+
+					.message-info-box {
+						width: calc(100% - 75px);
+						float: right;
+
+						.message-name {
+							width: 50%;
+							height: 30px;
+							float: left;
+							font-size: 15px;
+							font-family: PingFang SC;
+							color: #333333;
+							line-height: 30px;
+							overflow: hidden;
+							text-overflow: ellipsis;
+							white-space: nowrap;
+						}
+
+						.message-date {
+							width: 50%;
+							height: 30px;
+							float: left;
+							font-size: 12px;
+							font-family: PingFang SC;
+							color: #666666;
+							text-align: right;
+							line-height: 30px;
+							overflow: hidden;
+							text-overflow: ellipsis;
+							white-space: nowrap;
+						}
+
+						.message-text {
+							width: 100%;
+							height: 20px;
+							float: left;
+							font-size: 12px;
+							font-family: PingFang SC;
+							color: #666666;
+							line-height: 20px;
+							overflow: hidden;
+							text-overflow: ellipsis;
+							white-space: nowrap;
+						}
+
+						.message-img-box {
+							width: 100%;
+							float: left;
+							.message-img{
+								width: 76px;
+								height: 76px;
+								object-fit: cover;
+								float: left;
+								margin: 0  10px 10px 0;
+							}
+						}
+					}
+				}
+
+				.message-row:last-child {
+					margin-bottom: 0;
+				}
+
+				.order-info-row {
+					width: 100%;
+					height: 26px;
+					float: left;
+					box-sizing: border-box;
+					padding: 0 15px;
+					font-size: 12px;
+					font-family: PingFang SC;
+					color: #333333;
+					line-height: 26px;
+				}
+			}
+		}
+
+		.order-handle {
+			width: 100%;
+			position: fixed;
+			bottom: 0px;
+			border-top: 1px solid #cccccc;
+		}
+	}
+</style>

+ 8 - 1
pagesMain/orderItem.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="order-row">
+	<view class="order-row" @click="goToOrderDetail()">
 		<view class="shop-info" v-if="orderData" @click="gotoShop()">
 			<text class="iconfont icondianpu"></text>
 			<text class="shop-name">{{orderData.supplierName}}</text>
@@ -80,6 +80,7 @@
 			return {
 				modalShow: false,
 				modalContent: '',
+				handleType: '',
 			}
 		},
 		onLoad() {},
@@ -161,6 +162,12 @@
 					});
 				}
 			},
+			//  跳转订单详情
+			goToOrderDetail() {
+				uni.navigateTo({
+					url: '/pagesMain/orderDetail?orderId=' + this.orderData.orderId + '&orderStatus=' + this.orderData.orderStatus
+				});
+			},
 			//  状态流转
 			submitHandle() {
 				if (this.handleType == 1) {

+ 11 - 17
pagesMain/orderList.vue

@@ -35,21 +35,16 @@
 			return {
 				tabIndex: 0,
 				tabList: [{
-						name: '全部'
-					},
-					{
-						name: '待付款'
-					},
-					{
-						name: '待发货'
-					},
-					{
-						name: '待收货'
-					},
-					{
-						name: '已完成'
-					},
-				],
+					name: '全部'
+				}, {
+					name: '待付款'
+				}, {
+					name: '待发货'
+				}, {
+					name: '待收货'
+				}, {
+					name: '已完成'
+				}, ],
 				pageIndex1: 1,
 				isOver1: false,
 				orderList1: [],
@@ -71,8 +66,7 @@
 			this.tabIndex = options.type - 1
 			this.getOrderList(options.type)
 		},
-		onReady(options){
-		},
+		onReady(options) {},
 		methods: {
 			//  切换tab
 			changeTabs(index) {

+ 1 - 1
pagesMain/plantList.vue

@@ -1,6 +1,6 @@
 <template>
 	<scroll-view class="container" scroll-y="true" @scrolltolower="handleLoadMore()">
-		<view class="goods-row" v-for="item in plantList" @click="goToGoodDetail(item)">
+		<view class="goods-row" v-for="(item, index) in plantList" :key="index" @click="goToGoodDetail(item)">
 			<cover-image class="goods-img" :src="item.imgPath"></cover-image>
 			<view class="goods-info">
 				<view class="goods-name">{{item.productName}}</view>

BIN
static/images/orderDetail.png


+ 1 - 0
utils/request.js

@@ -18,6 +18,7 @@ const request = (url, data, method = 'GET') => {
 						uni.navigateTo({
 							url: '/pages/index/login'
 						});
+						return false
 					}
 					if (data.code == 0 || data.code == 200) {
 						resolve(res.data)