fix
This commit is contained in:
140
pages/order/detail.vue
Executable file → Normal file
140
pages/order/detail.vue
Executable file → Normal file
@@ -16,7 +16,8 @@
|
||||
<image class="image" src="/static/order/status/wait_deliver.png" mode="aspectFit"></image>
|
||||
</block> -->
|
||||
<!-- 待收货 -->
|
||||
<block v-else-if="order.payStatus == 20 && order.deliveryStatus <= 20 && order.receiptStatus == 10">
|
||||
<block
|
||||
v-else-if="order.payStatus == 20 && order.deliveryStatus <= 20 && order.receiptStatus == 10">
|
||||
<image class="image" src="/static/order/status/wait_receipt.png" mode="aspectFit"></image>
|
||||
</block>
|
||||
</block>
|
||||
@@ -34,13 +35,16 @@
|
||||
<text class="state-text" v-if="order.payStatus == 10">待支付</text>
|
||||
<block v-if="order.payStatus == 20">
|
||||
<text class="state-text" v-if="order.receiptStatus == 21">退租中</text>
|
||||
<text class="state-text" v-else-if="order.deliveryStatus <= 20 && order.receiptStatus == 10">待收货</text>
|
||||
<text class="state-text" v-else-if="order.deliveryStatus == 20 && order.receiptStatus == 20">待绑定</text>
|
||||
<text class="state-text" v-else-if="order.deliveryStatus == 40 && order.receiptStatus == 20">进行中</text>
|
||||
<text class="state-text"
|
||||
v-else-if="order.deliveryStatus <= 20 && order.receiptStatus == 10">待收货</text>
|
||||
<text class="state-text"
|
||||
v-else-if="order.deliveryStatus == 20 && order.receiptStatus == 20">待绑定</text>
|
||||
<text class="state-text"
|
||||
v-else-if="order.deliveryStatus == 40 && order.receiptStatus == 20">进行中</text>
|
||||
<text class="state-text"
|
||||
v-else-if="order.receiptStatus == 30 || ( order.equipmentGoods.equipmentCategory != 10 && order.currPeriods >= order.periods)">已完成</text>
|
||||
</block>
|
||||
|
||||
|
||||
<!-- <text>{{ order.stateText }}</text> -->
|
||||
</view>
|
||||
</view>
|
||||
@@ -222,19 +226,25 @@
|
||||
<text>{{ equipmentGoods.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="info-item" v-if="order.isFreeze==0">
|
||||
<view class="item-lable">设备押金</view>
|
||||
<view class="item-content">
|
||||
<text>+¥{{ equipmentGoods.batteryDeposit }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item" v-if="order.isFreeze==1">
|
||||
<view class="item-lable">设备押金</view>
|
||||
<view class="item-content">
|
||||
<text>芝麻分免押金</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<block v-if="equipmentGoods.equipmentCategory == '20'">
|
||||
<view class="info-item">
|
||||
<view class="item-lable">销售价格</view>
|
||||
@@ -280,12 +290,18 @@
|
||||
<text>{{ equipmentGoods.batteryRent }} 元</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="info-item" v-if="order.isFreeze==0">
|
||||
<view class="item-lable">设备押金</view>
|
||||
<view class="item-content">
|
||||
<text>{{ equipmentGoods.batteryDeposit }} 元</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item" v-else>
|
||||
<view class="item-lable">设备押金</view>
|
||||
<view class="item-content">
|
||||
<text>芝麻分免押金</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="item-lable">设备保险</view>
|
||||
<view class="item-content">
|
||||
@@ -315,12 +331,18 @@
|
||||
<text>{{ equipmentGoods.batteryRent }} 元</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="info-item" v-if="order.isFreeze==0">
|
||||
<view class="item-lable">设备押金</view>
|
||||
<view class="item-content">
|
||||
<text>{{ equipmentGoods.batteryDeposit }} 元</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item" v-if="order.isFreeze==1">
|
||||
<view class="item-lable">设备押金</view>
|
||||
<view class="item-content">
|
||||
<text>芝麻分免押金</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="item-lable">设备保险</view>
|
||||
<view class="item-content">
|
||||
@@ -342,7 +364,7 @@
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view v-if="equipmentGoods.equipmentCategory != '10'" class="renew-divider">-- 缴费记录 --</view>
|
||||
<view class="renew-order" v-if="renewOrderList.length > 0 && equipmentGoods.equipmentCategory != '10' ">
|
||||
<!-- 首付 -->
|
||||
@@ -508,26 +530,34 @@
|
||||
v-if="equipmentGoods.equipmentCategory != '10' && order.receiptStatus == 21 && !orderEnd">取消退租
|
||||
</view>
|
||||
</block> -->
|
||||
|
||||
|
||||
<block v-if="order.payStatus == PayStatusEnum.SUCCESS.value">
|
||||
<view class="btn-item" v-if="order.deliveryStatus <= 20 && order.receiptStatus == 10" @click="onReceipt(order.orderId)">确认收货</view>
|
||||
<view class="btn-item" v-else-if="order.orderStatus == 30 && order.deliveryStatus == 20 && order.receiptStatus == 20" @click="onBind(order)">绑定设备</view>
|
||||
|
||||
<view class="btn-item" v-if="order.deliveryStatus <= 20 && order.receiptStatus == 10"
|
||||
@click="onReceipt(order.orderId)">确认收货</view>
|
||||
<view class="btn-item"
|
||||
v-else-if="order.orderStatus == 30 && order.deliveryStatus == 20 && order.receiptStatus == 20"
|
||||
@click="onBind(order)">绑定设备</view>
|
||||
|
||||
<view class="btn-item" @click="handleRentingOut(order)"
|
||||
v-if="order.equipmentGoods.equipmentCategory != '10' && order.receiptStatus != 21 && order.receiptStatus != 30">我要退租</view>
|
||||
v-if="order.equipmentGoods.equipmentCategory != '10' && order.receiptStatus != 21 && order.receiptStatus != 30">
|
||||
我要退租</view>
|
||||
<view class="btn-item" @click="handleRentingOutCancel(order)"
|
||||
v-if="order.equipmentGoods.equipmentCategory != '10' && order.receiptStatus == 21 && !orderEnd">取消退租</view>
|
||||
|
||||
v-if="order.equipmentGoods.equipmentCategory != '10' && order.receiptStatus == 21 && !orderEnd">
|
||||
取消退租</view>
|
||||
|
||||
<view class="btn-item" @click="handleHireEquipment(order.orderId)"
|
||||
v-if="order.equipmentGoods.equipmentCategory != '10' && order.receiptStatus != 30 && order.receiptStatus != 21 && !orderEnd && order.orderId >= 28804 && order.deliveryStatus == 40">我要续费</view>
|
||||
|
||||
v-if="order.equipmentGoods.equipmentCategory != '10' && order.receiptStatus != 30 && order.receiptStatus != 21 && !orderEnd && order.orderId >= 28804 && order.deliveryStatus == 40">
|
||||
我要续费</view>
|
||||
|
||||
<block v-if="order.orderStatus == OrderStatusEnum.COMPLETED.value && order.isComment == 0">
|
||||
<view class="btn-item" v-if="order.equipmentGoods.equipmentCategory == '40' && order.deliveryStatus == DeliveryStatusEnum.ACCEPT.value"
|
||||
<view class="btn-item"
|
||||
v-if="order.equipmentGoods.equipmentCategory == '40' && order.deliveryStatus == DeliveryStatusEnum.ACCEPT.value"
|
||||
@click="handleChangeEquipment(order.orderId,order.equipment.equipmentId)">换电</view>
|
||||
<!-- <view class="btn-item" v-if="item.equipmentGoods.equipmentCategory == '锂电池租赁' || item.equipmentGoods.equipmentCategory == '电动车租赁'" @click="handleTargetDetail(item.orderId)">续费</view> -->
|
||||
</block>
|
||||
|
||||
</block>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -541,8 +571,9 @@
|
||||
</view>
|
||||
</u-popup>
|
||||
<!-- 更换设备码 -->
|
||||
<u-popup v-model="showQRCodeChange" mode="center" border-radius="26" :closeable="true">
|
||||
<u-popup v-model="showQRCodeChange" mode="center" border-radius="10" :closeable="true">
|
||||
<view class="qrcode-bind">
|
||||
|
||||
<view class="title">请输入更换的新电池编号</view>
|
||||
<view class="bind-content">
|
||||
<input v-model="bindValue" class="input" @confirm="onSearch" focus="true" placeholder="请输入设备编号"
|
||||
@@ -551,6 +582,7 @@
|
||||
<view class="submit">
|
||||
<u-button type="error" @click="doEquipment(true)">确定更换电池</u-button>
|
||||
</view>
|
||||
<view class="scan" @click="scan"><u-icon name="scan" color="#cecece" size="28"></u-icon>扫码</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<!-- 绑定设备码 -->
|
||||
@@ -675,7 +707,21 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
scan() {
|
||||
const app = this
|
||||
|
||||
my.ap.openAlipayApp({
|
||||
appCode: 'alipayScan',
|
||||
success: res => {
|
||||
console.log('openAlipayApp success', res);
|
||||
},
|
||||
fail: err => {
|
||||
console.log('openAlipayApp fail', err);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
// 获取当前订单信息
|
||||
getOrderDetail(canReset = false) {
|
||||
const app = this
|
||||
@@ -891,44 +937,44 @@
|
||||
})
|
||||
|
||||
}, */
|
||||
|
||||
|
||||
// 点击去支付
|
||||
onPay(orderId) {
|
||||
const app = this
|
||||
OrderApi.getOrderPayByOrderId(orderId).then(res => {
|
||||
if(res.data.isRenew == 0 && res.data.hasFreeze == 0){
|
||||
if (res.data.isRenew == 0 && res.data.hasFreeze == 0) {
|
||||
if (res.data.equipmentCategory != 10 && res.data.orderStr) {
|
||||
my.tradePay({
|
||||
orderStr: res.data.orderStr, // 完整的支付参数拼接成的字符串,从服务端获取
|
||||
success: (res) => {
|
||||
|
||||
|
||||
},
|
||||
fail: (res) => {
|
||||
|
||||
|
||||
},
|
||||
complete: () => {
|
||||
OrderApi.checkFreeze(orderId).then((res) => {
|
||||
if(res.code == 0){
|
||||
if (res.code == 0) {
|
||||
// app.$success("下单成功")
|
||||
setTimeout(() => {
|
||||
// uni.redirectTo({
|
||||
// url: '/pages/order/index'
|
||||
// })
|
||||
this.$navTo('pages/checkout/cashier/index', {
|
||||
orderId: res.data.id
|
||||
})
|
||||
this.$navTo(
|
||||
'pages/checkout/cashier/index', {
|
||||
orderId: res.data.id
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
app.$error(res.errMsg)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
OrderApi.checkFreeze(orderId).then((r) => {
|
||||
if(r.code == 0){
|
||||
if (r.code == 0) {
|
||||
app.$success("下单成功")
|
||||
setTimeout(() => {
|
||||
// uni.redirectTo({
|
||||
@@ -938,19 +984,18 @@
|
||||
orderId: r.data.id
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
app.$error(r.errMsg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
this.$navTo('pages/checkout/cashier/index', {
|
||||
orderId: res.data.id
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
@@ -1008,7 +1053,7 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 跳转到设备详情页
|
||||
handleTargetEquipment(equipmentId) {
|
||||
this.$navTo('pages/user/equipment/index', {
|
||||
@@ -1021,7 +1066,7 @@
|
||||
orderId: res.data.id
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
// 订单提交成功后回调
|
||||
onSubmitCallback(result) {
|
||||
@@ -1070,7 +1115,7 @@
|
||||
const app = this
|
||||
app.showQRCodeChange = true
|
||||
},
|
||||
|
||||
|
||||
// 绑定设备页面
|
||||
onBind(item) {
|
||||
const app = this
|
||||
@@ -1140,6 +1185,17 @@
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 106rpx + 6rpx);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.scan {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 30rpx;
|
||||
font-size: 24rpx;
|
||||
color: #cecece;
|
||||
}
|
||||
|
||||
// 页面顶部
|
||||
.header {
|
||||
display: flex;
|
||||
@@ -1594,7 +1650,7 @@
|
||||
// 弹出层 - 绑定设备码
|
||||
.qrcode-bind {
|
||||
width: 550rpx;
|
||||
height: 300rpx;
|
||||
|
||||
padding: 36rpx 30rpx;
|
||||
|
||||
.title {
|
||||
|
||||
Reference in New Issue
Block a user