银花优选微信小程序修改后的最新版本代码

This commit is contained in:
ss001
2026-02-07 16:22:31 +08:00
commit c00caf5744
516 changed files with 41796 additions and 0 deletions

573
pages/myorder/index.js Normal file
View File

@@ -0,0 +1,573 @@
var app = getApp()
var that=null
var sopenFrame=null
Page( {
data: {
orderImg: '../../images/iconfont-dingdan.png',
tipWords: '亲,您还没有订单哦!',
orderHidden:false,
noorderHidden:true,
loadingHidden:false,
orderpayHidden:true,
orderseefHidden:true,
orderseef0Hidden:true,
myorder:[],
Start: 0,
t:0,
zftype:2,
FHEnable2:"0",
nav:0,
orderid:0,
fhhome:0,
bhyy:"",
image:"",
image0:"",
apiurl:""
},
onLoad: function(options) {
that = this
if(options.t){
that.setData({
t:options.t
});
}
if(options.nav){
that.setData({
nav:options.nav
});
}
if(that.data.t==1){
wx.setNavigationBarTitle({
title: "审核订单"
})
}else{
wx.setNavigationBarTitle({
title: "订单管理"
})
}
that.clearCache();//清本页缓存
that.getlist(0)
sopenFrame=setInterval(function (){
if(app.globalData.IFRefreshmyorder==1){
app.globalData.IFRefreshmyorder=0
that.clearCache();//清本页缓存
that.getlist(0)
}
}, 1000);
},onUnload: function () {
wx.navigateBack({//返回
delta: 3
})
}, // 下拉刷新
onPullDownRefresh: function () {
//在当前页面显示导航条加载动画
wx.showNavigationBarLoading();
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
wx.showLoading({
title: '刷新中...',
})
that.clearCache();
that.getlist(1);//第一次加载数据
},
// 页面上拉触底事件(上拉加载更多)
onReachBottom: function () {
that.setData({
loadingHidden:false
});
that.getlist(2);//后台获取新数据并追加渲染
},
// 清缓存
clearCache:function(){
that.setData({
orderHidden:false,
noorderHidden:true,
loadingHidden:false,
orderpayHidden:true,
Start: 0,
orderid:0,
zftype:2,
myorder:[]
});
},getlist: function(gp) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
var userInfodata = wx.getStorageSync("userInfo")
if(userId&&LoginId&&userInfodata){
var userInfo = JSON.parse(userInfodata)
that.setData({
FHEnable2:userInfo.FHEnable2
})
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getorderslist",
t0:(that.data.nav==0?10:parseInt(that.data.nav)-1),
t:that.data.t,
Start:that.data.Start,
userId:(userId==null?"":userId),
LoginId:(LoginId==null?"":LoginId)
},
method:"GET",
dataType:"json",
header: {
"content-type": "application/json" // 默认值
},
success (res) {
if(res.data.status==1){
var tmpArr = null;
tmpArr = that.data.myorder;
// 处理每个订单数据将status0中的<br>替换为逗号
for(var i=0; i<res.data.data.length; i++){
if(res.data.data[i].status0){
res.data.data[i].status0 = res.data.data[i].status0.replace(/<br\s*\/?>/gi, '');
}
}
tmpArr.push.apply(tmpArr,res.data.data);
that.setData({
myorder: tmpArr,
apiurl:app.globalData.apiurl,
Start: that.data.Start+res.data.data.length,
loadingHidden:true
})
if(gp==0||gp==1){
if(res.data.data.length>0){
that.setData({
orderHidden:false,
noorderHidden:true
})
}else{
that.setData({
orderHidden:true,
noorderHidden:false
})
}
}
}
if(gp==1){
//隐藏loading 提示框
wx.hideLoading();
//隐藏导航条加载动画
wx.hideNavigationBarLoading();
//停止下拉刷新
wx.stopPullDownRefresh();
}
}
})
}else{
wx.navigateTo({
url: "../login/index"
})
}
},viewimages0:function(e) {
var src = e.currentTarget.dataset.index;
var src0 = e.currentTarget.dataset.index0;
var imgList=new Array();
imgList[0]=src;
imgList[1]=src0;
wx.previewImage({
urls: imgList,
current:imgList[0]
})
},viewimages1:function(e) {
var src = e.currentTarget.dataset.index;
var src0 = e.currentTarget.dataset.index0;
var imgList=new Array();
imgList[0]=src;
imgList[1]=src0;
wx.previewImage({
urls: imgList,
current:imgList[1]
})
},onnav:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userId&&LoginId){
var index = e.currentTarget.dataset.id
that.setData({
nav:index
})
that.clearCache();
that.getlist(0);
}else{
wx.navigateTo({
url: "../login/index"
})
}
},onshowpay:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userId&&LoginId){
var id = e.currentTarget.dataset.id
that.setData({
orderpayHidden:false,
orderid:id
})
}else{
wx.navigateTo({
url: "../login/index"
})
}
},onshowseef:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userId&&LoginId){
var id = e.currentTarget.dataset.id
var image = e.currentTarget.dataset.index
var image0 = e.currentTarget.dataset.index0
that.setData({
orderseefHidden:false,
image:image,
image0:image0,
orderid:id
})
}else{
wx.navigateTo({
url: "../login/index"
})
}
},getbhyyValue:function(e) {
that.setData({
bhyy:e.detail.value
})
},onshowseef0:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userId&&LoginId){
var id = e.currentTarget.dataset.id
var image = e.currentTarget.dataset.index
var image0 = e.currentTarget.dataset.index0
that.setData({
orderseef0Hidden:false,
image:image,
image0:image0,
orderid:id
})
}else{
wx.navigateTo({
url: "../login/index"
})
}
},weixinpay:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userId&&LoginId){
that.setData({
zftype:0
})
}else{
wx.navigateTo({
url: "../login/index"
})
}
},jianjinpay:function(e) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userId&&LoginId){
that.setData({
zftype:2
})
}else{
wx.navigateTo({
url: "../login/index"
})
}
},qypay:function() {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userId&&LoginId){
var openid = wx.getStorageSync("openid");
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"payorder",
userId:(userId==null?"":userId),
LoginId:(LoginId==null?"":LoginId),
openid:(!openid?"":openid),
orderid:that.data.orderid,
zftype:that.data.zftype
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res0) {
if(res0.data.ResultId>0){
wx.requestPayment({
timeStamp: res0.data.timeStamp,
nonceStr: res0.data.noncestr,
package: res0.data.package,
signType: res0.data.signType,
paySign: res0.data.paySign,
success (res) {
that.clearCache();
that.getlist(0);
},
fail (res) {
/*wx.showToast({
title: JSON.stringify(res),
icon: "none",
duration: 3000
})*/
}
})
}else{
wx.showToast({
title: res0.data.msg,
icon: "none",
duration: 3000
})
}
}
})
}else{
wx.navigateTo({
url: "../login/index"
})
}
},qyseef:function() {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userId&&LoginId){
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"seeforder",
userId:(userId==null?"":userId),
LoginId:(LoginId==null?"":LoginId),
orderid:that.data.orderid
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res0) {
if(res0.data.status==1){
wx.showToast({
title: res0.data.msg,
icon: "none",
duration: 3000
})
that.setData({
orderseefHidden:true
})
that.clearCache();
that.getlist(0);
}else{
wx.showToast({
title: res0.data.msg,
icon: "none",
duration: 3000
})
}
}
})
}else{
wx.navigateTo({
url: "../login/index"
})
}
},qyseef0:function() {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
if(userId&&LoginId){
if(that.data.bhyy!=""){
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"seeforder0",
userId:(userId==null?"":userId),
LoginId:(LoginId==null?"":LoginId),
bhyy:that.data.bhyy,
orderid:that.data.orderid
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res0) {
if(res0.data.status==1){
wx.showToast({
title: res0.data.msg,
icon: "none",
duration: 3000
})
that.setData({
orderseef0Hidden:true
})
that.clearCache();
that.getlist(0);
}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"
})
}
},closeorderpay:function(e) {
that.setData({
orderpayHidden:true
})
},inorderpay:function(e) {
},closeorderseef:function(e) {
that.setData({
orderseefHidden:true
})
},closeorderseef0:function(e) {
that.setData({
orderseef0Hidden:true
})
},oncancel:function(e) {
var id = e.currentTarget.dataset.id
that.setData({
orderid:id
})
wx.showModal({
title: '取消提示',
content: '此操作不可恢复!您确认要取消吗?',
success (res1) {
if (res1.confirm) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"CancelOrder",
userId:(userId==null?"":userId),
LoginId:(LoginId==null?"":LoginId),
orderid:that.data.orderid
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 3000
})
that.clearCache();
that.getlist(0);
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
}
})
}
}
})
},onqysh:function(e) {
var id = e.currentTarget.dataset.id
that.setData({
orderid:id
})
wx.showModal({
title: '友情提示',
content: '确认收货前请确认您是否真的已经收到货了?您确认要收货吗?',
success (res1) {
if (res1.confirm) {
var userId = wx.getStorageSync("userId")
var LoginId = wx.getStorageSync("LoginId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"qyshorder",
userId:(userId==null?"":userId),
LoginId:(LoginId==null?"":LoginId),
orderid:that.data.orderid
},
method:"POST",
dataType:"json",
header: {
"content-type": "application/x-www-form-urlencoded" // 默认值
},
success (res) {
if(res.data.status==1){
wx.showToast({
title: res.data.msg,
icon: "success",
duration: 3000
})
that.clearCache();
that.getlist(0);
}else{
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 3000
})
}
}
})
}
}
})
},onorderdetail:function(e) {
var id = e.currentTarget.dataset.id
wx.navigateTo({
url: "../myorderinfo/index?id=" + id + "&t=" + that.data.t
})
},ondetail:function(e) {
var id = e.currentTarget.dataset.id
wx.navigateTo({
url: "../details/index?id=" + id
})
},onckwl:function(e) {
var wlxx = e.currentTarget.dataset.id
wx.navigateTo({
url: "../myorderwlxx/index?wlxx=" + wlxx
})
}
})

3
pages/myorder/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "我的商城订单"
}

96
pages/myorder/index.wxml Normal file
View File

@@ -0,0 +1,96 @@
<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==3?"hover":""}}' bindtap="onnav" data-id="3">待收货</view>
<view class='{{nav==4?"hover":""}}' bindtap="onnav" data-id="4">已完成</view>
</view>
<view class="myorder-box" wx:for="{{myorder}}" wx:for-index="index" hidden="{{orderHidden}}">
<view class="myorder-item">
<view>
<text>订单号:</text>{{item.orderid}}
</view>
<view class="Total">
<text>数量:</text>{{item.Totalnum}} <text class="Totalprice">金额:</text>¥{{item.Totalprice}}
</view>
<view>
<text>下单时间:</text>{{item.SubmitDate}}
</view>
<view>
<text style="width: 5em;">状态:</text>{{item.status0}}
</view>
<view class="cz_box">
<view wx:if="{{item.Payed=='0'}}" bindtap="onshowpay" 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">
<view bindtap="ondetail" data-id="{{pitem.prodid}}">
<image src="{{pitem.prodimg}}"></image>
<text>{{pitem.prodName}}</text>
</view>
</view>
</view>
</view>
<view class="nodata" hidden="{{noorderHidden}}">
<image src="{{orderImg}}" class="order-image"/>
<view>{{tipWords}}</view>
</view>
</view>
<view class="Hidden_box" hidden="{{orderpayHidden}}" bindtap="closeorderpay">
<view class="Hidden_box_to" catchtap="inorderpay">
<view class="Hidden_box_title">
<text>付款</text>
<view class="close" bindtap="closeorderpay"><image src="../../images/close.png" /></view>
</view>
<view class="frombody">
<view class="pay_box">
<text class="pay_type">支付方式:</text>
<view class='hover' bindtap="weixinpay"><image src="../../images/weixinpay.png"/><view>微信支付</view></view>
</view>
<view class="button">
<button bindtap="qypay">确认</button>
</view>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{orderseefHidden}}" bindtap="closeorderseef">
<view class="Hidden_box_to" catchtap="inorderpay">
<view class="Hidden_box_title">
<text>确认审核</text>
<view class="close" bindtap="closeorderseef"><image src="../../images/close.png" /></view>
</view>
<view class="frombody">
<image src="{{image}}" bindtap="viewimages0" data-index="{{image}}" data-index0="{{image0}}"></image>
<image src="{{image0}}" bindtap="viewimages1" data-index="{{image}}" data-index0="{{image0}}"></image>
</view>
<view class="button">
<button bindtap="qyseef">确认</button>
</view>
</view>
</view>
<view class="Hidden_box" hidden="{{orderseef0Hidden}}" bindtap="closeorderseef0">
<view class="Hidden_box_to" catchtap="inorderpay">
<view class="Hidden_box_title">
<text>确认驳回</text>
<view class="close" bindtap="closeorderseef0"><image src="../../images/close.png" /></view>
</view>
<view class="frombody">
<view>
<text>驳回原因:</text><input name="bhyy" type="text" value="{{bhyy}}" bindinput='getbhyyValue' />
</view>
<image src="{{image}}" bindtap="viewimages0" data-index="{{image}}" data-index0="{{image0}}"></image>
<image src="{{image0}}" bindtap="viewimages1" data-index="{{image}}" data-index0="{{image0}}"></image>
</view>
<view class="button">
<button bindtap="qyseef0">确认</button>
</view>
</view>
</view>
<loading hidden="{{loadingHidden}}">
加载中...
</loading>

56
pages/myorder/index.wxss Normal file
View File

@@ -0,0 +1,56 @@
page{
background: #ccc;
}
.container {
position: relative;
width: 100%;
height: 100%;
font-size: 14px;
color: #000;
}
.myorder-menu{display: flex;flex-direction: row;align-items: center;justify-content: center;width:100%; background-color: #fff;}
.myorder-menu view{width:25%; height:2.5em; line-height: 2.5em; text-align: center; border:1px solid #f1f1f1; border-left:0;border-top: 0;}
.myorder-menu view.hover{border-bottom:1px solid #ff4d00;}
.myorder-box{display: flex;flex-direction: column;align-items: center;justify-content: center;width:100%;padding:0.8em; box-sizing: border-box;}
.myorder-item{width:100%;display: flex;flex-direction: column; align-items: center;justify-content: center;box-sizing: border-box; padding:0.8em; margin:0.8em 0; margin-top: 0; line-height: 2.5em; background-color:#fff;border-radius:0.5em;}
.myorder-item view{width:100%;display: flex;flex-direction: row; align-items: center;justify-content:left;color: #939393;}
.myorder-item view text{color: #000;}
.myorder-item view text.Totalprice{ margin-left: 1em;}
.myorder-item view.cz_box{ margin-top: 0.5em;}
.myorder-item view.Total{color:#ff4d00;}
.myorder-item view.cz_box text{float: left; display: block;width:auto;}
.myorder-item view.cz_box view{float: left; display: block;width:auto; margin-right:0.5em; padding:0 0.5em; height:2.5em; line-height: 2.5em; background:linear-gradient(to right,#00B050,#00B050); color:#fff; border-radius:0.2em; box-sizing: border-box; overflow: hidden;}
.myorder-item view.products{ margin-top: 1em;}
.myorder-item view.products image{width:4em;height:4em; vertical-align: middle;}
.myorder-item view.products text{margin-left: 1em;}
.Hidden_box{ position: fixed;display: flex;align-items: center; justify-content: center; top:0; left:0; width:100%;height:100vh; background:rgba(0, 0, 0, 0.5);}
.Hidden_box_to{position: relative; padding: 8px; width:98%;height:auto; background-color: #fff; box-sizing: border-box; border-radius:0.5em;}
.Hidden_box_to.addcart_box{ position: absolute; bottom:0; width:100%;border-radius:0.5em 0.5em 0 0;}
.Hidden_box_to .Hidden_box_title{width:100%;height:2.5em; line-height: 2.5em; text-align: left; box-sizing: border-box;border-bottom:1px solid #f1f1f1; font-weight: 800;}
.Hidden_box_to .close{position: absolute; right:0.5em; top:0.5em; width:1.5em; height:1.5em; padding:0.15em; background-color:#fff;border:1px solid #f1f1f1;border-radius:50%;box-sizing:border-box;}
.Hidden_box_to .close image{float:left;width:100%;height:100%; position: relative;}
.Hidden_box_to .title{width:100%;height:2.5em;}
.Hidden_box_to .frombody{display: flex;flex-direction: column;flex: 1; max-height: 24em; align-items: center;justify-content: center;overflow: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;}
.Hidden_box_to .frombody image{width: 100%;}
.Hidden_box_to .frombody view{display: flex; flex-direction: row; width: 100%;margin: 0.8em 0;}
.Hidden_box_to .frombody view text{width: 7em; margin-top:0.4em;}
.Hidden_box_to .frombody view input{width:100%;height: 2em; border:1px #dfdfdf solid; background-color: #f1f1f1; border-radius:0.4em;padding:0 0.2em;box-sizing: border-box;}
.Hidden_box_to .frombody .pay_box{margin-top: 1em;}
.Hidden_box_to .frombody .pay_box text{display: block; float:left; width:10%; height:2.5em;}
.Hidden_box_to .frombody .pay_box text.pay_type{width:auto;line-height:2.5em;height:2.5em;}
.Hidden_box_to .frombody .pay_box view{float:left; padding:0 0.2em; margin-right:0.2em; display: flex; align-items: center; justify-content: center;line-height:2.5em;height:2.5em; border:1px solid #f1f1f1; box-sizing: border-box;border-radius:0.5em;width:7em;}
.Hidden_box_to .frombody .pay_box view.hover{border:1px solid #ff4d00;}
.Hidden_box_to .frombody .pay_box view image{width:1.4em;height:1.4em;}
.Hidden_box_to .frombody .pay_box view view{flex-grow: 1;line-height:100%;height:100%; border:0;}
.Hidden_box_to view.button{margin:1em 0; border: 0;}
.Hidden_box_to view.button button{width:100%;padding:0 1em; height:2em; line-height: 2em; background:linear-gradient(to right,#00B050,#00B050); color:#fff; border-radius:0.2em;}
.nodata{padding-top:1em; text-align: center; line-height: 1.5em; color:#939393;}
.nodata image {
width: 80px;
height: 80px;
}