WIN-2CJ8FMUT9OF\Administrator 7 hónapja
szülő
commit
77307cbaa3
2 módosított fájl, 10 hozzáadás és 4 törlés
  1. 3 1
      pages-order/takeout-info.vue
  2. 7 3
      pages/order/index.vue

+ 3 - 1
pages-order/takeout-info.vue

@@ -13,7 +13,7 @@
 			</view>
 			<view class="" v-else>
 				<view class="fs-48 fc-3 fw-600">
-					{{infoData.order_status_str}}
+					{{infoData.order_status_str || ''}}
 				</view>
 			</view>
 		</view>
@@ -254,12 +254,14 @@
 				// console.log('触底');
 			},
 			orderInfo(id) {
+				tools.showLoading()
 				orderInfo({
 					order_id: id
 				}).then((res) => {
 					if (res.code == 1) {
 						this.infoData = res.data
 						if (this.infoData.order_status == 1) {
+							tools.hideLoading()
 							// 替换“-”为“/”,转换为 iOS 支持的格式
 							let compatibleDateString = (res.data.created_at).replace(/-/g, '/');
 							let createDate = new Date(compatibleDateString); //格式化订单创建时候的时间

+ 7 - 3
pages/order/index.vue

@@ -21,7 +21,7 @@
 								{{item.shop_name}}
 							</view>
 						</view>
-						<view class="fc-41ABF5 fs-28">
+						<view class="fc-FF3333 fs-28">
 							{{item.order_status_str}}
 						</view>
 					</view>
@@ -118,10 +118,12 @@
 				orderData: {}
 			};
 		},
-		onShow() {},
-		onLoad() {
+		onShow() {
+			this.list = []
+			this.page = 1
 			this.orderList()
 		},
+		onLoad() {},
 		onHide() {},
 		onUnload() {},
 		mounted() {},
@@ -162,11 +164,13 @@
 				// console.log('触底');
 			},
 			orderList() {
+				tools.showLoading()
 				// 订单列表
 				orderList({
 					page: this.page
 				}).then((res) => {
 					if (res.code == 1) {
+						tools.hideLoading()
 						this.total = res.data.total
 						this.list = [...this.list, ...res.data.items]
 					}