订单管理更新

This commit is contained in:
2024-10-10 16:23:17 +08:00
parent 0632e395ce
commit 9c0a4e704f
4 changed files with 159 additions and 74 deletions

View File

@@ -28,7 +28,7 @@
v-if="discount.price&&discount.currentPrice!=order.amount">
<view>服务员改价</view>
<view class=" u-flex u-col-center">
<text style="color: rgb(255, 95, 46);">-{{order.amount- discount.currentPrice}}</text>
<text style="color: rgb(255, 95, 46);">-{{to2(order.amount- discount.currentPrice)}}</text>
</view>
</view>
</view>
@@ -132,7 +132,12 @@
clearInterval(timer)
timer = null
}
function to2(n){
if(!n){
return ''
}
return n.toFixed(2)
}
const pays = reactive({
list: ['扫码收款', '二维码收款'],
selIndex: 0,
@@ -179,6 +184,7 @@
function editDiscountConfirm(form) {
console.log(form);
Object.assign(discount, form)
getPayUrl()
}
async function getPayType() {
const payTypeList = await Api.$getPayType()
@@ -196,6 +202,7 @@
infoBox.showToast('支付成功')
setTimeout(() => {
// uni.$emit('orderDetail:update')
uni.$emit('update:createOrderIndex')
uni.navigateBack({
delta: 2
})
@@ -270,13 +277,17 @@
async function init() {
const res = await orderApi.tbOrderInfoDetail(order.orderId)
Object.assign(order, res)
getPayUrl()
}
onLoad(async(opt) => {
function getPayUrl(){
orderApi.$getOrderPayUrl({
orderId: opt.orderId
orderId: order.id,
payAmount:discount.currentPrice?discount.currentPrice:order.amount
}).then(res => {
payCodeUrl.value = res
})
}
onLoad(async(opt) => {
console.log(opt);
Object.assign(order, opt)
const payTypeList = await Api.$getPayType()