|
@@ -215,6 +215,8 @@
|
|
|
var payByPoints = "{$payByPoints}";
|
|
|
//console.log(payByPoints, payByPoints)
|
|
|
|
|
|
+ var loadingModelEle= $("#loadingModel")
|
|
|
+
|
|
|
//默认地址
|
|
|
const defaultAddressInfo = {
|
|
|
userName: "{$name}",
|
|
@@ -227,10 +229,9 @@
|
|
|
postalCode: "{$zipCode}"
|
|
|
}
|
|
|
// 是否已填写过地址
|
|
|
+ var isAddress = false;
|
|
|
if (addressId) {
|
|
|
- var isAddress = true
|
|
|
- } else {
|
|
|
- var isAddress = false
|
|
|
+ isAddress = true
|
|
|
}
|
|
|
|
|
|
//初始化地址模块标签显示隐藏
|
|
@@ -273,33 +274,6 @@
|
|
|
|
|
|
//更改地址,需显示填写地址表单、取消保存按钮
|
|
|
$("#changeAddress").on(tap, async function () {
|
|
|
- //获取地址列表
|
|
|
- /* $.ajax({
|
|
|
- url: "/index/address/list",
|
|
|
- method: 'GET',
|
|
|
- headers: {
|
|
|
- 'Content-Type': 'application/json',
|
|
|
- 'storeId': '10001',
|
|
|
- 'platform': 'H5',
|
|
|
- },
|
|
|
- dataType: 'json',
|
|
|
- success: function (obj) {
|
|
|
- if (obj.status === 200 || obj.status === '200') {
|
|
|
- console.log(obj.data)
|
|
|
- return false;
|
|
|
- showToast("Successful")
|
|
|
- window.location.href = '../cart/shoppingCart';
|
|
|
- } else if (obj.status === 401 || obj.status === '401') {
|
|
|
- window.location.replace('../passport/logIn.html')
|
|
|
- } else {
|
|
|
- showToast(obj.message)
|
|
|
- }
|
|
|
- },
|
|
|
- error: function (xhr, status, error) {
|
|
|
- reject(error);
|
|
|
- }
|
|
|
- });*/
|
|
|
-
|
|
|
$("#addressContainer").slideDown(200)
|
|
|
$("#addressButModel").show(0)
|
|
|
});
|
|
@@ -559,7 +533,11 @@
|
|
|
// const res = await addAddress()
|
|
|
// addressId = res
|
|
|
}
|
|
|
- $("#loadingModel").show(0)
|
|
|
+ let left = (window.innerWidth - 600) / 2;
|
|
|
+ var importantStuff = window.open('', '_blank',
|
|
|
+ 'height=500,width=600,top=300,left=' + left + ',toolbar=no,menubar=no, scrollbars=no,resizable=no,location=no, status=no');
|
|
|
+ importantStuff.document.write('Preparing payment...');
|
|
|
+ loadingModelEle.show(0)
|
|
|
|
|
|
const params = {
|
|
|
//"cartIds": "10002",
|
|
@@ -575,10 +553,11 @@
|
|
|
window.open(data.payment.approval_link, "PayPal",
|
|
|
'height=300,width=600,top=300,left=' + left + ',toolbar=no,menubar=no, scrollbars=no,resizable=no,location=no, status=no');
|
|
|
*/
|
|
|
+ importantStuff.location.href = data.payment.approval_link;
|
|
|
|
|
|
- let uri = data.payment.approval_link;
|
|
|
- let id = "paypal"
|
|
|
- createSuperLabel(uri, id)
|
|
|
+ // let uri = data.payment.approval_link;
|
|
|
+ // let id = "paypal"
|
|
|
+ // createSuperLabel(uri, id)
|
|
|
|
|
|
var interId = setInterval(function () {
|
|
|
fetchOrder(data.orderId, interId);
|
|
@@ -587,7 +566,7 @@
|
|
|
window.location.replace('/index/passport/login.html');
|
|
|
} else {
|
|
|
showToast(message)
|
|
|
- $("#loadingModel").hide(0)
|
|
|
+ loadingModelEle.hide(0)
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -630,11 +609,11 @@
|
|
|
"delivery": 10,
|
|
|
"address_id": addressId
|
|
|
}
|
|
|
- $("#loadingModel").show(0)
|
|
|
+ loadingModelEle.show(0)
|
|
|
const res = await orderPaymentPoints(params)
|
|
|
const {status, message, data} = res || {}
|
|
|
if (status === 200 || status === "200") {
|
|
|
- $("#loadingModel").hide(0)
|
|
|
+ loadingModelEle.hide(0)
|
|
|
showToast(message)
|
|
|
setTimeout(function () {
|
|
|
window.location.replace('/index/user/order.html')
|