银花优选微信小程序修改后的最新版本代码
This commit is contained in:
460
pages/myorderinfo/index.js
Normal file
460
pages/myorderinfo/index.js
Normal file
@@ -0,0 +1,460 @@
|
||||
|
||||
var app = getApp();
|
||||
var that=null;
|
||||
var sopenFrame=null;
|
||||
var WxParse = null;
|
||||
var iftj=0;
|
||||
Page( {
|
||||
data: {
|
||||
loadingHidden:false,
|
||||
orderpayHidden:true,
|
||||
orderyhHidden:true,
|
||||
orderyhHidden0:true,
|
||||
orderseefHidden:true,
|
||||
orderseef0Hidden:true,
|
||||
checked:0,
|
||||
xytitle:"",
|
||||
xybody:"",
|
||||
bhyy:"",
|
||||
myorder:[],
|
||||
shipments:[],
|
||||
zftype:2,
|
||||
ttype:0,
|
||||
t:0,
|
||||
image:"",
|
||||
image0:"",
|
||||
Payed:0,
|
||||
Shipped:0,
|
||||
FHEnable2:"0",
|
||||
orderid:"",
|
||||
oid:0,
|
||||
apiurl:""
|
||||
},
|
||||
|
||||
onLoad: function(options) {
|
||||
that = this
|
||||
WxParse = require('../../wxParse/wxParse.js');
|
||||
if(options.id){
|
||||
that.setData({
|
||||
oid:options.id
|
||||
})
|
||||
}
|
||||
if(options.orderid){
|
||||
that.setData({
|
||||
orderid:options.orderid
|
||||
})
|
||||
}
|
||||
if(options.t){
|
||||
that.setData({
|
||||
t:options.t
|
||||
});
|
||||
}
|
||||
that.rdata()
|
||||
|
||||
},rdata: function() {
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var LoginId = wx.getStorageSync("LoginId")
|
||||
var userInfodata = wx.getStorageSync("userInfo")
|
||||
if(userId&&LoginId&&userInfodata){
|
||||
var userInfo = JSON.parse(userInfodata)
|
||||
|
||||
}
|
||||
|
||||
wx.request({
|
||||
url: app.globalData.apiurl + "/xapiajax.ashx",
|
||||
data: {
|
||||
action:"getordersinfo",
|
||||
orderId:that.data.oid,
|
||||
id:that.data.orderid,
|
||||
userId:(userId==null?"":userId),
|
||||
LoginId:(LoginId==null?"":LoginId)
|
||||
},
|
||||
method:"GET",
|
||||
dataType:"json",
|
||||
header: {
|
||||
"content-type": "application/json" // 默认值
|
||||
},
|
||||
success (res) {
|
||||
if(res.data.status==1){
|
||||
// 处理每个订单数据,将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, ',');
|
||||
}
|
||||
}
|
||||
that.setData({
|
||||
myorder: res.data.data,
|
||||
shipments: res.data.shipments,
|
||||
xytitle:res.data.xytitle,
|
||||
loadingHidden:true
|
||||
})
|
||||
WxParse.wxParse('xybody', 'html', res.data.xybody, that);
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},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]
|
||||
})
|
||||
},onshowpay:function(e) {
|
||||
var id = e.currentTarget.dataset.id
|
||||
that.setData({
|
||||
orderpayHidden:false,
|
||||
orderid:id
|
||||
})
|
||||
},weixinpay:function(e) {
|
||||
that.setData({
|
||||
zftype:0
|
||||
})
|
||||
},jianjinpay:function(e) {
|
||||
that.setData({
|
||||
zftype:2
|
||||
})
|
||||
},qypay:function() {
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var LoginId = wx.getStorageSync("LoginId")
|
||||
var openid = wx.getStorageSync("openid");
|
||||
if(iftj==0){
|
||||
iftj=1;
|
||||
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) {
|
||||
iftj=0;
|
||||
if(res0.data.ResultId>0){
|
||||
wx.requestPayment({
|
||||
timeStamp: res0.data.timeStamp,
|
||||
nonceStr: res0.data.noncestr,
|
||||
package: res0.data.package,
|
||||
signType: 'MD5',
|
||||
paySign: res0.data.paySign,
|
||||
success (res) {
|
||||
app.globalData.IFRefreshmyorder=1;
|
||||
that.rdata();
|
||||
},
|
||||
fail (res) {
|
||||
wx.showToast({
|
||||
title: JSON.stringify(res),
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})}
|
||||
})
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res0.data.msg,
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
},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")
|
||||
if(iftj==0){
|
||||
iftj=1;
|
||||
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) {
|
||||
iftj=0;
|
||||
if(res.data.status==1){
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: "success",
|
||||
duration: 3000
|
||||
})
|
||||
app.globalData.IFRefreshmyorder=1;
|
||||
that.rdata();
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},onwyth: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")
|
||||
if(iftj==0){
|
||||
iftj=1;
|
||||
wx.request({
|
||||
url: app.globalData.apiurl + "/xapiajax.ashx",
|
||||
data: {
|
||||
action:"qythorder",
|
||||
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) {
|
||||
iftj=0;
|
||||
if(res.data.status==1){
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: "success",
|
||||
duration: 3000
|
||||
})
|
||||
that.rdata();
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},onshowwyyh:function(e) {
|
||||
|
||||
that.setData({
|
||||
orderyhHidden:false
|
||||
})
|
||||
},closeorderyh:function(e) {
|
||||
that.setData({
|
||||
orderyhHidden:true
|
||||
})
|
||||
},closeorderyh0:function(e) {
|
||||
that.setData({
|
||||
orderyhHidden0:true
|
||||
})
|
||||
},onchecked:function(e) {
|
||||
if(that.data.checked==0){
|
||||
that.setData({
|
||||
checked:1
|
||||
})
|
||||
}else{
|
||||
that.setData({
|
||||
checked:0
|
||||
})
|
||||
}
|
||||
},openxy:function(e) {
|
||||
that.setData({
|
||||
orderyhHidden0:false
|
||||
})
|
||||
},onwyyh:function(e) {
|
||||
|
||||
if(that.data.checked==0){
|
||||
wx.showToast({
|
||||
title: "请先阅读" + that.data.xytitle,
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
}else{
|
||||
|
||||
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var LoginId = wx.getStorageSync("LoginId")
|
||||
if(iftj==0){
|
||||
iftj=1;
|
||||
wx.request({
|
||||
url: app.globalData.apiurl + "/xapiajax.ashx",
|
||||
data: {
|
||||
action:"qyyhorder",
|
||||
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) {
|
||||
iftj=0;
|
||||
if(res.data.status==1){
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: "success",
|
||||
duration: 3000
|
||||
})
|
||||
that.setData({
|
||||
orderyhHidden:true
|
||||
})
|
||||
that.rdata();
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},onqysh:function(e) {
|
||||
var id = e.currentTarget.dataset.id
|
||||
|
||||
wx.showModal({
|
||||
title: '友情提示',
|
||||
content: '确认收货前请确认您是否真的已经收到货了?您确认要收货吗?',
|
||||
success (res1) {
|
||||
if (res1.confirm) {
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var LoginId = wx.getStorageSync("LoginId")
|
||||
if(iftj==0){
|
||||
iftj=1;
|
||||
wx.request({
|
||||
url: app.globalData.apiurl + "/xapiajax.ashx",
|
||||
data: {
|
||||
action:"qyshorder",
|
||||
userId:(userId==null?"":userId),
|
||||
LoginId:(LoginId==null?"":LoginId),
|
||||
id:id
|
||||
},
|
||||
method:"POST",
|
||||
dataType:"json",
|
||||
header: {
|
||||
"content-type": "application/x-www-form-urlencoded" // 默认值
|
||||
},
|
||||
success (res) {
|
||||
iftj=0;
|
||||
if(res.data.status==1){
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: "success",
|
||||
duration: 3000
|
||||
})
|
||||
app.globalData.IFRefreshmyorder=1;
|
||||
that.rdata();
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},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
|
||||
})
|
||||
},copyText:function(e) {
|
||||
wx.setClipboardData({
|
||||
data: e.currentTarget.dataset.text,
|
||||
success: function (res) {
|
||||
wx.getClipboardData({
|
||||
success: function (res) {
|
||||
wx.showToast({
|
||||
title: '复制成功'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
3
pages/myorderinfo/index.json
Normal file
3
pages/myorderinfo/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
110
pages/myorderinfo/index.wxml
Normal file
110
pages/myorderinfo/index.wxml
Normal file
@@ -0,0 +1,110 @@
|
||||
<import src="../../wxParse/wxParse.wxml"/>
|
||||
<view class="container">
|
||||
|
||||
<view class="myorder-box" wx:for="{{myorder}}" wx:for-index="index">
|
||||
<view class="myorder-item">
|
||||
<view>
|
||||
<text>订单号:</text>{{item.orderid}}<image bindtap='copyText' data-text="{{item.orderid}}" src="../../images/copy.png"></image>
|
||||
</view>
|
||||
<view class="address" wx:if="{{item.Guests!='无需发货'}}">
|
||||
<text>发货地址:</text><view>{{item.address}}</view><image bindtap='copyText' data-text="{{item.address}}" src="../../images/copy.png"></image>
|
||||
</view>
|
||||
<view class="Total">
|
||||
<text>数量:</text>{{item.Totalnum}}
|
||||
</view>
|
||||
<view class="Total">
|
||||
<text>金额:</text>¥{{item.Totalprice}}
|
||||
</view>
|
||||
<view class="Guests">
|
||||
<text>下单时间:</text>{{item.SubmitDate}}
|
||||
</view>
|
||||
<view class="Guests" wx:if="{{item.Guests!='无需发货'}}">
|
||||
<text>备注留言:</text><view>{{item.Guests}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<text style="width:5em;">状态:</text>{{item.status0}}
|
||||
</view>
|
||||
<view class="cz_box">
|
||||
|
||||
<view wx:if="{{item.Payed=='0'}}" bindtap="oncancel" data-id="{{item.O_Id}}">取消</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
<view class="shipments" wx:for="{{shipments}}" wx:for-item="item">
|
||||
<view><text>发货数量:</text>{{item.num}}</view>
|
||||
<view><text>快递单号:</text>{{item.kdcompay}}{{item.kdorderid}}</view>
|
||||
<view><text>备注:</text>{{item.content}}</view>
|
||||
<view><text>状态:</text><view wx:if="{{item.seef==0}}" class="mybtn" bindtap="onqysh" data-id="{{item.id}}">确认收货</view><view wx:if="{{item.seef==1}}">已确认收货</view></view>
|
||||
</view>
|
||||
<view class="products" wx:for="{{item.pics}}" wx:for-item="pitem">
|
||||
<view><image src="{{apiurl + pitem.prodimg}}" bindtap="ondetail" data-id="{{pitem.prodid}}"></image>
|
||||
<view><view bindtap="ondetail" data-id="{{pitem.prodid}}">{{pitem.prodName}}</view>
|
||||
<view>编号:{{pitem.bianhao}}<image bindtap='copyText' data-text="{{pitem.bianhao}}" src="../../images/copy.png"></image></view>
|
||||
<view class="Total"><text>数量:</text>{{pitem.num}}<text class="Totalprice">金额:</text>{{pitem.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</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='{{zftype==2?"hover":""}}' bindtap="jianjinpay" hidden="FHEnableHidden"><image src="../../images/jianjinpay.png?t=0"/>余额支付</view>
|
||||
<view wx:if="{{FHEnable2==0}}" class='{{zftype==0?"hover":""}}' bindtap="weixinpay"><image src="../../images/weixinpay.png?t=0"/>微信支付</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="button">
|
||||
<button bindtap="qypay">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="Hidden_box" hidden="{{orderyhHidden}}" bindtap="closeorderyh">
|
||||
<view class="Hidden_box_to" catchtap="inorderpay">
|
||||
<view class="Hidden_box_title">
|
||||
<text>确认易货</text>
|
||||
<view class="close" bindtap="closeorderyh"><image src="../../images/close.png" /></view>
|
||||
</view>
|
||||
<view class="frombody">
|
||||
|
||||
<view class="check_box">
|
||||
<view class='checkbox {{checked==1?"checked":""}}' bindtap="onchecked"></view><view class="fontbox"><text bindtap="onchecked">我已阅读并同意</text><text bindtap="openxy" class="ptgztitle">《{{xytitle}}》</text></view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="button">
|
||||
<button bindtap="onwyyh">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="Hidden_box" hidden="{{orderyhHidden0}}" bindtap="closeorderyh0">
|
||||
<view class="Hidden_box_to" catchtap="inorderpay">
|
||||
<view class="title">{{xytitle}}</view>
|
||||
<view class="close" bindtap="closeorderyh0"><image src="../../images/close.png" /></view>
|
||||
<view class="frombody">
|
||||
<view class="wxParse">
|
||||
<template is="wxParse" data="{{wxParseData:xybody.nodes}}"/>
|
||||
</view>
|
||||
<view class="button">
|
||||
<button bindtap="closeorderyh0">已阅读</button>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<loading hidden="{{loadingHidden}}">
|
||||
加载中...
|
||||
</loading>
|
||||
95
pages/myorderinfo/index.wxss
Normal file
95
pages/myorderinfo/index.wxss
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user