|
@@ -1,7 +1,7 @@
|
|
|
// pages/orders/order-detail.ts
|
|
|
import { api_userPaymentOrderDetail } from "../../api/login";
|
|
|
import { formatPrice, GRADE_ENUM } from "../../utils/util";
|
|
|
-
|
|
|
+const app = getApp<IAppOption>()
|
|
|
// 获取应用实例
|
|
|
Page({
|
|
|
/**
|
|
@@ -58,12 +58,25 @@ Page({
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- onShow() {
|
|
|
- if(this.data.orderNo) {
|
|
|
+ onTimeing() {
|
|
|
+ if (!app.globalData.isLogin) {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.onTimeing()
|
|
|
+ }, 500);
|
|
|
+ } else {
|
|
|
this.getDetail(this.onTimeout)
|
|
|
}
|
|
|
},
|
|
|
+ onShow() {
|
|
|
+ // if(this.data.orderNo) {
|
|
|
+ // this.getDetail(this.onTimeout)
|
|
|
+ // }
|
|
|
+ this.onTimeing()
|
|
|
+ },
|
|
|
async getDetail(callback?: any) {
|
|
|
+ if (!this.data.orderNo) {
|
|
|
+ return
|
|
|
+ }
|
|
|
try {
|
|
|
const { data } = await api_userPaymentOrderDetail(this.data.orderNo, {
|
|
|
version: 'V2'
|
|
@@ -98,13 +111,13 @@ Page({
|
|
|
|
|
|
const allDiscountPrice: any = formatPrice(result.originalPrice - result.paymentCashAmount)
|
|
|
const allAfterPrice: any = formatPrice(result.paymentCashAmount)
|
|
|
-
|
|
|
+
|
|
|
const goodsInfo = {
|
|
|
discountIntegerPart: allDiscountPrice.integerPart,
|
|
|
discountDecimalPart: allDiscountPrice.decimalPart,
|
|
|
paymentCashAmount: result.paymentCashAmount,
|
|
|
originalPrice: result.originalPrice,
|
|
|
- integerPart: allAfterPrice.integerPart,
|
|
|
+ integerPart: allAfterPrice.integerPart,
|
|
|
decimalPart: allAfterPrice.decimalPart,
|
|
|
orderNo: result.orderNo,
|
|
|
createTime: result.createTime,
|
|
@@ -175,10 +188,10 @@ Page({
|
|
|
wx.setClipboardData({
|
|
|
data: e.currentTarget.dataset.orderno,
|
|
|
success: () => {
|
|
|
- wx.showToast({title: '复制成功', icon: 'none'})
|
|
|
+ wx.showToast({ title: '复制成功', icon: 'none' })
|
|
|
},
|
|
|
fail: () => {
|
|
|
- wx.showToast({title: '复制失败,请稍后再试', icon: 'none'})
|
|
|
+ wx.showToast({ title: '复制失败,请稍后再试', icon: 'none' })
|
|
|
}
|
|
|
})
|
|
|
},
|