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'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user