|
@@ -7,11 +7,9 @@
|
|
<view class="info-list">
|
|
<view class="info-list">
|
|
<view>被服务人员:{{ detaile.clientName }}</view>
|
|
<view>被服务人员:{{ detaile.clientName }}</view>
|
|
<view style="display: flex;">服务类别:
|
|
<view style="display: flex;">服务类别:
|
|
- <!-- <dict-tag :options="lrr_service_category"
|
|
|
|
- :value="detaile.businessTireName" /> -->
|
|
|
|
- {{ detaile.businessTireName }}
|
|
|
|
- </view>
|
|
|
|
- <view @click="onPhone">电话号码:<label class="phone">{{ detaile.clientPhoneNumber }}</label></view>
|
|
|
|
|
|
+ {{ detaile.businessTireName }}
|
|
|
|
+ </view>
|
|
|
|
+ <view @click="onPhone">电话号码:<label class="phone">{{ detaile.clientPhoneNumber.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') }}</label></view>
|
|
<view>地址:{{ detaile.address }}</view>
|
|
<view>地址:{{ detaile.address }}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -19,13 +17,13 @@
|
|
<view class="service-info order-card">
|
|
<view class="service-info order-card">
|
|
<view class="font-title ">备注信息</view>
|
|
<view class="font-title ">备注信息</view>
|
|
<view class="info-list">
|
|
<view class="info-list">
|
|
- {{ detaile.remark }}
|
|
|
|
|
|
+ {{ detaile.remark || '暂无备注信息'}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="service-info order-card" v-if="detaile.orderStatus === '3'">
|
|
<view class="service-info order-card" v-if="detaile.orderStatus === '3'">
|
|
<view class="font-title ">反馈信息</view>
|
|
<view class="font-title ">反馈信息</view>
|
|
<view class="info-list">
|
|
<view class="info-list">
|
|
- <up-textarea v-model="detaile.volunteerReview" placeholder="请输入内容" ></up-textarea>
|
|
|
|
|
|
+ <up-textarea v-model="detaile.volunteerReview" placeholder="请输入内容"></up-textarea>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -39,7 +37,8 @@
|
|
</view>
|
|
</view>
|
|
<view class="upload-box-see">
|
|
<view class="upload-box-see">
|
|
<view class="upload-img-item" v-for="(item) in volunteerPicture" :key="item.url">
|
|
<view class="upload-img-item" v-for="(item) in volunteerPicture" :key="item.url">
|
|
- <up-image class="upload-img-see" :show-loading="true" :src="item.url" :alt="item.fileName"></up-image>
|
|
|
|
|
|
+ <up-image class="upload-img-see" :show-loading="true" :src="item.url"
|
|
|
|
+ :alt="item.fileName" mode="widthFix"></up-image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -48,12 +47,13 @@
|
|
<view class="font-title">用户评价信息</view>
|
|
<view class="font-title">用户评价信息</view>
|
|
<view class="user-box">
|
|
<view class="user-box">
|
|
<view class="info-list">
|
|
<view class="info-list">
|
|
- <view class="info-item">{{ detaile.userReview || '用户未完成评价'}}</view>
|
|
|
|
|
|
+ <view class="info-item">{{ detaile.userReview || '用户未完成评价' }}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="upload-box-see">
|
|
<view class="upload-box-see">
|
|
<view class="upload-img-item" v-for="(item) in userPicture" :key="item.url">
|
|
<view class="upload-img-item" v-for="(item) in userPicture" :key="item.url">
|
|
- <up-image class="upload-img-see" :show-loading="true" :src="item.url" :alt="item.fileName"></up-image>
|
|
|
|
|
|
+ <up-image class="upload-img-see" :show-loading="true" :src="item.url"
|
|
|
|
+ :alt="item.fileName"></up-image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -77,8 +77,7 @@
|
|
|
|
|
|
|
|
|
|
<view class=" footer-g" v-if="detaile.orderStatus === '3'">
|
|
<view class=" footer-g" v-if="detaile.orderStatus === '3'">
|
|
- <!-- <up-button type="primary" text="确定结束" @click="onSubmit"></up-button> -->
|
|
|
|
- <view class="status-btn" @click="onSubmit">确定结束</view>
|
|
|
|
|
|
+ <view class="status-btn" @click="submit">确定结束</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -94,7 +93,7 @@ import DictTag from '@/components/DictTag/index.vue'
|
|
const fileList = ref([]);
|
|
const fileList = ref([]);
|
|
const secondOrderId = ref('');
|
|
const secondOrderId = ref('');
|
|
const detaile = ref({
|
|
const detaile = ref({
|
|
- volunteerReview:''
|
|
|
|
|
|
+ volunteerReview: ''
|
|
});
|
|
});
|
|
|
|
|
|
const {
|
|
const {
|
|
@@ -143,12 +142,12 @@ const getOrderDetail = async () => {
|
|
});
|
|
});
|
|
const res = await getVolunteerOrderInfo({ secondOrderId: secondOrderId.value });
|
|
const res = await getVolunteerOrderInfo({ secondOrderId: secondOrderId.value });
|
|
console.log('API response:', res);
|
|
console.log('API response:', res);
|
|
-
|
|
|
|
|
|
+
|
|
// Check if the response was successful
|
|
// Check if the response was successful
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
// Directly assign the data from response
|
|
// Directly assign the data from response
|
|
detaile.value = res.data;
|
|
detaile.value = res.data;
|
|
-
|
|
|
|
|
|
+
|
|
// Check if volunteer pictures exist and process them
|
|
// Check if volunteer pictures exist and process them
|
|
if (res.data.volunteerPicture) {
|
|
if (res.data.volunteerPicture) {
|
|
fileList.value = res.data.volunteerPicture.split(',').map(item => {
|
|
fileList.value = res.data.volunteerPicture.split(',').map(item => {
|
|
@@ -161,7 +160,7 @@ const getOrderDetail = async () => {
|
|
icon: 'error',
|
|
icon: 'error',
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
console.log('detaile.value after assignment:', detaile.value);
|
|
console.log('detaile.value after assignment:', detaile.value);
|
|
|
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -177,90 +176,93 @@ const getOrderDetail = async () => {
|
|
|
|
|
|
// 获取当前位置信息
|
|
// 获取当前位置信息
|
|
const getCurrentLocation = () => {
|
|
const getCurrentLocation = () => {
|
|
- return new Promise((resolve, reject) => {
|
|
|
|
- // 先检查用户是否授权了位置权限
|
|
|
|
- uni.getSetting({
|
|
|
|
- success: (res) => {
|
|
|
|
- if (!res.authSetting['scope.userLocation']) {
|
|
|
|
- // 如果用户未授权,先请求授权
|
|
|
|
- uni.authorize({
|
|
|
|
- scope: 'scope.userLocation',
|
|
|
|
- success: () => {
|
|
|
|
- // 授权成功后获取位置
|
|
|
|
- getLocation(resolve, reject);
|
|
|
|
- },
|
|
|
|
- fail: (err) => {
|
|
|
|
- console.error('位置授权失败:', err);
|
|
|
|
- uni.showModal({
|
|
|
|
- title: '提示',
|
|
|
|
- content: '需要获取您的位置信息,请在设置中打开位置权限',
|
|
|
|
- confirmText: '去设置',
|
|
|
|
- success: (res) => {
|
|
|
|
- if (res.confirm) {
|
|
|
|
- uni.openSetting();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- reject(err);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- // 已授权,直接获取位置
|
|
|
|
- getLocation(resolve, reject);
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- fail: (err) => {
|
|
|
|
- console.error('获取设置失败:', err);
|
|
|
|
- reject(err);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ // 先检查用户是否授权了位置权限
|
|
|
|
+ uni.getSetting({
|
|
|
|
+ success: (res) => {
|
|
|
|
+ if (!res.authSetting['scope.userLocation']) {
|
|
|
|
+ // 如果用户未授权,先请求授权
|
|
|
|
+ uni.authorize({
|
|
|
|
+ scope: 'scope.userLocation',
|
|
|
|
+ success: () => {
|
|
|
|
+ // 授权成功后获取位置
|
|
|
|
+ getLocation(resolve, reject);
|
|
|
|
+ },
|
|
|
|
+ fail: (err) => {
|
|
|
|
+ console.error('位置授权失败:', err);
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '需要获取您的位置信息,请在设置中打开位置权限',
|
|
|
|
+ confirmText: '去设置',
|
|
|
|
+ success: (res) => {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ uni.openSetting();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ reject(err);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ // 已授权,直接获取位置
|
|
|
|
+ getLocation(resolve, reject);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ fail: (err) => {
|
|
|
|
+ console.error('获取设置失败:', err);
|
|
|
|
+ reject(err);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
// 获取位置的具体实现
|
|
// 获取位置的具体实现
|
|
const getLocation = (resolve, reject) => {
|
|
const getLocation = (resolve, reject) => {
|
|
- // 删除开发环境模拟位置的代码,始终获取真实位置
|
|
|
|
- uni.getLocation({
|
|
|
|
- type: 'gcj02',
|
|
|
|
- isHighAccuracy: true, // 高精度
|
|
|
|
- highAccuracyExpireTime: 3000, // 高精度过期时间
|
|
|
|
- success: (res) => {
|
|
|
|
- const { longitude, latitude } = res;
|
|
|
|
- console.log('当前位置 - 经度:', longitude);
|
|
|
|
- console.log('当前位置 - 纬度:', latitude);
|
|
|
|
- resolve({
|
|
|
|
- longitude,
|
|
|
|
- latitude
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- fail: (err) => {
|
|
|
|
- console.error('获取位置失败:', err);
|
|
|
|
- // 获取位置失败时向用户提示
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '获取位置失败,请确保已开启位置权限',
|
|
|
|
- icon: 'none',
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
- reject(err);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ // 删除开发环境模拟位置的代码,始终获取真实位置
|
|
|
|
+ uni.getLocation({
|
|
|
|
+ type: 'gcj02',
|
|
|
|
+ isHighAccuracy: true, // 高精度
|
|
|
|
+ highAccuracyExpireTime: 3000, // 高精度过期时间
|
|
|
|
+ success: (res) => {
|
|
|
|
+ const { longitude, latitude } = res;
|
|
|
|
+ console.log('当前位置 - 经度:', longitude);
|
|
|
|
+ console.log('当前位置 - 纬度:', latitude);
|
|
|
|
+ resolve({
|
|
|
|
+ longitude,
|
|
|
|
+ latitude
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ fail: (err) => {
|
|
|
|
+ console.error('获取位置失败:', err);
|
|
|
|
+ // 获取位置失败时向用户提示
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '获取位置失败,请确保已开启位置权限',
|
|
|
|
+ icon: 'none',
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ reject(err);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
-
|
|
|
|
-const onSubmit = async() => {
|
|
|
|
|
|
+const submit = () => {
|
|
|
|
+ uni.$u.debounce(onSubmit, 300)
|
|
|
|
+}
|
|
|
|
+const onSubmit = async () => {
|
|
|
|
+
|
|
const img_urls = fileList.value.map(item => item.url).join(',');
|
|
const img_urls = fileList.value.map(item => item.url).join(',');
|
|
console.log('submit', fileList.value, img_urls);
|
|
console.log('submit', fileList.value, img_urls);
|
|
|
|
|
|
- // 获取结束服务时的位置
|
|
|
|
- const locationData = await getCurrentLocation().catch(err => {
|
|
|
|
- uni.hideLoading()
|
|
|
|
- verify.value.initialization()
|
|
|
|
- throw new Error('无法获取位置信息,请确保已开启位置权限')
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- // 构建参数字符串
|
|
|
|
- const params = `volunteerPicture=${img_urls}&volunteerReview=${detaile.value.volunteerReview}&secondOrderId=${secondOrderId.value}&serviceFinishLongitude=${locationData.longitude.toString()}&serviceFinishLatitude=${locationData.latitude.toString()}`
|
|
|
|
-
|
|
|
|
- // 调用结束服务接口,通过URL查询参数传递位置信息
|
|
|
|
|
|
+ // 获取结束服务时的位置
|
|
|
|
+ const locationData = await getCurrentLocation().catch(err => {
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ verify.value.initialization()
|
|
|
|
+ throw new Error('无法获取位置信息,请确保已开启位置权限')
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ // 构建参数字符串
|
|
|
|
+ const params = `volunteerPicture=${img_urls}&volunteerReview=${detaile.value.volunteerReview}&secondOrderId=${secondOrderId.value}&serviceFinishLongitude=${locationData.longitude.toString()}&serviceFinishLatitude=${locationData.latitude.toString()}`
|
|
|
|
+
|
|
|
|
+ // 调用结束服务接口,通过URL查询参数传递位置信息
|
|
|
|
|
|
getVolunteerFinishSecondOrder(params).then(res => {
|
|
getVolunteerFinishSecondOrder(params).then(res => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
@@ -397,12 +399,14 @@ onLoad((options) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
.upload-box-see {
|
|
.upload-box-see {
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
align-items: center;
|
|
justify-content: center;
|
|
justify-content: center;
|
|
- .upload-img-see{
|
|
|
|
|
|
+
|
|
|
|
+ .upload-img-see {
|
|
margin-bottom: 12px;
|
|
margin-bottom: 12px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -417,18 +421,18 @@ onLoad((options) => {
|
|
}
|
|
}
|
|
|
|
|
|
.status-btn {
|
|
.status-btn {
|
|
- // width: 716rpx;
|
|
|
|
- height: 96rpx;
|
|
|
|
- border-radius: 16rpx;
|
|
|
|
- background: rgba(221, 94, 69, 1);
|
|
|
|
-
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- justify-content: center;
|
|
|
|
-
|
|
|
|
- font-size: 32rpx;
|
|
|
|
- font-weight: 400;
|
|
|
|
- color: rgba(255, 255, 255, 1);
|
|
|
|
- margin-bottom: 88rpx;
|
|
|
|
- }
|
|
|
|
|
|
+ // width: 716rpx;
|
|
|
|
+ height: 96rpx;
|
|
|
|
+ border-radius: 16rpx;
|
|
|
|
+ background: rgba(221, 94, 69, 1);
|
|
|
|
+
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ color: rgba(255, 255, 255, 1);
|
|
|
|
+ margin-bottom: 88rpx;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|