From c93c946f1371d54c952d2168a54b4445f6d906d7 Mon Sep 17 00:00:00 2001 From: lym <16170814@qq.com> Date: Fri, 27 Mar 2026 22:27:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=BD=E6=94=B9=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 1 + pages/index/index.js | 2 +- pages/my/index.js | 9 +- pages/mybusiness0/index.js | 85 ++++++++-- pages/mybusiness0/index.wxml | 2 +- pages/mybusiness0/index.wxss | 12 +- pages/myorder/index.js | 91 ++++++++++- pages/myorder/index.wxml | 25 ++- pages/myorder/index.wxss | 85 ++++++++++ pages/myorder0/index.js | 58 +++++++ pages/myorder0/index.wxml | 27 +++- pages/myorder0/index.wxss | 302 +++++++++++++++++++++++++++++++++++ pages/myorderinfo/index.json | 2 +- 13 files changed, 667 insertions(+), 34 deletions(-) diff --git a/app.json b/app.json index 665ac68..ead1a24 100644 --- a/app.json +++ b/app.json @@ -24,6 +24,7 @@ "pages/myorder/index", "pages/myorder0/index", "pages/myorderinfo/index", + "pages/hxorderinfo/index", "pages/myorderwlxx/index", "pages/myfavorite/index", "pages/mytgm/index", diff --git a/pages/index/index.js b/pages/index/index.js index 5dd853c..245c62f 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1,4 +1,4 @@ -var WxParse = null; +var WxParse = null; //获取应用实例 var app = getApp() var sopenFrame = null diff --git a/pages/my/index.js b/pages/my/index.js index 7dce3d0..9da46db 100644 --- a/pages/my/index.js +++ b/pages/my/index.js @@ -137,10 +137,15 @@ Page({ }]; if (userInfo.id > 68 && userInfo.bdshEnable == 0) { userlist = [ + // { + // icon: '../../images/my_ico1.png', + // url: (userInfo.sjuLevel0 == 2 ? '../mybusiness0/index' : (userInfo.sjuLevel0 == 1 ? '' : '../appbusiness0/index')), + // text: (userInfo.sjuLevel0 == 2 ? '健康驿站管理' : (userInfo.sjuLevel0 == 1 ? '申请健康驿站正在审核中...' : '申请健康驿站')) + // }, { icon: '../../images/my_ico1.png', - url: (userInfo.sjuLevel0 == 2 ? '../mybusiness0/index' : (userInfo.sjuLevel0 == 1 ? '' : '../appbusiness0/index')), - text: (userInfo.sjuLevel0 == 2 ? '健康驿站管理' : (userInfo.sjuLevel0 == 1 ? '申请健康驿站正在审核中...' : '申请健康驿站')) + url: (userInfo.sjuLevel0 == 2 ? '../myorder0/index?t=3&nav=0' : (userInfo.sjuLevel0 == 1 ? '' : '../appbusiness0/index')), + text: (userInfo.sjuLevel0 == 2 ? '驿站订单管理' : (userInfo.sjuLevel0 == 1 ? '申请健康驿站正在审核中...' : '申请健康驿站')) }, { icon: '../../images/my_ico3.png', diff --git a/pages/mybusiness0/index.js b/pages/mybusiness0/index.js index 3c9e9e4..630f49a 100644 --- a/pages/mybusiness0/index.js +++ b/pages/mybusiness0/index.js @@ -27,44 +27,97 @@ Page( { }, onLoad: function() { that = this + // 检查用户权限 + var userInfodata = wx.getStorageSync("userInfo") + if(userInfodata){ + var userInfo = JSON.parse(userInfodata) + console.log("用户信息:", userInfo); + console.log("sjuLevel0:", userInfo.sjuLevel0); + // 检查是否是事业部用户 + if(userInfo.sjuLevel0 != 2){ + wx.showToast({ + title: "您不是事业部用户,无法查看此页面", + icon: "none", + duration: 3000 + }) + // 延迟返回上一页 + setTimeout(function(){ + wx.navigateBack() + }, 2000) + return + } + } that.rdata() },rdata: function() { var userId = wx.getStorageSync("userId") var LoginId = wx.getStorageSync("LoginId") var userInfodata = wx.getStorageSync("userInfo") + if(!userId || !LoginId || !userInfodata){ + wx.navigateTo({ + url: "../login/index" + }) + return + } + var userInfo = JSON.parse(userInfodata) wx.request({ url: app.globalData.apiurl + "/xapiajax.ashx", data: { action:"getmybusinessdata", userId:(!userId?"":userId), - LoginId:(!LoginId?"":LoginId) + LoginId:(!LoginId?"":LoginId), + // 添加用户类型参数,确保获取正确的数据 + userType: "business0" }, method:"GET", dataType:"json", success (res) { + console.log("mybusiness0 API返回数据:", res.data); if(res.data.status==1){ + // 检查返回的数据是否包含订单统计 + if(res.data.fhordercount0 === undefined){ + console.warn("API返回的数据缺少订单统计字段"); + wx.showToast({ + title: "数据获取不完整,请稍后重试", + icon: "none", + duration: 3000 + }) + } that.setData({ userid:res.data.zh, userpwd:res.data.mm, - userpwd:res.data.mm, - hkdjye:res.data.userInfo.hkdjye, - hkjdye:res.data.userInfo.hkjdye, - hkksye:res.data.userInfo.hkksye, - productcount:res.data.productcount, - productcount0:res.data.productcount0, - fhordercount0:res.data.fhordercount0, - fhordercount1:res.data.fhordercount1, - fhordercount2:res.data.fhordercount2, - kdordercount0:res.data.kdordercount0, - kdordercount1:res.data.kdordercount1, - kdordercount2:res.data.kdordercount2, - ztordercount0:res.data.ztordercount0, - ztordercount1:res.data.ztordercount1, - ztordercount2:res.data.ztordercount2, + hkdjye:res.data.userInfo ? res.data.userInfo.hkdjye : 0, + hkjdye:res.data.userInfo ? res.data.userInfo.hkjdye : 0, + hkksye:res.data.userInfo ? res.data.userInfo.hkksye : 0, + productcount:res.data.productcount || 0, + productcount0:res.data.productcount0 || 0, + fhordercount0:res.data.fhordercount0 || 0, + fhordercount1:res.data.fhordercount1 || 0, + fhordercount2:res.data.fhordercount2 || 0, + kdordercount0:res.data.kdordercount0 || 0, + kdordercount1:res.data.kdordercount1 || 0, + kdordercount2:res.data.kdordercount2 || 0, + ztordercount0:res.data.ztordercount0 || 0, + ztordercount1:res.data.ztordercount1 || 0, + ztordercount2:res.data.ztordercount2 || 0, loadingHidden:true }) + } else { + console.log("mybusiness0 API返回状态错误:", res.data); + wx.showToast({ + title: res.data.msg || "数据获取失败", + icon: "none", + duration: 3000 + }) } + }, + fail (err) { + console.error("mybusiness0 API请求失败:", err); + wx.showToast({ + title: "网络请求失败,请检查网络连接", + icon: "none", + duration: 3000 + }) } }) diff --git a/pages/mybusiness0/index.wxml b/pages/mybusiness0/index.wxml index 1f4d157..3a1ab37 100644 --- a/pages/mybusiness0/index.wxml +++ b/pages/mybusiness0/index.wxml @@ -1,7 +1,7 @@ 商品管理后台网址和账号 - + 付款 - + 查看核销码 确认收货 查看详情 @@ -91,6 +91,29 @@ + \ No newline at end of file diff --git a/pages/myorder/index.wxss b/pages/myorder/index.wxss index f149222..d5d5a60 100644 --- a/pages/myorder/index.wxss +++ b/pages/myorder/index.wxss @@ -53,4 +53,89 @@ page{ .nodata image { width: 80px; height: 80px; +} + +/* 核销码弹窗样式 */ +.hxm-box { + width: 90%; + max-width: 320px; +} + +.hxm-body { + display: flex; + flex-direction: column; + align-items: center; + padding: 20px; + box-sizing: border-box; +} + +.hxm-info { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + width: 100%; + margin-bottom: 20px; + padding: 15px; + background-color: #f5f5f5; + border-radius: 8px; + box-sizing: border-box; +} + +.hxm-label { + font-size: 14px; + color: #666; +} + +.hxm-code { + font-size: 24px; + font-weight: bold; + color: #ff4d00; + margin-left: 10px; + letter-spacing: 3px; +} + +.qrcode-section { + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + margin-bottom: 20px; +} + +.qrcode-label { + font-size: 14px; + color: #666; + margin-bottom: 15px; +} + +.qrcode-box { + display: flex; + align-items: center; + justify-content: center; + width: 200px; + height: 200px; + border: 1px solid #e0e0e0; + border-radius: 8px; + padding: 10px; + background-color: #fff; + box-sizing: border-box; +} + +.qrcode-image { + width: 180px; + height: 180px; +} + +.hxm-tips { + width: 100%; + padding: 12px; + background-color: #fff8e1; + border-radius: 8px; + box-sizing: border-box; + font-size: 12px; + color: #ff9800; + text-align: center; + border: 1px solid #ffeaa7; + line-height: 1.6; } \ No newline at end of file diff --git a/pages/myorder0/index.js b/pages/myorder0/index.js index ec8058d..f45835d 100644 --- a/pages/myorder0/index.js +++ b/pages/myorder0/index.js @@ -12,6 +12,8 @@ Page( { orderpayHidden:true, orderseefHidden:true, orderseef0Hidden:true, + hxddHidden:true, + hxm:"", myorder:[], Start: 0, t:0, @@ -123,6 +125,7 @@ Page( { "content-type": "application/json" // 默认值 }, success (res) { + console.log("myorder0 API返回数据:", res.data); if(res.data.status==1){ var tmpArr = null; @@ -149,6 +152,8 @@ Page( { } } + } else { + console.log("myorder0 API返回状态错误:", res.data); } if(gp==1){ //隐藏loading 提示框 @@ -237,6 +242,13 @@ Page( { bhyy:e.detail.value }) + },gethxmValue:function(e) { + console.log("Input value:", e.detail.value); + that.setData({ + hxm:e.detail.value + }) + console.log("hxm value set to:", that.data.hxm); + },onshowseef0:function(e) { var userId = wx.getStorageSync("userId") var LoginId = wx.getStorageSync("LoginId") @@ -554,6 +566,52 @@ Page( { wx.navigateTo({ url: "../myorderinfo/index?id=" + id + "&t=" + that.data.t }) +},onhxdd:function(e) { + var userId = wx.getStorageSync("userId") + var LoginId = wx.getStorageSync("LoginId") + if(userId&&LoginId){ + var id = e.currentTarget.dataset.id + that.setData({ + hxddHidden:false, + orderid:id, + hxm:"" + }) + }else{ + wx.navigateTo({ + url: "../login/index" + }) + } +},closehxdd:function(e) { + that.setData({ + hxddHidden:true + }) +},inhxdd:function(e) { + +},qxhxdd:function() { + var userId = wx.getStorageSync("userId") + var LoginId = wx.getStorageSync("LoginId") + console.log("hxm value:", that.data.hxm); + console.log("Full URL:", "../hxorderinfo/index?id=" + that.data.orderid + "&t=" + that.data.t + "&hxm=" + that.data.hxm); + if(userId&&LoginId){ + if(that.data.hxm!=""){ + wx.navigateTo({ + url: "../hxorderinfo/index?id=" + that.data.orderid + "&t=" + that.data.t + "&hxm=" + encodeURIComponent(that.data.hxm) + }) + that.setData({ + hxddHidden:true + }) + }else{ + wx.showToast({ + title: "核销码不能为空", + icon: "none", + duration: 3000 + }) + } + }else{ + wx.navigateTo({ + url: "../login/index" + }) + } },ondetail:function(e) { var id = e.currentTarget.dataset.id wx.navigateTo({ diff --git a/pages/myorder0/index.wxml b/pages/myorder0/index.wxml index bffff69..abc17b3 100644 --- a/pages/myorder0/index.wxml +++ b/pages/myorder0/index.wxml @@ -1,8 +1,8 @@ 全部 - 待发货 - 待收货 + 待核销 + 已完成 - - 确认收货 查看物流 查看详情 + 核销订单 + + 查看详情 @@ -92,4 +93,20 @@ \ No newline at end of file + + \ No newline at end of file diff --git a/pages/myorder0/index.wxss b/pages/myorder0/index.wxss index 8b13789..0b8a812 100644 --- a/pages/myorder0/index.wxss +++ b/pages/myorder0/index.wxss @@ -1 +1,303 @@ +page{ + background: linear-gradient(to bottom, #E8F4FC, #F5FAFF); +} +.container { + position: relative; + width: 100%; + min-height: 100%; + font-size: 14px; + color: #000; + padding-bottom: 2em; +} +.myorder-menu { + display: flex; + flex-direction: row; + width: 100%; + height: 3em; + line-height: 3em; + background-color: #fff; + border-bottom: 1px solid #f1f1f1; + box-sizing: border-box; +} + +.myorder-menu view { + flex: 1; + text-align: center; + color: #666; + font-size: 0.9em; + transition: all 0.3s ease; +} + +.myorder-menu view.hover { + color: #6BA3F0; + font-weight: 900; + border-bottom: 3px solid #6BA3F0; +} + +.myorder-box { + width: 100%; + padding: 0.8em; + box-sizing: border-box; +} + +.myorder-item { + background-color: #fff; + border-radius: 0.5em; + padding: 0.8em; + margin-bottom: 0.8em; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); + border: 1px solid #f1f1f1; + box-sizing: border-box; +} + +.myorder-item > view { + margin-bottom: 0.5em; + line-height: 1.5em; +} + +.myorder-item > view:last-child { + margin-bottom: 0; +} + +.Total { + display: flex; + flex-direction: row; + justify-content: space-between; + padding: 0.3em 0; + border-top: 1px solid #f8f8f8; + border-bottom: 1px solid #f8f8f8; +} + +.Totalprice { + margin-left: 1em; + color: #6BA3F0; + font-weight: bold; +} + +.cz_box { + display: flex; + flex-direction: row; + justify-content: flex-end; + margin-top: 0.8em; + padding-top: 0.8em; + border-top: 1px solid #f8f8f8; +} + +.cz_box view { + margin-left: 0.8em; + padding: 0.3em 0.8em; + background-color: #6BA3F0; + color: #fff; + border-radius: 0.3em; + font-size: 0.85em; + transition: all 0.3s ease; +} + +.cz_box view:active { + background-color: #5A93E0; + transform: scale(0.98); +} + +.products { + display: flex; + flex-direction: row; + flex-wrap: wrap; + margin-top: 0.8em; + padding-top: 0.8em; + border-top: 1px solid #f8f8f8; +} + +.products view { + display: flex; + flex-direction: column; + align-items: center; + width: 33.333%; + margin-bottom: 0.8em; + box-sizing: border-box; +} + +.products view image { + width: 5em; + height: 5em; + border-radius: 0.3em; + margin-bottom: 0.3em; +} + +.products view text { + width: 100%; + text-align: center; + font-size: 0.85em; + color: #333; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.nodata { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 3em 0; + text-align: center; +} + +.nodata image { + width: 6em; + height: 6em; + margin-bottom: 1em; + opacity: 0.6; +} + +.nodata view { + color: #939393; + font-size: 0.9em; +} + +.Hidden_box { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100vh; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + align-items: center; + justify-content: center; + z-index: 100; +} + +.Hidden_box_to { + background-color: #fff; + border-radius: 0.5em; + width: 85%; + max-height: 80vh; + overflow-y: auto; + box-sizing: border-box; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); +} + +.Hidden_box_title { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + padding: 0.8em; + border-bottom: 1px solid #f1f1f1; + font-weight: bold; + color: #333; +} + +.Hidden_box_title .close { + width: 1.5em; + height: 1.5em; + padding: 0.2em; + border-radius: 50%; + background-color: #f8f8f8; + display: flex; + align-items: center; + justify-content: center; +} + +.Hidden_box_title .close image { + width: 100%; + height: 100%; +} + +.frombody { + padding: 0.8em; +} + +.pay_box { + display: flex; + flex-direction: column; + margin-bottom: 1em; +} + +.pay_type { + margin-bottom: 0.5em; + font-weight: bold; + color: #333; +} + +.pay_box view { + display: flex; + flex-direction: row; + align-items: center; + padding: 0.8em; + margin-bottom: 0.5em; + border: 1px solid #f1f1f1; + border-radius: 0.3em; + background-color: #f8f8f8; + transition: all 0.3s ease; +} + +.pay_box view.hover { + border-color: #6BA3F0; + background-color: #E8F4FC; +} + +.pay_box view image { + width: 1.5em; + height: 1.5em; + margin-right: 0.5em; +} + +.button { + display: flex; + flex-direction: row; + justify-content: center; + padding: 0.8em; + border-top: 1px solid #f1f1f1; +} + +.button button { + width: 100%; + height: 2.5em; + line-height: 2.5em; + background: linear-gradient(to right, #6BA3F0, #8BBDF5); + color: #fff; + border-radius: 0.5em; + font-size: 0.9em; + border: none; + transition: all 0.3s ease; +} + +.button button:active { + background: linear-gradient(to right, #5A93E0, #7AADF0); + transform: scale(0.98); +} + +.frombody image { + width: 100%; + height: auto; + max-height: 15em; + margin-bottom: 0.5em; + border-radius: 0.3em; +} + +.frombody input { + width: 100%; + height: 2.5em; + padding: 0 0.5em; + border: 1px solid #f1f1f1; + border-radius: 0.3em; + background-color: #f8f8f8; + box-sizing: border-box; + margin-bottom: 0.8em; +} + +.frombody input:focus { + border-color: #6BA3F0; + background-color: #fff; +} + +.loading { + display: flex; + align-items: center; + justify-content: center; + padding: 2em 0; + color: #939393; + font-size: 0.9em; +} \ No newline at end of file diff --git a/pages/myorderinfo/index.json b/pages/myorderinfo/index.json index 3f51af6..a3df46f 100644 --- a/pages/myorderinfo/index.json +++ b/pages/myorderinfo/index.json @@ -1,3 +1,3 @@ { - "navigationBarTitleText": "订单详情" + "navigationBarTitleText": "核销订单" } \ No newline at end of file