| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756 |
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- body {
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
- background-color: #f5f5f5;
- padding-bottom: 65px;
- }
- /* 顶部商家信息 */
- .header {
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- color: white;
- padding: 15px;
- position: sticky;
- top: 0;
- z-index: 100;
- box-shadow: 0 2px 8px rgba(0,0,0,0.1);
- }
- .shop-name {
- font-size: 20px;
- margin-bottom: 8px;
- }
- .shop-tags {
- display: flex;
- gap: 10px;
- }
- .tag {
- background: rgba(255,255,255,0.2);
- padding: 4px 10px;
- border-radius: 12px;
- font-size: 12px;
- }
- /* 主体布局 */
- .main-container {
- display: flex;
- height: calc(100vh - 165px);
- overflow: hidden;
- }
- /* 左侧分类 */
- .category-sidebar {
- width: 90px;
- background: #f8f8f8;
- overflow-y: auto;
- border-right: 1px solid #e5e5e5;
- }
- .category-item {
- padding: 20px 10px;
- text-align: center;
- font-size: 14px;
- color: #666;
- cursor: pointer;
- transition: all 0.3s;
- border-left: 3px solid transparent;
- }
- .category-item:hover {
- background: #fff;
- }
- .category-item.active {
- background: #fff;
- color: #667eea;
- font-weight: bold;
- border-left-color: #667eea;
- }
- /* 右侧菜品列表 */
- .dish-content {
- flex: 1;
- overflow-y: auto;
- overflow-x: hidden;
- scroll-behavior: smooth;
- position: relative;
- padding: 15px;
- }
- .category-section {
- margin-bottom: 20px;
- }
- .category-title {
- font-size: 16px;
- font-weight: bold;
- color: #333;
- margin-bottom: 15px;
- padding-left: 10px;
- border-left: 4px solid #667eea;
- transition: all 0.3s;
- position: sticky;
- top: 0;
- background: #f5f5f5;
- padding-top: 10px;
- padding-bottom: 10px;
- z-index: 10;
- }
- .dish-list {
- display: flex;
- flex-direction: column;
- gap: 15px;
- }
- .dish-item {
- display: flex;
- background: white;
- border-radius: 12px;
- padding: 12px;
- box-shadow: 0 2px 8px rgba(0,0,0,0.05);
- transition: transform 0.2s;
- cursor: pointer;
- }
- .dish-item:active {
- transform: scale(0.98);
- }
- .dish-img {
- width: 100px;
- height: 100px;
- border-radius: 8px;
- object-fit: cover;
- margin-right: 12px;
- }
- .dish-info {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- }
- .dish-name {
- font-size: 16px;
- font-weight: bold;
- color: #333;
- margin-bottom: 5px;
- }
- .dish-desc {
- font-size: 12px;
- color: #999;
- margin-bottom: 5px;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .dish-tags {
- display: flex;
- gap: 5px;
- margin-bottom: 8px;
- }
- .dish-tag {
- background: #fff3e0;
- color: #ff9800;
- padding: 2px 8px;
- border-radius: 4px;
- font-size: 11px;
- }
- .dish-footer {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .dish-price {
- color: #ff6b6b;
- font-size: 18px;
- font-weight: bold;
- }
- .dish-sales {
- font-size: 12px;
- color: #999;
- margin-left: 10px;
- }
- .dish-controls {
- display: flex;
- align-items: center;
- gap: 10px;
- }
- .control-btn {
- width: 28px;
- height: 28px;
- border-radius: 50%;
- border: none;
- background: #667eea;
- color: white;
- font-size: 18px;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- transition: all 0.2s;
- }
- .control-btn:active {
- transform: scale(0.9);
- }
- .control-btn.minus {
- background: #e0e0e0;
- color: #666;
- }
- .dish-count {
- min-width: 20px;
- text-align: center;
- font-weight: bold;
- }
- /* 底部购物车 */
- .cart-bar {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- height: 65px;
- background: #2c2c2c;
- display: flex;
- align-items: center;
- padding: 0 15px;
- box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
- z-index: 200;
- gap: 10px;
- }
- .cart-icon-wrapper {
- position: relative;
- flex-shrink: 0;
- }
- .cart-icon {
- width: 45px;
- height: 45px;
- background: #667eea;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 20px;
- cursor: pointer;
- transition: transform 0.2s;
- position: relative;
- }
- .cart-icon:active {
- transform: scale(0.95);
- }
- .cart-count {
- position: absolute;
- top: -3px;
- right: -3px;
- background: #ff6b6b;
- color: white;
- border-radius: 9px;
- padding: 2px 5px;
- font-size: 11px;
- min-width: 18px;
- text-align: center;
- font-weight: bold;
- }
- .cart-info {
- flex: 1;
- color: white;
- min-width: 0;
- display: flex;
- flex-direction: column;
- justify-content: center;
- }
- .cart-price {
- font-size: 20px;
- font-weight: bold;
- color: #fff;
- line-height: 1.2;
- margin-bottom: 2px;
- }
- .price-label {
- font-size: 14px;
- }
- .delivery-fee {
- font-size: 11px;
- color: #999;
- line-height: 1.2;
- }
- .checkout-btn {
- background: #4caf50;
- color: white;
- border: none;
- padding: 10px 18px;
- border-radius: 18px;
- font-size: 13px;
- font-weight: bold;
- cursor: pointer;
- transition: all 0.3s;
- white-space: nowrap;
- flex-shrink: 0;
- }
- .checkout-btn:disabled {
- background: #555;
- cursor: not-allowed;
- }
- .checkout-btn:not(:disabled):active {
- transform: scale(0.95);
- }
- /* 购物车详情弹窗 */
- .cart-detail-mask {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 65px;
- background: rgba(0,0,0,0.5);
- z-index: 198;
- display: none;
- backdrop-filter: blur(2px);
- }
- .cart-detail-mask.show {
- display: block;
- animation: fadeIn 0.3s ease;
- }
- .cart-detail {
- position: fixed;
- bottom: 65px;
- left: 0;
- right: 0;
- max-height: 50vh;
- background: white;
- border-radius: 20px 20px 0 0;
- z-index: 199;
- transform: translateY(0);
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
- box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
- opacity: 0;
- visibility: hidden;
- pointer-events: none;
- }
- .cart-detail.show {
- opacity: 1;
- visibility: visible;
- pointer-events: auto;
- }
- .cart-detail-header {
- display: flex;
- justify-content: space-between;
- padding: 15px 20px;
- border-bottom: 1px solid #f0f0f0;
- font-weight: bold;
- }
- .clear-cart {
- color: #999;
- cursor: pointer;
- }
- .cart-detail-list {
- max-height: calc(50vh - 60px);
- overflow-y: auto;
- padding: 10px 20px;
- }
- .cart-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 15px 0;
- border-bottom: 1px solid #f5f5f5;
- }
- .cart-item-name {
- flex: 1;
- font-size: 14px;
- }
- .cart-item-price {
- color: #ff6b6b;
- margin: 0 15px;
- }
- /* 菜品详情弹窗 */
- .dish-detail-mask {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0,0,0,0.7);
- z-index: 400;
- display: none;
- }
- .dish-detail-mask.show {
- display: block;
- }
- .dish-detail {
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%) scale(0);
- width: 90%;
- max-width: 500px;
- background: white;
- border-radius: 16px;
- z-index: 401;
- transition: transform 0.3s;
- }
- .dish-detail.show {
- transform: translate(-50%, -50%) scale(1);
- }
- .dish-detail-content {
- padding: 20px;
- }
- .dish-detail-img {
- width: 100%;
- height: 200px;
- object-fit: cover;
- border-radius: 12px;
- margin-bottom: 15px;
- }
- .dish-detail-name {
- font-size: 20px;
- margin-bottom: 10px;
- }
- .dish-detail-desc {
- color: #666;
- font-size: 14px;
- line-height: 1.6;
- margin-bottom: 15px;
- }
- .dish-detail-tags {
- display: flex;
- gap: 8px;
- margin-bottom: 20px;
- }
- .dish-detail-footer {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .dish-detail-price {
- color: #ff6b6b;
- font-size: 24px;
- font-weight: bold;
- }
- .add-to-cart-btn {
- background: #667eea;
- color: white;
- border: none;
- padding: 12px 30px;
- border-radius: 25px;
- font-size: 16px;
- cursor: pointer;
- }
- .close-detail {
- position: absolute;
- top: 10px;
- right: 10px;
- width: 30px;
- height: 30px;
- background: rgba(0,0,0,0.5);
- color: white;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 24px;
- cursor: pointer;
- }
- /* 滚动条样式 */
- ::-webkit-scrollbar {
- width: 6px;
- }
- ::-webkit-scrollbar-thumb {
- background: #ccc;
- border-radius: 3px;
- }
- ::-webkit-scrollbar-track {
- background: #f5f5f5;
- }
- /* 支付二维码弹窗 */
- .payment-mask {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0,0,0,0.7);
- z-index: 500;
- display: none;
- backdrop-filter: blur(4px);
- }
- .payment-mask.show {
- display: block;
- animation: fadeIn 0.3s ease;
- }
- .payment-modal {
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%) scale(0);
- width: 90%;
- max-width: 400px;
- background: white;
- border-radius: 16px;
- z-index: 501;
- transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
- box-shadow: 0 8px 32px rgba(0,0,0,0.3);
- }
- .payment-modal.show {
- transform: translate(-50%, -50%) scale(1);
- }
- .payment-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 20px;
- border-bottom: 1px solid #f0f0f0;
- }
- .payment-header h3 {
- font-size: 20px;
- color: #333;
- margin: 0;
- }
- .close-payment {
- width: 32px;
- height: 32px;
- background: #f5f5f5;
- color: #666;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 24px;
- cursor: pointer;
- transition: all 0.2s;
- }
- .close-payment:hover {
- background: #e0e0e0;
- color: #333;
- }
- .payment-content {
- padding: 20px;
- }
- .payment-info {
- margin-bottom: 20px;
- }
- .info-row {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 10px 0;
- font-size: 14px;
- }
- .info-row .label {
- color: #666;
- }
- .info-row .value {
- color: #333;
- font-weight: 500;
- }
- .info-row .amount {
- color: #ff6b6b;
- font-size: 20px;
- font-weight: bold;
- }
- .qrcode-container {
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 20px;
- background: #f8f8f8;
- border-radius: 12px;
- margin-bottom: 20px;
- }
- .qrcode-image {
- width: 200px;
- height: 200px;
- padding: 15px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0,0,0,0.1);
- object-fit: contain;
- }
- .qrcode-tip {
- margin-top: 15px;
- font-size: 13px;
- color: #666;
- text-align: center;
- }
- .payment-status {
- text-align: center;
- }
- .status-checking {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 10px;
- }
- .loading-spinner {
- width: 40px;
- height: 40px;
- border: 4px solid #f0f0f0;
- border-top-color: #667eea;
- border-radius: 50%;
- animation: spin 1s linear infinite;
- }
- @keyframes spin {
- to { transform: rotate(360deg); }
- }
- .status-checking p {
- color: #666;
- font-size: 14px;
- margin: 0;
- }
- .status-success {
- display: none;
- flex-direction: column;
- align-items: center;
- gap: 10px;
- }
- .status-success.show {
- display: flex;
- }
- .success-icon {
- width: 60px;
- height: 60px;
- background: #4caf50;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 32px;
- color: white;
- animation: scaleIn 0.5s ease;
- }
- @keyframes scaleIn {
- 0% { transform: scale(0); }
- 50% { transform: scale(1.1); }
- 100% { transform: scale(1); }
- }
- .status-success p {
- color: #4caf50;
- font-size: 16px;
- font-weight: bold;
- margin: 0;
- }
- /* 支付失败样式 */
- .status-failure {
- display: none;
- flex-direction: column;
- align-items: center;
- gap: 10px;
- }
- .status-failure.show {
- display: flex;
- }
- .failure-icon {
- width: 60px;
- height: 60px;
- background: #f44336;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 32px;
- color: white;
- animation: shakeIn 0.5s ease;
- }
- @keyframes shakeIn {
- 0%, 100% { transform: translateX(0); }
- 25% { transform: translateX(-10px); }
- 75% { transform: translateX(10px); }
- }
- .status-failure p {
- color: #f44336;
- font-size: 16px;
- font-weight: bold;
- margin: 0;
- text-align: center;
- }
|