소스 검색

订单详情页新增”确认收获“

DELL 3 년 전
부모
커밋
e3d582dbd2
1개의 변경된 파일98개의 추가작업 그리고 2개의 파일을 삭제
  1. 98 2
      pages/order/detail.vue

+ 98 - 2
pages/order/detail.vue

@@ -7,6 +7,9 @@
 					<text>订单状态:</text>
 					<text>{{ status.desc }}</text>
 				</view>
+				<view class="detail-state-time" v-if="status.value == 2">
+					还剩 {{ autoConfirmTime || "--" }} 自动确认
+				</view>
 			</view>
 			<view class="detail-info">
 				<view class="detail-info-title">商品信息</view>
@@ -126,6 +129,17 @@
 						<view>{{ $parseTime(item.deliveryTime) }}</view>
 					</view>
 				</view>
+				
+				<view class="footer-fixed">
+					<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>
+						</view>
+					</view>
+				</view>
 			</view>
 
 		</view>
@@ -147,7 +161,8 @@
 				info: {},
 				addr: {},
 				list: [],
-				deliverList: []
+				deliverList: [],
+				autoConfirmTime: '',
 			};
 		},
 		onLoad(opthios) {
@@ -183,13 +198,14 @@
 			},
 
 			cancelOrder() {
+				let orderId = this.orderId
 				uni.showModal({
 					title: '提示',
 					content: '您确认要取消订单吗?',
 					success(res) {
 						if (res.confirm) {
 							$http.post('/api/v1/mp/user/deliver/order/cancel', {
-								orderId: this.orderId
+								orderId
 							}).then(res => {
 								if (res.code == 0) {
 									uni.$u.toast('订单取消成功');
@@ -263,10 +279,83 @@
 					data: id,
 				});
 			},
+			
+			// 确认收货
+			confirmOne() {
+				let orderId =  this.orderId
+				uni.showModal({
+					title: '提示',
+					content: '确定已经收到货了吗?',
+					success(res) {
+						if (res.confirm) {
+							$http.post('/api/v1/mp/user/deliver/order/confirm', {
+								orderId
+							}).then(res => {
+								if (res.code == 0) {
+									uni.$u.toast('确认收货成功');
+								}
+							})
+						}
+					}
+				})
+			}
 		}
 	}
 </script>
 
+<style lang="scss" scoped>
+	.footer-fixed {
+		position: fixed;
+		bottom: var(--window-bottom);
+		left: 0;
+		right: 0;
+		z-index: 11;
+		box-shadow: 0 -4rpx 40rpx 0 rgba(151, 151, 151, 0.24);
+		background: #fff;
+
+		// 设置ios刘海屏底部横线安全区域
+		padding-bottom: constant(safe-area-inset-bottom);
+		padding-bottom: env(safe-area-inset-bottom);
+
+		.btn {
+			justify-content: flex-end;
+			padding: 20rpx 40rpx;
+
+			&-right {
+				display: flex;
+				align-items: center;
+				justify-content: right;
+
+				.value {
+					color: $uni-text-color;
+				}
+
+				.logistics {
+					width: 160rpx;
+					height: 60rpx;
+					line-height: 60rpx;
+					border-radius: 8rpx;
+					text-align: center;
+					margin-left: 20rpx;
+					border: 1px solid #bbbbbb;
+					color: #414141;
+				}
+
+				.confirm {
+					width: 160rpx;
+					height: 60rpx;
+					line-height: 60rpx;
+					border-radius: 8rpx;
+					text-align: center;
+					margin-left: 20rpx;
+					border: 1px solid rgba(236, 112, 9, 100);
+					color: rgba(236, 112, 9, 100);
+				}
+			}
+		}
+	}
+</style>
+
 <style lang="scss" scoped>
 	.detail {
 		margin: 10rpx;
@@ -280,6 +369,13 @@
 			&-title {
 				line-height: 40rpx;
 				font-weight: bold;
+				display: inline-block;
+			}
+			
+			&-time {
+				line-height: 40rpx;
+				color: #b1b1b1;
+				float: right;
 			}
 		}