| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <template>
- <view class="page" :style="{'min-height':h+'px'}">
- <web-view v-if="src" :src="src" @error="handleWebViewError"></web-view>
- </view>
- </template>
- <script>
- export default {
- data(){
- return {
- src: '',
- h: 0
- }
- },
- onLoad(options) {
- this.src = this.$htmlUrl('PERILL团队评估欢迎页.html')
- this.handleLaunchOrShow(options)
- },
- methods:{
- async handleLaunchOrShow(options) {
- if(options.q){
- try{
- const decodedUrl = decodeURIComponent(options.q);
- const codeMatch = decodedUrl.match(/type=([^&]+)/);
- const stationCode = codeMatch ? codeMatch[1] : null;
- if(stationCode === 'scan') {
- // 关闭首页的加载/渲染,避免闪烁
- uni.hideHomeButton();
- return;
- }
- uni.reLaunch({ url: '/pages/home' });
- }catch(e){
- uni.reLaunch({ url: '/pages/home' });
- }
- }
- },
- handleHome(){
- uni.reLaunch({
- url:'/pages/home'
- })
- },
- handleWebViewError(){
- uni.showToast({
- title: '欢迎页加载失败',
- icon: 'none'
- })
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .page{
- box-sizing: border-box;
- image{
- width: 100%;
- }
- }
- </style>
|