备份改首页

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

@@ -1,4 +1,4 @@
var WxParse = null;
var WxParse = null;
//获取应用实例
var app = getApp()
var sopenFrame = null

View File

@@ -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',

View File

@@ -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
})
}
})

View File

@@ -1,7 +1,7 @@
<view class="container">
<view class="login_box">
<view class="mybusiness_title">商品管理后台网址和账号<view class="close">
<switch checked='{{IFDefault}}' color="#00B050" bindchange="changeisDefault"></switch>
<switch checked='{{IFDefault}}' color="#6BA3F0" bindchange="changeisDefault"></switch>
</view></view>
<view class="login_box_to" wx:if="{{IFDefault}}">

View File

@@ -1,5 +1,5 @@
page{
background: #ccc;
background: linear-gradient(to bottom, #E8F4FC, #F5FAFF);
}
.container {
position: relative;
@@ -23,7 +23,7 @@ page{
line-height: 3.5em;
padding: 0 0.8em;
font-weight: 900;
background-color: #00B050;
background-color: #6BA3F0;
box-sizing: border-box;
color: #fff;
}
@@ -32,8 +32,8 @@ page{
width: auto;
}
.mybusiness_title .close .wx-switch-input{
background:#ff4d00 !important;
border: #ff4d00 !important;
background:#6BA3F0 !important;
border: #6BA3F0 !important;
}
.login_box_to{
padding: 0.8em;
@@ -81,14 +81,14 @@ justify-content: center;
box-sizing: border-box;
}
.mydata_box0.logbox {
border-top: 1px solid #00B050;
border-top: 1px solid #6BA3F0;
}
.mydata_box0.logbox view {
height: 3em;
}
.mydata_box0 view.umoney1 {
border-right: 1px solid #0835AF;
border-right: 1px solid #8BBDF5;
color: #E1FFFF;
}
.mydata_box0 view.umoney1.end {

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({

View File

@@ -22,7 +22,7 @@
</view>
<view class="cz_box">
<view wx:if="{{item.Payed=='0'}}" bindtap="onshowpay" data-id="{{item.O_Id}}">付款</view>
<view wx:if="{{item.Payed=='1'}}" bindtap="onshowhxm" data-id="{{item.O_Id}}">查看核销码</view>
<view wx:if="{{item.Payed=='2'||item.Payed=='8'}}" bindtap="onqysh" data-id="{{item.O_Id}}">确认收货</view> <view bindtap="onorderdetail" data-id="{{item.O_Id}}">查看详情</view>
</view>
<view class="products" wx:for="{{item.pics}}" wx:for-item="pitem">
@@ -91,6 +91,29 @@
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{orderhxmHidden}}" bindtap="closeorderhxm">
<view class="Hidden_box_to hxm-box" catchtap="inorderpay">
<view class="Hidden_box_title">
<text>核销码</text>
<view class="close" bindtap="closeorderhxm"><image src="../../images/close.png" /></view>
</view>
<view class="hxm-body">
<view class="hxm-info">
<text class="hxm-label">核销码:</text>
<text class="hxm-code">{{orderhxm}}</text>
</view>
<view wx:if="{{qrcodeurl}}" class="qrcode-section">
<text class="qrcode-label">扫码核销二维码:</text>
<view class="qrcode-box">
<image src="{{qrcodeurl}}" mode="aspectFit" class="qrcode-image"></image>
</view>
</view>
<view class="hxm-tips">
<text>温馨提示:请向提货点工作人员出示此核销码{{qrcodeurl?'或二维码':''}}进行核销</text>
</view>
</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

View File

@@ -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;
}

View File

@@ -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({

View File

@@ -1,8 +1,8 @@
<view class="container">
<view class="myorder-menu">
<view class='{{nav==0?"hover":""}}' bindtap="onnav" data-id="0">全部</view>
<view class='{{nav==1?"hover":""}}' bindtap="onnav" data-id="1">待发货</view>
<view class='{{nav==2?"hover":""}}' bindtap="onnav" data-id="2">待收货</view>
<view class='{{nav==1?"hover":""}}' bindtap="onnav" data-id="1">待核销</view>
<!-- <view class='{{nav==2?"hover":""}}' bindtap="onnav" data-id="2">待收货</view> -->
<view class='{{nav==3?"hover":""}}' bindtap="onnav" data-id="3">已完成</view>
</view>
<view class="myorder-box" wx:for="{{myorder}}" wx:for-index="index" hidden="{{orderHidden}}">
@@ -20,8 +20,9 @@
<text>状态:</text>{{item.status0}}
</view>
<view class="cz_box">
<view wx:if="{{t==0&&(item.Payed=='2'||item.Payed=='8')}}" bindtap="onqysh" data-id="{{item.O_Id}}">确认收货</view> <view wx:if="{{(item.Payed=='2'||item.Payed=='3')}}" bindtap="onckwl" data-id="{{item.kdgs}}|{{item.kdgsmc}}|{{item.ydh}}">查看物流</view> <view bindtap="onorderdetail" data-id="{{item.O_Id}}">查看详情</view>
<view wx:if="{{t==3&&(item.Payed=='1')}}" bindtap="onhxdd" data-id="{{item.O_Id}}">核销订单</view>
<!-- <view wx:if="{{t==0&&(item.Payed=='2'||item.Payed=='8')}}" bindtap="onqysh" data-id="{{item.O_Id}}">确认收货</view> <view wx:if="{{(item.Payed=='2'||item.Payed=='3')}}" bindtap="onckwl" data-id="{{item.kdgs}}|{{item.kdgsmc}}|{{item.ydh}}">查看物流</view> -->
<view bindtap="onorderdetail" data-id="{{item.O_Id}}">查看详情</view>
</view>
<view class="products" wx:for="{{item.pics}}" wx:for-item="pitem">
<view bindtap="ondetail" data-id="{{pitem.prodid}}">
@@ -92,4 +93,20 @@
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>
</loading>
<view class="Hidden_box" hidden="{{hxddHidden}}" bindtap="closehxdd">
<view class="Hidden_box_to" catchtap="inhxdd">
<view class="Hidden_box_title">
<text>输入核销码</text>
<view class="close" bindtap="closehxdd"><image src="../../images/close.png" /></view>
</view>
<view class="frombody">
<view>
<text>核销码:</text><input name="hxm" type="text" value="{{hxm}}" placeholder="请输入核销码" bindinput='gethxmValue' />
</view>
</view>
<view class="button">
<button bindtap="qxhxdd">确认</button>
</view>
</view>
</view>

View File

@@ -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;
}

View File

@@ -1,3 +1,3 @@
{
"navigationBarTitleText": "订单详情"
"navigationBarTitleText": "核销订单"
}