修改web_view

This commit is contained in:
lewis 2025-09-07 10:59:17 +08:00
parent 3b46b76f1f
commit 5e52a4ef84

View File

@ -6,26 +6,19 @@
},
}
</route>
<!-- navigationStyle: 'custom', -->
<template>
<!-- <CustomNavbar :title="title">
<template #right>
<wd-icon name="home" @click="handleSearch" />
</template>
</CustomNavbar> -->
<!-- <view class="content"> -->
<fly-login v-model="show" />
<web-view class="web-view" :webview-styles="webviewStyles" :src="local_url"></web-view>
<!-- </view> -->
</template>
<!-- :style="{ width: windowW + 'px', height: windowH + 'px' }" -->
<script>
import { defineComponent, computed } from 'vue'
import { computed, defineComponent } from 'vue'
import CustomNavbar from '@/components/CustomNavbar.vue'
import { useUserStore } from '@/store'
import { getUrlCrmebLogin } from '@/utils'
import { isMpWeixin } from '@/utils/platform'
const userStore = useUserStore()
//
const hasLogin = computed(() => userStore.userInfo?.id)
const userId = computed(() => userStore.userInfo?.id)
export default defineComponent({
data() {
return {
@ -49,13 +42,13 @@ export default defineComponent({
onLoad(option) {
// const target = encodeURIComponent(option.target)
const target = option.target
console.log('获取跳转连接', target)
console.log('userId', userId.value)
if (isMpWeixin) {
this.local_url = getUrlCrmebLogin() + '?target=' + target
this.local_url = `${getUrlCrmebLogin()}?target=${target}&user_id=${userId.value}`
} else {
this.local_url = getUrlCrmebLogin() + target
}
console.log(this.local_url)
console.log('local_url', this.local_url)
this.title = option.title || ''
uni.setNavigationBarTitle({
title: this.title, //
@ -73,7 +66,6 @@ export default defineComponent({
},
methods: {
handleSearch() {
// console.log('search')
//
uni.navigateTo({ url: '/pages/search/index' })
},
@ -81,6 +73,11 @@ export default defineComponent({
})
</script>
<template>
<fly-login v-model="show" />
<web-view class="web-view" :webview-styles="webviewStyles" :src="local_url" />
</template>
<style scoped>
/* 根据需要添加样式 */
.content {