物流信息

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

@ -11,8 +11,8 @@ const guessExpressCom = ({ num, key, success, fail }) => {
})
}
const getExpressDetail = ({ num, success, fail }) => {
const param = JSON.stringify({ com: "yuantong", num, phone: "", from: "", to: "", resultv2: "0", show: "0", order: "desc" })
const getExpressDetail = ({ num, com, success, fail }) => {
const param = JSON.stringify({ com, num, phone: "", from: "", to: "", resultv2: "0", show: "0", order: "desc" })
console.log(param);
wx.request({
url: `https://poll.kuaidi100.com/poll/query.do`,

View File

@ -97,11 +97,5 @@
"scope.userLocation": {
"desc": "你的位置信息将方便您查看附近自提点"
}
},
"plugins": {
"kdPlugin": {
"version": "1.1.2",
"provider": "wx6885acbedba59c14"
}
}
}

View File

@ -0,0 +1,16 @@
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12.9841 4.99255C12.9841 4.44027 13.4318 3.99255 13.9841 3.99255C14.3415 3.99255 14.6551 4.18004 14.8319 4.46202L17.5195 7.14964C17.9101 7.54016 17.9101 8.17333 17.5195 8.56385C17.129 8.95438 16.4958 8.95438 16.1053 8.56385L14.9841 7.44263V14.9926C14.9841 15.5448 14.5364 15.9926 13.9841 15.9926C13.4318 15.9926 12.9841 15.5448 12.9841 14.9926V5.042C12.984 5.03288 12.984 5.02376 12.9841 5.01464V4.99255Z"
fill="currentColor"
/>
<path
d="M11.0159 19.0074C11.0159 19.5597 10.5682 20.0074 10.0159 20.0074C9.6585 20.0074 9.3449 19.82 9.16807 19.538L6.48045 16.8504C6.08993 16.4598 6.08993 15.8267 6.48045 15.4361C6.87098 15.0456 7.50414 15.0456 7.89467 15.4361L9.01589 16.5574V9.00745C9.01589 8.45516 9.46361 8.00745 10.0159 8.00745C10.5682 8.00745 11.0159 8.45516 11.0159 9.00745V18.958C11.016 18.9671 11.016 18.9762 11.0159 18.9854V19.0074Z"
fill="currentColor"
/>
</svg>

After

Width:  |  Height:  |  Size: 1010 B

1
icon/发现.svg Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1715218002438" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3423" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512.610227 147.69851h-12.554463a91.229095 91.229095 0 0 1 2.510893 19.529164A79.232608 79.232608 0 0 1 353.866022 206.56499 242.161634 242.161634 0 1 0 512.610227 147.69851z" fill="#FFC824" p-id="3424"></path><path d="M753.376921 83.810245A394.489114 394.489114 0 0 0 415.522383 11.552338 380.539711 380.539711 0 0 0 131.791528 300.862954 390.583281 390.583281 0 0 0 267.100736 693.399151a165.718906 165.718906 0 0 1 63.609277 128.892483 89.834155 89.834155 0 0 0 62.493325 85.370346V948.673224a75.326776 75.326776 0 0 0 75.326776 75.326776h86.765286a75.326776 75.326776 0 0 0 75.326776-75.326776v-41.011244a90.113143 90.113143 0 0 0 62.772313-85.649334A161.255098 161.255098 0 0 1 753.097933 697.583972a390.583281 390.583281 0 0 0 0-613.773727z m-178.552357 864.862979a19.529164 19.529164 0 0 1-19.529164 19.529164h-86.765286a19.808152 19.808152 0 0 1-19.529164-19.529164v-35.989459h125.823614z m143.67885-296.006329a214.820805 214.820805 0 0 0-80.906537 169.903727 34.873507 34.873507 0 0 1-34.873507 34.594519h-181.621226a34.873507 34.873507 0 0 1-34.594519-34.594519 221.516518 221.516518 0 0 0-83.696418-172.41462A334.78567 334.78567 0 0 1 186.194199 312.85944 324.7421 324.7421 0 0 1 428.91381 65.955009 350.130013 350.130013 0 0 1 512.610227 55.911439a334.78567 334.78567 0 0 1 207.288127 596.476468z" fill="#6B400D" p-id="3425"></path><path d="M420.823156 195.405468a27.898806 27.898806 0 0 1-25.94589-16.739284 27.898806 27.898806 0 0 1 13.949403-36.268447 27.898806 27.898806 0 0 1 22.040057 51.333802 30.688686 30.688686 0 0 1-10.04357 1.673929zM285.23496 338.80533a35.152495 35.152495 0 0 1-9.206606-1.394941 27.898806 27.898806 0 0 1-17.29726-35.710471 265.317643 265.317643 0 0 1 53.844695-90.671119 27.898806 27.898806 0 0 1 41.569221 37.105412 212.309912 212.309912 0 0 0-42.685173 71.978919 27.898806 27.898806 0 0 1-26.224877 18.6922z" fill="#6B400D" p-id="3426"></path></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

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>

8
wxParse/arrmap.js Normal file
View File

@ -0,0 +1,8 @@
function arrMap(arr, field) {
return arr.map(el => el[field])
}
module.exports = {
arrMap
}