fix: 更新API端点路径至v2版本

将/miniprogram/user/onlineCarHailing和/miniprogram/user等API端点路径更新为/v2/miniprogram/user/onlineCarHailing和/v2/miniprogram/user,以适配后端API的v2版本
This commit is contained in:
XiaoMo 2025-06-24 17:46:29 +08:00
parent a3fcf0eac1
commit 678d35042a
9 changed files with 39 additions and 39 deletions

View File

@ -38,7 +38,7 @@ Page({
title: '提交中...'
})
t.request('/miniprogram/user/onlineCarHailing', { mobile }, !0).then((res) => {
t.request('/v2/miniprogram/user/onlineCarHailing', { mobile }, !0).then((res) => {
wx.hideLoading()
if (res.code == 200) {
wx.showToast({

View File

@ -7,7 +7,7 @@ Page({
code: ''
},
onLoad() {
t.request('/miniprogram/coupons', {}, !0).then((res) => {
t.request('/v2/miniprogram/coupons', {}, !0).then((res) => {
if (res.code == 200) {
this.setData({
tips: res.data.tips,
@ -23,7 +23,7 @@ Page({
success: function (i) {
console.log(i), wx.showLoading({
title: ""
}), e.globalData.qrcode = i.result, t.request("/miniprogram/identify", i, !0).then(function (t) {
}), e.globalData.qrcode = i.result, t.request("/v2/miniprogram/identify", i, !0).then(function (t) {
console.log("data", t), wx.hideLoading();
// 保存设备编号
getApp().globalData.devicecode = t.data.devicecode || getApp().globalData.devicecode;
@ -38,7 +38,7 @@ Page({
startup: function () {
if (getApp().globalData.devicecode) {
// 已扫码,启动机器
t.request('/miniprogram/machine/carwashcodestartup', { devicecode: getApp().globalData.devicecode, washcode: this.data.code }, !0).then((startRes) => {
t.request('/v2/miniprogram/machine/carwashcodestartup', { devicecode: getApp().globalData.devicecode, washcode: this.data.code }, !0).then((startRes) => {
if (startRes.code == 200) {
wx.showToast({ title: startRes.message || '启动成功', icon: 'success' });
// 跳转到洗车券列表页面
@ -73,7 +73,7 @@ Page({
wx.showLoading({
title: '兑换中...'
})
t.request('/miniprogram/coupons/importDouyin', { code: code }, !0).then((res) => {
t.request('/v2/miniprogram/coupons/importDouyin', { code: code }, !0).then((res) => {
wx.hideLoading()
if (res.code == 200) {

View File

@ -28,7 +28,7 @@ Page({
var n = Object.assign(this.userInfo, t, {
code: a
});
o.request('/miniprogram/index/authorization', n, !0).then(function(o) {
o.request('/v2/miniprogram/index/authorization', n, !0).then(function(o) {
if (wx.hideLoading(), console.log("toAuthorization", "app.globalData.needJumpUrl", e.globalData.needJumpUrl, o),
200 != o.code) return wx.showModal({
title: "提示",

View File

@ -36,7 +36,7 @@ Page({
title: '查询中...'
})
t.request('/miniprogram/Refund/query', { mobile }, !0).then((res) => {
t.request('/v2/miniprogram/Refund/query', { mobile }, !0).then((res) => {
wx.hideLoading()
if (res.code == 200) {
this.setData({
@ -70,7 +70,7 @@ Page({
})
return
}
t.request('/miniprogram/pay/refund', {token: this.data.userInfo.token}, !0).then((res) => {
t.request('/v2/miniprogram/pay/refund', {token: this.data.userInfo.token}, !0).then((res) => {
wx.hideLoading()
if (res.code == 200) {
wx.showToast({
@ -117,7 +117,7 @@ Page({
})
return
}
t.request('/miniprogram/pay/refundOffline', {token: this.data.userInfo.token}, !0).then((res) => {
t.request('/v2/miniprogram/pay/refundOffline', {token: this.data.userInfo.token}, !0).then((res) => {
wx.hideLoading()
if (res.code == 200) {
wx.showToast({

View File

@ -34,7 +34,7 @@ Page({
loading: true
});
e.request('/miniprogram/substituteWash/index', {}, true).then(function (res) {
e.request('/v2/miniprogram/substituteWash/index', {}, true).then(function (res) {
a.setData({
loading: false
});
@ -93,7 +93,7 @@ Page({
mask: true
});
e.request('/miniprogram/substituteWash/pay', {token: a.data.token}, true).then(function (res) {
e.request('/v2/miniprogram/substituteWash/pay', {token: a.data.token}, true).then(function (res) {
wx.hideLoading();
if (res.code === 200) {

View File

@ -6,22 +6,22 @@ Page({
urlList: [],
user: {}
},
onLoad: function(n) {
onLoad: function (n) {
var o = this;
e.pageStart(t).then(function(t) {
e.pageStart(t).then(function (t) {
o.getContent();
});
},
onShow: function() {
onShow: function () {
this.refresh && this.getContent();
},
onPullDownRefresh: function() {},
onShareAppMessage: function() {},
getContent: function() {
onPullDownRefresh: function () { },
onShareAppMessage: function () { },
getContent: function () {
var n = this;
wx.showLoading({
title: ""
}), e.request('/miniprogram/user', {}, !0).then(function(t) {
}), e.request('/v2/miniprogram/user', {}, !0).then(function (t) {
if (wx.hideLoading(), 200 != t.code) return wx.showModal({
title: "提示",
content: t.message
@ -30,18 +30,18 @@ Page({
showLoding: !1,
user: t.data.user,
urlList: t.data.menu
}, function() {});
}).catch(function(t) {
}, function () { });
}).catch(function (t) {
wx.hideLoading();
});
},
islogin: function() {
islogin: function () {
wx.showLoading({
title: "加载中"
});
},
refresh: 0,
toPage: function(t) {
toPage: function (t) {
var e = t.currentTarget.dataset, n = (e.refresh, e.url);
n ? wx.navigateTo({
url: "/pages/".concat(n)
@ -51,29 +51,29 @@ Page({
duration: 2e3
}), this.refresh = 1;
},
callUs: function() {
callUs: function () {
if (!t.globalData.servicetel) return !1;
wx.makePhoneCall({
phoneNumber: "" + t.globalData.servicetel
});
},
updateUserAvatar: function() {
updateUserAvatar: function () {
var that = this;
wx.chooseMedia({
count: 1,
mediaType: ['image'],
sourceType: ['album', 'camera'],
success: function(res) {
success: function (res) {
wx.uploadFile({
url: 'https://t-jm.v0750.com/miniprogram/upload',
filePath: res.tempFiles[0].tempFilePath,
name: 'file',
success: function(uploadRes) {
success: function (uploadRes) {
var data = JSON.parse(uploadRes.data);
if (data.code == 200) {
e.request('/miniprogram/user/update', {
e.request('/v2/miniprogram/user/update', {
avatar: data.data.url
}, true).then(function(res) {
}, true).then(function (res) {
if (res.code == 200) {
that.getContent();
wx.showToast({
@ -93,18 +93,18 @@ Page({
}
});
},
updateUserNickname: function() {
updateUserNickname: function () {
var that = this;
wx.showModal({
title: '修改昵称',
editable: true,
placeholderText: '请输入新昵称',
success: function(res) {
success: function (res) {
if (res.confirm && res.content) {
// 发送请求到后端,更新用户昵称
e.request('/miniprogram/user/update', {
e.request('/v2/miniprogram/user/update', {
nickname: res.content
}, true).then(function(res) {
}, true).then(function (res) {
if (res.code == 200) {
that.getContent();
wx.showToast({

View File

@ -20,7 +20,7 @@ Page({
var o = this;
wx.showLoading({
title: ""
}), i.request('/miniprogram/coupons/details', {
}), i.request('/v2/miniprogram/coupons/details', {
id: this.data.id
}, !0).then(function (e) {
if (wx.hideLoading(), 200 != e.code) return wx.showModal({
@ -40,7 +40,7 @@ Page({
received: function () {
if (this.isSubmit) return !1;
var t = this;
this.isSubmit = !0, wx.showLoading(), console.log("received"), i.request('/miniprogram/coupons/receive', {
this.isSubmit = !0, wx.showLoading(), console.log("received"), i.request('/v2/miniprogram/coupons/receive', {
id: t.data.id,
token: t.data.info.token
}, !0).then(function (e) {

View File

@ -59,7 +59,7 @@ Page({
if (this.isloading) return !1;
wx.showLoading(), this.setData({
loading: !0
}), this.isloading = !0, e.request('/miniprogram/coupons/lists', { devicecode: t.globalData.devicecode }, !0).then(function (t) {
}), this.isloading = !0, e.request('/v2/miniprogram/coupons/lists', { devicecode: t.globalData.devicecode }, !0).then(function (t) {
if (o.isloading = !1, o.setData({
loading: !1
}), wx.hideLoading(), 200 != t.code) return wx.showModal({
@ -86,7 +86,7 @@ Page({
success: function (i) {
wx.showLoading({
title: ""
}), t.globalData.qrcode = i.result, e.request("/miniprogram/identify", i, !0).then(function (e) {
}), t.globalData.qrcode = i.result, e.request("/v2/miniprogram/identify", i, !0).then(function (e) {
if (wx.hideLoading(), 200 != e.code) return wx.showModal({
title: "提示",
content: e.message
@ -121,7 +121,7 @@ Page({
success: function (i) {
i.confirm && (a.isSubmit = !0, wx.showLoading({
title: "正在启动"
}), e.request('/miniprogram/machine/carwashcodestartup', {
}), e.request('/v2/miniprogram/machine/carwashcodestartup', {
washcode: a.data.selectID
}, !0).then(function (t) {
// 成功后返回提示

View File

@ -18,7 +18,7 @@ Page({
*/
onLoad(options) {
var a = this;
e.request('/miniprogram/index/balance', {}, !0).then(function (res) {
e.request('/v2/miniprogram/index/balance', {}, !0).then(function (res) {
if (!res.data || !res.data.progressorder) {
wx.showToast({
title: '没有进行中的订单',
@ -116,7 +116,7 @@ Page({
content: '确定要结算此次洗车订单吗?',
success: (res) => {
if (res.confirm) {
e.request('/miniprogram/machine/shutdown', {
e.request('/v2/miniprogram/machine/shutdown', {
orderid: this.data.orderid
}, true).then((res) => {
if (res.code === 200) {