feat: 新增商品详情搭配优惠组件和客服弹窗
refactor: 优化页面样式和交互逻辑 fix: 修复洗车券列表和详情页的数据展示问题 style: 调整用户页面按钮样式和布局 chore: 移除无用页面和代码,更新项目配置 docs: 更新单次启动页面的使用说明和注意事项 perf: 优化网络请求和数据处理逻辑 build: 更新依赖和配置文件 test: 更新测试用例以适应新功能 ci: 调整CI配置以适应新项目结构
This commit is contained in:
@@ -1,149 +0,0 @@
|
||||
var t = require("../../utils/login.js");
|
||||
|
||||
Page({
|
||||
data: {
|
||||
userInfo: {
|
||||
mobile: '',
|
||||
uid: '',
|
||||
givenamount: "0.00",
|
||||
money: "0.00",
|
||||
principal: "0.00",
|
||||
}, // 用户查询结果
|
||||
list: [], // 退款记录列表
|
||||
showResult: false // 控制查询结果显示
|
||||
},
|
||||
|
||||
onSubmitToGroup(e) {
|
||||
const mobile = e.detail.value.code
|
||||
if (!mobile) {
|
||||
wx.showToast({
|
||||
title: '请输入手机号码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 手机号格式验证
|
||||
if (!/^1[3-9]\d{9}$/.test(mobile)) {
|
||||
wx.showToast({
|
||||
title: '请输入正确的手机号码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
wx.showLoading({
|
||||
title: '查询中...'
|
||||
})
|
||||
|
||||
t.request('/miniprogram/refund/query', { mobile }, !0).then((res) => {
|
||||
wx.hideLoading()
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
userInfo: res.data.user,
|
||||
list: res.data.list,
|
||||
showResult: true
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.message || '查询失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 线上退款
|
||||
onSubmitToGroup1() {
|
||||
wx.showModal({
|
||||
title: '确认退款',
|
||||
content: '确定退款,将清零用户赠送金额,退还本金',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
wx.showLoading({
|
||||
title: '退款中...'
|
||||
})
|
||||
if (!this.data.userInfo.recharge || !this.data.userInfo.token) {
|
||||
wx.showToast({
|
||||
title: '退款信息不完整',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
t.request('/miniprogram/pay/refund', {token: this.data.userInfo.token}, !0).then((res) => {
|
||||
wx.hideLoading()
|
||||
if (res.code == 200) {
|
||||
wx.showToast({
|
||||
title: '退款成功',
|
||||
icon: 'success'
|
||||
})
|
||||
// 刷新页面数据
|
||||
this.setData({
|
||||
showResult: false,
|
||||
userInfo: {
|
||||
mobile: '',
|
||||
uid: '',
|
||||
givenamount: "0.00",
|
||||
money: "0.00",
|
||||
principal: "0.00"
|
||||
}
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.message || '退款失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 线下退款
|
||||
onSubmitToGroup2() {
|
||||
wx.showModal({
|
||||
title: '确认退款',
|
||||
content: `确定退款金额:${this.data.userInfo.money}元`,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
wx.showLoading({
|
||||
title: '退款中...'
|
||||
})
|
||||
if (!this.data.userInfo.token) {
|
||||
wx.showToast({
|
||||
title: '退款信息不完整',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
t.request('/miniprogram/pay/refundOffline', {token: this.data.userInfo.token}, !0).then((res) => {
|
||||
wx.hideLoading()
|
||||
if (res.code == 200) {
|
||||
wx.showToast({
|
||||
title: '退款成功',
|
||||
icon: 'success'
|
||||
})
|
||||
// 刷新页面数据
|
||||
this.setData({
|
||||
showResult: false,
|
||||
userInfo: {
|
||||
mobile: '',
|
||||
uid: '',
|
||||
givenamount: "0.00",
|
||||
money: "0.00",
|
||||
principal: "0.00"
|
||||
}
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.message || '退款失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
<view class="contain">
|
||||
<view class="content">
|
||||
<view class="title">退款</view>
|
||||
<form bindsubmit="onSubmitToGroup"> <!-- 查询前 -->
|
||||
<input class="input" name="code" auto-focus placeholder="请填写用户手机号码"/>
|
||||
<button class="button" form-type="submit" type="primary">查询用户订单</button>
|
||||
</form>
|
||||
|
||||
<!-- 显示用户信息 .userInfo -->
|
||||
<view class="userInfo" wx:if="{{showResult && userInfo}}">
|
||||
<view class="info">
|
||||
<view>手机号:<text>{{userInfo.mobile}}</text></view>
|
||||
<view>用户ID:<text>{{userInfo.uid}}</text></view>
|
||||
<view class="balance-info">
|
||||
<view class="balance-item">
|
||||
<view class="label">总余额</view>
|
||||
<view class="value r">{{userInfo.money}}</view>
|
||||
</view>
|
||||
<view class="balance-item">
|
||||
<view class="label">洗车金</view>
|
||||
<view class="value g">{{userInfo.principal}}</view>
|
||||
</view>
|
||||
<view class="balance-item">
|
||||
<view class="label">赠送金额</view>
|
||||
<view class="value b">{{userInfo.givenamount}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<block wx:if="{{showResult && userInfo}}">
|
||||
<form bindsubmit="onSubmitToGroup1" wx:if="{{userInfo.refundType === 'online'}}"> <!-- 查询后 线上退款 -->
|
||||
<view class="info">
|
||||
<view>本金:<text class="r">{{userInfo.recharge.money || ''}}</text></view>
|
||||
<view>赠送:{{userInfo.recharge.bonusamount || ''}}</view>
|
||||
<view class="mt">订单号:{{userInfo.recharge.orderid || ''}}</view>
|
||||
<view>购买时间:<text class="r">{{userInfo.recharge.date || ''}}</text></view>
|
||||
<view>网点:<text class="r">{{userInfo.recharge.agent || ''}}</text></view>
|
||||
</view>
|
||||
<button class="button" form-type="submit" type="primary">线上退款</button>
|
||||
</form>
|
||||
|
||||
<form bindsubmit="onSubmitToGroup2" wx:if="{{userInfo.refundType === 'offline'}}"> <!-- 查询后 线下退款 -->
|
||||
<view class="info">
|
||||
<view>本金:<text class="r">{{userInfo.recharge.money || ''}}</text></view>
|
||||
<view>赠送:{{userInfo.recharge.bonusamount || ''}}</view>
|
||||
<view class="mt">订单号:{{userInfo.recharge.orderid || ''}}</view>
|
||||
<view>购买时间:<text class="r">{{userInfo.recharge.date || ''}}</text></view>
|
||||
<view>网点:<text class="r">{{userInfo.recharge.agent || ''}}</text></view>
|
||||
</view>
|
||||
<button class="button" form-type="submit" type="warn">线下退款</button>
|
||||
</form>
|
||||
|
||||
<view wx:if="{{userInfo.refundType === 'none'}}" class="no-refund-info"> <!-- 没有可退款记录 -->
|
||||
<view class="info">
|
||||
<view class="no-refund-text">没有可退款记录</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
@@ -1,93 +0,0 @@
|
||||
.contain {
|
||||
box-sizing: border-box;
|
||||
min-height: 100vh;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 60rpx 40rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
line-height: 1;
|
||||
font-weight: 700;
|
||||
color: #0056A3;
|
||||
}
|
||||
|
||||
.input {
|
||||
margin: 40rpx 0;
|
||||
padding: 22rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: #fff;
|
||||
border: 2rpx solid #eee;
|
||||
box-shadow: 0 6rpx 10rpx rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.userInfo {
|
||||
padding-top: 22rpx;
|
||||
border-top: 2rpx solid #eee;
|
||||
}
|
||||
|
||||
.info {
|
||||
padding: 22rpx 32rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: #fff;
|
||||
border: 2rpx solid #eee;
|
||||
box-shadow: 0 6rpx 10rpx rgba(0, 0, 0, 0.1);
|
||||
margin-bottom: 30rpx;
|
||||
line-height: 2;
|
||||
}
|
||||
|
||||
.info .mt {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.info .r {
|
||||
color: #C13700;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.info .g {
|
||||
color: #60BB46;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.balance-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx 0;
|
||||
border-top: 2rpx solid #eee;
|
||||
}
|
||||
|
||||
.balance-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.balance-item .label {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.balance-item .value {
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.balance-item .b {
|
||||
color: #0056A3;
|
||||
}
|
||||
|
||||
.no-refund-info {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.no-refund-text {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
padding: 40rpx 0;
|
||||
}
|
||||
Reference in New Issue
Block a user