备份改首页

This commit is contained in:
lym
2026-03-27 22:27:00 +08:00
parent c91a4c5462
commit c93c946f13
13 changed files with 667 additions and 34 deletions

View File

@@ -12,6 +12,7 @@ Page( {
orderpayHidden:true,
orderseefHidden:true,
orderseef0Hidden:true,
orderhxmHidden:true,
myorder:[],
Start: 0,
t:0,
@@ -23,7 +24,9 @@ Page( {
bhyy:"",
image:"",
image0:"",
apiurl:""
apiurl:"",
orderhxm:"",
qrcodeurl:""
},
onLoad: function(options) {
@@ -458,6 +461,92 @@ Page( {
that.setData({
orderseef0Hidden:true
})
},closeorderhxm:function(e) {
that.setData({
orderhxmHidden:true,
qrcodeurl:""
})
},onshowhxm:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userId&&LoginId){
var id = e.currentTarget.dataset.id
// 从订单列表中查找对应的订单信息
var order = null;
for(var i = 0; i < that.data.myorder.length; i++) {
if(that.data.myorder[i].O_Id == id) {
order = that.data.myorder[i];
break;
}
}
if(order && order.orderhxm) {
that.setData({
orderhxmHidden:false,
orderhxm: order.orderhxm,
//准备改成从后端获取base64图片信息
//qrcodeurl: order.qrcodeurl || "",
orderid: id
})
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getmyhxm",
userId:(userId==null?"":userId),
LoginId:(LoginId==null?"":LoginId),
hxm:that.data.orderhxm,
orderid:that.data.orderid
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res0) {
if(res0.data.status==1){
//获得base64图片信息
var minQRcode = res0.data.minQRcode;
console.log(minQRcode);
// 处理base64图片数据确保包含data:image前缀
var qrcodeBase64 = minQRcode;
if (minQRcode && !minQRcode.startsWith('data:image')) {
qrcodeBase64 = 'data:image/png;base64,' + minQRcode;
}
// 设置base64图片数据
that.setData({
qrcodeurl: qrcodeBase64
});
}else{
wx.showToast({
title: res0.data.msg,
icon: "none",
duration: 3000
})
}
}
})
} else {
wx.showToast({
title: "未找到核销码信息",
icon: "none",
duration: 3000
})
}
}else{
wx.navigateTo({
url: "../login/index"
})
}
},oncancel:function(e) {
var id = e.currentTarget.dataset.id
that.setData({