This commit is contained in:
quantulr
2024-05-17 17:14:40 +08:00
parent 8e5986a8ef
commit e679915b6c
11 changed files with 272 additions and 61 deletions

1
icon/package.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="1715582752455" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4275" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M128 864c0 17.6 14.4 32 32 32h704c17.6 0 32-14.4 32-32V320H128v544z m447.2-288H768v64H575.2v-64z m-64 128H768v64H511.2v-64z m-16-416h-368l76.8-135.2c12-16 30.4-24.8 50.4-24.8h240.8v160z m401.6 0h-368V128h240.8c20 0 38.4 9.6 50.4 24.8l76.8 135.2z" p-id="4276" fill="#f85900"></path></svg>

After

Width:  |  Height:  |  Size: 620 B

View File

@ -6,7 +6,10 @@ Page({
* 页面的初始数据
*/
data: {
logistics: [],
activePackage: 0,
records: [],
logisticsName: null,
expressComName: [
"圆通速递",
"申通快递",
@ -67,7 +70,15 @@ Page({
})
this.getExpressData()
},
pickPackage(e) {
const { index } = e.currentTarget.dataset
const { logistics } = this.data
this.setData({
activePackage: index,
num: logistics[index].logisticsNumber
})
this.getExpressData()
},
// 获取物流信息
getExpressData() {
getExpressDetail({
@ -91,15 +102,25 @@ Page({
}
})
},
copyLogisticsNumber(e) {
const { logisticsNumber } = e.currentTarget.dataset
wx.setClipboardData({
data: logisticsNumber,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { logisticsNum, logisticsName } = options
const { logistics, logisticsName, orderNumber } = options
this.setData({
logistics: logistics ? JSON.parse(logistics) : null,
orderNumber,
logisticsName
})
const index = this.data.expressComs.findIndex(el => el.name === logisticsName)
this.setData({
num: logisticsNum,
num: this.data.logistics[0].logisticsNumber,
currentExpressComIndex: index < 0 ? 0 : index
})
this.getExpressData()

View File

@ -1,20 +1,54 @@
<!--pages/logistics_details/logistics_details.wxml-->
<view style="padding:48rpx 48rpx 92rpx;">
<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 style="background-color: #fff;display: flex;justify-content: space-between; align-items: center;padding: 20rpx 12rpx;color: #4c4c4c;">
<text>订单编号: {{orderNumber}}</text><text>{{logistics.length}}个包裹</text>
</view>
<view style="margin: 24rpx 24rpx 0;">
<!-- 选择包裹 -->
<scroll-view scroll-x enable-flex class="packages-scroll">
<view wx:for="{{logistics}}" class="package" bind:tap="pickPackage" data-index="{{index}}">
<image class="icon" src="/icon/package.svg" />
<text>包裹{{index+1}}</text>
<view wx:if="{{activePackage===index}}" class="active-indicator"></view>
</view>
</scroll-view>
<!-- 包裹内容, 物流公司 -->
<view style="height: 400rpx; width: 100%;background-color: #fff;border-radius: 24rpx;overflow: hidden;">
<view style="background-color: #fef8ec;color: #f85900;font-size: 24rpx;padding: 12rpx 12rpx;">快递走件,催派等物流信息,请联系物流公司,如需平台接入请联系客服</view>
<view style="margin: 36rpx 0 0 24rpx;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;" />
<text style="font-size: 38rpx;font-weight: bold;">{{expressComs[currentExpressComIndex].name}}</text>
</view>
</picker>
</view>
<view style="margin: 24rpx 0 0 24rpx;display: flex;align-items: center;">
<text>运单号: {{logistics[activePackage].logisticsNumber}}</text>
<button data-logistics-number="{{logistics[activePackage].logisticsNumber}}" style="border-radius: 999rpx;margin: 0 0 0 12rpx;" plain size="mini" bind:tap="copyLogisticsNumber">复制</button>
</view>
<view style="margin: 24rpx 48rpx 0">
<view style="justify-content: space-between;align-items: center;display: flex;height: 48rpx;" wx:for="{{logistics[activePackage].goods}}" wx:key="id">
<view class="goods-name" style="flex:7;">{{item.name}}</view>
<view class="goods-name" style="flex:3;text-align: center;">{{item.spec}}</view>
<view style="flex:1;text-align: right;">{{item.num}}</view>
<!-- {{item.unit}} -->
</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 style="background-color: #fff;padding: 24rpx;margin-top: 24rpx;border-radius: 24rpx;">
<text style="font-size:36rpx;font-weight: bold;">物流详情</text>
<view style="height: 2rpx;background-color: rgb(209 213 219);margin-top: 24rpx;"></view>
<view style="margin-top: 24rpx;" 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-top: 24rpx;">暂无物流信息,请检查快递单号或者快递公司是否正确,可以点击左上方快递公司名称选择正确的快递公司。</view>
</view>
</view>
<view style="height: 48rpx;"></view>

View File

@ -1,4 +1,45 @@
/* pages/logistics_details/logistics_details.wxss */
page {
background-color: #f2f2f2;
}
.packages-scroll {
display: flex;
flex-direction: row;
height: 128rpx;
}
.packages-scroll .package {
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 200rpx;
height: 96rpx;
background-color: #fff;
border-radius: 16rpx;
overflow: hidden;
}
.packages-scroll .package .icon {
width: 48rpx;
height: 48rpx;
margin-right: 4rpx;
}
.packages-scroll .package .active-indicator {
position: absolute;
height: 12rpx;
width: 100%;
bottom: 0;
left: 0;
background-color: #f85900;
}
.packages-scroll .package:not(:first-of-type) {
margin-left: 20rpx;
}
.record-item {
/* padding-bottom: 48rpx; */
display: flex;
@ -6,6 +47,11 @@
position: relative;
padding-left: 48rpx;
}
.goods-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.record-item:not(:last-child) {
padding-bottom: 48rpx;
@ -43,4 +89,4 @@
width: 2rpx;
background-color: gray;
opacity: 50%;
}
}

View File

@ -11,6 +11,8 @@ Page({
ipUrl: app.globalData.ipUrl,
textarea: '',
total: 0,
package: null,
packageId: null
},
/**
@ -18,6 +20,7 @@ Page({
*/
onLoad: function (options) {
this.setData({
packageId: options.packageId,
orderId: options.id,
num: options.num,
sq: options.sq,
@ -51,6 +54,7 @@ Page({
let goods = res.data.value;
this.setData({
goods: goods,
package: goods.logistics ? JSON.parse(goods.logistics).find(el => el.id == this.data.packageId) : null
})
} else {
wx.showModal({
@ -144,7 +148,8 @@ Page({
orderRefund: this.data.textarea,
orderId: parseInt(this.data.orderId),
orderRefundImg: photos,
status: this.data.sq == 1 ? 62 : 61
status: this.data.sq == 1 ? 62 : 61,
packageId: this.data.packageId
},
success: res => {
console.log(res)

View File

@ -1,4 +1,45 @@
<view class="goods">
<wxs module="findGoods">
function findGoods(goodsList, id) {
// 初始化一个变量来存储找到的商品
var found = null;
// 遍历商品列表以查找具有指定ID的商品
for (var i = 0; i < goodsList.length; i++) {
if (goodsList[i].id === id) {
found = goodsList[i];
break;
}
}
// 如果找到了商品,返回商品的照片
if (found !== null) {
return found;
}
// 如果没有找到返回undefined
return undefined;
}
module.exports = {
findGoods: findGoods,
}
</wxs>
<view wx:if="{{package}}" class="goods">
<view class="cont display_J_B" wx:for='{{package.goods}}' wx:key='specId'>
<view class="cont-l">
<image src="{{findGoods.findGoods(goods.goodsList, item.id).goodsPhoto}}"></image>
</view>
<view class="cont-m">
<view class="name GStitleOne">{{item.name}}</view>
<view class="specs" wx:if="{{findGoods.findGoods(goods.goodsList, item.id).orderPayWay!=3}}">规格:{{item.spec}}</view>
<view class="price" wx:if="{{findGoods.findGoods(goods.goodsList, item.id).orderPayWay!=3}}">
{{findGoods.findGoods(goods.goodsList, item.id).orderPayWay!=2?'¥':''}}{{findGoods.findGoods(goods.goodsList, item.id).wisdGoodsSpec.specBulyPrice==null?findGoods.findGoods(goods.goodsList, item.id).wisdGoodsSpec.specPrice:findGoods.findGoods(goods.goodsList, item.id).wisdGoodsSpec.specBulyPrice}}{{findGoods.findGoods(goods.goodsList, item.id).orderPayWay!=2?'':'积分'}}
</view>
<view class="price" wx:if="{{findGoods.findGoods(goods.goodsList, item.id).orderPayWay==3}}">¥0</view>
</view>
<view class="cont-r">x{{item.num}}</view>
</view>
</view>
<view wx:else class="goods">
<view class="cont display_J_B" wx:for='{{goods.goodsList}}' wx:key='index'>
<view class="cont-l">
<image src="{{item.goodsPhoto}}"></image>

View File

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

View File

@ -29,22 +29,22 @@
</view>
<view class="orderAll">
<view class="order" wx:for="{{orderList}}" wx:key='index' data-num="{{item.orderNumber}}" catchtap="toOrderDetail">
<view class="state" wx:if="{{item.status<6}}">
<view class="state" wx:if="{{item.status<6 && (item.afterSalesStatus ==66 || !item.afterSalesStatus) && type != 6}}">
{{item.status==5?'已取消':item.status==1?'待支付':item.status==2?'待发货':item.status==3?'待收货':item.status==4?'已完成':''}}
</view>
<view class="state" wx:if="{{item.status>5}}">
<view class="state" wx:if="{{item.afterSalesStatus && type==6}}">
{{
item.status==61?'换货审核中'
:item.status==62?'退货审核中'
:item.status==63&&item.orderRefundType==1?'换货申请成功'
:item.status==63&&item.orderRefundType==2?'退货申请成功'
:item.status==64&&item.orderRefundType==1?'换货待商家收货'
:item.status==64&&item.orderRefundType==2?'退货待商家收货'
:item.status==65&&item.orderRefundType==1?'换货完成'
:item.status==65&&item.orderRefundType==2?'退货完成'
:item.status==65&&item.orderRefundType==3?'退款完成'
:item.status==66&&item.orderRefundType==1?'换货失败'
:item.status==66&&item.orderRefundType==2?'退货失败'
item.afterSalesStatus==61?'换货审核中'
:item.afterSalesStatus==62?'退货审核中'
:item.afterSalesStatus==63&&item.orderRefundType==1?'换货申请成功'
:item.afterSalesStatus==63&&item.orderRefundType==2?'退货申请成功'
:item.afterSalesStatus==64&&item.orderRefundType==1?'换货待商家收货'
:item.afterSalesStatus==64&&item.orderRefundType==2?'退货待商家收货'
:item.afterSalesStatus==65&&item.orderRefundType==1?'换货完成'
:item.afterSalesStatus==65&&item.orderRefundType==2?'退货完成'
:item.afterSalesStatus==65&&item.orderRefundType==3?'退款完成'
:item.afterSalesStatus==66&&item.orderRefundType==1?'换货失败'
:item.afterSalesStatus==66&&item.orderRefundType==2?'退货失败'
:''
}}
</view>
@ -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}}' data-logistics-name="{{item.logisticsName}}" catchtap="viewLogisticsDetails">物流查询</view>
<view class="btn1" wx:if="{{item.status==3}}" data-item='{{item}}' data-logistics="{{item.logistics}}" data-order-number="{{item.orderNumber}}" 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>
@ -93,7 +93,6 @@
<!-- 退货待商家收货 完成 -->
<view class="btn1 btn2" wx:if="{{(item.status==64||item.status==65)&&item.orderRefundType!=3}}" data-id='{{item.id}}' data-num='{{item.orderNumber}}' data-sq='{{item.orderRefundType==1?2:1}}' catchtap="jilu">
退换货记录</view>
</view>
<!-- wx:if="{{item.status==2}}" -->
<view class="btn display_J_E" style="margin-top: 24rpx;">

View File

@ -74,7 +74,8 @@ Page({
this.setData({
goods: goods,
total: total,
numAll: numAll
numAll: numAll,
logistics: goods.logistics ? JSON.parse(goods.logistics) : null
})
if (goods.status == 1) {
this.setData({
@ -150,7 +151,14 @@ Page({
}
})
},
//申请售后
apply: function (e) {
const { id, num, sq, packageId } = e.currentTarget.dataset
console.log(packageId);
wx.navigateTo({
url: '/pages/my/applyAfter_sales/applyAfter_sales?id=' + id + '&num=' + num + '&sq=' + sq + "&packageId=" + packageId,
})
},
countDown() {
let leftoverDayI = this.data.leftoverDayI;
let nowTime = new Date().getTime()
@ -278,7 +286,7 @@ Page({
},
// 评价订单
rate(e){
rate(e) {
wx.navigateTo({
url: '/pages/rate/rate',
})
@ -342,9 +350,9 @@ Page({
})
},
viewLogisticsDetails(e) {
const { logisticsNum, logisticsName } = e.currentTarget.dataset
const { logistics, logisticsName, orderNumber } = e.currentTarget.dataset
wx.navigateTo({
url: `/pages/logistics_details/logistics_details?logisticsNum=${logisticsNum}&logisticsName=${logisticsName}`,
url: `/pages/logistics_details/logistics_details?orderNumber=${orderNumber}&logistics=${logistics}&logisticsName=${logisticsName}`,
})
},
/**

View File

@ -1,3 +1,28 @@
<wxs module="findGoods">
function findGoods(goodsList, id) {
// 初始化一个变量来存储找到的商品
var found = null;
// 遍历商品列表以查找具有指定ID的商品
for (var i = 0; i < goodsList.length; i++) {
if (goodsList[i].id === id) {
found = goodsList[i];
break;
}
}
// 如果找到了商品,返回商品的照片
if (found !== null) {
return found;
}
// 如果没有找到返回undefined
return undefined;
}
module.exports = {
findGoods: findGoods,
}
</wxs>
<!-- 倒计时 -->
<view wx:if='{{goods.status==1}}'>
<view class="djs" wx:if="{{ticker!=''}}">还剩余<text>{{ticker}}</text>订单将自动取消</view>
@ -29,20 +54,46 @@
<view class="address-cont">{{goods.orderAddress}}</view>
</view>
<view class="goods">
<view class="cont display_J_B" wx:for='{{goods.goodsList}}' wx:key='index' data-id='{{item.id}}' catchtap="goodsDetails">
<view class="cont-l">
<image src="{{item.goodsPhoto}}"></image>
</view>
<view class="cont-m">
<view class="name GStitleOne">{{item.goodsName}}</view>
<view class="specs" wx:if="{{goods.orderPayWay!=3}}">规格:{{item.wisdGoodsSpec.specName}}</view>
<view class="price" wx:if="{{goods.orderPayWay!=3}}">
{{goods.orderPayWay!=2?'¥'+item.price:item.price+'积分'}}
<view>
<view wx:if="{{logistics}}">
<view wx:for='{{logistics}}' class="packages" wx:key='id' data-id='{{item.id}}'>
<view style="display:flex; justify-content: space-between;">
<view>
包裹{{index+1}}
</view>
<view class="btn btn-red" data-id='{{goods.id}}' data-num='{{goods.orderNumber}}' data-s='{{goods.status}}' data-sq='2' data-package-id="{{item.id}}" capture-bind:tap="apply">换货申请</view>
</view>
<view class="cont display_J_B" wx:for='{{item.goods}}' wx:key="specId" wx:for-item="goodsItem" catchtap="">
<view class="cont-l">
<image src="{{ findGoods.findGoods(goods.goodsList,goodsItem.id).goodsPhoto }}"></image>
</view>
<view class="cont-m">
<view class="name GStitleOne">{{goodsItem.name}}</view>
<view class="specs" wx:if="{{goods.orderPayWay!=3}}">规格:{{goodsItem.spec}}</view>
<view class="price" wx:if="{{goods.orderPayWay!=3}}">
{{goods.orderPayWay!=2?'¥'+findGoods.findGoods(goods.goodsList,goodsItem.id).price:findGoods.findGoods(goods.goodsList,goodsItem.id).price+'积分'}}
</view>
<view class="price" wx:if="{{goods.orderPayWay==3}}">¥0</view>
</view>
<view class="cont-r">x{{goodsItem.num}}</view>
</view>
<view class="price" wx:if="{{goods.orderPayWay==3}}">¥0</view>
</view>
<view class="cont-r">x{{item.goodsNum}}</view>
</view>
<view class="goods" wx:else>
<view class="cont display_J_B" wx:for='{{goods.goodsList}}' wx:key='index' data-id='{{item.id}}' catchtap="goodsDetails">
<view class="cont-l">
<image src="{{item.goodsPhoto}}"></image>
</view>
<view class="cont-m">
<view class="name GStitleOne">{{item.goodsName}}</view>
<view class="specs" wx:if="{{goods.orderPayWay!=3}}">规格:{{item.wisdGoodsSpec.specName}}</view>
<view class="price" wx:if="{{goods.orderPayWay!=3}}">
{{goods.orderPayWay!=2?'¥'+item.price:item.price+'积分'}}
</view>
<view class="price" wx:if="{{goods.orderPayWay==3}}">¥0</view>
</view>
<view class="cont-r">x{{item.goodsNum}}</view>
</view>
</view>
</view>
@ -146,7 +197,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}}' data-logistics-name="{{goods.logisticsName}}" catchtap="viewLogisticsDetails">物流查询</view>
<view class="btn" wx:if="{{goods.status==3}}" data-item='{{goods}}' data-logistics="{{goods.logistics}}" data-order-number="{{goods.orderNumber}}" data-logistics-name="{{goods.logisticsName}}" catchtap="viewLogisticsDetails">物流查询</view>
<view class="btn btn-red" catchtap="confirm" wx:if="{{goods.status==3}}">确认收货</view>
<view class="btn btn-red" catchtap="rate" wx:if="{{goods.status==4}}">评价</view>
</view>

View File

@ -70,7 +70,13 @@ page {
border-radius: 20rpx;
margin: 30rpx 0;
}
.packages {
width: 690rpx;
padding: 16rpx 30rpx 0;
background-color: #ffffff;
border-radius: 20rpx;
margin: 30rpx 0;
}
.cont {
padding: 30rpx 0;
border-bottom: 1rpx #dcdcdc solid;
@ -282,7 +288,6 @@ page {
background-color: #ffffff;
border-radius: 20rpx;
margin: 30rpx 0;
}
.order {
@ -427,4 +432,4 @@ page {
.djs text {
color: #ff372d;
margin-left: 10rpx;
}
}