diff --git a/.cursorrules b/.cursorrules
index 4ffe28b..eb0a2a6 100644
--- a/.cursorrules
+++ b/.cursorrules
@@ -68,6 +68,7 @@ import { HomeOutlined } from '@taroify/icons'
- 使用 px单位,会自动转换为 rpx
- 使用 BEM 命名规范
- 非特殊说明,不要使用PX
+- 新页面的 样式使用 _ 链接 比如“name_label”
## 常用命令
diff --git a/src/pages/scan/index.scss b/src/pages/scan/index.scss
index 71a6d4c..5d222e0 100644
--- a/src/pages/scan/index.scss
+++ b/src/pages/scan/index.scss
@@ -44,5 +44,71 @@
align-items: center;
justify-content: center;
}
+
+ .unsettled-orders-btn {
+ width: 500px;
+ height: 88px;
+ background: #01CA68;
+ border-radius: 44px;
+ color: #fff;
+ font-size: 32px;
+ font-weight: bold;
+ border: none;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ }
+
+ // 未结算订单弹窗样式
+ :global {
+ .unsettled-dialog {
+ .taroify-dialog__header {
+ font-size: 36px;
+ font-weight: 500;
+ color: #333333;
+ padding: 50px 30px 30px;
+ }
+
+ .taroify-dialog__content {
+ padding: 20px 30px 50px;
+
+ .dialog-content {
+ font-size: 30px;
+ color: #666666;
+ line-height: 1.6;
+ text-align: center;
+ }
+ }
+
+ .taroify-dialog__footer {
+ display: flex;
+ border-top: 1PX solid #EEEEEE;
+
+ .cancel-btn, .confirm-btn {
+ flex: 1;
+ height: 100px;
+ line-height: 100px;
+ font-size: 33px;
+ background: transparent;
+ border: none;
+ border-radius: 0;
+ padding: 0;
+ margin: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .cancel-btn {
+ color: #8B8B8B;
+ }
+
+ .confirm-btn {
+ color: #03C175;
+ border-left: 1PX solid #EEEEEE;
+ }
+ }
+ }
}
}
diff --git a/src/pages/scan/index.tsx b/src/pages/scan/index.tsx
index 3ffa3ef..1e730b5 100644
--- a/src/pages/scan/index.tsx
+++ b/src/pages/scan/index.tsx
@@ -4,9 +4,13 @@
import { View, Text, Button } from '@tarojs/components'
import Taro, { useLoad } from '@tarojs/taro'
import { observer } from 'mobx-react'
+import { useState } from 'react'
+import { Dialog } from '@taroify/core'
import './index.scss'
const ScanIndex = observer(() => {
+ const [showUnsettledDialog, setShowUnsettledDialog] = useState(false)
+
useLoad(() => {
console.log('扫码页面加载')
})
@@ -48,6 +52,19 @@ const ScanIndex = observer(() => {
})
}
+ // 打开未结算订单弹窗
+ const handleUnsettledOrders = () => {
+ setShowUnsettledDialog(true)
+ }
+
+ // 去结算
+ const handleGoToSettle = () => {
+ setShowUnsettledDialog(false)
+ Taro.navigateTo({
+ url: '/pagesUser/unsettledOrders/index'
+ })
+ }
+
return (
@@ -66,7 +83,32 @@ const ScanIndex = observer(() => {
+
+
+ {/* 未结算订单提示弹窗 */}
+
)
})
diff --git a/src/pagesUser/unsettledOrders/index.scss b/src/pagesUser/unsettledOrders/index.scss
index aa5dddd..84506b0 100644
--- a/src/pagesUser/unsettledOrders/index.scss
+++ b/src/pagesUser/unsettledOrders/index.scss
@@ -2,4 +2,102 @@
min-height: 100vh;
background-color: #F2F3F5;
padding: 30px;
+
+ // 空数据
+ .empty-data {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 150px 0;
+
+ .empty-image {
+ width: 300px;
+ height: 300px;
+ margin-bottom: 30px;
+ }
+
+ .empty-text {
+ font-size: 30px;
+ color: #999999;
+ }
+ }
+
+ // 订单列表
+ .order-list {
+ // 订单卡片
+ .order-card {
+ background-color: #FFFFFF;
+ border-radius: 12px;
+ padding: 30px;
+ margin-bottom: 30px;
+
+ // 标题行
+ .card-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 30px;
+
+ .order-type {
+ font-size: 33px;
+ color: #333333;
+ font-weight: bold;
+ }
+
+ .detail-btn {
+ display: flex;
+ align-items: center;
+ gap: 5px;
+
+ .detail-text {
+ font-size: 33px;
+ color: #8B8B8B;
+ }
+ }
+ }
+
+ // 订单信息
+ .card-info {
+ display: flex;
+ flex-direction: column;
+ gap: 20px;
+ margin-bottom: 30px;
+
+ .info-row {
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+
+ .info-label {
+ font-size: 30px;
+ color: #333333;
+ flex-shrink: 0;
+ }
+
+ .info-value {
+ font-size: 30px;
+ color: #595959;
+ text-align: right;
+ word-break: break-all;
+ }
+ }
+ }
+
+ // 立即支付按钮
+ .pay-btn {
+ width: 100%;
+ height: 88px;
+ background: #03C175;
+ border-radius: 12px;
+ border: none;
+ font-weight: 400;
+ font-size: 31px;
+ color: #FFFFFF;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ }
+ }
}
diff --git a/src/pagesUser/unsettledOrders/index.tsx b/src/pagesUser/unsettledOrders/index.tsx
index 0ccbec1..fac65e7 100644
--- a/src/pagesUser/unsettledOrders/index.tsx
+++ b/src/pagesUser/unsettledOrders/index.tsx
@@ -1,18 +1,104 @@
/**
* 未结算账单页
*/
-import { View, Text } from '@tarojs/components'
-import { useLoad } from '@tarojs/taro'
+import { View, Text, Image, Button } from '@tarojs/components'
+import { useState } from 'react'
+import Taro, { useLoad } from '@tarojs/taro'
+import { Divider } from '@taroify/core'
+import { Arrow } from '@taroify/icons'
import './index.scss'
+const noDataImg = require('../../assets/big/noData.png')
+
+// 未结算订单数据接口
+interface UnsettledOrderItem {
+ id: string
+ type: string // 台球 / 自助售货机
+ amount: number // 消费金额
+ consumeTime: string // 消费时间
+ orderNo: string // 订单号
+ storeName: string // 门店
+ address: string // 地址
+}
+
const UnsettledOrders = () => {
+ // 模拟未结算订单数据
+ const [orderList] = useState([])
+
useLoad(() => {
console.log('未结算账单页面加载')
})
+ // 点击详情
+ const handleDetailClick = (orderId: string) => {
+ console.log('查看订单详情', orderId)
+ Taro.navigateTo({
+ url: `/pagesUser/orderDetail/index?orderId=${orderId}`
+ })
+ }
+
+ // 立即支付
+ const handlePay = (orderId: string) => {
+ console.log('立即支付', orderId)
+ Taro.showToast({
+ title: '跳转支付',
+ icon: 'none'
+ })
+ }
+
return (
- 未结算账单
+ {orderList.length === 0 ? (
+
+
+ 没有数据哦~
+
+ ) : (
+
+ {orderList.map(order => (
+
+ {/* 标题行 */}
+
+ {order.type}
+ handleDetailClick(order.id)}>
+ 详情
+
+
+
+
+
+ {/* 订单信息 */}
+
+
+ 消费金额
+ {order.amount.toFixed(2)}元
+
+
+ 消费时间
+ {order.consumeTime}
+
+
+ 订单号
+ {order.orderNo}
+
+
+ 门店
+ {order.storeName}
+
+
+ 地址
+ {order.address}
+
+
+
+ {/* 立即支付按钮 */}
+
+
+ ))}
+
+ )}
)
}