aiWebview.vue 2.56 KB
<!--
 * @Author: 前端 qianduan01@didihu.com.cn
 * @Date: 2024-04-28 18:19:19
 * @LastEditors: yangming@didihu.com.cn yangming@didihu.com.cn
 * @LastEditTime: 2025-04-30 13:31:51
 * @FilePath: \gl-tape\pages\common\webview.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <view>
    <view class="header" @click="back">
      <view class="nav-bar">
        <view class="back">
          <uni-icons type="left" :size="20" color="#000000"></uni-icons>
        </view>
        <view class="title">{{ title }}</view>
      </view>
    </view>
    <web-view :src="url" v-if="url"></web-view>
  </view>
</template>

<script type="text/ecmascript-6">
export default {
  name: '',
  data () {
    return {
      url: '',
      title:'广联AI集市'
    }
  },
  onLoad (options) {
    const {  sceneType, uuid,phone,  channelType=1 } = uni.$storage.get('userInfo')
   const  bussinessType =  sceneType == 0 ? 1 : 2 // sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
    const brand =  {
      1: '问界',
      2:'比亚迪',
      3:'其他'
    }[channelType]
   this.url = `${options.url}?no_header=1&business_type=${ bussinessType}&phone=${phone}&brand=${brand}&one_id=${uuid}&platformType=1&domain=${options.domain}&presuppositionProblem=${options.presuppositionProblem}`
   console.log(this.url,999)
  //  this.url='http://assistant.test.glsx.com.cn/chat/jHpvpOmuMWPxYxKo?business_type=12&brand=%E9%97%AE%E7%95%8C&one_id=266&platformType=2&no_header=1&domain=http://aiassistant.test.glsx.com.cn'
   setTimeout(() => {
   const currentWebview = this.$scope.$getAppWebview()
   const wv = currentWebview.children()[0]
          if (wv) {
            wv.setStyle({ top: '10%',height:'90%'})
          }
        }, 1000)
  },
  mounted () {
  },
  methods: {
    back() {
      console.log('back')
      uni.navigateBack()
    }
  }
}
</script>

<style scoped lang="scss">
.header {
  background: url('https://img02.glsx.com.cn/weapp/resource/saas/ai/ai-app-bg.jpg');
  padding-top: 30px;
  z-index: 9999;
  background-size: 100% 100%;
  position: fixed;
  height: 10%;
  width: 100%;
  .nav-bar {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    .back {
      height: 100%;
      aspect-ratio: 1/1;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .title {
      color: #333333;
      flex: 1;
      font-size: 16px;
      font-weight: 700;
      text-align: center;
    }
  }
}
</style>