物流信息

This commit is contained in:
quantulr
2024-05-10 15:18:51 +08:00
parent e3513e70fa
commit 67cdb9e667
14 changed files with 194 additions and 73 deletions

View File

@ -7,35 +7,102 @@ Page({
*/
data: {
records: [],
expressComName: [
"圆通速递",
"申通快递",
"极兔速递",
"中通快递",
"韵达快递",
"邮政快递包裹",
"顺丰速运",
"京东物流",
"EMS",
"邮政电商标快",
"邮政标准快递",
"德邦快递",
"菜鸟速递",
"德邦",
"中通快运",
"安能快运",
"顺丰快运",
"韵达快运",
"跨越速运",
"京东快运",
"百世快运",
"菜鸟速递",
],
currentExpressComIndex: 0,
expressComs: [
{ name: "圆通速递", code: "yuantong" },
{ name: "申通快递", code: "shentong" },
{ name: "极兔速递", code: "jtexpress" },
{ name: "中通快递", code: "zhongtong" },
{ name: "韵达快递", code: "yunda" },
{ name: "邮政快递包裹", code: "youzhengguonei" },
{ name: "顺丰速运", code: "shunfeng" },
{ name: "京东物流", code: "jd" },
{ name: "EMS", code: "ems" },
{ name: "邮政电商标快", code: "youzhengdsbk" },
{ name: "邮政标准快递", code: "youzhengbk" },
{ name: "德邦快递", code: "debangkuaidi" },
{ name: "菜鸟速递", code: "danniao" },
{ name: "德邦", code: "debangwuliu" },
{ name: "中通快运", code: "zhongtongkuaiyun" },
{ name: "安能快运", code: "annengwuliu" },
{ name: "顺丰快运", code: "shunfengkuaiyun" },
{ name: "韵达快运", code: "yundakuaiyun" },
{ name: "跨越速运", code: "kuayue" },
{ name: "京东快运", code: "jingdongkuaiyun" },
{ name: "百世快运", code: "baishiwuliu" },
{ name: "菜鸟速递", code: "cainiaozhisong" },
],
num: ""
},
expressComNames() {
return this.data.expressComs.map(el => el.name)
},
pickExpressCom(e) {
this.setData({
currentExpressComIndex: e.detail.value
})
this.getExpressData()
},
// 获取物流信息
getExpressData() {
getExpressDetail({
num: this.data.num,
com: this.data.expressComs[this.data.currentExpressComIndex].code,
success: (res) => {
if (res.data.status === "200") {
console.log(res.data.data);
this.setData({
records: res.data.data
})
} else {
this.setData({
records: []
}),
wx.showToast({
icon: "error",
title: res.data.message,
})
}
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// guessExpressCom({
// num: "YT7460149632645",
// key: "AjjPbmMP4727",
// success(resp) {
// console.log(resp);
// }
// })
const { logisticsNum, logisticsName } = options
const index = this.data.expressComs.findIndex(el => el.name === logisticsName)
this.setData({
num: "YT7460149632645"
})
getExpressDetail({
num: this.data.num,
success: (res) => {
console.log(res);
if (res.data.status === "200") {
console.log(res.data.data);
this.setData({
records: res.data.data
})
}
}
num: logisticsNum,
currentExpressComIndex: index < 0 ? 0 : index
})
this.getExpressData()
},
/**

View File

@ -1,10 +1,20 @@
<!--pages/logistics_details/logistics_details.wxml-->
<view style="padding:48rpx 48rpx 92rpx;">
<view style="margin-bottom: 36rpx;">圆通快递:{{num}}</view>
<view wx:for="{{records}}" class="record-item">
<view class="dot" />
<view class="line" />
<text class="time">{{item.time}}</text>
<text style="margin-top: 20rpx;">{{item.context}}</text>
<view style="margin-bottom: 36rpx;display: flex;align-items: center;">
<picker range="{{expressComName}}" value="{{currentExpressComIndex}}" bindchange="pickExpressCom">
<view style="display: flex;align-items: center;">
<image src="../../icon/arrows-exchange-alt-v.svg" style="width: 40rpx; height: 40rpx;" />
{{expressComs[currentExpressComIndex].name}}
</view>
</picker>{{num}}
</view>
<view wx:if="{{records.length}}">
<view wx:for="{{records}}" wx:key="context" class="record-item">
<view class="dot" />
<view class="line" />
<text class="time">{{item.time}}</text>
<text style="margin-top: 20rpx;">{{item.context}}</text>
</view>
</view>
<view wx:else style="text-align: center; margin: 256rpx 96rpx 0;">暂无物流信息,请检查快递单号或者快递公司是否正确,可以点击左上方快递公司名称选择正确的快递公司。</view>
</view>

View File

@ -27,7 +27,7 @@
z-index: 999;
}
.record-item:nth-child(2) .dot {
.record-item:nth-child(1) .dot {
background-color: red;
opacity: 1;
width: 24rpx;

View File

@ -9,7 +9,9 @@ Page({
select: false,
dataList: [],
orderAddress: false,
updateAddress: false,
addressIdXz: '',
oriAddr: ""
},
/**
@ -63,7 +65,12 @@ Page({
addressIdXz: options.addressId
})
}
if (options.updateAddress) {
this.setData({
updateAddress: options.updateAddress,
oriAddr: options.oriAddr
})
}
},
//选择地址

View File

@ -1,31 +1,40 @@
<view wx:if="{{updateAddress}}" style="padding: 0 24rpx;">
<view style="font-size: 48rpx;font-weight: bold;margin-top: 24rpx;text-align: center;">修改收货地址</view>
<view style="display: flex;align-items: center;margin-top: 12rpx;">
<image style="width: 96rpx;height: 96rpx;" src="../../../icon/发现.svg" />
<text style="font-size: 26rpx;margin-left: 16rpx;">从地址列表中选择一个地址,将其作为此订单的收货地址,选择后,如果已发货,将向后台发送修改地址申请,待客服同意申请后,才能完成地址修改。如果未发货,则无需客服处理直接修改。</text>
</view>
<view style="font-size: 36rpx;font-weight: bold;margin-top: 24rpx;">原地址</view>
<view style="margin-top: 12rpx;">{{oriAddr}}</view>
</view>
<view class='contAll' wx:for='{{dataList}}' wx:key="index">
<view class="title">收货人信息</view>
<view class="cont display_J_B" catchtap="{{orderAddress?'select':''}}" data-index='{{index}}'>
<view class="contL">
<view class="details ">{{item.addressDetailed}}
<view class="default" wx:if="{{item.addressDefault==1}}">默认</view>
</view>
<view class="phone">{{item.addressProvince}} {{item.addressCity}} {{item.addressArea}}</view>
<view class="phone"><text style="margin-right:30rpx;">姓名:{{item.addressName}}</text>手机号码:{{item.addressPhone}}</view>
</view>
<view class="contR display_A_C" wx:if="{{orderAddress}}">
<view class="select">
<image src="{{item.select?'/icon/checked.png':'/icon/check.png'}}"></image>
</view>
</view>
</view>
<view class="btnAll display_J_B" wx:if="{{!orderAddress}}">
<view class="btn" catchtap="edit" data-id="{{item.id}}">编 辑</view>
<view class="btn" catchtap="del" data-id="{{item.id}}">删 除</view>
<view class="btnX"></view>
</view>
<view class="btnAll display_J_B" wx:if="{{orderAddress}}">
<view class="btn" style="width:100%;" catchtap="edit" data-id="{{item.id}}">编 辑</view>
</view>
<view class="title">收货人信息</view>
<view class="cont display_J_B" catchtap="{{orderAddress?'select':''}}" data-index='{{index}}'>
<view class="contL">
<view class="details ">{{item.addressDetailed}}
<view class="default" wx:if="{{item.addressDefault==1}}">默认</view>
</view>
<view class="phone">{{item.addressProvince}} {{item.addressCity}} {{item.addressArea}}</view>
<view class="phone"><text style="margin-right:30rpx;">姓名:{{item.addressName}}</text>手机号码:{{item.addressPhone}}</view>
</view>
<view class="contR display_A_C" wx:if="{{orderAddress}}">
<view class="select">
<image src="{{item.select?'/icon/checked.png':'/icon/check.png'}}"></image>
</view>
</view>
</view>
<view class="btnAll display_J_B" wx:if="{{!orderAddress}}">
<view class="btn" catchtap="edit" data-id="{{item.id}}">编 辑</view>
<view class="btn" catchtap="del" data-id="{{item.id}}">删 除</view>
<view class="btnX"></view>
</view>
<view class="btnAll display_J_B" wx:if="{{orderAddress}}">
<view class="btn" style="width:100%;" catchtap="edit" data-id="{{item.id}}">编 辑</view>
</view>
</view>
<view class="empty" wx:if="{{dataList.length==0}}">
<image src="/icon/adress_empty.png"></image>
<view>暂无收货地址请添加~</view>
<image src="/icon/adress_empty.png"></image>
<view>暂无收货地址请添加~</view>
</view>
<view class="height100"></view>
<view class="height100"></view>

View File

@ -163,19 +163,19 @@ Page({
})
},
viewLogisticsDetails(e) {
const { logisticsNum } = e.currentTarget.dataset
const { logisticsNum, logisticsName } = e.currentTarget.dataset
wx.navigateTo({
url: `/pages/logistics_details/logistics_details`,
url: `/pages/logistics_details/logistics_details?logisticsNum=${logisticsNum}&logisticsName=${logisticsName}`,
})
},
updateAddress(e) {
const { addressId, id: orderId } = e.currentTarget.dataset
const { id: orderId, orderAddress } = e.currentTarget.dataset
this.setData({
currentOrder: orderId
})
wx.navigateTo({
url: '/pages/my/my_address/my_address?orderAddress=true&addressId=' + addressId,
url: '/pages/my/my_address/my_address?orderAddress=true&updateAddress=true' + "&oriAddr=" + orderAddress,
})
},
//查看进度
@ -383,9 +383,18 @@ Page({
addressId, orderId: currentOrder
},
success: (result) => {
wx.showToast({
title: result.data.message,
})
setTimeout(() => {
if (result.data.code == 1) {
wx.showToast({
title: result.data.message,
})
} else {
wx.showToast({
title: "服务器内部错误",
icon: "error"
})
}
}, 1500);
}
})
},

View File

@ -75,7 +75,7 @@
您需要在<text style="color:#ee7b1e;">{{item.timeStr}}</text>内处理
</view>
<view class="btn display_J_E">
<view class="btn1" wx:if="{{item.status==3}}" data-item='{{item}}' data-logistics-num='{{item.logisticsNum}}' catchtap="viewLogisticsDetails">物流查询</view>
<view class="btn1" wx:if="{{item.status==3}}" data-item='{{item}}' data-logistics-num='{{item.logisticsNum}}' data-logistics-name="{{item.logisticsName}}" catchtap="viewLogisticsDetails">物流查询</view>
<view class="btn1 btn2" wx:if="{{item.status==3}}" data-id='{{item.id}}' catchtap="confirm">确认收货</view>
<view class="btn1" wx:if="{{item.status==1}}">立即支付</view>
<view class="btn1" wx:if="{{item.status==4||item.status==5}}" catchtap="del" data-id='{{item.id}}' data-index="{{index}}">删除订单</view>
@ -97,7 +97,7 @@
</view>
<!-- wx:if="{{item.status==2}}" -->
<view class="btn display_J_E" style="margin-top: 24rpx;">
<view class="btn1 btn2" data-id='{{item.id}}' data-address-id="{{item.addressId}}" catchtap="updateAddress">
<view class="btn1 btn2" data-id='{{item.id}}' data-address-id="{{item.addressId}}" data-order-address="{{item.orderAddress}}" catchtap="updateAddress">
修改地址</view>
</view>
</view>

View File

@ -336,9 +336,9 @@ Page({
})
},
viewLogisticsDetails(e) {
const { logisticsNum } = e.currentTarget.dataset
const { logisticsNum, logisticsName } = e.currentTarget.dataset
wx.navigateTo({
url: `/pages/logistics_details/logistics_details`,
url: `/pages/logistics_details/logistics_details?logisticsNum=${logisticsNum}&logisticsName=${logisticsName}`,
})
},
/**

View File

@ -146,7 +146,7 @@
<view wx:if="{{!shops}}">
<view class="b-btn display_J_E display_A_C" wx:if="{{goods.status>2&&goods.status<6}}">
<view class="btn" wx:if="{{goods.status==5||goods.status==4}}" catchtap="del">删除订单</view>
<view class="btn" wx:if="{{goods.status==3}}" data-item='{{goods}}' data-logistics-num='{{goods.logisticsNum}}' catchtap="viewLogisticsDetails">物流查询</view>
<view class="btn" wx:if="{{goods.status==3}}" data-item='{{goods}}' data-logistics-num='{{goods.logisticsNum}}' data-logistics-name="{{goods.logisticsName}}" catchtap="viewLogisticsDetails">物流查询</view>
<view class="btn btn-red" catchtap="confirm" wx:if="{{goods.status==3}}">确认收货</view>
</view>