master
jevononlie 7 months ago
parent 692fe4f294
commit 6c8373634c

@ -16,6 +16,10 @@ onLoad((options) => {
const isLoading = ref(false)
//
const order = ref({})
const isOrderTypeSH = ref(false)
const isOderTypeTime = ref(false)
const isOderTypeDZ = ref(false)
const getMemberOrderByIdData = async (orderId) => {
const params = {
orderId: orderId,
@ -25,16 +29,33 @@ const getMemberOrderByIdData = async (orderId) => {
isLoading.value = true
const res = await getOrderDetailAPI(params)
const data = res.data
const str = data.appointmentTimeStart.slice(0, 10)
const start = data.appointmentTimeStart.slice(11, 16)
const end = data.appointmentTimeEnd.slice(11, 16)
data.appointmentTime = str + ' ' + start + '-' + end
data.orderDetails.forEach((q) => {
const arr = JSON.parse(q.product.photo)
const imgUrl = serviceDomain + arr[0].url
q.imgUrl = imgUrl
})
//
isOrderTypeSH.value = data.orderType?.code == '520193382480351557' || false
//
isOderTypeTime.value = data.orderType?.code == '520193458267230533' || false
//
isOderTypeDZ.value = data.orderType?.code == '520193532170867013' || false
if (isOrderTypeSH.value) {
const str = data.appointmentTimeStart?.slice(0, 10)
const start = data.appointmentTimeStart?.slice(11, 16)
const end = data.appointmentTimeEnd?.slice(11, 16)
data.appointmentTime = str + ' ' + start + '-' + end
data.orderDetails?.forEach((q) => {
const arr = JSON.parse(q.product.photo)
const imgUrl = serviceDomain + arr[0].url
q.imgUrl = imgUrl
})
}
//
if (isOderTypeTime.value) {
const arr = data.housingEstateInfo.images && JSON.parse(data.housingEstateInfo.images) || []
const imgUrl = serviceDomain + arr[0]?.url
data.housingEstateInfo.imgUrl = imgUrl
}
order.value = data
isLoading.value = false
@ -45,45 +66,142 @@ const getMemberOrderByIdData = async (orderId) => {
<template v-if="!isLoading">
<view class="order-detail">
<view class="status">
<view class="title">{{ order?.orderStatus?.desc }}</view>
<view class="title">订单状态{{ order.orderStatus?.desc }}</view>
<view class="desc">订单类型{{ order.orderType?.desc || '散户下单' }}</view>
<template
v-if="order.orderStatus?.code == '520192817293693253' || order.orderStatus?.code == '520192868833300805' || order.orderStatus?.code == '520192993311854917'">
<view class="time">预约时间{{ order.appointmentTime }}</view>
<view class="action">
<view class="button cancle" @click="handleCancleOrder"></view>
</view>
</template>
</view>
<view class="module">
<view class="title">订单编号{{ order.orderNumber }}</view>
<view class="order-details">
<view class="detail-item" v-for="item in order.orderDetails" :key="item.id">
<image class="img-url" :src="item.imgUrl"></image>
<view class="product-name">{{ item.product.name }}</view>
<template v-if="isOrderTypeSH">
<view class="module">
<view class="title">订单编号{{ order.orderNumber }}</view>
<view class="detail-title">回收品类</view>
<view class="order-details">
<view class="detail-item" v-for="item in order.orderDetails" :key="item.id">
<view class="product-info">
<image class="img-url" :src="item.imgUrl"></image>
<view class="name">{{ item.product.name }}</view>
</view>
<template v-if="order.orderStatus.code == '520193049964319045'">
<view class="recovery-price">实际价格{{ item.actualRecoveryPrice }}</view>
<view class="recovery-weight">实际重量{{ item.productActualWeight }}千克</view>
</template>
</view>
</view>
<view class="predict-weight">预估重量{{ order.predictWeight?.desc }}</view>
<template v-if="order.recyclerInfo">
<view class="staffs-name">
回收员{{ order.recyclerInfo?.staffsName }}</view>
<view class="staffs-phone">回收员手机号{{ order.recyclerInfo?.mobilePhone }}</view>
</template>
</view>
<view class="predict-weight">预估重量{{ order.predictWeight?.desc }}</view>
<view class="client-name">下单人员{{ order.clientName }}</view>
<view class="client-phone">下单人员手机号{{ order.clientMobile }}</view>
</view>
<view class="module info">
<view class="title">取件信息</view>
<view class="module info">
<view class="title">取件信息</view>
<view class="item">
<view class="label">取件时间</view>
<view class="val">{{ order.appointmentTime }}</view>
</view>
<view class="item" v-if="order.arrivalTime">
<view class="label">到达时间</view>
<view class="val">{{ order.arrivalTime }}</view>
</view>
<view class="item">
<view class="label">取件地址</view>
<view class="val">{{ order.addressInfo?.receiveStreet }} {{ order.addressInfo?.receiveHouseNumber }}
</view>
</view>
<view class="item">
<view class="label">下单时间</view>
<view class="val">{{ order.creatorTime }}</view>
</view>
<view class="item" v-if="order.completeTime">
<view class="label">完成时间</view>
<view class="val">{{ order.completeTime }}</view>
</view>
<view class="item">
<view class="label">备注</view>
<view class="val">{{ order.remark }}</view>
</view>
</view>
</template>
<template v-if="isOderTypeTime">
<view class="module info">
<view class="title">小区信息</view>
<view class="item">
<view class="label">名字</view>
<view class="val">{{ order.housingEstateInfo.name }}</view>
</view>
<view class="item">
<view class="label">地址</view>
<view class="val">{{ order.housingEstateInfo.address }}</view>
</view>
<view class="item">
<view class="label">回收时间</view>
<view class="val">{{ order.housingEstateInfo.appointmentTimeStart }} -
{{ order.housingEstateInfo.appointmentTimeEnd }}</view>
</view>
<view class="item">
<view class="label">下单时间</view>
<view class="val">{{ order.housingEstateInfo.creatorTime }}</view>
</view>
<view class="item" v-if="order.housingEstateInfo.completeTime">
<view class="label">完成时间</view>
<view class="val">{{ order.housingEstateInfo.completeTime }}</view>
</view>
<view class="item">
<view class="label">备注</view>
<view class="val">{{ order.remark }}</view>
</view>
</view>
</template>
<view class="module info" v-if="order.recyclerInfo">
<view class="title">回收员信息</view>
<view class="item">
<view class="label">取件时间</view>
<view class="val">{{ order.appointmentTime }}</view>
<view class="label">头像</view>
<image class="img-url" :src="order.recyclerInfo.imgUrl"></image>
</view>
<view class="item">
<view class="label">取件地址</view>
<view class="val">{{ order.addressInfo?.receiveStreet }} {{ order.addressInfo?.receiveHouseNumber }}</view>
<view class="label">性别</view>
<view class="val">{{ order.recyclerInfo.gender ? '男' : '女' }}</view>
</view>
<view class="item">
<view class="label">下单时间</view>
<view class="val">{{ order.creatorTime }}</view>
<view class="label">名字</view>
<view class="val">{{ order.recyclerInfo.staffsName }}</view>
</view>
<view class="item">
<view class="label">取件时间</view>
<view class="val">{{ order.receiveTime }}</view>
<view class="label">手机</view>
<view class="val">{{ order.recyclerInfo.mobilePhone }}</view>
</view>
</view>
<view class="module info" v-if="order.recycleStationInfo">
<view class="title">回收站信息</view>
<view class="item">
<view class="label">完成时间</view>
<view class="val">{{ order.completeTime }}</view>
<view class="label">站点图片</view>
<image class="img-url" :src="order.recycleStationInfo.imgUrl"></image>
</view>
<view class="item">
<view class="label">备注</view>
<view class="val">{{ order.remark }}</view>
<view class="label">名称</view>
<view class="val">{{ order.recycleStationInfo.stationName }}</view>
</view>
<view class="item">
<view class="label">联系人</view>
<view class="val">{{ order.recycleStationInfo.contactPerson }}</view>
</view>
<view class="item">
<view class="label">营业时间</view>
<view class="val">{{ order.recycleStationInfo.appointmentTimeStart + ' - ' +
order.recycleStationInfo.appointmentTimeEnd }}</view>
</view>
</view>
</view>
@ -107,24 +225,36 @@ page {
margin-bottom: 100rpx;
overflow: auto;
scrollbar-width: none;
.order-detail {
.status {
margin: 40rpx 0;
padding: 40rpx 0;
background: linear-gradient(180deg, #BDD3FF -3%, #FAFAFD 21%);
.title {
font-size: 42rpx;
color: #0D0D26;
text-align: center;
}
.desc {
margin: 10rpx 0;
font-size: 28rpx;
color: #356899;
text-align: center;
}
.time {
margin: 20rpx 0;
font-size: 28rpx;
color: #999A9F;
text-align: center;
}
.action {
margin-top: 40rpx;
display: flex;
justify-content: center;
.button {
padding: 10rpx 30rpx;
text-align: center;
@ -133,6 +263,7 @@ page {
font-weight: normal;
color: #0D0D26;
border-radius: 30rpx;
&.cancle {
border: 2rpx solid #E30000;
color: #E30000;
@ -140,67 +271,114 @@ page {
}
}
}
.module {
margin: 20rpx;
padding: 20rpx 20rpx;
min-height: 300rpx;
border-radius: 10rpx;
background: #FFFFFF;
box-shadow: 0px 0px 8px 0px rgba(161, 161, 177, 0.12);
.title {
color: #3D3D3D;
font-size: 28rpx;
padding: 10rpx;
border-bottom: 2rpx solid #F2F2F2;
}
.detail-title {
font-size: 28rpx;
margin: 20rpx 0;
}
.order-details {
margin: 20rpx;
.detail-item {
margin: 20rpx 0;
display: flex;
align-items: center;
.img-url {
width: 40rpx;
height: 40rpx;
margin-right: 20rpx;
margin: 30rpx 0; // display: flex;
// align-items: center;
font-size: 28rpx;
color: #3D3D3D;
.product-info {
display: flex;
align-items: center;
.img-url {
width: 40rpx;
height: 40rpx;
margin-right: 20rpx;
}
.name {
font-size: 28rpx;
color: #3D3D3D;
}
}
.address {}
.recovery-price {
font-size: 28rpx;
color: #3D3D3D;
margin: 10rpx;
}
.product-name {
.recovery-weight {
font-size: 28rpx;
color: #3D3D3D;
}
}
}
.predict-weight {
margin: 40rpx 0 20rpx;
font-size: 28rpx;
margin-top: 40rpx;
color: #3D3D3D;
}
.client-name {
margin: 20rpx 0;
.staffs-name {
font-size: 28rpx;
margin: 20rpx 0;
color: #3D3D3D;
}
.client-phone {
.staffs-phone {
font-size: 28rpx;
margin-bottom: 40rpx;
color: #3D3D3D;
margin: 20rpx 0;
}
&.info {
.title {
color: #0D0D26;
font-size: 32rpx;
}
.item {
display: flex;
justify-content: space-between;
// justify-content: space-between;
padding: 20rpx;
border-bottom: 2rpx solid #F2F2F2;
&:last-child {
border: none;
}
.img-url {
width: 40rpx;
height: 40rpx;
margin-right: 20rpx;
border-radius: 4rpx;
}
.label {
font-size: 28rpx;
color: #3D3D3D;
width: 160rpx;
}
.val {
font-size: 28rpx;
color: #3D3D3D;

@ -27,6 +27,10 @@ const orderList = ref<any[]>([])
//
const isLoading = ref(false)
const emit = defineEmits('tabChange')
const isOrderTypeSH = ref(false)
const isOderTypeTime = ref(false)
const isOderTypeDZ = ref(false)
const getMemberOrderData = async () => {
// 退
if (isLoading.value) return
@ -38,18 +42,36 @@ const getMemberOrderData = async () => {
isLoading.value = true
//
const res = await getListOrderAPI(queryParams)
res.data.list.forEach((e) => {
const str = e.appointmentTimeStart.slice(0, 10)
const start = e.appointmentTimeStart.slice(11, 16)
const end = e.appointmentTimeEnd.slice(11, 16)
e.appointmentTime = str + ' ' + start + '-' + end
})
const data = res.data
//
isOrderTypeSH.value = props.orderState == 'SH_ORDER' || false
//
isOderTypeTime.value = props.orderState == 'TM_RECOVERY' || false
//
isOderTypeDZ.value = props.orderState == 'DZ_RECOVERY' || false
if (isOrderTypeSH.value) {
data.list.forEach((e) => {
const str = e.appointmentTimeStart?.slice(0, 10)
const start = e.appointmentTimeStart?.slice(11, 16)
const end = e.appointmentTimeEnd?.slice(11, 16)
e.appointmentTime = str + ' ' + start + '-' + end
})
}
//
if (isOderTypeTime.value) {
res.data.list.forEach((e) => {
e.time = e.housingEstateInfo.appointmentTimeStart + ' - ' + e.housingEstateInfo.appointmentTimeEnd
})
}
//
isLoading.value = false
//
orderList.value.push(...res.data.list)
orderList.value.push(...data.list)
//
if (queryParams.pageNo < res.data.pages) {
if (queryParams.pageNo < data.pages) {
//
queryParams.pageNo++
} else {
@ -92,25 +114,54 @@ const onRefresherrefresh = async () => {
<navigator class="goods" :url="`/pages/orderCompleteDetail/orderCompleteDetail?orderId=${item.id}`"
hover-class="none">
<view class="meta">
<view class="meta-item">
<view class="icon">
<uni-icons type="location" color="#3775F6" size="20"></uni-icons>
<template v-if="isOrderTypeSH">
<view class="meta-item">
<view class="icon">
<uni-icons type="location" color="#3775F6" size="20"></uni-icons>
</view>
<view class="text ellipsis">{{ item.addressInfo?.receiveStreet }} {{ item.addressInfo?.receiveHouseNumber
}}
</view>
</view>
<view class="meta-item">
<view class="icon">
<uni-icons type="calendar" color="#3775F6" size="20"></uni-icons>
</view>
<view class="text ellipsis">{{ item.appointmentTime }}</view>
</view>
<view class="meta-item">
<view class="icon">
<uni-icons type="phone" color="#3775F6" size="20"></uni-icons>
</view>
<view class="text phone">{{ item.clientName }} <text class="iphone">{{ item.clientMobile }}</text></view>
</view>
</template>
<template v-if="isOderTypeTime">
<view class="meta-item">
<view class="icon">
<uni-icons type="shop" color="#3775F6" size="20"></uni-icons>
</view>
<view class="text ellipsis">小区{{ item.housingEstateInfo?.name }}</view>
</view>
<view class="text ellipsis">{{ item.addressInfo?.receiveStreet }} {{ item.addressInfo?.receiveHouseNumber }}
<view class="meta-item">
<view class="icon">
<uni-icons type="location" color="#3775F6" size="20"></uni-icons>
</view>
<view class="text ellipsis">小区地址{{ item.housingEstateInfo?.address }}</view>
</view>
</view>
<view class="meta-item">
<view class="icon">
<uni-icons type="calendar" color="#3775F6" size="20"></uni-icons>
<view class="meta-item">
<view class="icon">
<uni-icons type="calendar" color="#3775F6" size="20"></uni-icons>
</view>
<view class="text ellipsis">回收时间{{ item.time }}</view>
</view>
<view class="text ellipsis">{{ item.appointmentTime }}</view>
</view>
<view class="meta-item">
<view class="icon">
<uni-icons type="phone" color="#3775F6" size="20"></uni-icons>
<view class="meta-item">
<view class="icon">
<uni-icons type="phone" color="#3775F6" size="20"></uni-icons>
</view>
<view class="text phone">{{ item.clientName }} <text class="iphone">{{ item.clientMobile }}</text></view>
</view>
<view class="text phone">{{ item.clientName }} <text class="iphone">{{ item.clientMobile }}</text></view>
</view>
</template>
</view>
</navigator>
<!-- 订单操作按钮 -->

@ -2,12 +2,12 @@
* @Author: 王文杰
* @Date: 2024-01-25 10:55:51
* @LastEditors: jevononlie 728254585@qq.com
* @LastEditTime: 2024-04-01 16:18:36
* @LastEditTime: 2024-04-02 15:36:24
* @FilePath: /app-nx-recycle/src/payment/success/success.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup lang="ts">
import { getListOrderAPI, getHouseAPI, postOrderCompleteAPI } from '@/services/order'
import { getListOrderAPI, getHouseAPI, postOrderCompleteTmAPI } from '@/services/order'
import { getCategoryAPI } from '@/services/site'
import { ref, computed } from 'vue'
import { onShow, onReady } from '@dcloudio/uni-app'
@ -121,7 +121,6 @@ const onRefresherrefresh = async () => {
}
//
const siteProductList = ref([])
const orderId = ref('')
//
@ -135,7 +134,7 @@ const showPop = async (item: Object) => {
const arr = JSON.parse(e.photo)
const imgUrl = serviceDomain + arr[0].url
e.imgUrl = imgUrl
e.productActualWeight = 0
e.productActualWeight = ''
})
siteProductList.value = res.data
popup.value?.open()
@ -168,18 +167,21 @@ const handlePayment = async () => {
console.log('用户点击确定')
const orderDetails = []
siteProductList.value.forEach((e) => {
const obj = {
productActualWeight: e.productActualWeight,
productId: e.productId,
recoveryPrice: e.recoveryPrice,
if (e.productActualWeight) {
const obj = {
productActualWeight: e.productActualWeight,
productId: e.productId,
recoveryPrice: e.recoveryPrice,
}
orderDetails.push(obj)
}
orderDetails.push(obj)
})
const params = {
id: orderId.value,
orderDetails,
}
const res = await postOrderCompleteAPI(params)
const res = await postOrderCompleteTmAPI(params)
popup.value?.close()
uni.navigateTo({ url: '/payment/success/success' })
} else if (res.cancel) {
console.log('用户点击取消')
@ -203,9 +205,14 @@ onShow(() => {
isFinish.value = false
orderList.value = []
queryParams.pageNo = 1
getHouseData()
})
const handlePhone = (clientMobile) => {
uni.makePhoneCall({
phoneNumber: clientMobile,
})
}
</script>
<template>
<view class="viewport">
@ -225,11 +232,11 @@ onShow(() => {
<scroll-view enablorderStatee-back-to-top scroll-y class="orders" refresher-enabled
:refresher-triggered="isTriggered" @refresherrefresh="onRefresherrefresh" @scrolltolower="getOrderData">
<view class="item" v-for="item in orderList" :key="item.id">
<view class="hd" @click="handleDetail(item.id)">
<view class="hd">
<view class="num">订单编号{{ item.orderNumber }}</view>
<view class="statusLabel">{{ item.orderStatus?.desc }}</view>
</view>
<view class="md" @click="handleDetail(item.id)">
<view class="md">
<view class="order-details">
<view class="house-info">
<image class="img-url" :src="item.housingEstateInfo?.imgUrl"></image>
@ -239,9 +246,9 @@ onShow(() => {
<uni-icons type="location" color="#3775F6" size="20"></uni-icons>
<view class="val">{{ item.housingEstateInfo?.address }}</view>
</view>
<view class="details-item">
<view class="details-item" @tab="handlePhone(item?.clientMobile)">
<uni-icons type="phone" color="#3775F6" size="20"></uni-icons>
<view class="val">{{ item?.clientMobile }}</view>
<view class="val phone">{{ item?.clientMobile }}</view>
</view>
</view>
</view>
@ -432,6 +439,14 @@ page {
.label {
margin-right: 10rpx;
}
.val {
margin-left: 10rpx;
&.phone {
color: #3775f6;
}
}
}
}

@ -49,34 +49,46 @@ onLoad(() => {
})
const isLoadingPay = ref(false)
//
const handlePayment = async () => {
const flag = orderList.value.some((q) => {
return q.productActualWeight
})
console.log(flag)
if (flag) {
let orderDetails = []
orderList.value.forEach((e) => {
const obj = {
id: e.id,
productActualWeight: Number(e.productActualWeight).toFixed(2),
productId: e.productId,
}
orderDetails.push(obj)
uni.showModal({
title: '提示',
content: '我已清点完商品,确认结算!',
success: async (res) => {
if (res.confirm) {
console.log('用户点击确定')
let orderDetails = []
orderList.value.forEach((e) => {
if (e.productActualWeight) {
const obj = {
id: e.id,
productActualWeight: Number(e.productActualWeight).toFixed(2),
productId: e.productId,
}
orderDetails.push(obj)
}
})
if (isLoadingPay.value) {
return
}
const params = {
id: props.orderId,
orderDetails,
}
isLoadingPay.value = true
const res = await postOrderCompleteAPI(params)
isLoadingPay.value = false
uni.navigateTo({ url: '/payment/success/success' })
} else if (res.cancel) {
console.log('用户点击取消')
}
},
})
if (isLoadingPay.value) {
return
}
const params = {
id: props.orderId,
orderDetails,
}
isLoadingPay.value = true
const res = await postOrderCompleteAPI(params)
isLoadingPay.value = false
if (res.code == 200) {
uni.navigateTo({ url: '/payment/success/success' })
}
} else {
uni.showToast({
icon: 'none',

@ -2,7 +2,7 @@
* @Author:
* @Date: 2024-01-04 12:54:56
* @LastEditors: jevononlie 728254585@qq.com
* @LastEditTime: 2024-04-01 17:05:09
* @LastEditTime: 2024-04-02 16:47:12
* @FilePath: /app-nx-recycle/src/services/constants.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/

@ -55,7 +55,7 @@ export const postOrderReachAPI = (data: Object) => {
}
/**
*
*
*
* @param data [data description]
*/
@ -66,6 +66,19 @@ export const postOrderCompleteAPI = (data: Object) => {
data,
})
}
/**
*
*
* @param data [data description]
*/
export const postOrderCompleteTmAPI = (data: Object) => {
return http<PageResult>({
method: 'POST',
url: `/recycle-order/complete-tm`,
data,
})
}
/**
*
*

@ -105,11 +105,6 @@ export const http = <T>(options: UniApp.RequestOptions) => {
// userStore.clearProfile()
uni.navigateTo({ url: '/pages/login/login' })
reject(res)
} else if (res.statusCode === 403) {
// 401错误 -> 清理用户信息,跳转到登录页
uni.navigateTo({ url: '/pages/bind/bind' })
reject(res)
resolve(res.data as Data<T>)
} else {
// 其他错误 -> 根据后端错误信息轻提示
uni.showToast({

Loading…
Cancel
Save