1
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
<script>
|
||||
import {
|
||||
uploadFile
|
||||
} from '@/websoft/api/upload.js'
|
||||
} from '@/api/upload'
|
||||
import {
|
||||
pageOrder,
|
||||
removeOrder,
|
||||
@@ -66,6 +66,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {},
|
||||
order: {},
|
||||
orderSourceData: [],
|
||||
// 按钮禁用
|
||||
@@ -130,13 +131,14 @@
|
||||
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
||||
success(chooseImageRes) {
|
||||
const tempFilePaths = chooseImageRes.tempFilePaths;
|
||||
|
||||
uploadFile({
|
||||
filePath: tempFilePaths[0],
|
||||
fileType: 'image',
|
||||
name: 'file'
|
||||
}).then(res => {
|
||||
console.log("res: ", res);
|
||||
app.orderSourceData.push(fileUrl + res.data.path)
|
||||
app.orderSourceData.push(res.data.url)
|
||||
receiptOrder({
|
||||
orderId,
|
||||
orderSourceData: JSON.stringify(app.orderSourceData)
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
</block>
|
||||
</view>
|
||||
<view class="status-text">
|
||||
<text class="state-text" v-if="order.payStatus == 10">待支付</text>
|
||||
<text class="state-text" v-if="order.payStatus == 20 && order.receiptStatus == 10">待绑定</text>
|
||||
<text class="state-text" v-if="order.orderStatus == OrderStatusEnum.COMPLETED.value && order.receiptStatus == 20">已完成</text>
|
||||
<text class="state-text" v-if="order.receiptStatus == 21">退租中</text>
|
||||
<text class="state-text" v-if="order.receiptStatus == 30">已退租</text>
|
||||
<text class="state-text" v-if="order.payStatus == 20 && (order.receiptStatus == 30 || order.currPeriods >= order.periods)">已完成</text>
|
||||
<text class="state-text" v-else-if="order.payStatus == 10">待支付</text>
|
||||
<text class="state-text" v-else-if="order.payStatus == 20 && order.receiptStatus == 10">待绑定</text>
|
||||
<text class="state-text" v-else-if="order.orderStatus == 30 && order.receiptStatus == 20">进行中</text>
|
||||
<text class="state-text" v-else-if="order.receiptStatus == 21">进行中</text>
|
||||
<!-- <text>{{ order.stateText }}</text> -->
|
||||
</view>
|
||||
</view>
|
||||
@@ -215,6 +215,12 @@
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class="info-item">
|
||||
<view class="item-lable">可用天数</view>
|
||||
<view class="item-content">
|
||||
<text>{{ Math.abs(order.expirationDay) }}天</text>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="equipmentGoods.equipmentCategory == '40'">
|
||||
<view class="info-item">
|
||||
<view class="item-lable">下单方式</view>
|
||||
@@ -369,10 +375,11 @@
|
||||
|
||||
<!-- 续费订单 -->
|
||||
<view class="trade-info i-card">
|
||||
<view class="info-item" v-if="equipmentGoods.equipmentCategory != '40'">
|
||||
<view class="info-item" v-if="order.orderSource != 10">
|
||||
<view class="item-lable">当前期数</view>
|
||||
<view class="item-content">
|
||||
<text>第 {{ renewOrderList.length + 1 }} 期</text>
|
||||
<text v-if="order.orderSource == 20">首期</text>
|
||||
<text v-else>第 1 期</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
@@ -411,6 +418,10 @@
|
||||
<text>+¥{{ orderPrice3 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="item-lable">付款时间</view>
|
||||
<view class="item-content">{{ order.payTime }}</view>
|
||||
</view>
|
||||
<view class="info-item"
|
||||
v-if="order.orderStatus == OrderStatusEnum.COMPLETED.value && equipmentGoods.equipmentCategory != '10'">
|
||||
<view class="item-lable">到期时间</view>
|
||||
@@ -420,12 +431,7 @@
|
||||
{{ Math.abs(order.expirationDay) }}天)</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="item-lable">可用天数</view>
|
||||
<view class="item-content">
|
||||
<text>{{ Math.abs(order.expirationDay) }}天</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- <view v-if="order.updatePrice.value != '0.00'" class="info-item">
|
||||
<view class="item-lable">后台改价</view>
|
||||
@@ -443,10 +449,10 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="renew-divider">-- 历史订单 --</view>
|
||||
<view class="renew-divider">-- 续费订单 --</view>
|
||||
<view class="renew-order" v-if="renewOrderList.length > 0 && equipmentGoods.equipmentCategory != '10' ">
|
||||
<!-- 首付 -->
|
||||
<!-- <view class="trade-info i-card " v-for="(item,index) in renewOrderList" :key="index" v-if="index == 0">
|
||||
<!-- 首付 -->
|
||||
<!-- <view class="trade-info i-card " v-for="(item,index) in renewOrderList" :key="index" v-if="index == 0">
|
||||
<view class="info-item" v-if="equipmentGoods.equipmentCategory != '40'">
|
||||
<view class="item-lable">期数</view>
|
||||
<view class="item-content">
|
||||
@@ -485,10 +491,11 @@
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="trade-info i-card " v-for="(item,index) in renewOrderList" :key="index">
|
||||
<view class="info-item" v-if="equipmentGoods.equipmentCategory != '40'">
|
||||
<view class="item-lable">期数</view>
|
||||
<view class="info-item" v-if="order.orderSource != 10">
|
||||
<view class="item-lable">当前期数</view>
|
||||
<view class="item-content">
|
||||
<text>第 {{ index + 1 }} 期</text>
|
||||
<text v-if="order.orderSource == 20">第 {{ index + 1}} 期</text>
|
||||
<text v-else>第 {{ index + 2}} 期</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
@@ -546,8 +553,8 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -557,7 +564,7 @@
|
||||
<view class="btn-wrapper">
|
||||
<!-- 未支付取消订单 -->
|
||||
<block v-if="order.payStatus == PayStatusEnum.PENDING.value">
|
||||
<view class="btn-item" @click="onCancel(order.orderId)">取消</view>
|
||||
<view class="btn-item" @click="onCancel(order.orderId)">取消订单</view>
|
||||
</block>
|
||||
<!-- 已支付进行中的订单 -->
|
||||
<block v-if="order.orderStatus != OrderStatusEnum.APPLY_CANCEL.value">
|
||||
@@ -586,14 +593,16 @@
|
||||
<view class="btn-item active" @click="onReceipt(order.orderId)">确认收货</view>
|
||||
</block>
|
||||
<!-- 订单评价 -->
|
||||
<block v-if="order.orderStatus == OrderStatusEnum.COMPLETED.value && order.isComment == 0 && order.receiptStatus != 30">
|
||||
<block
|
||||
v-if="order.orderStatus == OrderStatusEnum.COMPLETED.value && order.isComment == 0 && order.receiptStatus != 30">
|
||||
<view class="btn-item" @click="handleTargetEquipment(order.equipmentId)">查看电池</view>
|
||||
<view class="btn-item" @click="handleHireEquipment(order.orderId)"
|
||||
v-if="equipmentGoods.equipmentCategory != '10' && !orderEnd">我要续费</view>
|
||||
<view class="btn-item" @click="handleRentingOut(order)"
|
||||
v-if="equipmentGoods.equipmentCategory != '10' && order.receiptStatus != 21">我要退租</view>
|
||||
<view class="btn-item" @click="handleRentingOut(order)"
|
||||
v-if="equipmentGoods.equipmentCategory != '10' && order.receiptStatus == 21 && !orderEnd">取消退租</view>
|
||||
v-if="equipmentGoods.equipmentCategory != '10' && order.receiptStatus == 21 && !orderEnd">取消退租
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
@@ -710,8 +719,7 @@
|
||||
}) {
|
||||
// 当前订单ID
|
||||
this.orderId = orderId
|
||||
// 获取当前订单信息
|
||||
this.getOrderDetail()
|
||||
|
||||
// 注册全局事件订阅: 是否刷新当前订单数据
|
||||
uni.$on('syncRefreshOrder', (val, isCur) => {
|
||||
if (!isCur) {
|
||||
@@ -724,7 +732,7 @@
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
this.canReset && this.getOrderDetail()
|
||||
this.getOrderDetail()
|
||||
this.canReset = false
|
||||
},
|
||||
|
||||
@@ -744,7 +752,7 @@
|
||||
if (result.data.equipment) {
|
||||
app.equipmentId = result.data.equipment.equipmentId
|
||||
}
|
||||
|
||||
|
||||
// 项目显示
|
||||
app.priceTitle1 = null
|
||||
app.priceTitle2 = null
|
||||
@@ -808,8 +816,12 @@
|
||||
})
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
res.data.sort((a,b) => {
|
||||
return new Date(a.createTime.replace(/-/gi, '/')) - new Date(b.createTime.replace(/-/gi, '/'))
|
||||
})
|
||||
app.renewOrderList = res.data;
|
||||
if(res.data.length >= app.equipmentGoods.periods){
|
||||
if (res.data.length >= app.equipmentGoods.periods && (this.order.orderSource == 20 || this
|
||||
.order.orderSource == 30)) {
|
||||
app.orderEnd = true
|
||||
}
|
||||
// 计算逾期
|
||||
@@ -942,17 +954,33 @@
|
||||
orderId
|
||||
})
|
||||
},
|
||||
handleRentingOut(order){
|
||||
const { orderId,equipmentId } = order
|
||||
EquipmentApi.rentingOut({orderId,equipmentId}).then(res => {
|
||||
this.$success(res.message)
|
||||
setTimeout(() => {
|
||||
// 刷新当前订单数据
|
||||
app.getOrderDetail(true)
|
||||
}, 1500)
|
||||
}).catch(err => {
|
||||
this.$success(err.message)
|
||||
handleRentingOut(order) {
|
||||
const app = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否退租',
|
||||
success: (result) => {
|
||||
if(result.confirm) {
|
||||
const {
|
||||
orderId,
|
||||
equipmentId
|
||||
} = order
|
||||
EquipmentApi.rentingOut({
|
||||
orderId,
|
||||
equipmentId
|
||||
}).then(res => {
|
||||
this.$success(res.message)
|
||||
setTimeout(() => {
|
||||
// 刷新当前订单数据
|
||||
app.getOrderDetail(true)
|
||||
}, 1500)
|
||||
}).catch(err => {
|
||||
this.$success(err.message)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
// 跳转到设备详情页
|
||||
@@ -986,7 +1014,7 @@
|
||||
orderSource: order.orderSource,
|
||||
orderSourceId: order.goodsId,
|
||||
equipmentId: order.equipmentId,
|
||||
dealerPhone:order.dealerPhone,
|
||||
dealerPhone: order.dealerPhone,
|
||||
comments: '续租订单' + order.orderNo
|
||||
}).then(res => {
|
||||
const {
|
||||
@@ -1413,6 +1441,7 @@
|
||||
align-items: center;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
|
||||
.act-copy {
|
||||
margin-left: 20rpx;
|
||||
padding: 2rpx 20rpx;
|
||||
@@ -1444,7 +1473,8 @@
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
text-align: right;
|
||||
.expirat-time-box{
|
||||
|
||||
.expirat-time-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
@@ -1477,7 +1507,7 @@
|
||||
|
||||
.renew-order {
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
// 底部操作栏
|
||||
@@ -1579,9 +1609,10 @@
|
||||
color: #ff0000;
|
||||
padding-left: 10rpx
|
||||
}
|
||||
.renew-divider{
|
||||
|
||||
.renew-divider {
|
||||
padding: 30rpx 0;
|
||||
text-align: center;
|
||||
color: #666666;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -13,11 +13,12 @@
|
||||
<text class="order-time">{{ item.merchantName }}</text>
|
||||
</view>
|
||||
<view class="item-top-right">
|
||||
<text class="state-text" v-if="item.payStatus == 10">待支付</text>
|
||||
<text class="state-text" v-if="item.payStatus == 20 && item.receiptStatus == 10">待绑定</text>
|
||||
<text class="state-text" v-if="item.orderStatus == 30 && item.receiptStatus == 20">已完成</text>
|
||||
<text class="state-text" v-if="item.receiptStatus == 21">退租中</text>
|
||||
<text class="state-text" v-if="item.receiptStatus == 30">已退租</text>
|
||||
<text class="state-text" v-if="item.payStatus == 20 && (item.receiptStatus == 30 || item.currPeriods >= item.periods)">已完成</text>
|
||||
<text class="state-text" v-else-if="item.payStatus == 10">待支付</text>
|
||||
<text class="state-text" v-else-if="item.payStatus == 20 && item.receiptStatus == 10">待绑定</text>
|
||||
<text class="state-text" v-else-if="item.orderStatus == 30 && item.receiptStatus == 20">进行中</text>
|
||||
<text class="state-text" v-else-if="item.receiptStatus == 21">进行中</text>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- 商品列表 -->
|
||||
@@ -115,6 +116,12 @@
|
||||
<!-- <view class="btn-item" v-if="item.equipmentGoods.equipmentCategory == '锂电池租赁' || item.equipmentGoods.equipmentCategory == '电动车租赁'" @click="handleTargetDetail(item.orderId)">续费</view> -->
|
||||
<view class="btn-item" @click="handleTargetDetail(item.orderId)">详情</view>
|
||||
</block>
|
||||
<block
|
||||
v-if="item.orderStatus == OrderStatusEnum.COMPLETED.value && item.isComment == 0 && item.receiptStatus != 30">
|
||||
<view class="btn-item" @click="handleTargetDetail(item.orderId)"
|
||||
v-if="item.equipmentGoods.equipmentCategory != '10' && !orderEnd">我要续费 </view>
|
||||
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -181,7 +188,8 @@
|
||||
import {
|
||||
pageOrder,
|
||||
removeOrder,
|
||||
receiptOrder
|
||||
receiptOrder,
|
||||
addOrder
|
||||
} from '@/websoft/api/order.js'
|
||||
import {
|
||||
bindEquipment
|
||||
@@ -190,7 +198,9 @@
|
||||
uploadFile
|
||||
} from '@/websoft/api/upload.js'
|
||||
import { fileUrl } from '@/config.js';
|
||||
|
||||
import {
|
||||
createOrderNo,dateFormat
|
||||
} from '@/utils/util.js'
|
||||
// 每页记录数量
|
||||
const pageSize = 15
|
||||
|
||||
@@ -201,12 +211,18 @@
|
||||
}, {
|
||||
name: `待支付`,
|
||||
value: 'payment'
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: `待绑定`,
|
||||
value: 'delivery'
|
||||
}, {
|
||||
name: `已完成`,
|
||||
},
|
||||
{
|
||||
name: `进行中`,
|
||||
value: 'comment'
|
||||
},
|
||||
{
|
||||
name: `已完成`,
|
||||
value: 'refund'
|
||||
}]
|
||||
|
||||
export default {
|
||||
@@ -303,7 +319,7 @@
|
||||
app.curTab = index > -1 ? index : 0
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 上拉加载的回调 (页面初始化时也会执行一次)
|
||||
* 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10
|
||||
@@ -321,7 +337,6 @@
|
||||
// })
|
||||
// .catch(() => app.mescroll.endErr())
|
||||
},
|
||||
|
||||
// 获取订单列表
|
||||
getOrderList(pageNo = 1) {
|
||||
const app = this
|
||||
@@ -343,11 +358,11 @@
|
||||
}
|
||||
if (curTab == 3) {
|
||||
app.where.payStatus = 20;
|
||||
app.where.receiptStatus = 20;
|
||||
app.where.orderStatus = 30;
|
||||
}
|
||||
if (curTab == 4) {
|
||||
app.where.receiptStatus = 20;
|
||||
app.where.isComment = 0;
|
||||
app.where.payStatus = 20;
|
||||
app.where.orderStatus = 40;
|
||||
}
|
||||
app.where.userId = uni.getStorageSync('userId');
|
||||
app.where.isRenew = 0;
|
||||
|
||||
Reference in New Issue
Block a user