This commit is contained in:
2024-08-22 12:53:28 +08:00
commit 1d65a849fd
360 changed files with 41757 additions and 0 deletions

View File

@@ -0,0 +1,86 @@
var t = getApp();
Page({
data: {
dataType: "all",
data: []
},
onLoad: function(t) {
this.data.dataType = t.type || "all", this.setData({
dataType: this.data.dataType
});
},
onShow: function() {
this.getOrderList(this.data.dataType);
},
formatDate: function(t) {
var e = new Date(t), a = e.getFullYear(), r = e.getMonth() + 1;
r = r < 10 ? "0" + r : r;
var d = e.getDate();
d = d < 10 ? "0" + d : d;
var o = e.getHours();
o = o < 10 ? "0" + o : o;
var n = e.getMinutes(), i = e.getSeconds();
return a + "-" + r + "-" + d + " " + o + ":" + (n = n < 10 ? "0" + n : n) + ":" + (i = i < 10 ? "0" + i : i);
},
getOrderList: function(e) {
var a = this;
t._get("user.order_goods/getOrderGoodsList", {
dataType: e
}, function(t) {
t.data.length && wx.pageScrollTo({
scrollTop: 0
});
for (var e = 0; e < t.data.length; e++) t.data[e].aftermarket_apply_date = a.formatDate(1e3 * t.data[e].aftermarket_apply_time);
a.setData(t);
});
},
bindHeaderTap: function(t) {
this.setData({
dataType: t.target.dataset.type
}), this.getOrderList(t.target.dataset.type);
},
cancelOrder: function(e) {
var a = this, r = e.currentTarget.dataset.id;
wx.showModal({
title: "提示",
content: "确认取消订单?",
success: function(e) {
e.confirm && t._post_form("user.order/cancel", {
order_id: r
}, function(t) {
a.getOrderList(a.data.dataType);
});
}
});
},
receipt: function(e) {
var a = this, r = e.currentTarget.dataset.id;
wx.showModal({
title: "提示",
content: "确认收到商品?",
success: function(e) {
e.confirm && t._post_form("user.order/receipt", {
order_id: r
}, function(t) {
a.getOrderList(a.data.dataType);
});
}
});
},
detail: function(t) {
var e = t.currentTarget.dataset.id;
wx.navigateTo({
url: "../aftermarket/create?order_goods_id=" + e
});
},
orderDetail: function(t) {
var e = t.currentTarget.dataset.id;
wx.navigateTo({
url: "../order/detail?order_id=" + e
});
},
onPullDownRefresh: function() {
wx.stopPullDownRefresh();
}
});