change
This commit is contained in:
@@ -124,11 +124,71 @@ body {
|
||||
}
|
||||
|
||||
.custom-list-loading {
|
||||
background-color: unset;
|
||||
min-width: 132px;
|
||||
padding: 15px 12px 12px;
|
||||
border-radius: 14px;
|
||||
color: #666;
|
||||
background-color: rgba(255, 255, 255, 0.98);
|
||||
box-shadow: 0 6px 22px rgba(128, 72, 72, 0.08);
|
||||
}
|
||||
|
||||
.custom-list-loading .van-icon {
|
||||
font-size: 108px;
|
||||
position: relative;
|
||||
width: 88px;
|
||||
height: 88px;
|
||||
overflow: visible;
|
||||
font-size: 88px;
|
||||
}
|
||||
|
||||
.custom-list-loading .van-icon::before {
|
||||
position: absolute;
|
||||
inset: 6px;
|
||||
border: 1px solid rgba(255, 112, 103, 0.24);
|
||||
border-radius: 50%;
|
||||
content: "";
|
||||
}
|
||||
|
||||
.custom-list-loading .van-icon::after {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 41px;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: #ff8c83;
|
||||
box-shadow: 33px 37px 0 #ff6f68, -35px 21px 0 #ffb0a9;
|
||||
content: "";
|
||||
transform-origin: 3px 42px;
|
||||
animation: smart-union-loading-orbit 1.8s linear infinite;
|
||||
}
|
||||
|
||||
.custom-list-loading .van-icon__image {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
box-sizing: border-box;
|
||||
width: 54px;
|
||||
height: 54px;
|
||||
padding: 5px;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 238, 236, 0.92);
|
||||
object-fit: contain;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
@keyframes smart-union-loading-orbit {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.custom-list-loading .van-toast__text {
|
||||
margin-top: 4px;
|
||||
color: #707070;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
line-height: 18px;
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
.list-card {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 460 KiB |
@@ -8,6 +8,10 @@ const commonUtil = {
|
||||
"x-requested-with": "XMLHttpRequest"
|
||||
}
|
||||
})
|
||||
// H5 页面按需注入统一的 Loading 与请求延迟处理,其他端保持原有行为。
|
||||
if (typeof window !== "undefined" && typeof window.bindH5AxiosLoading === "function") {
|
||||
window.bindH5AxiosLoading(axiosService)
|
||||
}
|
||||
//axios拦截器
|
||||
axiosService.interceptors.response.use(
|
||||
(response) => {
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* H5 弹框浏览器历史栈管理器。
|
||||
* 页面只注册关闭回调;本文件全局统一监听 popstate,避免每个页面重复绑定返回事件。
|
||||
*/
|
||||
;((global) => {
|
||||
const callbacks = new Map()
|
||||
const popupStack = []
|
||||
let tokenSeed = 0
|
||||
let stateSeed = 0
|
||||
let pendingClear = null
|
||||
|
||||
const invokeClose = (entry) => {
|
||||
const callback = callbacks.get(entry.token)
|
||||
if (callback) callback(entry.popupKey)
|
||||
}
|
||||
|
||||
global.addEventListener("popstate", (event) => {
|
||||
if (pendingClear) {
|
||||
event.stopImmediatePropagation()
|
||||
const clear = pendingClear
|
||||
pendingClear = null
|
||||
clear.resolve()
|
||||
return
|
||||
}
|
||||
if (!popupStack.length) return
|
||||
|
||||
// 有弹框历史时消费本次返回事件,阻止 PJAX 将页面直接切回上一个业务页面。
|
||||
event.stopImmediatePropagation()
|
||||
const entry = popupStack.pop()
|
||||
invokeClose(entry)
|
||||
}, true)
|
||||
|
||||
global.h5PopupHistory = {
|
||||
register(closeCallback) {
|
||||
tokenSeed += 1
|
||||
const token = "h5-popup-page-" + tokenSeed
|
||||
callbacks.set(token, closeCallback)
|
||||
return token
|
||||
},
|
||||
unregister(token) {
|
||||
callbacks.delete(token)
|
||||
for (let index = popupStack.length - 1; index >= 0; index -= 1) {
|
||||
if (popupStack[index].token === token) popupStack.splice(index, 1)
|
||||
}
|
||||
},
|
||||
open(token, popupKey) {
|
||||
if (!callbacks.has(token)) return
|
||||
const current = popupStack[popupStack.length - 1]
|
||||
if (current && current.token === token && current.popupKey === popupKey) return
|
||||
|
||||
stateSeed += 1
|
||||
const entry = {token:token,popupKey:popupKey,stateId:stateSeed}
|
||||
popupStack.push(entry)
|
||||
const state = Object.assign({}, global.history.state || {}, {
|
||||
__h5PopupHistory: {token:token,popupKey:popupKey,stateId:stateSeed}
|
||||
})
|
||||
global.history.pushState(state, global.document.title, global.location.href)
|
||||
},
|
||||
close(token, popupKey) {
|
||||
const current = popupStack[popupStack.length - 1]
|
||||
if (!current || current.token !== token || current.popupKey !== popupKey) return false
|
||||
global.history.back()
|
||||
return true
|
||||
},
|
||||
clear(token) {
|
||||
const entries = popupStack.filter((entry) => entry.token === token)
|
||||
if (!entries.length) return Promise.resolve()
|
||||
|
||||
entries.forEach((entry) => invokeClose(entry))
|
||||
for (let index = popupStack.length - 1; index >= 0; index -= 1) {
|
||||
if (popupStack[index].token === token) popupStack.splice(index, 1)
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
pendingClear = {resolve:resolve}
|
||||
global.history.go(-entries.length)
|
||||
})
|
||||
}
|
||||
}
|
||||
})(window)
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user