first commit
This commit is contained in:
75
unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
Normal file
75
unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
Normal 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
|
||||
6
unpackage/dist/dev/mp-weixin/pages/index/index.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/pages/index/index.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "预约系统",
|
||||
"usingComponents": {
|
||||
"t-fab": "../../uni_modules/tdesign-uniapp/components/fab/fab"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/index/index.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/index/index.wxml
vendored
Normal 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>
|
||||
78
unpackage/dist/dev/mp-weixin/pages/index/index.wxss
vendored
Normal file
78
unpackage/dist/dev/mp-weixin/pages/index/index.wxss
vendored
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user