Browse Source

首页AI助手悬浮按钮

data-page
mk 5 months ago
parent
commit
de8b7a310c
  1. 14
      pages/index/index.js
  2. 6
      pages/index/index.wxml
  3. 22
      pages/index/index.wxss
  4. 12
      pages/work2/work2.js
  5. 5
      pages/work2/work2.wxml

14
pages/index/index.js

@ -332,6 +332,18 @@ IDCard(){
wx.navigateTo({
url: '../../subpages/OCRCard/pages/index/index',
})
},
async geOpenwebuiToken(){
const {code,data} = await api.userOpenwebui()
if(code === 0 ){
return data;
}
},
async toAI(){
let token = await this.geOpenwebuiToken()
wx.navigateTo({
url: '/pages/webView/webView?token='+ encodeURIComponent(token) +'&url='+'https://openwebui.elinkservice.cn/auth',
})
}
})

6
pages/index/index.wxml

@ -150,5 +150,9 @@
</view>
</view>
</view>
<movable-area class="movable-area">
<movable-view class="movable-view" direction="all" x="250" y="300">
<image src="https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/prod/20250327/e15cc4ba38e34b6abe97503d763f3454.gif" class="image-wrapper" catchtouchend="handleTap" bind:tap="toAI"></image>
</movable-view>
</movable-area>
<custom-tab-bar></custom-tab-bar>

22
pages/index/index.wxss

@ -1029,4 +1029,26 @@ line-height: 52rpx;
.card_text{
margin-left: 20rpx;
font-size: 32rpx;
}
.movable-area{
pointer-events:none;
z-index: 100;
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.movable-view{
pointer-events:auto;
height: 50px;
width: 50px;
}
.image-wrapper{
width: 190rpx;
height: 190rpx;
}

12
pages/work2/work2.js

@ -126,18 +126,6 @@ Page({
url: '/pages/webView/webView?worktoken='+token+'&Hotline='+'https://epmet-preview.elinkservice.cn/epmet-work-h5/#/Hotline',
})
},
async geOpenwebuiToken(){
const {code,data} = await api.userOpenwebui()
if(code === 0 ){
return data;
}
},
async toAI(){
let token = await this.geOpenwebuiToken()
wx.navigateTo({
url: '/pages/webView/webView?token='+ encodeURIComponent(token) +'&url='+'https://openwebui.elinkservice.cn/auth',
})
}
// onAddHouse(){
// wx.navigateTo({
// url: '../../subpages/addhouse/pages/addhouse/addhouse',

5
pages/work2/work2.wxml

@ -84,10 +84,7 @@
<image src="/images/work2/12345.png" class="image_13-21" style="margin-left: 25px;" bind:tap="onHotlineCompletion"></image>
<text lines="1" class="text_4-0">热线接办</text>
</view>
<view style="display: flex; algin-items: center;">
<image src="https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/dev/20250326/da05357005a84873aa1f605e1e116b07.png" class="image_12-0" bind:tap="toAI"></image>
<text lines="1" class="text_4-0">AI助手</text>
</view>
</view>
</view>
</view>

Loading…
Cancel
Save