乱七八糟

This commit is contained in:
weicw
2023-10-23 15:21:33 +08:00
parent 0256bd355d
commit 686c1ae304
29 changed files with 2571 additions and 294 deletions

View File

@@ -116,7 +116,20 @@
// 表单提交
handleSubmit() {
const app = this
this.$navTo('pages/order/index')
const { orderId,orderSourceData } = app
if(orderSourceData.length < 5) {
return
}
receiptOrder({
orderId,
orderSourceData: JSON.stringify(orderSourceData)
}).then(result => {
app.$success("上传成功")
uni.navigateBack()
}).catch(err => {
app.$toast(err.message)
})
},
// 上传图片
@@ -139,14 +152,7 @@
}).then(res => {
console.log("res: ", res);
app.orderSourceData.push(res.data.url)
receiptOrder({
orderId,
orderSourceData: JSON.stringify(app.orderSourceData)
}).then(result => {
app.$success("上传成功")
// 刷新订单列表
app.getData()
})
})
}

View File

@@ -21,7 +21,7 @@
</block>
</block>
<!-- 已完成 -->
<block v-if="order.orderStatus == OrderStatusEnum.COMPLETED.value">
<block v-if="order.orderStatus == 40">
<image class="image" src="/static/order/status/received.png" mode="aspectFit"></image>
</block>
<!-- 已取消/待取消 -->
@@ -31,7 +31,8 @@
</block>
</view>
<view class="status-text">
<text class="state-text" v-if="order.payStatus == 20 && (order.receiptStatus == 30 || order.currPeriods >= order.periods)">已完成</text>
<text class="state-text"
v-if="order.payStatus == 20 && (order.receiptStatus == 30 || ( order.equipmentGoods.equipmentCategory != 10 && 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>
@@ -199,36 +200,6 @@
</view>
</view>
</block>
<block v-if="equipmentGoods.equipmentCategory == '20'">
<view class="info-item">
<view class="item-lable">下单方式</view>
<view class="item-content">
<text>分期</text>
</view>
</view>
</block>
<block v-if="equipmentGoods.equipmentCategory == '30'">
<view class="info-item">
<view class="item-lable">下单方式</view>
<view class="item-content">
<text>已租代购</text>
</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>
<view class="item-content">
<text>租赁</text>
</view>
</view>
</block>
<view class="info-item">
<view class="item-lable">所属门店</view>
<view class="item-content">
@@ -247,25 +218,19 @@
<text>{{ equipment.batteryModel }}</text>
</view>
</view>
<view class="info-item">
<view class="item-lable">订单金额</view>
<view class="item-content">
<text>¥{{ order.totalPrice }} 元</text>
</view>
</view>
<!-- <view class="info-item">
<view class="item-lable">商品编号</view>
<view class="info-item">
<view class="item-lable">设备押金</view>
<view class="item-content">
<text>{{ equipmentGoods.goodsId }}</text>
<text>+¥{{ equipmentGoods.batteryDeposit }}</text>
</view>
</view> -->
<!-- <view class="info-item" v-if="order.orderStatus == OrderStatusEnum.COMPLETED.value">
<view class="item-lable">到期时间</view>
<view class="item-content">
<text>{{ order.expirationTime }}</text>
</view>
</view> -->
</view>
<block v-if="equipmentGoods.equipmentCategory == '20'">
<view class="info-item">
<view class="item-lable">销售价格</view>
@@ -373,83 +338,8 @@
</view>
</view>
<!-- 续费订单 -->
<view class="trade-info i-card">
<view class="info-item" v-if="order.orderSource != 10">
<view class="item-lable">当前期数</view>
<view class="item-content">
<text v-if="order.orderSource == 20">首期</text>
<text v-else>第 1 期</text>
</view>
</view>
<view class="info-item">
<view class="item-lable">订单金额</view>
<view class="item-content">
<text>¥{{ orderPrice }}</text>
</view>
</view>
<view v-if="order.couponMoney > 0" class="info-item">
<view class="item-lable">优惠券抵扣</view>
<view class="item-content">
<text>-¥{{ order.couponMoney }}</text>
</view>
</view>
<view v-if="order.pointsMoney > 0" class="info-item">
<view class="item-lable">{{ setting.pointsName }}抵扣</view>
<view class="item-content">
<text>-¥{{ order.pointsMoney }}</text>
</view>
</view>
<view class="info-item" v-if="priceTitle1">
<view class="item-lable">{{ priceTitle1 }}</view>
<view class="item-content">
<text>+¥{{ orderPrice1 }}</text>
</view>
</view>
<view class="info-item" v-if="priceTitle2">
<view class="item-lable">{{ priceTitle2 }}</view>
<view class="item-content">
<text>+¥{{ orderPrice2 }}</text>
</view>
</view>
<view class="info-item" v-if="priceTitle3">
<view class="item-lable">{{ priceTitle3 }}</view>
<view class="item-content">
<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>
<view class="item-content">
<text>{{ order.expirationTime }}</text>
<text class="yuqi-text" v-if="order.expirationDay < 0">(已逾期
{{ Math.abs(order.expirationDay) }}天)</text>
</view>
</view>
<!-- <view v-if="order.updatePrice.value != '0.00'" class="info-item">
<view class="item-lable">后台改价</view>
<view class="item-content">
<text>{{ order.updatePrice.symbol }}</text>
<text>¥{{ order.updatePrice.value }}</text>
</view>
</view> -->
<view class="divider"></view>
<view class="trade-total">
<text class="lable" alt="续费金额">{{ freeTitle }}</text>
<view class="goods-price">
<text class="unit">¥</text>
<text class="value">{{ orderPrice }}</text>
</view>
</view>
</view>
<view class="renew-divider">-- 续费订单 --</view>
<view v-if="equipmentGoods.equipmentCategory != '10'" 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">
@@ -494,8 +384,9 @@
<view class="info-item" v-if="order.orderSource != 10">
<view class="item-lable">当前期数</view>
<view class="item-content">
<text v-if="order.orderSource == 20">第 {{ index + 1}} 期</text>
<text v-else>第 {{ index + 2}} 期</text>
<text v-if="order.orderSource == 20 && index == 0">首期</text>
<text v-if="order.orderSource == 20 && index != 0">第 {{index}} 期</text>
<text v-if="order.orderSource == 30 || order.orderSource == 40">第 {{ index + 1}} 期</text>
</view>
</view>
<view class="info-item">
@@ -534,6 +425,10 @@
<text>+¥{{ orderPrice3 }}</text>
</view>
</view>
<view class="info-item">
<view class="item-lable">付款状态</view>
<view class="item-content">{{ item.payStatus == 20 ? '已支付': '未支付' }}</view>
</view>
<view class="info-item">
<view class="item-lable">付款时间</view>
<view class="item-content">{{ item.payTime }}</view>
@@ -547,9 +442,9 @@
</view>
</view>
</view>
<view class="info-item" v-if="item.expirationDay < 0">
<view class="info-item" v-if="item.expirationDay > 0">
<view class="item-lable">逾期天数</view>
<view class="item-content"><text class="yuqi-text">{{ Math.abs(item.expirationDay) }}天</text>
<view class="item-content"><text class="yuqi-text">{{ item.expirationDay }}天</text>
</view>
</view>
</view>
@@ -588,10 +483,10 @@
<view class="btn-item active" @click="onPay(order.orderId)">去支付</view>
</block>
<!-- 确认收货 -->
<block
v-if="order.deliveryStatus == DeliveryStatusEnum.DELIVERED.value && order.receiptStatus == ReceiptStatusEnum.NOT_RECEIVED.value">
<view class="btn-item active" @click="onReceipt(order.orderId)">确认收货</view>
</block>
<!-- <block
v-if="order.payStatus == 20 && order.receiptStatus == 10">
<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">
@@ -810,14 +705,14 @@
const {
orderId
} = app.order
listOrder({
OrderApi.getOrderPayList({
rentOrderId: orderId,
payStatus: 20
})
.then(res => {
console.log(res);
res.data.sort((a,b) => {
return new Date(a.createTime.replace(/-/gi, '/')) - new Date(b.createTime.replace(/-/gi, '/'))
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 && (this.order.orderSource == 20 || this
@@ -943,9 +838,12 @@
// 点击去支付
onPay(orderId) {
this.$navTo('pages/checkout/cashier/index', {
orderId
OrderApi.getOrderPayByOrderId(orderId).then(res => {
this.$navTo('pages/checkout/cashier/index', {
orderId: res.data.id
})
})
},
// 跳转到订单评价页
@@ -960,7 +858,7 @@
title: '提示',
content: '是否退租',
success: (result) => {
if(result.confirm) {
if (result.confirm) {
const {
orderId,
equipmentId
@@ -980,7 +878,7 @@
}
}
})
},
// 跳转到设备详情页
@@ -990,51 +888,12 @@
})
},
handleHireEquipment(orderId) {
const app = this
const {
order
} = this
const orderNo = createOrderNo()
var time = new Date().getTime() + 60 * 60 * 1000 * 24
const expirationTime = dateFormat('YYYY-mm-dd HH:MM:SS', new Date(time))
addOrder({
orderNo: createOrderNo(),
merchantCode: order.merchantCode,
goodsId: app.goodsId,
totalPrice: app.orderPrice,
orderPrice: app.orderPrice,
payPrice: app.orderPrice,
month: app.month,
expirationTime,
isRenew: 1,
rentOrderId: orderId,
batteryRent: order.batteryRent,
batteryDeposit: order.batteryDeposit,
batteryInsurance: order.batteryInsurance,
orderSource: order.orderSource,
orderSourceId: order.goodsId,
equipmentId: order.equipmentId,
dealerPhone: order.dealerPhone,
comments: '续租订单' + order.orderNo
}).then(res => {
const {
orderId
} = res.data
app.$success("下单成功")
setTimeout(() => {
this.$navTo('pages/checkout/cashier/index', {
orderId
})
}, 100)
OrderApi.getOrderPayByOrderId(orderId).then(res => {
this.$navTo('pages/checkout/cashier/index', {
orderId: res.data.id
})
})
// alipayReLet({
// orderId,
// orderNo,
// tenantId,
// payPrice: 0.01,
// merchantName: app.order.merchantName,
// userId: app.order.userId
// }).then(result => app.onSubmitCallback(result)).catch(err => app.$error(err.message))
},
// 订单提交成功后回调
onSubmitCallback(result) {

View File

@@ -13,12 +13,14 @@
<text class="order-time">{{ item.merchantName }}</text>
</view>
<view class="item-top-right">
<text class="state-text" v-if="item.payStatus == 20 && (item.receiptStatus == 30 || item.currPeriods >= item.periods)">已完成</text>
<text class="state-text" v-if="item.orderStatus == 40">已完成</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.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>
<!-- 商品列表 -->
@@ -48,8 +50,10 @@
v-if="item.orderStatus == 30">设备编号{{ item.equipment.equipmentCode }}</text>
<text class="twoline-hide">设备名称{{ item.equipmentGoods.goodsName }}</text>
<text class="twoline-hide">设备型号{{ item.equipmentGoods.batteryModel }}</text>
<text class="twoline-hide yuqi-text" v-if="item.expirationDay < 0">逾期状态: (已逾期{{ Math.abs(item.expirationDay) }})</text>
<text class="twoline-hide yuqi-text" v-if="item.expirationDay < 7 && item.expirationDay > 0">逾期状态: 即将过期</text>
<text class="twoline-hide yuqi-text" v-if="item.expirationDay < 0">逾期状态:
(已逾期{{ Math.abs(item.expirationDay) }})</text>
<text class="twoline-hide yuqi-text"
v-if="item.expirationDay < 7 && item.expirationDay > 0">逾期状态: 即将过期</text>
</view>
<view class="goods-props clearfix">
<!-- <view class="goods-props-item">
@@ -106,7 +110,9 @@
<!-- 确认收货 -->
<block
v-if="item.payStatus == PayStatusEnum.SUCCESS.value && item.deliveryStatus == DeliveryStatusEnum.NOT_DELIVERED.value && item.receiptStatus == ReceiptStatusEnum.NOT_RECEIVED.value">
<view class="btn-item active" v-if="(item.orderSourceData && JSON.parse(item.orderSourceData).length == 5) || item.equipmentGoods.equipmentCategory == '10'" @click="onBind(item)">绑定设备</view>
<view class="btn-item active"
v-if="(item.orderSourceData && JSON.parse(item.orderSourceData).length == 5) || item.equipmentGoods.equipmentCategory == '10'"
@click="onBind(item)">绑定设备</view>
<view class="btn-item active" v-else @click="chooseImage(item.orderId)">确认收货</view>
</block>
<!-- 订单评价 -->
@@ -120,7 +126,7 @@
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>
@@ -189,7 +195,8 @@
pageOrder,
removeOrder,
receiptOrder,
addOrder
addOrder,
getOrderPayByOrderId
} from '@/websoft/api/order.js'
import {
bindEquipment
@@ -197,33 +204,37 @@
import {
uploadFile
} from '@/websoft/api/upload.js'
import { fileUrl } from '@/config.js';
import {
createOrderNo,dateFormat
import {
fileUrl
} from '@/config.js';
import {
createOrderNo,
dateFormat
} from '@/utils/util.js'
// 每页记录数量
const pageSize = 15
// tab栏数据
const tabs = [{
name: `全部`,
value: 'all'
}, {
name: `待支付`,
value: 'payment'
},
{
name: `待绑定`,
value: 'delivery'
},
{
name: `进行中`,
value: 'comment'
},
{
name: `已完成`,
value: 'refund'
}]
name: `全部`,
value: 'all'
}, {
name: `待支付`,
value: 'payment'
},
{
name: `待绑定`,
value: 'delivery'
},
{
name: `进行中`,
value: 'comment'
},
{
name: `已完成`,
value: 'refund'
}
]
export default {
components: {
@@ -319,7 +330,7 @@ import {
app.curTab = index > -1 ? index : 0
}
},
/**
* 上拉加载的回调 (页面初始化时也会执行一次)
* 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10
@@ -367,20 +378,21 @@ import {
app.where.userId = uni.getStorageSync('userId');
app.where.isRenew = 0;
app.where.isApp = true;
app.where.isFreeze = 1;
pageOrder(app.where).then(res => {
app.list = res.data.list
const curPageLen = res.data.list.length
const totalSize = res.data.count
console.log("totalSize: ", totalSize);
app.mescroll.endBySize(curPageLen, totalSize)
app.list.map((d,index) => {
app.list.map((d, index) => {
const setTime = new Date(d.expirationTime);
const nowTime = new Date();
const restSec = setTime.getTime() - nowTime.getTime();
// 剩余天数
const day = parseInt(restSec / (60*60*24*1000));
console.log("逾期天数: ",Math.abs(day));
const day = parseInt(restSec / (60 * 60 * 24 * 1000));
console.log("逾期天数: ", Math.abs(day));
app.list[index].expirationDay = day
})
})
@@ -561,9 +573,14 @@ import {
// 点击去支付
onPay(orderId) {
this.$navTo('pages/checkout/cashier/index', {
orderId
getOrderPayByOrderId(orderId).then(res => {
this.$navTo('pages/checkout/cashier/index', {
orderId: res.data.id
})
})
},
// 跳转到订单详情页
@@ -821,8 +838,8 @@ import {
margin-top: 30rpx;
}
}
.yuqi-text{
.yuqi-text {
color: #ff0000;
}
</style>
</style>