发货+兼容苹果
This commit is contained in:
@@ -4,14 +4,16 @@
|
||||
<!-- 顶部导航栏 -->
|
||||
<z-nav-bar title="物流详情"></z-nav-bar>
|
||||
</view>
|
||||
<view class="" style="margin-bottom: 20rpx; font-size: 28rpx;">
|
||||
<view class="kuaidiItem">运单号: {{expressOrderSn}}
|
||||
<u-tag @click="copyData(expressOrderSn)" class="copyCode" text="复制" plain type="success" /></view>
|
||||
</view>
|
||||
<view v-if="deliverDetails.length > 0">
|
||||
<!-- <u-tabs active-color="#2979ff" inactive-color="#606266" bar-height="6" bar-width="40"
|
||||
name="name" :list="deliverList" :is-scroll="false" :current="current" @change="tabchange"></u-tabs> -->
|
||||
<view class="deliverCntent">
|
||||
<view class="">
|
||||
<view class="">
|
||||
|
||||
<view class="kuaidiItem">{{expressCompanyName}} {{expressOrderSn}}
|
||||
<u-tag @click="copyData(expressOrderSn)" class="copyCode" text="复制" plain type="success" /></view>
|
||||
<view v-for="(item, index) in deliverDetails" :class="['item',index == 0 ? 'first':'' ]">
|
||||
<view class="flexbox">
|
||||
<view class="img_icon "></view>
|
||||
@@ -25,9 +27,8 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="quesheng" v-else>
|
||||
<image src="../../static/icon/kongbai.png" ></image>
|
||||
<text>- 暂无物流信息 -</text>
|
||||
<view class="quesheng" v-else>
|
||||
<u-divider text="- 暂无物流信息 -"></u-divider>
|
||||
</view>
|
||||
<music-play :playData="playData"></music-play>
|
||||
<public-module></public-module>
|
||||
@@ -49,26 +50,23 @@
|
||||
playData:{},
|
||||
loading: false,
|
||||
orderId: null,
|
||||
deliverDetails: [{
|
||||
Traces: []
|
||||
}],
|
||||
deliverDetails: [],
|
||||
express:{}, // 面单
|
||||
consignee:{}, // 收件人信息
|
||||
expressOrderSn:'', // 运单号
|
||||
expressCompanyCode:'', //快递编码
|
||||
expressCompanyName:'' ,// 快递公司
|
||||
// expressCompanyCode:'', //快递编码
|
||||
// expressCompanyName:'' ,// 快递公司
|
||||
orderSn : '',
|
||||
current: 0,
|
||||
deliverList: [],
|
||||
deliverDetailsLength: null,
|
||||
orderContet:{},
|
||||
sheetList:[]
|
||||
orderContet:{},
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.expressOrderSn = e.expressOrderSn
|
||||
this.expressCompanyCode = e.expressCompanyCode
|
||||
this.expressCompanyName = e.expressCompanyName
|
||||
// this.expressCompanyCode = e.expressCompanyCode
|
||||
// this.expressCompanyName = e.expressCompanyName
|
||||
//this.express = e.express
|
||||
//this.consignee = e.consignee
|
||||
console.log(e,'传入的参数')
|
||||
@@ -122,21 +120,7 @@
|
||||
console.log(this.orderContet,'订单详情')
|
||||
})
|
||||
},
|
||||
// getSheetInfo(){
|
||||
// console.log('查询快递信息')
|
||||
// this.$http
|
||||
// .get(`express/getPrintTemplateList?expressOrderSn=${this.orderSn}`)
|
||||
// .then(res => {
|
||||
// if(res.code == 0){
|
||||
// this.sheetList = res.result.data
|
||||
// console.log(res,'面单信息')
|
||||
// this.getdeliverDetails()
|
||||
// }
|
||||
// }).catch(e => {
|
||||
// console.log('e',e)
|
||||
|
||||
// })
|
||||
// },
|
||||
|
||||
// 复制到剪切板
|
||||
copyData(data){
|
||||
uni.setClipboardData({
|
||||
@@ -153,29 +137,30 @@
|
||||
// 获取物流
|
||||
getdeliverDetails() {
|
||||
this.deliverList = []
|
||||
var strLength = this.orderContet.consignee.consigneeMobile.length
|
||||
var subMobile = this.orderContet.consignee.consigneeMobile.substring(strLength-4,strLength)
|
||||
// var strLength = this.orderContet.consignee.consigneeMobile.length
|
||||
// var subMobile = this.orderContet.consignee.consigneeMobile.substring(strLength-4,strLength)
|
||||
// this.expressOrderSn = 'SF1504651506851'
|
||||
// this.expressCompanyCode = 'SF'
|
||||
// subMobile = '9277'
|
||||
uni.showLoading()
|
||||
this.$http
|
||||
//.post(`/book/buyOrder/queryFMS?orderId=${this.orderId}`)
|
||||
.get(`/book/buyOrder/queryExpress?expressOrderSn=${this.expressOrderSn}&expressCompanyCode=${this.expressCompanyCode}&customerName=${subMobile}`)
|
||||
.get(`/book/buyOrder/searchExpress?expressOrderSn=${this.expressOrderSn}`)
|
||||
.then(res => {
|
||||
console.log(res, '物流信息')
|
||||
if (res && res.code === 0) {
|
||||
uni.hideLoading()
|
||||
// this.deliverDetails = res.result.traces
|
||||
console.log(res.result.traces,'物流信息')
|
||||
// res.rntStr.forEach((item, index) => {
|
||||
this.deliverDetails = res.result.traces.reverse()
|
||||
// item.Traces = item.Traces.reverse()
|
||||
// //console.log(item)
|
||||
// this.deliverList.push({'name':item.ShipperName})
|
||||
// })
|
||||
console.log(res.express.traces,'物流信息')
|
||||
if(res.express.traces.length > 0){
|
||||
this.deliverDetails = res.express.traces.reverse()
|
||||
}else{
|
||||
this.deliverDetails = []
|
||||
}
|
||||
|
||||
}
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
console.log(e,'e')
|
||||
})
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
<z-nav-bar title="订单详情"></z-nav-bar>
|
||||
<view class="adDefault" v-if="consigneeShow">
|
||||
<view class="adDefault" v-if="consigneeShow && orderContet.orderType == 'order'">
|
||||
<view class="defalTop">
|
||||
<text class="userName">
|
||||
{{orderContet.consignee.consigneeName}}
|
||||
@@ -21,7 +21,7 @@
|
||||
</view>
|
||||
|
||||
<view class="orderList" v-if="consigneeShow">
|
||||
<view class="" v-if="sheetList.length > 1" style="background-color: rgb(113, 213, 161); margin-bottom: 20rpx; border-radius: 20rpx; color: #fff; font-size: 28rpx; padding: 10rpx;">
|
||||
<view class="" v-if="sheetList.length > 1 && orderContet.orderStatus==2" style="background-color: rgb(113, 213, 161); margin-bottom: 20rpx; border-radius: 20rpx; color: #fff; font-size: 28rpx; padding: 10rpx;">
|
||||
订单已被拆分成 {{sheetList.length}} 个包裹
|
||||
</view>
|
||||
<view class="orderItem">
|
||||
@@ -74,7 +74,7 @@
|
||||
<span style="color: #666;margin-right: 10rpx;float: left;">商品总价 : </span>
|
||||
<span>¥</span>{{orderContet.orderPrice}}
|
||||
</view>
|
||||
<view class="orderReal">
|
||||
<view class="orderReal" v-if="orderContet.orderType == 'order'"">
|
||||
<span style="color: #666;margin-right: 10rpx;float: left;">运费 : </span>
|
||||
<span>¥</span>{{orderContet.shippingPrice}}
|
||||
</view>
|
||||
@@ -99,17 +99,17 @@
|
||||
<span style="color: #666;margin-right: 10rpx;float: left;">付款时间 : </span>
|
||||
<text style="font-size: 24rpx;color: #666;">{{orderContet.paymentDate}}</text>
|
||||
</view>
|
||||
<view class="orderReal" v-if="orderContet.orderStatus >= 2 && orderContet.orderStatus != 5">
|
||||
<!-- <view class="orderReal" v-if="orderContet.orderStatus >= 2 && orderContet.orderStatus != 5">
|
||||
<span style="color: #666;margin-right: 10rpx;float: left;">发货时间 : </span>
|
||||
<text style="font-size: 24rpx;color: #666;">{{orderContet.shippingTime}}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="orderOper">
|
||||
<view style="width: 100%; text-align: right;">
|
||||
<!-- <u-button text="" type="success" plain ></u-button>
|
||||
<u-button text="" type="primary" plain >
|
||||
|
||||
</u-button> -->
|
||||
<view v-if="orderContet.orderStatus>=2 && sheetList.length > 0 && orderContet.orderStatus != 5" class="opFix" @click="seeExpressDetail(orderContet)">查看物流</view>
|
||||
<view v-if="orderContet.orderStatus==2 && sheetList.length > 0 && orderContet.orderStatus != 5" class="opFix" @click="seeExpressDetail(orderContet)">查看物流</view>
|
||||
<view v-if="orderContet.orderStatus==2" class="opCan" @click="OverOrder" >确认收货</view>
|
||||
|
||||
<view v-if="orderContet.orderStatus==0" class="opFix" @click="canceOrder">取消订单</view>
|
||||
@@ -175,9 +175,12 @@
|
||||
<view class="title">
|
||||
请选择要查看包裹
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="list">
|
||||
<view class="item" v-for="(item,index) in sheetList" @click="seeExpressDetails(item)">
|
||||
包裹 {{index+1}}
|
||||
<h4 style="margin-bottom: 10rpx;">包裹 {{index+1}}</h4>
|
||||
<view class="">运单号:{{item.expressOrderSn}}
|
||||
<u-tag @click="copyData(item.expressOrderSn)" size="mini" class="copyCode" text="复制单号" plain type="success" /></view>
|
||||
<view class="">发货时间:{{item.createTime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -269,6 +272,15 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 复制到剪切板
|
||||
copyData(data){
|
||||
uni.setClipboardData({
|
||||
data,
|
||||
success: function () {
|
||||
console.log('success');
|
||||
}
|
||||
});
|
||||
},
|
||||
seeExpressDetails(item){
|
||||
console.log(item,'item')
|
||||
uni.navigateTo({
|
||||
@@ -516,7 +528,7 @@
|
||||
}else if(this.sheetList.length == 1){
|
||||
// 直接展示详情
|
||||
uni.navigateTo({
|
||||
url: "./deliverDetail?orderSn=" + item.orderSn + "&expressOrderSn=" + this.sheetList[0].expressOrderSn + "&expressCompanyCode="+this.sheetList[0].expressCompanyCode + "&expressCompanyName="+this.sheetList[0].expressCompanyName
|
||||
url: "./deliverDetail?orderSn=" + item.orderSn + "&expressOrderSn=" + this.sheetList[0].expressOrderSn
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -570,9 +582,9 @@
|
||||
.get(`/book/buyOrder/orderDetail?orderSn=${this.orderSn}`)
|
||||
.then(res => {
|
||||
console.log('订单详情',res)
|
||||
var seconds = res.result.timestamp + 30 * 60 + 2 // 过期时间
|
||||
var nowSeconds = Math.floor(new Date().getTime() / 1000);
|
||||
res.result.overTime = seconds - nowSeconds
|
||||
// var seconds = res.result.timestamp + 30 * 60 + 2 // 过期时间
|
||||
// var nowSeconds = Math.floor(new Date().getTime() / 1000);
|
||||
// res.result.overTime = seconds - nowSeconds
|
||||
|
||||
this.orderContet = res.result
|
||||
this.consigneeShow = true
|
||||
@@ -590,63 +602,15 @@
|
||||
} else if (this.orderContet.orderStatus == 3) {
|
||||
this.titleStat = '已完成'
|
||||
}
|
||||
|
||||
|
||||
if(parseInt(this.orderContet.orderStatus) >= 2){
|
||||
// 查询快递信息
|
||||
// this.getSheetInfo()
|
||||
if(this.orderContet.goodsList.length > 0){
|
||||
this.sheetList = []
|
||||
// console.log('存在商品数据', this.orderContet.goodsList.length)
|
||||
// var ids = []
|
||||
// ids.push(this.orderContet.goodsList[0].expressInfo.expressOrderSn)
|
||||
// this.sheetList.push(this.orderContet.goodsList[0].expressInfo)
|
||||
// for (let index = 1; index < this.orderContet.goodsList.length; index++) {
|
||||
// // if (!ids.includes(this.orderContet.goodsList[index].expressInfo.expressOrder)) {
|
||||
// ids.push(this.orderContet.goodsList[index].expressInfo.expressOrderSn)
|
||||
// this.sheetList.push(this.orderContet.goodsList[index].expressInfo)}
|
||||
// console.log(this.orderContet.goodsList[index].expressInfo.expressOrderSn,'expressOrderSn')
|
||||
// // }
|
||||
// console.log(ids,this.sheetList,'this.sheetList')
|
||||
}
|
||||
}
|
||||
if(this.orderContet.orderStatus >= 2 && this.orderContet.orderType == 'order'){
|
||||
this.sheetList = this.orderContet.expressOrders
|
||||
}else{
|
||||
this.sheetList = []
|
||||
}
|
||||
console.log(this.orderContet,'订单详情')
|
||||
})
|
||||
},
|
||||
// getSheetInfo(){
|
||||
// console.log('查询快递信息')
|
||||
// this.$http
|
||||
// .get(`express/getPrintTemplateList?expressOrderSn=${this.orderSn}`)
|
||||
// .then(res => {
|
||||
// if(res.code == 0){
|
||||
// this.sheetList = res.result.data
|
||||
// console.log(res,'面单信息')
|
||||
// }
|
||||
// }).catch(e => {
|
||||
// console.log('e',e)
|
||||
|
||||
// })
|
||||
// },
|
||||
// 获取物流
|
||||
// getdeliverDetails() {
|
||||
// this.$http
|
||||
// .post(`/book/buyOrder/queryFMS?orderId=${this.orderID}`)
|
||||
// .then(res => {
|
||||
// if (res && res.code === 0) {
|
||||
// console.log(res, '物流信息')
|
||||
// // if(res.msg.indexOf('暂未查到物流信息') == -1){
|
||||
// // this.
|
||||
// // }
|
||||
// res.rntStr.forEach(item => {
|
||||
// item.Traces = item.Traces.reverse()
|
||||
// })
|
||||
// this.deliverDetails = res.rntStr
|
||||
// this.deliverDetailsLength = this.deliverDetails[0].Traces.length
|
||||
// } else {
|
||||
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
},
|
||||
|
||||
// 取消订单
|
||||
canceOrder() {
|
||||
uni.showModal({
|
||||
@@ -1038,7 +1002,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.copyCode{display: inline-block; margin-left: 20rpx; }
|
||||
.deliverCntent {
|
||||
padding: 32rpx;
|
||||
position: relative;
|
||||
|
||||
@@ -77,8 +77,10 @@
|
||||
style="font-weight: bold; color: #f56c6c;">{{ifex.realMoney}}</text>
|
||||
</view>
|
||||
<view class="orderOper" v-if="ifex.orderStatus==0">
|
||||
<view class="opFix" @click.stop="canceOrder(ifex)">取消订单</view>
|
||||
<view class="opCan" @click="goPay(ifex)">去支付</view>
|
||||
<view class="opFix" @click.stop = "canceOrder(ifex)">取消订单</view>
|
||||
<view class="opCan" @click.stop = "getNewIap" v-if="ifex.orderType == 'point' && ifex.paymentMethod == '3'">重新下单</view>
|
||||
<view class="opCan" v-else @click.stop = "goPay(ifex)">去支付</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="status==0" style="text-align: center;">
|
||||
@@ -151,7 +153,7 @@
|
||||
},
|
||||
onShow() {
|
||||
this.getOrderList()
|
||||
this.checkIapOrders() //检查未完成的苹果支付订单
|
||||
// this.checkIapOrders() //检查未完成的苹果支付订单
|
||||
this.getOS()
|
||||
// this.countDown()
|
||||
|
||||
@@ -185,6 +187,12 @@
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['setUserInfo']),
|
||||
// 苹果用户重新下单
|
||||
getNewIap(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/peanut/reCharge'
|
||||
})
|
||||
},
|
||||
// 倒计时回调
|
||||
countDown() {
|
||||
console.log('重新刷新订单')
|
||||
@@ -459,7 +467,7 @@
|
||||
}, function(e) {
|
||||
if (e.errCode == 2) {
|
||||
// 用户未绑定支付方式,app内支付流程结束,系统弹出框引导用户绑定支付方式,此过程将跳转到系统应用 AppStore 进行绑定支付方式,绑定成功同步支付成功,用户成功付款
|
||||
plus.runtime.openURL("https://apps.apple.com/account/billing");
|
||||
// plus.runtime.openURL("https://apps.apple.com/account/billing");
|
||||
} else {
|
||||
// restoreFlag = false; // 支付失败清楚标记
|
||||
that.finishTransaction(result);
|
||||
|
||||
Reference in New Issue
Block a user