修改跳转方法

This commit is contained in:
Dragon
2023-11-27 14:23:11 +08:00
parent 9738a953ba
commit 1bcf0c5d6e

View File

@@ -8,7 +8,7 @@ const showLoading = (content = '加载中...') => {
type: 2, type: 2,
shadeClose: false, shadeClose: false,
content, content,
success(e) { success (e) {
layerIndex = $(e).attr('index') layerIndex = $(e).attr('index')
} }
}) })
@@ -24,7 +24,7 @@ const toastMsg = (content = '操作完成', time = 2) => {
}) })
} }
$(function(){ $(function () {
getInfoFromClient() getInfoFromClient()
$('.back').click(() => { $('.back').click(() => {
@@ -35,27 +35,32 @@ $(function(){
} }
}) })
$('.next').click(() => { $('.next').click(() => {
showLoading() // if (browser.android) {
networkRequest({ // showLoading()
type: 'GET', // networkRequest({
url: urlPrefix + '/user/cancel/check', // type: 'GET',
success(res) { // url: urlPrefix + '/user/cancel/check',
hideLoading(layerIndex) // success (res) {
if (res.code === 200) { // hideLoading(layerIndex)
console.log(res.data); // if (res.code === 200) {
if (res.data.length) { // console.log(res.data);
window.location.href = './fail.html' // if (res.data.length) {
} else { // window.location.href = './fail.html'
window.location.href = './confirm.html' // } else {
} // window.location.href = './confirm.html'
} else { // }
toastMsg(res.message) // } else {
} // toastMsg(res.message)
}, // }
error(err) { // },
hideLoading(layerIndex) // error (err) {
toastMsg('网络错误') // hideLoading(layerIndex)
} // toastMsg('网络错误')
}) // }
// })
// } else {
window.webkit.messageHandlers.cancelAccount.postMessage(null)
// }
}) })
}) })