64 lines
1.0 KiB
Vue
64 lines
1.0 KiB
Vue
<template>
|
|
<view v-if="showImg" class="ai-entrance">
|
|
<image
|
|
:src="settingInfo.mainImage"
|
|
mode="widthFix"
|
|
class="img"
|
|
@click="enterAiChat()"
|
|
/>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
getAiSystemInfoSetting
|
|
} from '@/api/public'
|
|
export default {
|
|
name: 'AiEntrance',
|
|
props: {
|
|
cityName: {
|
|
type: String,
|
|
default: ''
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
showImg: false,
|
|
settingInfo: {}
|
|
}
|
|
},
|
|
created() {
|
|
this.init()
|
|
},
|
|
methods: {
|
|
init() {
|
|
getAiSystemInfoSetting().then(res => {
|
|
const { success, data } = res
|
|
if (success) {
|
|
this.settingInfo = data
|
|
this.showImg = data.showOnAppIndex === 1
|
|
}
|
|
})
|
|
},
|
|
enterAiChat() {
|
|
uni.navigateTo({
|
|
url: '/aiChat/views/index?click=1&cityName=' + this.cityName
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
.ai-entrance {
|
|
position: fixed;
|
|
right: 0;
|
|
top: 50%;
|
|
z-index: 5;
|
|
transform: translateY(-50%);
|
|
.img {
|
|
width: 88rpx;
|
|
}
|
|
}
|
|
</style>
|