From a240b43f1908abdecb87092502b3ed69d665336c Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期四, 30 四月 2026 13:41:12 +0800
Subject: [PATCH] 小程序 | app
---
app/pages/order/order.vue | 27 +++++++++++++++++++++++----
1 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/app/pages/order/order.vue b/app/pages/order/order.vue
index faa455c..ab572f1 100644
--- a/app/pages/order/order.vue
+++ b/app/pages/order/order.vue
@@ -383,15 +383,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 +429,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 => {
@@ -768,7 +788,6 @@
display: flex;
align-items: center;
justify-content: center;
- background: #f5f7fb;
border-radius: 16rpx;
image {
--
Gitblit v1.9.3