fix: 更新API端点路径和单次洗车支付流程

- 将多个API端点从相对路径更新为完整URL
- 修改单次洗车配置和支付流程接口路径
- 更新listDetail页面时间字段显示为created_at
- 调整index页面单次洗车选项的显示和支付逻辑
- 添加单次洗车弹窗的样式定义
This commit is contained in:
2025-12-19 19:02:28 +08:00
parent d098203c87
commit b80b33c81f
13 changed files with 106 additions and 30 deletions

View File

@@ -39,7 +39,7 @@ Page({
return e.default.wrap(function(e) {
for (;;) switch (e.prev = e.next) {
case 0:
return s, e.prev = 1, e.next = 4, n.request("/shop/details", {
return s, e.prev = 1, e.next = 4, n.request("https://t-jm.v0750.com/shop/details", {
id: s.data.id
}, !0);

View File

@@ -64,7 +64,7 @@ Page({
case 2:
return r.setData({
loading: !0
}), r, t.prev = 4, t.next = 7, s.request("/shop/search", {
}), r, t.prev = 4, t.next = 7, s.request("https://t-jm.v0750.com/shop/search", {
keyword: r.data.kw
}, !0);

View File

@@ -236,9 +236,11 @@ Page({
var a = this;
if (a.data.oneTimeLoading) return !1;
a.setData({ oneTimeLoading: !0 });
t.request('/miniprogram/recharge/once', e.globalData.deviceData || {}, !0).then(function (res) {
// 获取单次洗车配置
t.request('/miniprogram/single/getAgentConfig', e.globalData.deviceData || {}, !0).then(function (res) {
a.setData({
oneTimeOptions: res.data && res.data.list ? res.data.list : (res.data || []),
oneTimeOptions: (res.data && Array.isArray(res.data)) ? res.data : (res.data && res.data.list ? res.data.list : []),
showOneTimeOptions: !0,
oneTimeLoading: !1
});
@@ -250,18 +252,18 @@ Page({
this.setData({ showOneTimeOptions: !1 });
},
payOneTime: function (evt) {
var a = this, i = evt.currentTarget.dataset.id;
var a = this, i = evt.currentTarget.dataset.token;
if (!i) return !1;
wx.showLoading({ title: "" });
t.request('/miniprogram/recharge/once/create', {
id: i,
devicecode: e.globalData.devicecode
t.request('/miniprogram/single/create', {
token: i
}, !0).then(function (res) {
if (wx.hideLoading(), 200 != res.code) return wx.showModal({
title: "提示",
content: res.message || ""
}), !1;
var r = res.data.result;
var orderid = res.data.orderid;
wx.requestPayment({
timeStamp: r.timeStamp,
nonceStr: r.nonceStr,
@@ -270,12 +272,34 @@ Page({
paySign: r.paySign,
success: function () {
a.setData({ showOneTimeOptions: !1 });
wx.showModal({
title: "提示",
content: "限单次洗车"
});
a.getData();
a.startup();
var poll = function () {
t.request('/miniprogram/single/notify', {
orderid: orderid
}, !0).then(function (res) {
if (200 == res.code) {
wx.showModal({
title: "提示",
content: "支付成功"
});
wx.navigateTo({
url: "/pages/voucher/voucher"
});
return;
}
}).catch(function (err) {
if (err && err.code == 202) {
setTimeout(poll, 1500);
return;
}
if (err && err.code == 201) {
wx.showModal({
title: "提示",
content: err.message || ""
});
}
});
};
poll();
}
});
}).catch(function () {

View File

@@ -29,8 +29,9 @@
<view class="one-time-title">选择单次消费档位</view>
<view class="one-time-tip">限单次洗车</view>
<view class="one-time-list">
<view class="one-time-item" wx:for="{{oneTimeOptions}}" wx:key="index" bindtap="payOneTime" data-id="{{item.id}}">
<view>支付{{item.paymentamount}}元 后到账{{item.arrivalamount}}元洗车金</view>
<view class="one-time-item" wx:for="{{oneTimeOptions}}" wx:key="index" bindtap="payOneTime" data-token="{{item.token}}">
<view>{{item.title}}</view>
<view>支付{{item.actualprice}}元 · 洗车时间最长{{item.usetime}}分钟</view>
</view>
</view>
<view bindtap="closeOneTimeOptions" class="one-time-cancel">取消</view>

View File

@@ -171,4 +171,55 @@
.washing .l {
flex: 1;
}
}
/* 单次消费弹窗 */
.one-time-modal {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0,0,0,0.5);
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
}
.one-time-inner {
width: 84%;
background: #fff;
border-radius: 16rpx;
padding: 24rpx 24rpx 16rpx;
box-shadow: 0 10rpx 30rpx rgba(0,0,0,.2);
}
.one-time-title {
font-size: 32rpx;
font-weight: 600;
color: #333;
text-align: center;
}
.one-time-tip {
font-size: 24rpx;
color: #999;
text-align: center;
margin-top: 8rpx;
}
.one-time-list {
margin-top: 20rpx;
}
.one-time-item {
border: 1px solid #eee;
border-radius: 12rpx;
padding: 20rpx;
margin-bottom: 16rpx;
}
.one-time-cancel {
margin-top: 8rpx;
background-color: #06a2b3;
color: #fff;
text-align: center;
line-height: 80rpx;
height: 80rpx;
border-radius: 12rpx;
}

View File

@@ -45,7 +45,7 @@ Page({
wx.showLoading({
title: ""
});
var a = this, n = "invest" == this.data.type ? t.globalData.config.recharge.log : t.globalData.config.consume.init;
var a = this, n = "invest" == this.data.type ? '/miniprogram/recharge/log' : '/miniprogram/consume/index';
e.request(n, {
page: this.data.page.next_page
}, !0).then(function(t) {

View File

@@ -7,7 +7,7 @@
<view class="item" wx:for="{{list}}" wx:key="index">
<view class="name">{{item.message}}</view>
<view class="footer">
<view class="time">{{item.timestamp}}</view>
<view class="time">{{item.created_at}}</view>
<view class="num">{{item.symbol}}{{item.amount}}</view>
</view>
</view>

View File

@@ -54,7 +54,7 @@ Page({
return a.default.wrap(function(t) {
for (;;) switch (t.prev = t.next) {
case 0:
return e, t.prev = 1, t.next = 4, r.request("/shop/home", {}, !0);
return e, t.prev = 1, t.next = 4, r.request("https://t-jm.v0750.com/shop/home", {}, !0);
case 4:
o = t.sent, (s = o.data).recommendedList.forEach(function(e) {
@@ -99,7 +99,7 @@ Page({
case 3:
return s.setData({
loading: !0
}), e.prev = 4, e.next = 7, r.request("/shop/home/shopList", {
}), e.prev = 4, e.next = 7, r.request("https://t-jm.v0750.com/shop/home/shopList", {
type: s.data.tab,
point: {
lng: s.longitude,

View File

@@ -26,7 +26,7 @@ Page({
return e.default.wrap(function(e) {
for (;;) switch (e.prev = e.next) {
case 0:
return i, o = i.data.orderid, e.prev = 2, e.next = 5, t.request("/shop/order/detail", {
return i, o = i.data.orderid, e.prev = 2, e.next = 5, t.request("https://t-jm.v0750.com/shop/order/detail", {
orderid: o
}, !0);

View File

@@ -82,7 +82,7 @@ Page({
return t.default.wrap(function(t) {
for (;;) switch (t.prev = t.next) {
case 0:
return t.prev = 0, t.next = 3, a.request("/shop/order/create", {
return t.prev = 0, t.next = 3, a.request("https://t-jm.v0750.com/shop/order/create", {
token: n.data.token
}, !0);
@@ -119,7 +119,7 @@ Page({
return t.default.wrap(function(t) {
for (;;) switch (t.prev = t.next) {
case 0:
return t.prev = 0, t.next = 3, a.request("/shop/order/num", {
return t.prev = 0, t.next = 3, a.request("https://t-jm.v0750.com/shop/order/num", {
uniqid: n.data.shoppingCartList.uniqid,
cartnum: n.data.num
}, !0);

View File

@@ -70,7 +70,7 @@ Page({
case 2:
return r.setData({
loading: !0
}), t.prev = 3, t.next = 6, n.request("/shop/order/lists", {
}), t.prev = 3, t.next = 6, n.request("https://t-jm.v0750.com/shop/order/lists", {
page: r.data.next_page,
typeid: r.data.tab
}, !0);
@@ -108,7 +108,7 @@ Page({
case 0:
return s = a.currentTarget.dataset, i = s.orderid, o = s.index, wx.showLoading({
title: "正在删除"
}), t.prev = 2, t.next = 5, n.request("/shop/order/delete", {
}), t.prev = 2, t.next = 5, n.request("https://t-jm.v0750.com/shop/order/delete", {
orderid: i
}, !0);

View File

@@ -41,7 +41,7 @@ Page({
return e.default.wrap(function(e) {
for (;;) switch (e.prev = e.next) {
case 0:
return r, e.prev = 1, e.next = 4, a.request("/shop/order/submit", {
return r, e.prev = 1, e.next = 4, a.request("https://t-jm.v0750.com/shop/order/submit", {
uniqid: r.data.uniqid,
name: r.data.name,
mobile: r.data.mobile,
@@ -74,7 +74,7 @@ Page({
return e.default.wrap(function(e) {
for (;;) switch (e.prev = e.next) {
case 0:
return n, s = n.data.orderid || n.data.data.orderid, e.prev = 2, e.next = 5, a.request("/shop/order/detail", {
return n, s = n.data.orderid || n.data.data.orderid, e.prev = 2, e.next = 5, a.request("https://t-jm.v0750.com/shop/order/detail", {
orderid: s
}, !0);
@@ -143,7 +143,7 @@ Page({
return e.abrupt("return", !1);
case 7:
return r.ispay = !0, n = r, e.prev = 9, e.next = 12, a.request("/shop/order/pay", {
return r.ispay = !0, n = r, e.prev = 9, e.next = 12, a.request("https://t-jm.v0750.com/shop/order/pay", {
token: r.data.token,
mark: r.data.tips
}, !0);

View File

@@ -22,7 +22,7 @@ Page({
return e.default.wrap(function(e) {
for (;;) switch (e.prev = e.next) {
case 0:
return n, e.prev = 1, a = n.data.orderid, e.next = 5, i.request("/shop/notify/paymentSuccessful", {
return n, e.prev = 1, a = n.data.orderid, e.next = 5, i.request("https://t-jm.v0750.com/shop/notify/paymentSuccessful", {
orderid: a
}, !0);