fix:更新优化
This commit is contained in:
parent
a20195b1b7
commit
4765dad143
@ -1,5 +1,5 @@
|
||||
NODE_ENV= development
|
||||
VITE_HTTP_BASE_URL = http://10.39.13.78:8002/api/
|
||||
# VITE_HTTP_BASE_URL = http://10.39.13.78:8002/api/
|
||||
# VITE_HTTP_BASE_URL = https://test-weapp-api.linyikj.com.cn/api/
|
||||
# VITE_HTTP_BASE_URL = https://weapp-api.linyikj.com.cn/api/
|
||||
VITE_HTTP_BASE_URL = https://weapp-api.linyikj.com.cn/api/
|
||||
VITE_ACCESS_TOKEN_KEY= 'ACCESS_TOKEN_CUSTOMER'
|
||||
@ -1,4 +1,4 @@
|
||||
NODE_ENV= test
|
||||
VITE_HTTP_BASE_URL= https://test-weapp-api.linyikj.com.cn/api/
|
||||
# VITE_HTTP_BASE_URL= https://weapp-api.linyikj.com.cn/api/
|
||||
# VITE_HTTP_BASE_URL= https://test-weapp-api.linyikj.com.cn/api/
|
||||
VITE_HTTP_BASE_URL= https://weapp-api.linyikj.com.cn/api/
|
||||
VITE_ACCESS_TOKEN_KEY= 'NCHL_TEST_ACCESS_TOKEN_CUSTOMER'
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "0.0.78"
|
||||
"version": "0.0.80"
|
||||
}
|
||||
6
dist/build/mp-weixin/app.json
vendored
6
dist/build/mp-weixin/app.json
vendored
@ -94,6 +94,12 @@
|
||||
"iconPath": "/static/tabbar/home_icon.png",
|
||||
"selectedIconPath": "/static/tabbar/home_active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/ai/chat",
|
||||
"text": "管家在线",
|
||||
"iconPath": "/static/tabbar/news_active.png",
|
||||
"selectedIconPath": "/static/tabbar/news_active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/me/index",
|
||||
"text": "我的",
|
||||
|
||||
@ -1 +1 @@
|
||||
"use strict";let t=[{pagePath:"/pages/index/index",iconPath:"/static/tabbar/home_icon.png",selectedIconPath:"/static/tabbar/home_active.png",text:"首页"},{pagePath:"/pages/me/index",iconPath:"/static/tabbar/news_icon.png",selectedIconPath:"/static/tabbar/news_active.png",text:"我的"}];exports.setTabBar=function(e){var a,n,l,o,i;const c=getCurrentPages(),u=c[c.length-1];if(u){const o=(null==u?void 0:u.getTabBar)?null==u?void 0:u.getTabBar():null;let i=null==(l=null==(n=null==(a=null==e?void 0:e.companyConfig)?void 0:a.config_value)?void 0:n.menu)?void 0:l.map((t=>{var e,a,n,l;return{...t,iconPath:null==(a=null==(e=t.iconPath)?void 0:e[0])?void 0:a.url,selectedIconPath:null==(l=null==(n=t.selectedIconPath)?void 0:n[0])?void 0:l.url}}));getApp().globalData.menuList=i||t,o&&o.setData({list:i||t})}console.log("App.globalData.selectedOrg",null==(i=null==(o=null==e?void 0:e.companyConfig)?void 0:o.config_value)?void 0:i.menu)};
|
||||
"use strict";let t=[{pagePath:"/pages/index/index",iconPath:"/static/tabbar/home_icon.png",selectedIconPath:"/static/tabbar/home_active.png",text:"首页"},{pagePath:"/pages/ai/chat",iconPath:"/static/tabbar/news_icon.png",selectedIconPath:"/static/tabbar/news_active.png",text:"管家在线"},{pagePath:"/pages/me/index",iconPath:"/static/tabbar/news_icon.png",selectedIconPath:"/static/tabbar/news_active.png",text:"我的"}];exports.setTabBar=function(a){var e,n,l,o,c,i,s,u;const g=getCurrentPages(),p=g[g.length-1];if(p){const s=(null==p?void 0:p.getTabBar)?null==p?void 0:p.getTabBar():null;let u=null==(l=null==(n=null==(e=null==a?void 0:a.companyConfig)?void 0:e.config_value)?void 0:n.menu)?void 0:l.map((t=>{var a,e,n,l;return{...t,iconPath:null==(e=null==(a=t.iconPath)?void 0:a[0])?void 0:e.url,selectedIconPath:null==(l=null==(n=t.selectedIconPath)?void 0:n[0])?void 0:l.url}}));u.splice((null==(i=null==(c=null==(o=null==a?void 0:a.companyConfig)?void 0:o.config_value)?void 0:c.menu)?void 0:i.length)/2,0,{pagePath:"/pages/ai/chat",iconPath:"https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN63WTGSX2T5X8N233CJ5K0Q.png",selectedIconPath:"https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN63WTGSX2T5X8N233CJ5K0Q.png",text:"管家在线"}),getApp().globalData.menuList=u||t,s&&s.setData({list:u||t})}console.log("App.globalData.selectedOrg",null==(u=null==(s=null==a?void 0:a.companyConfig)?void 0:s.config_value)?void 0:u.menu)};
|
||||
|
||||
46
dist/build/mp-weixin/custom-tab-bar/index.js
vendored
46
dist/build/mp-weixin/custom-tab-bar/index.js
vendored
@ -1,23 +1,32 @@
|
||||
const App = getApp();
|
||||
const App = getApp()
|
||||
Component({
|
||||
data: {
|
||||
selected: App.globalData.selectedIndex,
|
||||
color: "#3D3D3D",
|
||||
selectedColor: "#3D3D3D",
|
||||
list: [{
|
||||
pagePath: "/pages/index/index",
|
||||
iconPath: "/static/tabbar/home_icon.png",
|
||||
selectedIconPath: "/static/tabbar/home_active.png",
|
||||
text: "首页"
|
||||
}, {
|
||||
pagePath: "/pages/me/index",
|
||||
iconPath: "/static/tabbar/news_icon.png",
|
||||
selectedIconPath: "/static/tabbar/news_active.png",
|
||||
text: "我的"
|
||||
},]
|
||||
color: '#3D3D3D',
|
||||
selectedColor: '#3D3D3D',
|
||||
list: [
|
||||
{
|
||||
pagePath: '/pages/index/index',
|
||||
iconPath: '/static/tabbar/home_icon.png',
|
||||
selectedIconPath: '/static/tabbar/home_active.png',
|
||||
text: '首页'
|
||||
},
|
||||
{
|
||||
pagePath: '/pages/ai/chat',
|
||||
iconPath: '/static/tabbar/news_icon.png',
|
||||
selectedIconPath: '/static/tabbar/news_active.png',
|
||||
text: '管家在线'
|
||||
},
|
||||
{
|
||||
pagePath: '/pages/me/index',
|
||||
iconPath: '/static/tabbar/news_icon.png',
|
||||
selectedIconPath: '/static/tabbar/news_active.png',
|
||||
text: '我的'
|
||||
}
|
||||
]
|
||||
},
|
||||
lifetimes: {
|
||||
attached: function() {
|
||||
attached: function () {
|
||||
// 监听路由变化,自动更新tab-bar选中状态
|
||||
const updateTabBar = () => {
|
||||
let _this = this
|
||||
@ -59,10 +68,13 @@ Component({
|
||||
list: getApp().globalData.menuList
|
||||
})
|
||||
console.log('switchTab fail', url)
|
||||
wx.switchTab({url, fail: (res) => {
|
||||
wx.switchTab({
|
||||
url,
|
||||
fail: res => {
|
||||
// wx.navigateTo({url})
|
||||
console.log('switchTab fail', res)
|
||||
}})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -1,8 +1,8 @@
|
||||
<!--miniprogram/custom-tab-bar/index.wxml-->
|
||||
<view class="tab-bar">
|
||||
<view class="tab-bar-border"></view>
|
||||
<view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
|
||||
<image src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></image>
|
||||
<view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view>
|
||||
<!-- <view class="tab-bar-border"></view>-->
|
||||
<view wx:for="{{list}}" wx:key="index" class="{{index === 1 ? 'tab-bar-item-center' : 'tab-bar-item'}}" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
|
||||
<image class="{{index === 1 ? 'tab-bar-item-icon' : ''}}" src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></image>
|
||||
<view wx:if="{{index !== 1}}" style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
19
dist/build/mp-weixin/custom-tab-bar/index.wxss
vendored
19
dist/build/mp-weixin/custom-tab-bar/index.wxss
vendored
@ -4,7 +4,11 @@
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 48px;
|
||||
background: white;
|
||||
/* background: url('https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN62JHV37KC4W8K8A391MS3Y.png')
|
||||
no-repeat; */
|
||||
background: url(' https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN62VGEVV8NSR4GDDQAYC2JV.png')
|
||||
no-repeat;
|
||||
background-size: 100% auto;
|
||||
display: flex;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
@ -27,12 +31,25 @@
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
.tab-bar-item-center {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tab-bar-item image {
|
||||
width: 27px;
|
||||
height: 27px;
|
||||
}
|
||||
|
||||
.tab-bar-item-center .tab-bar-item-icon {
|
||||
width: 120rpx !important;
|
||||
height: 120rpx !important;
|
||||
margin-bottom: 70rpx;
|
||||
}
|
||||
|
||||
.tab-bar-item view {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
2
dist/build/mp-weixin/pages/ai/chat.js
vendored
2
dist/build/mp-weixin/pages/ai/chat.js
vendored
File diff suppressed because one or more lines are too long
2
dist/build/mp-weixin/pages/ai/chat.wxml
vendored
2
dist/build/mp-weixin/pages/ai/chat.wxml
vendored
File diff suppressed because one or more lines are too long
2
dist/build/mp-weixin/pages/ai/chat.wxss
vendored
2
dist/build/mp-weixin/pages/ai/chat.wxss
vendored
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
"use strict";const e=require("../../../common/vendor.js");require("../../../common/libraries/getPageConfig.js");const r=require("../../../common/libraries/public.js");if(require("../../../common/store/useWeAppAuthStore.js"),require("../../../gen/Apis.js"),require("../../../common/libraries/request.js"),require("../../../common/store/useWorkStore.js"),require("../../../common/libraries/setTabBar.js"),require("../../../common/libraries/apiLoading.js"),!Array){e.resolveComponent("uni-icons")()}Math;const o=e.defineComponent({__name:"AiInput",setup(o){const i=()=>{e.index.navigateTo({url:"/pages/ai/chat"})};return(o,s)=>({a:e.p({type:"arrow-right",size:"20",color:"#A4A4A4"}),b:e.o(i),c:e.f(e.unref(r.quickActions),((r,o,i)=>({a:`/static/svg/${r.icon}`,b:e.t(r.label),c:`item_${o}`,d:e.o((o=>(r=>{e.index.navigateTo({url:`/pages/ai/chat?message=${null==r?void 0:r.message}`})})(r)),`item_${o}`)})))})}}),i=e._export_sfc(o,[["__scopeId","data-v-165fd657"]]);wx.createComponent(i);
|
||||
"use strict";const e=require("../../../common/vendor.js");require("../../../common/libraries/getPageConfig.js");const r=require("../../../common/libraries/public.js");if(require("../../../common/store/useWeAppAuthStore.js"),require("../../../gen/Apis.js"),require("../../../common/libraries/request.js"),require("../../../common/store/useWorkStore.js"),require("../../../common/libraries/setTabBar.js"),require("../../../common/libraries/apiLoading.js"),!Array){e.resolveComponent("uni-icons")()}Math;const o=e.defineComponent({__name:"AiInput",setup(o){const i=()=>{e.index.navigateTo({url:"/pages/ai/chat"})};return(o,s)=>({a:e.p({type:"arrow-right",size:"20",color:"#A4A4A4"}),b:e.o(i),c:e.f(e.unref(r.quickActions),((r,o,i)=>({a:`/static/svg/${r.icon}`,b:e.t(r.label),c:`item_${o}`,d:e.o((o=>(r=>{e.index.navigateTo({url:`/pages/ai/chat?message=${null==r?void 0:r.message}`})})(r)),`item_${o}`)})))})}}),i=e._export_sfc(o,[["__scopeId","data-v-726ad5ed"]]);wx.createComponent(i);
|
||||
|
||||
@ -1 +1 @@
|
||||
<view class="ai_contents data-v-165fd657"><view class="ai_contents_center data-v-165fd657"><view class="ai_contents_header data-v-165fd657"><image class="data-v-165fd657" src="https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN3YX35D5WJ22MQ1GH4X6BF0.png" mode="heightFix"/><text class="data-v-165fd657">我是客服邻邻,遇到问题了,可以问我哦~ </text></view><view class="ai_contents_input data-v-165fd657" bindtap="{{b}}"><view class="ai_input data-v-165fd657"> 点击联系在线客服 </view><uni-icons wx:if="{{a}}" class="data-v-165fd657" u-i="165fd657-0" bind:__l="__l" u-p="{{a}}"></uni-icons></view><view class="ai_footer data-v-165fd657"><scroll-view class="data-v-165fd657" scroll-x="true" style="height:80rpx"><view wx:for="{{c}}" wx:for-item="i" wx:key="c" class="items data-v-165fd657" bindtap="{{i.d}}"><view class="items_center data-v-165fd657"><image class="data-v-165fd657" src="{{i.a}}" mode="heightFix"/> {{i.b}}</view></view></scroll-view></view></view></view>
|
||||
<view class="ai_contents data-v-726ad5ed"><view class="ai_contents_center data-v-726ad5ed"><view class="ai_contents_header data-v-726ad5ed"><image class="data-v-726ad5ed" src="https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN3YX35D5WJ22MQ1GH4X6BF0.png" mode="heightFix"/><text class="data-v-726ad5ed">我是客服邻邻,遇到问题了,可以问我哦~ </text></view><view class="ai_contents_input data-v-726ad5ed" bindtap="{{b}}"><view class="ai_input data-v-726ad5ed"> 点击联系在线客服 </view><uni-icons wx:if="{{a}}" class="data-v-726ad5ed" u-i="726ad5ed-0" bind:__l="__l" u-p="{{a}}"></uni-icons></view><view class="ai_footer data-v-726ad5ed"><scroll-view class="data-v-726ad5ed" scroll-x="true" style="height:80rpx"><view wx:for="{{c}}" wx:for-item="i" wx:key="c" class="items data-v-726ad5ed" bindtap="{{i.d}}"><view class="items_center data-v-726ad5ed"><image class="data-v-726ad5ed" src="{{i.a}}" mode="heightFix"/> {{i.b}}</view></view></scroll-view></view></view></view>
|
||||
@ -1 +1 @@
|
||||
.ai_contents.data-v-165fd657{background-color:#fff;padding:6rpx;border-radius:20rpx;height:320rpx;margin:30rpx}.ai_contents .ai_contents_center.data-v-165fd657{border-radius:20rpx;background:linear-gradient(307deg,rgba(255,137,24,.06) -1%,rgba(255,255,255,0) 29%),linear-gradient(243deg,rgba(75,72,255,.06) 1%,rgba(255,255,255,0) 20%),linear-gradient(303deg,rgba(255,255,255,0) 71%,rgba(40,26,255,.08) 100%),linear-gradient(231deg,rgba(255,255,255,0) 76%,rgba(255,105,0,.06) 98%,rgba(255,145,68,.06) 98%);width:100%;height:100%}.ai_contents .ai_contents_center button.data-v-165fd657{padding:0;margin:0 30rpx;text-align:left;display:flex;align-items:center;background-color:transparent;height:90rpx;border-radius:100rpx;box-shadow:0 4px 10px 3px rgba(231,231,231,.3)}.ai_contents .ai_contents_header.data-v-165fd657{display:flex;align-items:center;color:#333;font-size:28rpx;padding:0 0 0 50rpx}.ai_contents .ai_contents_header image.data-v-165fd657{height:130rpx;position:relative;margin-top:-22rpx}.ai_contents .ai_contents_header text.data-v-165fd657{padding:5rpx 0 0 15rpx}.ai_contents .ai_contents_input.data-v-165fd657{display:flex;align-items:center;justify-content:space-between;background-color:#fff;border-radius:10rpx;padding:15rpx 20rpx;margin:5rpx 30rpx;box-shadow:0 4px 10px rgba(231,231,231,.3)}.ai_contents .ai_contents_input .ai_input.data-v-165fd657{flex:1;font-size:28rpx;color:#666}.ai_contents .ai_contents_input .ai_input input.data-v-165fd657{height:100%}.ai_contents .ai_footer.data-v-165fd657{padding:25rpx 0 0;white-space:nowrap}.ai_contents .ai_footer .items.data-v-165fd657{background-color:#fff;box-shadow:0 0 6px 3px rgba(199,199,199,.1);border-radius:10rpx;display:inline-block;height:70rpx;color:#3d3d3d;font-size:24rpx;padding:0 20rpx;margin-right:15rpx}.ai_contents .ai_footer .items.data-v-165fd657:first-child{margin-left:30rpx}.ai_contents .ai_footer .items.data-v-165fd657:last-child{margin-right:30rpx}.ai_contents .ai_footer .items .items_center.data-v-165fd657{display:flex;align-items:center;height:100%}.ai_contents .ai_footer .items image.data-v-165fd657{width:40rpx;height:40rpx;margin-right:10rpx}
|
||||
.ai_contents.data-v-726ad5ed{background-color:#fff;padding:6rpx;border-radius:20rpx;height:320rpx;margin:30rpx}.ai_contents .ai_contents_center.data-v-726ad5ed{border-radius:20rpx;background:linear-gradient(307deg,rgba(255,137,24,.06) -1%,rgba(255,255,255,0) 29%),linear-gradient(243deg,rgba(75,72,255,.06) 1%,rgba(255,255,255,0) 20%),linear-gradient(303deg,rgba(255,255,255,0) 71%,rgba(40,26,255,.08) 100%),linear-gradient(231deg,rgba(255,255,255,0) 76%,rgba(255,105,0,.06) 98%,rgba(255,145,68,.06) 98%);width:100%;height:100%}.ai_contents .ai_contents_center button.data-v-726ad5ed{padding:0;margin:0 30rpx;text-align:left;display:flex;align-items:center;background-color:transparent;height:90rpx;border-radius:100rpx;box-shadow:0 4px 10px 3px rgba(231,231,231,.3)}.ai_contents .ai_contents_header.data-v-726ad5ed{display:flex;align-items:center;color:#333;font-size:28rpx;padding:0 0 0 50rpx}.ai_contents .ai_contents_header image.data-v-726ad5ed{width:56rpx;height:130rpx;position:relative;margin-top:-22rpx}.ai_contents .ai_contents_header text.data-v-726ad5ed{padding:5rpx 0 0 15rpx}.ai_contents .ai_contents_input.data-v-726ad5ed{display:flex;align-items:center;justify-content:space-between;background-color:#fff;border-radius:10rpx;padding:15rpx 20rpx;margin:5rpx 30rpx;box-shadow:0 4px 10px rgba(231,231,231,.3)}.ai_contents .ai_contents_input .ai_input.data-v-726ad5ed{flex:1;font-size:28rpx;color:#666}.ai_contents .ai_contents_input .ai_input input.data-v-726ad5ed{height:100%}.ai_contents .ai_footer.data-v-726ad5ed{padding:25rpx 0 0;white-space:nowrap}.ai_contents .ai_footer .items.data-v-726ad5ed{background-color:#fff;box-shadow:0 0 6px 3px rgba(199,199,199,.1);border-radius:10rpx;display:inline-block;height:70rpx;color:#3d3d3d;font-size:24rpx;padding:0 20rpx;margin-right:15rpx}.ai_contents .ai_footer .items.data-v-726ad5ed:first-child{margin-left:30rpx}.ai_contents .ai_footer .items.data-v-726ad5ed:last-child{margin-right:30rpx}.ai_contents .ai_footer .items .items_center.data-v-726ad5ed{display:flex;align-items:center;height:100%}.ai_contents .ai_footer .items image.data-v-726ad5ed{width:40rpx;height:40rpx;margin-right:10rpx}
|
||||
|
||||
@ -1 +1 @@
|
||||
"use strict";const e=require("../../../common/vendor.js"),o=require("../../../common/libraries/apiLoading.js"),n=require("../../../gen/Apis.js");require("../../../common/libraries/request.js");const s=require("../../../common/store/useWeAppAuthStore.js");if(require("../../../common/store/useWorkStore.js"),require("../../../common/libraries/setTabBar.js"),!Array){(e.resolveComponent("hs-button")+e.resolveComponent("uni-icons")+e.resolveComponent("hs-popup-custom"))()}Math||((()=>"../../../components/hs-button/hs-button.js")+(()=>"../../../uni_modules/uni-icons/components/uni-icons/uni-icons.js")+(()=>"../../../components/hs-popup-custom/hs-popup-custom.js"))();const t=e.defineComponent({__name:"ModalServer",setup(t){const u=s.useWeAppAuthStore(),i=e.ref(!1),l=e.ref(!1),r=o=>{e.index.navigateTo({url:o||""})},a=()=>{i.value=!1,l.value=!1};e.onHide((()=>{a()}));return e.watch((()=>{var e;return null==(e=null==u?void 0:u.data)?void 0:e.is_house_exist}),(()=>{var e,o,n,s;!(null==(e=null==u?void 0:u.data)?void 0:e.user)||(null==(o=null==u?void 0:u.data)?void 0:o.house_occupant)||(null==(n=null==u?void 0:u.data)?void 0:n.house_register)||(i.value=!0),console.log(null==(s=null==u?void 0:u.data)?void 0:s.house_occupant,"house_occupant2")}),{deep:!0}),e.watch((()=>{var e;return null==(e=null==u?void 0:u.data)?void 0:e.user}),(()=>{var e,o;(null==(e=null==u?void 0:u.data)?void 0:e.user)&&(null==(o=null==u?void 0:u.data)||o.selected_house)}),{deep:!0}),e.onShow((async()=>{var s,t,i;await(null==(s=e.getCurrentInstance())?void 0:s.appContext.config.globalProperties.$onLaunched),(null==(t=null==u?void 0:u.data)?void 0:t.user)&&(null==(i=null==u?void 0:u.data)?void 0:i.selected_house)&&o.getApiLoading(n.Apis.Archive.HouseRegisters.GetOwnerIsAudit,{}).then((e=>{(null==e?void 0:e.data)&&(l.value=!0),console.log(e)}))})),(o,n)=>({a:e.o((e=>r("/INDEX/binding/index"))),b:e.p({label:"前往入住登记",size:"md",type:"primary"}),c:e.o(a),d:e.p({type:"close",size:"35",color:"#fff"}),e:e.o(a),f:e.p({show:i.value,mode:"center",title:"入住登记提醒"}),g:e.o((e=>r("/INDEX/owner_audit_list/index"))),h:e.p({label:"前往审核",size:"md",type:"primary"}),i:e.o(a),j:e.p({type:"close",size:"35",color:"#fff"}),k:e.o(a),l:e.p({show:l.value,mode:"center",title:"住户审核通知"})})}}),u=e._export_sfc(t,[["__scopeId","data-v-5109beae"]]);wx.createComponent(u);
|
||||
"use strict";const e=require("../../../common/vendor.js"),o=require("../../../common/libraries/apiLoading.js"),n=require("../../../gen/Apis.js");require("../../../common/libraries/request.js");const s=require("../../../common/store/useWeAppAuthStore.js");if(require("../../../common/store/useWorkStore.js"),require("../../../common/libraries/setTabBar.js"),!Array){(e.resolveComponent("hs-button")+e.resolveComponent("uni-icons")+e.resolveComponent("hs-popup-custom"))()}Math||((()=>"../../../components/hs-button/hs-button.js")+(()=>"../../../uni_modules/uni-icons/components/uni-icons/uni-icons.js")+(()=>"../../../components/hs-popup-custom/hs-popup-custom.js"))();const t=e.defineComponent({__name:"ModalServer",setup(t){const u=e.ref(!1),l=s.useWeAppAuthStore(),i=e.ref(!1),r=e.ref(!1),a=o=>{e.index.navigateTo({url:o||""})},d=()=>{i.value=!1,r.value=!1};e.onHide((()=>{d()}));return e.watch((()=>{var e;return null==(e=null==l?void 0:l.data)?void 0:e.is_house_exist}),(()=>{var e,o,n,s;!(null==(e=null==l?void 0:l.data)?void 0:e.user)||(null==(o=null==l?void 0:l.data)?void 0:o.house_occupant)||(null==(n=null==l?void 0:l.data)?void 0:n.house_register)||(i.value=!0),console.log(null==(s=null==l?void 0:l.data)?void 0:s.house_occupant,"house_occupant2")}),{deep:!0}),e.watch((()=>{var e;return null==(e=null==l?void 0:l.data)?void 0:e.user}),(()=>{var e,o;(null==(e=null==l?void 0:l.data)?void 0:e.user)&&(null==(o=null==l?void 0:l.data)||o.selected_house)}),{deep:!0}),e.onShow((async()=>{var s,t,i;await(null==(s=e.getCurrentInstance())?void 0:s.appContext.config.globalProperties.$onLaunched),(null==(t=null==l?void 0:l.data)?void 0:t.user)&&(null==(i=null==l?void 0:l.data)?void 0:i.selected_house)&&(u.value||o.getApiLoading(n.Apis.Archive.HouseRegisters.GetOwnerIsAudit,{}).then((e=>{(null==e?void 0:e.data)&&(r.value=!0,u.value=!0),console.log(e)})))})),(o,n)=>({a:e.o((e=>a("/INDEX/binding/index"))),b:e.p({label:"前往入住登记",size:"md",type:"primary"}),c:e.o(d),d:e.p({type:"close",size:"35",color:"#fff"}),e:e.o(d),f:e.p({show:i.value,mode:"center",title:"入住登记提醒"}),g:e.o((e=>a("/INDEX/owner_audit_list/index"))),h:e.p({label:"前往审核",size:"md",type:"primary"}),i:e.o(d),j:e.p({type:"close",size:"35",color:"#fff"}),k:e.o(d),l:e.p({show:r.value,mode:"center",title:"住户审核通知"})})}}),u=e._export_sfc(t,[["__scopeId","data-v-2c4ba4e3"]]);wx.createComponent(u);
|
||||
|
||||
@ -1 +1 @@
|
||||
<hs-popup-custom wx:if="{{f}}" class="data-v-5109beae" u-s="{{['footer','d']}}" u-i="5109beae-0" bind:__l="__l" u-p="{{f}}"><view class="popup_custom_content data-v-5109beae"><view class="bind_des data-v-5109beae"> 为了给您提供更精准的社区服务<view class="data-v-5109beae"/>请先完成房屋绑定哦~ </view><view class="bind_house_popup_footer data-v-5109beae"><hs-button wx:if="{{b}}" class="data-v-5109beae" bindclick="{{a}}" u-i="5109beae-1,5109beae-0" bind:__l="__l" u-p="{{b}}"/><view class="bind_house_popup_footer_later data-v-5109beae" bindtap="{{c}}"> 稍后绑定 </view></view></view><view class="bind_house_popup_close data-v-5109beae" bindtap="{{e}}" slot="footer"><uni-icons wx:if="{{d}}" class="data-v-5109beae" u-i="5109beae-2,5109beae-0" bind:__l="__l" u-p="{{d}}"></uni-icons></view></hs-popup-custom><hs-popup-custom wx:if="{{l}}" class="data-v-5109beae" u-s="{{['footer','d']}}" u-i="5109beae-3" bind:__l="__l" u-p="{{l}}"><view class="popup_custom_content data-v-5109beae"><view class="bind_des data-v-5109beae"> 您有一条房屋绑定审核申请<view class="data-v-5109beae"/>请及时处理~ </view><view class="bind_house_popup_footer data-v-5109beae"><hs-button wx:if="{{h}}" class="data-v-5109beae" bindclick="{{g}}" u-i="5109beae-4,5109beae-3" bind:__l="__l" u-p="{{h}}"/><view class="bind_house_popup_footer_later data-v-5109beae" bindtap="{{i}}"> 稍后处理 </view></view></view><view class="bind_house_popup_close data-v-5109beae" bindtap="{{k}}" slot="footer"><uni-icons wx:if="{{j}}" class="data-v-5109beae" u-i="5109beae-5,5109beae-3" bind:__l="__l" u-p="{{j}}"></uni-icons></view></hs-popup-custom>
|
||||
<hs-popup-custom wx:if="{{f}}" class="data-v-2c4ba4e3" u-s="{{['footer','d']}}" u-i="2c4ba4e3-0" bind:__l="__l" u-p="{{f}}"><view class="popup_custom_content data-v-2c4ba4e3"><view class="bind_des data-v-2c4ba4e3"> 为了给您提供更精准的社区服务<view class="data-v-2c4ba4e3"/>请先完成房屋绑定哦~ </view><view class="bind_house_popup_footer data-v-2c4ba4e3"><hs-button wx:if="{{b}}" class="data-v-2c4ba4e3" bindclick="{{a}}" u-i="2c4ba4e3-1,2c4ba4e3-0" bind:__l="__l" u-p="{{b}}"/><view class="bind_house_popup_footer_later data-v-2c4ba4e3" bindtap="{{c}}"> 稍后绑定 </view></view></view><view class="bind_house_popup_close data-v-2c4ba4e3" bindtap="{{e}}" slot="footer"><uni-icons wx:if="{{d}}" class="data-v-2c4ba4e3" u-i="2c4ba4e3-2,2c4ba4e3-0" bind:__l="__l" u-p="{{d}}"></uni-icons></view></hs-popup-custom><hs-popup-custom wx:if="{{l}}" class="data-v-2c4ba4e3" u-s="{{['footer','d']}}" u-i="2c4ba4e3-3" bind:__l="__l" u-p="{{l}}"><view class="popup_custom_content data-v-2c4ba4e3"><view class="bind_des data-v-2c4ba4e3"> 您有一条房屋绑定审核申请<view class="data-v-2c4ba4e3"/>请及时处理~ </view><view class="bind_house_popup_footer data-v-2c4ba4e3"><hs-button wx:if="{{h}}" class="data-v-2c4ba4e3" bindclick="{{g}}" u-i="2c4ba4e3-4,2c4ba4e3-3" bind:__l="__l" u-p="{{h}}"/><view class="bind_house_popup_footer_later data-v-2c4ba4e3" bindtap="{{i}}"> 稍后处理 </view></view></view><view class="bind_house_popup_close data-v-2c4ba4e3" bindtap="{{k}}" slot="footer"><uni-icons wx:if="{{j}}" class="data-v-2c4ba4e3" u-i="2c4ba4e3-5,2c4ba4e3-3" bind:__l="__l" u-p="{{j}}"></uni-icons></view></hs-popup-custom>
|
||||
@ -1 +1 @@
|
||||
.popup_custom_content.data-v-5109beae{text-align:center}.popup_custom_content .bind_des.data-v-5109beae{line-height:50rpx;padding:10rpx 0}.popup_custom_content .bind_house_popup_footer.data-v-5109beae{padding:40rpx 40rpx 0}.popup_custom_content .bind_house_popup_footer .bind_house_popup_footer_later.data-v-5109beae{text-align:center;color:#000;font-size:28rpx;padding:30rpx 0}.bind_house_popup_close.data-v-5109beae{text-align:center;padding-top:40rpx}
|
||||
.popup_custom_content.data-v-2c4ba4e3{text-align:center}.popup_custom_content .bind_des.data-v-2c4ba4e3{line-height:50rpx;padding:10rpx 0}.popup_custom_content .bind_house_popup_footer.data-v-2c4ba4e3{padding:40rpx 40rpx 0}.popup_custom_content .bind_house_popup_footer .bind_house_popup_footer_later.data-v-2c4ba4e3{text-align:center;color:#000;font-size:28rpx;padding:30rpx 0}.bind_house_popup_close.data-v-2c4ba4e3{text-align:center;padding-top:40rpx}
|
||||
|
||||
1
dist/dev/mp-weixin/app.js
vendored
1
dist/dev/mp-weixin/app.js
vendored
@ -15,6 +15,7 @@ if (!Math) {
|
||||
"./pages/forward/index.js";
|
||||
"./pages/me/index.js";
|
||||
"./pages/ai/chat.js";
|
||||
"./pages/ai/index.js";
|
||||
"./pages/web_view/index.js";
|
||||
"./WORKORDER/list/index.js";
|
||||
"./WORKORDER/add/index.js";
|
||||
|
||||
7
dist/dev/mp-weixin/app.json
vendored
7
dist/dev/mp-weixin/app.json
vendored
@ -6,6 +6,7 @@
|
||||
"pages/forward/index",
|
||||
"pages/me/index",
|
||||
"pages/ai/chat",
|
||||
"pages/ai/index",
|
||||
"pages/web_view/index"
|
||||
],
|
||||
"subPackages": [
|
||||
@ -94,6 +95,12 @@
|
||||
"iconPath": "/static/tabbar/home_icon.png",
|
||||
"selectedIconPath": "/static/tabbar/home_active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/ai/index",
|
||||
"text": "管家在线",
|
||||
"iconPath": "/static/tabbar/news_active.png",
|
||||
"selectedIconPath": "/static/tabbar/news_active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/me/index",
|
||||
"text": "我的",
|
||||
|
||||
@ -3,7 +3,7 @@ const common_vendor = require("../vendor.js");
|
||||
const common_store_useWeAppAuthStore = require("../store/useWeAppAuthStore.js");
|
||||
const http = new common_vendor.Request();
|
||||
http.setConfig((config) => {
|
||||
config.baseURL = "http://10.39.13.78:8002/api/";
|
||||
config.baseURL = "https://weapp-api.linyikj.com.cn/api/";
|
||||
config.header = {
|
||||
...config.header
|
||||
};
|
||||
|
||||
32
dist/dev/mp-weixin/common/libraries/setTabBar.js
vendored
32
dist/dev/mp-weixin/common/libraries/setTabBar.js
vendored
@ -1,32 +1,52 @@
|
||||
"use strict";
|
||||
let menu = [{
|
||||
let menu = [
|
||||
{
|
||||
pagePath: "/pages/index/index",
|
||||
iconPath: "/static/tabbar/home_icon.png",
|
||||
selectedIconPath: "/static/tabbar/home_active.png",
|
||||
text: "首页"
|
||||
}, {
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/ai/chat",
|
||||
iconPath: "/static/tabbar/news_icon.png",
|
||||
selectedIconPath: "/static/tabbar/news_active.png",
|
||||
text: "管家在线"
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/me/index",
|
||||
iconPath: "/static/tabbar/news_icon.png",
|
||||
selectedIconPath: "/static/tabbar/news_active.png",
|
||||
text: "我的"
|
||||
}];
|
||||
}
|
||||
];
|
||||
function setTabBar(res) {
|
||||
var _a, _b, _c, _d, _e;
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h;
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
if (currentPage) {
|
||||
const tabBar = (currentPage == null ? void 0 : currentPage.getTabBar) ? currentPage == null ? void 0 : currentPage.getTabBar() : null;
|
||||
let list = (_c = (_b = (_a = res == null ? void 0 : res.companyConfig) == null ? void 0 : _a.config_value) == null ? void 0 : _b.menu) == null ? void 0 : _c.map((i) => {
|
||||
var _a2, _b2, _c2, _d2;
|
||||
return { ...i, iconPath: (_b2 = (_a2 = i.iconPath) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.url, selectedIconPath: (_d2 = (_c2 = i.selectedIconPath) == null ? void 0 : _c2[0]) == null ? void 0 : _d2.url };
|
||||
return {
|
||||
...i,
|
||||
iconPath: (_b2 = (_a2 = i.iconPath) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.url,
|
||||
selectedIconPath: (_d2 = (_c2 = i.selectedIconPath) == null ? void 0 : _c2[0]) == null ? void 0 : _d2.url
|
||||
};
|
||||
});
|
||||
list.splice(((_f = (_e = (_d = res == null ? void 0 : res.companyConfig) == null ? void 0 : _d.config_value) == null ? void 0 : _e.menu) == null ? void 0 : _f.length) / 2, 0, {
|
||||
pagePath: "/pages/ai/index",
|
||||
iconPath: "https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN63WTGSX2T5X8N233CJ5K0Q.png",
|
||||
selectedIconPath: "https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN63WTGSX2T5X8N233CJ5K0Q.png",
|
||||
text: "管家在线"
|
||||
});
|
||||
getApp().globalData.menuList = list || menu;
|
||||
console.log("getApp().globalData", getApp().globalData, list);
|
||||
if (tabBar) {
|
||||
tabBar.setData({
|
||||
list: list || menu
|
||||
});
|
||||
}
|
||||
}
|
||||
console.log("App.globalData.selectedOrg", (_e = (_d = res == null ? void 0 : res.companyConfig) == null ? void 0 : _d.config_value) == null ? void 0 : _e.menu);
|
||||
console.log("App.globalData.selectedOrg", (_h = (_g = res == null ? void 0 : res.companyConfig) == null ? void 0 : _g.config_value) == null ? void 0 : _h.menu);
|
||||
}
|
||||
exports.setTabBar = setTabBar;
|
||||
|
||||
@ -29,8 +29,9 @@ const getUserLogin = {
|
||||
}
|
||||
},
|
||||
getLoginStatus() {
|
||||
var _a;
|
||||
if (!((_a = auth == null ? void 0 : auth.data) == null ? void 0 : _a.user)) {
|
||||
var _a, _b;
|
||||
console.log("auth?.data?.user:", (_a = auth == null ? void 0 : auth.data) == null ? void 0 : _a.user);
|
||||
if (!((_b = auth == null ? void 0 : auth.data) == null ? void 0 : _b.user)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
|
||||
@ -32,19 +32,19 @@ const useWeAppAuthStore = common_vendor.defineStore("we_app_auth", () => {
|
||||
gen_Apis.Apis.Login.Auth.Login({ code, app_id: wxAppId }).then((res) => {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
console.log("登录", res == null ? void 0 : res.data);
|
||||
data.value.user = (_a = res.data) == null ? void 0 : _a.user;
|
||||
data.value.selected_house = (_b = res.data) == null ? void 0 : _b.selected_house;
|
||||
data.value.config = (_c = res.data) == null ? void 0 : _c.config;
|
||||
common_libraries_setTabBar.setTabBar((_d = res == null ? void 0 : res.data) == null ? void 0 : _d.config);
|
||||
common_vendor.index.setStorageSync("ACCESS_TOKEN_CUSTOMER", (_f = (_e = res == null ? void 0 : res.data) == null ? void 0 : _e.token) == null ? void 0 : _f.token);
|
||||
if (data.value.user) {
|
||||
getIsHouseExist();
|
||||
}
|
||||
common_vendor.index.setStorageSync("ACCESS_TOKEN_CUSTOMER", (_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.token) == null ? void 0 : _b.token);
|
||||
app == null ? void 0 : app.appContext.config.globalProperties.$isResolve();
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
hasError.value = false;
|
||||
}, 300);
|
||||
app == null ? void 0 : app.appContext.config.globalProperties.$isResolve();
|
||||
data.value.selected_house = (_c = res.data) == null ? void 0 : _c.selected_house;
|
||||
data.value.user = (_d = res.data) == null ? void 0 : _d.user;
|
||||
data.value.config = (_e = res.data) == null ? void 0 : _e.config;
|
||||
common_libraries_setTabBar.setTabBar((_f = res == null ? void 0 : res.data) == null ? void 0 : _f.config);
|
||||
if (data.value.user) {
|
||||
getIsHouseExist();
|
||||
}
|
||||
}).catch(() => {
|
||||
loading.value = false;
|
||||
hasError.value = true;
|
||||
@ -64,7 +64,6 @@ const useWeAppAuthStore = common_vendor.defineStore("we_app_auth", () => {
|
||||
data.value.user = res.data.user;
|
||||
data.value.config = (_a = res.data) == null ? void 0 : _a.config;
|
||||
data.value.selected_house = (_b = res.data) == null ? void 0 : _b.selected_house;
|
||||
common_libraries_setTabBar.setTabBar((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.config);
|
||||
console.log("me", res.data);
|
||||
if (data.value.user) {
|
||||
getIsHouseExist();
|
||||
@ -73,6 +72,7 @@ const useWeAppAuthStore = common_vendor.defineStore("we_app_auth", () => {
|
||||
loading.value = false;
|
||||
hasError.value = false;
|
||||
}, 300);
|
||||
common_libraries_setTabBar.setTabBar((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.config);
|
||||
return fun == null ? void 0 : fun();
|
||||
});
|
||||
}
|
||||
|
||||
25
dist/dev/mp-weixin/common/vendor.js
vendored
25
dist/dev/mp-weixin/common/vendor.js
vendored
@ -11680,24 +11680,16 @@ class Request2 {
|
||||
}
|
||||
}
|
||||
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
||||
function getDefaultExportFromCjs(x) {
|
||||
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
||||
}
|
||||
var dayjs_minExports$1 = {};
|
||||
var dayjs_minExports = {};
|
||||
var dayjs_min = {
|
||||
get exports() {
|
||||
return dayjs_minExports$1;
|
||||
return dayjs_minExports;
|
||||
},
|
||||
set exports(v) {
|
||||
dayjs_minExports$1 = v;
|
||||
dayjs_minExports = v;
|
||||
}
|
||||
};
|
||||
var hasRequiredDayjs_min;
|
||||
function requireDayjs_min() {
|
||||
if (hasRequiredDayjs_min)
|
||||
return dayjs_minExports$1;
|
||||
hasRequiredDayjs_min = 1;
|
||||
(function(module2, exports2) {
|
||||
(function(module2, exports2) {
|
||||
!function(t2, e2) {
|
||||
module2.exports = e2();
|
||||
}(commonjsGlobal, function() {
|
||||
@ -11985,11 +11977,8 @@ function requireDayjs_min() {
|
||||
return O(1e3 * t3);
|
||||
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
||||
});
|
||||
})(dayjs_min);
|
||||
return dayjs_minExports$1;
|
||||
}
|
||||
var dayjs_minExports = requireDayjs_min();
|
||||
const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
|
||||
})(dayjs_min);
|
||||
const dayjs = dayjs_minExports;
|
||||
var relativeTimeExports = {};
|
||||
var relativeTime$1 = {
|
||||
get exports() {
|
||||
@ -12053,7 +12042,7 @@ var zhCn = {
|
||||
};
|
||||
(function(module2, exports2) {
|
||||
!function(e2, _) {
|
||||
module2.exports = _(requireDayjs_min());
|
||||
module2.exports = _(dayjs_minExports);
|
||||
}(commonjsGlobal, function(e2) {
|
||||
function _(e3) {
|
||||
return e3 && "object" == typeof e3 && "default" in e3 ? e3 : { default: e3 };
|
||||
|
||||
57
dist/dev/mp-weixin/custom-tab-bar/index.js
vendored
57
dist/dev/mp-weixin/custom-tab-bar/index.js
vendored
@ -1,39 +1,53 @@
|
||||
const App = getApp();
|
||||
const App = getApp()
|
||||
Component({
|
||||
data: {
|
||||
selected: App.globalData.selectedIndex,
|
||||
color: "#3D3D3D",
|
||||
selectedColor: "#3D3D3D",
|
||||
list: [{
|
||||
pagePath: "/pages/index/index",
|
||||
iconPath: "/static/tabbar/home_icon.png",
|
||||
selectedIconPath: "/static/tabbar/home_active.png",
|
||||
text: "首页"
|
||||
}, {
|
||||
pagePath: "/pages/me/index",
|
||||
iconPath: "/static/tabbar/news_icon.png",
|
||||
selectedIconPath: "/static/tabbar/news_active.png",
|
||||
text: "我的"
|
||||
},]
|
||||
color: '#3D3D3D',
|
||||
selectedColor: '#3D3D3D',
|
||||
list: [
|
||||
{
|
||||
pagePath: '/pages/index/index',
|
||||
iconPath: '/static/tabbar/home_icon.png',
|
||||
selectedIconPath: '/static/tabbar/home_active.png',
|
||||
text: '首页'
|
||||
},
|
||||
{
|
||||
pagePath: '/pages/ai/index',
|
||||
iconPath:
|
||||
'https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN63WTGSX2T5X8N233CJ5K0Q.png',
|
||||
selectedIconPath:
|
||||
'https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN63WTGSX2T5X8N233CJ5K0Q.png',
|
||||
text: '管家在线'
|
||||
},
|
||||
{
|
||||
pagePath: '/pages/me/index',
|
||||
iconPath: '/static/tabbar/news_icon.png',
|
||||
selectedIconPath: '/static/tabbar/news_active.png',
|
||||
text: '我的'
|
||||
}
|
||||
]
|
||||
},
|
||||
lifetimes: {
|
||||
attached: function() {
|
||||
attached: function () {
|
||||
// 监听路由变化,自动更新tab-bar选中状态
|
||||
const updateTabBar = () => {
|
||||
let _this = this
|
||||
const pages = getCurrentPages()
|
||||
const currentPage = pages[pages.length - 1]
|
||||
console.log('currentList', getApp().globalData.menuList)
|
||||
if (currentPage) {
|
||||
console.log('currentList', getApp().globalData, currentPage)
|
||||
if (currentPage && this.data.list) {
|
||||
const currentPath = currentPage.route
|
||||
const index = this.data.list.findIndex(item => item.pagePath === `/${currentPath}`)
|
||||
if (index !== -1) {
|
||||
this.setData({
|
||||
selected: index,
|
||||
list: getApp().globalData.menuList
|
||||
list: this.data.list
|
||||
})
|
||||
App.globalData.selectedIndex = index
|
||||
}
|
||||
if (!getApp().globalData.menuList) {
|
||||
getApp().globalData.menuList = this.data.list
|
||||
}
|
||||
}
|
||||
}
|
||||
// 初始化时执行一次
|
||||
@ -59,10 +73,13 @@ Component({
|
||||
list: getApp().globalData.menuList
|
||||
})
|
||||
console.log('switchTab fail', url)
|
||||
wx.switchTab({url, fail: (res) => {
|
||||
wx.switchTab({
|
||||
url,
|
||||
fail: res => {
|
||||
// wx.navigateTo({url})
|
||||
console.log('switchTab fail', res)
|
||||
}})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
13
dist/dev/mp-weixin/custom-tab-bar/index.wxml
vendored
13
dist/dev/mp-weixin/custom-tab-bar/index.wxml
vendored
@ -1,8 +1,11 @@
|
||||
<!--miniprogram/custom-tab-bar/index.wxml-->
|
||||
<view class="tab-bar">
|
||||
<view class="tab-bar-border"></view>
|
||||
<view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
|
||||
<image src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></image>
|
||||
<view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view>
|
||||
<view class="tab-bar" style="">
|
||||
<!-- <view class="tab-bar-border"></view>-->
|
||||
<view class='tab-bar-content'>
|
||||
<view wx:for="{{list}}" wx:key="index" class="{{index === 1 ? 'tab-bar-item-center' : 'tab-bar-item'}}" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
|
||||
<image class="{{index === 1 ? 'tab-bar-item-icon' : ''}}" src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></image>
|
||||
<view wx:if="{{index !== 1}}" style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="safe-area-inset-bottom"></view>
|
||||
</view>
|
||||
|
||||
33
dist/dev/mp-weixin/custom-tab-bar/index.wxss
vendored
33
dist/dev/mp-weixin/custom-tab-bar/index.wxss
vendored
@ -3,12 +3,22 @@
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 48px;
|
||||
background: white;
|
||||
display: flex;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
/* padding-bottom: env(safe-area-inset-bottom); */
|
||||
}
|
||||
.safe-area-inset-bottom {
|
||||
width: 100%;
|
||||
height: env(safe-area-inset-bottom);
|
||||
background-color: #fff;
|
||||
}
|
||||
.tab-bar-content {
|
||||
display: flex;
|
||||
height: 48px;
|
||||
width: 100%;
|
||||
background: url('https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN6H4Z5VTWGPRGQZ35CPYHF5.png')
|
||||
center no-repeat;
|
||||
background-size: 100%;
|
||||
}
|
||||
.tab-bar-border {
|
||||
background-color: rgba(0, 0, 0, 0.33);
|
||||
position: absolute;
|
||||
@ -27,12 +37,25 @@
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
.tab-bar-item-center {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tab-bar-item image {
|
||||
width: 27px;
|
||||
height: 27px;
|
||||
}
|
||||
|
||||
.tab-bar-item-center .tab-bar-item-icon {
|
||||
width: 120rpx !important;
|
||||
height: 120rpx !important;
|
||||
margin-bottom: 70rpx;
|
||||
}
|
||||
|
||||
.tab-bar-item view {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
161
dist/dev/mp-weixin/pages/ai/chat.js
vendored
161
dist/dev/mp-weixin/pages/ai/chat.js
vendored
@ -4,34 +4,33 @@ require("../../common/libraries/request.js");
|
||||
const common_store_useWeAppAuthStore = require("../../common/store/useWeAppAuthStore.js");
|
||||
require("../../common/store/useWorkStore.js");
|
||||
const common_libraries_upload = require("../../common/libraries/upload.js");
|
||||
const common_libraries_public = require("../../common/libraries/public.js");
|
||||
const common_libraries_userUserLogin = require("../../common/libraries/userUserLogin.js");
|
||||
require("../../gen/Apis.js");
|
||||
require("../../common/libraries/setTabBar.js");
|
||||
require("../../common/libraries/apiLoading.js");
|
||||
if (!Array) {
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
_easycom_uni_icons2();
|
||||
const _easycom_hs_empty2 = common_vendor.resolveComponent("hs-empty");
|
||||
const _easycom_hs_button2 = common_vendor.resolveComponent("hs-button");
|
||||
(_easycom_uni_icons2 + _easycom_hs_empty2 + _easycom_hs_button2)();
|
||||
}
|
||||
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||||
const _easycom_hs_empty = () => "../../components/hs-empty/hs-empty.js";
|
||||
const _easycom_hs_button = () => "../../components/hs-button/hs-button.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_icons();
|
||||
(_easycom_uni_icons + _easycom_hs_empty + _easycom_hs_button)();
|
||||
}
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
const _sfc_defineComponent = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "chat",
|
||||
setup(__props) {
|
||||
common_vendor.dayjs.extend(common_vendor.relativeTime);
|
||||
common_vendor.dayjs.locale("zh-cn");
|
||||
const auth = common_store_useWeAppAuthStore.useWeAppAuthStore();
|
||||
const userLoginStatus = common_vendor.ref(false);
|
||||
const inputMessage = common_vendor.ref("");
|
||||
const selectedImages = common_vendor.ref([]);
|
||||
const isInputFocused = common_vendor.ref(false);
|
||||
const messages = common_vendor.ref([
|
||||
{
|
||||
role: "ai",
|
||||
content: "您好!我是物业客服,有什么可以帮助您的吗?",
|
||||
quickQuestions: []
|
||||
}
|
||||
]);
|
||||
const messages = common_vendor.ref([]);
|
||||
const loading = common_vendor.ref(false);
|
||||
const loadingText = common_vendor.ref("正在输入中...");
|
||||
let socketTask = null;
|
||||
@ -44,30 +43,20 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
const isLoadingHistory = common_vendor.ref(false);
|
||||
const conversationId = common_vendor.ref("");
|
||||
const currentOffset = common_vendor.ref(0);
|
||||
const quickQuestionsData = common_vendor.ref([]);
|
||||
const quickQuestionsData = common_vendor.ref({});
|
||||
const lastMessageContent = common_vendor.ref("");
|
||||
const getQuickQuestions = async () => {
|
||||
var _a;
|
||||
try {
|
||||
let selected_house = (_a = auth == null ? void 0 : auth.data) == null ? void 0 : _a.selected_house;
|
||||
const response = await common_vendor.index.request({
|
||||
url: `${API_BASE_URL}/api/public/quick-questions`,
|
||||
url: `${API_BASE_URL}/api/public/quick-questions?platform=property&company_id=${selected_house == null ? void 0 : selected_house.companies_id}&project_id=${selected_house == null ? void 0 : selected_house.asset_projects_id}`,
|
||||
method: "GET"
|
||||
});
|
||||
if (response.statusCode === 200) {
|
||||
const result = response.data;
|
||||
let quickQuestions = [];
|
||||
if (result.data && Array.isArray(result.data)) {
|
||||
quickQuestions = result.data.map(
|
||||
(item) => item.question || item.title || item.text || item
|
||||
);
|
||||
} else if (result.questions && Array.isArray(result.questions)) {
|
||||
quickQuestions = result.questions.map(
|
||||
(item) => item.question || item.title || item.text || item
|
||||
);
|
||||
} else if (Array.isArray(result)) {
|
||||
quickQuestions = result.map((item) => item.question || item.title || item.text || item);
|
||||
}
|
||||
console.log("获取到开场白按钮数据:", quickQuestions);
|
||||
return quickQuestions;
|
||||
console.log("获取到开场白按钮数据2:", result);
|
||||
return result;
|
||||
} else {
|
||||
console.error("获取开场白数据失败,状态码:", response.statusCode);
|
||||
return [];
|
||||
@ -77,6 +66,11 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
return [];
|
||||
}
|
||||
};
|
||||
const goToPageLogin = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/login"
|
||||
});
|
||||
};
|
||||
const formatMessageContent = (content) => {
|
||||
if (!content || typeof content !== "string") {
|
||||
return [""];
|
||||
@ -267,19 +261,6 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
console.log("没有历史记录");
|
||||
messages.value = [];
|
||||
}
|
||||
common_vendor.nextTick$1(() => {
|
||||
if (quickQuestionsData.value.length > 0) {
|
||||
const welcomeMessage = {
|
||||
role: "ai",
|
||||
content: "您好!我是物业客服,有什么可以帮助您的吗?",
|
||||
quickQuestions: quickQuestionsData.value,
|
||||
created_at: new Date().toISOString()
|
||||
};
|
||||
messages.value.push(welcomeMessage);
|
||||
console.log("[Customer] 获取历史记录成功后,在历史记录后面push新开场白消息");
|
||||
scrollToBottom();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (historyMessages.length > 0) {
|
||||
setTimeout(() => {
|
||||
@ -567,6 +548,9 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
inputMessage.value = question;
|
||||
handleSendMessage();
|
||||
};
|
||||
const handleQuickFast = (name) => {
|
||||
handleQuickAction({ message: name });
|
||||
};
|
||||
const handleQuickAction = (action) => {
|
||||
inputMessage.value = action.message;
|
||||
handleSendMessage();
|
||||
@ -770,16 +754,41 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
}
|
||||
});
|
||||
common_vendor.onLoad(async (op) => {
|
||||
var _a, _b, _c;
|
||||
console.log(
|
||||
"页面加载时已获取开场白按钮数据1:",
|
||||
quickQuestionsData.value.length,
|
||||
(_a = common_libraries_userUserLogin.getUserLogin) == null ? void 0 : _a.getLoginStatus()
|
||||
);
|
||||
await ((_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$onLaunched);
|
||||
if ((_c = common_libraries_userUserLogin.getUserLogin) == null ? void 0 : _c.getLoginStatus()) {
|
||||
userLoginStatus.value = true;
|
||||
console.log("页面加载时已获取开场白按钮数据3:", quickQuestionsData.value.length);
|
||||
quickQuestionsData.value = await getQuickQuestions();
|
||||
console.log("页面加载时已获取开场白按钮数据:", quickQuestionsData.value.length);
|
||||
console.log("页面加载时已获取开场白按钮数据2:", quickQuestionsData.value.length);
|
||||
getHistoryMessages(1);
|
||||
if (op == null ? void 0 : op.message) {
|
||||
handleQuickAction(op);
|
||||
}
|
||||
} else {
|
||||
userLoginStatus.value = false;
|
||||
messages.value = [];
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
var _a, _b;
|
||||
return common_vendor.e({
|
||||
a: common_vendor.f(messages.value, (message, index, i0) => {
|
||||
a: userLoginStatus.value
|
||||
}, userLoginStatus.value ? common_vendor.e({
|
||||
b: common_vendor.t(((_a = quickQuestionsData.value) == null ? void 0 : _a.greeting_text) || "我是管家-邻邻,有什么可以帮助您的吗?"),
|
||||
c: common_vendor.f((_b = quickQuestionsData.value) == null ? void 0 : _b.questions, (i, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(i),
|
||||
b: `item_${index}`,
|
||||
c: common_vendor.o(($event) => handleQuickFast(i), `item_${index}`)
|
||||
};
|
||||
}),
|
||||
d: common_vendor.f(messages.value, (message, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: message.role === "ai"
|
||||
}, message.role === "ai" ? {} : {}, {
|
||||
@ -861,13 +870,13 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
H: common_vendor.n(message.role === "user" ? "user-message" : "ai-message")
|
||||
});
|
||||
}),
|
||||
b: loading.value
|
||||
e: loading.value
|
||||
}, loading.value ? {
|
||||
c: common_vendor.t(loadingText.value)
|
||||
f: common_vendor.t(loadingText.value)
|
||||
} : {}, {
|
||||
d: selectedImages.value.length > 0
|
||||
g: selectedImages.value.length > 0
|
||||
}, selectedImages.value.length > 0 ? common_vendor.e({
|
||||
e: common_vendor.f(selectedImages.value, (image, index, i0) => {
|
||||
h: common_vendor.f(selectedImages.value, (image, index, i0) => {
|
||||
return {
|
||||
a: image,
|
||||
b: "25c36616-0-" + i0,
|
||||
@ -875,60 +884,68 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
d: index
|
||||
};
|
||||
}),
|
||||
f: common_vendor.p({
|
||||
i: common_vendor.p({
|
||||
type: "closeempty",
|
||||
size: "14",
|
||||
color: "#fff"
|
||||
}),
|
||||
g: selectedImages.value.length < 9
|
||||
j: selectedImages.value.length < 9
|
||||
}, selectedImages.value.length < 9 ? {
|
||||
h: common_vendor.p({
|
||||
k: common_vendor.p({
|
||||
type: "plus",
|
||||
size: "30",
|
||||
color: "#999"
|
||||
}),
|
||||
i: common_vendor.o(chooseImage)
|
||||
l: common_vendor.o(chooseImage)
|
||||
} : {}) : {}, {
|
||||
j: common_vendor.f(common_vendor.unref(common_libraries_public.quickActions), (action, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(action.label),
|
||||
b: index,
|
||||
c: common_vendor.o(($event) => handleQuickAction(action), index)
|
||||
};
|
||||
}),
|
||||
k: common_vendor.o(($event) => isInputFocused.value = true),
|
||||
l: common_vendor.o(($event) => isInputFocused.value = false),
|
||||
m: common_vendor.o(handleSendMessage),
|
||||
n: inputMessage.value,
|
||||
o: common_vendor.o(($event) => inputMessage.value = $event.detail.value),
|
||||
p: !inputMessage.value.trim() && !isInputFocused.value && selectedImages.value.length === 0
|
||||
m: common_vendor.o(($event) => isInputFocused.value = true),
|
||||
n: common_vendor.o(($event) => isInputFocused.value = false),
|
||||
o: common_vendor.o(handleSendMessage),
|
||||
p: inputMessage.value,
|
||||
q: common_vendor.o(($event) => inputMessage.value = $event.detail.value),
|
||||
r: !inputMessage.value.trim() && !isInputFocused.value && selectedImages.value.length === 0
|
||||
}, !inputMessage.value.trim() && !isInputFocused.value && selectedImages.value.length === 0 ? {
|
||||
q: common_vendor.p({
|
||||
s: common_vendor.p({
|
||||
type: "camera",
|
||||
size: "24",
|
||||
color: "#666"
|
||||
}),
|
||||
r: common_vendor.o(chooseImage)
|
||||
t: common_vendor.o(chooseImage)
|
||||
} : {}, {
|
||||
s: (inputMessage.value.trim() || isInputFocused.value || selectedImages.value.length > 0) && !loading.value
|
||||
v: (inputMessage.value.trim() || isInputFocused.value || selectedImages.value.length > 0) && !loading.value
|
||||
}, (inputMessage.value.trim() || isInputFocused.value || selectedImages.value.length > 0) && !loading.value ? {
|
||||
t: common_vendor.p({
|
||||
w: common_vendor.p({
|
||||
type: "paperplane-filled",
|
||||
size: "20",
|
||||
color: "#fff"
|
||||
}),
|
||||
v: common_vendor.o(handleSendMessage)
|
||||
x: common_vendor.o(handleSendMessage)
|
||||
} : {}, {
|
||||
w: loading.value
|
||||
y: loading.value
|
||||
}, loading.value ? {
|
||||
x: common_vendor.p({
|
||||
z: common_vendor.p({
|
||||
type: "spinner-cycle",
|
||||
size: "20",
|
||||
color: "#ccc"
|
||||
})
|
||||
} : {});
|
||||
} : {}) : {
|
||||
A: common_vendor.p({
|
||||
height: "20vh",
|
||||
baseStyle: {
|
||||
paddingTop: "35%"
|
||||
},
|
||||
text: "登录体验更多功能"
|
||||
}),
|
||||
B: common_vendor.o(goToPageLogin),
|
||||
C: common_vendor.p({
|
||||
label: "去登录",
|
||||
size: "md",
|
||||
type: "primary"
|
||||
})
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/pages/ai/chat.vue"]]);
|
||||
_sfc_defineComponent.__runtimeHooks = 1;
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_defineComponent, [["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/pages/ai/chat.vue"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
|
||||
4
dist/dev/mp-weixin/pages/ai/chat.json
vendored
4
dist/dev/mp-weixin/pages/ai/chat.json
vendored
@ -2,6 +2,8 @@
|
||||
"navigationBarTitleText": "客服服务",
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {
|
||||
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
|
||||
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons",
|
||||
"hs-empty": "../../components/hs-empty/hs-empty",
|
||||
"hs-button": "../../components/hs-button/hs-button"
|
||||
}
|
||||
}
|
||||
2
dist/dev/mp-weixin/pages/ai/chat.wxml
vendored
2
dist/dev/mp-weixin/pages/ai/chat.wxml
vendored
@ -1 +1 @@
|
||||
<view class="chat-container"><view class="chat_container_linear_gradient"></view><view class="chat_messages_body"><view class="opening_remarks"><view class="opening_remarks_body"><view class="opening_remarks_server_img"><image src="https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN5XRPWKSMDDHRJTY4F2TG1G.png" mode="heightFix"/></view><view class="opening_remarks_server_info"><view class="label"> 我是管家-邻邻,有什么可以帮助您的吗? </view><view class="group_btn"><view class="group_btn_item"> 房屋绑定 </view><view class="group_btn_item"> 物业缴费 </view><view class="group_btn_item"> 工单报事 </view><view class="group_btn_item"> 社区服务 </view><view class="group_btn_item"> 访客邀请 </view><view class="group_btn_item"> 房屋管理 </view></view></view></view></view><view class="chat-messages"><view wx:for="{{a}}" wx:for-item="message" wx:key="F" id="{{message.G}}" class="{{['message-item', message.H]}}"><view wx:if="{{message.a}}" class="message-avatar"><image src="https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN43RH4M09FAFBD8D9TQPM2B.png" mode="aspectFit"/></view><view class="message-content-wrapper"><view class="message-content"><view wx:if="{{message.b}}" class="message-images"><view wx:for="{{message.c}}" wx:for-item="image" wx:key="c" class="{{['message-image-item', message.e && 'single-image']}}"><image src="{{image.a}}" mode="{{message.d}}" class="message-image" bindtap="{{image.b}}"/></view></view><view wx:elif="{{message.f}}" class="message-images"><view wx:for="{{message.g}}" wx:for-item="image" wx:key="c" class="{{['message-image-item', message.i && 'single-image']}}"><image src="{{image.a}}" mode="{{message.h}}" class="message-image" bindtap="{{image.b}}"/></view></view><view wx:elif="{{message.j}}" class="message-images"><view wx:for="{{message.k}}" wx:for-item="image" wx:key="c" class="{{['message-image-item', message.m && 'single-image']}}"><image src="{{image.a}}" mode="{{message.l}}" class="message-image" bindtap="{{image.b}}"/></view></view><block wx:if="{{message.n}}"><view wx:for="{{message.o}}" wx:for-item="line" wx:key="b" class="message-text-line"><text>{{line.a}}</text></view></block></view><view wx:if="{{message.p}}" class="quick-questions"><view wx:for="{{message.q}}" wx:for-item="question" wx:key="b" class="question-btn" bindtap="{{question.c}}"><text>{{question.a}}</text></view></view><view wx:if="{{message.r}}" class="confirmation-buttons"><view class="{{['confirmation-btn', message.s && 'selected', message.t && 'disabled']}}" bindtap="{{message.v}}"><text>是</text></view><view class="{{['confirmation-btn', message.w && 'selected', message.x && 'disabled']}}" bindtap="{{message.y}}"><text>否</text></view></view><view wx:if="{{message.z}}" class="message-meta"><view wx:if="{{message.A}}" class="copy-button" bindtap="{{message.B}}"><image src="/static/svg/copy.svg" mode="aspectFit" class="copy-icon"/></view><text class="message-time">{{message.C}}</text><view wx:if="{{message.D}}" class="copy-button" bindtap="{{message.E}}"><image src="/static/svg/copy.svg" mode="aspectFit" class="copy-icon"/></view></view></view></view><view wx:if="{{b}}" class="message-item ai-message"><view class="message-avatar"><image src="/static/svg/ai_icon.svg" mode="aspectFit"/></view><view class="message-content loading"><text>{{c}}</text></view></view></view><view class="chat-input-area"><view wx:if="{{d}}" class="image-preview-area"><view class="image-preview-list"><view wx:for="{{e}}" wx:for-item="image" wx:key="d" class="image-preview-item"><image src="{{image.a}}" mode="aspectFill" class="preview-image"/><view class="remove-image" bindtap="{{image.c}}"><uni-icons wx:if="{{f}}" u-i="{{image.b}}" bind:__l="__l" u-p="{{f}}"/></view></view><view wx:if="{{g}}" class="image-preview-item add-more-button" bindtap="{{i}}"><uni-icons wx:if="{{h}}" u-i="25c36616-1" bind:__l="__l" u-p="{{h}}"/><text class="add-more-text">添加图片</text></view></view></view><view class="quick-actions-bar"><view wx:for="{{j}}" wx:for-item="action" wx:key="b" class="quick-action-btn" bindtap="{{action.c}}"><text>{{action.a}}</text></view></view><view class="input-container"><input class="message-input" placeholder="请输入您的问题..." confirm-type="{{'send'}}" bindfocus="{{k}}" bindblur="{{l}}" bindconfirm="{{m}}" value="{{n}}" bindinput="{{o}}"/><view wx:if="{{p}}" class="upload-button" bindtap="{{r}}"><uni-icons wx:if="{{q}}" u-i="25c36616-2" bind:__l="__l" u-p="{{q}}"/></view><view wx:if="{{s}}" class="send-button" bindtap="{{v}}"><uni-icons wx:if="{{t}}" u-i="25c36616-3" bind:__l="__l" u-p="{{t}}"/></view><view wx:if="{{w}}" class="send-button disabled"><uni-icons wx:if="{{x}}" u-i="25c36616-4" bind:__l="__l" u-p="{{x}}"/></view></view></view></view></view>
|
||||
<view class="chat-container"><view class="chat_container_linear_gradient"></view><view wx:if="{{a}}" class="chat_messages_body"><view class="opening_remarks"><view class="opening_remarks_body"><view class="opening_remarks_server_img"><image src="https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN5XRPWKSMDDHRJTY4F2TG1G.png" mode="heightFix"/></view><view class="opening_remarks_server_info"><view class="label">{{b}}</view><view class="group_btn"><view wx:for="{{c}}" wx:for-item="i" wx:key="b" class="group_btn_item" bindtap="{{i.c}}">{{i.a}}</view></view></view></view></view><view class="chat-messages chat-messages-chat"><view wx:for="{{d}}" wx:for-item="message" wx:key="F" id="{{message.G}}" class="{{['message-item', message.H]}}"><view wx:if="{{message.a}}" class="message-avatar"><image src="https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN43RH4M09FAFBD8D9TQPM2B.png" mode="aspectFit"/></view><view class="message-content-wrapper"><view class="message-content"><view wx:if="{{message.b}}" class="message-images"><view wx:for="{{message.c}}" wx:for-item="image" wx:key="c" class="{{['message-image-item', message.e && 'single-image']}}"><image src="{{image.a}}" mode="{{message.d}}" class="message-image" bindtap="{{image.b}}"/></view></view><view wx:elif="{{message.f}}" class="message-images"><view wx:for="{{message.g}}" wx:for-item="image" wx:key="c" class="{{['message-image-item', message.i && 'single-image']}}"><image src="{{image.a}}" mode="{{message.h}}" class="message-image" bindtap="{{image.b}}"/></view></view><view wx:elif="{{message.j}}" class="message-images"><view wx:for="{{message.k}}" wx:for-item="image" wx:key="c" class="{{['message-image-item', message.m && 'single-image']}}"><image src="{{image.a}}" mode="{{message.l}}" class="message-image" bindtap="{{image.b}}"/></view></view><block wx:if="{{message.n}}"><view wx:for="{{message.o}}" wx:for-item="line" wx:key="b" class="message-text-line"><text>{{line.a}}</text></view></block></view><view wx:if="{{message.p}}" class="quick-questions"><view wx:for="{{message.q}}" wx:for-item="question" wx:key="b" class="question-btn" bindtap="{{question.c}}"><text>{{question.a}}</text></view></view><view wx:if="{{message.r}}" class="confirmation-buttons"><view class="{{['confirmation-btn', message.s && 'selected', message.t && 'disabled']}}" bindtap="{{message.v}}"><text>是</text></view><view class="{{['confirmation-btn', message.w && 'selected', message.x && 'disabled']}}" bindtap="{{message.y}}"><text>否</text></view></view><view wx:if="{{message.z}}" class="message-meta"><view wx:if="{{message.A}}" class="copy-button" bindtap="{{message.B}}"><image src="/static/svg/copy.svg" mode="aspectFit" class="copy-icon"/></view><text class="message-time">{{message.C}}</text><view wx:if="{{message.D}}" class="copy-button" bindtap="{{message.E}}"><image src="/static/svg/copy.svg" mode="aspectFit" class="copy-icon"/></view></view></view></view><view wx:if="{{e}}" class="message-item ai-message"><view class="message-avatar"><image src="/static/svg/ai_icon.svg" mode="aspectFit"/></view><view class="message-content loading"><text>{{f}}</text></view></view></view><view class="chat-input-area chat-input-area-chat"><view wx:if="{{g}}" class="image-preview-area"><view class="image-preview-list"><view wx:for="{{h}}" wx:for-item="image" wx:key="d" class="image-preview-item"><image src="{{image.a}}" mode="aspectFill" class="preview-image"/><view class="remove-image" bindtap="{{image.c}}"><uni-icons wx:if="{{i}}" u-i="{{image.b}}" bind:__l="__l" u-p="{{i}}"/></view></view><view wx:if="{{j}}" class="image-preview-item add-more-button" bindtap="{{l}}"><uni-icons wx:if="{{k}}" u-i="25c36616-1" bind:__l="__l" u-p="{{k}}"/><text class="add-more-text">添加图片</text></view></view></view><view class="input-container"><input class="message-input" placeholder="请输入您的问题..." confirm-type="{{'send'}}" bindfocus="{{m}}" bindblur="{{n}}" bindconfirm="{{o}}" value="{{p}}" bindinput="{{q}}"/><view wx:if="{{r}}" class="upload-button" bindtap="{{t}}"><uni-icons wx:if="{{s}}" u-i="25c36616-2" bind:__l="__l" u-p="{{s}}"/></view><view wx:if="{{v}}" class="send-button" bindtap="{{x}}"><uni-icons wx:if="{{w}}" u-i="25c36616-3" bind:__l="__l" u-p="{{w}}"/></view><view wx:if="{{y}}" class="send-button disabled"><uni-icons wx:if="{{z}}" u-i="25c36616-4" bind:__l="__l" u-p="{{z}}"/></view></view></view></view><view wx:else class="chat_messages_body"><hs-empty wx:if="{{A}}" u-i="25c36616-5" bind:__l="__l" u-p="{{A}}"/><view class="login_btn"><hs-button wx:if="{{C}}" bindclick="{{B}}" u-i="25c36616-6" bind:__l="__l" u-p="{{C}}"/></view></view></view>
|
||||
22
dist/dev/mp-weixin/pages/ai/chat.wxss
vendored
22
dist/dev/mp-weixin/pages/ai/chat.wxss
vendored
@ -5,13 +5,16 @@
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background: linear-gradient(180deg, rgba(208, 229, 255, 0.44) 0%, rgba(255, 255, 255, 0) 600rpx), linear-gradient(159deg, #d3d7ff 0%, rgba(255, 255, 255, 0) 400rpx), linear-gradient(188deg, #dffff3 -8%, #f7f7f7 600rpx);
|
||||
background: linear-gradient(180deg, rgba(208, 229, 255, 0.44) 0%, rgba(255, 255, 255, 0) 300rpx), linear-gradient(159deg, #d3d7ff 0%, rgba(255, 255, 255, 0) 150rpx), linear-gradient(188deg, #dffff3 -8%, #f7f7f7 300rpx);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.chat_messages_body {
|
||||
position: relative;
|
||||
z-index: 100;
|
||||
}
|
||||
.chat_messages_body .login_btn {
|
||||
padding: 0 50rpx;
|
||||
}
|
||||
.chat-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -22,10 +25,13 @@
|
||||
width: 100%;
|
||||
padding: 0 30rpx;
|
||||
padding-top: 314rpx;
|
||||
padding-bottom: calc(220rpx + env(safe-area-inset-bottom));
|
||||
padding-bottom: calc(260rpx + env(safe-area-inset-bottom));
|
||||
box-sizing: border-box;
|
||||
flex: 1;
|
||||
}
|
||||
.chat-messages-chat {
|
||||
padding-bottom: calc(160rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
.message-item {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
@ -242,9 +248,12 @@ to {
|
||||
background-color: #fff;
|
||||
border-top: 1px solid #f8f8f8;
|
||||
padding: 20rpx 20rpx;
|
||||
padding-bottom: calc(30rpx + env(safe-area-inset-bottom));
|
||||
padding-bottom: calc(155rpx + env(safe-area-inset-bottom));
|
||||
z-index: 100;
|
||||
}
|
||||
.chat-input-area-chat {
|
||||
padding-bottom: calc(30rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
.input-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -414,13 +423,14 @@ to {
|
||||
opacity: 0.7;
|
||||
}
|
||||
.opening_remarks {
|
||||
padding: 30rpx;
|
||||
padding: 30rpx 30rpx 10rpx 30rpx;
|
||||
z-index: 1000;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: linear-gradient(180deg, rgba(208, 229, 255, 0.44) 0%, rgba(255, 255, 255, 0) 600rpx), linear-gradient(159deg, #d3d7ff 0%, rgba(255, 255, 255, 0) 400rpx), linear-gradient(188deg, #dffff3 -8%, #f7f7f7 600rpx);
|
||||
background: linear-gradient(180deg, rgba(208, 229, 255, 0.44) 0%, rgba(255, 255, 255, 0) 300rpx), linear-gradient(159deg, #d3d7ff 0%, rgba(255, 255, 255, 0) 150rpx), linear-gradient(188deg, #dffff3 -8%, #f7f7f7 300rpx);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.opening_remarks .opening_remarks_body {
|
||||
height: 254rpx;
|
||||
@ -459,6 +469,8 @@ to {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
overflow: hidden;
|
||||
height: 160rpx;
|
||||
}
|
||||
.opening_remarks .opening_remarks_body .group_btn_item {
|
||||
background-color: #fff;
|
||||
|
||||
@ -1,27 +1,49 @@
|
||||
import { Merchant, Investor, Agent } from './updateMenu'
|
||||
import AllPages from '../../pages.json'
|
||||
let menu = [{
|
||||
pagePath: "/pages/index/index",
|
||||
iconPath: "/static/tabbar/home_icon.png",
|
||||
selectedIconPath: "/static/tabbar/home_active.png",
|
||||
text: "首页"
|
||||
}, {
|
||||
pagePath: "/pages/me/index",
|
||||
iconPath: "/static/tabbar/news_icon.png",
|
||||
selectedIconPath: "/static/tabbar/news_active.png",
|
||||
text: "我的"
|
||||
}]
|
||||
let menu = [
|
||||
{
|
||||
pagePath: '/pages/index/index',
|
||||
iconPath: '/static/tabbar/home_icon.png',
|
||||
selectedIconPath: '/static/tabbar/home_active.png',
|
||||
text: '首页'
|
||||
},
|
||||
{
|
||||
pagePath: '/pages/ai/chat',
|
||||
iconPath: '/static/tabbar/news_icon.png',
|
||||
selectedIconPath: '/static/tabbar/news_active.png',
|
||||
text: '管家在线'
|
||||
},
|
||||
{
|
||||
pagePath: '/pages/me/index',
|
||||
iconPath: '/static/tabbar/news_icon.png',
|
||||
selectedIconPath: '/static/tabbar/news_active.png',
|
||||
text: '我的'
|
||||
}
|
||||
]
|
||||
export function setTabBar(res: any) {
|
||||
const pages = getCurrentPages();
|
||||
const currentPage: any = pages[pages.length - 1];
|
||||
const pages = getCurrentPages()
|
||||
const currentPage: any = pages[pages.length - 1]
|
||||
if (currentPage) {
|
||||
const tabBar = currentPage?.getTabBar ? currentPage?.getTabBar() : null;
|
||||
let list = res?.companyConfig?.config_value?.menu?.map((i:any) =>({...i,iconPath: i.iconPath?.[0]?.url,selectedIconPath: i.selectedIconPath?.[0]?.url}))
|
||||
const tabBar = currentPage?.getTabBar ? currentPage?.getTabBar() : null
|
||||
let list = res?.companyConfig?.config_value?.menu?.map((i: any) => ({
|
||||
...i,
|
||||
iconPath: i.iconPath?.[0]?.url,
|
||||
selectedIconPath: i.selectedIconPath?.[0]?.url
|
||||
}))
|
||||
list.splice(res?.companyConfig?.config_value?.menu?.length / 2, 0, {
|
||||
pagePath: '/pages/ai/index',
|
||||
iconPath:
|
||||
'https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN63WTGSX2T5X8N233CJ5K0Q.png',
|
||||
selectedIconPath:
|
||||
'https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN63WTGSX2T5X8N233CJ5K0Q.png',
|
||||
text: '管家在线'
|
||||
})
|
||||
getApp().globalData.menuList = list || menu
|
||||
console.log('getApp().globalData', getApp().globalData, list)
|
||||
if (tabBar) {
|
||||
tabBar.setData({
|
||||
list: list || menu
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
console.log('App.globalData.selectedOrg', res?.companyConfig?.config_value?.menu)
|
||||
|
||||
@ -26,6 +26,7 @@ export default {
|
||||
}
|
||||
},
|
||||
getLoginStatus() {
|
||||
console.log('auth?.data?.user:', auth?.data?.user)
|
||||
if (!auth?.data?.user) {
|
||||
// 是否登录
|
||||
return false
|
||||
|
||||
@ -65,20 +65,20 @@ export const useWeAppAuthStore = defineStore('we_app_auth', () => {
|
||||
Apis.Login.Auth.Login({ code: code, app_id: wxAppId })
|
||||
.then(res => {
|
||||
console.log('登录', res?.data)
|
||||
data.value.user = res.data?.user
|
||||
data.value.selected_house = res.data?.selected_house
|
||||
data.value.config = res.data?.config
|
||||
//设置底部菜单
|
||||
setTabBar(res?.data?.config)
|
||||
uni.setStorageSync(import.meta.env.VITE_ACCESS_TOKEN_KEY, res?.data?.token?.token)
|
||||
if (data.value.user) {
|
||||
getIsHouseExist()
|
||||
}
|
||||
app?.appContext.config.globalProperties.$isResolve()
|
||||
setTimeout(() => {
|
||||
loading.value = false
|
||||
hasError.value = false
|
||||
}, 300)
|
||||
app?.appContext.config.globalProperties.$isResolve()
|
||||
data.value.selected_house = res.data?.selected_house
|
||||
data.value.user = res.data?.user
|
||||
data.value.config = res.data?.config
|
||||
//设置底部菜单
|
||||
setTabBar(res?.data?.config)
|
||||
if (data.value.user) {
|
||||
getIsHouseExist()
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
@ -99,8 +99,6 @@ export const useWeAppAuthStore = defineStore('we_app_auth', () => {
|
||||
data.value.user = res.data.user
|
||||
data.value.config = res.data?.config
|
||||
data.value.selected_house = res.data?.selected_house
|
||||
//设置底部菜单
|
||||
setTabBar(res?.data?.config)
|
||||
console.log('me', res.data)
|
||||
if (data.value.user) {
|
||||
getIsHouseExist()
|
||||
@ -109,6 +107,8 @@ export const useWeAppAuthStore = defineStore('we_app_auth', () => {
|
||||
loading.value = false
|
||||
hasError.value = false
|
||||
}, 300)
|
||||
//设置底部菜单
|
||||
setTabBar(res?.data?.config)
|
||||
return fun?.()
|
||||
})
|
||||
}
|
||||
|
||||
@ -1,39 +1,53 @@
|
||||
const App = getApp();
|
||||
const App = getApp()
|
||||
Component({
|
||||
data: {
|
||||
selected: App.globalData.selectedIndex,
|
||||
color: "#3D3D3D",
|
||||
selectedColor: "#3D3D3D",
|
||||
list: [{
|
||||
pagePath: "/pages/index/index",
|
||||
iconPath: "/static/tabbar/home_icon.png",
|
||||
selectedIconPath: "/static/tabbar/home_active.png",
|
||||
text: "首页"
|
||||
}, {
|
||||
pagePath: "/pages/me/index",
|
||||
iconPath: "/static/tabbar/news_icon.png",
|
||||
selectedIconPath: "/static/tabbar/news_active.png",
|
||||
text: "我的"
|
||||
},]
|
||||
color: '#3D3D3D',
|
||||
selectedColor: '#3D3D3D',
|
||||
list: [
|
||||
{
|
||||
pagePath: '/pages/index/index',
|
||||
iconPath: '/static/tabbar/home_icon.png',
|
||||
selectedIconPath: '/static/tabbar/home_active.png',
|
||||
text: '首页'
|
||||
},
|
||||
{
|
||||
pagePath: '/pages/ai/index',
|
||||
iconPath:
|
||||
'https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN63WTGSX2T5X8N233CJ5K0Q.png',
|
||||
selectedIconPath:
|
||||
'https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN63WTGSX2T5X8N233CJ5K0Q.png',
|
||||
text: '管家在线'
|
||||
},
|
||||
{
|
||||
pagePath: '/pages/me/index',
|
||||
iconPath: '/static/tabbar/news_icon.png',
|
||||
selectedIconPath: '/static/tabbar/news_active.png',
|
||||
text: '我的'
|
||||
}
|
||||
]
|
||||
},
|
||||
lifetimes: {
|
||||
attached: function() {
|
||||
attached: function () {
|
||||
// 监听路由变化,自动更新tab-bar选中状态
|
||||
const updateTabBar = () => {
|
||||
let _this = this
|
||||
const pages = getCurrentPages()
|
||||
const currentPage = pages[pages.length - 1]
|
||||
console.log('currentList', getApp().globalData.menuList)
|
||||
if (currentPage) {
|
||||
console.log('currentList', getApp().globalData, currentPage)
|
||||
if (currentPage && this.data.list) {
|
||||
const currentPath = currentPage.route
|
||||
const index = this.data.list.findIndex(item => item.pagePath === `/${currentPath}`)
|
||||
if (index !== -1) {
|
||||
this.setData({
|
||||
selected: index,
|
||||
list: getApp().globalData.menuList
|
||||
list: this.data.list
|
||||
})
|
||||
App.globalData.selectedIndex = index
|
||||
}
|
||||
if (!getApp().globalData.menuList) {
|
||||
getApp().globalData.menuList = this.data.list
|
||||
}
|
||||
}
|
||||
}
|
||||
// 初始化时执行一次
|
||||
@ -59,10 +73,13 @@ Component({
|
||||
list: getApp().globalData.menuList
|
||||
})
|
||||
console.log('switchTab fail', url)
|
||||
wx.switchTab({url, fail: (res) => {
|
||||
wx.switchTab({
|
||||
url,
|
||||
fail: res => {
|
||||
// wx.navigateTo({url})
|
||||
console.log('switchTab fail', res)
|
||||
}})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -1,8 +1,11 @@
|
||||
<!--miniprogram/custom-tab-bar/index.wxml-->
|
||||
<view class="tab-bar">
|
||||
<view class="tab-bar-border"></view>
|
||||
<view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
|
||||
<image src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></image>
|
||||
<view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view>
|
||||
<view class="tab-bar" style="">
|
||||
<!-- <view class="tab-bar-border"></view>-->
|
||||
<view class='tab-bar-content'>
|
||||
<view wx:for="{{list}}" wx:key="index" class="{{index === 1 ? 'tab-bar-item-center' : 'tab-bar-item'}}" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
|
||||
<image class="{{index === 1 ? 'tab-bar-item-icon' : ''}}" src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></image>
|
||||
<view wx:if="{{index !== 1}}" style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="safe-area-inset-bottom"></view>
|
||||
</view>
|
||||
|
||||
@ -3,12 +3,22 @@
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 48px;
|
||||
background: white;
|
||||
display: flex;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
/* padding-bottom: env(safe-area-inset-bottom); */
|
||||
}
|
||||
.safe-area-inset-bottom {
|
||||
width: 100%;
|
||||
height: env(safe-area-inset-bottom);
|
||||
background-color: #fff;
|
||||
}
|
||||
.tab-bar-content {
|
||||
display: flex;
|
||||
height: 48px;
|
||||
width: 100%;
|
||||
background: url('https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KN6H4Z5VTWGPRGQZ35CPYHF5.png')
|
||||
center no-repeat;
|
||||
background-size: 100%;
|
||||
}
|
||||
.tab-bar-border {
|
||||
background-color: rgba(0, 0, 0, 0.33);
|
||||
position: absolute;
|
||||
@ -27,12 +37,25 @@
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
.tab-bar-item-center {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tab-bar-item image {
|
||||
width: 27px;
|
||||
height: 27px;
|
||||
}
|
||||
|
||||
.tab-bar-item-center .tab-bar-item-icon {
|
||||
width: 120rpx !important;
|
||||
height: 120rpx !important;
|
||||
margin-bottom: 70rpx;
|
||||
}
|
||||
|
||||
.tab-bar-item view {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
@ -41,6 +41,13 @@
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/ai/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "客服服务",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/web_view/index"
|
||||
}
|
||||
@ -205,12 +212,14 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "工单提报"
|
||||
}
|
||||
},{
|
||||
},
|
||||
{
|
||||
"path": "pass/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "通行证"
|
||||
}
|
||||
},{
|
||||
},
|
||||
{
|
||||
"path": "release_items/list/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "放行记录"
|
||||
@ -361,12 +370,14 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "停车缴费记录"
|
||||
}
|
||||
},{
|
||||
},
|
||||
{
|
||||
"path": "visitor_applies/add/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "访客邀请"
|
||||
}
|
||||
},{
|
||||
},
|
||||
{
|
||||
"path": "visitor_applies/list/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "访客邀请记录"
|
||||
@ -398,6 +409,12 @@
|
||||
"iconPath": "/static/tabbar/home_icon.png",
|
||||
"selectedIconPath": "/static/tabbar/home_active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/ai/index",
|
||||
"text": "管家在线",
|
||||
"iconPath": "/static/tabbar/news_active.png",
|
||||
"selectedIconPath": "/static/tabbar/news_active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/me/index",
|
||||
"text": "我的",
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="chat-container">
|
||||
<view class="chat_container_linear_gradient"> </view>
|
||||
<view class="chat_messages_body">
|
||||
<view class="chat_messages_body" v-if="userLoginStatus">
|
||||
<view class="opening_remarks">
|
||||
<view class="opening_remarks_body">
|
||||
<view class="opening_remarks_server_img">
|
||||
@ -11,20 +11,24 @@
|
||||
/>
|
||||
</view>
|
||||
<view class="opening_remarks_server_info">
|
||||
<view class="label"> 我是管家-邻邻,有什么可以帮助您的吗? </view>
|
||||
<view class="label">
|
||||
{{ quickQuestionsData?.greeting_text || '我是管家-邻邻,有什么可以帮助您的吗?' }}
|
||||
</view>
|
||||
<view class="group_btn">
|
||||
<view class="group_btn_item"> 房屋绑定 </view>
|
||||
<view class="group_btn_item"> 物业缴费 </view>
|
||||
<view class="group_btn_item"> 工单报事 </view>
|
||||
<view class="group_btn_item"> 社区服务 </view>
|
||||
<view class="group_btn_item"> 访客邀请 </view>
|
||||
<view class="group_btn_item"> 房屋管理 </view>
|
||||
<view
|
||||
v-for="(i, index) in quickQuestionsData?.questions"
|
||||
:key="`item_${index}`"
|
||||
class="group_btn_item"
|
||||
@click="handleQuickFast(i)"
|
||||
>
|
||||
{{ i }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="chat-messages">
|
||||
<view class="chat-messages chat-messages-chat">
|
||||
<view
|
||||
v-for="(message, index) in messages"
|
||||
:key="index"
|
||||
@ -175,7 +179,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="chat-input-area">
|
||||
<view class="chat-input-area chat-input-area-chat">
|
||||
<!-- 图片预览区域 -->
|
||||
<view v-if="selectedImages.length > 0" class="image-preview-area">
|
||||
<view class="image-preview-list">
|
||||
@ -199,7 +203,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 快捷按钮栏 -->
|
||||
<view class="quick-actions-bar">
|
||||
<!-- <view class="quick-actions-bar">
|
||||
<view
|
||||
v-for="(action, index) in quickActions"
|
||||
:key="index"
|
||||
@ -208,7 +212,7 @@
|
||||
>
|
||||
<text>{{ action.label }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="input-container">
|
||||
<input
|
||||
@ -246,18 +250,25 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="chat_messages_body" v-else>
|
||||
<hs-empty height="20vh" :baseStyle="{ paddingTop: '35%' }" text="登录体验更多功能" />
|
||||
<view class="login_btn">
|
||||
<hs-button label="去登录" size="md" type="primary" @click="goToPageLogin" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, nextTick, onUnmounted } from 'vue'
|
||||
import { ref, nextTick, onUnmounted, getCurrentInstance } from 'vue'
|
||||
import { useWeAppAuthStore } from '@/common'
|
||||
import { onPullDownRefresh, onLoad } from '@dcloudio/uni-app'
|
||||
import { onPullDownRefresh, onLoad, onPageScroll, onShow } from '@dcloudio/uni-app'
|
||||
import dayjs from 'dayjs'
|
||||
import relativeTime from 'dayjs/plugin/relativeTime'
|
||||
import 'dayjs/locale/zh-cn'
|
||||
import { upload } from '@/common/libraries/upload'
|
||||
import { quickActions, QuickAction } from '@/common/libraries/public'
|
||||
import getLoginStatus from '@/common/libraries/userUserLogin'
|
||||
|
||||
// 配置dayjs
|
||||
dayjs.extend(relativeTime)
|
||||
@ -281,22 +292,19 @@ interface Message {
|
||||
}
|
||||
|
||||
const auth = useWeAppAuthStore()
|
||||
const userLoginStatus = ref(false)
|
||||
const inputMessage = ref('')
|
||||
const selectedImages = ref<string[]>([]) // 选中的图片
|
||||
const isInputFocused = ref(false) // 输入框是否聚焦
|
||||
const messages = ref<Message[]>([
|
||||
{
|
||||
role: 'ai',
|
||||
content: '您好!我是物业客服,有什么可以帮助您的吗?',
|
||||
quickQuestions: []
|
||||
}
|
||||
])
|
||||
const messages = ref<Message[]>([])
|
||||
const loading = ref(false)
|
||||
const loadingText = ref('正在输入中...')
|
||||
let socketTask: any = null
|
||||
let isConnected = ref(false)
|
||||
|
||||
// 接口域名配置
|
||||
// const API_BASE_URL = 'http://10.39.13.78:8000' //dev环境
|
||||
// const WS_BASE_URL = 'wss://10.39.13.78:8000' //dev环境
|
||||
const API_BASE_URL = 'https://kf-api-test.linyikj.com.cn' //测试环境
|
||||
const WS_BASE_URL = 'wss://kf-api-test.linyikj.com.cn' //测试环境
|
||||
|
||||
@ -307,36 +315,23 @@ const hasMore = ref(true)
|
||||
const isLoadingHistory = ref(false)
|
||||
const conversationId = ref<string>('') // 会话ID
|
||||
const currentOffset = ref(0) // 当前偏移量
|
||||
const quickQuestionsData = ref<string[]>([]) // 存储开场白数据
|
||||
const quickQuestionsData = ref<any>({}) // 存储开场白数据
|
||||
const lastMessageContent = ref('') // 用于防止重复显示相同的消息
|
||||
|
||||
// 获取开场白按钮数据
|
||||
const getQuickQuestions = async () => {
|
||||
try {
|
||||
let selected_house = auth?.data?.selected_house
|
||||
const response = await uni.request({
|
||||
url: `${API_BASE_URL}/api/public/quick-questions`,
|
||||
url: `${API_BASE_URL}/api/public/quick-questions?platform=property&company_id=${selected_house?.companies_id}&project_id=${selected_house?.asset_projects_id}`,
|
||||
method: 'GET'
|
||||
})
|
||||
|
||||
if (response.statusCode === 200) {
|
||||
const result = response.data as any
|
||||
let quickQuestions: string[] = []
|
||||
|
||||
// 处理不同的数据结构
|
||||
if (result.data && Array.isArray(result.data)) {
|
||||
quickQuestions = result.data.map(
|
||||
(item: any) => item.question || item.title || item.text || item
|
||||
)
|
||||
} else if (result.questions && Array.isArray(result.questions)) {
|
||||
quickQuestions = result.questions.map(
|
||||
(item: any) => item.question || item.title || item.text || item
|
||||
)
|
||||
} else if (Array.isArray(result)) {
|
||||
quickQuestions = result.map((item: any) => item.question || item.title || item.text || item)
|
||||
}
|
||||
|
||||
console.log('获取到开场白按钮数据:', quickQuestions)
|
||||
return quickQuestions
|
||||
console.log('获取到开场白按钮数据2:', result)
|
||||
return result
|
||||
} else {
|
||||
console.error('获取开场白数据失败,状态码:', response.statusCode)
|
||||
return []
|
||||
@ -347,6 +342,12 @@ const getQuickQuestions = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const goToPageLogin = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login'
|
||||
})
|
||||
}
|
||||
|
||||
// 格式化消息内容,处理换行符
|
||||
const formatMessageContent = (content: string) => {
|
||||
if (!content || typeof content !== 'string') {
|
||||
@ -611,19 +612,19 @@ const getHistoryMessages = async (page: number = 1) => {
|
||||
}
|
||||
|
||||
// 获取历史记录成功后,不管有没有历史数据,都在历史记录后面push一条新开场白信息
|
||||
nextTick(() => {
|
||||
if (quickQuestionsData.value.length > 0) {
|
||||
const welcomeMessage: Message = {
|
||||
role: 'ai',
|
||||
content: '您好!我是物业客服,有什么可以帮助您的吗?',
|
||||
quickQuestions: quickQuestionsData.value,
|
||||
created_at: new Date().toISOString()
|
||||
}
|
||||
messages.value.push(welcomeMessage)
|
||||
console.log('[Customer] 获取历史记录成功后,在历史记录后面push新开场白消息')
|
||||
scrollToBottom()
|
||||
}
|
||||
})
|
||||
// nextTick(() => {
|
||||
// if (quickQuestionsData.value.length > 0) {
|
||||
// const welcomeMessage: Message = {
|
||||
// role: 'ai',
|
||||
// content: '您好!我是物业客服,有什么可以帮助您的吗?',
|
||||
// quickQuestions: quickQuestionsData.value,
|
||||
// created_at: new Date().toISOString()
|
||||
// }
|
||||
// messages.value.push(welcomeMessage)
|
||||
// console.log('[Customer] 获取历史记录成功后,在历史记录后面push新开场白消息')
|
||||
// scrollToBottom()
|
||||
// }
|
||||
// })
|
||||
} else {
|
||||
// 加载更多,使用unshift插入到前面
|
||||
if (historyMessages.length > 0) {
|
||||
@ -1030,6 +1031,10 @@ const handleQuickQuestion = (question: string) => {
|
||||
handleSendMessage()
|
||||
}
|
||||
|
||||
const handleQuickFast = (name: string) => {
|
||||
handleQuickAction({ message: name })
|
||||
}
|
||||
|
||||
// 处理快捷按钮点击
|
||||
const handleQuickAction = (action: QuickAction) => {
|
||||
inputMessage.value = action.message
|
||||
@ -1284,18 +1289,27 @@ onUnmounted(() => {
|
||||
}
|
||||
})
|
||||
|
||||
// 页面加载时获取历史记录和开场白
|
||||
onLoad(async op => {
|
||||
// 始终获取开场白数据
|
||||
console.log(
|
||||
'页面加载时已获取开场白按钮数据1:',
|
||||
quickQuestionsData.value.length,
|
||||
getLoginStatus?.getLoginStatus()
|
||||
)
|
||||
await getCurrentInstance()?.appContext.config.globalProperties.$onLaunched
|
||||
if (getLoginStatus?.getLoginStatus()) {
|
||||
userLoginStatus.value = true
|
||||
console.log('页面加载时已获取开场白按钮数据3:', quickQuestionsData.value.length)
|
||||
quickQuestionsData.value = await getQuickQuestions()
|
||||
console.log('页面加载时已获取开场白按钮数据:', quickQuestionsData.value.length)
|
||||
|
||||
console.log('页面加载时已获取开场白按钮数据2:', quickQuestionsData.value.length)
|
||||
// 获取历史记录(如果有历史记录,会在接口返回成功后自动在最前方插入开场白)
|
||||
getHistoryMessages(1)
|
||||
|
||||
if (op?.message) {
|
||||
handleQuickAction(op as QuickAction)
|
||||
}
|
||||
} else {
|
||||
userLoginStatus.value = false
|
||||
messages.value = []
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
@ -6,14 +6,17 @@
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(208, 229, 255, 0.44) 0%, rgba(255, 255, 255, 0) 600rpx),
|
||||
linear-gradient(159deg, #d3d7ff 0%, rgba(255, 255, 255, 0) 400rpx),
|
||||
linear-gradient(188deg, #dffff3 -8%, #f7f7f7 600rpx);
|
||||
linear-gradient(180deg, rgba(208, 229, 255, 0.44) 0%, rgba(255, 255, 255, 0) 300rpx),
|
||||
linear-gradient(159deg, #d3d7ff 0%, rgba(255, 255, 255, 0) 150rpx),
|
||||
linear-gradient(188deg, #dffff3 -8%, #f7f7f7 300rpx);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.chat_messages_body {
|
||||
position: relative;
|
||||
z-index: 100;
|
||||
.login_btn {
|
||||
padding: 0 50rpx;
|
||||
}
|
||||
}
|
||||
.chat-container {
|
||||
display: flex;
|
||||
@ -27,10 +30,13 @@
|
||||
width: 100%;
|
||||
padding: 0 30rpx;
|
||||
padding-top: 314rpx;
|
||||
padding-bottom: calc(220rpx + env(safe-area-inset-bottom));
|
||||
padding-bottom: calc(260rpx + env(safe-area-inset-bottom));
|
||||
box-sizing: border-box;
|
||||
flex: 1;
|
||||
}
|
||||
.chat-messages-chat {
|
||||
padding-bottom: calc(160rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.message-item {
|
||||
display: flex;
|
||||
@ -285,9 +291,12 @@
|
||||
background-color: #fff;
|
||||
border-top: 1px solid #f8f8f8;
|
||||
padding: 20rpx 20rpx;
|
||||
padding-bottom: calc(30rpx + env(safe-area-inset-bottom));
|
||||
padding-bottom: calc(155rpx + env(safe-area-inset-bottom));
|
||||
z-index: 100;
|
||||
}
|
||||
.chat-input-area-chat {
|
||||
padding-bottom: calc(30rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.input-container {
|
||||
display: flex;
|
||||
@ -490,16 +499,18 @@
|
||||
}
|
||||
|
||||
.opening_remarks {
|
||||
padding: 30rpx;
|
||||
padding: 30rpx 30rpx 10rpx 30rpx;
|
||||
z-index: 1000;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(208, 229, 255, 0.44) 0%, rgba(255, 255, 255, 0) 600rpx),
|
||||
linear-gradient(159deg, #d3d7ff 0%, rgba(255, 255, 255, 0) 400rpx),
|
||||
linear-gradient(188deg, #dffff3 -8%, #f7f7f7 600rpx);
|
||||
linear-gradient(180deg, rgba(208, 229, 255, 0.44) 0%, rgba(255, 255, 255, 0) 300rpx),
|
||||
linear-gradient(159deg, #d3d7ff 0%, rgba(255, 255, 255, 0) 150rpx),
|
||||
linear-gradient(188deg, #dffff3 -8%, #f7f7f7 300rpx);
|
||||
background-repeat: no-repeat;
|
||||
|
||||
.opening_remarks_body {
|
||||
height: 254rpx;
|
||||
border-radius: 20rpx;
|
||||
@ -539,6 +550,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
overflow: hidden;
|
||||
height: 160rpx;
|
||||
&_item {
|
||||
background-color: #fff;
|
||||
border-radius: 100rpx;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user