|
@@ -97,7 +97,10 @@
|
|
|
<div class="orderGoodsBox eleBox">
|
|
|
<div class="ogTeFlex">
|
|
|
<p class="ogTitle">Listing</p>
|
|
|
+ {if $order['pay_status'] == 10 }
|
|
|
<div class="ogMarkButton">Pay With PayPal</div>
|
|
|
+ <div class="ogCancelButton">Cancel</div>
|
|
|
+ {/if}
|
|
|
</div>
|
|
|
<p class="ogTips">
|
|
|
Your goods will be shipped in 72 hours
|
|
@@ -347,11 +350,11 @@
|
|
|
|
|
|
$("#loadingModel").hide(0);
|
|
|
var orderId = "{$order['order_id']}";
|
|
|
- var payStatus = "{$order['pay_status']}";
|
|
|
- $('#ogMarkButton').hide(0)
|
|
|
- if (payStatus === "10") {
|
|
|
- $('#ogMarkButton').show(0)
|
|
|
- }
|
|
|
+ //var payStatus = "{$order['pay_status']}";
|
|
|
+ // $('#ogMarkButton').hide(0)
|
|
|
+ // if (payStatus === "10") {
|
|
|
+ // $('#ogMarkButton').show(0)
|
|
|
+ // }
|
|
|
|
|
|
//触屏事件 || 点击事件
|
|
|
const tap = "ontouchstart" in window ? "touchstart" : "click";
|
|
@@ -441,6 +444,34 @@
|
|
|
showToast(message)
|
|
|
}
|
|
|
});
|
|
|
+ //取消未支付的订单
|
|
|
+ $(".ogCancelButton").on(tap, async function () {
|
|
|
+ const dp = {
|
|
|
+ orderId: orderId
|
|
|
+ };
|
|
|
+ $.ajax({
|
|
|
+ url: "/index/order/cancel",
|
|
|
+ headers: {platform: 'H5'},
|
|
|
+ dataType: 'json',
|
|
|
+ data: JSON.stringify(dp),
|
|
|
+ type: "POST",
|
|
|
+ contentType: 'application/json',
|
|
|
+ success: function (obj) {
|
|
|
+ //注册成功后进入
|
|
|
+ if (obj.status === 200 || obj.status === '200') {
|
|
|
+ showToast("Successful")
|
|
|
+ setTimeout(function () {
|
|
|
+ window.location.replace('/index/user/order.html')
|
|
|
+ }
|
|
|
+ , 3000)
|
|
|
+ } else if (obj.status === 401 || obj.status === '401') {
|
|
|
+ window.location.replace('../passport/logIn.html')
|
|
|
+ } else {
|
|
|
+ showToast('Something wrong,please try again later')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
|
|
|
function fetchOrder(interId) {
|
|
|
$.get('/index/order/detail?orderId=' + orderId, function (res) {
|