2 lines
2.8 KiB
JavaScript
2 lines
2.8 KiB
JavaScript
"use strict";const e=require("../../common/vendor.js"),t=require("../VerifyLogin.js");Math||n();const n=()=>"../../pages/NewAddedPk/NewAddedPk2.js",o={__name:"tabBar",props:{tabIndex:Number},emits:["publishSucces"],setup(n,{emit:o}){require.async("../../TUIKit/components/TUIConversation/entry.js");let a=e.ref(!1);const s=e.ref([]);let c=e.ref(0);function i(e){s.value=e,c.value=function(e){let t=0;for(const n of e){if(!n.hasOwnProperty("unreadCount"))return null;const e=n.unreadCount;if("number"!=typeof e||!Number.isFinite(e))return null;t+=e}return t}(e)}e.onMounted((()=>{e.Jt.watch(e.o.CONV,{conversationList:i})})),e.onUnmounted((()=>{e.Jt.unwatch(e.o.CONV,{conversationList:i})}));const l=o;function u(){l("publishSucces")}let h=e.reactive([{iconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Pk.png",selectedIconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/PKClick.png",text:"PK",pagePath:"/pages/Home/Home",middleClass:""},{iconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Forum.png",selectedIconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Forumclick.png",text:"论坛",pagePath:"/pages/Forum/Forum",middleClass:""},{iconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/jiahao.png",selectedIconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/jiahao.png",text:"",pagePath:"/pages/c/c",middleClass:""},{iconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Message.png",selectedIconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Messageclick.png",text:"消息"},{iconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Mine.png",selectedIconPath:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Mineclick.png",text:"我的",pagePath:"/pages/Mine/Mine",middleClass:""}]);e.onMounted((()=>{!function(){let e=h.length;if(e%2){a.value=!0;let t=Math.floor(e/2);h[t].middleClass="mid-button"}}()})),e.index.getSystemInfo({success:function(e){e.safeArea.top}});const d=e.ref();const r=()=>!1;function p(n,o){3===o?t.VerifyLogin().then((t=>{t&&e.index.redirectTo({url:"/TUIKit/components/TUIConversation/index",animationType:"none"})})):2===o?t.VerifyLogin().then((e=>{e&&d.value.open()})):4===o?t.VerifyLogin().then((t=>{t&&e.index.switchTab({url:"/pages/Mine/Mine",animationType:"none"})})):e.index.switchTab({url:n.pagePath})}return(t,o)=>({a:e.f(e.unref(h),((t,o,a)=>e.e({a:n.tabIndex==o?t.selectedIconPath:t.iconPath,b:3===o&&e.unref(c)>0},3===o&&e.unref(c)>0?{c:e.t(e.unref(c)>99?"99+":e.unref(c))}:{},{d:e.t(t.text),e:n.tabIndex==o?"#1DD2F9":"#A7A3A3",f:e.n("list-item flex flex-column flex-middle "+t.middleClass),g:e.o$1((e=>p(t,o)),o),h:o}))),b:e.n(!0===e.unref(a)?"tab-list-middle":"tab-list-default"),c:e.o$1(r),d:e.sr(d,"c3a0cede-0",{k:"createModule"}),e:e.o$1(u)})}},a=e._export_sfc(o,[["__scopeId","data-v-c3a0cede"]]);wx.createComponent(a);
|