JMApp/pages/duiquan/duiquan.js
XiaoMo 7c8536272c feat: 新增退款和网约车用户管理页面
添加了退款和网约车用户管理相关页面,包括页面配置、样式、逻辑处理等。同时更新了应用配置文件和私有配置文件以支持新页面。
2025-04-14 18:21:46 +08:00

68 lines
2.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var t = require("../../utils/login.js");
Page({
data: {
pic: "https://jm-static.v0750.com/image/dui.jpg",
tips: "温馨提示:\n1、请在30分钟内完成兑换超时作废\n2、请在兑换完成后在本页面点击\"确认兑换\"\n3、兑换成功后将在3个工作日内发放奖品",
},
onLoad() {
t.request('/miniprogram/coupons', {}, !0).then((res) => {
if (res.code == 200) {
this.setData({
tips: res.data.tips,
pic: res.data.pic
})
}
})
},
onSubmitToGroup(e) {
const code = e.detail.value.code
if (!code) {
wx.showToast({
title: '请输入券码',
icon: 'none'
})
return
}
wx.showLoading({
title: '兑换中...'
})
t.request('/miniprogram/coupons/importDouyin', { code: code }, !0).then((res) => {
wx.hideLoading()
if (res.code == 200) {
wx.showModal({
title: '兑换成功',
content: '是否立即使用?',
success: (result) => {
if (result.confirm) {
// 判断是否已扫码
if (getApp().globalData.devicecode) {
// 已扫码,启动机器
t.request('/miniprogram/device/start', { devicecode: getApp().globalData.devicecode }, !0).then((startRes) => {
if (startRes.code == 200) {
wx.showToast({ title: '启动成功', icon: 'success' });
} else {
wx.showToast({ title: startRes.message || '启动失败', icon: 'none' });
wx.navigateTo({ url: '/pages/washCodeList/washCodeList' });
}
});
} else {
// 未扫码跳转到washCodeList页面进行扫码
wx.navigateTo({ url: '/pages/washCodeList/washCodeList' });
}
} else {
wx.navigateTo({ url: '/pages/washCodeList/washCodeList' });
}
}
});
} else {
wx.showToast({
title: res.message || '兑换失败',
icon: 'none'
})
}
})
}
})