|
@@ -2,7 +2,7 @@ import OHeader from '@/components/o-header'
|
|
|
import OSticky from '@/components/o-sticky'
|
|
|
import request from '@/helpers/request'
|
|
|
import { ActionSheet, Cell, Icon, List, Popover, Tag } from 'vant'
|
|
|
-import { defineComponent, onMounted, reactive } from 'vue'
|
|
|
+import { defineComponent, onMounted, onUnmounted, reactive } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import styles from './index.module.less'
|
|
|
import { state } from '@/state'
|
|
@@ -114,7 +114,19 @@ export default defineComponent({
|
|
|
|
|
|
onMounted(() => {
|
|
|
getList()
|
|
|
+ // 处理返回上一页的问题
|
|
|
+ window.history.pushState(null, '', document.URL)
|
|
|
+ window.addEventListener('popstate', onBack, false)
|
|
|
})
|
|
|
+
|
|
|
+ const onBack = () => {
|
|
|
+ postMessage({ api: 'back' })
|
|
|
+ }
|
|
|
+
|
|
|
+ onUnmounted(() => {
|
|
|
+ window.removeEventListener('popstate', onBack)
|
|
|
+ })
|
|
|
+
|
|
|
return () => (
|
|
|
<div class={!form.listState.dataShow && 'emptyRootContainer'}>
|
|
|
<OSticky
|