优化页面
This commit is contained in:
@@ -1,132 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
require("../../../adapter-vue.js");
|
||||
const common_assets = require("../../../../common/assets.js");
|
||||
const TUIKit_utils_env = require("../../../utils/env.js");
|
||||
const TUIKit_utils_lodash = require("../../../utils/lodash.js");
|
||||
if (!Math) {
|
||||
Icon();
|
||||
}
|
||||
const Icon = () => "../../common/Icon.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
const searchingPlaceholder = common_vendor.Wt.t("TUIContact.输入ID");
|
||||
const isSearching = common_vendor.ref(false);
|
||||
const searchValue = common_vendor.ref("");
|
||||
const searchResult = common_vendor.ref({
|
||||
user: {
|
||||
label: "联系人",
|
||||
list: []
|
||||
},
|
||||
group: {
|
||||
label: "群聊",
|
||||
list: []
|
||||
}
|
||||
});
|
||||
const changeContactSearchingStatus = TUIKit_utils_lodash.debounce(function(status) {
|
||||
isSearching.value = status;
|
||||
}, 200);
|
||||
const search = async () => {
|
||||
if (!searchValue.value) {
|
||||
return;
|
||||
}
|
||||
common_vendor.R.callService({
|
||||
serviceName: common_vendor.E.TUISearch.SERVICE.NAME,
|
||||
method: common_vendor.E.TUISearch.SERVICE.METHOD.SEARCH_USER,
|
||||
params: {
|
||||
userID: searchValue.value
|
||||
}
|
||||
}).then((res) => {
|
||||
searchResult.value.user.list = res.data;
|
||||
}).catch((error) => {
|
||||
searchResult.value.user.list = [];
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/contact-search/index.vue:111", "search user error", error);
|
||||
});
|
||||
common_vendor.R.callService({
|
||||
serviceName: common_vendor.E.TUISearch.SERVICE.NAME,
|
||||
method: common_vendor.E.TUISearch.SERVICE.METHOD.SEARCH_GROUP,
|
||||
params: {
|
||||
groupID: searchValue.value
|
||||
}
|
||||
}).then((res) => {
|
||||
searchResult.value.group.list = [res.data.group];
|
||||
}).catch((error) => {
|
||||
searchResult.value.group.list = [];
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/contact-search/index.vue:125", "search group error", error);
|
||||
});
|
||||
};
|
||||
common_vendor.watch(
|
||||
() => searchResult.value,
|
||||
() => {
|
||||
common_vendor.Jt.update(
|
||||
common_vendor.o.CUSTOM,
|
||||
"currentContactSearchResult",
|
||||
searchResult.value
|
||||
);
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => isSearching.value,
|
||||
() => {
|
||||
common_vendor.Jt.update(
|
||||
common_vendor.o.CUSTOM,
|
||||
"currentContactSearchingStatus",
|
||||
isSearching.value
|
||||
);
|
||||
if (isSearching.value) {
|
||||
searchValue.value = "";
|
||||
searchResult.value.user.list = [];
|
||||
searchResult.value.group.list = [];
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.i.updateContactSearch = search;
|
||||
common_vendor.i.closeSearching = () => {
|
||||
isSearching.value = false;
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: !common_vendor.unref(isSearching) || !common_vendor.unref(TUIKit_utils_env.isPC)
|
||||
}, !common_vendor.unref(isSearching) || !common_vendor.unref(TUIKit_utils_env.isPC) ? {
|
||||
b: common_vendor.p({
|
||||
file: common_vendor.unref(isSearching) ? common_vendor.unref(common_assets.backIcon) : common_vendor.unref(common_assets.addSVG),
|
||||
width: common_vendor.unref(isSearching) ? "20px" : "14px",
|
||||
height: common_vendor.unref(isSearching) ? "20px" : "14px"
|
||||
}),
|
||||
c: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-search-h5-header-icon"),
|
||||
d: common_vendor.o$1(($event) => common_vendor.unref(changeContactSearchingStatus)(!common_vendor.unref(isSearching))),
|
||||
e: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("TUIContact.添加好友/群聊")),
|
||||
f: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-search-h5-header-title"),
|
||||
g: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-search-h5-header"),
|
||||
h: common_vendor.n(common_vendor.unref(isSearching) && "tui-contact-searching-h5-header"),
|
||||
i: common_vendor.o$1(($event) => common_vendor.unref(changeContactSearchingStatus)(true))
|
||||
} : {}, {
|
||||
j: common_vendor.unref(isSearching)
|
||||
}, common_vendor.unref(isSearching) ? {
|
||||
k: common_vendor.unref(searchingPlaceholder),
|
||||
l: common_vendor.o$1(search),
|
||||
m: common_vendor.o$1(search),
|
||||
n: common_vendor.o$1(search),
|
||||
o: common_vendor.unref(searchValue),
|
||||
p: common_vendor.o$1(($event) => common_vendor.isRef(searchValue) ? searchValue.value = $event.detail.value : null),
|
||||
q: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("取消")),
|
||||
r: common_vendor.o$1(($event) => isSearching.value = false),
|
||||
s: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-search-h5-main")
|
||||
} : {}, {
|
||||
t: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-search-h5")
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-efa1a0fe"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIContact/contact-search/index.js.map
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"icon": "../../common/Icon"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{['data-v-efa1a0fe', 'tui-contact-search', t]}}"><view wx:if="{{a}}" class="{{['data-v-efa1a0fe', 'tui-contact-search-header', g, h]}}" bindtap="{{i}}"><view class="{{['data-v-efa1a0fe', 'tui-contact-search-header-icon', c]}}" catchtap="{{d}}"><icon wx:if="{{b}}" class="data-v-efa1a0fe" u-i="efa1a0fe-0" bind:__l="__l" u-p="{{b}}"/></view><view class="{{['data-v-efa1a0fe', 'tui-contact-search-header-title', f]}}">{{e}}</view></view><view wx:if="{{j}}" class="{{['data-v-efa1a0fe', 'tui-contact-search-main', s]}}"><input class="tui-contact-search-main-input data-v-efa1a0fe" type="text" placeholder="{{k}}" enterkeyhint="search" bindkeyup="{{l}}" bindblur="{{m}}" bindconfirm="{{n}}" value="{{o}}" bindinput="{{p}}"></input><view class="tui-contact-search-main-cancel data-v-efa1a0fe" bindtap="{{r}}">{{q}}</view></view></view>
|
||||
@@ -1,96 +0,0 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.tui-contact-search.data-v-efa1a0fe {
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
padding: 12px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #f4f5f9;
|
||||
flex-direction: column;
|
||||
}
|
||||
.tui-contact-search-header.data-v-efa1a0fe, .tui-contact-search-main.data-v-efa1a0fe {
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.tui-contact-search-header.data-v-efa1a0fe {
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.tui-contact-search-header-icon.data-v-efa1a0fe {
|
||||
padding-right: 10px;
|
||||
}
|
||||
.tui-contact-search-header-title.data-v-efa1a0fe {
|
||||
font-size: 14px;
|
||||
}
|
||||
.tui-contact-search-main.data-v-efa1a0fe {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex: 1;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
.tui-contact-search-main-input.data-v-efa1a0fe {
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
border-radius: 5px;
|
||||
padding: 7px;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.tui-contact-search-main-input.data-v-efa1a0fe:focus {
|
||||
outline: none;
|
||||
border: 1px solid #006eff;
|
||||
}
|
||||
.tui-contact-search-main-cancel.data-v-efa1a0fe {
|
||||
padding-left: 10px;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.tui-contact-search-h5-header.data-v-efa1a0fe {
|
||||
width: 100%;
|
||||
}
|
||||
.tui-contact-searching-h5-header.data-v-efa1a0fe {
|
||||
padding-bottom: 10px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.tui-contact-searching-h5-header .tui-contact-search-h5-header-title.data-v-efa1a0fe {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
margin-right: 30px;
|
||||
}
|
||||
Reference in New Issue
Block a user