feat: 新增商品详情搭配优惠组件和客服弹窗

refactor: 优化页面样式和交互逻辑

fix: 修复洗车券列表和详情页的数据展示问题

style: 调整用户页面按钮样式和布局

chore: 移除无用页面和代码,更新项目配置

docs: 更新单次启动页面的使用说明和注意事项

perf: 优化网络请求和数据处理逻辑

build: 更新依赖和配置文件

test: 更新测试用例以适应新功能

ci: 调整CI配置以适应新项目结构
This commit is contained in:
2026-01-03 11:26:51 +08:00
parent b80b33c81f
commit 95eed74b96
68 changed files with 1197 additions and 2036 deletions

View File

@@ -1,199 +0,0 @@
var t = getApp(), e = require("../../utils/login.js");
Page({
/**
* 页面的初始数据
*/
data: {
userInfo: {},
balance: 0,
loading: true,
paySuccess: false,
orderInfo: {},
token: '',
},
/**
* 生命周期函数--监听页面加载
*/
onShow(options) {
var a = this;
// 等待全局接口执行完成后再初始化页面
e.pageStart(t).then(function () {
a.initPage();
});
},
/**
* 初始化页面数据
*/
initPage() {
var a = this;
a.setData({
loading: true
});
e.request('/miniprogram/substituteWash/index', {}, true).then(function (res) {
a.setData({
loading: false
});
if (res.code === 200 && res.data) {
a.setData({
orderInfo: res.data.orderInfo || {},
balance: res.data.balance || 0,
token: res.data.token || '',
});
} else {
wx.showToast({
title: res.message || '获取数据失败',
icon: 'none',
duration: 2000
});
}
}).catch(function (err) {
a.setData({
loading: false
});
wx.showToast({
title: '获取数据失败',
icon: 'none',
duration: 2000
});
});
},
/**
* 确认洗车
*/
confirmWash() {
var a = this;
wx.showModal({
title: '确认洗车',
content: '确定要进行帮洗服务吗?',
success: (res) => {
if (res.confirm) {
a.payForWash();
}
}
});
},
/**
* 支付洗车费用
*/
payForWash() {
var a = this;
wx.showLoading({
title: '处理中',
mask: true
});
e.request('/miniprogram/substituteWash/pay', { token: a.data.token }, true).then(function (res) {
wx.hideLoading();
if (res.code === 200) {
wx.showToast({
title: '支付成功',
icon: 'success',
duration: 2000
});
// 更新余额信息和支付状态
let updateData = {
paySuccess: true
};
if (res.data && res.data.balance !== undefined) {
updateData.balance = res.data.balance;
}
if (res.data && res.data.orderInfo) {
updateData.orderInfo = res.data.orderInfo;
}
a.setData(updateData);
// 可以在这里添加支付成功后的其他操作
} else {
wx.showModal({
title: '支付失败',
content: res.message || '请稍后再试',
showCancel: false
});
}
}).catch(function (err) {
wx.hideLoading();
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 如果不是支付成功状态,则重新初始化页面
if (!this.data.paySuccess) {
var a = this;
e.pageStart(t).then(function () {
a.initPage();
});
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
var a = this;
e.pageStart(t).then(function () {
a.initPage();
wx.stopPullDownRefresh();
});
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 禁止页面分享
*/
onShareAppMessage: null,
/**
* 返回首页
*/
backToIndex() {
wx.redirectTo({
url: '/pages/index/index'
});
}
})

View File

@@ -1,8 +0,0 @@
{
"navigationBarTitleText": "帮洗服务",
"enablePullDownRefresh": true,
"backgroundColor": "#f8f8f8",
"usingComponents": {
"service-tel": "/template/serviceTel/serviceTel"
}
}

View File

@@ -1,109 +0,0 @@
<view class="container">
<!-- 加载中 -->
<view class="loading-container" wx:if="{{loading}}">
<view class="spinner">
<view class="spinner-container container1">
<view class="circle1"></view>
<view class="circle2"></view>
<view class="circle3"></view>
<view class="circle4"></view>
</view>
<view class="spinner-container container2">
<view class="circle1"></view>
<view class="circle2"></view>
<view class="circle3"></view>
<view class="circle4"></view>
</view>
<view class="spinner-container container3">
<view class="circle1"></view>
<view class="circle2"></view>
<view class="circle3"></view>
<view class="circle4"></view>
</view>
</view>
<view class="loading-text">加载中...</view>
</view>
<!-- 内容区域 -->
<view class="content" wx:else>
<!-- 支付成功界面 -->
<view class="success-content" wx:if="{{paySuccess}}">
<view class="success-icon">
<icon type="success" size="80"></icon>
</view>
<view class="success-title">支付成功</view>
<view class="success-info">
<view class="info-item">
<text class="label">洗车网点</text>
<text class="value">{{orderInfo.agentname || userInfo.nickname || '---'}}</text>
</view>
<view class="info-item">
<text class="label">订单编号</text>
<text class="value">{{orderInfo.orderNo || '---'}}</text>
</view>
<view class="info-item">
<text class="label">支付金额</text>
<text class="value highlight">{{orderInfo.amount || '0'}} 元</text>
</view>
<view class="info-item">
<text class="label">账户余额</text>
<text class="value balance">{{balance}} 元</text>
</view>
</view>
<view class="success-tips">
<view class="tips-title">温馨提示</view>
<view class="tips-content">
<view class="tips-item">1. 请向工作人员出示此页面</view>
<view class="tips-item">2. 确认支付成功后即可开始洗车服务</view>
<view class="tips-item">3. 如有疑问请联系客服</view>
</view>
</view>
<view class="btn-area">
<button class="back-btn" type="default" bindtap="backToIndex">返回首页</button>
</view>
</view>
<!-- 确认洗车界面 -->
<view class="confirm-content" wx:else>
<view class="header">
<view class="title">帮洗服务</view>
<view class="subtitle">让洗车更便捷</view>
</view>
<view class="user-info">
<view class="info-item">
<text class="label">洗车网点</text>
<text class="value">{{orderInfo.agentname || userInfo.nickname || '---'}}</text>
</view>
<view class="info-item">
<text class="label">洗车费用</text>
<text class="value">{{orderInfo.amount || '0'}} 元</text>
</view>
<view class="info-item">
<text class="label">账户余额</text>
<text class="value balance">{{balance}} 元</text>
</view>
</view>
<view class="wash-info">
<view class="wash-title">服务说明</view>
<view class="wash-desc">
<view class="desc-item">1. 帮洗服务由专业人员提供</view>
<view class="desc-item">2. 确认后将从您的账户余额中扣除相应费用</view>
<view class="desc-item">3. 服务完成后可在订单中查看详情</view>
</view>
</view>
<view class="btn-area">
<button class="confirm-btn" type="primary" bindtap="confirmWash">确认洗车</button>
</view>
</view>
</view>
<!-- 客服电话组件 -->
<service-tel></service-tel>
</view>

View File

@@ -1,292 +0,0 @@
.container {
padding: 0;
font-size: 28rpx;
background-color: #f8f8f8;
min-height: 100vh;
border: none;
}
/* 加载动画 */
.loading-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
.spinner {
margin: 0 auto;
width: 120rpx;
height: 120rpx;
position: relative;
}
.spinner .spinner-container {
position: absolute;
width: 100%;
height: 100%;
}
.container1 > view, .container2 > view, .container3 > view {
width: 20rpx;
height: 20rpx;
background-color: #1aad19;
border-radius: 100%;
position: absolute;
-webkit-animation: bouncedelay 1.2s infinite ease-in-out;
animation: bouncedelay 1.2s infinite ease-in-out;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.container2 {
-webkit-transform: rotateZ(45deg);
transform: rotateZ(45deg);
}
.container3 {
-webkit-transform: rotateZ(90deg);
transform: rotateZ(90deg);
}
.circle1 { top: 0; left: 0; }
.circle2 { top: 0; right: 0; }
.circle3 { right: 0; bottom: 0; }
.circle4 { left: 0; bottom: 0; }
.container1 .circle1 {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s;
}
.container2 .circle1 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
.container3 .circle1 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s;
}
.container1 .circle2 {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s;
}
.container2 .circle2 {
-webkit-animation-delay: -0.7s;
animation-delay: -0.7s;
}
.container3 .circle2 {
-webkit-animation-delay: -0.6s;
animation-delay: -0.6s;
}
.container1 .circle3 {
-webkit-animation-delay: -0.5s;
animation-delay: -0.5s;
}
.container2 .circle3 {
-webkit-animation-delay: -0.4s;
animation-delay: -0.4s;
}
.container3 .circle3 {
-webkit-animation-delay: -0.3s;
animation-delay: -0.3s;
}
.container1 .circle4 {
-webkit-animation-delay: -0.2s;
animation-delay: -0.2s;
}
.container2 .circle4 {
-webkit-animation-delay: -0.1s;
animation-delay: -0.1s;
}
.container3 .circle4 {
-webkit-animation-delay: 0s;
animation-delay: 0s;
}
@-webkit-keyframes bouncedelay {
0%, 80%, 100% { -webkit-transform: scale(0.0) }
40% { -webkit-transform: scale(1.0) }
}
@keyframes bouncedelay {
0%, 80%, 100% {
transform: scale(0.0);
-webkit-transform: scale(0.0);
} 40% {
transform: scale(1.0);
-webkit-transform: scale(1.0);
}
}
.loading-text {
margin-top: 30rpx;
color: #999;
}
/* 内容区域 */
.content {
padding: 30rpx;
}
.header {
text-align: center;
margin-bottom: 60rpx;
padding-top: 40rpx;
}
.title {
font-size: 48rpx;
font-weight: bold;
color: #333;
}
.subtitle {
font-size: 28rpx;
color: #666;
margin-top: 10rpx;
}
.user-info {
background-color: #fff;
border-radius: 12rpx;
padding: 0 30rpx;
margin-bottom: 30rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
}
.info-item {
display: flex;
justify-content: space-between;
padding: 20rpx 0;
border-bottom: 1rpx solid #f0f0f0;
}
.info-item:last-child {
border-bottom: none;
}
.label {
color: #666;
}
.value {
color: #333;
font-weight: 500;
}
.balance {
color: #1aad19;
font-weight: bold;
font-size: 32rpx;
}
.wash-info {
background-color: #fff;
border-radius: 12rpx;
padding: 30rpx;
margin-bottom: 60rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
}
.wash-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;
}
.wash-desc {
color: #666;
}
.desc-item {
line-height: 1.8;
margin-bottom: 10rpx;
}
.btn-area {
padding: 40rpx 60rpx;
}
.confirm-btn {
width: 100%;
height: 88rpx;
line-height: 88rpx;
font-size: 32rpx;
border-radius: 44rpx;
background-color: #1aad19;
}
/* 支付成功样式 */
.success-content {
display: flex;
flex-direction: column;
align-items: center;
padding: 30rpx;
}
.success-icon {
margin: 40rpx 0;
}
.success-title {
font-size: 48rpx;
font-weight: bold;
color: #1aad19;
margin-bottom: 60rpx;
}
.success-info {
width: 100%;
background-color: #fff;
border-radius: 12rpx;
padding: 0 30rpx;
margin-bottom: 30rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
}
.highlight {
color: #ff6600;
font-weight: bold;
font-size: 32rpx;
}
.success-tips {
width: 100%;
background-color: #fff;
border-radius: 12rpx;
padding: 30rpx;
margin-bottom: 30rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
}
.tips-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;
}
.tips-content {
color: #666;
}
.tips-item {
line-height: 1.8;
margin-bottom: 10rpx;
}
.back-btn {
width: 100%;
height: 88rpx;
line-height: 88rpx;
font-size: 32rpx;
border-radius: 44rpx;
background-color: #f8f8f8;
color: #333;
border: 1rpx solid #ddd;
}