5 changed files with 517 additions and 4 deletions
@ -0,0 +1,5 @@ |
|||||||
|
export default { |
||||||
|
navigationBarTitleText: '续费', |
||||||
|
navigationBarBackgroundColor: '#FFFFFF', |
||||||
|
navigationBarTextStyle: 'black', |
||||||
|
} |
||||||
@ -0,0 +1,326 @@ |
|||||||
|
.renew-fee-page { |
||||||
|
min-height: 100vh; |
||||||
|
background-color: #F2F3F5; |
||||||
|
padding-bottom: calc(120px + env(safe-area-inset-bottom)); // 为底部按钮留空间 |
||||||
|
|
||||||
|
// 内容区域 |
||||||
|
.content-area { |
||||||
|
padding: 30px; |
||||||
|
|
||||||
|
// 台球桌信息卡片 |
||||||
|
.table-card { |
||||||
|
background: url('../startTable/images/startBiliardCardBg.png') no-repeat center; |
||||||
|
background-size: cover; |
||||||
|
height: 190px; |
||||||
|
border-radius: 12px; |
||||||
|
padding: 24px; |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
justify-content: space-between; |
||||||
|
margin-bottom: 40px; |
||||||
|
|
||||||
|
// 顶部:类型和电话 |
||||||
|
.card-header { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: space-between; |
||||||
|
|
||||||
|
.table-type { |
||||||
|
font-size: 25px; |
||||||
|
color: #FFFFFF; |
||||||
|
} |
||||||
|
|
||||||
|
.phone-box { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
gap: 8px; |
||||||
|
|
||||||
|
.phone-icon { |
||||||
|
width: 28px; |
||||||
|
height: 28px; |
||||||
|
} |
||||||
|
|
||||||
|
.phone-text { |
||||||
|
font-size: 25px; |
||||||
|
color: #FFFFFF; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// 台球桌标题和使用状态 |
||||||
|
.table-title-row { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
gap: 20px; |
||||||
|
|
||||||
|
.table-title { |
||||||
|
font-weight: bold; |
||||||
|
font-size: 42px; |
||||||
|
color: #FFFFFF; |
||||||
|
line-height: 1.3; |
||||||
|
} |
||||||
|
|
||||||
|
.table-status { |
||||||
|
font-size: 42px; |
||||||
|
color: #01CA68; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 1.3; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// 位置信息 |
||||||
|
.location-info { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
gap: 8px; |
||||||
|
|
||||||
|
.location-icon { |
||||||
|
width: 28px; |
||||||
|
height: 28px; |
||||||
|
} |
||||||
|
|
||||||
|
.location-text { |
||||||
|
font-size: 25px; |
||||||
|
color: #FFFFFF; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// 开台订单信息卡片 |
||||||
|
.order-info-card { |
||||||
|
background-color: #FFFFFF; |
||||||
|
border-radius: 12px; |
||||||
|
padding: 30px; |
||||||
|
margin-bottom: 30px; |
||||||
|
|
||||||
|
// 顶部:开台方式 |
||||||
|
.order-header { |
||||||
|
margin-bottom: 30px; |
||||||
|
|
||||||
|
.order-tag { |
||||||
|
background-color: transparent; |
||||||
|
border: 1px solid #FF6B00; |
||||||
|
border-radius: 4px; |
||||||
|
padding: 6px 12px; |
||||||
|
display: inline-block; |
||||||
|
|
||||||
|
.tag-text { |
||||||
|
font-size: 25px; |
||||||
|
color: #FF6B00; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// 订单统计 |
||||||
|
.order-stats { |
||||||
|
display: flex; |
||||||
|
justify-content: space-around; |
||||||
|
|
||||||
|
.stat-item { |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
align-items: center; |
||||||
|
gap: 20px; |
||||||
|
|
||||||
|
.stat-value { |
||||||
|
font-size: 37px; |
||||||
|
color: #000000; |
||||||
|
font-weight: 500; |
||||||
|
} |
||||||
|
|
||||||
|
.stat-label { |
||||||
|
font-size: 25px; |
||||||
|
color: #8D8D8D; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// 收费规则 |
||||||
|
.pricing-rules { |
||||||
|
padding-top: 30px; |
||||||
|
border-top: 1px solid #F2F3F5; |
||||||
|
|
||||||
|
.rules-content { |
||||||
|
background-color: #F2F3F5; |
||||||
|
border-radius: 13px; |
||||||
|
padding: 30px; |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
gap: 25px; |
||||||
|
|
||||||
|
.rules-title { |
||||||
|
font-weight: 400; |
||||||
|
font-size: 29px; |
||||||
|
color: #000000; |
||||||
|
} |
||||||
|
|
||||||
|
.price-row { |
||||||
|
display: flex; |
||||||
|
justify-content: space-between; |
||||||
|
align-items: center; |
||||||
|
|
||||||
|
.price-item { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
gap: 4px; |
||||||
|
|
||||||
|
.price-label { |
||||||
|
font-size: 25px; |
||||||
|
color: #8B8B8B; |
||||||
|
} |
||||||
|
|
||||||
|
.price-value { |
||||||
|
font-size: 25px; |
||||||
|
color: #333333; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// 续费金额卡片 |
||||||
|
.renew-card { |
||||||
|
background-color: #FFFFFF; |
||||||
|
border-radius: 12px; |
||||||
|
padding: 34px 30px; |
||||||
|
margin-bottom: 30px; |
||||||
|
|
||||||
|
// 续费金额输入 |
||||||
|
.renew-input-row { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: space-between; |
||||||
|
margin-bottom: 30px; |
||||||
|
|
||||||
|
.renew-label { |
||||||
|
font-size: 31px; |
||||||
|
color: #000000; |
||||||
|
} |
||||||
|
|
||||||
|
.renew-stepper { |
||||||
|
// 输入框相关 |
||||||
|
--stepper-input-width: 100px; |
||||||
|
--stepper-input-height: 56px; |
||||||
|
--stepper-input-font-size: 31px; |
||||||
|
--stepper-input-color: #000000; |
||||||
|
--stepper-input-background-color: #FFFFFF; |
||||||
|
|
||||||
|
// 圆形风格 - 减号按钮 |
||||||
|
--stepper-circular-decrease-button-color: #FFFFFF; |
||||||
|
--stepper-circular-decrease-button-background-color: #565B66; |
||||||
|
--stepper-circular-decrease-button-border-color: #565B66; |
||||||
|
|
||||||
|
// 圆形风格 - 加号按钮 |
||||||
|
--stepper-circular-increase-button-color: #FFFFFF; |
||||||
|
--stepper-circular-increase-button-background-color: #565B66; |
||||||
|
--stepper-circular-increase-button-border-color: #565B66; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// 分割线 |
||||||
|
.divider { |
||||||
|
height: 1px; |
||||||
|
background-color: #E8E8E8; |
||||||
|
margin: 30px 0; |
||||||
|
} |
||||||
|
|
||||||
|
// 续费时长 |
||||||
|
.duration-row { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: space-between; |
||||||
|
|
||||||
|
.duration-label { |
||||||
|
font-size: 31px; |
||||||
|
color: #000000; |
||||||
|
} |
||||||
|
|
||||||
|
.duration-value { |
||||||
|
font-size: 31px; |
||||||
|
color: #000000; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// 支付方式 |
||||||
|
.payment-cell { |
||||||
|
background-color: #FFFFFF; |
||||||
|
border-radius: 12px; |
||||||
|
padding: 30px; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: space-between; |
||||||
|
margin-bottom: 30px; |
||||||
|
|
||||||
|
.payment-label { |
||||||
|
font-size: 31px; |
||||||
|
color: #000000; |
||||||
|
} |
||||||
|
|
||||||
|
.payment-right { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
gap: 8px; |
||||||
|
|
||||||
|
.payment-value { |
||||||
|
font-size: 31px; |
||||||
|
color: #000000; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// 底部固定区域 |
||||||
|
.footer-bar { |
||||||
|
position: fixed; |
||||||
|
bottom: 0; |
||||||
|
left: 0; |
||||||
|
right: 0; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: space-between; |
||||||
|
padding: 20px 30px; |
||||||
|
padding-bottom: calc(20px + env(safe-area-inset-bottom)); |
||||||
|
background-color: #FFFFFF; |
||||||
|
box-shadow: 0px -2px 10px rgba(0, 0, 0, 0.1); |
||||||
|
|
||||||
|
.payment-info { |
||||||
|
display: flex; |
||||||
|
align-items: baseline; |
||||||
|
|
||||||
|
.payment-label { |
||||||
|
font-size: 28px; |
||||||
|
color: #000000; |
||||||
|
margin-right: 8px; |
||||||
|
} |
||||||
|
|
||||||
|
.payment-symbol { |
||||||
|
font-size: 28px; |
||||||
|
color: #000000; |
||||||
|
} |
||||||
|
|
||||||
|
.payment-amount { |
||||||
|
font-size: 45px; |
||||||
|
color: #000000; |
||||||
|
font-weight: 500; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.confirm-btn { |
||||||
|
width: 200px; |
||||||
|
height: 88px; |
||||||
|
background-color: #01CA68; |
||||||
|
border-radius: 44px; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: center; |
||||||
|
|
||||||
|
.confirm-text { |
||||||
|
font-size: 33px; |
||||||
|
color: #FFFFFF; |
||||||
|
font-weight: 500; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,183 @@ |
|||||||
|
/** |
||||||
|
* 续费页面 |
||||||
|
*/ |
||||||
|
import { View, Text, Image } from '@tarojs/components' |
||||||
|
import Taro, { useLoad } from '@tarojs/taro' |
||||||
|
import { useState } from 'react' |
||||||
|
import { Stepper } from '@taroify/core' |
||||||
|
import './index.scss' |
||||||
|
|
||||||
|
// 使用本地图片资源
|
||||||
|
const phoneIcon = require('../startTable/images/phone.png') |
||||||
|
const locationIcon = require('../../assets/icon/locationIcon.png') |
||||||
|
|
||||||
|
const RenewFee = () => { |
||||||
|
const [renewAmount, setRenewAmount] = useState(1000) // 续费金额
|
||||||
|
const [paymentMethod] = useState('微信支付') // 支付方式
|
||||||
|
|
||||||
|
useLoad(() => { |
||||||
|
console.log('续费页面加载') |
||||||
|
}) |
||||||
|
|
||||||
|
// 拨打电话
|
||||||
|
const handlePhoneCall = () => { |
||||||
|
Taro.makePhoneCall({ |
||||||
|
phoneNumber: '100-666-XXXX', |
||||||
|
}).catch((err) => { |
||||||
|
console.error('拨打电话失败:', err) |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
// 续费金额变化
|
||||||
|
const handleRenewAmountChange = (value: number) => { |
||||||
|
setRenewAmount(value) |
||||||
|
} |
||||||
|
|
||||||
|
// 计算续费时长(以小时为单位,假设 28.8元/小时)
|
||||||
|
const calculateDuration = () => { |
||||||
|
const hours = Math.floor(renewAmount / 28.8) |
||||||
|
const minutes = Math.round((renewAmount / 28.8 - hours) * 60) |
||||||
|
return `约${hours}小时${minutes}分钟` |
||||||
|
} |
||||||
|
|
||||||
|
// 选择支付方式
|
||||||
|
const handleSelectPayment = () => { |
||||||
|
Taro.showToast({ |
||||||
|
title: '暂时只支持微信支付', |
||||||
|
icon: 'none', |
||||||
|
duration: 2000 |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
// 立即续费
|
||||||
|
const handleConfirmRenew = () => { |
||||||
|
console.log('立即续费,金额:', renewAmount) |
||||||
|
Taro.showToast({ |
||||||
|
title: '功能开发中', |
||||||
|
icon: 'none', |
||||||
|
duration: 2000 |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
return ( |
||||||
|
<View className="renew-fee-page"> |
||||||
|
{/* 内容区域 */} |
||||||
|
<View className="content-area"> |
||||||
|
{/* 台球桌信息卡片 */} |
||||||
|
<View className="table-card"> |
||||||
|
{/* 顶部:类型和店名 */} |
||||||
|
<View className="card-header"> |
||||||
|
<Text className="table-type">中式台球</Text> |
||||||
|
<View className="phone-box" onClick={handlePhoneCall}> |
||||||
|
<Image className="phone-icon" src={phoneIcon} mode="aspectFit" /> |
||||||
|
<Text className="phone-text">联系店长</Text> |
||||||
|
</View> |
||||||
|
</View> |
||||||
|
|
||||||
|
{/* 台球桌标题和使用状态 */} |
||||||
|
<View className="table-title-row"> |
||||||
|
<Text className="table-title">来力.山岩-A03/3号球桌</Text> |
||||||
|
<Text className="table-status">使用中...</Text> |
||||||
|
</View> |
||||||
|
|
||||||
|
{/* 位置信息 */} |
||||||
|
<View className="location-info"> |
||||||
|
<Image className="location-icon" src={locationIcon} mode="aspectFit" /> |
||||||
|
<Text className="location-text">北京黑八大师联盟球厅店</Text> |
||||||
|
</View> |
||||||
|
</View> |
||||||
|
|
||||||
|
{/* 开台订单信息卡片 */} |
||||||
|
<View className="order-info-card"> |
||||||
|
{/* 开台方式标签 */} |
||||||
|
<View className="order-header"> |
||||||
|
<View className="order-tag"> |
||||||
|
<Text className="tag-text">开台方式</Text> |
||||||
|
</View> |
||||||
|
</View> |
||||||
|
|
||||||
|
{/* 订单统计 */} |
||||||
|
<View className="order-stats"> |
||||||
|
<View className="stat-item"> |
||||||
|
<Text className="stat-value">1小时56分</Text> |
||||||
|
<Text className="stat-label">已消费时长</Text> |
||||||
|
</View> |
||||||
|
<View className="stat-item"> |
||||||
|
<Text className="stat-value">100.00元</Text> |
||||||
|
<Text className="stat-label">已消费金额</Text> |
||||||
|
</View> |
||||||
|
<View className="stat-item"> |
||||||
|
<Text className="stat-value">6分钟</Text> |
||||||
|
<Text className="stat-label">剩余时长</Text> |
||||||
|
</View> |
||||||
|
</View> |
||||||
|
|
||||||
|
{/* 收费规则 */} |
||||||
|
<View className="pricing-rules"> |
||||||
|
<View className="rules-content"> |
||||||
|
<Text className="rules-title">收费规则</Text> |
||||||
|
<View className="price-row"> |
||||||
|
<View className="price-item"> |
||||||
|
<Text className="price-label">价格:</Text> |
||||||
|
<Text className="price-value">90.00元/小时</Text> |
||||||
|
</View> |
||||||
|
<View className="price-item"> |
||||||
|
<Text className="price-label">折扣价:</Text> |
||||||
|
<Text className="price-value">80.00元/小时</Text> |
||||||
|
</View> |
||||||
|
</View> |
||||||
|
</View> |
||||||
|
</View> |
||||||
|
</View> |
||||||
|
|
||||||
|
{/* 续费金额卡片 */} |
||||||
|
<View className="renew-card"> |
||||||
|
{/* 续费金额输入 */} |
||||||
|
<View className="renew-input-row"> |
||||||
|
<Text className="renew-label">续费金额(元)</Text> |
||||||
|
<Stepper |
||||||
|
value={renewAmount} |
||||||
|
min={100} |
||||||
|
step={10} |
||||||
|
onChange={handleRenewAmountChange} |
||||||
|
shape="circular" |
||||||
|
size="27px" |
||||||
|
className="renew-stepper" |
||||||
|
/> |
||||||
|
</View> |
||||||
|
|
||||||
|
{/* 分割线 */} |
||||||
|
<View className="divider" /> |
||||||
|
|
||||||
|
{/* 续费时长 */} |
||||||
|
<View className="duration-row"> |
||||||
|
<Text className="duration-label">续费时长</Text> |
||||||
|
<Text className="duration-value">{calculateDuration()}</Text> |
||||||
|
</View> |
||||||
|
</View> |
||||||
|
|
||||||
|
{/* 支付方式 */} |
||||||
|
<View className="payment-cell" onClick={handleSelectPayment}> |
||||||
|
<Text className="payment-label">支付方式</Text> |
||||||
|
<View className="payment-right"> |
||||||
|
<Text className="payment-value">{paymentMethod}</Text> |
||||||
|
</View> |
||||||
|
</View> |
||||||
|
</View> |
||||||
|
|
||||||
|
{/* 底部固定区域 */} |
||||||
|
<View className="footer-bar"> |
||||||
|
<View className="payment-info"> |
||||||
|
<Text className="payment-label">需支付</Text> |
||||||
|
<Text className="payment-symbol">¥</Text> |
||||||
|
<Text className="payment-amount">{renewAmount.toFixed(2)}</Text> |
||||||
|
</View> |
||||||
|
<View className="confirm-btn" onClick={handleConfirmRenew}> |
||||||
|
<Text className="confirm-text">立即续费</Text> |
||||||
|
</View> |
||||||
|
</View> |
||||||
|
</View> |
||||||
|
) |
||||||
|
} |
||||||
|
|
||||||
|
export default RenewFee |
||||||
Loading…
Reference in new issue