From 8a899e63502939dbf034b90ba46741e0faa9023c Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 08 五月 2026 18:49:32 +0800
Subject: [PATCH] 管理端bug修改
---
app/pages/order/order.vue | 144 ++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 121 insertions(+), 23 deletions(-)
diff --git a/app/pages/order/order.vue b/app/pages/order/order.vue
index faa455c..bbd6fbb 100644
--- a/app/pages/order/order.vue
+++ b/app/pages/order/order.vue
@@ -6,7 +6,14 @@
</view>
</view>
- <view class="order-page__tabs" :style="{ top: navHeight + 'px' }">
+ <view class="order-page__search" :style="{ top: navHeight + 'px' }">
+ <view class="order-page__search-box">
+ <u-icon name="search" color="#999999" size="28"></u-icon>
+ <input class="order-page__search-input" v-model="searchKeyword" placeholder="杈撳叆濮撳悕銆佺數璇濄�佽鍗曠紪鍙锋悳绱�" placeholder-class="order-page__search-placeholder" @confirm="searchOrder" />
+ </view>
+ </view>
+
+ <view class="order-page__tabs" :style="{ top: (navHeight + 44) + 'px' }">
<view v-for="tab in displayTabs" :key="tab.value" class="order-page__tab" :class="{ 'order-page__tab--active': activeTab === tab.value }" @click="activeTab = tab.value">
<text class="order-page__tab-text">{{ tab.label }}</text>
<view v-if="activeTab === tab.value" class="order-page__tab-line"></view>
@@ -27,16 +34,16 @@
<view class="order-card__route-item">
<view class="order-card__point order-card__point--pickup">鍙�</view>
<view class="order-card__route-texts">
- <text class="order-card__route-title">{{ item.takeName }}</text>
- <text class="order-card__route-desc">{{ item.takeAddress }}</text>
+ <text class="order-card__route-title">{{ item.depositShopName }}</text>
+ <text class="order-card__route-desc">{{ item.depositShopAddress }}</text>
</view>
</view>
<view class="order-card__route-item order-card__route-item--delivery">
<view class="order-card__point order-card__point--delivery">閫�</view>
<view class="order-card__route-texts">
- <text class="order-card__route-title">{{ item.depositShopName }}</text>
- <text class="order-card__route-desc">{{ item.depositShopAddress }}</text>
+ <text class="order-card__route-title">{{ item.takeName }}</text>
+ <text class="order-card__route-desc">{{ item.takeAddress }}</text>
</view>
</view>
@@ -151,6 +158,7 @@
statusBarHeight: 0,
navHeight: 0,
activeTab: null,
+ searchKeyword: '',
tabs: [
{ label: '鍏ㄩ儴', value: null },
{ label: '寰呭彇璐�', value: 3 },
@@ -193,8 +201,8 @@
bodyStyle() {
return {
- marginTop: this.navHeight + uni.upx2px(88) + 'px',
- height: `calc(100vh - ${this.navHeight + uni.upx2px(88)}px)`
+ marginTop: this.navHeight + uni.upx2px(88) + uni.upx2px(88) + 'px',
+ height: `calc(100vh - ${this.navHeight + uni.upx2px(88) + uni.upx2px(72)}px)`
}
},
photoPopupTitle() {
@@ -230,6 +238,12 @@
}
},
methods: {
+ searchOrder() {
+ this.page = 1
+ this.hasMore = true
+ this.orders = []
+ this.getOrderList()
+ },
getActiveOrderCount() {
this.$u.api.activeOrderCount().then(res => {
if (res.code === 200) {
@@ -249,7 +263,7 @@
2: '寰呮帴鍗�',
3: '寰呭彇璐�',
4: '閰嶉�佷腑',
- 5: '宸插畬鎴�',
+ 5: '宸查�佽揪',
7: '宸插畬鎴�',
99: '宸插彇娑�'
}
@@ -282,11 +296,13 @@
capacity: 10,
page: this.page,
model: {
- status: this.activeTab
+ status: this.activeTab,
+ keyword: this.searchKeyword
}
}).then(res => {
if (res.code === 200) {
const list = res.data.records || []
+ console.log(list)
if (this.page === 1) {
this.orders = list
} else {
@@ -345,18 +361,44 @@
this.showQRPopup = true
},
handlePhotoPickup(item) {
- this.selectedOrder = item
- this.photoPopupMode = 'pickup'
- this.uploadedPhotos = []
- this.photoRemark = ''
- this.showPhotoPopup = true
+ this.checkOperationRadius(item.id, 'pickup')
},
handlePhotoDeliver(item) {
- this.selectedOrder = item
- this.photoPopupMode = 'deliver'
- this.uploadedPhotos = []
- this.photoRemark = ''
- this.showPhotoPopup = true
+ this.checkOperationRadius(item.id, 'deliver')
+ },
+ checkOperationRadius(orderId, mode) {
+ uni.getLocation({
+ type: 'gcj02',
+ success: (res) => {
+ this.$u.api.checkDriverOperationRadius({
+ lat: res.latitude,
+ lng: res.longitude,
+ orderId: orderId
+ }).then(apiRes => {
+ if (apiRes.code === 200) {
+ console.log(apiRes.data)
+ if (apiRes.data === true) {
+ this.selectedOrder = { id: orderId }
+ this.photoPopupMode = mode
+ this.uploadedPhotos = []
+ this.photoRemark = ''
+ this.showPhotoPopup = true
+ } else {
+ uni.showToast({
+ title: '鎮ㄥ綋鍓嶄綅缃笌鏀惰揣鍦板潃璺濈瓒呭嚭鑼冨洿锛岃鍦ㄥ湴鍧�闄勮繎閲嶆柊鎷嶇収',
+ icon: 'none'
+ })
+ }
+ }
+ })
+ },
+ fail: () => {
+ uni.showToast({
+ title: '鏃犳硶鑾峰彇鎮ㄧ殑浣嶇疆淇℃伅',
+ icon: 'none'
+ })
+ }
+ })
},
closePhotoPopup() {
this.showPhotoPopup = false
@@ -383,15 +425,31 @@
return
}
uni.showLoading({ title: '涓婁紶涓�...' })
+ uni.getLocation({
+ type: 'gcj02',
+ success: (locationRes) => {
+ this.doUploadPhotos(locationRes.latitude, locationRes.longitude)
+ },
+ fail: () => {
+ this.doUploadPhotos(null, null)
+ }
+ })
+ },
+
+ doUploadPhotos(latitude, longitude) {
const uploadTasks = this.uploadedPhotos.map(path => {
return new Promise((resolve, reject) => {
+ const formData = { folder: 'orders' }
+ if (latitude && longitude) {
+ formData.latitude = latitude
+ formData.longitude = longitude
+ }
+ console.log('formData:', formData)
uni.uploadFile({
url: this.$baseUrl + 'web/public/upload',
filePath: path,
name: 'file',
- formData: {
- folder: 'order'
- },
+ formData: formData,
success: (uploadRes) => {
const data = JSON.parse(uploadRes.data)
if (data.code === 200) {
@@ -413,6 +471,10 @@
images: images.map(img => img.imgaddr),
orderId: this.selectedOrder.id,
remark: this.photoRemark
+ }
+ if (latitude && longitude) {
+ params.latitude = latitude
+ params.longitude = longitude
}
return this.$u.api[api](params)
}).then(res => {
@@ -460,6 +522,43 @@
font-size: 38rpx;
font-weight: 700;
color: #ffffff;
+ }
+
+ &__search {
+ position: fixed;
+ left: 0;
+ right: 0;
+ z-index: 10;
+ height: 88rpx;
+ padding: 8rpx 30rpx;
+ box-sizing: border-box;
+ display: flex;
+ align-items: center;
+ background: #ffffff;
+ }
+
+ &__search-box {
+ width: 100%;
+ height: 72rpx;
+ display: flex;
+ align-items: center;
+ padding: 0 24rpx;
+ background: #EEEEEE;
+ border-radius: 16rpx;
+ }
+
+ &__search-input {
+ flex: 1;
+ height: 72rpx;
+ margin-left: 12rpx;
+ color: #333333;
+ font-weight: 400;
+ font-size: 26rpx;
+ }
+
+ &__search-placeholder {
+ font-size: 28rpx;
+ color: #999999;
}
&__tabs {
@@ -768,7 +867,6 @@
display: flex;
align-items: center;
justify-content: center;
- background: #f5f7fb;
border-radius: 16rpx;
image {
--
Gitblit v1.9.3