fix: 更新API端点路径至v2版本
将/miniprogram/user/onlineCarHailing和/miniprogram/user等API端点路径更新为/v2/miniprogram/user/onlineCarHailing和/v2/miniprogram/user,以适配后端API的v2版本
This commit is contained in:
parent
a3fcf0eac1
commit
678d35042a
@ -38,7 +38,7 @@ Page({
|
|||||||
title: '提交中...'
|
title: '提交中...'
|
||||||
})
|
})
|
||||||
|
|
||||||
t.request('/miniprogram/user/onlineCarHailing', { mobile }, !0).then((res) => {
|
t.request('/v2/miniprogram/user/onlineCarHailing', { mobile }, !0).then((res) => {
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
|
@ -7,7 +7,7 @@ Page({
|
|||||||
code: ''
|
code: ''
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
t.request('/miniprogram/coupons', {}, !0).then((res) => {
|
t.request('/v2/miniprogram/coupons', {}, !0).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.setData({
|
this.setData({
|
||||||
tips: res.data.tips,
|
tips: res.data.tips,
|
||||||
@ -23,7 +23,7 @@ Page({
|
|||||||
success: function (i) {
|
success: function (i) {
|
||||||
console.log(i), wx.showLoading({
|
console.log(i), wx.showLoading({
|
||||||
title: ""
|
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();
|
console.log("data", t), wx.hideLoading();
|
||||||
// 保存设备编号
|
// 保存设备编号
|
||||||
getApp().globalData.devicecode = t.data.devicecode || getApp().globalData.devicecode;
|
getApp().globalData.devicecode = t.data.devicecode || getApp().globalData.devicecode;
|
||||||
@ -38,7 +38,7 @@ Page({
|
|||||||
startup: function () {
|
startup: function () {
|
||||||
if (getApp().globalData.devicecode) {
|
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) {
|
if (startRes.code == 200) {
|
||||||
wx.showToast({ title: startRes.message || '启动成功', icon: 'success' });
|
wx.showToast({ title: startRes.message || '启动成功', icon: 'success' });
|
||||||
// 跳转到洗车券列表页面
|
// 跳转到洗车券列表页面
|
||||||
@ -73,7 +73,7 @@ Page({
|
|||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: '兑换中...'
|
title: '兑换中...'
|
||||||
})
|
})
|
||||||
t.request('/miniprogram/coupons/importDouyin', { code: code }, !0).then((res) => {
|
t.request('/v2/miniprogram/coupons/importDouyin', { code: code }, !0).then((res) => {
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ Page({
|
|||||||
var n = Object.assign(this.userInfo, t, {
|
var n = Object.assign(this.userInfo, t, {
|
||||||
code: a
|
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),
|
if (wx.hideLoading(), console.log("toAuthorization", "app.globalData.needJumpUrl", e.globalData.needJumpUrl, o),
|
||||||
200 != o.code) return wx.showModal({
|
200 != o.code) return wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
|
@ -36,7 +36,7 @@ Page({
|
|||||||
title: '查询中...'
|
title: '查询中...'
|
||||||
})
|
})
|
||||||
|
|
||||||
t.request('/miniprogram/Refund/query', { mobile }, !0).then((res) => {
|
t.request('/v2/miniprogram/Refund/query', { mobile }, !0).then((res) => {
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.setData({
|
this.setData({
|
||||||
@ -70,7 +70,7 @@ Page({
|
|||||||
})
|
})
|
||||||
return
|
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()
|
wx.hideLoading()
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
@ -117,7 +117,7 @@ Page({
|
|||||||
})
|
})
|
||||||
return
|
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()
|
wx.hideLoading()
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
|
@ -34,7 +34,7 @@ Page({
|
|||||||
loading: true
|
loading: true
|
||||||
});
|
});
|
||||||
|
|
||||||
e.request('/miniprogram/substituteWash/index', {}, true).then(function (res) {
|
e.request('/v2/miniprogram/substituteWash/index', {}, true).then(function (res) {
|
||||||
a.setData({
|
a.setData({
|
||||||
loading: false
|
loading: false
|
||||||
});
|
});
|
||||||
@ -93,7 +93,7 @@ Page({
|
|||||||
mask: true
|
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();
|
wx.hideLoading();
|
||||||
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
@ -6,22 +6,22 @@ Page({
|
|||||||
urlList: [],
|
urlList: [],
|
||||||
user: {}
|
user: {}
|
||||||
},
|
},
|
||||||
onLoad: function(n) {
|
onLoad: function (n) {
|
||||||
var o = this;
|
var o = this;
|
||||||
e.pageStart(t).then(function(t) {
|
e.pageStart(t).then(function (t) {
|
||||||
o.getContent();
|
o.getContent();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onShow: function() {
|
onShow: function () {
|
||||||
this.refresh && this.getContent();
|
this.refresh && this.getContent();
|
||||||
},
|
},
|
||||||
onPullDownRefresh: function() {},
|
onPullDownRefresh: function () { },
|
||||||
onShareAppMessage: function() {},
|
onShareAppMessage: function () { },
|
||||||
getContent: function() {
|
getContent: function () {
|
||||||
var n = this;
|
var n = this;
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: ""
|
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({
|
if (wx.hideLoading(), 200 != t.code) return wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: t.message
|
content: t.message
|
||||||
@ -30,18 +30,18 @@ Page({
|
|||||||
showLoding: !1,
|
showLoding: !1,
|
||||||
user: t.data.user,
|
user: t.data.user,
|
||||||
urlList: t.data.menu
|
urlList: t.data.menu
|
||||||
}, function() {});
|
}, function () { });
|
||||||
}).catch(function(t) {
|
}).catch(function (t) {
|
||||||
wx.hideLoading();
|
wx.hideLoading();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
islogin: function() {
|
islogin: function () {
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: "加载中"
|
title: "加载中"
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
refresh: 0,
|
refresh: 0,
|
||||||
toPage: function(t) {
|
toPage: function (t) {
|
||||||
var e = t.currentTarget.dataset, n = (e.refresh, e.url);
|
var e = t.currentTarget.dataset, n = (e.refresh, e.url);
|
||||||
n ? wx.navigateTo({
|
n ? wx.navigateTo({
|
||||||
url: "/pages/".concat(n)
|
url: "/pages/".concat(n)
|
||||||
@ -51,29 +51,29 @@ Page({
|
|||||||
duration: 2e3
|
duration: 2e3
|
||||||
}), this.refresh = 1;
|
}), this.refresh = 1;
|
||||||
},
|
},
|
||||||
callUs: function() {
|
callUs: function () {
|
||||||
if (!t.globalData.servicetel) return !1;
|
if (!t.globalData.servicetel) return !1;
|
||||||
wx.makePhoneCall({
|
wx.makePhoneCall({
|
||||||
phoneNumber: "" + t.globalData.servicetel
|
phoneNumber: "" + t.globalData.servicetel
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updateUserAvatar: function() {
|
updateUserAvatar: function () {
|
||||||
var that = this;
|
var that = this;
|
||||||
wx.chooseMedia({
|
wx.chooseMedia({
|
||||||
count: 1,
|
count: 1,
|
||||||
mediaType: ['image'],
|
mediaType: ['image'],
|
||||||
sourceType: ['album', 'camera'],
|
sourceType: ['album', 'camera'],
|
||||||
success: function(res) {
|
success: function (res) {
|
||||||
wx.uploadFile({
|
wx.uploadFile({
|
||||||
url: 'https://t-jm.v0750.com/miniprogram/upload',
|
url: 'https://t-jm.v0750.com/miniprogram/upload',
|
||||||
filePath: res.tempFiles[0].tempFilePath,
|
filePath: res.tempFiles[0].tempFilePath,
|
||||||
name: 'file',
|
name: 'file',
|
||||||
success: function(uploadRes) {
|
success: function (uploadRes) {
|
||||||
var data = JSON.parse(uploadRes.data);
|
var data = JSON.parse(uploadRes.data);
|
||||||
if (data.code == 200) {
|
if (data.code == 200) {
|
||||||
e.request('/miniprogram/user/update', {
|
e.request('/v2/miniprogram/user/update', {
|
||||||
avatar: data.data.url
|
avatar: data.data.url
|
||||||
}, true).then(function(res) {
|
}, true).then(function (res) {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
that.getContent();
|
that.getContent();
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
@ -93,18 +93,18 @@ Page({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updateUserNickname: function() {
|
updateUserNickname: function () {
|
||||||
var that = this;
|
var that = this;
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
title: '修改昵称',
|
title: '修改昵称',
|
||||||
editable: true,
|
editable: true,
|
||||||
placeholderText: '请输入新昵称',
|
placeholderText: '请输入新昵称',
|
||||||
success: function(res) {
|
success: function (res) {
|
||||||
if (res.confirm && res.content) {
|
if (res.confirm && res.content) {
|
||||||
// 发送请求到后端,更新用户昵称
|
// 发送请求到后端,更新用户昵称
|
||||||
e.request('/miniprogram/user/update', {
|
e.request('/v2/miniprogram/user/update', {
|
||||||
nickname: res.content
|
nickname: res.content
|
||||||
}, true).then(function(res) {
|
}, true).then(function (res) {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
that.getContent();
|
that.getContent();
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
|
@ -20,7 +20,7 @@ Page({
|
|||||||
var o = this;
|
var o = this;
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: ""
|
title: ""
|
||||||
}), i.request('/miniprogram/coupons/details', {
|
}), i.request('/v2/miniprogram/coupons/details', {
|
||||||
id: this.data.id
|
id: this.data.id
|
||||||
}, !0).then(function (e) {
|
}, !0).then(function (e) {
|
||||||
if (wx.hideLoading(), 200 != e.code) return wx.showModal({
|
if (wx.hideLoading(), 200 != e.code) return wx.showModal({
|
||||||
@ -40,7 +40,7 @@ Page({
|
|||||||
received: function () {
|
received: function () {
|
||||||
if (this.isSubmit) return !1;
|
if (this.isSubmit) return !1;
|
||||||
var t = this;
|
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,
|
id: t.data.id,
|
||||||
token: t.data.info.token
|
token: t.data.info.token
|
||||||
}, !0).then(function (e) {
|
}, !0).then(function (e) {
|
||||||
|
@ -59,7 +59,7 @@ Page({
|
|||||||
if (this.isloading) return !1;
|
if (this.isloading) return !1;
|
||||||
wx.showLoading(), this.setData({
|
wx.showLoading(), this.setData({
|
||||||
loading: !0
|
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({
|
if (o.isloading = !1, o.setData({
|
||||||
loading: !1
|
loading: !1
|
||||||
}), wx.hideLoading(), 200 != t.code) return wx.showModal({
|
}), wx.hideLoading(), 200 != t.code) return wx.showModal({
|
||||||
@ -86,7 +86,7 @@ Page({
|
|||||||
success: function (i) {
|
success: function (i) {
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: ""
|
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({
|
if (wx.hideLoading(), 200 != e.code) return wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: e.message
|
content: e.message
|
||||||
@ -121,7 +121,7 @@ Page({
|
|||||||
success: function (i) {
|
success: function (i) {
|
||||||
i.confirm && (a.isSubmit = !0, wx.showLoading({
|
i.confirm && (a.isSubmit = !0, wx.showLoading({
|
||||||
title: "正在启动"
|
title: "正在启动"
|
||||||
}), e.request('/miniprogram/machine/carwashcodestartup', {
|
}), e.request('/v2/miniprogram/machine/carwashcodestartup', {
|
||||||
washcode: a.data.selectID
|
washcode: a.data.selectID
|
||||||
}, !0).then(function (t) {
|
}, !0).then(function (t) {
|
||||||
// 成功后返回提示
|
// 成功后返回提示
|
||||||
|
@ -18,7 +18,7 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
var a = this;
|
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) {
|
if (!res.data || !res.data.progressorder) {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: '没有进行中的订单',
|
title: '没有进行中的订单',
|
||||||
@ -116,7 +116,7 @@ Page({
|
|||||||
content: '确定要结算此次洗车订单吗?',
|
content: '确定要结算此次洗车订单吗?',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
e.request('/miniprogram/machine/shutdown', {
|
e.request('/v2/miniprogram/machine/shutdown', {
|
||||||
orderid: this.data.orderid
|
orderid: this.data.orderid
|
||||||
}, true).then((res) => {
|
}, true).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user