This commit is contained in:
quantulr
2024-06-07 16:43:09 +08:00
parent ee30f0cc3f
commit 99c82fb2a2
12 changed files with 223 additions and 9 deletions

View File

@ -85,5 +85,7 @@
<view class="height100"></view>
<view class="height100"></view>
<view class="height100"></view>
<view class="height100"></view>

View File

@ -20,7 +20,7 @@ Page({
*/
onLoad: function (options) {
this.setData({
packageId: options.packageId,
packageId: options.packageId !== "undefined" ? options.packageId : null,
orderId: options.id,
num: options.num,
sq: options.sq,

View File

@ -0,0 +1,131 @@
// pages/my/apply_after_sales/apply_after_sales.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
order: null,
orderId: null,
goodsNames: [],
packages: [{
id: 1,
goods: [],
logisticsNumber: "YT7460149632645"
}]
},
addPackage() {
const _packages = this.data.packages
_packages.push({
id: Date.now(),
goods: [],
logisticsNumber: ""
})
this.setData({
packages: _packages
})
},
deletePackage(e) {
const { id } = e.currentTarget.dataset
console.log(id);
this.setData({
packages: this.data.packages.filter(el => el.id !== id)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { id, sq, num } = options
console.log(options);
this.setData({
orderId: id
})
wx.setNavigationBarTitle({
title: sq == 1 ? '退货申请' : '换货申请'
})
wx.showLoading({
title: '加载中..',
})
wx.request({
url: app.globalData.ip + '/wisdommining/api/order/getOrderDetail',
method: 'GET',
header: {
"content-type": "application/x-www-form-urlencoded",
},
data: {
userId: app.globalData.userId,
orderNumber: num,
},
success: res => {
wx.hideLoading()
if (res.data.code == 1) {
let order = res.data.value;
this.setData({
order,
goodsNames: order.goodsList.map(el => `${el.goodsName} - ${el.wisdGoodsSpec.specName} × ${el.goodsNum}`)
// package: goods.logistics ? JSON.parse(goods.logistics).find(el => el.id == this.data.packageId) : null
})
} else {
wx.showModal({
title: '提示!',
content: res.data.message,
showCancel: false,
})
}
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,16 @@
<!--pages/my/apply_after_sales/apply_after_sales.wxml-->
<view>
<view wx:for="{{packages}}" wx:key="id" class="package-card">
<view wx:if="{{packages.length>1}}" data-id="{{item.id}}" bind:tap="deletePackage" style="width: 36rpx;height: 36rpx;position: absolute;top: -18rpx;right: -18rpx;background-color: red;border-radius: 50%;font-size: 36rpx;display: flex;justify-content: center;align-items: center;color: white;">×</view>
<view class="package-index">包裹{{index+1}}</view>
<text class="form-label">快递单号</text>
<input class="package-input" placeholder="请输入快递单号" />
<picker range="{{goodsNames}}" class="add-goods">
<button size="mini" type="primary">添加商品</button>
<!-- <view class="">添加商品</view> -->
</picker>
</view>
<view class="display_J_C" style="margin-top: 24rpx;">
<button size="mini" type="primary" bind:tap="addPackage">添加包裹</button>
</view>
</view>

View File

@ -0,0 +1,46 @@
/* pages/my/apply_after_sales/apply_after_sales.wxss */
page {
background-color: rgb(245, 245, 245);
}
.package-card {
background-color: #fff;
position: relative;
box-sizing: border-box;
/* border: 1rpx solid rgb(151, 151, 151); */
margin: 20rpx 20rpx 0;
border-radius: 12rpx;
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
padding: 20rpx;
}
.package-card:not(:first-of-type) {
margin-top: 30rpx;
}
.package-card .add-goods {
margin-top: 24rpx;
text-align: center;
}
.package-card .package-index {
position: absolute;
top: -16rpx;
left: 40rpx;
font-size: 24rpx;
padding: 0 8rpx;
background-color: linear-gradient(
to bottom,
rgba(255, 255, 255, 0) 50%,
rgba(255, 255, 255, 1) 50%
);
}
.package-card .form-label {
font-size: 28rpx;
color: gray;
}
.package-card .package-input {
margin-top: 6rpx;
border: 1rpx solid rgb(225, 225, 225);
height: 50rpx;
padding: 0 12rpx;
border-radius: 8rpx;
}

View File

@ -256,6 +256,7 @@ Page({
let sq = e.currentTarget.dataset.sq;
wx.navigateTo({
url: '/pages/my/applyAfter_sales/applyAfter_sales?id=' + id + '&num=' + num + '&sq=' + sq,
// url: '/pages/my/apply_after_sales/apply_after_sales?id=' + id + '&num=' + num + '&sq=' + sq,
})
},
//支付订单

View File

@ -29,7 +29,7 @@
</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 && (item.afterSalesStatus == 66 || !item.afterSalesStatus) && type != 6}}">
<view class="state" wx:if="{{item.status<6 && (item.afterSalesStatus == 66|| item.afterSalesStatus==67 || !item.afterSalesStatus) && type != 6}}">
{{item.status==5?'已取消'
:item.status==1?'待支付'
:item.status==2?'待发货'
@ -51,6 +51,7 @@
:item.afterSalesStatus==66&&item.orderRefundType==1?'换货失败'
:item.afterSalesStatus==66&&item.orderRefundType==2?'退货失败'
:item.afterSalesStatus==66&&item.orderRefundType==3?'退款失败'
:item.afterSalesStatus==67?"已撤销售后申请"
:''
}}
</view>
@ -93,8 +94,8 @@
<view class="btn1 btn2" wx:if="{{item.status==2 && (item.afterSalesStatus<66 || !item.afterSalesStatus)}}" data-id='{{item.id}}' catchtap="apply1">
申请退款</view>
<!-- 待收货申请 -->
<view class="btn1 btn2" wx:if="{{item.status==3&& (type==3||type==0) && (item.afterSalesStatus==66 || !item.afterSalesStatus)}}" data-id='{{item.id}}' data-num='{{item.orderNumber}}' data-s='{{item.status}}' data-sq='1' catchtap="apply">申请退货</view>
<view class="btn1 btn2" wx:if="{{item.status==3&&( type==3||type==0) && ( item.afterSalesStatus==66 || !item.afterSalesStatus) }}" data-id='{{item.id}}' data-num='{{item.orderNumber}}' data-s='{{item.status}}' data-sq='2' catchtap="apply">申请换货</view>
<view class="btn1 btn2" wx:if="{{item.status==3&& (type==3||type==0) && (item.afterSalesStatus==66||item.afterSalesStatus==67 || !item.afterSalesStatus)}}" data-id='{{item.id}}' data-num='{{item.orderNumber}}' data-s='{{item.status}}' data-sq='1' catchtap="apply">申请退货</view>
<view class="btn1 btn2" wx:if="{{item.status==3&&( type==3||type==0) && ( item.afterSalesStatus==66||item.afterSalesStatus==67 || !item.afterSalesStatus) }}" data-id='{{item.id}}' data-num='{{item.orderNumber}}' data-s='{{item.status}}' data-sq='2' catchtap="apply">申请换货</view>
<!-- 申请中 -->
<!-- -->
<view class="btn1 btn2" wx:if="{{(item.afterSalesStatus==61||item.afterSalesStatus==62||item.afterSalesStatus==63||item.afterSalesStatus==66) && item.afterSalesStatus!=64&&type==6}}" data-id='{{item.id}}' data-num='{{item.orderNumber}}' catchtap="after">查看进度</view>

View File

@ -12,6 +12,7 @@ Page({
ticker: '--:--',
leftoverDay: "",
shops: false,//商铺进入
refundLogistics: null
},
//商品详情
@ -77,6 +78,16 @@ Page({
numAll: numAll,
logistics: goods.logistics ? JSON.parse(goods.logistics) : null
})
// 用户已提交退货物流信息
if (goods.afterSalesStatus == 64) {
this.setData({
refundLogistics: JSON.stringify([{
id: Date.now(),
goods: [],
logisticsNumber: goods.orderRefundNumber
}])
})
}
if (goods.status == 1) {
this.setData({
setIntervalTime: setInterval((t) => {
@ -113,7 +124,7 @@ Page({
// 获取发货时间
let orderDeliverTime = goods.orderDeliverTime
console.log("=======")
let orderDeliverTimeMillisecond = (new Date(orderDeliverTime.replace(/-/g, '/'))).getTime() + 15 * 24 * 60 * 60 * 1000; //得到毫秒数
let orderDeliverTimeMillisecond = (new Date(orderDeliverTime.replace(/-/g, '/'))).getTime() + 15 * 24 * 60 * 60 * 1000; // 得到毫秒数
// 获取现在的毫秒值
console.log(orderDeliverTimeMillisecond)
let nowTime = new Date().getTime()
@ -158,6 +169,7 @@ Page({
wx.navigateTo({
url: '/pages/my/applyAfter_sales/applyAfter_sales?id=' + id + '&num=' + num + '&sq=' + sq + "&packageId=" + packageId,
})
},
countDown() {
let leftoverDayI = this.data.leftoverDayI;

View File

@ -44,7 +44,7 @@
<!--待收货-->
<view class="logistics-all" data-item='{{goods}}' data-logistics-num="{{goods.logisticsNum}}" catchtap="viewLogisticsDetails" wx:if='{{goods.status==3 && (!goods.afterSalesStatus||goods.afterSalesStatus==66||goods.afterSalesStatus==64)}}'>
<view class="logistics-all" data-item='{{goods}}' data-order-number="{{goods.orderNumber}}" data-logistics="{{refundLogistics}}" data-logistics-name="{{goods.orderRefundName}}" data-logistics-num="{{goods.logisticsNum}}" catchtap="viewLogisticsDetails" wx:if='{{goods.status==3 && (!goods.afterSalesStatus||goods.afterSalesStatus==66||goods.afterSalesStatus==64)}}'>
<view class="logistics display_J_B">
<view class="logistics-l display_J_S display_A_C">
<image src="/icon/express_icon.png"></image>
@ -206,6 +206,7 @@
<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="{{goods.logistics}}" data-order-number="{{goods.orderNumber}}" data-logistics-name="{{goods.logisticsName}}" catchtap="viewLogisticsDetails">物流查询</view>
<view class="btn btn-red" catchtap="apply" data-id='{{goods.id}}' data-num='{{goods.orderNumber}}' data-s='{{goods.status}}' data-sq='2' wx:if="{{goods.status==3}}">全部换货</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>