Ver código fonte

待收货与已完成新增物流信息

DELL 3 anos atrás
pai
commit
2050d03306
4 arquivos alterados com 361 adições e 10 exclusões
  1. 2 0
      pages.json
  2. 9 9
      pages/order/detail.vue
  3. 350 0
      pages/order/logistics.vue
  4. 0 1
      pages/prizeGoods/detail.vue

+ 2 - 0
pages.json

@@ -63,6 +63,8 @@
 		"path": "pages/webview/index"
 	}, {
 		"path": "pages/goods/company"
+	}, {
+		"path": "pages/order/logistics"
 	}],
 	"tabBar": {
 		"custom": true,

+ 9 - 9
pages/order/detail.vue

@@ -66,7 +66,7 @@
 				</view>
 			</view>
 
-			<view class="detail-info" v-if="(status.value == 2 || status.value == 4) && deliverList.length > 1">
+			<!-- <view class="detail-info" v-if="(status.value == 2 || status.value == 4) && deliverList.length > 1">
 				<view class="detail-info-title">发货信息</view>
 				<view class="detail-info-content border" v-for="(item, index) in deliverList" :key="index">
 					<view class="detail-info-content-desc">
@@ -107,8 +107,8 @@
 					</view>
 				</view>
 			</view>
-			
-			<view class="detail-info" v-if="(status.value == 2 || status.value == 4) && deliverList.length == 1">
+			 -->
+			<!-- <view class="detail-info" v-if="(status.value == 2 || status.value == 4) && deliverList.length == 1">
 				<view class="detail-info-title">发货信息</view>
 				<view class="detail-info-content" v-for="(item, index) in deliverList" :key="index">
 					<view class="detail-info-content-desc">
@@ -129,16 +129,16 @@
 						<view>{{ $parseTime(item.deliveryTime) }}</view>
 					</view>
 				</view>
-			</view>
+			</view> -->
 		</view>
 		
-		<view class="footer-fixed" v-if="status.value == 2">
+		<view class="footer-fixed" v-if="status.value == 2 || status.value == 3">
 			<view class="flex btn">
 				<view class="btn-right">
 					<text class="logistics" @click="getLogistics">查看物流</text>
 				</view>
 				<view class="btn-right">
-					<text class="confirm" @click="confirmOne">确认收货</text>
+					<text class="confirm" @click="confirmOne" v-if="status.value == 2">确认收货</text>
 				</view>
 			</view>
 		</view>
@@ -276,11 +276,11 @@
 				});
 			},
 			
-			//查看物流
+			// 查看物流
 			getLogistics() {
-				console.log(this.info)
 				uni.navigateTo({
-					url:`/pages/order/logistics?id=${ 1 }`
+					url:`/pages/order/logistics?id=${ this.orderId }`
+					// url:`/pages/order/logistics?id=96666733329055749370`
 				});
 			},
 			

+ 350 - 0
pages/order/logistics.vue

@@ -0,0 +1,350 @@
+<template>
+	<view class="detail">
+		<u-navbar title="物流详情" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
+		<!-- 物流信息 -->
+		<view class="detail-info">
+			<view class="detail-info-one" v-for="(item,index) in list" :key="index" @click="jumpPosition(index)"
+				:class="{'aside-active':listIndex === index}">
+				包裹{{index+1}}</view>
+		</view>
+
+		<view class="detail-info">
+			<view class="detail-info-title">商品信息</view>
+			<view class="detail-info-content">
+				<view class="detail-info-content-goods">
+					<view class="flex detail-info-content-goods__detail">
+						<view class="detail-info-content-goods__detail__left">
+							<view class="img">
+								<image class="img" :src="list[listIndex].picUrl" mode="aspectFill">
+								</image>
+							</view>
+						</view>
+						<view class="detail-info-content-goods__detail__right">
+							<view class="ells title">{{ list[listIndex].title }}</view>
+							<view class="sku" v-if="list[listIndex].properties">规格:{{ list[listIndex].properties }}
+							</view>
+							<view class="num">数量:{{ list[listIndex].goodsNum }}</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+
+		<view class="detail-info">
+			<view class="detail-info-content-desc">
+				<view>配送方式:</view>
+				<view>{{ list[listIndex].companyName ? "快递发货" : "无需物流" }}</view>
+			</view>
+			<view class="detail-info-content-desc" v-if="list[listIndex].companyName?true:false">
+				<view>{{ list[listIndex].companyName }}:</view>
+				<view class="copy" @click="copyDeliveryFlowId(list[listIndex].deliveryFlowId)">复制</view>
+				<view>{{ list[listIndex].deliveryFlowId }}</view>
+			</view>
+		</view>
+
+		
+		<view class="detail-info" v-if="list[listIndex].companyName && logistics!==''?true:false">
+			<u-steps current="1" direction="column" dot>
+				<u-steps-item :desc="item.context" :title="item.status + '  ' + item.time"
+					v-for="(item,index) in logistics">
+					<!-- <text class="slot-icon" slot="icon" v-if="item.status == '签收'">签</text> -->
+					<!-- <text class="slot-icon" slot="icon" v-else-if="item.status == '揽收'">揽</text>
+					<text class="slot-icon" slot="icon" v-else-if="item.status == '在途'">途</text> -->
+				</u-steps-item>
+			</u-steps>
+		</view>
+		<view v-else-if="list[listIndex].companyName?true:false" class="detail-info">
+			<view style="color: #b1b1b1;">
+				暂无物流信息
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import env from '../../config/env.js'
+	import $http from '@/utils/request.js'
+	export default {
+		data() {
+			return {
+				info: '',
+				list: [{
+					picUrl: '',
+					deliveryFlowId: '',
+					deliveryId: '',
+				}],
+				orderId: '',
+				deliverList: '',
+				listIndex: 0,
+				logistics: '',
+
+			}
+		},
+		onLoad(opthios) {
+			this.orderId = opthios.id
+			this.getDetail()
+		},
+		methods: {
+			getDetail() {
+				// uni.showLoading({
+				// 	title: '加载中'
+				// });
+				$http.post('/api/v1/mp/user/deliver/order/detail', {
+					orderId: this.orderId
+				}).then(res => {
+
+					// uni.hideLoading();
+					this.info = res.data
+					res.data.items.forEach(item => {
+						let picUrlArr = item.picUrl.split(',')
+						item.picUrl = env.filePublic + picUrlArr[0] + '?imageView2/2/w/170'
+					})
+					res.data.deliverList && res.data.deliverList.forEach((item) => {
+						item.items.forEach((ele) => {
+							let picUrlArr = ele.picUrl.split(",");
+							ele.picUrl = env.filePublic + picUrlArr[0] + '?imageView2/2/w/170';
+						});
+					});
+					this.deliverList = res.data.deliverList;
+					this.list = res.data.items
+					this.logisticsQuery()
+				}).catch(() => {
+					// uni.hideLoading();
+				})
+			},
+			jumpPosition(index) {
+
+				this.listIndex = index
+				this.logisticsQuery()
+
+			},
+			copyDeliveryFlowId(id) {
+				uni.setClipboardData({
+					data: id,
+				});
+			},
+			logisticsQuery() {
+				if (this.list[this.listIndex].deliveryFlowId == "") {
+					return
+				}
+				let data = {
+					deliveryFlowId: this.list[this.listIndex].deliveryFlowId,
+					deliveryId: this.list[this.listIndex].deliveryId,
+				}
+				$http.post('/api/v1/mp/logistics/query', data).then(res => {
+					if (res.code == 0) {
+						this.logistics = res.data
+					}
+				})
+			}
+		}
+	}
+</script>
+<style lang="scss" scopen>
+	.aside-active {
+		color: #f27120;
+		border-bottom: 2rpx solid #f27120;
+	}
+</style>
+<style lang="scss" scoped>
+	.detail {
+		margin: 10rpx;
+		padding-bottom: 160rpx;
+
+		&-state {
+			padding: 28rpx;
+			margin-bottom: 20rpx;
+			background-color: #FFFFFF;
+
+			&-title {
+				line-height: 40rpx;
+				font-weight: bold;
+				display: inline-block;
+			}
+
+			&-time {
+				line-height: 40rpx;
+				color: #b1b1b1;
+				float: right;
+			}
+		}
+
+		&-info {
+			margin-bottom: 20rpx;
+			padding: 20rpx 28rpx;
+			background-color: #FFFFFF;
+
+			&-one {
+				height: 60rpx;
+				padding: 1px;
+				line-height: 60rpx;
+				text-align: center;
+				display: inline-block;
+				margin-right: 20rpx;
+			}
+
+			&-title {
+				line-height: 40rpx;
+				font-weight: bold;
+			}
+
+			&-content {
+
+				&-goods {
+
+					&__detail {
+						padding: 20rpx 0;
+						justify-content: space-between;
+						border-bottom: 1px solid rgba(236, 236, 236, 100);
+
+						&__left {
+							display: flex;
+							height: 170rpx;
+
+							.img {
+
+								image {
+									width: 170rpx;
+									height: 170rpx;
+									margin-right: 20rpx;
+								}
+							}
+						}
+
+						&__right {
+							flex: 1;
+							display: flex;
+							height: 170rpx;
+							flex-direction: column;
+							justify-content: space-between;
+							align-items: flex-start;
+							font-size: 30rpx;
+
+							.title {
+								font-weight: bold;
+							}
+
+							.sku {
+								color: #8C8C8C;
+							}
+
+						}
+
+					}
+
+					&__detail:last-child {
+						border: none;
+					}
+				}
+
+				&-money {
+					margin-top: 40rpx;
+
+					&__item {
+						display: flex;
+						align-items: center;
+						justify-content: space-between;
+						line-height: 40rpx;
+						margin-bottom: 24rpx;
+					}
+				}
+
+				&-toatl {
+					padding-top: 24rpx;
+					display: flex;
+					align-items: center;
+					justify-content: flex-end;
+					font-weight: bold;
+				}
+
+				&-desc {
+					position: relative;
+					display: flex;
+					line-height: 40rpx;
+					margin-top: 20rpx;
+					margin-bottom: 24rpx;
+
+					view:first-child {
+						width: 150rpx;
+					}
+
+					view:last-child {
+						width: calc(100% - 150rpx)
+					}
+
+					.copy {
+						position: absolute;
+						right: 0;
+						top: -6rpx;
+						width: 136rpx;
+						height: 52rpx;
+						line-height: 52rpx;
+						text-align: center;
+						color: rgba(149, 149, 149, 100);
+						border: 1px solid rgba(187, 187, 187, 100);
+						border-radius: 10rpx;
+					}
+				}
+
+				&-desc:last-child {
+					margin-bottom: 0;
+				}
+
+				&-deliver {
+					&__detail {
+						padding: 20rpx 0;
+						justify-content: space-between;
+						border-bottom: 1px solid rgba(236, 236, 236, 100);
+
+						&__left {
+							display: flex;
+							height: 170rpx;
+
+							.img {
+
+								image {
+									width: 170rpx;
+									height: 170rpx;
+									margin-right: 20rpx;
+								}
+							}
+						}
+
+						&__right {
+							flex: 1;
+							display: flex;
+							height: 170rpx;
+							flex-direction: column;
+							justify-content: space-between;
+							align-items: flex-end;
+
+							.num {
+								width: 100%;
+								justify-content: space-between;
+
+								.sku {
+									color: #8C8C8C;
+								}
+							}
+						}
+
+					}
+
+					&__detail:last-child {
+						border: none;
+					}
+				}
+			}
+
+			.border {
+				border-bottom: 1px solid rgba(236, 236, 236, 100);
+			}
+
+			.border:last-child {
+				border: none;
+			}
+		}
+
+
+	}
+</style>

+ 0 - 1
pages/prizeGoods/detail.vue

@@ -173,7 +173,6 @@
 				height: 88rpx;
 				width: 100%;
 				background-color: #ffffff;
-				margin-top: 10rpx;
 
 				&-one {
 					float: left;