优化页面
This commit is contained in:
@@ -3,7 +3,6 @@ const common_vendor = require("../common/vendor.js");
|
||||
function TUIlogin(chatInfo, info, userSig) {
|
||||
common_vendor.index.$SDKAppID = chatInfo;
|
||||
common_vendor.index.$userID = String(info);
|
||||
common_vendor.index.__f__("log", "at components/TUILogin.js:9", "TUIlogin", chatInfo, info, userSig);
|
||||
common_vendor.index.$userSig = userSig;
|
||||
common_vendor.A.login({
|
||||
SDKAppID: common_vendor.index.$SDKAppID,
|
||||
|
||||
@@ -3,7 +3,7 @@ const common_vendor = require("../common/vendor.js");
|
||||
const components_addPrefixToHeaderIcon = require("./addPrefixToHeaderIcon.js");
|
||||
function request(urldata) {
|
||||
const { url, data, method, header, userInfo } = urldata;
|
||||
const baseUrl = "http://192.168.0.218:8086/" + url;
|
||||
const baseUrl = "http://120.26.251.180:8086/" + url;
|
||||
if (userInfo) {
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.getStorage({
|
||||
@@ -17,7 +17,6 @@ function request(urldata) {
|
||||
method,
|
||||
header,
|
||||
success: function(res2) {
|
||||
common_vendor.index.__f__("log", "at components/request.js:21", "请求成功1", res2.data);
|
||||
resolve(components_addPrefixToHeaderIcon.addPrefixToHeaderIcon(res2.data));
|
||||
},
|
||||
fail: function(res2) {
|
||||
@@ -48,7 +47,6 @@ function request(urldata) {
|
||||
method,
|
||||
header,
|
||||
success: function(res) {
|
||||
common_vendor.index.__f__("log", "at components/request.js:53", "请求成功2", res);
|
||||
resolve(components_addPrefixToHeaderIcon.addPrefixToHeaderIcon(res.data));
|
||||
},
|
||||
fail: function(res) {
|
||||
|
||||
@@ -11,8 +11,10 @@ const _sfc_main = {
|
||||
tabIndex: Number
|
||||
},
|
||||
setup(__props) {
|
||||
require.async("../../TUIKit/components/TUIConversation/entry.js");
|
||||
let showMiddleButton = common_vendor.ref(false);
|
||||
const conversationList = common_vendor.ref([]);
|
||||
let Unread = common_vendor.ref(0);
|
||||
common_vendor.onMounted(() => {
|
||||
common_vendor.Jt.watch(common_vendor.o.CONV, {
|
||||
conversationList: onConversationListUpdated
|
||||
@@ -25,7 +27,21 @@ const _sfc_main = {
|
||||
});
|
||||
function onConversationListUpdated(list) {
|
||||
conversationList.value = list;
|
||||
common_vendor.index.__f__("log", "at components/tabBar/tabBar.vue:51", "conversationList", list);
|
||||
Unread.value = calculateUnreadCount(list);
|
||||
}
|
||||
function calculateUnreadCount(arr) {
|
||||
let total = 0;
|
||||
for (const item of arr) {
|
||||
if (!item.hasOwnProperty("unreadCount")) {
|
||||
return null;
|
||||
}
|
||||
const count = item.unreadCount;
|
||||
if (typeof count !== "number" || !Number.isFinite(count)) {
|
||||
return null;
|
||||
}
|
||||
total += count;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
let tabList = common_vendor.reactive([
|
||||
{
|
||||
@@ -67,10 +83,8 @@ const _sfc_main = {
|
||||
});
|
||||
common_vendor.index.getSystemInfo({
|
||||
success: function(res) {
|
||||
common_vendor.index.__f__("log", "at components/tabBar/tabBar.vue:99", "机型", res.deviceType);
|
||||
if (res.safeArea.top > 40) {
|
||||
common_vendor.index.__f__("log", "at components/tabBar/tabBar.vue:101", "苹果的底部栏大小", res.safeArea.top);
|
||||
}
|
||||
if (res.safeArea.top > 40)
|
||||
;
|
||||
}
|
||||
});
|
||||
function setTabBar() {
|
||||
@@ -123,14 +137,18 @@ const _sfc_main = {
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.f(common_vendor.unref(tabList), (item, index, i0) => {
|
||||
return {
|
||||
return common_vendor.e({
|
||||
a: __props.tabIndex == index ? item.selectedIconPath : item.iconPath,
|
||||
b: common_vendor.t(item.text),
|
||||
c: __props.tabIndex == index ? "#1DD2F9" : "#A7A3A3",
|
||||
d: common_vendor.n("list-item flex flex-column flex-middle " + item.middleClass),
|
||||
e: common_vendor.o$1(($event) => handlePush(item, index), index),
|
||||
f: index
|
||||
};
|
||||
b: index === 3 && common_vendor.unref(Unread) > 0
|
||||
}, index === 3 && common_vendor.unref(Unread) > 0 ? {
|
||||
c: common_vendor.t(common_vendor.unref(Unread) > 99 ? "99+" : common_vendor.unref(Unread))
|
||||
} : {}, {
|
||||
d: common_vendor.t(item.text),
|
||||
e: __props.tabIndex == index ? "#1DD2F9" : "#A7A3A3",
|
||||
f: common_vendor.n("list-item flex flex-column flex-middle " + item.middleClass),
|
||||
g: common_vendor.o$1(($event) => handlePush(item, index), index),
|
||||
h: index
|
||||
});
|
||||
}),
|
||||
b: common_vendor.n(common_vendor.unref(showMiddleButton) === true ? "tab-list-middle" : "tab-list-default"),
|
||||
c: common_vendor.o$1(disabledScroll),
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="tab-block data-v-c497a889"><view class="{{['tab-list', 'flex', 'flex-center', 'data-v-c497a889', b]}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="f" class="{{['data-v-c497a889', item.d]}}" bindtap="{{item.e}}"><view class="item-img-box data-v-c497a889"><image class="item-img data-v-c497a889" src="{{item.a}}"/></view><view class="item-text font-20 data-v-c497a889" style="{{'color:' + item.c}}">{{item.b}}</view></view></view><view class="data-v-c497a889" catchtouchmove="{{c}}"></view><new-added-pk class="createModule r data-v-c497a889" u-r="createModule" u-i="c497a889-0" bind:__l="__l"></new-added-pk></view>
|
||||
<view class="tab-block data-v-c497a889"><view class="{{['tab-list', 'flex', 'flex-center', 'data-v-c497a889', b]}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="h" class="{{['data-v-c497a889', item.f]}}" bindtap="{{item.g}}"><view class="item-img-box data-v-c497a889"><image class="item-img data-v-c497a889" src="{{item.a}}"/><view wx:if="{{item.b}}" class="Unreadcss data-v-c497a889">{{item.c}}</view></view><view class="item-text font-20 data-v-c497a889" style="{{'color:' + item.e}}">{{item.d}}</view></view></view><view class="data-v-c497a889" catchtouchmove="{{c}}"></view><new-added-pk class="createModule r data-v-c497a889" u-r="createModule" u-i="c497a889-0" bind:__l="__l"></new-added-pk></view>
|
||||
@@ -111,4 +111,18 @@
|
||||
.tab-block .tab-bar.data-v-c497a889 {
|
||||
height: 30rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.Unreadcss.data-v-c497a889 {
|
||||
background-color: #ff0000;
|
||||
margin-top: -65rpx;
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 18rpx;
|
||||
color: #ffffff;
|
||||
line-height: 30rpx;
|
||||
margin-left: 30rpx;
|
||||
z-index: 1001;
|
||||
}
|
||||
Reference in New Issue
Block a user