first commit

This commit is contained in:
lingxiao865
2026-02-10 08:05:03 +08:00
commit c5af079d8c
1094 changed files with 97530 additions and 0 deletions

33
unpackage/dist/dev/mp-weixin/app.js vendored Normal file
View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const common_vendor = require("./common/vendor.js");
if (!Math) {
"./pages/index/index.js";
"./pages/login/login.js";
"./pages/register/register.js";
"./pages/booking/booking.js";
"./pages/appointments/appointments.js";
}
const _sfc_main = {
onLaunch: function() {
const token = common_vendor.index.getStorageSync("token");
if (!token) {
common_vendor.index.reLaunch({
url: "/pages/login/login"
});
}
},
onShow: function() {
},
onHide: function() {
}
};
function createApp() {
const app = common_vendor.createSSRApp(_sfc_main);
return {
app
};
}
createApp().app.mount("#app");
exports.createApp = createApp;
//# sourceMappingURL=../.sourcemap/mp-weixin/app.js.map

16
unpackage/dist/dev/mp-weixin/app.json vendored Normal file
View File

@@ -0,0 +1,16 @@
{
"pages": [
"pages/index/index",
"pages/login/login",
"pages/register/register",
"pages/booking/booking",
"pages/appointments/appointments"
],
"window": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "预约系统",
"navigationBarBackgroundColor": "#FF7A00",
"backgroundColor": "#F8F8F8"
},
"usingComponents": {}
}

53
unpackage/dist/dev/mp-weixin/app.wxss vendored Normal file
View File

@@ -0,0 +1,53 @@
/* 全局样式 */
page, body {
background-color: #F8F9FA;
color: #333333;
font-size: 28rpx;
line-height: 1.6;
height: 100%;
margin: 0;
padding: 0;
}
/* 通用容器 */
view {
box-sizing: border-box;
}
/* 移除所有按钮的默认边框和阴影 */
button {
border: none !important;
box-shadow: none !important;
outline: none !important;
}
button::after {
border: none !important;
box-shadow: none !important;
}
button:active {
background: none !important;
}
/* 主按钮样式 */
.btn-primary {
background: linear-gradient(135deg, #FF7A00 0%, #FF9500 100%) !important;
color: #FFFFFF !important;
border: none !important;
box-shadow: 0 4rpx 12rpx rgba(255, 122, 0, 0.3);
}
/* 次要按钮样式 */
.btn-secondary {
background: #F5F5F5 !important;
color: #666666 !important;
border: 2rpx solid #E0E0E0 !important;
}
/* 线框按钮样式 */
.btn-outline {
background: transparent !important;
color: #FF7A00 !important;
border: 2rpx solid #FF7A00 !important;
}
page{--status-bar-height:25px;--top-window-height:0px;--window-top:0px;--window-bottom:0px;--window-left:0px;--window-right:0px;--window-magin:0px}[data-c-h="true"]{display: none !important;}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,174 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const utils_api = require("../../utils/api.js");
if (!Array) {
const _easycom_t_tab_panel2 = common_vendor.resolveComponent("t-tab-panel");
const _easycom_t_tabs2 = common_vendor.resolveComponent("t-tabs");
const _easycom_t_loading2 = common_vendor.resolveComponent("t-loading");
const _easycom_t_empty2 = common_vendor.resolveComponent("t-empty");
const _easycom_t_tag2 = common_vendor.resolveComponent("t-tag");
const _easycom_t_button2 = common_vendor.resolveComponent("t-button");
(_easycom_t_tab_panel2 + _easycom_t_tabs2 + _easycom_t_loading2 + _easycom_t_empty2 + _easycom_t_tag2 + _easycom_t_button2)();
}
const _easycom_t_tab_panel = () => "../../uni_modules/tdesign-uniapp/components/tab-panel/tab-panel.js";
const _easycom_t_tabs = () => "../../uni_modules/tdesign-uniapp/components/tabs/tabs.js";
const _easycom_t_loading = () => "../../uni_modules/tdesign-uniapp/components/loading/loading.js";
const _easycom_t_empty = () => "../../uni_modules/tdesign-uniapp/components/empty/empty.js";
const _easycom_t_tag = () => "../../uni_modules/tdesign-uniapp/components/tag/tag.js";
const _easycom_t_button = () => "../../uni_modules/tdesign-uniapp/components/button/button.js";
if (!Math) {
(_easycom_t_tab_panel + _easycom_t_tabs + _easycom_t_loading + _easycom_t_empty + _easycom_t_tag + _easycom_t_button)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "appointments",
setup(__props) {
const activeTab = common_vendor.ref("all");
const appointments = common_vendor.ref([]);
const loading = common_vendor.ref(false);
common_vendor.onMounted(() => {
loadAppointments();
});
const loadAppointments = async () => {
loading.value = true;
try {
const params = {};
if (activeTab.value !== "all") {
params.status = activeTab.value;
}
appointments.value = await utils_api.api.appointments.getList(params);
} catch (error) {
common_vendor.index.__f__("error", "at pages/appointments/appointments.vue:84", "加载预约失败", error);
} finally {
loading.value = false;
}
};
const onTabChange = (value) => {
const tabValue = typeof value === "string" ? value : (value == null ? void 0 : value.value) || "all";
activeTab.value = tabValue;
loadAppointments();
};
const getStatusTheme = (status) => {
const themes = {
pending: "warning",
confirmed: "success",
completed: "primary",
cancelled: "default"
};
return themes[status] || "default";
};
const getStatusText = (status) => {
const texts = {
pending: "待确认",
confirmed: "已确认",
completed: "已完成",
cancelled: "已取消"
};
return texts[status] || status;
};
const formatDate = (dateStr) => {
if (!dateStr)
return "";
try {
return dateStr.replace("T", " ").split("+")[0];
} catch (error) {
common_vendor.index.__f__("error", "at pages/appointments/appointments.vue:127", "Date format error:", error, dateStr);
return dateStr;
}
};
const formatTime = (timeStr) => {
const timePart = timeStr.split("T")[1] || timeStr;
const timeWithoutZone = timePart.split("+")[0].split("Z")[0];
const [hours, minutes] = timeWithoutZone.split(":");
return `${hours}:${minutes}`;
};
const cancelAppointment = (appointment) => {
common_vendor.index.showModal({
title: "确认取消",
content: "确定要取消这个预约吗?",
success: async (res) => {
if (res.confirm) {
try {
await utils_api.api.appointments.cancel(appointment.id);
common_vendor.index.showToast({
title: "取消成功",
icon: "success"
});
loadAppointments();
} catch (error) {
common_vendor.index.__f__("error", "at pages/appointments/appointments.vue:157", "取消预约失败", error);
}
}
}
});
};
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.p({
value: "all",
label: "全部"
}),
b: common_vendor.p({
value: "pending",
label: "待确认"
}),
c: common_vendor.p({
value: "confirmed",
label: "已确认"
}),
d: common_vendor.p({
value: "completed",
label: "已完成"
}),
e: common_vendor.p({
value: "cancelled",
label: "已取消"
}),
f: common_vendor.o(onTabChange),
g: common_vendor.p({
value: activeTab.value
}),
h: loading.value
}, loading.value ? {
i: common_vendor.p({
loading: true
})
} : appointments.value.length === 0 ? {
k: common_vendor.p({
description: "暂无预约记录"
})
} : {
l: common_vendor.f(appointments.value, (appointment, k0, i0) => {
return common_vendor.e({
a: common_vendor.t(getStatusText(appointment.status)),
b: "7c6f8f1a-8-" + i0,
c: common_vendor.p({
theme: getStatusTheme(appointment.status),
size: "small"
}),
d: common_vendor.t(formatDate(appointment.created_at)),
e: common_vendor.t(appointment.time_slot ? appointment.time_slot.date.split("T")[0] : ""),
f: common_vendor.t(appointment.time_slot ? formatTime(appointment.time_slot.start_time) : ""),
g: common_vendor.t(appointment.time_slot ? formatTime(appointment.time_slot.end_time) : ""),
h: common_vendor.t(appointment.people_count),
i: appointment.status === "pending"
}, appointment.status === "pending" ? {
j: common_vendor.o(($event) => cancelAppointment(appointment), appointment.id),
k: "7c6f8f1a-9-" + i0,
l: common_vendor.p({
size: "small",
theme: "danger",
variant: "outline"
})
} : {}, {
m: appointment.id
});
})
}, {
j: appointments.value.length === 0
});
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-7c6f8f1a"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/appointments/appointments.js.map

View File

@@ -0,0 +1,11 @@
{
"navigationBarTitleText": "我的预约",
"usingComponents": {
"t-tab-panel": "../../uni_modules/tdesign-uniapp/components/tab-panel/tab-panel",
"t-tabs": "../../uni_modules/tdesign-uniapp/components/tabs/tabs",
"t-loading": "../../uni_modules/tdesign-uniapp/components/loading/loading",
"t-empty": "../../uni_modules/tdesign-uniapp/components/empty/empty",
"t-tag": "../../uni_modules/tdesign-uniapp/components/tag/tag",
"t-button": "../../uni_modules/tdesign-uniapp/components/button/button"
}
}

View File

@@ -0,0 +1 @@
<view class="container data-v-7c6f8f1a"><view class="tabs data-v-7c6f8f1a"><t-tabs wx:if="{{g}}" class="data-v-7c6f8f1a" u-s="{{['d']}}" bindchange="{{f}}" u-i="7c6f8f1a-0" bind:__l="__l" u-p="{{g}}"><t-tab-panel wx:if="{{a}}" class="data-v-7c6f8f1a" u-i="7c6f8f1a-1,7c6f8f1a-0" bind:__l="__l" u-p="{{a}}"/><t-tab-panel wx:if="{{b}}" class="data-v-7c6f8f1a" u-i="7c6f8f1a-2,7c6f8f1a-0" bind:__l="__l" u-p="{{b}}"/><t-tab-panel wx:if="{{c}}" class="data-v-7c6f8f1a" u-i="7c6f8f1a-3,7c6f8f1a-0" bind:__l="__l" u-p="{{c}}"/><t-tab-panel wx:if="{{d}}" class="data-v-7c6f8f1a" u-i="7c6f8f1a-4,7c6f8f1a-0" bind:__l="__l" u-p="{{d}}"/><t-tab-panel wx:if="{{e}}" class="data-v-7c6f8f1a" u-i="7c6f8f1a-5,7c6f8f1a-0" bind:__l="__l" u-p="{{e}}"/></t-tabs></view><view class="appointments-list data-v-7c6f8f1a"><t-loading wx:if="{{h}}" class="data-v-7c6f8f1a" u-i="7c6f8f1a-6" bind:__l="__l" u-p="{{i}}"/><view wx:elif="{{j}}" class="empty-state data-v-7c6f8f1a"><t-empty wx:if="{{k}}" class="data-v-7c6f8f1a" u-i="7c6f8f1a-7" bind:__l="__l" u-p="{{k}}"/></view><view wx:else class="data-v-7c6f8f1a"><view wx:for="{{l}}" wx:for-item="appointment" wx:key="m" class="appointment-card data-v-7c6f8f1a"><view class="appointment-header data-v-7c6f8f1a"><view class="appointment-status data-v-7c6f8f1a"><t-tag wx:if="{{appointment.c}}" class="data-v-7c6f8f1a" u-s="{{['d']}}" u-i="{{appointment.b}}" bind:__l="__l" u-p="{{appointment.c}}">{{appointment.a}}</t-tag></view><view class="appointment-date data-v-7c6f8f1a">{{appointment.d}}</view></view><view class="appointment-body data-v-7c6f8f1a"><view class="appointment-row data-v-7c6f8f1a"><text class="row-label data-v-7c6f8f1a">时间段:</text><text class="row-value data-v-7c6f8f1a">{{appointment.e}} {{appointment.f}} - {{appointment.g}}</text></view><view class="appointment-row data-v-7c6f8f1a"><text class="row-label data-v-7c6f8f1a">人数:</text><text class="row-value data-v-7c6f8f1a">{{appointment.h}}人</text></view></view><view wx:if="{{appointment.i}}" class="appointment-footer data-v-7c6f8f1a"><t-button wx:if="{{appointment.l}}" u-s="{{['d']}}" class="btn-outline data-v-7c6f8f1a" bindclick="{{appointment.j}}" u-i="{{appointment.k}}" bind:__l="__l" u-p="{{appointment.l}}"> 取消预约 </t-button></view></view></view></view></view>

View File

@@ -0,0 +1,61 @@
.container.data-v-7c6f8f1a {
height: calc(100vh - var(--window-top));
display: flex;
flex-direction: column;
background: #F8F9FA;
overflow: hidden;
}
.tabs.data-v-7c6f8f1a {
flex-shrink: 0;
background: #ffffff;
}
.appointments-list.data-v-7c6f8f1a {
flex: 1;
overflow-y: auto;
padding: 20rpx 32rpx;
}
.empty-state.data-v-7c6f8f1a {
padding: 120rpx 0;
}
.appointment-card.data-v-7c6f8f1a {
background: #ffffff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
}
.appointment-header.data-v-7c6f8f1a {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 24rpx;
}
.appointment-date.data-v-7c6f8f1a {
font-size: 24rpx;
color: #999;
}
.appointment-body.data-v-7c6f8f1a {
padding: 24rpx 0;
border-top: 1rpx solid #f0f0f0;
border-bottom: 1rpx solid #f0f0f0;
}
.appointment-row.data-v-7c6f8f1a {
display: flex;
margin-bottom: 16rpx;
}
.row-label.data-v-7c6f8f1a {
font-size: 28rpx;
color: #666;
min-width: 120rpx;
}
.row-value.data-v-7c6f8f1a {
font-size: 28rpx;
color: #333;
flex: 1;
}
.appointment-footer.data-v-7c6f8f1a {
padding-top: 24rpx;
display: flex;
justify-content: flex-end;
}

View File

@@ -0,0 +1,280 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const utils_api = require("../../utils/api.js");
if (!Array) {
const _easycom_t_loading2 = common_vendor.resolveComponent("t-loading");
const _easycom_t_empty2 = common_vendor.resolveComponent("t-empty");
const _easycom_t_tag2 = common_vendor.resolveComponent("t-tag");
const _easycom_t_button2 = common_vendor.resolveComponent("t-button");
const _easycom_t_stepper2 = common_vendor.resolveComponent("t-stepper");
const _easycom_t_dialog2 = common_vendor.resolveComponent("t-dialog");
(_easycom_t_loading2 + _easycom_t_empty2 + _easycom_t_tag2 + _easycom_t_button2 + _easycom_t_stepper2 + _easycom_t_dialog2)();
}
const _easycom_t_loading = () => "../../uni_modules/tdesign-uniapp/components/loading/loading.js";
const _easycom_t_empty = () => "../../uni_modules/tdesign-uniapp/components/empty/empty.js";
const _easycom_t_tag = () => "../../uni_modules/tdesign-uniapp/components/tag/tag.js";
const _easycom_t_button = () => "../../uni_modules/tdesign-uniapp/components/button/button.js";
const _easycom_t_stepper = () => "../../uni_modules/tdesign-uniapp/components/stepper/stepper.js";
const _easycom_t_dialog = () => "../../uni_modules/tdesign-uniapp/components/dialog/dialog.js";
if (!Math) {
(_easycom_t_loading + _easycom_t_empty + _easycom_t_tag + _easycom_t_button + _easycom_t_stepper + _easycom_t_dialog)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "booking",
setup(__props) {
const getLocalDateStr = () => {
const now = /* @__PURE__ */ new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, "0");
const day = String(now.getDate()).padStart(2, "0");
return `${year}-${month}-${day}`;
};
const selectedDate = common_vendor.ref(getLocalDateStr());
const timeslots = common_vendor.ref([]);
const loading = common_vendor.ref(false);
const showDialog = common_vendor.ref(false);
const selectedSlot = common_vendor.ref(null);
const peopleCount = common_vendor.ref(1);
const notes = common_vendor.ref("");
const isBooking = common_vendor.ref(false);
const currentDate = common_vendor.ref(/* @__PURE__ */ new Date());
const weekdays = ["日", "一", "二", "三", "四", "五", "六"];
const dateBookings = common_vendor.ref({});
const dateHasSlots = common_vendor.ref({});
const currentDateStr = common_vendor.computed(() => {
const year = currentDate.value.getFullYear();
const month = currentDate.value.getMonth() + 1;
return `${year}${month}`;
});
const totalBookingCount = common_vendor.computed(() => {
return timeslots.value.reduce((sum, slot) => sum + slot.current_people, 0);
});
const calendarDays = common_vendor.computed(() => {
const year = currentDate.value.getFullYear();
const month = currentDate.value.getMonth();
const firstDay = new Date(year, month, 1);
const lastDay = new Date(year, month + 1, 0);
const today = /* @__PURE__ */ new Date();
const startWeekday = firstDay.getDay();
const days = [];
for (let i = startWeekday - 1; i >= 0; i--) {
days.push({
day: "",
dateStr: "",
isPlaceholder: true,
isOtherMonth: false,
isToday: false,
bookingCount: 0,
hasBookings: false
});
}
for (let i = 1; i <= lastDay.getDate(); i++) {
const date = new Date(year, month, i);
const yearNum = date.getFullYear();
const monthNum = date.getMonth() + 1;
const dayNum = date.getDate();
const dateStr = `${yearNum}-${String(monthNum).padStart(2, "0")}-${String(dayNum).padStart(2, "0")}`;
const todayYear = today.getFullYear();
const todayMonth = today.getMonth();
const todayDay = today.getDate();
const isToday = yearNum === todayYear && monthNum - 1 === todayMonth && dayNum === todayDay;
days.push({
day: i,
dateStr,
isPlaceholder: false,
isOtherMonth: false,
isToday,
bookingCount: dateBookings.value[dateStr] || 0,
hasBookings: dateHasSlots.value[dateStr] || false
});
}
return days;
});
common_vendor.onMounted(() => {
const token = common_vendor.index.getStorageSync("token");
if (!token) {
common_vendor.index.redirectTo({ url: "/pages/login/login" });
} else {
loadTimeSlots();
loadDateBookings();
}
});
const loadDateBookings = async () => {
try {
const slots = await utils_api.api.timeslots.getList({ is_active: true });
const bookings = {};
const slotsMap = {};
slots.forEach((slot) => {
const dateStr = slot.date.split("T")[0];
bookings[dateStr] = (bookings[dateStr] || 0) + slot.current_people;
slotsMap[dateStr] = true;
});
dateBookings.value = bookings;
dateHasSlots.value = slotsMap;
} catch (error) {
common_vendor.index.__f__("error", "at pages/booking/booking.vue:230", "加载日期预约统计失败", error);
}
};
const loadTimeSlots = async () => {
loading.value = true;
try {
const slots = await utils_api.api.timeslots.getList({
date: selectedDate.value,
is_active: true
});
timeslots.value = slots;
} catch (error) {
common_vendor.index.__f__("error", "at pages/booking/booking.vue:244", "加载时间槽失败", error);
} finally {
loading.value = false;
}
};
const selectDate = (day) => {
selectedDate.value = day.dateStr;
loadTimeSlots();
};
const formatTime = (timeStr) => {
const timePart = timeStr.split("T")[1] || timeStr;
const timeWithoutZone = timePart.split("+")[0].split("Z")[0];
const [hours, minutes] = timeWithoutZone.split(":");
return `${hours}:${minutes}`;
};
const showBookingModal = (slot) => {
if (isBooking.value) {
common_vendor.index.showToast({
title: "正在处理,请稍候",
icon: "none"
});
return;
}
if (!slot.is_active || slot.current_people >= slot.max_people) {
common_vendor.index.__f__("log", "at pages/booking/booking.vue:278", "时间槽不可用", slot);
common_vendor.index.showToast({
title: "该时间段已不可用",
icon: "none"
});
return;
}
selectedSlot.value = slot;
peopleCount.value = 1;
notes.value = "";
showDialog.value = true;
common_vendor.index.__f__("log", "at pages/booking/booking.vue:289", "打开弹窗", showDialog.value);
};
const confirmBooking = async () => {
if (!selectedSlot.value)
return;
isBooking.value = true;
try {
await utils_api.api.appointments.create(selectedSlot.value.id, peopleCount.value, notes.value);
common_vendor.index.showToast({
title: "预约成功",
icon: "success"
});
showDialog.value = false;
loadTimeSlots();
loadDateBookings();
} catch (error) {
showDialog.value = false;
} finally {
isBooking.value = false;
}
};
return (_ctx, _cache) => {
var _a, _b, _c, _d;
return common_vendor.e({
a: common_vendor.t(currentDateStr.value),
b: common_vendor.f(weekdays, (day, k0, i0) => {
return {
a: common_vendor.t(day),
b: day
};
}),
c: common_vendor.f(calendarDays.value, (day, index, i0) => {
return common_vendor.e({
a: !day.isPlaceholder
}, !day.isPlaceholder ? {
b: common_vendor.t(day.day)
} : {}, {
c: !day.isPlaceholder && day.bookingCount > 0
}, !day.isPlaceholder && day.bookingCount > 0 ? {
d: common_vendor.t(day.bookingCount)
} : {}, {
e: day.dateStr || `placeholder-${index}`,
f: day.isPlaceholder ? 1 : "",
g: day.dateStr === selectedDate.value ? 1 : "",
h: day.isToday ? 1 : "",
i: !day.hasBookings && !day.isPlaceholder ? 1 : "",
j: day.hasBookings ? 1 : "",
k: common_vendor.o(($event) => !day.isPlaceholder && selectDate(day), day.dateStr || `placeholder-${index}`)
});
}),
d: common_vendor.t(selectedDate.value),
e: totalBookingCount.value > 0
}, totalBookingCount.value > 0 ? {
f: common_vendor.t(totalBookingCount.value)
} : {}, {
g: loading.value
}, loading.value ? {
h: common_vendor.p({
loading: true
})
} : timeslots.value.length === 0 ? {
j: common_vendor.p({
description: "暂无可预约时间段"
})
} : {
k: common_vendor.f(timeslots.value, (slot, k0, i0) => {
return {
a: common_vendor.t(formatTime(slot.start_time)),
b: common_vendor.t(formatTime(slot.end_time)),
c: common_vendor.t(slot.current_people),
d: common_vendor.t(slot.max_people),
e: "d331dabb-2-" + i0,
f: common_vendor.p({
theme: slot.current_people >= slot.max_people ? "danger" : "success",
size: "small"
}),
g: common_vendor.t(slot.current_people >= slot.max_people ? "已满" : "预约"),
h: common_vendor.o(($event) => showBookingModal(slot), slot.id),
i: "d331dabb-3-" + i0,
j: common_vendor.p({
["t-class"]: "btn-primary",
size: "small",
theme: "primary",
disabled: !slot.is_active || slot.current_people >= slot.max_people
}),
k: slot.id,
l: !slot.is_active || slot.current_people >= slot.max_people ? 1 : ""
};
})
}, {
i: timeslots.value.length === 0,
l: common_vendor.t(selectedDate.value),
m: common_vendor.t(((_a = selectedSlot.value) == null ? void 0 : _a.start_time) ? formatTime(selectedSlot.value.start_time) : ""),
n: common_vendor.t(((_b = selectedSlot.value) == null ? void 0 : _b.end_time) ? formatTime(selectedSlot.value.end_time) : ""),
o: common_vendor.o(($event) => peopleCount.value = $event),
p: common_vendor.p({
min: 1,
max: ((_c = selectedSlot.value) == null ? void 0 : _c.max_people) - ((_d = selectedSlot.value) == null ? void 0 : _d.current_people) || 1,
disabled: true,
size: "small",
modelValue: peopleCount.value
}),
q: common_vendor.o(confirmBooking),
r: common_vendor.o(($event) => showDialog.value = false),
s: common_vendor.o(($event) => showDialog.value = $event),
t: common_vendor.p({
title: "预约确认",
cancelBtn: "取消",
confirmBtn: "确认预约",
["t-class-confirm"]: "btn-primary",
visible: showDialog.value
})
});
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-d331dabb"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/booking/booking.js.map

View File

@@ -0,0 +1,11 @@
{
"navigationBarTitleText": "我要预约",
"usingComponents": {
"t-loading": "../../uni_modules/tdesign-uniapp/components/loading/loading",
"t-empty": "../../uni_modules/tdesign-uniapp/components/empty/empty",
"t-tag": "../../uni_modules/tdesign-uniapp/components/tag/tag",
"t-button": "../../uni_modules/tdesign-uniapp/components/button/button",
"t-stepper": "../../uni_modules/tdesign-uniapp/components/stepper/stepper",
"t-dialog": "../../uni_modules/tdesign-uniapp/components/dialog/dialog"
}
}

View File

@@ -0,0 +1 @@
<view class="container data-v-d331dabb"><view class="date-selector data-v-d331dabb"><view class="calendar-header data-v-d331dabb"><text class="month-title data-v-d331dabb">{{a}}</text></view><view class="calendar-weekdays data-v-d331dabb"><text wx:for="{{b}}" wx:for-item="day" wx:key="b" class="weekday data-v-d331dabb">{{day.a}}</text></view><view class="calendar-days data-v-d331dabb"><view wx:for="{{c}}" wx:for-item="day" wx:key="e" class="{{['calendar-day', 'data-v-d331dabb', day.f && 'placeholder', day.g && 'selected', day.h && 'today', day.i && 'disabled', day.j && 'has-bookings']}}" bindtap="{{day.k}}"><text wx:if="{{day.a}}" class="day-number data-v-d331dabb">{{day.b}}</text><text wx:if="{{day.c}}" class="booking-count data-v-d331dabb">{{day.d}}人 </text></view></view></view><scroll-view class="timeslots-scroll data-v-d331dabb" scroll-y="true"><view class="timeslots-section data-v-d331dabb"><view class="section-title data-v-d331dabb">{{d}} 可选时间段 <text wx:if="{{e}}" class="total-booking data-v-d331dabb"> (总预约: {{f}}人) </text></view><t-loading wx:if="{{g}}" class="data-v-d331dabb" u-i="d331dabb-0" bind:__l="__l" u-p="{{h}}"/><view wx:elif="{{i}}" class="empty-state data-v-d331dabb"><t-empty wx:if="{{j}}" class="data-v-d331dabb" u-i="d331dabb-1" bind:__l="__l" u-p="{{j}}"/></view><view wx:else class="timeslots-list data-v-d331dabb"><view wx:for="{{k}}" wx:for-item="slot" wx:key="k" class="{{['timeslot-card', 'data-v-d331dabb', slot.l && 'disabled']}}"><view class="timeslot-info data-v-d331dabb"><view class="time-range data-v-d331dabb">{{slot.a}} - {{slot.b}}</view><view class="slot-status data-v-d331dabb"><t-tag wx:if="{{slot.f}}" class="data-v-d331dabb" u-s="{{['d']}}" u-i="{{slot.e}}" bind:__l="__l" u-p="{{slot.f}}">{{slot.c}}/{{slot.d}}</t-tag></view></view><t-button wx:if="{{slot.j}}" class="data-v-d331dabb" u-s="{{['d']}}" catchclick="{{slot.h}}" u-i="{{slot.i}}" bind:__l="__l" u-p="{{slot.j}}">{{slot.g}}</t-button></view></view></view></scroll-view><t-dialog wx:if="{{t}}" class="data-v-d331dabb" u-s="{{['content']}}" bindconfirm="{{q}}" bindcancel="{{r}}" u-i="d331dabb-4" bind:__l="__l" bindupdateVisible="{{s}}" u-p="{{t}}"><scroll-view type="list" scroll-y class="long-content data-v-d331dabb" slot="content"><view class="booking-dialog data-v-d331dabb"><view class="dialog-item data-v-d331dabb"><text class="dialog-label data-v-d331dabb">日期:</text><text class="dialog-value data-v-d331dabb">{{l}}</text></view><view class="dialog-item data-v-d331dabb"><text class="dialog-label data-v-d331dabb">时间段:</text><text class="dialog-value data-v-d331dabb">{{m}} - {{n}}</text></view><view class="dialog-item data-v-d331dabb"><text class="dialog-label data-v-d331dabb">人数:</text><t-stepper wx:if="{{p}}" class="data-v-d331dabb" u-i="d331dabb-5,d331dabb-4" bind:__l="__l" bindupdateModelValue="{{o}}" u-p="{{p}}"/></view></view></scroll-view></t-dialog></view>

View File

@@ -0,0 +1,179 @@
.container.data-v-d331dabb {
height: calc(100vh - var(--window-top));
display: flex;
flex-direction: column;
background: #f5f5f5;
overflow: hidden;
}
.date-selector.data-v-d331dabb {
flex-shrink: 0;
background: #ffffff;
margin: 24rpx 32rpx;
border-radius: 16rpx;
padding: 32rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
}
.calendar-header.data-v-d331dabb {
text-align: center;
margin-bottom: 24rpx;
}
.month-title.data-v-d331dabb {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.calendar-weekdays.data-v-d331dabb {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 8rpx;
margin-bottom: 16rpx;
padding: 0 10rpx;
}
.weekday.data-v-d331dabb {
font-size: 24rpx;
color: #999;
text-align: center;
}
.calendar-days.data-v-d331dabb {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 8rpx;
padding: 0 10rpx;
}
.calendar-day.data-v-d331dabb {
height: 100rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-radius: 8rpx;
cursor: pointer;
transition: all 0.3s ease;
}
.calendar-day.placeholder.data-v-d331dabb {
visibility: hidden;
}
.calendar-day.disabled.data-v-d331dabb {
opacity: 0.4;
pointer-events: none;
}
.calendar-day.has-bookings.data-v-d331dabb {
background: rgba(255, 122, 0, 0.08);
border: 2rpx solid #FF7A00;
}
.calendar-day.today.data-v-d331dabb {
background: rgba(255, 122, 0, 0.12);
}
.calendar-day.selected.data-v-d331dabb {
background: linear-gradient(135deg, #FF7A00 0%, #FF9500 100%);
}
.calendar-day.selected .day-number.data-v-d331dabb {
color: #ffffff;
}
.calendar-day.selected .booking-count.data-v-d331dabb {
color: #ffffff;
}
.day-number.data-v-d331dabb {
font-size: 28rpx;
color: #333;
margin-bottom: 4rpx;
}
.booking-count.data-v-d331dabb {
font-size: 20rpx;
color: #FF7A00;
}
.timeslots-scroll.data-v-d331dabb {
flex: 1;
overflow: hidden;
}
.timeslots-section.data-v-d331dabb {
padding: 32rpx;
}
.section-title.data-v-d331dabb {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 24rpx;
display: flex;
align-items: center;
}
.total-booking.data-v-d331dabb {
font-size: 24rpx;
color: #FF7A00;
margin-left: 16rpx;
font-weight: normal;
}
.empty-state.data-v-d331dabb {
padding: 80rpx 0;
}
.timeslots-list.data-v-d331dabb {
display: flex;
flex-direction: column;
gap: 20rpx;
}
.timeslot-card.data-v-d331dabb {
background: #ffffff;
border-radius: 16rpx;
padding: 32rpx;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
}
.timeslot-card.disabled.data-v-d331dabb {
opacity: 0.6;
}
.timeslot-info.data-v-d331dabb {
flex: 1;
}
.time-range.data-v-d331dabb {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 16rpx;
}
.slot-status.data-v-d331dabb {
margin-top: 8rpx;
}
.booking-dialog.data-v-d331dabb {
padding: 32rpx 0;
}
.dialog-item.data-v-d331dabb {
display: flex;
align-items: center;
padding: 20rpx 0;
border-bottom: 1rpx solid #f0f0f0;
}
.dialog-item.data-v-d331dabb:last-child {
border-bottom: none;
}
.dialog-label.data-v-d331dabb {
width: 120rpx;
font-size: 28rpx;
color: #666;
}
.dialog-value.data-v-d331dabb {
flex: 1;
font-size: 28rpx;
color: #333;
font-weight: 500;
}
/* 按钮自定义样式 - 使用全局样式 */
.btn-primary {
background: linear-gradient(135deg, #FF7A00 0%, #FF9500 100%) !important;
border: none !important;
border-radius: 8rpx !important;
color: #FFFFFF !important;
box-shadow: 0 4rpx 12rpx rgba(255, 122, 0, 0.3) !important;
outline: none !important;
}
.btn-primary::after {
border: none !important;
box-shadow: none !important;
}
.btn-primary:active {
background: linear-gradient(135deg, #FF6900 0%, #FF8500 100%) !important;
}

View File

@@ -0,0 +1,75 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
if (!Array) {
const _easycom_t_fab2 = common_vendor.resolveComponent("t-fab");
_easycom_t_fab2();
}
const _easycom_t_fab = () => "../../uni_modules/tdesign-uniapp/components/fab/fab.js";
if (!Math) {
_easycom_t_fab();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "index",
setup(__props) {
const user = common_vendor.ref(null);
const banners = common_vendor.ref([
{ image: "https://picsum.photos/800/400?random=1", title: "专业美容服务" },
{ image: "https://picsum.photos/800/400?random=2", title: "预约更便捷" },
{ image: "https://picsum.photos/800/400?random=3", title: "优惠活动" }
]);
const menuItems = common_vendor.ref([
{ icon: "📅", text: "我要预约", path: "/pages/booking/booking" },
{ icon: "📋", text: "我的预约", path: "/pages/appointments/appointments" }
]);
common_vendor.onMounted(() => {
const token = common_vendor.index.getStorageSync("token");
if (!token) {
common_vendor.index.redirectTo({ url: "/pages/login/login" });
} else {
user.value = common_vendor.index.getStorageSync("user");
}
});
const navigateTo = (path) => {
common_vendor.index.navigateTo({ url: path });
};
const logout = () => {
common_vendor.index.showModal({
title: "提示",
content: "确定要退出登录吗?",
success: (res) => {
if (res.confirm) {
common_vendor.index.removeStorageSync("token");
common_vendor.index.removeStorageSync("user");
common_vendor.index.redirectTo({ url: "/pages/login/login" });
}
}
});
};
return (_ctx, _cache) => {
return {
a: common_vendor.f(banners.value, (item, index, i0) => {
return {
a: item.image,
b: index
};
}),
b: common_vendor.f(menuItems.value, (item, index, i0) => {
return {
a: common_vendor.t(item.icon),
b: common_vendor.t(item.text),
c: item.path,
d: common_vendor.o(($event) => navigateTo(item.path), item.path)
};
}),
c: common_vendor.o(logout),
d: common_vendor.p({
icon: "caret-right",
["aria-label"]: "退出"
})
};
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1cf27b2a"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "预约系统",
"usingComponents": {
"t-fab": "../../uni_modules/tdesign-uniapp/components/fab/fab"
}
}

View File

@@ -0,0 +1 @@
<view class="container data-v-1cf27b2a"><view class="swiper-container data-v-1cf27b2a"><swiper class="swiper data-v-1cf27b2a" indicator-dots="{{true}}" autoplay="{{true}}" interval="{{3000}}" duration="{{500}}" indicator-color="rgba(255, 255, 255, 0.5)" indicator-active-color="#FF7A00"><swiper-item wx:for="{{a}}" wx:for-item="item" wx:key="b" class="swiper-item data-v-1cf27b2a"><image src="{{item.a}}" class="banner-image data-v-1cf27b2a" mode="aspectFill" lazy-load/></swiper-item></swiper></view><view class="grid-scroll data-v-1cf27b2a"><view class="grid-container data-v-1cf27b2a"><view wx:for="{{b}}" wx:for-item="item" wx:key="c" class="grid-item data-v-1cf27b2a" bindtap="{{item.d}}"><view class="grid-icon data-v-1cf27b2a">{{item.a}}</view><text class="grid-text data-v-1cf27b2a">{{item.b}}</text></view></view></view><t-fab wx:if="{{d}}" class="data-v-1cf27b2a" bindclick="{{c}}" u-i="1cf27b2a-0" bind:__l="__l" u-p="{{d}}"/></view>

View File

@@ -0,0 +1,78 @@
.container.data-v-1cf27b2a {
height: calc(100vh - var(--window-top));
display: flex;
flex-direction: column;
background: #f5f5f5;
overflow: hidden;
}
.welcome-section.data-v-1cf27b2a {
flex-shrink: 0;
background: linear-gradient(135deg, #FF7A00 0%, #FF9500 100%);
padding: 32rpx;
}
.welcome-text.data-v-1cf27b2a {
font-size: 36rpx;
font-weight: bold;
color: #ffffff;
}
/* 轮播图样式 */
.swiper-container.data-v-1cf27b2a {
flex-shrink: 0;
margin: 24rpx 32rpx;
border-radius: 16rpx;
overflow: hidden;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
}
.swiper.data-v-1cf27b2a {
width: 100%;
height: 360rpx;
}
.swiper-item.data-v-1cf27b2a {
width: 100%;
height: 100%;
}
.banner-image.data-v-1cf27b2a {
width: 100%;
height: 100%;
background: linear-gradient(135deg, #FF7A00 0%, #FF9500 100%);
}
/* 九宫格样式 */
.grid-scroll.data-v-1cf27b2a {
flex: 1;
overflow: hidden;
}
.grid-container.data-v-1cf27b2a {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 24rpx;
padding: 0 32rpx;
width: 100%;
align-content: center;
}
.grid-item.data-v-1cf27b2a {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: #ffffff;
border-radius: 16rpx;
padding: 40rpx 20rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
transition: all 0.3s ease;
}
.grid-item.data-v-1cf27b2a:active {
transform: scale(0.95);
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
}
.grid-icon.data-v-1cf27b2a {
font-size: 64rpx;
margin-bottom: 16rpx;
}
.grid-text.data-v-1cf27b2a {
font-size: 28rpx;
color: #333;
font-weight: 500;
}

View File

@@ -0,0 +1,172 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const utils_api = require("../../utils/api.js");
if (!Array) {
const _easycom_t_input2 = common_vendor.resolveComponent("t-input");
const _easycom_t_button2 = common_vendor.resolveComponent("t-button");
(_easycom_t_input2 + _easycom_t_button2)();
}
const _easycom_t_input = () => "../../uni_modules/tdesign-uniapp/components/input/input.js";
const _easycom_t_button = () => "../../uni_modules/tdesign-uniapp/components/button/button.js";
if (!Math) {
(_easycom_t_input + _easycom_t_button)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "login",
setup(__props) {
const phone = common_vendor.ref("13777777777");
const code = common_vendor.ref("");
const loginType = common_vendor.ref("one-click");
const loading = common_vendor.ref(false);
const codeDisabled = common_vendor.ref(false);
const countdown = common_vendor.ref(0);
const codeButtonText = common_vendor.ref("发送验证码");
const toggleLoginType = () => {
loginType.value = loginType.value === "code" ? "one-click" : "code";
};
const sendCode = async () => {
common_vendor.index.__f__("log", "at pages/login/login.vue:74", phone.value);
if (!phone.value || phone.value.length !== 11) {
common_vendor.index.showToast({
title: "请输入正确的手机号",
icon: "none"
});
return;
}
try {
await utils_api.api.auth.sendCode("+86" + phone.value);
common_vendor.index.showToast({
title: "验证码已发送",
icon: "success"
});
codeDisabled.value = true;
countdown.value = 60;
const timer = setInterval(() => {
countdown.value--;
codeButtonText.value = `${countdown.value}秒后重发`;
if (countdown.value <= 0) {
clearInterval(timer);
codeDisabled.value = false;
codeButtonText.value = "发送验证码";
}
}, 1e3);
} catch (error) {
common_vendor.index.__f__("error", "at pages/login/login.vue:103", "发送验证码失败", error);
}
};
const codeLogin = async () => {
if (!phone.value || phone.value.length !== 11) {
common_vendor.index.showToast({
title: "请输入正确的手机号",
icon: "none"
});
return;
}
if (!code.value || code.value.length !== 6) {
common_vendor.index.showToast({
title: "请输入验证码",
icon: "none"
});
return;
}
loading.value = true;
try {
const res = await utils_api.api.auth.verificationLogin("+86" + phone.value, code.value);
common_vendor.index.setStorageSync("token", res.token);
common_vendor.index.setStorageSync("user", res.user);
common_vendor.index.showToast({
title: "登录成功",
icon: "success"
});
common_vendor.index.reLaunch({ url: "/pages/index/index" });
} catch (error) {
common_vendor.index.__f__("error", "at pages/login/login.vue:139", "登录失败", error);
} finally {
loading.value = false;
}
};
const oneClickLogin = async () => {
if (!phone.value || phone.value.length !== 11) {
common_vendor.index.showToast({
title: "请输入正确的手机号",
icon: "none"
});
return;
}
loading.value = true;
try {
const res = await utils_api.api.auth.oneClickLogin("+86" + phone.value);
common_vendor.index.setStorageSync("token", res.token);
common_vendor.index.setStorageSync("user", res.user);
common_vendor.index.showToast({
title: "登录成功",
icon: "success"
});
common_vendor.index.reLaunch({ url: "/pages/index/index" });
} catch (error) {
common_vendor.index.__f__("error", "at pages/login/login.vue:169", "登录失败", error);
} finally {
loading.value = false;
}
};
const goToRegister = () => {
common_vendor.index.navigateTo({ url: "/pages/register/register" });
};
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.o(($event) => phone.value = $event),
b: common_vendor.p({
placeholder: "请输入手机号",
type: "number",
maxlength: 11,
clearable: true,
value: phone.value
}),
c: loginType.value === "code"
}, loginType.value === "code" ? {
d: common_vendor.t(codeButtonText.value),
e: common_vendor.o(sendCode),
f: common_vendor.p({
size: "small",
variant: "text",
disabled: codeDisabled.value
}),
g: common_vendor.o(($event) => code.value = $event),
h: common_vendor.p({
placeholder: "请输入验证码",
type: "number",
maxlength: 6,
clearable: true,
value: code.value
})
} : {}, {
i: loginType.value === "code"
}, loginType.value === "code" ? {
j: common_vendor.o(codeLogin),
k: common_vendor.p({
["t-class"]: "btn-primary",
theme: "primary",
size: "large",
block: true,
loading: loading.value
})
} : {
l: common_vendor.o(oneClickLogin),
m: common_vendor.p({
["t-class"]: "btn-primary",
theme: "primary",
size: "large",
block: true,
loading: loading.value
})
}, {
n: common_vendor.t(loginType.value === "code" ? "使用一键登录" : "使用验证码登录"),
o: common_vendor.o(toggleLoginType),
p: common_vendor.o(goToRegister)
});
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e4e4508d"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/login.js.map

View File

@@ -0,0 +1,7 @@
{
"navigationBarTitleText": "登录",
"usingComponents": {
"t-input": "../../uni_modules/tdesign-uniapp/components/input/input",
"t-button": "../../uni_modules/tdesign-uniapp/components/button/button"
}
}

View File

@@ -0,0 +1 @@
<view class="login-container data-v-e4e4508d"><view class="login-header data-v-e4e4508d"><text class="title data-v-e4e4508d">欢迎使用预约系统</text><text class="subtitle data-v-e4e4508d">请登录或注册</text></view><view class="login-form data-v-e4e4508d"><view class="form-item data-v-e4e4508d"><t-input wx:if="{{b}}" class="data-v-e4e4508d" u-s="{{['prefixIcon']}}" u-i="e4e4508d-0" bind:__l="__l" bindupdateValue="{{a}}" u-p="{{b}}"><text class="prefix-icon data-v-e4e4508d" slot="prefixIcon">📱</text></t-input></view><view wx:if="{{c}}" class="form-item data-v-e4e4508d"><t-input wx:if="{{h}}" class="data-v-e4e4508d" u-s="{{['prefixIcon','suffix']}}" u-i="e4e4508d-1" bind:__l="__l" bindupdateValue="{{g}}" u-p="{{h}}"><text class="prefix-icon data-v-e4e4508d" slot="prefixIcon">🔐</text><t-button class="data-v-e4e4508d" u-s="{{['d']}}" bindclick="{{e}}" u-i="e4e4508d-2,e4e4508d-1" bind:__l="__l" u-p="{{f}}" slot="suffix">{{d}}</t-button></t-input></view><view class="form-actions data-v-e4e4508d"><t-button wx:if="{{i}}" class="data-v-e4e4508d" u-s="{{['d']}}" bindclick="{{j}}" u-i="e4e4508d-3" bind:__l="__l" u-p="{{k}}"> 验证码登录 </t-button><t-button wx:else class="data-v-e4e4508d" u-s="{{['d']}}" bindclick="{{l}}" u-i="e4e4508d-4" bind:__l="__l" u-p="{{m||''}}"> 一键登录 </t-button></view><view class="form-switch data-v-e4e4508d"><text class="data-v-e4e4508d" bindtap="{{o}}">{{n}}</text><text class="register-link data-v-e4e4508d" bindtap="{{p}}">注册新账号</text></view></view></view>

View File

@@ -0,0 +1,70 @@
.login-container.data-v-e4e4508d {
min-height: 100vh;
background: linear-gradient(135deg, #FF7A00 0%, #FF9500 100%);
padding: 80rpx 40rpx;
}
.login-header.data-v-e4e4508d {
text-align: center;
margin-bottom: 100rpx;
}
.title.data-v-e4e4508d {
display: block;
font-size: 48rpx;
font-weight: bold;
color: #ffffff;
margin-bottom: 20rpx;
}
.subtitle.data-v-e4e4508d {
display: block;
font-size: 28rpx;
color: rgba(255, 255, 255, 0.8);
}
.login-form.data-v-e4e4508d {
background: #ffffff;
border-radius: 32rpx;
padding: 60rpx 40rpx;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.1);
}
.form-item.data-v-e4e4508d {
margin-bottom: 32rpx;
}
.prefix-icon.data-v-e4e4508d {
font-size: 32rpx;
color: #FF7A00;
}
.form-actions.data-v-e4e4508d {
margin-top: 60rpx;
}
.form-switch.data-v-e4e4508d {
display: flex;
justify-content: space-between;
margin-top: 32rpx;
font-size: 28rpx;
color: #666;
}
.form-switch text.data-v-e4e4508d {
padding: 16rpx 0;
}
.register-link.data-v-e4e4508d {
color: #FF7A00 !important;
font-weight: bold;
}
/* 按钮自定义样式 - 使用全局样式 */
.btn-primary {
background: linear-gradient(135deg, #FF7A00 0%, #FF9500 100%) !important;
border: none !important;
border-radius: 8rpx !important;
color: #FFFFFF !important;
box-shadow: 0 4rpx 12rpx rgba(255, 122, 0, 0.3) !important;
outline: none !important;
}
.btn-primary::after {
border: none !important;
box-shadow: none !important;
}
.btn-primary:active {
background: linear-gradient(135deg, #FF6900 0%, #FF8500 100%) !important;
}

View File

@@ -0,0 +1,85 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const utils_api = require("../../utils/api.js");
if (!Array) {
const _easycom_t_input2 = common_vendor.resolveComponent("t-input");
const _easycom_t_button2 = common_vendor.resolveComponent("t-button");
(_easycom_t_input2 + _easycom_t_button2)();
}
const _easycom_t_input = () => "../../uni_modules/tdesign-uniapp/components/input/input.js";
const _easycom_t_button = () => "../../uni_modules/tdesign-uniapp/components/button/button.js";
if (!Math) {
(_easycom_t_input + _easycom_t_button)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "register",
setup(__props) {
const phone = common_vendor.ref("");
const nickname = common_vendor.ref("");
const loading = common_vendor.ref(false);
const register = async () => {
if (!phone.value || String(phone.value).length !== 11) {
common_vendor.index.showToast({
title: "请输入正确的手机号",
icon: "none"
});
return;
}
if (!nickname.value || nickname.value.trim().length === 0) {
common_vendor.index.showToast({
title: "请输入昵称",
icon: "none"
});
return;
}
loading.value = true;
try {
const res = await utils_api.api.auth.register("+86" + phone.value, nickname.value.trim());
common_vendor.index.setStorageSync("token", res.token);
common_vendor.index.setStorageSync("user", res.user);
common_vendor.index.showToast({
title: "注册成功",
icon: "success"
});
common_vendor.index.reLaunch({ url: "/pages/index/index" });
} catch (error) {
common_vendor.index.__f__("error", "at pages/register/register.vue:95", "注册失败", error);
} finally {
loading.value = false;
}
};
const goToLogin = () => {
common_vendor.index.navigateBack();
};
return (_ctx, _cache) => {
return {
a: common_vendor.o(($event) => phone.value = $event),
b: common_vendor.p({
placeholder: "请输入手机号",
type: "number",
maxlength: 11,
clearable: true,
value: phone.value
}),
c: common_vendor.o(($event) => nickname.value = $event),
d: common_vendor.p({
placeholder: "请输入昵称",
maxlength: 20,
clearable: true,
value: nickname.value
}),
e: common_vendor.o(register),
f: common_vendor.p({
theme: "primary",
size: "large",
block: true,
loading: loading.value
}),
g: common_vendor.o(goToLogin)
};
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-bac4a35d"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/register/register.js.map

View File

@@ -0,0 +1,7 @@
{
"navigationBarTitleText": "注册",
"usingComponents": {
"t-input": "../../uni_modules/tdesign-uniapp/components/input/input",
"t-button": "../../uni_modules/tdesign-uniapp/components/button/button"
}
}

View File

@@ -0,0 +1 @@
<view class="register-container data-v-bac4a35d"><view class="register-header data-v-bac4a35d"><text class="title data-v-bac4a35d">注册账号</text><text class="subtitle data-v-bac4a35d">创建您的预约系统账号</text></view><view class="register-form data-v-bac4a35d"><view class="form-item data-v-bac4a35d"><t-input wx:if="{{b}}" class="data-v-bac4a35d" u-s="{{['prefixIcon']}}" u-i="bac4a35d-0" bind:__l="__l" bindupdateValue="{{a}}" u-p="{{b}}"><text class="prefix-icon data-v-bac4a35d" slot="prefixIcon">📱</text></t-input></view><view class="form-item data-v-bac4a35d"><t-input wx:if="{{d}}" class="data-v-bac4a35d" u-s="{{['prefixIcon']}}" u-i="bac4a35d-1" bind:__l="__l" bindupdateValue="{{c}}" u-p="{{d}}"><text class="prefix-icon data-v-bac4a35d" slot="prefixIcon">👤</text></t-input></view><view class="form-actions data-v-bac4a35d"><t-button wx:if="{{f}}" u-s="{{['d']}}" class="btn-primary data-v-bac4a35d" bindclick="{{e}}" u-i="bac4a35d-2" bind:__l="__l" u-p="{{f}}"> 注册 </t-button></view><view class="form-switch data-v-bac4a35d"><text class="data-v-bac4a35d" bindtap="{{g}}">已有账号?去登录</text></view></view></view>

View File

@@ -0,0 +1,55 @@
.register-container.data-v-bac4a35d {
min-height: 100vh;
background: linear-gradient(135deg, #FF7A00 0%, #FF9500 100%);
padding: 80rpx 40rpx;
}
.register-header.data-v-bac4a35d {
text-align: center;
margin-bottom: 100rpx;
}
.title.data-v-bac4a35d {
display: block;
font-size: 48rpx;
font-weight: bold;
color: #ffffff;
margin-bottom: 20rpx;
}
.subtitle.data-v-bac4a35d {
display: block;
font-size: 28rpx;
color: rgba(255, 255, 255, 0.8);
}
.register-form.data-v-bac4a35d {
background: #ffffff;
border-radius: 32rpx;
padding: 60rpx 40rpx;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.1);
}
.form-item.data-v-bac4a35d {
margin-bottom: 32rpx;
}
.prefix-icon.data-v-bac4a35d {
font-size: 32rpx;
color: #FF7A00;
}
.form-actions.data-v-bac4a35d {
margin-top: 60rpx;
}
.form-switch.data-v-bac4a35d {
display: flex;
justify-content: center;
margin-top: 32rpx;
font-size: 28rpx;
color: #FF7A00;
}
.form-switch text.data-v-bac4a35d {
padding: 16rpx 0;
}
/* 按钮自定义样式 */
.btn-primary.data-v-bac4a35d .t-button {
background: linear-gradient(135deg, #FF7A00 0%, #FF9500 100%) !important;
border: none !important;
box-shadow: 0 4rpx 12rpx rgba(255, 122, 0, 0.3);
}

View File

@@ -0,0 +1,37 @@
{
"description": "项目配置文件。",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": false,
"es6": true,
"postcss": false,
"minified": false,
"newFeature": true,
"bigPackageSizeSupport": true,
"minifyWXML": true
},
"compileType": "miniprogram",
"libVersion": "",
"appid": "wx7677406cd2dfb7ac",
"projectname": "yu",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}

View File

@@ -0,0 +1,8 @@
这是一个占位符文件,用于轮播图显示。
请在 static 目录下放置以下图片文件:
- banner1.png
- banner2.png
- banner3.png
或者使用网络图片链接替换 banners 数组中的 image 路径。

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -0,0 +1,129 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
const uni_modules_tdesignUniapp_components_badge_props = require("./props.js");
const uni_modules_tdesignUniapp_components_common_utils = require("../common/utils.js");
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
const uni_modules_tdesignUniapp_components_badge_computed = require("./computed.js");
const common_vendor = require("../../../../common/vendor.js");
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-badge`;
const getUniqueID = uni_modules_tdesignUniapp_components_common_utils.uniqueFactory("badge");
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
name,
options: {
styleIsolation: "shared"
},
externalClasses: [
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-count`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-content`
],
props: {
...uni_modules_tdesignUniapp_components_badge_props.props
},
data() {
return {
prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
classPrefix: name,
value: "",
labelID: "",
descriptionID: "",
tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools,
useOuterClass: false
};
},
computed: {
hasChild() {
var _a;
return !!((_a = this.$slots) == null ? void 0 : _a.default);
}
},
mounted() {
const e = getUniqueID();
this.labelID = `${e}_label`;
this.descriptionID = `${e}_description`;
this.checkForActualContent();
},
methods: {
getBadgeValue: uni_modules_tdesignUniapp_components_badge_computed.getBadgeValue,
getBadgeStyles: uni_modules_tdesignUniapp_components_badge_computed.getBadgeStyles,
getBadgeInnerClass: uni_modules_tdesignUniapp_components_badge_computed.getBadgeInnerClass,
isShowBadge: uni_modules_tdesignUniapp_components_badge_computed.isShowBadge,
checkForActualContent() {
const target = ["ribbon", "ribbon-right", "ribbon-left", "triangle-right", "triangle-left"];
if (this.content || !target.includes(this.shape)) {
this.useOuterClass = false;
return;
}
return uni_modules_tdesignUniapp_components_common_utils.getRect(this, `.${name}__content`).then((rect) => {
const hasSlotContent = rect.width > 0 || rect.height > 0;
this.useOuterClass = !hasSlotContent;
});
}
}
});
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: !_ctx.content
}, !_ctx.content ? {} : {
b: common_vendor.t(_ctx.content),
c: common_vendor.n(_ctx.classPrefix + "__content-text")
}, {
d: _ctx.labelID,
e: common_vendor.n(_ctx.tools.cls(_ctx.classPrefix + "__content", [["empty", !_ctx.content && !_ctx.hasChild]]) + " " + _ctx.tClassContent),
f: _ctx.isShowBadge({
dot: _ctx.dot,
count: _ctx.count,
showZero: _ctx.showZero
}) || _ctx.count === null
}, _ctx.isShowBadge({
dot: _ctx.dot,
count: _ctx.count,
showZero: _ctx.showZero
}) || _ctx.count === null ? common_vendor.e({
g: _ctx.isShowBadge({
dot: _ctx.dot,
count: _ctx.count,
showZero: _ctx.showZero
})
}, _ctx.isShowBadge({
dot: _ctx.dot,
count: _ctx.count,
showZero: _ctx.showZero
}) ? {
h: common_vendor.t(_ctx.getBadgeValue({
dot: _ctx.dot,
count: _ctx.count,
maxCount: _ctx.maxCount
}))
} : {}, {
i: common_vendor.n(_ctx.classPrefix + "__count"),
j: _ctx.descriptionID,
k: _ctx.ariaLabel || _ctx.tools.getBadgeAriaLabel({
dot: _ctx.dot,
count: _ctx.count,
maxCount: _ctx.maxCount
}),
l: common_vendor.n(_ctx.getBadgeInnerClass({
classPrefix: _ctx.classPrefix,
dot: _ctx.dot,
size: _ctx.size,
shape: _ctx.shape,
count: _ctx.count
}) + " " + _ctx.prefix + "-has-count "),
m: common_vendor.n(_ctx.tClassCount),
n: common_vendor.s(_ctx.tools._style([_ctx.getBadgeStyles({
color: _ctx.color,
offset: _ctx.offset
})]))
}) : {}, {
o: common_vendor.s(_ctx.tools._style([_ctx.customStyle])),
p: common_vendor.n(_ctx.classPrefix + " " + (_ctx.useOuterClass ? _ctx.classPrefix + "__" + _ctx.shape + "-outer" : "") + _ctx.tClass),
q: _ctx.labelID,
r: _ctx.descriptionID,
s: _ctx.ariaRole || "option"
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-3b9e0753"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/badge/badge.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view style="{{o}}" class="{{['data-v-3b9e0753', p]}}" aria-labelledby="{{q}}" aria-describedby="{{r}}" aria-role="{{s}}"><view id="{{d}}" class="{{['data-v-3b9e0753', e]}}" aria-hidden="{{true}}"><slot wx:if="{{a}}"/><text wx:else class="{{['data-v-3b9e0753', c]}}">{{b}}</text></view><view wx:if="{{f}}" id="{{j}}" aria-hidden="{{true}}" aria-label="{{k}}" class="{{['data-v-3b9e0753', l, m]}}" style="{{n}}"><view class="{{['data-v-3b9e0753', i]}}"><block wx:if="{{g}}">{{h}}</block><slot name="count"/></view></view></view>

View File

@@ -0,0 +1,140 @@
.t-badge.data-v-3b9e0753 {
position: relative;
display: inline-flex;
align-items: start;
}
.t-badge--basic.data-v-3b9e0753 {
z-index: 100;
padding: 0 var(--td-badge-basic-padding, 8rpx);
font: var(--td-badge-font, var(--td-font-mark-extraSmall, 600 20rpx / 32rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular)));
color: var(--td-badge-text-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
background-color: var(--td-badge-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
text-align: center;
height: var(--td-badge-basic-height, 32rpx);
border-radius: var(--td-badge-border-radius, 4rpx);
}
.t-badge--dot.data-v-3b9e0753 {
height: var(--td-badge-dot-size, 16rpx);
border-radius: 50%;
min-width: var(--td-badge-dot-size, 16rpx);
padding: 0;
}
.t-badge--count.data-v-3b9e0753 {
min-width: var(--td-badge-basic-width, 32rpx);
white-space: nowrap;
box-sizing: border-box;
}
.t-badge--circle.data-v-3b9e0753 {
border-radius: calc(var(--td-badge-basic-height, 32rpx) / 2);
}
.t-badge__ribbon-outer.data-v-3b9e0753,
.t-badge__ribbon-right-outer.data-v-3b9e0753,
.t-badge__triangle-right-outer.data-v-3b9e0753,
.t-badge__ribbon-left-outer.data-v-3b9e0753,
.t-badge__triangle-left-outer.data-v-3b9e0753 {
position: absolute;
top: 0;
}
.t-badge__ribbon-outer.data-v-3b9e0753,
.t-badge__ribbon-right-outer.data-v-3b9e0753,
.t-badge__triangle-right-outer.data-v-3b9e0753 {
right: 0;
}
.t-badge__ribbon-left-outer.data-v-3b9e0753,
.t-badge__triangle-left-outer.data-v-3b9e0753 {
left: 0;
}
.t-badge--bubble.data-v-3b9e0753 {
border-radius: var(--td-badge-bubble-border-radius, 20rpx 20rpx 20rpx 1px);
}
.t-badge--ribbon.data-v-3b9e0753,
.t-badge--ribbon-right.data-v-3b9e0753,
.t-badge--ribbon-left.data-v-3b9e0753,
.t-badge--triangle-left.data-v-3b9e0753,
.t-badge--triangle-right.data-v-3b9e0753 {
width: calc(var(--td-badge-basic-height, 32rpx) * 2);
height: calc(var(--td-badge-basic-height, 32rpx) * 2);
border-radius: 0;
padding: 0;
position: absolute;
top: 0;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.t-badge--ribbon.data-v-3b9e0753,
.t-badge--ribbon-right.data-v-3b9e0753 {
background: linear-gradient(45deg, transparent 50%, var(--td-badge-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941))) 50%, var(--td-badge-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941))) 85%, transparent 85%);
}
.t-badge--triangle-right.data-v-3b9e0753 {
background: linear-gradient(45deg, transparent 50%, var(--td-badge-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941))) 50%);
}
.t-badge--ribbon.data-v-3b9e0753,
.t-badge--ribbon-right.data-v-3b9e0753,
.t-badge--triangle-right.data-v-3b9e0753 {
right: 0;
}
.t-badge--ribbon .t-badge__count.data-v-3b9e0753,
.t-badge--ribbon-right .t-badge__count.data-v-3b9e0753,
.t-badge--triangle-right .t-badge__count.data-v-3b9e0753 {
transform: rotate(45deg) translateY(calc(-1 * var(--td-line-height-mark-extraSmall, 32rpx) / 2 + 1rpx));
}
.t-badge--ribbon-left.data-v-3b9e0753 {
background: linear-gradient(-45deg, transparent 50%, var(--td-badge-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941))) 50%, var(--td-badge-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941))) 85%, transparent 85%);
}
.t-badge--triangle-left.data-v-3b9e0753 {
background: linear-gradient(-45deg, transparent 50%, var(--td-badge-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941))) 50%);
}
.t-badge--ribbon-left.data-v-3b9e0753,
.t-badge--triangle-left.data-v-3b9e0753 {
left: 0;
}
.t-badge--ribbon-left .t-badge__count.data-v-3b9e0753,
.t-badge--triangle-left .t-badge__count.data-v-3b9e0753 {
transform: rotate(-45deg) translateY(calc(-1 * var(--td-line-height-mark-extraSmall, 32rpx) / 2 + 1rpx));
}
.t-badge--large.data-v-3b9e0753 {
font: var(--td-badge-large-font, var(--td-font-mark-small, 600 24rpx / 40rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular)));
height: var(--td-badge-large-height, 40rpx);
min-width: var(--td-badge-large-height, 40rpx);
padding: 0 var(--td-badge-large-padding, 10rpx);
}
.t-badge--large.t-badge--circle.data-v-3b9e0753 {
border-radius: calc(var(--td-badge-large-height, 40rpx) / 2);
}
.t-badge--large.t-badge--ribbon.data-v-3b9e0753,
.t-badge--large.t-badge--ribbon-right.data-v-3b9e0753,
.t-badge--large.t-badge--ribbon-left.data-v-3b9e0753,
.t-badge--large.t-badge--triangle-right.data-v-3b9e0753,
.t-badge--large.t-badge--triangle-left.data-v-3b9e0753 {
width: calc(var(--td-badge-large-height, 40rpx) * 2);
height: calc(var(--td-badge-large-height, 40rpx) * 2);
padding: 0;
}
.t-badge--large.t-badge--ribbon .t-badge__count.data-v-3b9e0753,
.t-badge--large.t-badge--ribbon-right .t-badge__count.data-v-3b9e0753,
.t-badge--large.t-badge--triangle-right .t-badge__count.data-v-3b9e0753 {
transform: rotate(45deg) translateY(calc(-1 * var(--td-line-height-mark-small, 40rpx) / 2 + 3rpx));
}
.t-badge--large.t-badge--ribbon-left .t-badge__count.data-v-3b9e0753,
.t-badge--large.t-badge--triangle-left .t-badge__count.data-v-3b9e0753 {
transform: rotate(-45deg) translateY(calc(-1 * var(--td-line-height-mark-small, 40rpx) / 2 + 3rpx));
}
.t-badge__content:not(:empty) + .t-badge--bubble.t-has-count.data-v-3b9e0753,
.t-badge__content:not(:empty) + .t-badge--circle.t-has-count.data-v-3b9e0753,
.t-badge__content:not(:empty) + .t-badge--square.t-has-count.data-v-3b9e0753 {
transform-origin: center center;
transform: translate(-50%, -50%);
position: absolute;
top: 0;
left: 100%;
}
.t-badge__content-text.data-v-3b9e0753 {
display: block;
font: var(--td-font-body-large, 32rpx / 48rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular));
color: var(--td-badge-content-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
}
.t-badge__count.data-v-3b9e0753:empty {
display: none;
}

View File

@@ -0,0 +1,54 @@
"use strict";
const getBadgeValue = function(props) {
if (props.dot) {
return "";
}
if (isNaN(props.count) || isNaN(props.maxCount)) {
return props.count;
}
return parseInt(props.count, 10) > props.maxCount ? `${props.maxCount}+` : props.count;
};
const hasUnit = function(unit) {
return unit.indexOf("px") > 0 || unit.indexOf("rpx") > 0 || unit.indexOf("em") > 0 || unit.indexOf("rem") > 0 || unit.indexOf("%") > 0 || unit.indexOf("vh") > 0 || unit.indexOf("vm") > 0;
};
const getBadgeStyles = function(props) {
var _a, _b;
let styleStr = "";
if (props.color) {
styleStr += `background:${props.color};`;
}
if ((_a = props.offset) == null ? void 0 : _a[0]) {
styleStr += `left: calc(100% + ${hasUnit(props.offset[0].toString()) ? props.offset[0] : `${props.offset[0]}px`});`;
}
if ((_b = props.offset) == null ? void 0 : _b[1]) {
styleStr += `top:${hasUnit(props.offset[1].toString()) ? props.offset[1] : `${props.offset[1]}px`};`;
}
return styleStr;
};
const getBadgeInnerClass = function(props) {
const baseClass = props.classPrefix;
const classNames = [
`${baseClass}--basic`,
props.dot ? `${baseClass}--dot` : "",
`${baseClass}--${props.size}`,
`${baseClass}--${props.shape}`,
!props.dot ? `${baseClass}--count` : ""
];
return classNames.join(" ");
};
const isShowBadge = function(props) {
if (props.dot) {
return true;
}
if (!props.showZero && !isNaN(props.count) && parseInt(props.count, 10) === 0) {
return false;
}
if (props.count == null)
return false;
return true;
};
exports.getBadgeInnerClass = getBadgeInnerClass;
exports.getBadgeStyles = getBadgeStyles;
exports.getBadgeValue = getBadgeValue;
exports.isShowBadge = isShowBadge;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/badge/computed.js.map

View File

@@ -0,0 +1,53 @@
"use strict";
const props = {
/** 颜色 */
color: {
type: String,
default: ""
},
/** 徽标内容,示例:`content='自定义内容'`。也可以使用默认插槽定义 */
content: {
type: String,
default: ""
},
/** 徽标右上角内容。可以是数字,也可以是文字。如:'new'/3/99+。特殊:值为空表示使用插槽渲染 */
count: {
type: [String, Number],
default: 0
},
/** 是否为红点 */
dot: Boolean,
/** 封顶的数字值 */
maxCount: {
type: Number,
default: 99
},
/** 设置状态点的位置偏移,示例:[-10, 20] 或 ['10em', '8rem'] */
offset: {
type: Array
},
/** 徽标形状,其中 ribbon 和 ribbon-right 等效 */
shape: {
type: String,
default: "circle",
validator(val) {
if (!val)
return true;
return ["circle", "square", "bubble", "ribbon", "ribbon-right", "ribbon-left", "triangle-right", "triangle-left"].includes(val);
}
},
/** 当数值为 0 时,是否展示徽标 */
showZero: Boolean,
/** 尺寸 */
size: {
type: String,
default: "medium",
validator(val) {
if (!val)
return true;
return ["medium", "large"].includes(val);
}
}
};
exports.props = props;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/badge/props.js.map

View File

@@ -0,0 +1,215 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
const uni_modules_tdesignUniapp_components_button_props = require("./props.js");
const uni_modules_tdesignUniapp_components_common_utils = require("../common/utils.js");
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
const common_vendor = require("../../../../common/vendor.js");
const TIcon = () => "../icon/icon.js";
const TLoading = () => "../loading/loading.js";
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-button`;
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
name,
options: {
styleIsolation: "shared"
},
externalClasses: [
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-icon`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-loading`
],
components: {
TIcon,
TLoading
},
props: {
...uni_modules_tdesignUniapp_components_button_props.props
},
emits: [
"click"
],
data() {
return {
tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools,
prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
className: "",
classPrefix: name,
_icon: void 0
};
},
computed: {
iconCustomStyle() {
const fontSize = {
"extra-small": "var(--td-button-extra-small-icon-font-size, 18px)",
small: "var(--td-button-small-icon-font-size, 18px)",
medium: "var(--td-button-medium-icon-font-size, 20px)",
large: "var(--td-button-large-icon-font-size, 24px)"
};
return uni_modules_tdesignUniapp_components_common_utils_wxs.tools._style([
{
fontSize: fontSize[this.size || "medium"],
borderRadius: "var(--td-button-icon-border-radius, 4px)"
},
this._icon.style || ""
]);
},
loadingCustomStyle() {
return uni_modules_tdesignUniapp_components_common_utils_wxs.tools._style({
display: "flex",
alignItems: "center",
justifyContent: "center"
});
}
},
watch: {
icon: {
handler(value) {
this._icon = uni_modules_tdesignUniapp_components_common_utils.calcIcon(value, "");
},
immediate: true
},
theme: "setClass",
size: "setClass",
plain: "setClass",
block: "setClass",
shape: "setClass",
disabled: "setClass",
loading: "setClass",
variant: "setClass"
},
mounted() {
this.setClass();
},
methods: {
setClass() {
const t = [
name,
this.tClass,
`${name}--${this.variant || "base"}`,
`${name}--${this.theme || "default"}`,
`${name}--${this.shape || "rectangle"}`,
`${name}--size-${this.size || "medium"}`
];
if (this.block) {
t.push(`${name}--block`);
}
if (this.disabled) {
t.push(`${name}--disabled`);
}
if (this.ghost) {
t.push(`${name}--ghost`);
}
this.className = t.join(" ");
},
getuserinfo(t) {
this.$emit("getuserinfo", t);
},
contact(t) {
this.$emit("contact", t);
},
getphonenumber(t) {
this.$emit("getphonenumber", t);
},
error(t) {
this.$emit("error", t);
},
opensetting(t) {
this.$emit("opensetting", t);
},
launchapp(t) {
this.$emit("launchapp", t);
},
chooseavatar(t) {
this.$emit("chooseavatar", t);
},
agreeprivacyauthorization(t) {
this.$emit("agreeprivacyauthorization", t);
},
handleTap(t) {
if (this.disabled || this.loading)
return;
this.$emit("click", t);
}
}
});
if (!Array) {
const _easycom_t_icon2 = common_vendor.resolveComponent("t-icon");
const _easycom_t_loading2 = common_vendor.resolveComponent("t-loading");
(_easycom_t_icon2 + _easycom_t_loading2)();
}
const _easycom_t_icon = () => "../icon/icon.js";
const _easycom_t_loading = () => "../loading/loading.js";
if (!Math) {
(_easycom_t_icon + _easycom_t_loading)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx._icon
}, _ctx._icon ? {
b: common_vendor.o(($event) => "handleClose"),
c: common_vendor.p({
["custom-style"]: _ctx.iconCustomStyle,
["t-class"]: _ctx.classPrefix + "__icon " + _ctx.classPrefix + "__icon--" + (_ctx._icon.activeIdx == _ctx._icon.index ? "active " : " ") + _ctx.tClassIcon,
prefix: _ctx._icon.prefix,
name: _ctx._icon.name || "",
size: _ctx._icon.size,
color: _ctx._icon.color
})
} : {}, {
d: _ctx.loading
}, _ctx.loading ? {
e: common_vendor.p({
delay: _ctx.loadingProps.delay || 0,
duration: _ctx.loadingProps.duration || 800,
indicator: _ctx.loadingProps.indicator || true,
["inherit-color"]: _ctx.loadingProps.inheritColor || true,
layout: _ctx.loadingProps.layout || "horizontal",
pause: _ctx.loadingProps.pause || false,
progress: _ctx.loadingProps.progress || 0,
reverse: _ctx.loadingProps.reverse || false,
size: _ctx.loadingProps.size || "40rpx",
text: _ctx.loadingProps.text || "",
theme: _ctx.loadingProps.theme || "circular",
loading: true,
["t-class"]: _ctx.classPrefix + "__loading " + _ctx.classPrefix + "__loading--wrapper",
["t-class-indicator"]: _ctx.classPrefix + "__loading--indicator " + _ctx.tClassLoading,
["custom-style"]: _ctx.loadingCustomStyle
})
} : {}, {
f: _ctx.content
}, _ctx.content ? {
g: common_vendor.t(_ctx.content)
} : {}, {
h: common_vendor.n(_ctx.classPrefix + "__content " + ((_ctx._icon && _ctx._icon.name || _ctx.loading) && _ctx.content ? _ctx.classPrefix + "__content--has-icon" : "")),
i: _ctx.tId,
j: common_vendor.s(_ctx.tools._style([_ctx.customStyle])),
k: _ctx.customDataset,
l: common_vendor.n(_ctx.className),
m: _ctx.disabled || _ctx.loading ? "" : _ctx.type,
n: _ctx.disabled || _ctx.loading ? "" : _ctx.openType,
o: _ctx.hoverStopPropagation,
p: _ctx.hoverStartTime,
q: _ctx.hoverStayTime,
r: _ctx.lang,
s: _ctx.sessionFrom,
t: _ctx.disabled || _ctx.loading ? "" : _ctx.hoverClass || _ctx.classPrefix + "--hover",
v: _ctx.sendMessageTitle,
w: _ctx.sendMessagePath,
x: _ctx.sendMessageImg,
y: _ctx.appParameter,
z: _ctx.showMessageCard,
A: _ctx.ariaLabel,
B: common_vendor.o((...args) => _ctx.handleTap && _ctx.handleTap(...args)),
C: common_vendor.o((...args) => _ctx.getuserinfo && _ctx.getuserinfo(...args)),
D: common_vendor.o((...args) => _ctx.contact && _ctx.contact(...args)),
E: common_vendor.o((...args) => _ctx.getphonenumber && _ctx.getphonenumber(...args)),
F: common_vendor.o((...args) => _ctx.error && _ctx.error(...args)),
G: common_vendor.o((...args) => _ctx.opensetting && _ctx.opensetting(...args)),
H: common_vendor.o((...args) => _ctx.launchapp && _ctx.launchapp(...args)),
I: common_vendor.o((...args) => _ctx.chooseavatar && _ctx.chooseavatar(...args)),
J: common_vendor.o((...args) => _ctx.agreeprivacyauthorization && _ctx.agreeprivacyauthorization(...args))
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ad58069f"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/button/button.js.map

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"t-icon": "../icon/icon",
"t-loading": "../loading/loading"
}
}

View File

@@ -0,0 +1 @@
<button id="{{i}}" style="{{j}}" data-custom="{{k}}" class="{{['data-v-ad58069f', l]}}" form-type="{{m}}" open-type="{{n}}" hover-stop-propagation="{{o}}" hover-start-time="{{p}}" hover-stay-time="{{q}}" lang="{{r}}" session-from="{{s}}" hover-class="{{t}}" send-message-title="{{v}}" send-message-path="{{w}}" send-message-img="{{x}}" app-parameter="{{y}}" show-message-card="{{z}}" aria-label="{{A}}" catchtap="{{B}}" bindgetuserinfo="{{C}}" bindcontact="{{D}}" bindgetphonenumber="{{E}}" binderror="{{F}}" bindopensetting="{{G}}" bindlaunchapp="{{H}}" bindchooseavatar="{{I}}" bindagreeprivacyauthorization="{{J}}"><block wx:if="{{a}}" name="icon"><t-icon wx:if="{{c}}" class="data-v-ad58069f" bindclick="{{b}}" u-i="ad58069f-0" bind:__l="__l" u-p="{{c}}"/></block><t-loading wx:if="{{d}}" class="data-v-ad58069f" u-i="ad58069f-1" bind:__l="__l" u-p="{{e}}"/><view class="{{['data-v-ad58069f', h]}}"><slot name="content"/><block wx:if="{{f}}">{{g}}</block><slot/></view><slot name="suffix"/></button>

View File

@@ -0,0 +1,525 @@
.t-button--size-extra-small.data-v-ad58069f {
font-size: var(--td-button-extra-small-font-size, var(--td-font-size-base, 28rpx));
padding-left: var(--td-button-extra-small-padding-horizontal, 16rpx);
padding-right: var(--td-button-extra-small-padding-horizontal, 16rpx);
height: var(--td-button-extra-small-height, 56rpx);
line-height: var(--td-button-extra-small-height, 56rpx);
}
.t-button--size-extra-small .t-button__icon.data-v-ad58069f {
font-size: var(--td-button-extra-small-icon-size, 36rpx);
}
.t-button--size-small.data-v-ad58069f {
font-size: var(--td-button-small-font-size, var(--td-font-size-base, 28rpx));
padding-left: var(--td-button-small-padding-horizontal, 24rpx);
padding-right: var(--td-button-small-padding-horizontal, 24rpx);
height: var(--td-button-small-height, 64rpx);
line-height: var(--td-button-small-height, 64rpx);
}
.t-button--size-small .t-button__icon.data-v-ad58069f {
font-size: var(--td-button-small-icon-size, 36rpx);
}
.t-button--size-medium.data-v-ad58069f {
font-size: var(--td-button-medium-font-size, var(--td-font-size-m, 32rpx));
padding-left: var(--td-button-medium-padding-horizontal, 32rpx);
padding-right: var(--td-button-medium-padding-horizontal, 32rpx);
height: var(--td-button-medium-height, 80rpx);
line-height: var(--td-button-medium-height, 80rpx);
}
.t-button--size-medium .t-button__icon.data-v-ad58069f {
font-size: var(--td-button-medium-icon-size, 40rpx);
}
.t-button--size-large.data-v-ad58069f {
font-size: var(--td-button-large-font-size, var(--td-font-size-m, 32rpx));
padding-left: var(--td-button-large-padding-horizontal, 40rpx);
padding-right: var(--td-button-large-padding-horizontal, 40rpx);
height: var(--td-button-large-height, 96rpx);
line-height: var(--td-button-large-height, 96rpx);
}
.t-button--size-large .t-button__icon.data-v-ad58069f {
font-size: var(--td-button-large-icon-size, 48rpx);
}
.t-button--default.data-v-ad58069f {
color: var(--td-button-default-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
background-color: var(--td-button-default-bg-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
border-color: var(--td-button-default-border-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
}
.t-button--default.data-v-ad58069f::after {
border-width: var(--td-button-border-width, 4rpx);
border-color: var(--td-button-default-border-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
}
.t-button--default.t-button--hover.data-v-ad58069f {
z-index: 0;
}
.t-button--default.t-button--hover.data-v-ad58069f,
.t-button--default.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-button-default-active-bg-color, var(--td-bg-color-component-active, var(--td-gray-color-6, #a6a6a6)));
border-color: var(--td-button-default-active-border-color, var(--td-bg-color-component-active, var(--td-gray-color-6, #a6a6a6)));
}
.t-button--default.t-button--disabled.data-v-ad58069f {
color: var(--td-button-default-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
background-color: var(--td-button-default-disabled-bg, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
}
.t-button--default.t-button--disabled.data-v-ad58069f,
.t-button--default.t-button--disabled.data-v-ad58069f::after {
border-color: var(--td-button-default-disabled-border-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
}
.t-button--primary.data-v-ad58069f {
color: var(--td-button-primary-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
background-color: var(--td-button-primary-bg-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
border-color: var(--td-button-primary-border-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
}
.t-button--primary.data-v-ad58069f::after {
border-width: var(--td-button-border-width, 4rpx);
border-color: var(--td-button-primary-border-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
}
.t-button--primary.t-button--hover.data-v-ad58069f {
z-index: 0;
}
.t-button--primary.t-button--hover.data-v-ad58069f,
.t-button--primary.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-button-primary-active-bg-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
border-color: var(--td-button-primary-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
}
.t-button--primary.t-button--disabled.data-v-ad58069f {
color: var(--td-button-primary-disabled-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
background-color: var(--td-button-primary-disabled-bg, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
}
.t-button--primary.t-button--disabled.data-v-ad58069f,
.t-button--primary.t-button--disabled.data-v-ad58069f::after {
border-color: var(--td-button-primary-disabled-border-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
}
.t-button--light.data-v-ad58069f {
color: var(--td-button-light-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
background-color: var(--td-button-light-bg-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
border-color: var(--td-button-light-border-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
}
.t-button--light.data-v-ad58069f::after {
border-width: var(--td-button-border-width, 4rpx);
border-color: var(--td-button-light-border-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
}
.t-button--light.t-button--hover.data-v-ad58069f {
z-index: 0;
}
.t-button--light.t-button--hover.data-v-ad58069f,
.t-button--light.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-button-light-active-bg-color, var(--td-brand-color-light-active, var(--td-primary-color-2, #d9e1ff)));
border-color: var(--td-button-light-active-border-color, var(--td-brand-color-light-active, var(--td-primary-color-2, #d9e1ff)));
}
.t-button--light.t-button--disabled.data-v-ad58069f {
color: var(--td-button-light-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
background-color: var(--td-button-light-disabled-bg, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
}
.t-button--light.t-button--disabled.data-v-ad58069f,
.t-button--light.t-button--disabled.data-v-ad58069f::after {
border-color: var(--td-button-light-disabled-border-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
}
.t-button--danger.data-v-ad58069f {
color: var(--td-button-danger-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
background-color: var(--td-button-danger-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
border-color: var(--td-button-danger-border-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
}
.t-button--danger.data-v-ad58069f::after {
border-width: var(--td-button-border-width, 4rpx);
border-color: var(--td-button-danger-border-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
}
.t-button--danger.t-button--hover.data-v-ad58069f {
z-index: 0;
}
.t-button--danger.t-button--hover.data-v-ad58069f,
.t-button--danger.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-button-danger-active-bg-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
border-color: var(--td-button-danger-active-border-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
}
.t-button--danger.t-button--disabled.data-v-ad58069f {
color: var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff));
background-color: var(--td-button-danger-disabled-bg, var(--td-error-color-3, #ffb9b0));
}
.t-button--danger.t-button--disabled.data-v-ad58069f,
.t-button--danger.t-button--disabled.data-v-ad58069f::after {
border-color: var(--td-button-danger-disabled-border-color, var(--td-error-color-3, #ffb9b0));
}
.t-button.data-v-ad58069f {
display: inline-flex;
align-items: center;
justify-content: center;
position: relative;
white-space: nowrap;
text-align: center;
background-image: none;
transition: all 0.3s;
touch-action: manipulation;
border-radius: var(--td-button-border-radius, var(--td-radius-default, 12rpx));
outline: none;
font-family: PingFang SC, Microsoft YaHei, Arial Regular;
font-weight: var(--td-button-font-weight, 600);
vertical-align: top;
box-sizing: border-box;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
-webkit-user-select: none;
user-select: none;
/* stylelint-disable-next-line */
-webkit-appearance: none;
}
.t-button.data-v-ad58069f::after {
border-radius: calc(var(--td-button-border-radius, var(--td-radius-default, 12rpx)) * 2);
}
.t-button--text.data-v-ad58069f {
color: var(--td-button-default-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
background-color: transparent;
}
.t-button--text.data-v-ad58069f,
.t-button--text.data-v-ad58069f::after {
border: 0;
}
.t-button--text.t-button--hover.data-v-ad58069f,
.t-button--text.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-button-default-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
}
.t-button--text.t-button--primary.data-v-ad58069f {
color: var(--td-button-primary-text-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
background-color: transparent;
}
.t-button--text.t-button--primary.t-button--hover.data-v-ad58069f,
.t-button--text.t-button--primary.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-button-primary-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
}
.t-button--text.t-button--primary.t-button--disabled.data-v-ad58069f {
color: var(--td-button-primary-text-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
}
.t-button--text.t-button--danger.data-v-ad58069f {
color: var(--td-button-danger-text-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
background-color: transparent;
}
.t-button--text.t-button--danger.t-button--hover.data-v-ad58069f,
.t-button--text.t-button--danger.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-button-danger-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
}
.t-button--text.t-button--danger.t-button--disabled.data-v-ad58069f {
color: var(--td-button-danger-text-disabled-color, var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff)));
background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
}
.t-button--text.t-button--light.data-v-ad58069f {
color: var(--td-button-light-text-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
background-color: transparent;
}
.t-button--text.t-button--light.t-button--hover.data-v-ad58069f,
.t-button--text.t-button--light.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-button-light-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
}
.t-button--text.t-button--disabled.data-v-ad58069f {
color: var(--td-button-default-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
}
.t-button--outline.data-v-ad58069f {
color: var(--td-button-default-outline-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
}
.t-button--outline.data-v-ad58069f,
.t-button--outline.data-v-ad58069f::after {
border-color: var(--td-button-default-outline-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
}
.t-button--outline.t-button--hover.data-v-ad58069f,
.t-button--outline.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-button-default-outline-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
border-color: var(--td-button-default-outline-active-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
}
.t-button--outline.t-button--disabled.data-v-ad58069f {
color: var(--td-button-default-outline-disabled-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
}
.t-button--outline.t-button--disabled.data-v-ad58069f,
.t-button--outline.t-button--disabled.data-v-ad58069f::after {
border-color: var(--td-button-default-outline-disabled-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
}
.t-button--outline.t-button--primary.data-v-ad58069f {
color: var(--td-button-primary-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
}
.t-button--outline.t-button--primary.data-v-ad58069f,
.t-button--outline.t-button--primary.data-v-ad58069f::after {
border-color: var(--td-button-primary-outline-border-color, var(--td-button-primary-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
}
.t-button--outline.t-button--primary.t-button--hover.data-v-ad58069f {
color: var(--td-button-primary-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
}
.t-button--outline.t-button--primary.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-button-primary-outline-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
border-color: var(--td-button-primary-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
}
.t-button--outline.t-button--primary.t-button--disabled.data-v-ad58069f {
background-color: transparent;
color: var(--td-button-primary-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
}
.t-button--outline.t-button--primary.t-button--disabled.data-v-ad58069f,
.t-button--outline.t-button--primary.t-button--disabled.data-v-ad58069f::after {
border-color: var(--td-button-primary-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
}
.t-button--outline.t-button--danger.data-v-ad58069f {
color: var(--td-button-danger-outline-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
}
.t-button--outline.t-button--danger.data-v-ad58069f,
.t-button--outline.t-button--danger.data-v-ad58069f::after {
border-color: var(--td-button-danger-outline-border-color, var(--td-button-danger-outline-color, var(--td-error-color, var(--td-error-color-6, #d54941))));
}
.t-button--outline.t-button--danger.t-button--hover.data-v-ad58069f {
color: var(--td-button-danger-outline-active-border-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
}
.t-button--outline.t-button--danger.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-button-danger-outline-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
border-color: var(--td-button-danger-outline-active-border-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
}
.t-button--outline.t-button--danger.t-button--disabled.data-v-ad58069f {
background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
color: var(--td-button-danger-outline-disabled-color, var(--td-error-color-3, #ffb9b0));
}
.t-button--outline.t-button--danger.t-button--disabled.data-v-ad58069f,
.t-button--outline.t-button--danger.t-button--disabled.data-v-ad58069f::after {
border-color: var(--td-button-danger-outline-disabled-color, var(--td-error-color-3, #ffb9b0));
}
.t-button--outline.t-button--light.data-v-ad58069f {
color: var(--td-button-light-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
background-color: var(--td-button-light-outline-bg-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
}
.t-button--outline.t-button--light.data-v-ad58069f,
.t-button--outline.t-button--light.data-v-ad58069f::after {
border-color: var(--td-button-light-outline-border-color, var(--td-button-light-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
}
.t-button--outline.t-button--light.t-button--hover.data-v-ad58069f {
color: var(--td-button-light-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
}
.t-button--outline.t-button--light.t-button--hover.data-v-ad58069f,
.t-button--outline.t-button--light.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-button-light-outline-active-bg-color, var(--td-brand-color-light-active, var(--td-primary-color-2, #d9e1ff)));
border-color: var(--td-button-light-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
}
.t-button--outline.t-button--light.t-button--disabled.data-v-ad58069f {
background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
color: var(--td-button-light-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
}
.t-button--outline.t-button--light.t-button--disabled.data-v-ad58069f,
.t-button--outline.t-button--light.t-button--disabled.data-v-ad58069f::after {
border-color: var(--td-button-light-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
}
.t-button--dashed.data-v-ad58069f {
background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
border-style: dashed;
border-width: 2rpx;
}
.t-button--dashed.data-v-ad58069f::after {
border: 0;
}
.t-button--dashed.t-button--hover.data-v-ad58069f,
.t-button--dashed.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-button-default-outline-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
border-color: var(--td-button-default-outline-active-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
}
.t-button--dashed.t-button--primary.data-v-ad58069f {
color: var(--td-button-primary-dashed-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
}
.t-button--dashed.t-button--primary.data-v-ad58069f,
.t-button--dashed.t-button--primary.data-v-ad58069f::after {
border-color: var(--td-button-primary-dashed-border-color, var(--td-button-primary-dashed-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
}
.t-button--dashed.t-button--primary.t-button--disabled.data-v-ad58069f {
background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
color: var(--td-button-primary-dashed-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
}
.t-button--dashed.t-button--primary.t-button--disabled.data-v-ad58069f,
.t-button--dashed.t-button--primary.t-button--disabled.data-v-ad58069f::after {
border-color: var(--td-button-primary-dashed-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
}
.t-button--dashed.t-button--danger.data-v-ad58069f {
color: var(--td-button-danger-dashed-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
}
.t-button--dashed.t-button--danger.data-v-ad58069f,
.t-button--dashed.t-button--danger.data-v-ad58069f::after {
border-color: var(--td-button-danger-dashed-border-color, var(--td-button-danger-dashed-color, var(--td-error-color, var(--td-error-color-6, #d54941))));
}
.t-button--dashed.t-button--danger.t-button--disabled.data-v-ad58069f {
background-color: transparent;
color: var(--td-button-danger-dashed-disabled-color, var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff)));
}
.t-button--dashed.t-button--danger.t-button--disabled.data-v-ad58069f::after {
border-color: var(--td-button-danger-dashed-disabled-color, var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff)));
}
.t-button--ghost.data-v-ad58069f {
background-color: transparent;
color: var(--td-button-ghost-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
}
.t-button--ghost.data-v-ad58069f,
.t-button--ghost.data-v-ad58069f::after {
border-color: var(--td-button-ghost-border-color, var(--td-button-ghost-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff))));
}
.t-button--ghost.t-button--default.t-button--hover.data-v-ad58069f {
color: var(--td-button-ghost-hover-color, var(--td-font-white-2, rgba(255, 255, 255, 0.55)));
}
.t-button--ghost.t-button--default.t-button--hover.data-v-ad58069f,
.t-button--ghost.t-button--default.t-button--hover.data-v-ad58069f::after {
background-color: transparent;
border-color: var(--td-button-ghost-hover-color, var(--td-font-white-2, rgba(255, 255, 255, 0.55)));
}
.t-button--ghost.t-button--primary.data-v-ad58069f {
color: var(--td-button-ghost-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
}
.t-button--ghost.t-button--primary.data-v-ad58069f,
.t-button--ghost.t-button--primary.data-v-ad58069f::after {
border-color: var(--td-button-ghost-primary-border-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
}
.t-button--ghost.t-button--primary.t-button--hover.data-v-ad58069f {
color: var(--td-button-ghost-primary-hover-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
}
.t-button--ghost.t-button--primary.t-button--hover.data-v-ad58069f,
.t-button--ghost.t-button--primary.t-button--hover.data-v-ad58069f::after {
background-color: transparent;
border-color: var(--td-button-ghost-primary-hover-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
}
.t-button--ghost.t-button--primary.t-button--text.t-button--hover.data-v-ad58069f,
.t-button--ghost.t-button--primary.t-button--text.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-gray-color-10, #4b4b4b);
}
.t-button--ghost.t-button--primary.t-button--disabled.data-v-ad58069f {
background-color: transparent;
color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
}
.t-button--ghost.t-button--primary.t-button--disabled.data-v-ad58069f,
.t-button--ghost.t-button--primary.t-button--disabled.data-v-ad58069f::after {
border-color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
}
.t-button--ghost.t-button--danger.data-v-ad58069f {
color: var(--td-button-ghost-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
}
.t-button--ghost.t-button--danger.data-v-ad58069f,
.t-button--ghost.t-button--danger.data-v-ad58069f::after {
border-color: var(--td-button-ghost-danger-border-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
}
.t-button--ghost.t-button--danger.t-button--hover.data-v-ad58069f {
color: var(--td-button-ghost-danger-hover-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
}
.t-button--ghost.t-button--danger.t-button--hover.data-v-ad58069f,
.t-button--ghost.t-button--danger.t-button--hover.data-v-ad58069f::after {
background-color: transparent;
border-color: var(--td-button-ghost-danger-hover-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
}
.t-button--ghost.t-button--danger.t-button--text.t-button--hover.data-v-ad58069f,
.t-button--ghost.t-button--danger.t-button--text.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-gray-color-10, #4b4b4b);
}
.t-button--ghost.t-button--danger.t-button--disabled.data-v-ad58069f {
background-color: transparent;
color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
}
.t-button--ghost.t-button--danger.t-button--disabled.data-v-ad58069f,
.t-button--ghost.t-button--danger.t-button--disabled.data-v-ad58069f::after {
border-color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
}
.t-button--ghost.t-button--default.t-button--text.t-button--hover.data-v-ad58069f,
.t-button--ghost.t-button--default.t-button--text.t-button--hover.data-v-ad58069f::after {
background-color: var(--td-gray-color-10, #4b4b4b);
}
.t-button--ghost.t-button--default.t-button--disabled.data-v-ad58069f {
background-color: transparent;
color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
}
.t-button--ghost.t-button--default.t-button--disabled.data-v-ad58069f,
.t-button--ghost.t-button--default.t-button--disabled.data-v-ad58069f::after {
border-color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
}
.t-button__loading + .t-button__content.data-v-ad58069f:not(:empty),
.t-button__icon + .t-button__content.data-v-ad58069f:not(:empty) {
margin-left: 8rpx;
}
.t-button__icon.data-v-ad58069f {
border-radius: var(--td-button-icon-border-radius, 8rpx);
}
.t-button--round.t-button--size-large.data-v-ad58069f {
border-radius: calc(var(--td-button-large-height, 96rpx) / 2);
}
.t-button--round.t-button--size-large.data-v-ad58069f::after {
border-radius: var(--td-button-large-height, 96rpx);
}
.t-button--round.t-button--size-medium.data-v-ad58069f {
border-radius: calc(var(--td-button-medium-height, 80rpx) / 2);
}
.t-button--round.t-button--size-medium.data-v-ad58069f::after {
border-radius: var(--td-button-medium-height, 80rpx);
}
.t-button--round.t-button--size-small.data-v-ad58069f {
border-radius: calc(var(--td-button-small-height, 64rpx) / 2);
}
.t-button--round.t-button--size-small.data-v-ad58069f::after {
border-radius: var(--td-button-small-height, 64rpx);
}
.t-button--round.t-button--size-extra-small.data-v-ad58069f {
border-radius: calc(var(--td-button-extra-small-height, 56rpx) / 2);
}
.t-button--round.t-button--size-extra-small.data-v-ad58069f::after {
border-radius: var(--td-button-extra-small-height, 56rpx);
}
.t-button--square.data-v-ad58069f {
padding: 0;
}
.t-button--square.t-button--size-large.data-v-ad58069f {
width: var(--td-button-large-height, 96rpx);
}
.t-button--square.t-button--size-medium.data-v-ad58069f {
width: var(--td-button-medium-height, 80rpx);
}
.t-button--square.t-button--size-small.data-v-ad58069f {
width: var(--td-button-small-height, 64rpx);
}
.t-button--square.t-button--size-extra-small.data-v-ad58069f {
width: var(--td-button-extra-small-height, 56rpx);
}
.t-button--circle.data-v-ad58069f {
padding: 0;
border-radius: 50%;
}
.t-button--circle.t-button--size-large.data-v-ad58069f {
width: var(--td-button-large-height, 96rpx);
}
.t-button--circle.t-button--size-large.data-v-ad58069f::after {
border-radius: 50%;
}
.t-button--circle.t-button--size-medium.data-v-ad58069f {
width: var(--td-button-medium-height, 80rpx);
}
.t-button--circle.t-button--size-medium.data-v-ad58069f::after {
border-radius: 50%;
}
.t-button--circle.t-button--size-small.data-v-ad58069f {
width: var(--td-button-small-height, 64rpx);
}
.t-button--circle.t-button--size-small.data-v-ad58069f::after {
border-radius: 50%;
}
.t-button--circle.t-button--size-extra-small.data-v-ad58069f {
width: var(--td-button-extra-small-height, 56rpx);
}
.t-button--circle.t-button--size-extra-small.data-v-ad58069f::after {
border-radius: 50%;
}
.t-button--block.data-v-ad58069f {
display: flex;
width: 100%;
}
.t-button--disabled.data-v-ad58069f {
cursor: not-allowed;
}
.t-button__loading--wrapper.data-v-ad58069f {
display: flex;
align-items: center;
justify-content: center;
}
.t-button.t-button--hover.data-v-ad58069f::after {
z-index: -1;
}
.data-v-ad58069f .t-button__loading + .t-button__content:not(:empty) {
margin-left: 4px;
}
.data-v-ad58069f .t-button__icon + .t-button__content:not(:empty) {
margin-left: 4px;
}
.t-button.data-v-ad58069f {
/* support my-alipay */
margin-left: auto;
margin-right: auto;
}

View File

@@ -0,0 +1,210 @@
"use strict";
const props = {
/** 打开 APP 时,向 APP 传递的参数open-type=launchApp时有效 */
appParameter: {
type: String,
default: ""
},
/** 是否为块级元素 */
block: Boolean,
/** 按钮内容 */
content: {
type: String
},
/** 自定义 dataset可通过 event.currentTarget.dataset.custom 获取 */
customDataset: {
type: [String, Number, Boolean, Object, Array],
default: () => ({})
},
/** 禁用状态。优先级Button.disabled > Form.disabled */
disabled: {
type: Boolean,
default: void 0
},
/** 是否为幽灵按钮(镂空按钮) */
ghost: Boolean,
/** 指定按钮按下去的样式类,按钮不为加载或禁用状态时有效。当 `hover-class="none"` 时,没有点击态效果 */
hoverClass: {
type: String,
default: ""
},
/** 按住后多久出现点击态,单位毫秒 */
hoverStartTime: {
type: Number,
default: 20
},
/** 手指松开后点击态保留时间,单位毫秒 */
hoverStayTime: {
type: Number,
default: 70
},
/** 指定是否阻止本节点的祖先节点出现点击态 */
hoverStopPropagation: Boolean,
/** 图标名称。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon` */
icon: {
type: [String, Object]
},
/** 指定返回用户信息的语言zh_CN 简体中文zh_TW 繁体中文en 英文。<br />具体释义:<br />`en` 英文;<br />`zh_CN` 简体中文;<br />`zh_TW` 繁体中文。<br />[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html) */
lang: {
type: String,
validator(val) {
if (!val)
return true;
return ["en", "zh_CN", "zh_TW"].includes(val);
}
},
/** 是否显示为加载状态 */
loading: Boolean,
/** 透传 Loading 组件全部属性 */
loadingProps: {
type: Object,
default: () => ({})
},
/** 微信开放能力。<br />具体释义:<br />`contact` 打开客服会话,如果用户在会话中点击消息卡片后返回小程序,可以从 bindcontact 回调中获得具体信息,<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/customer-message.html">具体说明</a> *鸿蒙 OS 暂不支持*<br />`liveActivity` 通过前端获取<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html">新的一次性订阅消息下发机制</a>使用的 code<br />`share` 触发用户转发,使用前建议先阅读<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#使用指引">使用指引</a><br />`getPhoneNumber` 获取用户手机号,可以从 bindgetphonenumber 回调中获取到用户信息,<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html">具体说明</a> *小程序插件中不能使用*<br />`getUserInfo` 获取用户信息,可以从 bindgetuserinfo 回调中获取到用户信息 *小程序插件中不能使用*<br />`launchApp` 打开APP可以通过 app-parameter 属性设定向 APP 传的参数<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/launchApp.html">具体说明</a><br />`openSetting` 打开授权设置页;<br />`feedback` 打开“意见反馈”页面,用户可提交反馈内容并上传<a href="https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/wx.getLogManager.html">日志</a>,开发者可以登录<a href="https://mp.weixin.qq.com/">小程序管理后台</a>后进入左侧菜单“客服反馈”页面获取到反馈内容;<br />`chooseAvatar` 获取用户头像,可以从 bindchooseavatar 回调中获取到头像信息;<br />`agreePrivacyAuthorization`用户同意隐私协议按钮。用户点击一次此按钮后,所有隐私接口可以正常调用。可通过`bindagreeprivacyauthorization`监听用户同意隐私协议事件。隐私合规开发指南详情可见《<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/user-privacy/PrivacyAuthorize.html">小程序隐私协议开发指南</a>》。<br />[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html) */
openType: {
type: String,
validator(val) {
if (!val)
return true;
return ["contact", "share", "getPhoneNumber", "getUserInfo", "launchApp", "openSetting", "feedback", "chooseAvatar", "agreePrivacyAuthorization"].includes(val);
}
},
/** 原生按钮属性当手机号快速验证或手机号实时验证额度用尽时是否对用户展示“申请获取你的手机号但该功能使用次数已达当前小程序上限暂时无法使用”的提示默认展示open-type="getPhoneNumber" 或 open-type="getRealtimePhoneNumber" 时有效 */
phoneNumberNoQuotaToast: {
type: Boolean,
default: true
},
/** 会话内消息卡片图片open-type="contact"时有效 */
sendMessageImg: {
type: String,
default: "截图"
},
/** 会话内消息卡片点击跳转小程序路径open-type="contact"时有效 */
sendMessagePath: {
type: String,
default: "当前分享路径"
},
/** 会话内消息卡片标题open-type="contact"时有效 */
sendMessageTitle: {
type: String,
default: "当前标题"
},
/** 会话来源open-type="contact"时有效 */
sessionFrom: {
type: String,
default: ""
},
/** 按钮形状,有 4 种:长方形、正方形、圆角长方形、圆形 */
shape: {
type: String,
default: "rectangle",
validator(val) {
if (!val)
return true;
return ["rectangle", "square", "round", "circle"].includes(val);
}
},
/** 是否显示会话内消息卡片,设置此参数为 true用户进入客服会话会在右下角显示"可能要发送的小程序"提示用户点击后可以快速发送小程序消息open-type="contact"时有效 */
showMessageCard: Boolean,
/** 组件尺寸 */
size: {
type: String,
default: "medium",
validator(val) {
if (!val)
return true;
return ["extra-small", "small", "medium", "large"].includes(val);
}
},
/** 按钮标签id */
tId: {
type: String,
default: ""
},
/** 组件风格,依次为品牌色、危险色 */
theme: {
type: String,
default: "default",
validator(val) {
if (!val)
return true;
return ["default", "primary", "danger", "light"].includes(val);
}
},
/** 同小程序的 formType */
type: {
type: String,
validator(val) {
if (!val)
return true;
return ["submit", "reset"].includes(val);
}
},
/** 按钮形式,基础、线框、虚线、文字 */
variant: {
type: String,
default: "base",
validator(val) {
if (!val)
return true;
return ["base", "outline", "dashed", "text"].includes(val);
}
},
/** 原生按钮属性用户同意隐私协议事件回调open-type=agreePrivacyAuthorization时有效 Tips: 如果使用 onNeedPrivacyAuthorization 接口,需要在 bindagreeprivacyauthorization 触发后再调用 resolve({ event: "agree", buttonId }) */
onAgreeprivacyauthorization: {
type: Function,
default: () => ({})
},
/** 原生按钮属性,获取用户头像回调,`open-type=chooseAvatar` 时有效。返回 `e.detail.avatarUrl` 为头像临时文件链接 */
onChooseavatar: {
type: Function,
default: () => ({})
},
/** 点击时触发 */
onClick: {
type: Function,
default: () => ({})
},
/** 原生按钮属性,客服消息回调,`open-type="contact"` 时有效 */
onContact: {
type: Function,
default: () => ({})
},
/** 新的一次性订阅消息下发机制回调,`open-type=liveActivity` 时有效 */
onCreateliveactivity: {
type: Function,
default: () => ({})
},
/** 原生按钮属性,当使用开放能力时,发生错误的回调,`open-type=launchApp` 时有效 */
onError: {
type: Function,
default: () => ({})
},
/** 原生按钮属性手机号快速验证回调open-type=getPhoneNumber时有效。Tips在触发 bindgetphonenumber 回调后应立即隐藏手机号按钮组件,或置为 disabled 状态,避免用户重复授权手机号产生额外费用 */
onGetphonenumber: {
type: Function,
default: () => ({})
},
/** 原生按钮属性手机号实时验证回调open-type=getRealtimePhoneNumber 时有效。Tips在触发 bindgetrealtimephonenumber 回调后应立即隐藏手机号按钮组件,或置为 disabled 状态,避免用户重复授权手机号产生额外费用 */
onGetrealtimephonenumber: {
type: Function,
default: () => ({})
},
/** 原生按钮属性用户点击该按钮时会返回获取到的用户信息回调的detail数据与wx.getUserInfo返回的一致open-type="getUserInfo"时有效 */
onGetuserinfo: {
type: Function,
default: () => ({})
},
/** 打开 APP 成功的回调,`open-type=launchApp` 时有效 */
onLaunchapp: {
type: Function,
default: () => ({})
},
/** 原生按钮属性在打开授权设置页后回调open-type=openSetting时有效 */
onOpensetting: {
type: Function,
default: () => ({})
}
};
exports.props = props;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/button/props.js.map

View File

@@ -0,0 +1,66 @@
"use strict";
class Bus {
constructor() {
this.listeners = /* @__PURE__ */ new Map();
this.emitted = /* @__PURE__ */ new Map();
this.onceListeners = /* @__PURE__ */ new Map();
}
on(evtName, listener) {
const target = this.listeners.get(evtName) || [];
target.push(listener);
this.listeners.set(evtName, target);
if (this.emitted.has(evtName)) {
listener(...this.emitted.get(evtName));
}
}
once(evtName, listener) {
if (this.emitted.has(evtName)) {
listener(...this.emitted.get(evtName));
return;
}
const onceWrapper = (...args) => {
listener(...args);
this.off(evtName, onceWrapper);
};
const onceMap = this.onceListeners.get(evtName) || /* @__PURE__ */ new Map();
onceMap.set(listener, onceWrapper);
this.onceListeners.set(evtName, onceMap);
this.on(evtName, onceWrapper);
}
emit(evtName, ...args) {
this.emitted.set(evtName, args);
const listeners = this.listeners.get(evtName) || [];
[...listeners].forEach((func) => func(...args));
}
off(evtName, listener) {
if (listener) {
const onceMap = this.onceListeners.get(evtName);
if (onceMap && onceMap.has(listener)) {
const wrapper = onceMap.get(listener);
this._removeListener(evtName, wrapper);
onceMap.delete(listener);
return;
}
this._removeListener(evtName, listener);
} else {
this.listeners.delete(evtName);
this.onceListeners.delete(evtName);
this.emitted.delete(evtName);
}
}
// 私有方法:从指定事件中移除单个监听器
_removeListener(evtName, listener) {
const listeners = this.listeners.get(evtName);
if (!listeners)
return;
const index = listeners.indexOf(listener);
if (index > -1) {
listeners.splice(index, 1);
if (listeners.length === 0) {
this.listeners.delete(evtName);
}
}
}
}
exports.Bus = Bus;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/bus.js.map

View File

@@ -0,0 +1,4 @@
"use strict";
const prefix = "t";
exports.prefix = prefix;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/config.js.map

View File

@@ -0,0 +1,46 @@
"use strict";
function formatPropKey(key) {
return key.replace(/^(\w)/, (a, b) => `data${b.toUpperCase()}`);
}
function getPropsWatch(props) {
const watchProps = Object.keys(props).reduce((acc, item) => {
acc[item] = {
handler(val) {
this[formatPropKey(item)] = val;
}
};
return acc;
}, {});
return watchProps;
}
function getPropsData(context, props) {
const propsData = Object.keys(props).reduce((acc, item) => {
acc[formatPropKey(item)] = context[item];
return acc;
}, {});
return propsData;
}
function setPropsToData(data) {
Object.keys(data).forEach((key) => {
this[formatPropKey(key)] = data[key];
});
}
function getFunctionalMixin(dialogProps) {
return {
data() {
return {
...getPropsData(this, dialogProps)
};
},
watch: {
...getPropsWatch(dialogProps)
},
methods: {
setData(data) {
setPropsToData.call(this, data);
}
}
};
}
exports.getFunctionalMixin = getFunctionalMixin;
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/functional/mixin.js.map

View File

@@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/relation/index.js.map

View File

@@ -0,0 +1,23 @@
"use strict";
const RELATION_MAP = {
CollapsePanel: "Collapse",
TabPanel: "Tabs",
StepItem: "Steps",
TabBarItem: "TabBar",
SideBarItem: "SideBar",
GridItem: "Grid",
DropdownItem: "DropdownMenu",
Radio: "RadioGroup",
Checkbox: "CheckboxGroup",
Cell: "CellGroup",
Avatar: "AvatarGroup",
PickerItem: "Picker",
IndexesAnchor: "Indexes",
SwiperNav: "Swiper",
Col: "Row",
BackTop: "PullDownRefresh",
FormItem: "Form",
FormKey: "FormKey"
};
exports.RELATION_MAP = RELATION_MAP;
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/relation/parent-map.js.map

View File

@@ -0,0 +1,89 @@
"use strict";
function ChildrenMixin(parent, options = {}) {
const indexKey = options.indexKey || "index";
return {
inject: {
[parent]: {
default: null
}
},
data() {
return {};
},
computed: {
// 会造成循环引用
// parent() {
// if (this.disableBindRelation) {
// return null;
// }
// return this[parent];
// },
[indexKey]() {
const that = this;
that.bindRelation();
if (that[parent]) {
return that[parent].children.indexOf(this);
}
return null;
}
},
watch: {
disableBindRelation(val) {
const that = this;
if (!val) {
that.bindRelation();
}
}
},
created() {
const that = this;
that.bindRelation();
},
mounted() {
},
beforeUnmount() {
const that = this;
that.onBeforeMount();
},
methods: {
bindRelation() {
var _a, _b, _c;
if (!this[parent] || this[parent].children && this[parent].children.indexOf(this) !== -1) {
return;
}
const children = [...this[parent].children || [], this];
this[parent].children = children;
(_a = this.innerAfterLinked) == null ? void 0 : _a.call(this, this);
(_c = (_b = this[parent]).innerAfterLinked) == null ? void 0 : _c.call(_b, this);
},
onBeforeMount() {
var _a, _b, _c, _d;
const that = this;
if (that[parent]) {
that[parent].children = that[parent].children.filter((item) => item !== that);
(_b = (_a = this[parent]).innerAfterUnLinked) == null ? void 0 : _b.call(_a, this);
(_c = this.innerAfterUnLinked) == null ? void 0 : _c.call(this, this);
(_d = that == null ? void 0 : that.destroyCallback) == null ? void 0 : _d.call(that);
}
}
}
};
}
function ParentMixin(parent) {
return {
provide() {
return {
[parent]: this
};
},
data() {
return {
// 会造成循环引用
// children: [],
};
}
};
}
exports.ChildrenMixin = ChildrenMixin;
exports.ParentMixin = ParentMixin;
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/relation/relation.js.map

View File

@@ -0,0 +1,8 @@
"use strict";
function getRegExp() {
const args = Array.prototype.slice.call(arguments);
args.unshift(RegExp);
return new (Function.prototype.bind.apply(RegExp, args))();
}
exports.getRegExp = getRegExp;
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/runtime/wxs-polyfill.js.map

View File

@@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/src/control.js.map

View File

@@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/src/flatTool.js.map

View File

@@ -0,0 +1,3 @@
"use strict";
require("./instantiationDecorator.js");
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/src/index.js.map

View File

@@ -0,0 +1,185 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_validator = require("../validator.js");
const uni_modules_tdesignUniapp_components_common_version = require("../version.js");
const uni_modules_tdesignUniapp_components_common_utils = require("../utils.js");
const getInnerControlledValue = (key) => `data${key.replace(/^(\w)/, (e, t) => t.toUpperCase())}`;
const getDefaultKey = (key) => `default${key.replace(/^(\w)/, (e, t) => t.toUpperCase())}`;
const ARIAL_PROPS = [
{ key: "ariaHidden", type: Boolean },
{ key: "ariaRole", type: String },
{ key: "ariaLabel", type: String },
{ key: "ariaLabelledby", type: String },
{ key: "ariaDescribedby", type: String },
{ key: "ariaBusy", type: Boolean }
];
const getPropsDefault = (type, disableBoolean = false) => {
if (type === Boolean && !disableBoolean) {
return false;
}
if (type === String) {
return "";
}
return void 0;
};
const COMMON_PROPS = {
...ARIAL_PROPS.reduce((acc, item) => ({
...acc,
[item.key]: {
type: item.type,
default: getPropsDefault(item.type)
}
}), {}),
customStyle: { type: [String, Object], default: "" }
};
const toComponent = function(options) {
if (!options.properties && options.props) {
options.properties = options.props;
}
if (options.properties) {
Object.keys(options.properties).forEach((k) => {
let opt = options.properties[k];
if (!uni_modules_tdesignUniapp_components_common_validator.isPlainObject(opt)) {
opt = { type: opt };
}
options.properties[k] = opt;
});
}
if (!options.methods)
options.methods = {};
if (!options.lifetimes)
options.lifetimes = {};
const oldCreated = options.created;
const { controlledProps = [] } = options;
options.created = function(...args) {
if (oldCreated) {
oldCreated.apply(this, args);
}
controlledProps.forEach(({ key }) => {
const defaultKey = getDefaultKey(key);
const tDataKey = getInnerControlledValue(key);
this[tDataKey] = this[key];
if (this[key] == null) {
this._selfControlled = true;
}
if (this[key] == null && this[defaultKey] != null) {
this[tDataKey] = this[defaultKey];
}
});
};
options.methods._trigger = function(evtName, detail, opts) {
const target = controlledProps.find((item) => item.event === evtName);
if (target) {
const { key } = target;
if (this._selfControlled) {
const tDataKey = getInnerControlledValue(key);
this[tDataKey] = detail[key];
}
this.$emit(
`update:${key}`,
detail[key],
opts
);
}
this.$emit(
evtName,
detail,
opts
);
};
return options;
};
function sortPropsType(type) {
if (!Array.isArray(type)) {
return type;
}
type.sort((a, b) => {
if (a === Boolean) {
return -1;
}
if (b === Boolean) {
return 1;
}
return 0;
});
return type;
}
function filterProps(props, controlledProps) {
const newProps = {};
const emits = [];
const reg = /^on[A-Z][a-z]/;
const controlledKeys = Object.values(controlledProps).map((item) => item.key);
const unControlledKeys = controlledKeys.map((key) => getDefaultKey(key));
Object.keys(props).forEach((key) => {
const curType = props[key].type || props[key];
if (reg.test(key) && props[key].type === Function) {
const str = key.replace(/^on/, "");
const eventName = str.charAt(0).toLowerCase() + str.slice(1);
emits.push(...[uni_modules_tdesignUniapp_components_common_utils.hyphenate(eventName), eventName]);
} else if (controlledKeys.indexOf(key) > -1 || unControlledKeys.indexOf(key) > -1) {
const newType = Array.isArray(curType) ? curType : [curType];
newProps[key] = {
type: [null, ...newType],
default: null
};
} else if ([Boolean, String].indexOf(props[key].type) > -1 && props[key].default === void 0) {
newProps[key] = {
...props[key],
default: getPropsDefault(props[key].type, true)
};
} else {
newProps[key] = {
...typeof props[key] === "object" ? props[key] : {},
type: sortPropsType(curType)
};
}
});
return {
newProps,
emits
};
}
const getEmitsByControlledProps = (controlledProps) => Object.values(controlledProps).map((item) => `update:${item.key}`);
const uniComponent = function(info) {
const { newProps, emits } = filterProps(info.props || {}, info.controlledProps || {});
info.props = {
...getExternalClasses(info),
...newProps,
...COMMON_PROPS
};
info.emits = Array.from(/* @__PURE__ */ new Set([
...info.emits || [],
...getEmitsByControlledProps(info.controlledProps || {}),
...emits
]));
info.options = {
...info.options || {},
multipleSlots: true
};
if (uni_modules_tdesignUniapp_components_common_version.canUseVirtualHost() && info.options.virtualHost == null) {
info.options.virtualHost = true;
}
if (!info.options.styleIsolation) {
info.options.styleIsolation = "shared";
}
if (info.name) {
info.name = uni_modules_tdesignUniapp_components_common_utils.toPascal(info.name);
}
const obj = toComponent(info);
return obj;
};
function getExternalClasses(info) {
if (!info.externalClasses) {
return {};
}
const { externalClasses } = info;
const list = Array.isArray(externalClasses) ? externalClasses : [externalClasses];
return list.reduce((acc, item) => ({
...acc,
[uni_modules_tdesignUniapp_components_common_utils.toCamel(item)]: {
type: String,
default: ""
}
}), {});
}
exports.uniComponent = uniComponent;
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/src/instantiationDecorator.js.map

View File

@@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/src/superComponent.js.map

View File

@@ -0,0 +1,188 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const uni_modules_tdesignUniapp_components_common_config = require("./config.js");
const uni_modules_tdesignUniapp_components_common_validator = require("./validator.js");
const uni_modules_tdesignUniapp_components_common_wechat = require("./wechat.js");
const systemInfo = uni_modules_tdesignUniapp_components_common_wechat.getWindowInfo();
const appBaseInfo = uni_modules_tdesignUniapp_components_common_wechat.getAppBaseInfo();
const deviceInfo = uni_modules_tdesignUniapp_components_common_wechat.getDeviceInfo();
function coalesce(...args) {
for (let i = 0; i < args.length; i += 1) {
if (args[i] !== null && args[i] !== void 0) {
return args[i];
}
}
return args[args.length - 1];
}
const classNames = function(...args) {
const hasOwn = {}.hasOwnProperty;
const classes = [];
args.forEach((arg) => {
if (!arg)
return;
const argType = typeof arg;
if (argType === "string" || argType === "number") {
classes.push(arg);
} else if (Array.isArray(arg) && arg.length) {
const inner = classNames(...arg);
if (inner) {
classes.push(inner);
}
} else if (argType === "object") {
for (const key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(key);
}
}
}
});
return classes.join(" ");
};
const styles = function(styleObj) {
return Object.keys(styleObj).map((styleKey) => `${styleKey}: ${styleObj[styleKey]}`).join("; ");
};
const getRect = function(context, selector, needAll = false, useH5Origin = false) {
return new Promise((resolve, reject) => {
common_vendor.index.createSelectorQuery().in(context)[needAll ? "selectAll" : "select"](selector).boundingClientRect((rect) => {
if (rect) {
resolve(rect);
} else {
reject(rect);
}
}).exec();
});
};
(deviceInfo == null ? void 0 : deviceInfo.environment) === "wxwork";
["mac", "windows"].includes(deviceInfo == null ? void 0 : deviceInfo.platform);
const addUnit = function(value) {
if (!uni_modules_tdesignUniapp_components_common_validator.isDef(value)) {
return void 0;
}
value = String(value);
return uni_modules_tdesignUniapp_components_common_validator.isNumeric(value) ? `${value}px` : value;
};
const getCharacterLength = (type, char, max) => {
const str = String(coalesce(char, ""));
if (str.length === 0) {
return {
length: 0,
characters: ""
};
}
if (type === "maxcharacter") {
let len = 0;
for (let i = 0; i < str.length; i += 1) {
let currentStringLength = 0;
if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
currentStringLength = 2;
} else {
currentStringLength = 1;
}
if (len + currentStringLength > max) {
return {
length: len,
characters: str.slice(0, i)
};
}
len += currentStringLength;
}
return {
length: len,
characters: str
};
}
if (type === "maxlength") {
const length = str.length > max ? max : str.length;
return {
length,
characters: str.slice(0, length)
};
}
return {
length: str.length,
characters: str
};
};
const unitConvert = (value) => {
if (typeof value === "string") {
if (value.includes("rpx")) {
return parseInt(value, 10) * coalesce(systemInfo == null ? void 0 : systemInfo.screenWidth, 750) / 750;
}
return parseInt(value, 10);
}
return coalesce(value, 0);
};
const setIcon = (iconName, icon, defaultIcon) => {
if (icon) {
if (typeof icon === "string") {
return {
[`${iconName}Name`]: icon,
[`${iconName}Data`]: {}
};
}
if (typeof icon === "object") {
return {
[`${iconName}Name`]: "",
[`${iconName}Data`]: icon
};
}
return {
[`${iconName}Name`]: defaultIcon,
[`${iconName}Data`]: {}
};
}
return {
[`${iconName}Name`]: "",
[`${iconName}Data`]: {}
};
};
const toCamel = (str) => str.replace(/-(\w)/g, (match, m1) => m1.toUpperCase());
const toPascal = (name) => name.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
function hyphenate(str) {
const hyphenateRE = /\B([A-Z])/g;
return str.replace(hyphenateRE, "-$1").toLowerCase();
}
const getCurrentPage = function() {
const pages = getCurrentPages();
return pages[pages.length - 1];
};
const uniqueFactory = (compName) => {
let number = 0;
return () => {
const uniqueId = `${uni_modules_tdesignUniapp_components_common_config.prefix}_${compName}_${number}`;
number += 1;
return uniqueId;
};
};
const calcIcon = (icon, defaultIcon) => {
if (icon && (uni_modules_tdesignUniapp_components_common_validator.isBoolean(icon) && defaultIcon || uni_modules_tdesignUniapp_components_common_validator.isString(icon))) {
return { name: uni_modules_tdesignUniapp_components_common_validator.isBoolean(icon) ? defaultIcon : icon };
}
if (uni_modules_tdesignUniapp_components_common_validator.isObject(icon)) {
return icon;
}
return null;
};
const nextTick = () => new Promise((resolve) => {
setTimeout(() => {
resolve();
}, 33);
});
exports.addUnit = addUnit;
exports.appBaseInfo = appBaseInfo;
exports.calcIcon = calcIcon;
exports.classNames = classNames;
exports.coalesce = coalesce;
exports.getCharacterLength = getCharacterLength;
exports.getCurrentPage = getCurrentPage;
exports.getRect = getRect;
exports.hyphenate = hyphenate;
exports.nextTick = nextTick;
exports.setIcon = setIcon;
exports.styles = styles;
exports.systemInfo = systemInfo;
exports.toCamel = toCamel;
exports.toPascal = toPascal;
exports.uniqueFactory = uniqueFactory;
exports.unitConvert = unitConvert;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/utils.js.map

View File

@@ -0,0 +1,106 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_runtime_wxsPolyfill = require("./runtime/wxs-polyfill.js");
function addUnit(value) {
const REGEXP = uni_modules_tdesignUniapp_components_common_runtime_wxsPolyfill.getRegExp("^-?\\d+(.\\d+)?$");
if (value == null) {
return void 0;
}
return REGEXP.test(`${value}`) ? `${value}px` : value;
}
function isString(string) {
return typeof string === "string";
}
function isArray(array) {
return Array.isArray(array);
}
function isObject(x) {
const type = typeof x;
return x !== null && (type === "object" || type === "function");
}
function isBoolean(value) {
return typeof value === "boolean";
}
const isNoEmptyObj = function(obj) {
return isObject(obj) && JSON.stringify(obj) !== "{}";
};
function includes(arr, value) {
if (!arr || !isArray(arr))
return false;
let i = 0;
const len = arr.length;
for (; i < len; i++) {
if (arr[i] === value)
return true;
}
return false;
}
function cls(base, arr) {
const res = [base];
let i = 0;
for (let size = arr.length; i < size; i++) {
const item = arr[i];
if (item && Array.isArray(item)) {
const key = arr[i][0];
const value = arr[i][1];
if (value) {
res.push(`${base}--${key}`);
}
} else if (typeof item === "string" || typeof item === "number") {
if (item) {
res.push(`${base}--${item}`);
}
}
}
return res.join(" ");
}
function getBadgeAriaLabel(options) {
const maxCount = options.maxCount || 99;
if (options.dot) {
return "有新的消息";
}
if (options.count === "...") {
return "有很多消息";
}
if (isNaN(options.count)) {
return options.count;
}
const str1 = `${maxCount}+条消息`;
const str2 = `${options.count}条消息`;
return Number(options.count) > maxCount ? str1 : str2;
}
function endsWith(str, endStr) {
return str.slice(-endStr.length) === endStr ? str : str + endStr;
}
function keys(obj) {
return JSON.stringify(obj).replace(uni_modules_tdesignUniapp_components_common_runtime_wxsPolyfill.getRegExp('{|}|"', "g"), "").split(",").map((item) => item.split(":")[0]);
}
function kebabCase(str) {
return str.replace(uni_modules_tdesignUniapp_components_common_runtime_wxsPolyfill.getRegExp("[A-Z]", "g"), (ele) => `-${ele}`).toLowerCase();
}
function _style(styles) {
if (isArray(styles)) {
return styles.filter((item) => item != null && item !== "").map((item) => isArray(item) || isObject(item) ? _style(item) : endsWith(item, ";")).join(" ");
}
if (isObject(styles)) {
return keys(styles).filter((key) => styles[key] != null && styles[key] !== "").map((key) => [kebabCase(key), [styles[key]]].join(":")).join(";");
}
return styles;
}
function isValidIconName(str) {
return uni_modules_tdesignUniapp_components_common_runtime_wxsPolyfill.getRegExp("^[A-Za-z0-9-_]+$").test(str);
}
const tools = {
addUnit,
isString,
isArray,
isObject,
isBoolean,
isNoEmptyObj,
includes,
cls,
getBadgeAriaLabel,
_style,
isValidIconName
};
exports.tools = tools;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/utils.wxs.js.map

View File

@@ -0,0 +1,27 @@
"use strict";
const isString = (val) => typeof val === "string";
const isNull = (value) => value === null;
const isUndefined = (value) => value === void 0;
function isDef(value) {
return !isUndefined(value) && !isNull(value);
}
function isNumeric(value) {
return !Number.isNaN(Number(value));
}
function isBoolean(value) {
return typeof value === "boolean";
}
function isObject(x) {
const type = typeof x;
return x !== null && (type === "object" || type === "function");
}
function isPlainObject(val) {
return val !== null && typeof val === "object" && Object.prototype.toString.call(val) === "[object Object]";
}
exports.isBoolean = isBoolean;
exports.isDef = isDef;
exports.isNumeric = isNumeric;
exports.isObject = isObject;
exports.isPlainObject = isPlainObject;
exports.isString = isString;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/validator.js.map

View File

@@ -0,0 +1,43 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_wechat = require("./wechat.js");
let systemInfo;
function getSystemInfo() {
if (systemInfo == null) {
systemInfo = uni_modules_tdesignUniapp_components_common_wechat.getAppBaseInfo();
}
return systemInfo;
}
function compareVersion(v1, v2) {
v1 = v1.split(".");
v2 = v2.split(".");
const len = Math.max(v1.length, v2.length);
while (v1.length < len) {
v1.push("0");
}
while (v2.length < len) {
v2.push("0");
}
for (let i = 0; i < len; i += 1) {
const num1 = parseInt(v1[i], 10);
const num2 = parseInt(v2[i], 10);
if (num1 > num2) {
return 1;
}
if (num1 < num2) {
return -1;
}
}
return 0;
}
function judgeByVersion(version) {
const currentSDKVersion = getSystemInfo().SDKVersion;
return compareVersion(currentSDKVersion, version) >= 0;
}
function canUseVirtualHost() {
let result = false;
result = judgeByVersion("2.19.2");
return result;
}
exports.canUseVirtualHost = canUseVirtualHost;
exports.compareVersion = compareVersion;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/version.js.map

View File

@@ -0,0 +1,17 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const getObserver = (context, selector) => new Promise((resolve) => {
common_vendor.index.createIntersectionObserver(context, {
nativeMode: true
}).relativeToViewport().observe(selector, (res) => {
resolve(res);
});
});
const getWindowInfo = () => common_vendor.index.getWindowInfo ? common_vendor.index.getWindowInfo() || common_vendor.index.getSystemInfoSync() : common_vendor.index.getSystemInfoSync();
const getAppBaseInfo = () => common_vendor.index.getAppBaseInfo ? common_vendor.index.getAppBaseInfo() || common_vendor.index.getSystemInfoSync() : common_vendor.index.getSystemInfoSync();
const getDeviceInfo = () => common_vendor.index.getDeviceInfo ? common_vendor.index.getDeviceInfo() || common_vendor.index.getSystemInfoSync() : common_vendor.index.getSystemInfoSync();
exports.getAppBaseInfo = getAppBaseInfo;
exports.getDeviceInfo = getDeviceInfo;
exports.getObserver = getObserver;
exports.getWindowInfo = getWindowInfo;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/common/wechat.js.map

View File

@@ -0,0 +1,11 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_utils = require("../common/utils.js");
const getActionClass = function(prefix, buttonLayout, actionItem, tClassAction) {
const cls = [`${prefix}__button`, `${prefix}__button--action`];
if (buttonLayout) {
cls.push(`${prefix}__button--${buttonLayout}`);
}
return `${cls.join(" ")} ${uni_modules_tdesignUniapp_components_common_utils.coalesce(actionItem.tClass, tClassAction)}`;
};
exports.getActionClass = getActionClass;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/dialog/computed.js.map

View File

@@ -0,0 +1,459 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_validator = require("../common/validator.js");
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
const uni_modules_tdesignUniapp_components_dialog_props = require("./props.js");
const uni_modules_tdesignUniapp_components_common_utils = require("../common/utils.js");
const uni_modules_tdesignUniapp_components_mixins_usingCustomNavbar = require("../mixins/using-custom-navbar.js");
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
const uni_modules_tdesignUniapp_components_dialog_computed = require("./computed.js");
const uni_modules_tdesignUniapp_components_common_functional_mixin = require("../common/functional/mixin.js");
const uni_modules_tdesignUniapp_components_common_version = require("../common/version.js");
const common_vendor = require("../../../../common/vendor.js");
const TPopup = () => "../popup/popup.js";
const TIcon = () => "../icon/icon.js";
const TButton = () => "../button/button.js";
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-dialog`;
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
name,
options: {
styleIsolation: "shared"
},
externalClasses: [
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-content`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-confirm`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-cancel`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-action`
],
mixins: [uni_modules_tdesignUniapp_components_common_functional_mixin.getFunctionalMixin(uni_modules_tdesignUniapp_components_dialog_props.props), uni_modules_tdesignUniapp_components_mixins_usingCustomNavbar.useCustomNavbarBehavior],
components: {
TPopup,
TIcon,
TButton
},
props: {
...uni_modules_tdesignUniapp_components_dialog_props.props
},
data() {
return {
prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
classPrefix: name,
buttonVariant: "text",
tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools,
_confirm: null,
_cancel: null,
useVirtualHost: uni_modules_tdesignUniapp_components_common_version.canUseVirtualHost()
};
},
watch: {
dataConfirmBtn: {
handler() {
this.onWatchBtn(this.dataConfirmBtn, this.dataCancelBtn);
},
immediate: true
},
dataCancelBtn: {
handler() {
this.onWatchBtn(this.dataConfirmBtn, this.dataCancelBtn);
},
immediate: true
}
},
methods: {
coalesce: uni_modules_tdesignUniapp_components_common_utils.coalesce,
getActionClass: uni_modules_tdesignUniapp_components_dialog_computed.getActionClass,
onWatchBtn(confirm, cancel) {
const { prefix, classPrefix, dataButtonLayout } = this;
const rect = { buttonVariant: "text" };
const useBaseVariant = [confirm, cancel].some((item) => uni_modules_tdesignUniapp_components_common_validator.isObject(item) && item.variant && item.variant !== "text");
const buttonMap = { confirm, cancel };
const cls = [`${classPrefix}__button`];
const externalCls = [];
if (useBaseVariant) {
rect.buttonVariant = "base";
cls.push(`${classPrefix}__button--${dataButtonLayout}`);
} else {
cls.push(`${classPrefix}__button--text`);
externalCls.push(`${classPrefix}-button`);
}
const useVirtualHost = uni_modules_tdesignUniapp_components_common_version.canUseVirtualHost();
Object.keys(buttonMap).forEach((key) => {
const btn = buttonMap[key];
const rootClass = [...cls, `${classPrefix}__button--${key}`];
const tClass = [...externalCls, this[uni_modules_tdesignUniapp_components_common_utils.toCamel(`${prefix}-class-${key}`)], ...rootClass].join(" ");
const base = {
block: true,
rootClass,
tClass: useVirtualHost ? tClass : "",
class: !useVirtualHost ? tClass : "",
variant: rect.buttonVariant,
openType: ""
};
if (key === "cancel" && rect.buttonVariant === "base") {
base.theme = "light";
}
if (typeof btn === "string") {
rect[`_${key}`] = { ...base, content: btn };
} else if (btn && typeof btn === "object") {
rect[`_${key}`] = { ...base, ...btn };
} else {
rect[`_${key}`] = null;
}
});
Object.keys(rect).forEach((key) => {
this[key] = rect[key];
});
},
onTplButtonTap(e, { type, extra }) {
var _a, _b, _c;
const evtType = e.type;
const button = this[`_${type}`];
const cbName = `bind${evtType}`;
if (type === "action") {
this.onActionTap(extra);
return;
}
if (typeof (button == null ? void 0 : button[cbName]) === "function") {
const closeFlag = button[cbName](e);
if (closeFlag) {
this.close();
}
}
const hasOpenType = !!(button == null ? void 0 : button.openType);
if (!hasOpenType && ["confirm", "cancel"].includes(type)) {
(_a = this[uni_modules_tdesignUniapp_components_common_utils.toCamel(`on-${type}`)]) == null ? void 0 : _a.call(this, type);
}
if (evtType !== "click") {
const success = ((_c = (_b = e.detail) == null ? void 0 : _b.errMsg) == null ? void 0 : _c.indexOf("ok")) > -1;
this.$emit(success ? "open-type-event" : "open-type-error-event", e.detail);
}
},
onConfirm(e) {
this.$emit("confirm", { e });
if (this._onConfirm) {
this._onConfirm({ trigger: "confirm" });
this.close();
}
},
onCancel(e) {
const trigger = { trigger: "cancel" };
this.$emit("cancel", { e });
this.$emit("close", trigger);
if (this._onCancel) {
this._onCancel(trigger);
this.close();
}
},
onClose() {
var _a;
const trigger = { trigger: "close-btn" };
this.$emit("close", trigger);
(_a = this._onCancel) == null ? void 0 : _a.call(this, trigger);
this.close();
},
close() {
this.dataVisible = false;
},
overlayClick(e) {
var _a;
this.$emit("overlay-click", { e });
if (this.dataCloseOnOverlayClick) {
const trigger = { trigger: "overlay" };
this.$emit("close", trigger);
(_a = this._onCancel) == null ? void 0 : _a.call(this, trigger);
this.close();
}
},
onActionTap(index) {
this.$emit("action", { index });
if (this._onAction) {
this._onAction({ index });
this.close();
}
}
}
});
if (!Array) {
const _easycom_t_icon2 = common_vendor.resolveComponent("t-icon");
const _easycom_t_button2 = common_vendor.resolveComponent("t-button");
const _easycom_t_popup2 = common_vendor.resolveComponent("t-popup");
(_easycom_t_icon2 + _easycom_t_button2 + _easycom_t_popup2)();
}
const _easycom_t_icon = () => "../icon/icon.js";
const _easycom_t_button = () => "../button/button.js";
const _easycom_t_popup = () => "../popup/popup.js";
if (!Math) {
(_easycom_t_icon + _easycom_t_button + _easycom_t_popup)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.dataCloseBtn
}, _ctx.dataCloseBtn ? common_vendor.e({
b: _ctx.tools.isObject(_ctx.dataCloseBtn)
}, _ctx.tools.isObject(_ctx.dataCloseBtn) ? {
c: common_vendor.p({
["custom-style"]: _ctx.dataCloseBtn.style || "",
prefix: _ctx.dataCloseBtn.prefix,
name: _ctx.dataCloseBtn.name || "close",
size: _ctx.dataCloseBtn.size || 22,
color: _ctx.dataCloseBtn.color,
["aria-hidden"]: true,
["aria-label"]: _ctx.dataCloseBtn.ariaLabel,
["aria-role"]: _ctx.dataCloseBtn.ariaRole
})
} : {
d: common_vendor.p({
name: "close",
size: "44rpx"
})
}, {
e: common_vendor.n(_ctx.classPrefix + "__close-btn"),
f: common_vendor.o((...args) => _ctx.onClose && _ctx.onClose(...args))
}) : {}, {
g: _ctx.dataTitle
}, _ctx.dataTitle ? {
h: common_vendor.t(_ctx.dataTitle),
i: common_vendor.n(_ctx.classPrefix + "__header")
} : {}, {
j: _ctx.dataContent
}, _ctx.dataContent ? {
k: common_vendor.t(_ctx.dataContent),
l: common_vendor.n(_ctx.classPrefix + "__body-text"),
m: common_vendor.n(_ctx.classPrefix + "__body")
} : {}, {
n: common_vendor.n(_ctx.classPrefix + "__content " + _ctx.tClassContent),
o: _ctx.dataActions
}, _ctx.dataActions ? {
p: common_vendor.f(_ctx.dataActions, (actionItem, index, i0) => {
return common_vendor.e({
a: actionItem.useDefaultSlot || false
}, actionItem.useDefaultSlot || false ? {} : {}, {
b: index,
c: common_vendor.n(!_ctx.useVirtualHost ? _ctx.getActionClass(_ctx.classPrefix, _ctx.dataButtonLayout, actionItem, _ctx.tClassAction) : ""),
d: _ctx.coalesce(actionItem.index, index),
e: common_vendor.o(($event) => _ctx.onTplButtonTap($event, {
type: "action",
extra: index
}), index),
f: common_vendor.o(($event) => _ctx.onTplButtonTap($event, {
type: "action",
extra: index
}), index),
g: common_vendor.o(($event) => _ctx.onTplButtonTap($event, {
type: "action",
extra: index
}), index),
h: common_vendor.o(($event) => _ctx.onTplButtonTap($event, {
type: "action",
extra: index
}), index),
i: common_vendor.o(($event) => _ctx.onTplButtonTap($event, {
type: "action",
extra: index
}), index),
j: common_vendor.o(($event) => _ctx.onTplButtonTap($event, {
type: "action",
extra: index
}), index),
k: common_vendor.o(($event) => _ctx.onTplButtonTap($event, {
type: "action",
extra: index
}), index),
l: common_vendor.o(($event) => _ctx.onTplButtonTap($event, {
type: "action",
extra: index
}), index),
m: "8dd4352e-3-" + i0 + ",8dd4352e-0",
n: common_vendor.p({
["t-id"]: actionItem.tId,
["custom-style"]: actionItem.style,
block: _ctx.coalesce(actionItem.block, true),
["t-class"]: _ctx.useVirtualHost ? _ctx.getActionClass(_ctx.classPrefix, _ctx.dataButtonLayout, actionItem, _ctx.tClassAction) : "",
disabled: actionItem.disabled,
["custom-dataset"]: actionItem.customDataset,
content: actionItem.content,
icon: actionItem.icon,
loading: actionItem.loading,
["loading-props"]: actionItem.loadingProps,
theme: actionItem.theme,
ghost: actionItem.ghost,
shape: actionItem.shape,
size: actionItem.size,
variant: actionItem.variant,
["open-type"]: actionItem.openType,
["hover-class"]: actionItem.hoverClass,
["hover-stop-propagation"]: actionItem.hoverStopPropagation,
["hover-start-time"]: actionItem.hoverStartTime,
["hover-stay-time"]: actionItem.hoverStayTime,
lang: actionItem.lang,
["session-from"]: actionItem.sessionFrom,
["send-message-title"]: actionItem.sendMessageTitle,
["send-message-path"]: actionItem.sendMessagePath,
["send-message-img"]: actionItem.sendMessageImg,
["app-parameter"]: actionItem.appParameter,
["show-message-card"]: actionItem.showMessageCard,
["aria-label"]: actionItem.ariaLabel
})
});
})
} : {}, {
q: _ctx._cancel
}, _ctx._cancel ? common_vendor.e({
r: _ctx._cancel.useDefaultSlot || false
}, _ctx._cancel.useDefaultSlot || false ? {} : {}, {
s: common_vendor.n(_ctx._cancel.class),
t: _ctx._cancel.index,
v: common_vendor.o(($event) => _ctx.onCancel($event, {
type: "action",
extra: 0
})),
w: common_vendor.o(($event) => _ctx.onCancel($event, {
type: "action",
extra: 0
})),
x: common_vendor.o(($event) => _ctx.onCancel($event, {
type: "action",
extra: 0
})),
y: common_vendor.o(($event) => _ctx.onCancel($event, {
type: "action",
extra: 0
})),
z: common_vendor.o(($event) => _ctx.onCancel($event, {
type: "action",
extra: 0
})),
A: common_vendor.o(($event) => _ctx.onCancel($event, {
type: "action",
extra: 0
})),
B: common_vendor.o(($event) => _ctx.onCancel($event, {
type: "action",
extra: 0
})),
C: common_vendor.o(($event) => _ctx.onCancel($event, {
type: "action",
extra: 0
})),
D: common_vendor.p({
["t-id"]: _ctx._cancel.tId,
["custom-style"]: _ctx._cancel.style,
block: _ctx._cancel.block,
["t-class"]: _ctx._cancel.tClass,
disabled: _ctx._cancel.disabled,
["custom-dataset"]: _ctx._cancel.customDataset,
content: _ctx._cancel.content,
icon: _ctx._cancel.icon,
loading: _ctx._cancel.loading,
["loading-props"]: _ctx._cancel.loadingProps,
theme: _ctx._cancel.theme,
ghost: _ctx._cancel.ghost,
shape: _ctx._cancel.shape,
size: _ctx._cancel.size,
variant: _ctx._cancel.variant,
["open-type"]: _ctx._cancel.openType,
["hover-class"]: _ctx._cancel.hoverClass,
["hover-stop-propagation"]: _ctx._cancel.hoverStopPropagation,
["hover-start-time"]: _ctx._cancel.hoverStartTime,
["hover-stay-time"]: _ctx._cancel.hoverStayTime,
lang: _ctx._cancel.lang,
["session-from"]: _ctx._cancel.sessionFrom,
["send-message-title"]: _ctx._cancel.sendMessageTitle,
["send-message-path"]: _ctx._cancel.sendMessagePath,
["send-message-img"]: _ctx._cancel.sendMessageImg,
["app-parameter"]: _ctx._cancel.appParameter,
["show-message-card"]: _ctx._cancel.showMessageCard,
["aria-label"]: _ctx._cancel.ariaLabel
})
}) : {}, {
E: _ctx._confirm
}, _ctx._confirm ? common_vendor.e({
F: _ctx._confirm.useDefaultSlot || false
}, _ctx._confirm.useDefaultSlot || false ? {} : {}, {
G: common_vendor.n(_ctx._confirm.class),
H: _ctx._confirm.index,
I: common_vendor.o(($event) => _ctx.onConfirm($event, {
type: "action",
extra: 0
})),
J: common_vendor.o(($event) => _ctx.onConfirm($event, {
type: "action",
extra: 0
})),
K: common_vendor.o(($event) => _ctx.onConfirm($event, {
type: "action",
extra: 0
})),
L: common_vendor.o(($event) => _ctx.onConfirm($event, {
type: "action",
extra: 0
})),
M: common_vendor.o(($event) => _ctx.onTplButtonConfirmonTap($event, {
type: "action",
extra: 0
})),
N: common_vendor.o(($event) => _ctx.onConfirm($event, {
type: "action",
extra: 0
})),
O: common_vendor.o(($event) => _ctx.onConfirm($event, {
type: "action",
extra: 0
})),
P: common_vendor.o(($event) => _ctx.onConfirm($event, {
type: "action",
extra: 0
})),
Q: common_vendor.p({
["t-id"]: _ctx._confirm.tId,
["custom-style"]: _ctx._confirm.style,
block: _ctx._confirm.block,
["t-class"]: _ctx._confirm.tClass,
disabled: _ctx._confirm.disabled,
["custom-dataset"]: _ctx._confirm.customDataset,
content: _ctx._confirm.content,
icon: _ctx._confirm.icon,
loading: _ctx._confirm.loading,
["loading-props"]: _ctx._confirm.loadingProps,
theme: _ctx._confirm.theme || "primary",
ghost: _ctx._confirm.ghost,
shape: _ctx._confirm.shape,
size: _ctx._confirm.size,
variant: _ctx._confirm.variant,
["open-type"]: _ctx._confirm.openType,
["hover-class"]: _ctx._confirm.hoverClass,
["hover-stop-propagation"]: _ctx._confirm.hoverStopPropagation,
["hover-start-time"]: _ctx._confirm.hoverStartTime,
["hover-stay-time"]: _ctx._confirm.hoverStayTime,
lang: _ctx._confirm.lang,
["session-from"]: _ctx._confirm.sessionFrom,
["send-message-title"]: _ctx._confirm.sendMessageTitle,
["send-message-path"]: _ctx._confirm.sendMessagePath,
["send-message-img"]: _ctx._confirm.sendMessageImg,
["app-parameter"]: _ctx._confirm.appParameter,
["show-message-card"]: _ctx._confirm.showMessageCard,
["aria-label"]: _ctx._confirm.ariaLabel
})
}) : {}, {
R: common_vendor.n(_ctx.tools.cls(_ctx.classPrefix + "__footer", [["column", _ctx.dataButtonLayout === "vertical"], ["full", _ctx.buttonVariant == "text" && (!_ctx.dataActions || _ctx.dataActions.length == 0)]])),
S: common_vendor.n(_ctx.classPrefix + " " + _ctx.tClass),
T: common_vendor.o(_ctx.overlayClick),
U: common_vendor.p({
name: "dialog",
["custom-style"]: _ctx.tools._style([_ctx.customStyle]),
["t-class"]: _ctx.classPrefix + "__wrapper",
visible: _ctx.dataVisible,
["show-overlay"]: _ctx.dataShowOverlay,
["close-on-overlay-click"]: _ctx.dataCloseOnOverlayClick,
["prevent-scroll-through"]: _ctx.dataPreventScrollThrough,
["overlay-props"]: _ctx.dataOverlayProps,
["z-index"]: _ctx.dataZIndex,
placement: "center",
["using-custom-navbar"]: _ctx.dataUsingCustomNavbar
})
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-8dd4352e"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/dialog/dialog.js.map

View File

@@ -0,0 +1,8 @@
{
"component": true,
"usingComponents": {
"t-popup": "../popup/popup",
"t-icon": "../icon/icon",
"t-button": "../button/button"
}
}

View File

@@ -0,0 +1 @@
<t-popup wx:if="{{U}}" class="data-v-8dd4352e" u-s="{{['content']}}" bindvisibleChange="{{T}}" u-i="8dd4352e-0" bind:__l="__l" u-p="{{U}}"><view class="{{['data-v-8dd4352e', S]}}" slot="content"><slot name="top"/><view wx:if="{{a}}" class="{{['data-v-8dd4352e', e]}}" bindtap="{{f}}"><block wx:if="{{b}}"><t-icon wx:if="{{c}}" class="data-v-8dd4352e" u-i="8dd4352e-1,8dd4352e-0" bind:__l="__l" u-p="{{c}}"/></block><t-icon wx:else class="data-v-8dd4352e" u-i="8dd4352e-2,8dd4352e-0" bind:__l="__l" u-p="{{d||''}}"/></view><view class="{{['data-v-8dd4352e', n]}}"><view wx:if="{{g}}" class="{{['data-v-8dd4352e', i]}}">{{h}}</view><slot name="title"/><view wx:if="{{j}}" class="{{['data-v-8dd4352e', m]}}"><text class="{{['data-v-8dd4352e', l]}}">{{k}}</text></view><slot name="content"/></view><slot name="middle"/><view class="{{['data-v-8dd4352e', R]}}"><block wx:if="{{o}}"><t-button wx:for="{{p}}" wx:for-item="actionItem" wx:key="b" u-s="{{['d']}}" class="{{['data-v-8dd4352e', actionItem.c]}}" data-type="{{'action'}}" data-extra="{{actionItem.d}}" bindclick="{{actionItem.e}}" bindgetuserinfo="{{actionItem.f}}" bindcontact="{{actionItem.g}}" bindgetphonenumber="{{actionItem.h}}" binderror="{{actionItem.i}}" bindopensetting="{{actionItem.j}}" bindlaunchapp="{{actionItem.k}}" bindagreeprivacyauthorization="{{actionItem.l}}" u-i="{{actionItem.m}}" bind:__l="__l" u-p="{{actionItem.n}}"><slot wx:if="{{actionItem.a}}"/></t-button></block><slot name="actions"/><block wx:if="{{q}}"><t-button wx:if="{{D}}" u-s="{{['d']}}" class="{{['data-v-8dd4352e', s]}}" data-type="{{'cancel'}}" data-extra="{{t}}" bindclick="{{v}}" bindgetuserinfo="{{w}}" bindcontact="{{x}}" bindgetphonenumber="{{y}}" binderror="{{z}}" bindopensetting="{{A}}" bindlaunchapp="{{B}}" bindagreeprivacyauthorization="{{C}}" u-i="8dd4352e-4,8dd4352e-0" bind:__l="__l" u-p="{{D}}"><slot wx:if="{{r}}"/></t-button></block><slot name="cancel-btn"/><block wx:if="{{E}}"><t-button wx:if="{{Q}}" u-s="{{['d']}}" class="{{['data-v-8dd4352e', G]}}" data-type="{{'confirm'}}" data-extra="{{H}}" bindclick="{{I}}" bindgetuserinfo="{{J}}" bindcontact="{{K}}" bindgetphonenumber="{{L}}" binderror="{{M}}" bindopensetting="{{N}}" bindlaunchapp="{{O}}" bindagreeprivacyauthorization="{{P}}" u-i="8dd4352e-5,8dd4352e-0" bind:__l="__l" u-p="{{Q}}"><slot wx:if="{{F}}"/></t-button></block><slot name="confirm-btn"/></view></view></t-popup>

View File

@@ -0,0 +1,102 @@
.t-dialog.data-v-8dd4352e {
overflow: hidden;
width: var(--td-dialog-width, 622rpx);
border-radius: var(--td-dialog-border-radius, var(--td-radius-extraLarge, 24rpx));
background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
}
.t-dialog__wrapper.data-v-8dd4352e {
--td-popup-border-radius: var(--td-dialog-border-radius, var(--td-radius-extraLarge, 24rpx));
}
.t-dialog__close-btn.data-v-8dd4352e {
position: absolute;
top: var(--td-spacer, 16rpx);
right: var(--td-spacer, 16rpx);
color: var(--td-dialog-close-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
z-index: 1;
/* skyline适配新增 */
}
.t-dialog__content.data-v-8dd4352e {
padding-top: var(--td-spacer-3, 48rpx);
padding-right: var(--td-spacer-3, 48rpx);
padding-bottom: 0;
padding-left: var(--td-spacer-3, 48rpx);
max-height: var(--td-dialog-body-max-height, 912rpx);
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: center;
font-size: var(--td-font-size-m, 32rpx);
}
.t-dialog__content.data-v-8dd4352e:empty {
display: none;
}
.t-dialog__header.data-v-8dd4352e {
text-align: center;
font: var(--td-dialog-title-font, var(--td-font-title-large, 600 36rpx / 52rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular)));
color: var(--td-dialog-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
}
.t-dialog__header + .t-dialog__body.data-v-8dd4352e {
margin-top: var(--td-spacer, 16rpx);
}
.t-dialog__body.data-v-8dd4352e {
overflow-y: scroll;
text-align: center;
-webkit-overflow-scrolling: touch;
font: var(--td-dialog-content-font, var(--td-font-body-large, 32rpx / 48rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular)));
color: var(--td-dialog-content-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
}
.t-dialog__body-text.data-v-8dd4352e {
word-wrap: break-word;
}
.t-dialog__body--left.data-v-8dd4352e {
text-align: left;
}
.t-dialog__body--right.data-v-8dd4352e {
text-align: right;
}
.t-dialog__footer.data-v-8dd4352e {
display: flex;
padding: var(--td-spacer-3, 48rpx);
}
.t-dialog__footer--column.data-v-8dd4352e {
flex-flow: column-reverse;
}
.t-dialog__footer--column.data-v-8dd4352e .t-dialog__button {
width: 100%;
}
.t-dialog__footer--full.data-v-8dd4352e {
padding: var(--td-spacer-4, 64rpx) 0 0;
}
.data-v-8dd4352e .t-dialog__button {
position: relative;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.data-v-8dd4352e .t-dialog__button--horizontal:not(:first-child) {
margin-left: var(--td-spacer-1, 24rpx);
}
.data-v-8dd4352e .t-dialog__button--vertical:not(:first-child) {
margin-bottom: var(--td-spacer-1, 24rpx);
}
.data-v-8dd4352e .t-dialog__button--text {
flex: 1;
--td-button-border-radius: 0;
--td-button-medium-height: 112rpx;
border-radius: 0;
}
.data-v-8dd4352e .t-dialog__button--text:before {
content: ' ';
position: absolute;
box-sizing: border-box;
top: 0;
left: 0;
border-top: 1px solid var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7));
border-left: 1px solid var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7));
transform: scale(0.5);
transform-origin: 0 0;
width: 200%;
height: 200%;
border-radius: 0;
}

View File

@@ -0,0 +1,91 @@
"use strict";
const props = {
/** 操作栏 */
actions: {
type: Array
},
/** 多按钮排列方式 */
buttonLayout: {
type: String,
default: "horizontal",
validator(val) {
if (!val)
return true;
return ["horizontal", "vertical"].includes(val);
}
},
/** 取消按钮,可自定义。值为 null 则不显示取消按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 Slot 自定义按钮时,需自行控制取消事件 */
cancelBtn: {
type: [String, Object]
},
/** 是否展示关闭按钮,值为 `true` 显示默认关闭按钮;值为 `false` 则不显示关闭按钮;使用 Object 时透传至图标组件 */
closeBtn: {
type: [Boolean, Object],
default: false
},
/** 点击蒙层时是否触发关闭事件 */
closeOnOverlayClick: Boolean,
/** 确认按钮。值为 null 则不显示确认按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 Slot 自定义按钮时,需自行控制确认事件 */
confirmBtn: {
type: [String, Object]
},
/** 内容 */
content: {
type: String
},
/** 透传至 Overlay 组件 */
overlayProps: {
type: Object,
default: () => ({})
},
/** 防止滚动穿透 */
preventScrollThrough: {
type: Boolean,
default: true
},
/** 是否显示遮罩层 */
showOverlay: {
type: Boolean,
default: true
},
/** 标题 */
title: {
type: String
},
/** 是否使用了自定义导航栏 */
usingCustomNavbar: Boolean,
/** 控制对话框是否显示 */
visible: Boolean,
/** 对话框层级Web 侧样式默认为 2500移动端样式默认 2500小程序样式默认为 11500 */
zIndex: {
type: Number,
default: 11500
},
/** 点击多按钮中的其中一个时触发 */
onAction: {
type: Function,
default: () => ({})
},
/** 如果“取消”按钮存在,则点击“取消”按钮时触发,同时触发关闭事件 */
onCancel: {
type: Function,
default: () => ({})
},
/** 关闭事件,点击 取消按钮 或 点击蒙层 时触发 */
onClose: {
type: Function,
default: () => ({})
},
/** 如果“确认”按钮存在,则点击“确认”按钮时触发 */
onConfirm: {
type: Function,
default: () => ({})
},
/** 如果蒙层存在,点击蒙层时触发 */
onOverlayClick: {
type: Function,
default: () => ({})
}
};
exports.props = props;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/dialog/props.js.map

View File

@@ -0,0 +1,84 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
const uni_modules_tdesignUniapp_components_draggable_props = require("./props.js");
const uni_modules_tdesignUniapp_components_common_utils = require("../common/utils.js");
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
const common_vendor = require("../../../../common/vendor.js");
const uni_modules_tdesignUniapp_components_common_wechat = require("../common/wechat.js");
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-draggable`;
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
name,
options: {
styleIsolation: "shared"
},
props: {
...uni_modules_tdesignUniapp_components_draggable_props.props
},
emits: [
"move",
"start",
"end"
],
data() {
return {
prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
classPrefix: name,
tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools,
systemInfo: uni_modules_tdesignUniapp_components_common_wechat.getWindowInfo()
};
},
mounted() {
this.computedRect();
},
methods: {
onTouchStart(e) {
const { systemInfo } = this;
if (this.direction === "none")
return;
this.startX = e.touches[0].clientX + systemInfo.windowWidth - this.rect.right;
this.startY = e.touches[0].clientY + systemInfo.windowHeight - this.rect.bottom;
this.$emit("start", { startX: this.startX, startY: this.startY, rect: this.rect, e });
},
onTouchMove(e) {
const { systemInfo } = this;
if (this.direction === "none")
return;
let x = this.startX - e.touches[0].clientX;
let y = this.startY - e.touches[0].clientY;
if (this.direction === "vertical") {
x = systemInfo.windowWidth - this.rect.right;
}
if (this.direction === "horizontal") {
y = systemInfo.windowHeight - this.rect.bottom;
}
this.$emit("move", { x, y, rect: this.rect, e });
},
async onTouchEnd(e) {
if (this.direction === "none")
return;
await this.computedRect();
this.$emit("end", { rect: this.rect, e });
},
async computedRect() {
this.rect = { right: 0, bottom: 0, width: 0, height: 0 };
try {
this.rect = await uni_modules_tdesignUniapp_components_common_utils.getRect(this, `.${this.classPrefix}`);
} catch (e) {
}
}
}
});
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.n(_ctx.classPrefix),
b: common_vendor.n(_ctx.tClass),
c: common_vendor.s(_ctx.tools._style([_ctx.customStyle])),
d: common_vendor.o((...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
e: common_vendor.o((...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
f: common_vendor.o((...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-02b06622"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/draggable/draggable.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="{{['data-v-02b06622', a, b]}}" style="{{c}}" bindtouchstart="{{d}}" catchtouchmove="{{e}}" bindtouchend="{{f}}"><slot/></view>

View File

@@ -0,0 +1,16 @@
.hotspot-expanded.relative.data-v-02b06622 {
position: relative;
}
.hotspot-expanded.data-v-02b06622::after {
content: '';
display: block;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
transform: scale(1.5);
}
.t-draggable.data-v-02b06622 {
position: fixed;
}

View File

@@ -0,0 +1,21 @@
"use strict";
const props = {
direction: {
type: String,
value: "all"
},
tClass: {
type: String,
default: ""
},
tClassButton: {
type: String,
default: ""
},
customStyle: {
type: [String, Object],
default: ""
}
};
exports.props = props;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/draggable/props.js.map

View File

@@ -0,0 +1,116 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
const uni_modules_tdesignUniapp_components_empty_props = require("./props.js");
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
const uni_modules_tdesignUniapp_components_common_utils = require("../common/utils.js");
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
const uni_modules_tdesignUniapp_components_common_version = require("../common/version.js");
const common_vendor = require("../../../../common/vendor.js");
const TIcon = () => "../icon/icon.js";
const TImage = () => "../image/image.js";
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-empty`;
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
name,
options: {
styleIsolation: "shared"
},
externalClasses: [
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-description`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-image`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-actions`
],
components: {
TIcon,
TImage
},
props: {
...uni_modules_tdesignUniapp_components_empty_props.props
},
data() {
return {
prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
classPrefix: name,
iconName: "",
iconData: {},
tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools
};
},
computed: {
iconTClass() {
return uni_modules_tdesignUniapp_components_common_version.canUseVirtualHost() ? this.iconRealClass : "";
},
iconClass() {
return !uni_modules_tdesignUniapp_components_common_version.canUseVirtualHost() ? this.iconRealClass : "";
},
iconRealClass() {
const { classPrefix, iconData } = this;
return `${classPrefix}__icon ${classPrefix}__icon--${iconData.activeIdx == iconData.index ? "active " : " "}`;
}
},
watch: {
icon: {
handler(t) {
const obj = uni_modules_tdesignUniapp_components_common_utils.setIcon("icon", t, "");
Object.keys(obj).forEach((key) => {
this[key] = obj[key];
});
},
immediate: true
}
},
mounted() {
},
methods: {}
});
if (!Array) {
const _easycom_t_image2 = common_vendor.resolveComponent("t-image");
const _easycom_t_icon2 = common_vendor.resolveComponent("t-icon");
(_easycom_t_image2 + _easycom_t_icon2)();
}
const _easycom_t_image = () => "../image/image.js";
const _easycom_t_icon = () => "../icon/icon.js";
if (!Math) {
(_easycom_t_image + _easycom_t_icon)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.image
}, _ctx.image ? {
b: common_vendor.p({
["t-class"]: _ctx.tClassImage,
src: _ctx.image,
mode: "aspectFit"
})
} : _ctx.iconName || _ctx.tools.isNoEmptyObj(_ctx.iconData) ? {
d: common_vendor.n(_ctx.iconClass),
e: common_vendor.p({
["custom-style"]: _ctx.iconData.style || "",
["t-class"]: _ctx.iconTClass,
prefix: _ctx.iconData.prefix,
name: _ctx.iconName || _ctx.iconData.name,
size: _ctx.iconData.size,
color: _ctx.iconData.color,
["aria-hidden"]: !!_ctx.iconData.ariaHidden,
["aria-label"]: _ctx.iconData.ariaLabel,
["aria-role"]: _ctx.iconData.ariaRole
})
} : {}, {
c: _ctx.iconName || _ctx.tools.isNoEmptyObj(_ctx.iconData),
f: common_vendor.n(_ctx.classPrefix + "__thumb"),
g: _ctx.description
}, _ctx.description ? {
h: common_vendor.t(_ctx.description)
} : {}, {
i: common_vendor.n(_ctx.classPrefix + "__description "),
j: common_vendor.n(_ctx.tClassDescription),
k: common_vendor.n(_ctx.classPrefix + "__actions "),
l: common_vendor.n(_ctx.tClassActions),
m: common_vendor.s(_ctx.tools._style([_ctx.customStyle])),
n: common_vendor.n(_ctx.tClass),
o: common_vendor.n(_ctx.classPrefix)
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e9615c73"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/empty/empty.js.map

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"t-icon": "../icon/icon",
"t-image": "../image/image"
}
}

View File

@@ -0,0 +1 @@
<view style="{{m}}" class="{{['data-v-e9615c73', n, o]}}"><view aria-hidden="{{true}}" class="{{['data-v-e9615c73', f]}}"><t-image wx:if="{{a}}" class="data-v-e9615c73" u-i="e9615c73-0" bind:__l="__l" u-p="{{b}}"/><block wx:elif="{{c}}" name="icon"><t-icon wx:if="{{e}}" class="{{['data-v-e9615c73', d]}}" u-i="e9615c73-1" bind:__l="__l" u-p="{{e}}"/></block><slot wx:else name="image"/></view><view class="{{['data-v-e9615c73', i, j]}}"><block wx:if="{{g}}">{{h}}</block><slot name="description"/></view><view class="{{['data-v-e9615c73', k, l]}}"><slot name="action"/></view></view>

View File

@@ -0,0 +1,21 @@
.t-empty.data-v-e9615c73 {
display: flex;
flex-direction: column;
align-items: center;
}
.data-v-e9615c73 .t-empty__icon {
font-size: 192rpx;
color: var(--td-empty-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
}
.t-empty__thumb + .t-empty__description.data-v-e9615c73:not(:empty) {
margin-top: var(--td-empty-description-margin-top, var(--td-spacer-2, 32rpx));
}
.t-empty__description.data-v-e9615c73 {
text-align: center;
color: var(--td-empty-description-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
font: var(--td-empty-description-font, var(--td-font-body-medium, 28rpx / 44rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular)));
white-space: pre-wrap;
}
.t-empty__description + .t-empty__actions.data-v-e9615c73:not(:empty) {
margin-top: var(--td-empty-action-margin-top, var(--td-spacer-4, 64rpx));
}

View File

@@ -0,0 +1,17 @@
"use strict";
const props = {
/** 描述文字 */
description: {
type: String
},
/** 图标名称。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon` */
icon: {
type: [String, Object]
},
/** 图片地址 */
image: {
type: String
}
};
exports.props = props;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/empty/props.js.map

View File

@@ -0,0 +1,233 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
const uni_modules_tdesignUniapp_components_fab_props = require("./props.js");
const uni_modules_tdesignUniapp_components_mixins_usingCustomNavbar = require("../mixins/using-custom-navbar.js");
const uni_modules_tdesignUniapp_components_common_utils = require("../common/utils.js");
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
const common_vendor = require("../../../../common/vendor.js");
const uni_modules_tdesignUniapp_components_common_wechat = require("../common/wechat.js");
const TButton = () => "../button/button.js";
const TDraggable = () => "../draggable/draggable.js";
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-fab`;
const baseButtonProps = {
size: "large",
shape: "circle",
theme: "primary",
tClass: `${uni_modules_tdesignUniapp_components_common_config.prefix}-fab__button`
};
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
name,
options: {
styleIsolation: "shared"
},
externalClasses: [`${uni_modules_tdesignUniapp_components_common_config.prefix}-class`, `${uni_modules_tdesignUniapp_components_common_config.prefix}-class-button`],
mixins: [uni_modules_tdesignUniapp_components_mixins_usingCustomNavbar.useCustomNavbarBehavior],
components: {
TButton,
TDraggable
},
props: {
...uni_modules_tdesignUniapp_components_fab_props.props
},
emits: [
"move",
"start",
"end"
],
data() {
return {
prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
classPrefix: name,
moveStyle: null,
tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools,
systemInfo: uni_modules_tdesignUniapp_components_common_wechat.getWindowInfo()
};
},
computed: {
buttonData() {
return {
...baseButtonProps,
shape: this.text ? "round" : "circle",
...this.buttonProps,
icon: this.icon,
content: this.text,
ariaLabel: this.ariaLabel
};
}
},
watch: {
icon: "computedSize",
ariaLabel: "computedSize",
yBounds: "computedSize",
buttonProps: "computedSize",
text: {
handler(val) {
this.content = val;
this.computedSize();
},
immediate: true
}
},
methods: {
onTplButtonTap(e) {
this.$emit("click", { e });
},
onStart(t) {
this.$emit("drag-start", t);
},
onMove(e) {
const {
yBounds = [],
distanceTop,
systemInfo
} = this;
const { x, y, rect } = e;
const maxX = systemInfo.windowWidth - rect.width;
const maxY = systemInfo.windowHeight - Math.max(distanceTop, uni_modules_tdesignUniapp_components_common_utils.unitConvert(yBounds[0])) - rect.height;
const right = Math.max(0, Math.min(x, maxX));
const bottom = Math.max(0, uni_modules_tdesignUniapp_components_common_utils.unitConvert(yBounds[1]), Math.min(y, maxY));
this.moveStyle = `right: ${right}px; bottom: ${bottom}px;`;
},
onEnd(t) {
this.$emit("drag-end", t);
},
computedSize() {
if (!this.draggable)
return;
setTimeout(() => {
var _a, _b, _c;
const insChild = (_b = (_a = this.$refs.draggableTemplate) == null ? void 0 : _a.$refs) == null ? void 0 : _b.draggable;
if ((_c = this == null ? void 0 : this.yBounds) == null ? void 0 : _c[1]) {
this.moveStyle = `bottom: ${uni_modules_tdesignUniapp_components_common_utils.unitConvert(this.yBounds[1])}px`;
insChild == null ? void 0 : insChild.computedRect();
} else {
insChild == null ? void 0 : insChild.computedRect();
}
});
},
getActionClass(a, b) {
return `${a}-${b}`;
}
}
});
if (!Array) {
const _easycom_t_button2 = common_vendor.resolveComponent("t-button");
const _easycom_t_draggable2 = common_vendor.resolveComponent("t-draggable");
(_easycom_t_button2 + _easycom_t_draggable2)();
}
const _easycom_t_button = () => "../button/button.js";
const _easycom_t_draggable = () => "../draggable/draggable.js";
if (!Math) {
(_easycom_t_button + _easycom_t_draggable)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.draggable
}, _ctx.draggable ? common_vendor.e({
b: !_ctx.buttonData.content && !_ctx.buttonData.icon
}, !_ctx.buttonData.content && !_ctx.buttonData.icon ? {} : common_vendor.e({
c: true
}, {}, {
d: common_vendor.n(_ctx.getActionClass(_ctx.classPrefix, _ctx.buttonData.buttonLayout) || ""),
e: _ctx.buttonData.index,
f: common_vendor.o(_ctx.onTplButtonTap),
g: common_vendor.o(_ctx.onTplButtonTap),
h: common_vendor.o(_ctx.onTplButtonTap),
i: common_vendor.o(_ctx.onTplButtonTap),
j: common_vendor.o(_ctx.onTplButtonTap),
k: common_vendor.o(_ctx.onTplButtonTap),
l: common_vendor.o(_ctx.onTplButtonTap),
m: common_vendor.o(_ctx.onTplButtonTap),
n: common_vendor.p({
["t-id"]: _ctx.buttonData.tId,
["custom-style"]: _ctx.buttonData.style || "",
block: _ctx.buttonData.block,
["t-class"]: _ctx.buttonData.tClass,
disabled: _ctx.buttonData.disabled,
["custom-dataset"]: _ctx.buttonData.customDataset,
content: _ctx.buttonData.content,
icon: _ctx.buttonData.icon,
loading: _ctx.buttonData.loading,
["loading-props"]: _ctx.buttonData.loadingProps,
theme: _ctx.buttonData.theme,
ghost: _ctx.buttonData.ghost,
shape: _ctx.buttonData.shape,
size: _ctx.buttonData.size,
variant: _ctx.buttonData.variant,
["open-type"]: _ctx.buttonData.openType,
["hover-class"]: _ctx.buttonData.hoverClass,
["hover-stop-propagation"]: _ctx.buttonData.hoverStopPropagation,
["hover-start-time"]: _ctx.buttonData.hoverStartTime,
["hover-stay-time"]: _ctx.buttonData.hoverStayTime,
lang: _ctx.buttonData.lang,
["session-from"]: _ctx.buttonData.sessionFrom,
["send-message-title"]: _ctx.buttonData.sendMessageTitle,
["send-message-path"]: _ctx.buttonData.sendMessagePath,
["send-message-img"]: _ctx.buttonData.sendMessageImg,
["app-parameter"]: _ctx.buttonData.appParameter,
["show-message-card"]: _ctx.buttonData.showMessageCard,
["aria-label"]: _ctx.buttonData.ariaLabel
})
}), {
o: common_vendor.sr("draggable", "f580c3f3-0"),
p: common_vendor.o(_ctx.onStart),
q: common_vendor.o(_ctx.onMove),
r: common_vendor.o(_ctx.onEnd),
s: common_vendor.p({
["custom-style"]: _ctx.tools._style(["right: 16px; bottom: 32px;", _ctx.customStyle, _ctx.moveStyle]),
direction: _ctx.draggable === true ? "all" : _ctx.draggable,
["t-class"]: _ctx.tClass
})
}) : common_vendor.e({
t: !_ctx.buttonData || !_ctx.buttonData.content && !_ctx.buttonData.icon
}, !_ctx.buttonData || !_ctx.buttonData.content && !_ctx.buttonData.icon ? {} : {
v: common_vendor.n(_ctx.getActionClass(_ctx.classPrefix, _ctx.buttonData.buttonLayout) || ""),
w: _ctx.buttonData.index,
x: common_vendor.o(_ctx.onTplButtonTap),
y: common_vendor.o(_ctx.onTplButtonTap),
z: common_vendor.o(_ctx.onTplButtonTap),
A: common_vendor.o(_ctx.onTplButtonTap),
B: common_vendor.o(_ctx.onTplButtonTap),
C: common_vendor.o(_ctx.onTplButtonTap),
D: common_vendor.o(_ctx.onTplButtonTap),
E: common_vendor.o(_ctx.onTplButtonTap),
F: common_vendor.p({
["t-id"]: _ctx.buttonData.tId,
["custom-style"]: _ctx.buttonData.style || "",
block: _ctx.buttonData.block,
["t-class"]: _ctx.buttonData.tClass,
disabled: _ctx.buttonData.disabled,
["custom-dataset"]: _ctx.buttonData.customDataset,
content: _ctx.buttonData.content,
icon: _ctx.buttonData.icon,
loading: _ctx.buttonData.loading,
["loading-props"]: _ctx.buttonData.loadingProps,
theme: _ctx.buttonData.theme,
ghost: _ctx.buttonData.ghost,
shape: _ctx.buttonData.shape,
size: _ctx.buttonData.size,
variant: _ctx.buttonData.variant,
["open-type"]: _ctx.buttonData.openType,
["hover-class"]: _ctx.buttonData.hoverClass,
["hover-stop-propagation"]: _ctx.buttonData.hoverStopPropagation,
["hover-start-time"]: _ctx.buttonData.hoverStartTime,
["hover-stay-time"]: _ctx.buttonData.hoverStayTime,
lang: _ctx.buttonData.lang,
["session-from"]: _ctx.buttonData.sessionFrom,
["send-message-title"]: _ctx.buttonData.sendMessageTitle,
["send-message-path"]: _ctx.buttonData.sendMessagePath,
["send-message-img"]: _ctx.buttonData.sendMessageImg,
["app-parameter"]: _ctx.buttonData.appParameter,
["show-message-card"]: _ctx.buttonData.showMessageCard,
["aria-label"]: _ctx.buttonData.ariaLabel
})
}, {
G: common_vendor.n(_ctx.classPrefix),
H: common_vendor.n(_ctx.tClass),
I: common_vendor.s(_ctx.tools._style(["right: 16px; bottom: 32px;", _ctx.customStyle]))
}));
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-f580c3f3"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/fab/fab.js.map

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"t-button": "../button/button",
"t-draggable": "../draggable/draggable"
}
}

View File

@@ -0,0 +1 @@
<t-draggable wx:if="{{a}}" class="r data-v-f580c3f3" u-s="{{['d']}}" u-r="draggable" bindstart="{{p}}" bindmove="{{q}}" bindend="{{r}}" u-i="f580c3f3-0" bind:__l="__l" u-p="{{s}}"><slot wx:if="{{b}}"/><block wx:else name="button"><t-button wx:if="{{n}}" u-s="{{['d']}}" class="{{['data-v-f580c3f3', d]}}" data-type="{{'action'}}" data-extra="{{e}}" bindclick="{{f}}" bindgetuserinfo="{{g}}" bindcontact="{{h}}" bindgetphonenumber="{{i}}" binderror="{{j}}" bindopensetting="{{k}}" bindlaunchapp="{{l}}" bindagreeprivacyauthorization="{{m}}" u-i="f580c3f3-1,f580c3f3-0" bind:__l="__l" u-p="{{n}}"><slot wx:if="{{c}}"/></t-button></block></t-draggable><view wx:else class="{{['data-v-f580c3f3', G, H]}}" style="{{I}}"><slot wx:if="{{t}}"/><t-button wx:else u-s="{{['d']}}" class="{{['data-v-f580c3f3', v]}}" data-type="{{'action'}}" data-extra="{{w}}" bindclick="{{x}}" bindgetuserinfo="{{y}}" bindcontact="{{z}}" bindgetphonenumber="{{A}}" binderror="{{B}}" bindopensetting="{{C}}" bindlaunchapp="{{D}}" bindagreeprivacyauthorization="{{E}}" u-i="f580c3f3-2" bind:__l="__l" u-p="{{F||''}}"><slot/></t-button></view>

View File

@@ -0,0 +1,9 @@
.t-fab.data-v-f580c3f3 {
position: fixed;
}
.t-fab__button.data-v-f580c3f3 {
box-shadow: var(--td-fab-shadow, var(--td-shadow-2, 0 3px 14px 2px rgba(0, 0, 0, 0.05), 0 8px 10px 1px rgba(0, 0, 0, 0.06), 0 5px 5px -3px rgba(0, 0, 0, 0.1)));
}
.t-fab__draggable.data-v-f580c3f3 {
position: fixed;
}

View File

@@ -0,0 +1,50 @@
"use strict";
const props = {
/** 透传至 Button 组件 */
buttonProps: {
type: Object
},
/** 是否可拖拽。`true` / `'all'`可拖动<br>`'vertical'`可垂直拖动<br>`'horizontal'`可水平拖动<br>`false`禁止拖动 */
draggable: {
type: [String, Boolean],
default: false
},
/** 图标 */
icon: {
type: String,
default: ""
},
/** 悬浮按钮的样式,常用于调整位置(即将废弃,建议使用 `style` */
style: {
type: String,
default: "right: 16px; bottom: 32px;"
},
/** 文本内容 */
text: {
type: String,
default: ""
},
/** 是否使用了自定义导航栏 */
usingCustomNavbar: Boolean,
/** 设置垂直方向边界限制,示例:[48, 48] 或 ['96px', 80] */
yBounds: {
type: Array
},
/** 悬浮按钮点击事件 */
onClick: {
type: Function,
default: () => ({})
},
/** 结束拖拽时触发 */
onDragEnd: {
type: Function,
default: () => ({})
},
/** 开始拖拽时触发 */
onDragStart: {
type: Function,
default: () => ({})
}
};
exports.props = props;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/fab/props.js.map

View File

@@ -0,0 +1,112 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
const uni_modules_tdesignUniapp_components_icon_props = require("./props.js");
const uni_modules_tdesignUniapp_components_common_utils = require("../common/utils.js");
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
const common_vendor = require("../../../../common/vendor.js");
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-icon`;
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
name,
options: {
styleIsolation: "shared"
},
externalClasses: [`${uni_modules_tdesignUniapp_components_common_config.prefix}-class`],
props: {
...uni_modules_tdesignUniapp_components_icon_props.props
},
data() {
return {
componentPrefix: uni_modules_tdesignUniapp_components_common_config.prefix,
classPrefix: name,
isImage: false,
iconStyle: void 0,
tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools
};
},
watch: {
name: {
handler() {
this.setIconStyle();
},
immediate: true
},
color: {
handler() {
this.setIconStyle();
},
immediate: true
},
size: {
handler() {
this.setIconStyle();
},
immediate: true
},
style: {
handler() {
this.setIconStyle();
},
immediate: true
}
},
methods: {
onTap(t) {
this.$emit("click", t);
},
setIconStyle() {
const {
name: name2,
color,
size,
classPrefix
} = this;
const isImage = name2.indexOf("/") !== -1;
const sizeValue = uni_modules_tdesignUniapp_components_common_utils.addUnit(size);
const colorStyle = color ? {
color
} : {};
const fontStyle = size ? {
"font-size": sizeValue
} : {};
const iconStyle = { ...colorStyle, ...fontStyle };
this.isImage = isImage;
if (isImage) {
let iconSize = sizeValue;
if (!iconSize) {
uni_modules_tdesignUniapp_components_common_utils.getRect(this, `.${classPrefix}`).then((res) => {
iconSize = uni_modules_tdesignUniapp_components_common_utils.addUnit(res == null ? void 0 : res.height);
}).catch(() => {
});
}
iconStyle.width = iconSize;
iconStyle.height = iconSize;
}
this.iconStyle = `${uni_modules_tdesignUniapp_components_common_utils.styles(iconStyle)}`;
}
}
});
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.isImage
}, _ctx.isImage ? {
b: _ctx.name,
c: common_vendor.n(_ctx.classPrefix + "__image"),
d: common_vendor.n(_ctx.classPrefix + "--image")
} : {}, {
e: _ctx.tools.isValidIconName(_ctx.name) && !_ctx.isImage
}, _ctx.tools.isValidIconName(_ctx.name) && !_ctx.isImage ? {
f: common_vendor.n((_ctx.prefix ? _ctx.prefix : _ctx.classPrefix) + "-" + _ctx.name + " " + _ctx.classPrefix + "-base")
} : {}, {
g: common_vendor.n(_ctx.tClass),
h: common_vendor.n(_ctx.prefix || "t-icon"),
i: common_vendor.s(_ctx.tools._style([_ctx.iconStyle, _ctx.customStyle])),
j: _ctx.ariaHidden,
k: _ctx.ariaLabel,
l: _ctx.ariaRole,
m: common_vendor.o((...args) => _ctx.onTap && _ctx.onTap(...args))
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-2e2ca7b4"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/icon/icon.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="{{['data-v-2e2ca7b4', g, h]}}" style="{{i}}" aria-hidden="{{j}}" aria-label="{{k}}" aria-role="{{l}}" bindtap="{{m}}"><view wx:if="{{a}}" class="{{['data-v-2e2ca7b4', d]}}"><image src="{{b}}" mode="aspectFit" class="{{['data-v-2e2ca7b4', c]}}"/></view><view wx:if="{{e}}" class="{{['data-v-2e2ca7b4', f]}}"/></view>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,31 @@
"use strict";
const props = {
/** 图标颜色 */
color: {
type: String,
default: ""
},
/** 图标名称或图片链接 */
name: {
type: String,
default: "",
required: true
},
/** 自定义图标前缀 */
prefix: {
type: String,
default: ""
},
/** 图标大小, 如 `20`, `20px`, `48rpx`, 默认单位是 `px` */
size: {
type: [String, Number],
default: ""
},
/** 点击图标时触发 */
onClick: {
type: Function,
default: () => ({})
}
};
exports.props = props;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/icon/props.js.map

View File

@@ -0,0 +1,190 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
const uni_modules_tdesignUniapp_components_image_props = require("./props.js");
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
const uni_modules_tdesignUniapp_components_common_utils = require("../common/utils.js");
const uni_modules_tdesignUniapp_components_common_version = require("../common/version.js");
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
const common_vendor = require("../../../../common/vendor.js");
const TLoading = () => "../loading/loading.js";
const TIcon = () => "../icon/icon.js";
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-image`;
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
name,
options: {
styleIsolation: "shared"
},
externalClasses: [
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-load`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-image`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-error`
],
components: {
TLoading,
TIcon
},
props: {
...uni_modules_tdesignUniapp_components_image_props.ImageProps
},
emits: [
"click"
],
data() {
return {
prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
isLoading: true,
isFailed: false,
innerStyle: "",
classPrefix: name,
tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools,
preSrc: ""
};
},
watch: {
src() {
if (this.preSrc !== this.src) {
this.update();
}
},
width: "calcSize",
height: "calcSize"
},
mounted() {
this.calcSize(this.width, this.height);
},
methods: {
onLoaded(e) {
const version = uni_modules_tdesignUniapp_components_common_utils.appBaseInfo.SDKVersion;
const {
mode,
tId
} = this;
const lower = uni_modules_tdesignUniapp_components_common_version.compareVersion(version, "2.10.3") < 0;
if ("heightFix" === mode && lower) {
uni_modules_tdesignUniapp_components_common_utils.getRect(this, `#${tId || "image"}`).then((e2) => {
const {
height,
width
} = e2;
this.innerStyle = `height: ${uni_modules_tdesignUniapp_components_common_utils.addUnit(height)}; width: ${width}px;`;
}).catch(() => {
});
}
this.isLoading = false;
this.isFailed = false;
this.$emit("load", { e });
},
onLoadError(e) {
this.isLoading = false;
this.isFailed = true;
this.$emit("error", { e });
},
calcSize(width = this.width, height = this.height) {
let innerStyle = "";
if (width) {
innerStyle += `width: ${uni_modules_tdesignUniapp_components_common_utils.addUnit(width)};`;
}
if (height) {
innerStyle += `height: ${uni_modules_tdesignUniapp_components_common_utils.addUnit(height)};`;
}
this.innerStyle = innerStyle;
},
update() {
const {
src
} = this;
this.preSrc = src;
if (src) {
this.isLoading = true;
this.isFailed = false;
} else {
this.onLoadError({
errMsg: "图片链接为空"
});
}
},
onClick(e) {
this.$emit("click", e);
}
}
});
if (!Array) {
const _easycom_t_loading2 = common_vendor.resolveComponent("t-loading");
const _easycom_t_icon2 = common_vendor.resolveComponent("t-icon");
(_easycom_t_loading2 + _easycom_t_icon2)();
}
const _easycom_t_loading = () => "../loading/loading.js";
const _easycom_t_icon = () => "../icon/icon.js";
if (!Math) {
(_easycom_t_loading + _easycom_t_icon)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.isLoading
}, _ctx.isLoading ? common_vendor.e({
b: _ctx.loading === "default"
}, _ctx.loading === "default" ? {
c: common_vendor.p({
theme: "dots",
size: "44rpx",
loading: true,
["inherit-color"]: true,
["t-class"]: _ctx.tClassLoad,
["t-class-text"]: _ctx.classPrefix + "--loading-text"
})
} : _ctx.loading !== "" && _ctx.loading !== "slot" ? {
e: common_vendor.t(_ctx.loading),
f: common_vendor.n(_ctx.classPrefix + "__common " + _ctx.tClassLoad)
} : {}, {
d: _ctx.loading !== "" && _ctx.loading !== "slot",
g: common_vendor.s(_ctx.tools._style([_ctx.innerStyle])),
h: common_vendor.n(_ctx.classPrefix + "__mask " + _ctx.classPrefix + "--loading " + _ctx.classPrefix + "--shape-" + _ctx.shape),
i: _ctx.ariaHidden
}) : _ctx.isFailed ? common_vendor.e({
k: _ctx.error === "default"
}, _ctx.error === "default" ? {
l: common_vendor.p({
name: "close",
["aria-role"]: "img",
["aria-label"]: "加载失败"
}),
m: common_vendor.n(_ctx.tClassLoad)
} : _ctx.error && _ctx.error !== "slot" ? {
o: common_vendor.t(_ctx.error),
p: common_vendor.n(_ctx.classPrefix + "__common "),
q: common_vendor.n(_ctx.tClassLoad)
} : {}, {
n: _ctx.error && _ctx.error !== "slot",
r: common_vendor.s(_ctx.tools._style([_ctx.innerStyle])),
s: common_vendor.n(_ctx.classPrefix + "__mask " + _ctx.classPrefix + "--failed " + _ctx.classPrefix + "--shape-" + _ctx.shape),
t: common_vendor.n(_ctx.tClassError),
v: _ctx.ariaHidden
}) : {}, {
j: _ctx.isFailed,
w: !_ctx.isFailed
}, !_ctx.isFailed ? {
x: _ctx.tId || "image",
y: common_vendor.s(_ctx.tools._style([_ctx.innerStyle])),
z: common_vendor.n(_ctx.classPrefix + "__img " + _ctx.classPrefix + "--shape-" + _ctx.shape + " "),
A: common_vendor.n((_ctx.isLoading ? _ctx.classPrefix + "--lazy" : "") + " "),
B: common_vendor.n(_ctx.tClassImage),
C: _ctx.src,
D: _ctx.mode,
E: _ctx.webp,
F: _ctx.lazy,
G: _ctx.showMenuByLongpress,
H: _ctx.ariaHidden || _ctx.isLoading || _ctx.isFailed,
I: _ctx.ariaLabel,
J: common_vendor.o((...args) => _ctx.onClick && _ctx.onClick(...args)),
K: common_vendor.o((...args) => _ctx.onLoaded && _ctx.onLoaded(...args)),
L: common_vendor.o((...args) => _ctx.onLoadError && _ctx.onLoadError(...args))
} : {}, {
M: common_vendor.s(_ctx.tools._style([_ctx.customStyle])),
N: common_vendor.n(_ctx.tClass),
O: common_vendor.n(_ctx.classPrefix)
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ea3c0982"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/image/image.js.map

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"t-loading": "../loading/loading",
"t-icon": "../icon/icon"
}
}

View File

@@ -0,0 +1 @@
<view style="{{M}}" class="{{['data-v-ea3c0982', N, O]}}"><view wx:if="{{a}}" style="{{g}}" class="{{['data-v-ea3c0982', h]}}" aria-hidden="{{i}}"><t-loading wx:if="{{b}}" class="data-v-ea3c0982" u-i="ea3c0982-0" bind:__l="__l" u-p="{{c}}"/><view wx:elif="{{d}}" class="{{['data-v-ea3c0982', f]}}">{{e}}</view><slot wx:else name="loading"/></view><view wx:elif="{{j}}" style="{{r}}" class="{{['data-v-ea3c0982', s, t]}}" aria-hidden="{{v}}"><view wx:if="{{k}}" style="font-size:44rpx" class="{{['data-v-ea3c0982', m]}}"><t-icon wx:if="{{l}}" class="data-v-ea3c0982" u-i="ea3c0982-1" bind:__l="__l" u-p="{{l}}"/></view><view wx:elif="{{n}}" class="{{['data-v-ea3c0982', p, q]}}">{{o}}</view><slot wx:else name="error"/></view><image wx:if="{{w}}" id="{{x}}" style="{{y}}" class="{{['data-v-ea3c0982', z, A, B]}}" src="{{C}}" mode="{{D}}" webp="{{E}}" lazy-load="{{F}}" show-menu-by-longpress="{{G}}" aria-hidden="{{H}}" aria-label="{{I}}" bindtap="{{J}}" bindload="{{K}}" binderror="{{L}}"/></view>

View File

@@ -0,0 +1,44 @@
.t-image.data-v-ea3c0982 {
position: relative;
display: inline-block;
}
.t-image__mask.data-v-ea3c0982,
.t-image__img.data-v-ea3c0982 {
color: var(--td-image-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
vertical-align: top;
width: inherit;
height: inherit;
}
.t-image__mask.data-v-ea3c0982 {
display: flex;
align-items: center;
justify-content: center;
background-color: var(--td-image-loading-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
color: var(--td-image-loading-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
}
.t-image--loading-text.data-v-ea3c0982 {
width: 0;
height: 0;
}
.t-image__common.data-v-ea3c0982 {
width: 100%;
height: 100%;
}
.t-image--lazy.data-v-ea3c0982 {
position: absolute;
top: 0;
left: 0;
z-index: -1;
}
.t-image--shape-circle.data-v-ea3c0982 {
border-radius: 50%;
overflow: hidden;
}
.t-image--shape-round.data-v-ea3c0982 {
border-radius: var(--td-image-round-radius, var(--td-radius-default, 12rpx));
overflow: hidden;
}
.t-image--shape-square.data-v-ea3c0982 {
border-radius: 0;
overflow: hidden;
}

View File

@@ -0,0 +1,69 @@
"use strict";
const ImageProps = {
/** 加载失败时显示的内容。值为 `default` 则表示使用默认加载失败风格;值为空或者 `slot` 表示使用插槽渲染,插槽名称为 `error`;值为其他则表示普通文本内容,如“加载失败” */
error: {
type: String,
default: "default"
},
/** 高度,默认单位为`px` */
height: {
type: [String, Number]
},
/** 是否开启图片懒加载 */
lazy: Boolean,
/** 加载态内容。值为 `default` 则表示使用默认加载中风格;值为其他则表示普通文本内容,如“加载中” */
loading: {
type: String,
default: "default"
},
/** 图片裁剪、缩放的模式;[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/image.html) */
mode: {
type: String,
default: "scaleToFill",
validator(val) {
if (!val)
return true;
return ["scaleToFill", "aspectFit", "aspectFill", "widthFix", "heightFix", "top", "bottom", "center", "left", "right", "top left", "top right", "bottom left", "bottom right"].includes(val);
}
},
/** 图片圆角类型 */
shape: {
type: String,
default: "square",
validator(val) {
if (!val)
return true;
return ["circle", "round", "square"].includes(val);
}
},
/** 长按图片显示发送给朋友、收藏、保存图片、搜一搜、打开名片/前往群聊/打开小程序(若图片中包含对应二维码或小程序码)的菜单 */
showMenuByLongpress: Boolean,
/** 图片链接 */
src: {
type: String,
default: ""
},
/** 图片标签id */
tId: {
type: String,
default: ""
},
/** 默认不解析 webP 格式,只支持网络资源 */
webp: Boolean,
/** 宽度,默认单位为`px` */
width: {
type: [String, Number]
},
/** 图片加载失败时触发 */
onError: {
type: Function,
default: () => ({})
},
/** 图片加载完成时触发 */
onLoad: {
type: Function,
default: () => ({})
}
};
exports.ImageProps = ImageProps;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/image/props.js.map

View File

@@ -0,0 +1,13 @@
"use strict";
function getInputClass(classPrefix, suffix, align, disabled) {
const className = [`${classPrefix}__control`];
if (align) {
className.push(`${classPrefix}--${align}`);
}
if (disabled) {
className.push(`${classPrefix}__control--disabled`);
}
return className.join(" ");
}
exports.getInputClass = getInputClass;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/input/computed.js.map

View File

@@ -0,0 +1,336 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_validator = require("../common/validator.js");
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
const uni_modules_tdesignUniapp_components_input_props = require("./props.js");
const uni_modules_tdesignUniapp_components_common_utils = require("../common/utils.js");
const uni_modules_tdesignUniapp_components_input_computed = require("./computed.js");
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
const uni_modules_tdesignUniapp_components_common_relation_parentMap = require("../common/relation/parent-map.js");
const common_vendor = require("../../../../common/vendor.js");
const TIcon = () => "../icon/icon.js";
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-input`;
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
name,
options: {
styleIsolation: "shared"
},
inject: {
[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.FormKey]: {
default: null
}
},
externalClasses: [
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-prefix-icon`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-label`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-input`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-clearable`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-suffix`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-suffix-icon`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-tips`
],
components: {
TIcon
},
props: {
...uni_modules_tdesignUniapp_components_input_props.props
},
emits: [
"blur",
"change",
"clear",
"click",
"enter",
"focus",
"keyboardheightchange",
"nicknamereview",
"validate",
"update:value"
],
data() {
return {
prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
classPrefix: name,
classBasePrefix: uni_modules_tdesignUniapp_components_common_config.prefix,
showClearIcon: true,
tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools,
dataValue: uni_modules_tdesignUniapp_components_common_utils.coalesce(this.value, this.defaultValue)
// rawValue: '',
// innerMaxLen: -1,
};
},
computed: {},
watch: {
prefixIcon: {
handler(v) {
this._prefixIcon = uni_modules_tdesignUniapp_components_common_utils.calcIcon(v);
},
immediate: true
},
suffixIcon: {
handler(v) {
this._suffixIcon = uni_modules_tdesignUniapp_components_common_utils.calcIcon(v);
},
immediate: true
},
clearable: {
handler(v) {
this._clearIcon = uni_modules_tdesignUniapp_components_common_utils.calcIcon(v, "close-circle-filled");
},
immediate: true
},
clearTrigger: "updateClearIconVisible",
disabled: "updateClearIconVisible",
readonly: "updateClearIconVisible",
value: {
handler(v) {
this.dataValue = v;
uni_modules_tdesignUniapp_components_common_utils.nextTick().then(() => {
this.dataValue = v;
if (this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.FormKey] && this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.FormKey].onValueChange) {
this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.FormKey].onValueChange(v);
}
});
}
}
},
mounted() {
const { value, defaultValue } = this;
this.updateValue(uni_modules_tdesignUniapp_components_common_utils.coalesce(value, defaultValue, ""));
this.updateClearIconVisible();
},
methods: {
getInputClass: uni_modules_tdesignUniapp_components_input_computed.getInputClass,
updateValue(value) {
this.dataValue = value;
const { allowInputOverMax, maxcharacter, maxlength } = this;
if (!allowInputOverMax && maxcharacter && maxcharacter > 0 && !Number.isNaN(maxcharacter)) {
const { length, characters } = uni_modules_tdesignUniapp_components_common_utils.getCharacterLength("maxcharacter", value, maxcharacter);
uni_modules_tdesignUniapp_components_common_utils.nextTick().then(() => {
this.dataValue = characters;
});
this.count = length;
} else if (!allowInputOverMax && maxlength && maxlength > 0 && !Number.isNaN(maxlength)) {
const { length, characters } = uni_modules_tdesignUniapp_components_common_utils.getCharacterLength("maxlength", value, maxlength);
uni_modules_tdesignUniapp_components_common_utils.nextTick().then(() => {
this.dataValue = characters;
});
this.count = length;
} else {
uni_modules_tdesignUniapp_components_common_utils.nextTick().then(() => {
this.dataValue = value;
});
this.dataValue = value;
this.count = uni_modules_tdesignUniapp_components_common_validator.isDef(value) ? String(value).length : 0;
}
},
// updateInnerMaxLen() {
// this.innerMaxLen = this.getInnerMaxLen();
// },
// getInnerMaxLen() {
// const {
// allowInputOverMax,
// maxcharacter,
// maxlength,
// dataValue,
// rawValue,
// count,
// } = this;
// return getInnerMaxLen({
// allowInputOverMax,
// maxcharacter,
// maxlength,
// dataValue,
// rawValue,
// count,
// });
// },
updateClearIconVisible(value = false) {
const { clearTrigger, disabled, readonly } = this;
if (disabled || readonly) {
this.showClearIcon = false;
return;
}
this.showClearIcon = value || clearTrigger === "always";
},
onInput(e) {
const { value, cursor, keyCode } = e.detail;
this.updateValue(value);
this.emitChange({ value: this.dataValue, cursor, keyCode });
},
onChange(e) {
if (this.type !== "nickname")
return;
const { value } = e.detail;
this.updateValue(value);
this.emitChange({ value: this.dataValue });
},
emitChange(data) {
this.$emit("change", data);
this.$emit("update:value", data.value);
},
onFocus(e) {
this.updateClearIconVisible(true);
this.$emit("focus", e.detail);
},
onBlur(e) {
this.updateClearIconVisible();
if (this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.FormKey] && this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.FormKey].onBlur) {
this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.FormKey].onBlur(this.dataValue);
}
if (typeof this.format === "function") {
const v = this.format(e.detail.value);
this.updateValue(v);
this.$emit("blur", { value: this.dataValue, cursor: this.count });
return;
}
this.$emit("blur", e.detail);
},
onConfirm(e) {
this.$emit("enter", e.detail);
},
onSuffixClick() {
this.$emit("click", { trigger: "suffix" });
},
onSuffixIconClick() {
this.$emit("click", { trigger: "suffix-icon" });
},
clearInput(e) {
this.$emit("clear", e.detail);
this.dataValue = "";
},
onKeyboardHeightChange(e) {
this.$emit("keyboardheightchange", e.detail);
},
onNickNameReview(e) {
this.$emit("nicknamereview", e.detail);
},
onClick() {
this.$emit("click", { trigger: "input" });
}
}
});
if (!Array) {
const _easycom_t_icon2 = common_vendor.resolveComponent("t-icon");
_easycom_t_icon2();
}
const _easycom_t_icon = () => "../icon/icon.js";
if (!Math) {
_easycom_t_icon();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx._prefixIcon
}, _ctx._prefixIcon ? {
b: common_vendor.o(($event) => _ctx._prefixIcon.click || ""),
c: common_vendor.p({
["custom-style"]: _ctx._prefixIcon.style || "",
["t-class"]: _ctx.tClassPrefixIcon,
prefix: _ctx._prefixIcon.prefix,
name: _ctx._prefixIcon.name,
size: _ctx._prefixIcon.size,
color: _ctx._prefixIcon.color,
["aria-hidden"]: true,
["aria-label"]: _ctx._prefixIcon.ariaLabel,
["aria-role"]: _ctx._prefixIcon.ariaRole
})
} : {}, {
d: common_vendor.n(_ctx.classPrefix + "__icon--prefix"),
e: _ctx.label
}, _ctx.label ? {
f: common_vendor.t(_ctx.label)
} : {}, {
g: common_vendor.n(_ctx.classPrefix + "__label " + _ctx.tClassLabel),
h: common_vendor.n(_ctx.classPrefix + "__wrap--prefix"),
i: common_vendor.n(_ctx.getInputClass(_ctx.classPrefix, _ctx.suffix, _ctx.align, _ctx.disabled) + " " + _ctx.tClassInput),
j: _ctx.allowInputOverMax ? -1 : _ctx.maxlength,
k: _ctx.disabled || _ctx.readonly,
l: _ctx.placeholder,
m: _ctx.placeholderStyle,
n: _ctx.tools.cls(_ctx.classPrefix + "__placeholder", [["disabled", _ctx.disabled]]) + " " + _ctx.placeholderClass,
o: _ctx.dataValue,
p: _ctx.type === "password",
q: _ctx.type === "password" ? "text" : _ctx.type,
r: _ctx.focus,
s: _ctx.confirmType,
t: _ctx.confirmHold,
v: _ctx.cursor,
w: _ctx.cursorColor,
x: _ctx.cursorSpacing,
y: _ctx.adjustPosition,
z: _ctx.autoFocus,
A: _ctx.alwaysEmbed,
B: _ctx.selectionStart,
C: _ctx.selectionEnd,
D: _ctx.holdKeyboard,
E: _ctx.safePasswordCertPath,
F: _ctx.safePasswordLength,
G: _ctx.safePasswordTimeStamp,
H: _ctx.safePasswordNonce,
I: _ctx.safePasswordSalt,
J: _ctx.safePasswordCustomHash,
K: _ctx.label,
L: _ctx.label,
M: common_vendor.o((...args) => _ctx.onInput && _ctx.onInput(...args)),
N: common_vendor.o((...args) => _ctx.onChange && _ctx.onChange(...args)),
O: common_vendor.o((...args) => _ctx.onFocus && _ctx.onFocus(...args)),
P: common_vendor.o((...args) => _ctx.onBlur && _ctx.onBlur(...args)),
Q: common_vendor.o((...args) => _ctx.onConfirm && _ctx.onConfirm(...args)),
R: common_vendor.o((...args) => _ctx.onKeyboardHeightChange && _ctx.onKeyboardHeightChange(...args)),
S: common_vendor.o((...args) => _ctx.onNickNameReview && _ctx.onNickNameReview(...args)),
T: _ctx._clearIcon && _ctx.dataValue && _ctx.dataValue.length && _ctx.showClearIcon
}, _ctx._clearIcon && _ctx.dataValue && _ctx.dataValue.length && _ctx.showClearIcon ? {
U: common_vendor.o(($event) => _ctx._clearIcon.click || ""),
V: common_vendor.p({
["custom-style"]: _ctx._clearIcon.style || "",
["t-class"]: _ctx.tClassClearable,
prefix: _ctx._clearIcon.prefix,
name: _ctx._clearIcon.name,
size: _ctx._clearIcon.size,
color: _ctx._clearIcon.color,
["aria-hidden"]: false,
["aria-label"]: _ctx._clearIcon.ariaLabel || "清除",
["aria-role"]: _ctx._clearIcon.ariaRole || "button"
}),
W: common_vendor.n(_ctx.classPrefix + "__wrap--clearable-icon"),
X: common_vendor.o((...args) => _ctx.clearInput && _ctx.clearInput(...args))
} : {}, {
Y: _ctx.suffix
}, _ctx.suffix ? {
Z: common_vendor.t(_ctx.suffix)
} : {}, {
aa: common_vendor.n(_ctx.classPrefix + "__wrap--suffix " + _ctx.tClassSuffix),
ab: common_vendor.o((...args) => _ctx.onSuffixClick && _ctx.onSuffixClick(...args)),
ac: _ctx._suffixIcon
}, _ctx._suffixIcon ? {
ad: common_vendor.o(($event) => _ctx._suffixIcon.click || ""),
ae: common_vendor.p({
["custom-style"]: _ctx._suffixIcon.style || "",
["t-class"]: _ctx.tClassSuffixIcon,
prefix: _ctx._suffixIcon.prefix,
name: _ctx._suffixIcon.name,
size: _ctx._suffixIcon.size,
color: _ctx._suffixIcon.color,
["aria-hidden"]: true,
["aria-label"]: _ctx._suffixIcon.ariaLabel,
["aria-role"]: _ctx._suffixIcon.ariaRole || "button"
})
} : {}, {
af: common_vendor.n(_ctx.classPrefix + "__wrap--suffix-icon"),
ag: common_vendor.o((...args) => _ctx.onSuffixIconClick && _ctx.onSuffixIconClick(...args)),
ah: common_vendor.n(_ctx.classPrefix + "__content " + _ctx.classPrefix + "--" + _ctx.status),
ai: common_vendor.o((...args) => _ctx.onClick && _ctx.onClick(...args)),
aj: _ctx.tips && _ctx.tips.length > 0
}, _ctx.tips && _ctx.tips.length > 0 ? {
ak: common_vendor.t(_ctx.tips),
al: common_vendor.n(_ctx.classPrefix + "__tips " + _ctx.classPrefix + "--" + _ctx.align + " " + _ctx.tClassTips)
} : {}, {
am: common_vendor.n(_ctx.classPrefix + "__wrap"),
an: common_vendor.s(_ctx.tools._style([_ctx.customStyle])),
ao: common_vendor.n(_ctx.tools.cls(_ctx.classPrefix, [["border", !_ctx.borderless], ["readonly", _ctx.readonly], ["disabled", _ctx.disabled]]) + " " + _ctx.classPrefix + "--layout-" + _ctx.layout + " " + _ctx.tClass)
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-bdad3b11"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/input/input.js.map

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"t-icon": "../icon/icon"
}
}

View File

@@ -0,0 +1 @@
<view style="{{an}}" class="{{['data-v-bdad3b11', ao]}}" aria-describedby><view class="{{['data-v-bdad3b11', h]}}"><view class="{{['data-v-bdad3b11', d]}}"><slot name="prefix-icon"/><block wx:if="{{a}}" name="icon"><t-icon wx:if="{{c}}" class="data-v-bdad3b11" bindclick="{{b}}" u-i="bdad3b11-0" bind:__l="__l" u-p="{{c}}"/></block></view><view class="{{['data-v-bdad3b11', g]}}" aria-hidden><slot name="label"/><block wx:if="{{e}}">{{f}}</block></view></view><view class="{{['data-v-bdad3b11', am]}}"><view class="{{['data-v-bdad3b11', ah]}}" bindtap="{{ai}}"><block wx:if="{{r0}}"><input class="{{['data-v-bdad3b11', i]}}" maxlength="{{j}}" disabled="{{k}}" placeholder="{{l}}" placeholder-style="{{m}}" placeholder-class="{{n}}" value="{{o}}" password="{{p}}" type="{{q}}" focus="{{r}}" confirm-type="{{s}}" confirm-hold="{{t}}" cursor="{{v}}" cursor-color="{{w}}" cursor-spacing="{{x}}" adjust-position="{{y}}" auto-focus="{{z}}" always-embed="{{A}}" selection-start="{{B}}" selection-end="{{C}}" hold-keyboard="{{D}}" safe-password-cert-path="{{E}}" safe-password-length="{{F}}" safe-password-time-stamp="{{G}}" safe-password-nonce="{{H}}" safe-password-salt="{{I}}" safe-password-custom-hash="{{J}}" aria-role="textbox" aria-label="{{K}}" aria-roledescription="{{L}}" bindinput="{{M}}" bindchange="{{N}}" bindfocus="{{O}}" bindblur="{{P}}" bindconfirm="{{Q}}" bindkeyboardheightchange="{{R}}" bindnicknamereview="{{S}}"></input></block><view wx:if="{{T}}" class="{{['data-v-bdad3b11', W]}}" catchtap="{{X}}"><t-icon wx:if="{{V}}" class="data-v-bdad3b11" bindclick="{{U}}" u-i="bdad3b11-1" bind:__l="__l" u-p="{{V}}"/></view><view class="{{['data-v-bdad3b11', aa]}}" bindtap="{{ab}}"><text wx:if="{{Y}}" class="data-v-bdad3b11">{{Z}}</text><slot name="suffix"/></view><view class="{{['data-v-bdad3b11', af]}}" bindtap="{{ag}}"><slot name="suffix-icon"/><block wx:if="{{ac}}" name="icon"><t-icon wx:if="{{ae}}" class="data-v-bdad3b11" bindclick="{{ad}}" u-i="bdad3b11-2" bind:__l="__l" u-p="{{ae}}"/></block></view></view><view wx:if="{{aj}}" class="{{['data-v-bdad3b11', al]}}">{{ak}}</view><slot name="tips"/></view><slot name="extra"/></view>

View File

@@ -0,0 +1,173 @@
.t-input.data-v-bdad3b11 {
background-color: var(--td-input-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
display: flex;
align-items: var(--td-input-align-items, center);
flex: 1;
padding: var(--td-input-vertical-padding, 32rpx);
overflow: hidden;
}
.t-input--border.data-v-bdad3b11 {
position: relative;
}
.t-input--border.data-v-bdad3b11::after {
content: '';
display: block;
position: absolute;
top: unset;
bottom: 0;
left: unset;
right: unset;
background-color: var(--td-input-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
}
.t-input--border.data-v-bdad3b11::after {
height: 1px;
left: 0;
right: 0;
transform: scaleY(0.5);
}
.t-input--border.data-v-bdad3b11:after {
left: var(--td-input-border-left-space, 32rpx);
right: var(--td-input-border-right-space, 0);
}
.t-input--layout-vertical.data-v-bdad3b11 {
flex-direction: column;
align-items: start;
}
.t-input__wrap--prefix.data-v-bdad3b11 {
display: flex;
}
.t-input__icon--prefix.data-v-bdad3b11 {
font-size: 48rpx;
color: var(--td-input-prefix-icon-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
}
.t-input__label.data-v-bdad3b11:not(:empty) {
min-width: var(--td-input-label-min-width, 2em);
max-width: var(--td-input-label-max-width, 5em);
font: var(--td-input-label-text-font, var(--td-font-body-large, 32rpx / 48rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular)));
color: var(--td-input-label-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
margin-right: var(--td-spacer-2, 32rpx);
word-wrap: break-word;
}
.t-input--layout-vertical .t-input__label.data-v-bdad3b11:not(:empty) {
font-size: var(--td-font-size-base, 28rpx);
padding-bottom: 8rpx;
}
.t-input__icon--prefix:not(:empty) + .t-input__label.data-v-bdad3b11:not(:empty) {
padding-left: 8rpx;
}
.t-input__label:not(:empty) + .t-input__wrap.data-v-bdad3b11 {
margin-left: var(--td-spacer-2, 32rpx);
}
.t-input__icon--prefix:not(:empty) + .t-input__label.data-v-bdad3b11:empty {
margin-right: var(--td-spacer-2, 32rpx);
}
.t-input__wrap.data-v-bdad3b11 {
width: 100%;
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: center;
flex-shrink: 1;
flex: 1;
}
.t-input__wrap .t-input__content.data-v-bdad3b11 {
display: flex;
width: 100%;
align-items: center;
font: var(--td-font-body-large, 32rpx / 48rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular));
}
.t-input__wrap--clearable-icon.data-v-bdad3b11,
.t-input__wrap--suffix-icon.data-v-bdad3b11,
.t-input__wrap--suffix.data-v-bdad3b11 {
flex: 0 0 auto;
padding-left: var(--td-spacer-1, 24rpx);
}
.t-input__wrap--clearable-icon.data-v-bdad3b11:empty,
.t-input__wrap--suffix-icon.data-v-bdad3b11:empty,
.t-input__wrap--suffix.data-v-bdad3b11:empty {
display: none;
}
.t-input__wrap--clearable-icon.data-v-bdad3b11,
.t-input__wrap--suffix-icon.data-v-bdad3b11 {
font-size: 48rpx;
color: var(--td-input-suffix-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
}
.t-input__wrap--suffix.data-v-bdad3b11 {
font-size: var(--td-font-size-m, 32rpx);
color: var(--td-input-suffix-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
}
.t-input__icon--prefix.data-v-bdad3b11:empty,
.t-input__tips.data-v-bdad3b11:empty,
.t-input__wrap--clearable-icon.data-v-bdad3b11:empty,
.t-input__wrap--suffix-icon.data-v-bdad3b11:empty,
.t-input__wrap--suffix.data-v-bdad3b11:empty {
display: none;
}
.t-input__control.data-v-bdad3b11 {
display: block;
box-sizing: border-box;
width: 100%;
min-width: 0;
min-height: 48rpx;
margin: 0;
padding: 0;
color: var(--td-input-default-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
line-height: inherit;
background-color: transparent;
border: 0;
resize: none;
font-size: inherit;
}
.t-input__control--disabled.data-v-bdad3b11 {
color: var(--td-input-disabled-text-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
cursor: not-allowed;
opacity: 1;
-webkit-text-fill-color: currentColor;
}
.t-input__control--read-only.data-v-bdad3b11 {
cursor: default;
}
.t-input--left.data-v-bdad3b11 {
text-align: left;
}
.t-input--right.data-v-bdad3b11 {
text-align: right;
}
.t-input--center.data-v-bdad3b11 {
text-align: center;
}
.t-input__placeholder.data-v-bdad3b11 {
color: var(--td-input-placeholder-text-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
font: var(--td-input-placeholder-text-font, var(--td-font-body-large, 32rpx / 48rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular)));
}
.t-input__placeholder--disabled.data-v-bdad3b11 {
color: var(--td-input-disabled-text-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
}
.t-input__tips.data-v-bdad3b11 {
font: var(--td-font-body-small, 24rpx / 40rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular));
padding-top: 8rpx;
}
.t-input--default + .t-input__tips.data-v-bdad3b11 {
color: var(--td-input-default-tips-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
}
.t-input--success + .t-input__tips.data-v-bdad3b11 {
color: var(--td-input-success-tips-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
}
.t-input--warning + .t-input__tips.data-v-bdad3b11 {
color: var(--td-input-warning-tips-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
}
.t-input--error + .t-input__tips.data-v-bdad3b11 {
color: var(--td-input-error-tips-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
}

View File

@@ -0,0 +1,249 @@
"use strict";
const props = {
/** 键盘弹起时,是否自动上推页面 */
adjustPosition: {
type: Boolean,
default: true
},
/** 文本内容位置,居左/居中/居右 */
align: {
type: String,
default: "left",
validator(val) {
if (!val)
return true;
return ["left", "center", "right"].includes(val);
}
},
/** 超出 `maxlength` 或 `maxcharacter` 之后是否允许继续输入 */
allowInputOverMax: Boolean,
/** 强制 input 处于同层状态,默认 focus 时 input 会切到非同层状态 (仅在 iOS 下生效) */
alwaysEmbed: Boolean,
/** (即将废弃,请直接使用 focus )自动聚焦,拉起键盘 */
autoFocus: Boolean,
/** 是否开启无边框模式 */
borderless: Boolean,
/** 清空图标触发方式,仅在输入框有值时有效 */
clearTrigger: {
type: String,
default: "always",
validator(val) {
if (!val)
return true;
return ["always", "focus"].includes(val);
}
},
/** 是否可清空,默认不启动。值为 `true` 表示使用默认清空按钮,值为 `Object` 表示透传至 `icon` */
clearable: {
type: [Boolean, Object],
default: false
},
/** 点击键盘右下角按钮时是否保持键盘不收起 */
confirmHold: Boolean,
/** 设置键盘右下角按钮的文字仅在type='text'时生效。<br />具体释义:<br />`send` 右下角按钮为“发送”;<br />`search` 右下角按钮为“搜索”;<br />`next` 右下角按钮为“下一个”;<br />`go` 右下角按钮为“前往”;<br />`done` 右下角按钮为“完成”。<br />[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/input.html) */
confirmType: {
type: String,
default: "done",
validator(val) {
if (!val)
return true;
return ["send", "search", "next", "go", "done"].includes(val);
}
},
/** 指定 focus 时的光标位置 */
cursor: {
type: Number,
default: -1
},
/** 光标颜色。iOS 下的格式为十六进制颜色值 #000000安卓下的只支持 default 和 greenSkyline 下无限制 */
cursorColor: {
type: String,
default: "#0052d9"
},
/** 指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 */
cursorSpacing: {
type: Number,
default: 0
},
/** 是否禁用输入框 */
disabled: {
type: Boolean,
default: void 0
},
/** 获取焦点 */
focus: Boolean,
/** 指定输入框展示值的格式 */
format: {
type: Function
},
/** focus时点击页面的时候不收起键盘 */
holdKeyboard: Boolean,
/** 左侧文本 */
label: {
type: String
},
/** 标题输入框布局方式 */
layout: {
type: String,
default: "horizontal",
validator(val) {
if (!val)
return true;
return ["vertical", "horizontal"].includes(val);
}
},
/** 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用 */
maxcharacter: {
type: Number
},
/** 用户最多可以输入的文本长度,一个中文等于一个计数长度。默认为 -1不限制输入长度。`maxcharacter` 和 `maxlength` 二选一使用 */
maxlength: {
type: Number,
default: -1
},
/** 占位符 */
placeholder: {
type: String,
default: void 0
},
/** 指定 placeholder 的样式类 */
placeholderClass: {
type: String,
default: "input-placeholder"
},
/** 指定 placeholder 的样式 */
placeholderStyle: {
type: String,
default: ""
},
/** 组件前置图标。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon` */
prefixIcon: {
type: [String, Object]
},
/** 只读状态 */
readonly: {
type: Boolean,
default: void 0
},
/** 安全键盘加密公钥的路径,只支持包内路径 */
safePasswordCertPath: {
type: String,
default: ""
},
/** 安全键盘计算 hash 的算法表达式,如 `md5(sha1('foo' + sha256(sm3(password + 'bar'))))` */
safePasswordCustomHash: {
type: String,
default: ""
},
/** 安全键盘输入密码长度 */
safePasswordLength: {
type: Number
},
/** 安全键盘加密盐值 */
safePasswordNonce: {
type: String,
default: ""
},
/** 安全键盘计算 hash 盐值若指定custom-hash 则无效 */
safePasswordSalt: {
type: String,
default: ""
},
/** 安全键盘加密时间戳 */
safePasswordTimeStamp: {
type: Number
},
/** 光标结束位置,自动聚集时有效,需与 selection-start 搭配使用 */
selectionEnd: {
type: Number,
default: -1
},
/** 光标起始位置,自动聚集时有效,需与 selection-end 搭配使用 */
selectionStart: {
type: Number,
default: -1
},
/** 输入框状态 */
status: {
type: String,
default: "default",
validator(val) {
if (!val)
return true;
return ["default", "success", "warning", "error"].includes(val);
}
},
/** 后置图标前的后置内容 */
suffix: {
type: String
},
/** 后置文本内容。值为字符串则表示图标名称,值为 `Object` 类型,表示透传至 `icon` */
suffixIcon: {
type: [String, Object]
},
/** 输入框下方提示文本,会根据不同的 `status` 呈现不同的样式 */
tips: {
type: String
},
/** 输入框类型 */
type: {
type: String,
default: "text",
validator(val) {
if (!val)
return true;
return ["text", "number", "idcard", "digit", "safe-password", "password", "nickname"].includes(val);
}
},
/** 输入框的值 */
value: {
type: [String, Number]
},
/** 失去焦点时触发 */
onBlur: {
type: Function,
default: () => ({})
},
/** 输入框值发生变化时触发cursor 为光标位置; */
onChange: {
type: Function,
default: () => ({})
},
/** 清空按钮点击时触发 */
onClear: {
type: Function,
default: () => ({})
},
/** 点击事件。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts)。 */
onClick: {
type: Function,
default: () => ({})
},
/** 回车键按下时触发 */
onEnter: {
type: Function,
default: () => ({})
},
/** 获得焦点时触发 */
onFocus: {
type: Function,
default: () => ({})
},
/** 键盘高度发生变化的时候触发此事件 */
onKeyboardheightchange: {
type: Function,
default: () => ({})
},
/** 用户昵称审核完毕后触发,仅在 type 为 "nickname" 时有效 */
onNicknamereview: {
type: Function,
default: () => ({})
},
/** 字数超出限制时触发 */
onValidate: {
type: Function,
default: () => ({})
}
};
exports.props = props;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/input/props.js.map

View File

@@ -0,0 +1,107 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
const uni_modules_tdesignUniapp_components_loading_props = require("./props.js");
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
const common_vendor = require("../../../../common/vendor.js");
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-loading`;
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
name,
options: {
multipleSlots: true,
styleIsolation: "shared"
},
externalClasses: [
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-text`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-indicator`
],
props: {
...uni_modules_tdesignUniapp_components_loading_props.props
},
data() {
return {
prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
classPrefix: name,
show: true,
tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools
};
},
watch: {
loading: {
handler(value) {
const {
delay
} = this;
if (this.timer) {
clearTimeout(this.timer);
}
if (value && delay) {
this.timer = setTimeout(() => {
this.show = value;
this.timer = null;
}, delay);
} else {
this.show = value;
}
},
immediate: true
}
},
beforeUnMount() {
clearTimeout(this.timer);
},
methods: {
refreshPage() {
this.$emit("reload");
}
}
});
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.indicator
}, _ctx.indicator ? common_vendor.e({
b: _ctx.theme === "spinner"
}, _ctx.theme === "spinner" ? {
c: common_vendor.f(12, (item, index, i0) => {
return {
a: index,
b: common_vendor.n(_ctx.classPrefix + "__dot " + _ctx.classPrefix + "__dot-" + index)
};
})
} : {}, {
d: _ctx.theme === "circular"
}, _ctx.theme === "circular" ? {
e: common_vendor.n(_ctx.classPrefix + "__circular")
} : {}, {
f: _ctx.theme === "dots"
}, _ctx.theme === "dots" ? {
g: common_vendor.n(_ctx.classPrefix + "__dot"),
h: common_vendor.s((_ctx.duration ? "animation-duration: " + _ctx.duration / 1e3 + "s; animation-delay:0s;" : "") + " animation-play-state: " + (_ctx.pause ? "paused" : "running") + ";"),
i: common_vendor.n(_ctx.classPrefix + "__dot"),
j: common_vendor.s((_ctx.duration ? "animation-duration: " + _ctx.duration / 1e3 + "s; animation-delay:" + _ctx.duration * 1 / 3e3 + "s;" : "") + " animation-play-state: " + (_ctx.pause ? "paused" : "running") + ";"),
k: common_vendor.n(_ctx.classPrefix + "__dot"),
l: common_vendor.s((_ctx.duration ? "animation-duration: " + _ctx.duration / 1e3 + "s; animation-delay:" + _ctx.duration * 2 / 3e3 + "s;" : "") + " animation-play-state: " + (_ctx.pause ? "paused" : "running") + ";")
} : {}, {
m: common_vendor.n(_ctx.tClassIndicator),
n: common_vendor.n(_ctx.classPrefix + "__spinner " + _ctx.classPrefix + "__spinner--" + _ctx.theme + " " + (_ctx.reverse ? "reverse" : "")),
o: common_vendor.s("width: " + _ctx.tools.addUnit(_ctx.size) + "; height: " + _ctx.tools.addUnit(_ctx.size) + "; " + (_ctx.inheritColor ? "color: inherit;" : "") + " " + (_ctx.indicator ? "" : "display: none;") + " " + (_ctx.duration ? "animation-duration: " + _ctx.duration / 1e3 + "s;" : "") + " animation-play-state: " + (_ctx.pause ? "paused" : "running") + ";"),
p: _ctx.ariaRole || "img",
q: _ctx.ariaLabel || _ctx.text || "加载中"
}) : {}, {
r: _ctx.text
}, _ctx.text ? {
s: common_vendor.t(_ctx.text)
} : {}, {
t: common_vendor.n(_ctx.tools.cls(_ctx.classPrefix + "__text", [_ctx.layout])),
v: common_vendor.n(_ctx.tClassText),
w: _ctx.indicator,
x: _ctx.ariaLabel || _ctx.text,
y: common_vendor.s(_ctx.tools._style([_ctx.customStyle, _ctx.show ? "" : "display: none", _ctx.inheritColor ? "color: inherit" : ""])),
z: common_vendor.n(_ctx.tClass),
A: common_vendor.n(_ctx.classPrefix + " " + (_ctx.classPrefix + "--" + _ctx.layout) + " " + (_ctx.fullscreen ? _ctx.classPrefix + "--fullscreen" : ""))
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-11314ba3"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/loading/loading.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view style="{{y}}" class="{{['data-v-11314ba3', z, A]}}"><view wx:if="{{a}}" class="{{['data-v-11314ba3', m, n]}}" style="{{o}}" aria-role="{{p}}" aria-label="{{q}}"><block wx:if="{{b}}"><view wx:for="{{c}}" wx:for-item="item" wx:key="a" class="{{['data-v-11314ba3', item.b]}}"/></block><view wx:if="{{d}}" class="{{['data-v-11314ba3', e]}}"/><block wx:if="{{f}}"><view class="{{['data-v-11314ba3', g]}}" style="{{h}}"/><view class="{{['data-v-11314ba3', i]}}" style="{{j}}"/><view class="{{['data-v-11314ba3', k]}}" style="{{l}}"/></block><slot name="indicator"/></view><view class="{{['data-v-11314ba3', t, v]}}" aria-hidden="{{w}}" aria-label="{{x}}"><block wx:if="{{r}}">{{s}}</block><slot name="text"/><slot/></view></view>

View File

@@ -0,0 +1,203 @@
.t-loading.data-v-11314ba3 {
display: inline-flex;
align-items: center;
justify-content: center;
}
.t-loading--fullscreen.data-v-11314ba3 {
position: fixed;
display: flex;
align-items: center;
vertical-align: middle;
justify-content: center;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: var(--td-loading-z-index, 3500);
background-color: var(--td-loading-full-bg-color, rgba(255, 255, 255, 0.6));
}
.t-loading__spinner.data-v-11314ba3 {
position: relative;
box-sizing: border-box;
width: 100%;
height: 100%;
max-width: 100%;
max-height: 100%;
animation: rotate-11314ba3 0.8s linear infinite;
color: var(--td-loading-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
}
.t-loading__spinner.reverse.data-v-11314ba3 {
animation-name: rotateReverse-11314ba3;
}
.t-loading__spinner--spinner.data-v-11314ba3 {
animation-timing-function: steps(12);
color: var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
}
.t-loading__spinner--spinner .t-loading__dot.data-v-11314ba3 {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.t-loading__spinner--spinner .t-loading__dot.data-v-11314ba3::before {
display: block;
width: 5rpx;
height: 25%;
margin: 0 auto;
background-color: var(--td-loading-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
border-radius: 40%;
content: ' ';
}
.t-loading__spinner--circular .t-loading__circular.data-v-11314ba3 {
border-radius: 100%;
width: 100%;
height: 100%;
background: conic-gradient(from 180deg at 50% 50%, rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, 0) 60deg, currentColor 330deg, rgba(255, 255, 255, 0) 360deg);
mask: radial-gradient(transparent calc(50% - 1rpx), #fff 50%);
/* stylelint-disable-next-line */
-webkit-mask: radial-gradient(transparent calc(50% - 1rpx), #fff 50%);
}
.t-loading__spinner--dots.data-v-11314ba3 {
display: flex;
justify-content: space-between;
align-items: center;
animation: none;
}
.t-loading__spinner--dots .t-loading__dot.data-v-11314ba3 {
width: 20%;
height: 20%;
border-radius: 50%;
background-color: var(--td-loading-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
animation-duration: 1.8s;
animation-name: dotting-11314ba3;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-fill-mode: both;
}
.t-loading__text.data-v-11314ba3 {
color: var(--td-loading-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
font: var(--td-loading-text-font, var(--td-font-body-small, 24rpx / 40rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular)));
}
.t-loading__text--vertical.data-v-11314ba3:not(:first-child):not(:empty) {
margin-top: 12rpx;
}
.t-loading__text--horizontal.data-v-11314ba3:not(:first-child):not(:empty) {
margin-left: 16rpx;
}
.t-loading--vertical.data-v-11314ba3 {
flex-direction: column;
}
.t-loading--horizontal.data-v-11314ba3 {
flex-direction: row;
vertical-align: top;
}
@keyframes t-bar-11314ba3 {
0% {
width: 0;
}
50% {
width: 70%;
}
100% {
width: 80%;
}
}
@keyframes t-bar-loaded-11314ba3 {
0% {
height: 6rpx;
opacity: 1;
width: 90%;
}
50% {
height: 6rpx;
opacity: 1;
width: 100%;
}
100% {
height: 0;
opacity: 0;
width: 100%;
}
}
.t-loading__dot-1.data-v-11314ba3 {
transform: rotate(30deg);
opacity: 0;
}
.t-loading__dot-2.data-v-11314ba3 {
transform: rotate(60deg);
opacity: 0.08333333;
}
.t-loading__dot-3.data-v-11314ba3 {
transform: rotate(90deg);
opacity: 0.16666667;
}
.t-loading__dot-4.data-v-11314ba3 {
transform: rotate(120deg);
opacity: 0.25;
}
.t-loading__dot-5.data-v-11314ba3 {
transform: rotate(150deg);
opacity: 0.33333333;
}
.t-loading__dot-6.data-v-11314ba3 {
transform: rotate(180deg);
opacity: 0.41666667;
}
.t-loading__dot-7.data-v-11314ba3 {
transform: rotate(210deg);
opacity: 0.5;
}
.t-loading__dot-8.data-v-11314ba3 {
transform: rotate(240deg);
opacity: 0.58333333;
}
.t-loading__dot-9.data-v-11314ba3 {
transform: rotate(270deg);
opacity: 0.66666667;
}
.t-loading__dot-10.data-v-11314ba3 {
transform: rotate(300deg);
opacity: 0.75;
}
.t-loading__dot-11.data-v-11314ba3 {
transform: rotate(330deg);
opacity: 0.83333333;
}
.t-loading__dot-12.data-v-11314ba3 {
transform: rotate(360deg);
opacity: 0.91666667;
}
@keyframes rotate-11314ba3 {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@keyframes rotateReverse-11314ba3 {
from {
transform: rotate(360deg);
}
to {
transform: rotate(0deg);
}
}
@keyframes dotting-11314ba3 {
0% {
opacity: 0.15;
}
1% {
opacity: 0.8;
}
33% {
opacity: 0.8;
}
34% {
opacity: 0.15;
}
100% {
opacity: 0.15;
}
}

View File

@@ -0,0 +1,66 @@
"use strict";
const props = {
/** 延迟显示加载效果的时间,用于防止请求速度过快引起的加载闪烁,单位:毫秒 */
delay: {
type: Number,
default: 0
},
/** 加载动画执行完成一次的时间,单位:毫秒 */
duration: {
type: Number,
default: 800
},
/** 是否显示为全屏加载 */
fullscreen: Boolean,
/** 加载指示符,值为 true 显示默认指示符,值为 false 则不显示,也可以自定义指示符 */
indicator: {
type: Boolean,
default: true
},
/** 是否继承父元素颜色 */
inheritColor: Boolean,
/** 对齐方式 */
layout: {
type: String,
default: "horizontal",
validator(val) {
if (!val)
return true;
return ["horizontal", "vertical"].includes(val);
}
},
/** 是否处于加载状态 */
loading: {
type: Boolean,
default: true
},
/** 是否暂停动画 */
pause: Boolean,
/** 加载进度 */
progress: {
type: Number
},
/** 加载动画是否反向 */
reverse: Boolean,
/** 尺寸示例20px */
size: {
type: String,
default: "20px"
},
/** 加载提示文案 */
text: {
type: String
},
/** 加载组件类型 */
theme: {
type: String,
default: "circular",
validator(val) {
if (!val)
return true;
return ["circular", "spinner", "dots", "custom"].includes(val);
}
}
};
exports.props = props;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/loading/props.js.map

View File

@@ -0,0 +1,56 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_utils = require("../common/utils.js");
const uni_modules_tdesignUniapp_components_common_bus = require("../common/bus.js");
const bus = new uni_modules_tdesignUniapp_components_common_bus.Bus();
const PAGE_SCROLL_EVENT_NAME = "page-scroll";
const onPageScroll = function(event) {
const page = uni_modules_tdesignUniapp_components_common_utils.getCurrentPage();
if (!page)
return;
const { pageScroller } = page;
pageScroller == null ? void 0 : pageScroller.forEach((scroller) => {
if (typeof scroller === "function") {
scroller(event);
}
});
};
const pageScrollMixin = (funcName = "onScroll", useBus = true) => {
return {
mounted() {
if (useBus) {
bus.on(PAGE_SCROLL_EVENT_NAME, this[funcName]);
return;
}
const page = uni_modules_tdesignUniapp_components_common_utils.getCurrentPage();
if (!page)
return;
if (Array.isArray(page.pageScroller)) {
page.pageScroller.push(this._bindScroller);
} else {
page.pageScroller = typeof page.onPageScroll === "function" ? [page.onPageScroll.bind(page), this._bindScroller] : [this._bindScroller];
}
page.onPageScroll = onPageScroll;
},
beforeUnMount() {
var _a;
if (useBus) {
bus.off(PAGE_SCROLL_EVENT_NAME, this[funcName]);
return;
}
const page = uni_modules_tdesignUniapp_components_common_utils.getCurrentPage();
if (!page)
return;
page.pageScroller = ((_a = page.pageScroller) == null ? void 0 : _a.filter((item) => item !== this._bindScroller)) || [];
},
methods: {
_bindScroller(e) {
var _a;
let result;
result = (_a = this[funcName]) == null ? void 0 : _a.call(this, e);
return result;
}
}
};
};
exports.pageScrollMixin = pageScrollMixin;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/mixins/page-scroll.js.map

View File

@@ -0,0 +1,32 @@
"use strict";
const getDirection = (t, s) => t > s && t > 10 ? "horizontal" : s > t && s > 10 ? "vertical" : "";
const touch = {
data() {
return {};
},
methods: {
resetTouchStatus() {
this.direction = "";
this.deltaX = 0;
this.deltaY = 0;
this.offsetX = 0;
this.offsetY = 0;
},
touchStart(t) {
this.resetTouchStatus();
const [s] = t.touches;
this.startX = s.clientX;
this.startY = s.clientY;
},
touchMove(t) {
const [s] = t.touches;
this.deltaX = s.clientX - this.startX;
this.deltaY = s.clientY - this.startY;
this.offsetX = Math.abs(this.deltaX);
this.offsetY = Math.abs(this.deltaY);
this.direction = getDirection(this.offsetX, this.offsetY);
}
}
};
exports.touch = touch;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/mixins/touch.js.map

View File

@@ -0,0 +1,132 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
function transition() {
return {
data() {
return {
transitionClass: "",
transitionDurations: 300,
className: "",
realVisible: false
};
},
props: {
visible: {
type: Boolean,
default: null
},
appear: Boolean,
name: {
type: String,
default: "fade"
},
durations: {
type: Number,
optionalTypes: [Array]
}
},
watch: {
visible: {
handler(val, oldVal) {
this.watchVisible(val, oldVal);
}
}
},
created() {
this.status = "";
this.transitionT = 0;
},
beforeMount() {
this.dataDurations = this.getDurations();
if (this.visible) {
this.enter();
}
this.inited = true;
},
destroyed() {
clearTimeout(this.transitionT);
},
methods: {
watchVisible(curr, prev) {
if (this.inited && curr !== prev) {
curr ? this.enter() : this.leave();
}
},
getDurations() {
const { durations } = this;
if (Array.isArray(durations)) {
return durations.map((item) => Number(item));
}
return [Number(durations), Number(durations)];
},
enter() {
const { name, transitionDurations } = this;
const [duration] = this.dataDurations;
this.status = "entering";
this.realVisible = true;
this.transitionClass = `${uni_modules_tdesignUniapp_components_common_config.prefix}-${name}-enter ${uni_modules_tdesignUniapp_components_common_config.prefix}-${name}-enter-active`;
setTimeout(() => {
this.transitionClass = `${uni_modules_tdesignUniapp_components_common_config.prefix}-${name}-enter-active ${uni_modules_tdesignUniapp_components_common_config.prefix}-${name}-enter-to`;
}, 30);
if (typeof duration === "number" && duration > 0) {
this.transitionT = setTimeout(this.entered.bind(this), duration + 30);
} else {
this.transitionT = setTimeout(
this.status === "leaving" ? this.leaved.bind(this) : () => {
},
transitionDurations + 30
);
}
},
entered() {
this.customDuration = false;
clearTimeout(this.transitionT);
this.status = "entered";
this.transitionClass = "";
},
leave() {
const { name, transitionDurations } = this;
const [, duration] = this.dataDurations;
this.status = "leaving";
this.transitionClass = `${uni_modules_tdesignUniapp_components_common_config.prefix}-${name}-leave ${uni_modules_tdesignUniapp_components_common_config.prefix}-${name}-leave-active`;
clearTimeout(this.transitionT);
setTimeout(() => {
this.transitionClass = `${uni_modules_tdesignUniapp_components_common_config.prefix}-${name}-leave-active ${uni_modules_tdesignUniapp_components_common_config.prefix}-${name}-leave-to`;
}, 30);
if (typeof duration === "number" && duration > 0) {
this.customDuration = true;
this.transitionT = setTimeout(this.leaved.bind(this), duration + 30);
} else {
this.transitionT = setTimeout(
this.status === "leaving" ? this.leaved.bind(this) : () => {
},
transitionDurations + 30
);
}
},
leaved() {
this.customDuration = false;
this.$emit("leaved");
clearTimeout(this.transitionT);
this.status = "leaved";
this.transitionClass = "";
this.realVisible = false;
},
onTransitionEnd() {
if (this.customDuration) {
return;
}
clearTimeout(this.transitionT);
if (this.status === "entering" && this.visible) {
this.entered();
} else if (this.status === "leaving" && !this.visible) {
this.leaved();
}
}
}
};
}
const transitionMixins = transition();
exports.transition = transition;
exports.transitionMixins = transitionMixins;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/mixins/transition.js.map

Some files were not shown because too many files have changed in this diff Show More