|
|
@@ -40,19 +40,19 @@ getOrderDetail()
|
|
|
|
|
|
function getOrderDetail() {
|
|
|
getOrderById(props.orderId).then(res => {
|
|
|
- userId.value = res.result.userId
|
|
|
- productId.value = res.result.productId
|
|
|
- productName.value = res.result.productName
|
|
|
- amount.value = res.result.amount
|
|
|
- price.value = res.result.price
|
|
|
- paid.value = res.result.paid
|
|
|
- type.value = res.result.type
|
|
|
- content.value = res.result.content
|
|
|
- rating.value = res.result.rating
|
|
|
- status.value = res.result.status
|
|
|
- createTime.value = res.result.createTime
|
|
|
- finishTime.value = res.result.finishTime
|
|
|
- storeId.value = res.result.storeId
|
|
|
+ userId.value = res.data.result.userId
|
|
|
+ productId.value = res.data.result.productId
|
|
|
+ productName.value = res.data.result.productName
|
|
|
+ amount.value = res.data.result.amount
|
|
|
+ price.value = res.data.result.price
|
|
|
+ paid.value = res.data.result.paid
|
|
|
+ type.value = res.data.result.type
|
|
|
+ content.value = res.data.result.content
|
|
|
+ rating.value = res.data.result.rating
|
|
|
+ status.value = res.data.result.status
|
|
|
+ createTime.value = res.data.result.createTime
|
|
|
+ finishTime.value = res.data.result.finishTime
|
|
|
+ storeId.value = res.data.result.storeId
|
|
|
|
|
|
totalPrice.value = amount.value * price.value
|
|
|
discountPrice.value = totalPrice.value
|
|
|
@@ -69,7 +69,7 @@ const refreshButtonVisible = ref(false)
|
|
|
|
|
|
function handleConfirmOrder() {
|
|
|
payOrder(props.orderId, couponId.value).then(res => {
|
|
|
- if (res.code === '000') {
|
|
|
+ if (res.data.code === '000') {
|
|
|
ElMessage({
|
|
|
message: '订单提交成功!',
|
|
|
type: 'success',
|
|
|
@@ -78,11 +78,11 @@ function handleConfirmOrder() {
|
|
|
isLoading.value = true
|
|
|
refreshButtonVisible.value = true
|
|
|
const paymentWindow = window.open('', '_blank');
|
|
|
- paymentWindow.document.write(res.result);
|
|
|
+ paymentWindow.document.write(res.data.result);
|
|
|
paymentWindow.document.forms[0].submit(); // 提交表单
|
|
|
- } else if (res.code === '400') {
|
|
|
+ } else if (res.data.code === '400') {
|
|
|
ElMessage({
|
|
|
- message: res.msg,
|
|
|
+ message: res.data.msg,
|
|
|
type: 'error',
|
|
|
center: true,
|
|
|
})
|
|
|
@@ -103,16 +103,16 @@ function handlePayDialogClose() {
|
|
|
|
|
|
function handleDeliver() {
|
|
|
deliverOrder(props.orderId).then(res => {
|
|
|
- if (res.code === '000') {
|
|
|
+ if (res.data.code === '000') {
|
|
|
ElMessage({
|
|
|
message: '订单发货成功!',
|
|
|
type: 'success',
|
|
|
center: true,
|
|
|
})
|
|
|
getOrderDetail()
|
|
|
- } else if (res.code === '400') {
|
|
|
+ } else if (res.data.code === '400') {
|
|
|
ElMessage({
|
|
|
- message: res.msg,
|
|
|
+ message: res.data.msg,
|
|
|
type: 'error',
|
|
|
center: true,
|
|
|
})
|
|
|
@@ -122,16 +122,16 @@ function handleDeliver() {
|
|
|
|
|
|
function handleGet() {
|
|
|
getOrder(props.orderId).then(res => {
|
|
|
- if (res.code === '000') {
|
|
|
+ if (res.data.code === '000') {
|
|
|
ElMessage({
|
|
|
message: '订单收货成功!',
|
|
|
type: 'success',
|
|
|
center: true,
|
|
|
})
|
|
|
getOrderDetail()
|
|
|
- } else if (res.code === '400') {
|
|
|
+ } else if (res.data.code === '400') {
|
|
|
ElMessage({
|
|
|
- message: res.msg,
|
|
|
+ message: res.data.msg,
|
|
|
type: 'error',
|
|
|
center: true,
|
|
|
})
|
|
|
@@ -152,7 +152,7 @@ function handleSendComment() {
|
|
|
}
|
|
|
|
|
|
commentOrder(payload).then(res => {
|
|
|
- if (res.code === '000') {
|
|
|
+ if (res.data.code === '000') {
|
|
|
ElMessage({
|
|
|
message: '评价成功!',
|
|
|
type: 'success',
|
|
|
@@ -162,7 +162,7 @@ function handleSendComment() {
|
|
|
commentDialogVisible.value = false
|
|
|
} else {
|
|
|
ElMessage({
|
|
|
- message: res.msg,
|
|
|
+ message: res.data.msg,
|
|
|
type: 'error',
|
|
|
center: true,
|
|
|
})
|
|
|
@@ -185,7 +185,7 @@ const singleTableRef = ref<InstanceType<typeof ElTable>>()
|
|
|
|
|
|
function getAvailableCouponList() {
|
|
|
getAvailableCouponsByStoreId(storeId.value).then(res => {
|
|
|
- availableCouponList.value = res.result
|
|
|
+ availableCouponList.value = res.data.result
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -197,7 +197,7 @@ const handleCurrentChange = (val: Coupon | undefined) => {
|
|
|
}
|
|
|
currentRow.value = val
|
|
|
calculateOrder(props.orderId, couponId.value).then(res => {
|
|
|
- discountPrice.value = res.result
|
|
|
+ discountPrice.value = res.data.result
|
|
|
})
|
|
|
}
|
|
|
|