feat: 增加小程序服务预约和订单页面

This commit is contained in:
que01 committed 2026-09-19 10:37:51 +08:00
1 parent 63e5e3bd7b
commit 6a66d20b81
14 files changed
+41 -1

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
const API='http://localhost:3001';
Page({data:{loading:true,bookings:[]},onLoad(){this.load()},onShow(){this.load()},load(){const token=wx.getStorageSync('customerToken');if(!token){this.setData({loading:false});return}wx.request({url:API+'/customer/bookings',header:{Authorization:'Bearer '+token},success:r=>this.setData({bookings:r.data,loading:false}),fail:()=>this.setData({loading:false})})}});
+1
View File
@@ -0,0 +1 @@
{"navigationBarTitleText":"我的订单","navigationBarBackgroundColor":"#FBF7F1","navigationBarTextStyle":"black"}
+1
View File
@@ -0,0 +1 @@
<view class="page"><view class="heading">我的订单</view><view wx:if="{{loading}}" class="state">加载中...</view><view wx:elif="{{!bookings.length}}" class="empty">完成预约后,订单会显示在这里</view><view wx:else><view wx:for="{{bookings}}" wx:key="id" class="card"><view class="status">{{item.status}}</view><text class="name">{{item.bookingNo}}</text><text>{{item.customerName}}</text><text class="price">{{item.estimatedAmount ? '¥'+item.estimatedAmount/100 : '人工沟通报价'}}</text></view></view></view>
+1
View File
@@ -0,0 +1 @@
.page{min-height:100vh;padding:24rpx 32rpx;background:#FBF7F1;color:#2B2B2B}.heading{font-size:48rpx;font-weight:700;margin:12rpx 0 32rpx}.card{position:relative;margin-bottom:18rpx;padding:30rpx;background:#F4EBD9;border-radius:32rpx}.name{display:block;font-size:32rpx;font-weight:700;margin-bottom:12rpx}.status{position:absolute;right:28rpx;top:28rpx;color:#B54A2C}.price{display:block;margin-top:18rpx;color:#B54A2C;font-size:34rpx}.state,.empty{text-align:center;padding:100rpx 20rpx;color:#7A4A2B}