Files
smartDriveEEUniApp/unpackage/dist/build/mp-weixin/pages-subpackage/furniture_reception/furniture_reception-impl.js
2026-04-18 17:15:26 +08:00

2 lines
6.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";const e=require("../../common/vendor.js"),t={props:{incomingTab:{type:String,default:""}},components:{CommonBeginReception:()=>"./common_begin_reception.js",ServiceListFurniture:()=>"./serviceListFurniture.js",TagManagementPanel:()=>"./tag_management_panel.js"},data:()=>({activeTab:"status",navbarTop:"88rpx",contentTop:"160rpx",receptionForm:{id:"",customerName:"",contact:"",customerSource:"",gender:"女",age:"",dealershipId:"",dealershipName:"",salesId:"",salesName:"",salesPhone:"",recordingCount:0,intendedModel:"",infoCard:"",remark:"",detailedAddress:"",contactCount:0}}),watch:{incomingTab:{immediate:!0,handler(e){this.applyIncomingTab(e)}}},computed:{computedNavbarTop(){const t=e.index.getSystemInfoSync();return((t.statusBarHeight||20)+44)*(750/(t.windowWidth||t.screenWidth||375))+"rpx"},computedContentTop(){const t=e.index.getSystemInfoSync();return((t.statusBarHeight||20)+44)*(750/(t.windowWidth||t.screenWidth||375))+72+"rpx"}},onLoad(){console.log("[FurnitureReception][onLoad] 页面加载"),this.updateNavbarPosition(),this.loadCurrentUserInfo()},onShow(){console.log("[FurnitureReception][onShow] 页面显示"),this.$nextTick((()=>{this.updateNavbarPosition(),setTimeout((()=>{this.updateNavbarPosition(),console.log("[FurnitureReception][onShow] 延迟更新后的位置:",{navbarTop:this.navbarTop,contentTop:this.contentTop,computedNavbarTop:this.computedNavbarTop,computedContentTop:this.computedContentTop})}),50)}))},onReady(){console.log("[FurnitureReception][onReady] 页面渲染完成"),console.log("[FurnitureReception][onReady] activeTab:",this.activeTab),console.log("[FurnitureReception][onReady] navbarTop:",this.navbarTop),console.log("[FurnitureReception][onReady] contentTop:",this.contentTop),console.log("[FurnitureReception][onReady] computedNavbarTop:",this.computedNavbarTop),console.log("[FurnitureReception][onReady] computedContentTop:",this.computedContentTop),this.updateNavbarPosition(),this.initUrlHidingAfterPageLoad();const t=e.index.getSystemInfoSync();console.log("[FurnitureReception][onReady] 系统信息:",{statusBarHeight:t.statusBarHeight,windowHeight:t.windowHeight,screenHeight:t.screenHeight}),setTimeout((()=>{e.index.createSelectorQuery().in(this).select(".tabs").boundingClientRect((e=>{console.log("[FurnitureReception][onReady] tab栏元素信息:",e),e?(console.log("[FurnitureReception][onReady] tab栏位置:",{top:e.top,left:e.left,width:e.width,height:e.height,expectedTop:this.navbarTop,computedNavbarTop:this.computedNavbarTop,isVisible:e.width>0&&e.height>0,isOnScreen:e.top>=0&&e.top<t.windowHeight}),(0===e.width||0===e.height||e.top<0)&&(console.warn("[FurnitureReception][onReady] tab栏不可见强制更新位置"),this.updateNavbarPosition(),this.$forceUpdate())):console.error("[FurnitureReception][onReady] tab栏元素未找到")})).exec()}),100)},methods:{refreshPageData(){this.$nextTick((()=>{const e=this.$refs.serviceListRef;if("status"===this.activeTab)e&&"function"==typeof e.onServiceStatusRefresh&&e.onServiceStatusRefresh();else if("tag"===this.activeTab){const e=this.$refs.tagPanelRef;e&&"function"==typeof e.refreshTagList&&e.refreshTagList()}}))},scheduleTagPanelRefresh(){this.$nextTick((()=>{this.$nextTick((()=>{const e=this.$refs.tagPanelRef;e&&"function"==typeof e.refreshTagList&&e.refreshTagList()}))}))},applyIncomingTab(e){["status","reception","tag"].includes(e)&&(this.activeTab!==e&&(this.activeTab=e),"reception"===e?this.resetReceptionForm():"tag"===e?this.scheduleTagPanelRefresh():"status"===e&&this.$nextTick((()=>{this.refreshPageData()})))},updateNavbarPosition(){console.log("[FurnitureReception][updateNavbarPosition] 开始更新导航栏位置");const t=e.index.getSystemInfoSync().statusBarHeight||20,o=2*t+88,n=o+"rpx",i=o+72+"rpx";console.log("[FurnitureReception][updateNavbarPosition] 更新导航栏位置:",{statusBarHeight:t,navbarHeight:44,totalNavbarHeight:o,navbarTop:n,contentTop:i,currentNavbarTop:this.navbarTop,currentContentTop:this.contentTop}),this.$set(this,"navbarTop",n),this.$set(this,"contentTop",i),this.$forceUpdate()},loadCurrentUserInfo(){try{const t=e.index.getStorageSync("backend-login-response")||{};t.userName&&(this.receptionForm.salesName=t.userName),t.phone?this.receptionForm.salesPhone=t.phone:t.userName&&(this.receptionForm.salesPhone=t.userName),t.userId&&(this.receptionForm.salesId=String(t.userId))}catch(t){console.error("加载当前登录用户信息失败:",t)}},goBack(){getCurrentPages().length<=1?e.index.switchTab({url:"/pages/workbench/workbench",fail:e=>{console.error("[FurnitureReception][goBack] 切回工作台失败:",e)}}):e.index.navigateBack({fail:e=>{console.error("[FurnitureReception][goBack] 返回失败:",e)}})},switchTab(e){this.activeTab=e,"reception"===e?this.resetReceptionForm():"tag"===e&&this.scheduleTagPanelRefresh()},resetReceptionForm(){this.receptionForm={id:"",customerName:"",contact:"",customerSource:"",gender:"女",age:"",dealershipId:"",dealershipName:"",salesId:"",salesName:"",salesPhone:"",recordingCount:0,intendedModel:"",infoCard:"",remark:"",detailedAddress:"",contactCount:0},this.loadCurrentUserInfo()},onReceptionCancel(){this.resetReceptionForm()},onReceptionSaveSuccess({action:e,data:t}){t&&(this.receptionForm={...this.receptionForm,...t}),this.resetReceptionForm(),"start"===e&&console.log("开始接待成功",t)},onReceptionSaveError({action:e,error:t}){console.error("保存失败:",t)},initUrlHidingAfterPageLoad(){},attemptUrlHidingForCurrentPage(){},setupTabNavigationHiding(){},setupBrowserNavigationHiding(){}}};if(!Array){(e.resolveComponent("uni-nav-bar")+e.resolveComponent("service-list-furniture")+e.resolveComponent("common-begin-reception")+e.resolveComponent("tag-management-panel"))()}Math;const o=e._export_sfc(t,[["render",function(t,o,n,i,a,r){return e.e({a:e.o(r.goBack,"66"),b:e.p({fixed:!0,statusBar:!0,border:!1,title:"AI销冠系统",leftIcon:"left",color:"#333",backgroundColor:"#FFFFFF"}),c:"reception"===a.activeTab?1:"",d:e.o((e=>r.switchTab("reception")),"5d"),e:"status"===a.activeTab?1:"",f:e.o((e=>r.switchTab("status")),"a2"),g:"tag"===a.activeTab?1:"",h:e.o((e=>r.switchTab("tag")),"4c"),i:r.computedNavbarTop||a.navbarTop,j:"status"===a.activeTab},"status"===a.activeTab?{k:e.sr("serviceListRef","638dc4bb-1"),l:r.computedContentTop||a.contentTop}:{},{m:"reception"===a.activeTab},"reception"===a.activeTab?{n:r.computedContentTop||a.contentTop,o:e.o(r.onReceptionCancel,"4b"),p:e.o(r.onReceptionSaveSuccess,"7b"),q:e.o(r.onReceptionSaveError,"fc"),r:e.p({"initial-data":a.receptionForm})}:{},{s:"tag"===a.activeTab},"tag"===a.activeTab?{t:e.sr("tagPanelRef","638dc4bb-3"),v:e.p({"content-top":r.computedContentTop||a.contentTop})}:{})}]]);wx.createComponent(o);