fix: 更新API端点路径和单次洗车支付流程
- 将多个API端点从相对路径更新为完整URL - 修改单次洗车配置和支付流程接口路径 - 更新listDetail页面时间字段显示为created_at - 调整index页面单次洗车选项的显示和支付逻辑 - 添加单次洗车弹窗的样式定义
This commit is contained in:
@@ -39,7 +39,7 @@ Page({
|
|||||||
return e.default.wrap(function(e) {
|
return e.default.wrap(function(e) {
|
||||||
for (;;) switch (e.prev = e.next) {
|
for (;;) switch (e.prev = e.next) {
|
||||||
case 0:
|
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
|
id: s.data.id
|
||||||
}, !0);
|
}, !0);
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ Page({
|
|||||||
case 2:
|
case 2:
|
||||||
return r.setData({
|
return r.setData({
|
||||||
loading: !0
|
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
|
keyword: r.data.kw
|
||||||
}, !0);
|
}, !0);
|
||||||
|
|
||||||
|
|||||||
@@ -236,9 +236,11 @@ Page({
|
|||||||
var a = this;
|
var a = this;
|
||||||
if (a.data.oneTimeLoading) return !1;
|
if (a.data.oneTimeLoading) return !1;
|
||||||
a.setData({ oneTimeLoading: !0 });
|
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({
|
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,
|
showOneTimeOptions: !0,
|
||||||
oneTimeLoading: !1
|
oneTimeLoading: !1
|
||||||
});
|
});
|
||||||
@@ -250,18 +252,18 @@ Page({
|
|||||||
this.setData({ showOneTimeOptions: !1 });
|
this.setData({ showOneTimeOptions: !1 });
|
||||||
},
|
},
|
||||||
payOneTime: function (evt) {
|
payOneTime: function (evt) {
|
||||||
var a = this, i = evt.currentTarget.dataset.id;
|
var a = this, i = evt.currentTarget.dataset.token;
|
||||||
if (!i) return !1;
|
if (!i) return !1;
|
||||||
wx.showLoading({ title: "" });
|
wx.showLoading({ title: "" });
|
||||||
t.request('/miniprogram/recharge/once/create', {
|
t.request('/miniprogram/single/create', {
|
||||||
id: i,
|
token: i
|
||||||
devicecode: e.globalData.devicecode
|
|
||||||
}, !0).then(function (res) {
|
}, !0).then(function (res) {
|
||||||
if (wx.hideLoading(), 200 != res.code) return wx.showModal({
|
if (wx.hideLoading(), 200 != res.code) return wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: res.message || ""
|
content: res.message || ""
|
||||||
}), !1;
|
}), !1;
|
||||||
var r = res.data.result;
|
var r = res.data.result;
|
||||||
|
var orderid = res.data.orderid;
|
||||||
wx.requestPayment({
|
wx.requestPayment({
|
||||||
timeStamp: r.timeStamp,
|
timeStamp: r.timeStamp,
|
||||||
nonceStr: r.nonceStr,
|
nonceStr: r.nonceStr,
|
||||||
@@ -270,12 +272,34 @@ Page({
|
|||||||
paySign: r.paySign,
|
paySign: r.paySign,
|
||||||
success: function () {
|
success: function () {
|
||||||
a.setData({ showOneTimeOptions: !1 });
|
a.setData({ showOneTimeOptions: !1 });
|
||||||
wx.showModal({
|
var poll = function () {
|
||||||
title: "提示",
|
t.request('/miniprogram/single/notify', {
|
||||||
content: "限单次洗车"
|
orderid: orderid
|
||||||
});
|
}, !0).then(function (res) {
|
||||||
a.getData();
|
if (200 == res.code) {
|
||||||
a.startup();
|
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 () {
|
}).catch(function () {
|
||||||
|
|||||||
@@ -29,8 +29,9 @@
|
|||||||
<view class="one-time-title">选择单次消费档位</view>
|
<view class="one-time-title">选择单次消费档位</view>
|
||||||
<view class="one-time-tip">限单次洗车</view>
|
<view class="one-time-tip">限单次洗车</view>
|
||||||
<view class="one-time-list">
|
<view class="one-time-list">
|
||||||
<view class="one-time-item" wx:for="{{oneTimeOptions}}" wx:key="index" bindtap="payOneTime" data-id="{{item.id}}">
|
<view class="one-time-item" wx:for="{{oneTimeOptions}}" wx:key="index" bindtap="payOneTime" data-token="{{item.token}}">
|
||||||
<view>支付{{item.paymentamount}}元 后到账{{item.arrivalamount}}元洗车金</view>
|
<view>{{item.title}}</view>
|
||||||
|
<view>支付{{item.actualprice}}元 · 洗车时间最长{{item.usetime}}分钟</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view bindtap="closeOneTimeOptions" class="one-time-cancel">取消</view>
|
<view bindtap="closeOneTimeOptions" class="one-time-cancel">取消</view>
|
||||||
|
|||||||
@@ -172,3 +172,54 @@
|
|||||||
.washing .l {
|
.washing .l {
|
||||||
flex: 1;
|
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;
|
||||||
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ Page({
|
|||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: ""
|
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, {
|
e.request(n, {
|
||||||
page: this.data.page.next_page
|
page: this.data.page.next_page
|
||||||
}, !0).then(function(t) {
|
}, !0).then(function(t) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<view class="item" wx:for="{{list}}" wx:key="index">
|
<view class="item" wx:for="{{list}}" wx:key="index">
|
||||||
<view class="name">{{item.message}}</view>
|
<view class="name">{{item.message}}</view>
|
||||||
<view class="footer">
|
<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 class="num">{{item.symbol}}{{item.amount}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Page({
|
|||||||
return a.default.wrap(function(t) {
|
return a.default.wrap(function(t) {
|
||||||
for (;;) switch (t.prev = t.next) {
|
for (;;) switch (t.prev = t.next) {
|
||||||
case 0:
|
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:
|
case 4:
|
||||||
o = t.sent, (s = o.data).recommendedList.forEach(function(e) {
|
o = t.sent, (s = o.data).recommendedList.forEach(function(e) {
|
||||||
@@ -99,7 +99,7 @@ Page({
|
|||||||
case 3:
|
case 3:
|
||||||
return s.setData({
|
return s.setData({
|
||||||
loading: !0
|
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,
|
type: s.data.tab,
|
||||||
point: {
|
point: {
|
||||||
lng: s.longitude,
|
lng: s.longitude,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ Page({
|
|||||||
return e.default.wrap(function(e) {
|
return e.default.wrap(function(e) {
|
||||||
for (;;) switch (e.prev = e.next) {
|
for (;;) switch (e.prev = e.next) {
|
||||||
case 0:
|
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
|
orderid: o
|
||||||
}, !0);
|
}, !0);
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ Page({
|
|||||||
return t.default.wrap(function(t) {
|
return t.default.wrap(function(t) {
|
||||||
for (;;) switch (t.prev = t.next) {
|
for (;;) switch (t.prev = t.next) {
|
||||||
case 0:
|
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
|
token: n.data.token
|
||||||
}, !0);
|
}, !0);
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ Page({
|
|||||||
return t.default.wrap(function(t) {
|
return t.default.wrap(function(t) {
|
||||||
for (;;) switch (t.prev = t.next) {
|
for (;;) switch (t.prev = t.next) {
|
||||||
case 0:
|
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,
|
uniqid: n.data.shoppingCartList.uniqid,
|
||||||
cartnum: n.data.num
|
cartnum: n.data.num
|
||||||
}, !0);
|
}, !0);
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ Page({
|
|||||||
case 2:
|
case 2:
|
||||||
return r.setData({
|
return r.setData({
|
||||||
loading: !0
|
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,
|
page: r.data.next_page,
|
||||||
typeid: r.data.tab
|
typeid: r.data.tab
|
||||||
}, !0);
|
}, !0);
|
||||||
@@ -108,7 +108,7 @@ Page({
|
|||||||
case 0:
|
case 0:
|
||||||
return s = a.currentTarget.dataset, i = s.orderid, o = s.index, wx.showLoading({
|
return s = a.currentTarget.dataset, i = s.orderid, o = s.index, wx.showLoading({
|
||||||
title: "正在删除"
|
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
|
orderid: i
|
||||||
}, !0);
|
}, !0);
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ Page({
|
|||||||
return e.default.wrap(function(e) {
|
return e.default.wrap(function(e) {
|
||||||
for (;;) switch (e.prev = e.next) {
|
for (;;) switch (e.prev = e.next) {
|
||||||
case 0:
|
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,
|
uniqid: r.data.uniqid,
|
||||||
name: r.data.name,
|
name: r.data.name,
|
||||||
mobile: r.data.mobile,
|
mobile: r.data.mobile,
|
||||||
@@ -74,7 +74,7 @@ Page({
|
|||||||
return e.default.wrap(function(e) {
|
return e.default.wrap(function(e) {
|
||||||
for (;;) switch (e.prev = e.next) {
|
for (;;) switch (e.prev = e.next) {
|
||||||
case 0:
|
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
|
orderid: s
|
||||||
}, !0);
|
}, !0);
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ Page({
|
|||||||
return e.abrupt("return", !1);
|
return e.abrupt("return", !1);
|
||||||
|
|
||||||
case 7:
|
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,
|
token: r.data.token,
|
||||||
mark: r.data.tips
|
mark: r.data.tips
|
||||||
}, !0);
|
}, !0);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Page({
|
|||||||
return e.default.wrap(function(e) {
|
return e.default.wrap(function(e) {
|
||||||
for (;;) switch (e.prev = e.next) {
|
for (;;) switch (e.prev = e.next) {
|
||||||
case 0:
|
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
|
orderid: a
|
||||||
}, !0);
|
}, !0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user