Publish Mini Program Dev Version / publish (push) Successful in 2m8s
【重要修复】重写农历双向转换算法(原来全错): - solarToLunar/lunarToSolar 改用标准算法(基准1900-01-31正月初一,UTC避免时区误差) - 验证:2026春节2-17、中秋9-25、端午6-19、2023闰二月全部正确 【首页大日历】 - 日期数字加大到240rpx,超醒目 - 节假日红色喜庆卡片+红数字(春节/国庆/中秋等法定假日) - 工作日绿色卡片+绿数字(一眼知道要上班) - 周末红色数字+米黄卡片 - 节气显示具体时刻(如 立秋 20:29) - 初一/十五金色标记(可在设置关闭) - 佛历提醒:距下一佛诞还有几天(可在设置开启) 【全屏放大弹窗(老年友好)】 - 大日历卡片/宜忌/详情/节日速查 点击均可全屏放大 - 宜忌放大后字号44rpx,详情放大后40rpx 【月历视图】 - swiper 左右滑动换月,预计算5个月居中显示 - 滑到边缘自动补月,可无限滚动 - 点选日期切回日视图 【节日速查】 - 首页显示近期5个节日(中秋/重阳等)+公历日期+倒计时 - 点击直接跳到该日老黄历 【设置页】 - 新增'显示佛历提醒'开关(默认关) - 新增'初一十五高亮'开关(默认开)
110 lines
3.7 KiB
Plaintext
110 lines
3.7 KiB
Plaintext
<view class="container">
|
||
<!-- 全屏画布 -->
|
||
<canvas
|
||
canvas-id="wishTree"
|
||
class="wish-tree-canvas"
|
||
style="width: {{canvasWidth}}px; height: {{canvasHeight}}px;"
|
||
bindtouchstart="onCanvasTouch"
|
||
></canvas>
|
||
|
||
<!-- 顶部导航 -->
|
||
<view class="top-bar">
|
||
<view class="tree-switcher">
|
||
<view class="switch-btn" bindtap="switchTree" data-direction="prev">
|
||
<text class="switch-icon">‹</text>
|
||
</view>
|
||
<view class="tree-name">{{trees[currentTreeIndex].name || '许愿树'}}</view>
|
||
<view class="switch-btn" bindtap="switchTree" data-direction="next">
|
||
<text class="switch-icon">›</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 传感器控制 -->
|
||
<view class="sensor-controls">
|
||
<view class="sensor-btn {{micEnabled ? 'active' : ''}}" bindtap="enableMicrophone">
|
||
<text class="sensor-icon">🎤</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 许愿按钮 -->
|
||
<view class="action-bar">
|
||
<button class="btn-wish" bindtap="openCreateModal">
|
||
<text class="icon">🙏</text>
|
||
<text>我要许愿</text>
|
||
</button>
|
||
</view>
|
||
|
||
<!-- 许愿弹窗 -->
|
||
<view class="modal" wx:if="{{showCreateModal}}">
|
||
<view class="modal-mask" bindtap="closeCreateModal"></view>
|
||
<view class="modal-content">
|
||
<view class="modal-header">
|
||
<text class="modal-title">许下心愿</text>
|
||
<text class="modal-close" bindtap="closeCreateModal">×</text>
|
||
</view>
|
||
|
||
<view class="modal-body">
|
||
<!-- 许愿类型选择 -->
|
||
<view class="type-selector">
|
||
<view
|
||
class="type-item {{wishType === 'free' ? 'active' : ''}}"
|
||
bindtap="selectType"
|
||
data-type="free"
|
||
>
|
||
<text class="type-name">免费许愿</text>
|
||
<text class="type-desc">20字以内</text>
|
||
</view>
|
||
<view
|
||
class="type-item {{wishType === 'paid' ? 'active' : ''}}"
|
||
bindtap="selectType"
|
||
data-type="paid"
|
||
>
|
||
<text class="type-name">付费许愿</text>
|
||
<text class="type-desc">更多特权</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 许愿内容输入 -->
|
||
<textarea
|
||
class="wish-input"
|
||
placeholder="请输入你的愿望..."
|
||
maxlength="{{wishType === 'free' ? maxFreeLength : maxPaidLength}}"
|
||
bindinput="onInputContent"
|
||
value="{{wishContent}}"
|
||
></textarea>
|
||
<view class="input-count">
|
||
{{wishContent.length}}/{{wishType === 'free' ? maxFreeLength : maxPaidLength}}
|
||
</view>
|
||
|
||
<!-- 付费商品选择 -->
|
||
<view class="product-section" wx:if="{{wishType === 'paid'}}">
|
||
<view class="section-title">选择许愿商品</view>
|
||
<view class="product-list">
|
||
<view
|
||
wx:for="{{products}}"
|
||
wx:key="id"
|
||
class="product-item {{selectedProduct && selectedProduct.id === item.id ? 'active' : ''}}"
|
||
bindtap="selectProduct"
|
||
data-id="{{item.id}}"
|
||
>
|
||
<view class="product-info">
|
||
<text class="product-name">{{item.name}}</text>
|
||
<text class="product-desc">展示{{item.duration}}天</text>
|
||
</view>
|
||
<view class="product-price">¥{{item.price / 100}}</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="modal-footer">
|
||
<button class="btn-outline" bindtap="closeCreateModal">取消</button>
|
||
<button class="btn-primary" bindtap="submitWish">
|
||
{{wishType === 'paid' ? '支付并许愿' : '提交许愿'}}
|
||
</button>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|