浏览代码

接入订单详情接口

pangqijun 1 年之前
父节点
当前提交
b65b7c0d23
共有 3 个文件被更改,包括 56 次插入73 次删除
  1. 5 0
      api/home.js
  2. 49 71
      pages/groupbuying_details/order_details_list/index.vue
  3. 2 2
      pages/order/index.vue

+ 5 - 0
api/home.js

@@ -95,6 +95,11 @@ export function getUserOrderPage(data) {
 	return request.get("v1/order/user",data);
 }
 
+// 查询用户订单接口
+export function getUserOrderDetail(data) {
+	return request.get("v1/order/user/detail",data);
+}
+
 // 根据用户订单NO查询物流信息
 export function getOrderLogistic(data) {
 	return request.get("v1/order/logistic",data);

+ 49 - 71
pages/groupbuying_details/order_details_list/index.vue

@@ -3,75 +3,42 @@
 		<view class="wait_panel">
 			<view class="w1">
 				<image src="http://www.gzzzyd.com/groupon/home_slices/倒计时@2x.png" mode="scaleToFill" />
-				<text class="yellow">等待付款</text>
+				<text v-if="orderDetail.orderState == 1" class="yellow">等待付款</text>
+				<text v-if="orderDetail.orderState == 2" class="yellow">等待提货</text>
 			</view>
-			<view class="w2">
-				需付款: <text class="red">¥96.00</text>
+			<view class="w2" v-if="orderDetail.orderState == 1">
+				需付款: <text class="red">¥{{orderDetail.paymentAmount}}</text>
 				剩余:26分钟30秒
 			</view>
+			<view class="w2" v-if="orderDetail.orderState == 2">
+				取货码
+			</view>
 			<view class="w3">
-				<button>
+				<button v-if="orderDetail.orderState == 1">
 					去支付
 				</button>
+				<button v-if="orderDetail.orderState == 2">
+					{{orderDetail.pickupCode}}
+				</button>
 			</view>
 		</view>
-		<view class="all-products-body">
-			<view class="all-products-item" @click="addGoodPopupShow = true">
-				<image
-					src="https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/38e693de009644aa9de2dc6d6f7e747a_mergeImage.png"
-					mode="scaleToFill" />
-
-				<view class="all-products-item-content">
-					<view class="all-products-item-content-t">
-						宫中秘策(GOONGBE)进口儿童韩国进口儿童防晒霜80g
-					</view>
-					<view class="all-products-item-content-b">
-						<view style="display:flex;">
-							<text class="red"> ¥48.00</text>
-						</view>
-
-						<view>
-							<view class="count"> x 1</view>
-						</view>
-					</view>
-				</view>
-			</view>
-			<view class="all-products-item" @click="addGoodPopupShow = true">
-				<image
-					src="https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/38e693de009644aa9de2dc6d6f7e747a_mergeImage.png"
-					mode="scaleToFill" />
-
-				<view class="all-products-item-content">
-					<view class="all-products-item-content-t">
-						宫中秘策(GOONGBE)进口儿童韩国进口儿童防晒霜80g
-					</view>
-					<view class="all-products-item-content-b">
-						<view style="display:flex;">
-							<text class="red"> ¥48.00</text>
-						</view>
-
-						<view>
-							<view class="count"> x 1</view>
-						</view>
-					</view>
-				</view>
-			</view>
+		<view class="all-products-body" v-for="(item, index) in orderDetail.goodsList" :key="index">
 			<view class="all-products-item" @click="addGoodPopupShow = true">
 				<image
-					src="https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/38e693de009644aa9de2dc6d6f7e747a_mergeImage.png"
+					:src="item.goodsImage"
 					mode="scaleToFill" />
 
 				<view class="all-products-item-content">
 					<view class="all-products-item-content-t">
-						宫中秘策(GOONGBE)进口儿童韩国进口儿童防晒霜80g
+						{{item.goodsName}}
 					</view>
 					<view class="all-products-item-content-b">
 						<view style="display:flex;">
-							<text class="red"> ¥48.00</text>
+							<text class="red"> ¥{{item.goodsPrice}}</text>
 						</view>
 
 						<view>
-							<view class="count"> x 1</view>
+							<view class="count"> x {{item.goodsNum}}</view>
 						</view>
 					</view>
 				</view>
@@ -95,7 +62,7 @@
 							<view class="t1">
 								自提门店
 							</view>
-							<view class="t2">
+							<view class="t2" v-if="orderDetail.orderState == 1">
 								更换自提网点
 								<image src="http://www.gzzzyd.com/groupon/order_details/切换_面24@2x.png" mode="scaleToFill" />
 							</view>
@@ -103,25 +70,25 @@
 						<view class="a-m">
 							<view class="am1">
 								<view class="am1-1">
-									夜未央佳佳便利店
+									{{orderDetail.selfTake.name}}
 								</view>
 								<view class="am1-2">
-									距您1.8km
+									距您{{orderDetail.selfTake.distanceDesc}}
 									<image src="http://www.gzzzyd.com/groupon/order_details/距离@2x.png" mode="scaleToFill" />
 								</view>
 							</view>
 							<view class="am2">
-								上海市浦东新区秀浦路29号三层303
+								{{orderDetail.selfTake.address}}
 							</view>
 							<view class="am3">
-								营业时间 08:15-18:00
+								营业时间 {{orderDetail.selfTake.busStartTimeDesc}}-{{orderDetail.selfTake.busEndTimeDesc}}
 							</view>
 						</view>
 						<view class="a-b">
 							<view class="a-b1">
 								对接团长:
 								<text class="red">
-									陈晓旭
+									{{orderDetail.commander}}
 								</text>
 							</view>
 							<view class="a-b2">
@@ -139,15 +106,15 @@
 						</view>
 						<view class="p-b-item">
 							<view class="item-lable">订单编号</view>
-							<view class="item-value2">ZYG564648498465</view>
+							<view class="item-value2">{{orderDetail.orderNo}}</view>
 						</view>
 						<view class="p-b-item">
 							<view class="item-lable">下单时间</view>
-							<view class="item-value2">2023-05-05 12:08:22</view>
+							<view class="item-value2">{{orderDetail.createTime}}</view>
 						</view>
-						<view class="p-b-item">
+						<view class="p-b-item" v-if="orderDetail.orderState == 2">
 							<view class="item-lable">支付方式</view>
-							<view class="item-value2">在线支付</view>
+							<view class="item-value2">{{orderDetail.paymentModeDesc}}</view>
 						</view>
 					</blok>
 					<blok>
@@ -156,15 +123,15 @@
 						</view>
 						<view class="p-b-item">
 							<view class="item-lable">商品金额</view>
-							<view class="item-value">¥48</view>
+							<view class="item-value">¥{{orderDetail.totalAmount}}</view>
 						</view>
-						<view class="p-b-item">
+<!-- 						<view class="p-b-item">
 							<view class="item-lable">积分抵扣</view>
 							<view class="item-value">¥0</view>
-						</view>
+						</view> -->
 						<view class="p-b-item">
 							<view class="item-lable">总计金额</view>
-							<view class="item-value">¥48</view>
+							<view class="item-value">¥{{orderDetail.paymentAmount}}</view>
 						</view>
 					</blok>
 				</view>
@@ -174,12 +141,9 @@
 
 			<view class='footer op-area'>
 
-				<button class="info-btn" @click="RefundShow = true">申请售后
-
-
-				</button>
-				<button class="info-btn" @click="goPay()">取消订单</button>
-				<button class="action-btn" @click="goPay()">去支付</button>
+				<button class="info-btn" v-if="orderDetail.orderState == 2" @click="RefundShow = true">申请售后</button>
+				<button class="info-btn" v-if="orderDetail.orderState == 1" @click="cancelOrder()">取消订单</button>
+				<button class="action-btn" v-if="orderDetail.orderState == 1" @click="goPay()">去支付</button>
 			</view>
 		</view>
 
@@ -218,6 +182,7 @@ import authorize from '@/components/Authorize';
 import payment from '@/components/payment';
 import colors from "@/mixins/color";
 import productConSwiperGroupbuying from "@/components/productConSwiperGroupbuying";
+import {getUserOrderDetail} from '@/api/home.js';
 export default {
 	components: {
 		payment,
@@ -241,7 +206,7 @@ export default {
 			canvasHeight: "",
 			canvasStatus: false,
 			newImg: [],
-
+			orderDetail: {}
 		}
 	},
 	computed: mapGetters(['isLogin']),
@@ -255,7 +220,9 @@ export default {
 	// },
 	onLoad (options) {
 		this.from = 'routine'
-
+		console.log(options);
+		let orderId = options.orderId;
+		this.getOrderDetail(orderId)
 	},
 	/**
 	 * 生命周期函数--监听页面显示
@@ -273,6 +240,17 @@ export default {
 	methods: {
 		afterSales () {
 
+		},
+		getOrderDetail(orderId) {
+			let longitude = uni.getStorageSync('user_longitude');
+			let latitude = uni.getStorageSync('user_latitude');
+			getUserOrderDetail({
+				orderId: orderId,
+				longitude: longitude,
+				latitude: latitude
+			}).then(res => {
+				this.orderDetail = res.data
+			});
 		}
 	}
 }

+ 2 - 2
pages/order/index.vue

@@ -466,9 +466,9 @@ export default {
 		/**
 		 * 去订单详情
 		 */
-		goOrderDetails: function (order_id, order) {
+		goOrderDetails (orderId) {
 			uni.navigateTo({
-				url: '/pages/groupbuying_details/order_details_list/index?order_id= + order_id'
+				url: '/pages/groupbuying_details/order_details_list/index?orderId=' + orderId
 			});
 			// let that = this;
 			// if (!order_id)