Files
smartDriveEEUniApp/unpackage/dist/build/mp-weixin/pages/xixi/xixi.js
2026-04-17 07:35:37 +08:00

2 lines
4.0 KiB
JavaScript

"use strict";const e=require("../../common/vendor.js");function t(){if(void 0!==e.wx$1&&e.wx$1.getWindowInfo)try{const t=e.wx$1.getWindowInfo();return{statusBarHeight:t.statusBarHeight||20,windowWidth:t.windowWidth,windowHeight:t.windowHeight}}catch(t){console.warn("[Xixi] wx.getWindowInfo failed:",t)}try{const t=e.index.getSystemInfoSync();return{statusBarHeight:t.statusBarHeight||20,windowWidth:t.windowWidth,windowHeight:t.windowHeight}}catch(t){return{statusBarHeight:20,windowWidth:375,windowHeight:667}}}const i={who:"我是谁",meet:"约会准备",record:"幸福相遇",diag:"诊断结果",advice:"约会建议"},o={components:{},data:()=>({viewMode:"home",detailKey:null,contentTop:2*t().statusBarHeight+88+"rpx",contentBottom:"96rpx",diagTick:0,adviceRefreshTick:0}),computed:{computedContentTop:()=>2*t().statusBarHeight+88+"rpx",navTitle(){return"detail"===this.viewMode&&this.detailKey&&i[this.detailKey]?i[this.detailKey]:"喜喜"}},onLoad(){this.updateNavbarPosition(),setTimeout((()=>this.preloadSubpackage()),100)},onShow(){this.diagTick+=1,this.adviceRefreshTick+=1,this.$nextTick((()=>{this.updateNavbarPosition(),setTimeout((()=>this.updateNavbarPosition()),50)}))},onReady(){this.$nextTick((()=>{e.index.createSelectorQuery().in(this).select(".uni-navbar__content").boundingClientRect((e=>{if(e&&e.height){const t=Math.max(2*e.height-4,0);this.$set(this,"contentTop",t+"rpx")}else{const e=2*t().statusBarHeight+88;this.$set(this,"contentTop",Math.max(e-4,0)+"rpx")}})).exec();e.index.createSelectorQuery().in(this).select(".tabbar").boundingClientRect((e=>{if(e&&e.height){const t=Math.max(2*e.height-4,0);this.$set(this,"contentBottom",t+"rpx")}else this.$set(this,"contentBottom","96rpx")})).exec(),setTimeout((()=>{e.index.createSelectorQuery().in(this).select(".uni-navbar__content").boundingClientRect((e=>{if(e&&e.height){const t=Math.max(2*e.height-4,0);this.$set(this,"contentTop",t+"rpx")}})).exec();e.index.createSelectorQuery().in(this).select(".tabbar").boundingClientRect((e=>{if(e&&e.height){const t=Math.max(2*e.height-4,0);this.$set(this,"contentBottom",t+"rpx")}})).exec()}),200)}))},methods:{preloadSubpackage(){void 0!==e.wx$1&&e.wx$1.loadSubpackage&&e.wx$1.loadSubpackage({name:"pages-subpackage",success:()=>console.log("[Xixi] subpackage loaded"),fail:e=>console.warn("[Xixi] subpackage preload:",e)})},updateNavbarPosition(){const e=2*t().statusBarHeight+88;this.$set(this,"contentTop",e+"rpx"),this.$forceUpdate()},onNavLeftClick(){if("detail"===this.viewMode)return void this.backHome();getCurrentPages().length<=1||e.index.navigateBack({fail:e=>console.error("[Xixi] navigateBack:",e)})},openDetail(e){this.detailKey=e,this.viewMode="detail","diag"!==e&&"record"!==e||(this.diagTick+=1),"advice"===e&&(this.adviceRefreshTick+=1)},backHome(){this.viewMode="home",this.detailKey=null},onFormSaved(){},onRecordingsChanged(){this.diagTick+=1}}};if(!Array){(e.resolveComponent("uni-nav-bar")+e.resolveComponent("XixiWhoAmI")+e.resolveComponent("XixiFirstMeeting")+e.resolveComponent("XixiRecord")+e.resolveComponent("XixiDiagnosis")+e.resolveComponent("XixiDatingAdvice"))()}Math;const n=e._export_sfc(o,[["render",function(t,i,o,n,a,s){return{a:e.o(s.onNavLeftClick,"ee"),b:e.p({fixed:!0,statusBar:!0,border:!1,title:s.navTitle,leftIcon:"detail"===a.viewMode?"left":"",color:"#333",backgroundColor:"#FFFFFF"}),c:e.o((e=>s.openDetail("who")),"19"),d:e.o((e=>s.openDetail("meet")),"c2"),e:e.o((e=>s.openDetail("advice")),"1a"),f:e.o((e=>s.openDetail("record")),"31"),g:e.o((e=>s.openDetail("diag")),"0a"),h:"home"===a.viewMode,i:s.computedContentTop||a.contentTop,j:a.contentBottom||"96rpx",k:e.o(s.onFormSaved,"a3"),l:"who"===a.detailKey,m:e.o(s.onFormSaved,"aa"),n:"meet"===a.detailKey,o:e.o(s.onRecordingsChanged,"f1"),p:"record"===a.detailKey,q:e.p({"refresh-tick":a.diagTick}),r:"diag"===a.detailKey,s:e.p({"refresh-tick":a.adviceRefreshTick}),t:"advice"===a.detailKey,v:"detail"===a.viewMode,w:s.computedContentTop||a.contentTop,x:a.contentBottom||"96rpx"}}],["__scopeId","data-v-c063f8dd"]]);wx.createPage(n);