Files
JMApp/pages/washCodeDetail/washCodeDetail.js
XiaoMo d098203c87 refactor: 统一API路径前缀并更新静态资源域名
- 将所有API路径从'/v2/miniprogram'统一为'/miniprogram'
- 更新静态资源域名从'http://jm.v0750.com'到'https://jm-static.v0750.com'
- 在utils/login.js中设置统一的baseUrl为'https://t-jm.v0750.com/v3'
- 移除不再使用的initial_url和baseUrl配置项
2025-12-15 23:27:34 +08:00

70 lines
2.4 KiB
JavaScript

var e = getApp(), i = require("../../utils/login.js"), t = require("../../utils/common.js");
Page({
data: {
showLoding: !0,
info: {},
id: ""
},
onLoad: function (t) {
var o = this;
wx.showLoading({
title: ""
}), this.setData({
id: t.id || 0
}), i.pageStart(e).then(function (e) {
o.getList();
});
},
getList: function () {
var o = this;
wx.showLoading({
title: ""
}), i.request('/miniprogram/coupons/details', {
id: this.data.id
}, !0).then(function (e) {
if (wx.hideLoading(), 200 != e.code) return wx.showModal({
title: "提示",
content: e.message
}), !1;
e.data.starttime = t.changeTimeyear(new Date(1e3 * e.data.starttime)), e.data.deadline = t.changeTimeyear(new Date(1e3 * e.data.deadline)),
o.setData({
info: e.data,
showLoding: !1
}, function () { });
}).catch(function (e) {
wx.hideLoading();
});
},
isSubmit: !1,
received: function () {
if (this.isSubmit) return !1;
var t = this;
this.isSubmit = !0, wx.showLoading(), console.log("received"), i.request('/miniprogram/coupons/receive', {
id: t.data.id,
token: t.data.info.token
}, !0).then(function (e) {
console.log("receiveddqta", e), wx.hideLoading(), t.isSubmit = !1, console.log("recief"),
wx.showModal({
title: "提示",
content: e.message,
success: function (e) {
e.confirm && wx.redirectTo({
url: "/pages/index/index"
});
}
});
}).catch(function (e) {
wx.hideLoading(), t.isSubmit = !1, console.log("提示提示提示提示", e), 201 == e.code && wx.showModal({
title: "提示",
content: e.message,
success: function (e) {
if (!e.confirm) return console.log("弹窗取消"), !1;
wx.redirectTo({
url: "/pages/index/index"
});
}
});
});
}
});