init commit

This commit is contained in:
quantulr
2024-05-08 17:32:39 +08:00
parent e3a0666d5a
commit e3513e70fa
16 changed files with 522 additions and 114 deletions

View File

@ -1,3 +1,4 @@
const { guessExpressCom, getExpressDetail } = require("../../api/express")
// pages/logistics_details/logistics_details.js
Page({
@ -5,14 +6,36 @@ Page({
* 页面的初始数据
*/
data: {
records: [],
num: ""
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// guessExpressCom({
// num: "YT7460149632645",
// key: "AjjPbmMP4727",
// success(resp) {
// console.log(resp);
// }
// })
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
})
}
}
})
},
/**

View File

@ -1,2 +1,10 @@
<!--pages/logistics_details/logistics_details.wxml-->
<text>TODO: 物流详情</text>
<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>
</view>

View File

@ -1 +1,46 @@
/* pages/logistics_details/logistics_details.wxss */
/* pages/logistics_details/logistics_details.wxss */
.record-item {
/* padding-bottom: 48rpx; */
display: flex;
flex-direction: column;
position: relative;
padding-left: 48rpx;
}
.record-item:not(:last-child) {
padding-bottom: 48rpx;
}
.time {
font-size: 24rpx;
}
.dot {
position: absolute;
left: 0;
top: 9rpx;
width: 16rpx;
height: 16rpx;
background-color: gray;
opacity: 50%;
border-radius: 50%;
z-index: 999;
}
.record-item:nth-child(2) .dot {
background-color: red;
opacity: 1;
width: 24rpx;
height: 24rpx;
left: -6rpx;
}
.line {
position: absolute;
left: 8rpx;
top: 0;
height: 100%;
width: 2rpx;
background-color: gray;
opacity: 50%;
}

View File

@ -81,22 +81,23 @@ Page({
const prevPage = pages[pages.length - 2]  // 上一页
// 调用上一个页面的setData 方法将数据存储
if(this.data.dataList.length>0){
if (this.data.dataList.length > 0) {
prevPage.setData({
address: dataList[index].addressProvince + dataList[index].addressCity + dataList[index].addressArea + dataList[index].addressDetailed,
addressId: dataList[index].id,
province: dataList[index].addressProvince,
orderPick:2,
orderPick: 2,
})
}else{
prevPage.requestUpdateAddress && prevPage.requestUpdateAddress()
} else {
prevPage.setData({
address: '选择收货方式',
addressId: '',
province: '',
orderPick:2,
orderPick: 2,
})
}
wx.navigateBack();
},
//编辑
@ -156,6 +157,9 @@ Page({
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

View File

@ -71,7 +71,7 @@ Page({
},
//订单数据
orderList: function () {
if(time) {
if (time) {
clearTimeout(time);
}
console.log(11111)
@ -88,7 +88,9 @@ Page({
userId: app.globalData.userId,
status: this.data.type,
page: this.data.page,
num: this.data.num
num: this.data.num,
addressId: undefined,
currentOrder: undefined
},
success: res => {
console.log(res)
@ -120,10 +122,10 @@ Page({
orderList: orderList,
page: this.data.page + 1
})
time = setInterval(()=>{
time = setInterval(() => {
this.countDown(orderList);
}, 1000)
} else {
if (this.data.page != 1) {
wx.showToast({
@ -160,6 +162,22 @@ Page({
url: '/pages/expresswx/expresswx',
})
},
viewLogisticsDetails(e) {
const { logisticsNum } = e.currentTarget.dataset
wx.navigateTo({
url: `/pages/logistics_details/logistics_details`,
})
},
updateAddress(e) {
const { addressId, id: orderId } = e.currentTarget.dataset
this.setData({
currentOrder: orderId
})
wx.navigateTo({
url: '/pages/my/my_address/my_address?orderAddress=true&addressId=' + addressId,
})
},
//查看进度
after: function (e) {
wx.navigateTo({
@ -355,6 +373,23 @@ Page({
})
},
requestUpdateAddress() {
const { addressId, currentOrder } = this.data
console.log(addressId, currentOrder,);
wx.request({
url: app.globalData.ip + '/wisdommining/api/order/requestUpdateAddress',
method: "GET",
data: {
addressId, orderId: currentOrder
},
success: (result) => {
wx.showToast({
title: result.data.message,
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
@ -388,6 +423,5 @@ Page({
*/
onReachBottom: function () {
this.orderList()
},
}
})

View File

@ -1,39 +1,39 @@
<!--pages/my/my_order/my_order.wxml-->
<view style="width:750rpx;background-color: #ffffff;">
<view class="typeAll display_J_S">
<view class="type {{type==0?'type_xz':''}}" catchtap="type" data-type="0">
<view class="type_s">全部</view>
<view class="typeXz" wx:if='{{type==0}}'></view>
</view>
<view class="type {{type==1?'type_xz':''}}" catchtap="type" data-type="1">
<view class="type_s">待支付</view>
<view class="typeXz" wx:if='{{type==1}}'></view>
</view>
<view class="type {{type==2?'type_xz':''}}" catchtap="type" data-type="2">
<view class="type_s">待发货</view>
<view class="typeXz" wx:if='{{type==2}}'></view>
</view>
<view class="type {{type==3?'type_xz':''}}" catchtap="type" data-type="3">
<view class="type_s">待收货</view>
<view class="typeXz" wx:if='{{type==3}}'></view>
</view>
<view class="type {{type==6?'type_xz':''}}" catchtap="type" data-type="6">
<view class="type_s">退款售后</view>
<view class="typeXz" wx:if='{{type==6}}'></view>
</view>
<view class="type {{type==4?'type_xz':''}}" catchtap="type" data-type="4">
<view class="type_s">已完成</view>
<view class="typeXz" wx:if='{{type==4}}'></view>
</view>
</view>
<view class="typeAll display_J_S">
<view class="type {{type==0?'type_xz':''}}" catchtap="type" data-type="0">
<view class="type_s">全部</view>
<view class="typeXz" wx:if='{{type==0}}'></view>
</view>
<view class="type {{type==1?'type_xz':''}}" catchtap="type" data-type="1">
<view class="type_s">待支付</view>
<view class="typeXz" wx:if='{{type==1}}'></view>
</view>
<view class="type {{type==2?'type_xz':''}}" catchtap="type" data-type="2">
<view class="type_s">待发货</view>
<view class="typeXz" wx:if='{{type==2}}'></view>
</view>
<view class="type {{type==3?'type_xz':''}}" catchtap="type" data-type="3">
<view class="type_s">待收货</view>
<view class="typeXz" wx:if='{{type==3}}'></view>
</view>
<view class="type {{type==6?'type_xz':''}}" catchtap="type" data-type="6">
<view class="type_s">退款售后</view>
<view class="typeXz" wx:if='{{type==6}}'></view>
</view>
<view class="type {{type==4?'type_xz':''}}" catchtap="type" data-type="4">
<view class="type_s">已完成</view>
<view class="typeXz" wx:if='{{type==4}}'></view>
</view>
</view>
</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.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="order" wx:for="{{orderList}}" wx:key='index' data-num="{{item.orderNumber}}" catchtap="toOrderDetail">
<view class="state" wx:if="{{item.status<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}}">
{{
item.status==61?'换货审核中'
:item.status==62?'退货审核中'
:item.status==63&&item.orderRefundType==1?'换货申请成功'
@ -47,64 +47,65 @@
:item.status==66&&item.orderRefundType==2?'退货失败'
:''
}}
</view>
<view class="number">订单编号:<text>{{item.orderNumber}}</text></view>
<view class="goods display_J_B" wx:for="{{item.goodsList}}" wx:for-item="goods" wx:key='index'>
<view class="goodsL">
<image src="{{goods.goodsPhoto}}"></image>
</view>
<view class="goodsM">
<view class="goodsTitle GStitleTwo">{{goods.goodsName}}</view>
<view class="goodsPrice" wx:if='{{item.orderPayWay!=3}}'>
{{item.orderPayWay!=2?'¥'+goods.price:goods.price+'积分'}}
</view>
<view class="goodsPrice" wx:if='{{item.orderPayWay==3}}'>¥0</view>
</view>
<view class="goodsR display_A_E">x <text>{{goods.goodsNum}}</text></view>
</view>
</view>
<view class="number">订单编号:<text>{{item.orderNumber}}</text></view>
<view class="goods display_J_B" wx:for="{{item.goodsList}}" wx:for-item="goods" wx:key='index'>
<view class="goodsL">
<image src="{{goods.goodsPhoto}}"></image>
</view>
<view class="goodsM">
<view class="goodsTitle GStitleTwo">{{goods.goodsName}}</view>
<view class="goodsPrice" wx:if='{{item.orderPayWay!=3}}'>
{{item.orderPayWay!=2?'¥'+goods.price:goods.price+'积分'}}
</view>
<view class="goodsPrice" wx:if='{{item.orderPayWay==3}}'>¥0</view>
</view>
<view class="goodsR display_A_E">x <text>{{goods.goodsNum}}</text></view>
</view>
<view class="total display_J_E">
<view class="total1" wx:if="{{item.orderPick==1}}">自提</view>
<view class="total1" wx:if="{{item.orderPick!=1&&item.orderFreight==0}}">免运费</view>
<view class="total2" wx:if="{{item.orderPick!=1&&item.orderFreight!=0}}">
运费<text><text>¥</text>{{item.orderFreight}}</text>
</view>
<view class="total3">合计<text>{{item.orderPayWay!=2?'¥'+item.orderActualPay:item.orderOtherPay+'积分'}}</text></view>
</view>
<view wx:if="{{item.timeStr}}" style="font-size: 28rpx">
您需要在<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}}' catchtap="express">物流查询</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>
<view class="total display_J_E">
<view class="total1" wx:if="{{item.orderPick==1}}">自提</view>
<view class="total1" wx:if="{{item.orderPick!=1&&item.orderFreight==0}}">免运费</view>
<view class="total2" wx:if="{{item.orderPick!=1&&item.orderFreight!=0}}">
运费<text><text>¥</text>{{item.orderFreight}}</text>
</view>
<view class="total3">合计<text>{{item.orderPayWay!=2?'¥'+item.orderActualPay:item.orderOtherPay+'积分'}}</text></view>
</view>
<view wx:if="{{item.timeStr}}" style="font-size: 28rpx">
您需要在<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 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>
<!-- 退货流程 -->
<!-- 待发货 申请 -->
<view class="btn1 btn2" wx:if="{{item.status==2}}" data-id='{{item.id}}' catchtap="apply1">
申请退款</view>
<!-- 待收货申请 -->
<view class="btn1 btn2" wx:if="{{item.status==3}}" 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}}" 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==61||item.status==62||item.status==63||item.status==66}}"
data-id='{{item.id}}' data-num='{{item.orderNumber}}' catchtap="after">查看进度</view>
<!-- 退货待商家收货 完成 -->
<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>
</view>
<view class="btn1 btn2" wx:if="{{item.status==2}}" data-id='{{item.id}}' catchtap="apply1">
申请退款</view>
<!-- 待收货申请 -->
<view class="btn1 btn2" wx:if="{{item.status==3}}" 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}}" 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==61||item.status==62||item.status==63||item.status==66}}" data-id='{{item.id}}' data-num='{{item.orderNumber}}' catchtap="after">查看进度</view>
<!-- 退货待商家收货 完成 -->
<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 class="btn1 btn2" data-id='{{item.id}}' data-address-id="{{item.addressId}}" catchtap="updateAddress">
修改地址</view>
</view>
</view>
</view>
<view class="empty" wx:if="{{orderList.length==0}}">
<view class="emptyImg">
<image src="/icon/order_none.png"></image>
</view>
<view class="emptyTitle">暂无订单~</view>
<view class="emptyImg">
<image src="/icon/order_none.png"></image>
</view>
<view class="emptyTitle">暂无订单~</view>
</view>

View File

@ -335,12 +335,12 @@ Page({
phoneNumber: '15955151737',
})
},
viewLogisticsDetails() {
viewLogisticsDetails(e) {
const { logisticsNum } = e.currentTarget.dataset
wx.navigateTo({
url: "/pages/logistics_details/logistics_details",
url: `/pages/logistics_details/logistics_details`,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

View File

@ -11,7 +11,7 @@
<!--待收货-->
<view class="logistics-all" data-item='{{goods}}' catchtap="express" wx:if='{{goods.status==3}}'>
<view class="logistics-all" data-item='{{goods}}' data-logistics-num="{{goods.logisticsNum}}" catchtap="viewLogisticsDetails" wx:if='{{goods.status==3}}'>
<view class="logistics display_J_B">
<view class="logistics-l display_J_S display_A_C">
<image src="/icon/express_icon.png"></image>
@ -118,8 +118,16 @@
<view class="order-l">快速解决问题</view>
<!-- <view class="order-r">暂无</view> -->
<view class="contact-b">
<button bind:tap="callCustomService" type="primary">客服电话</button>
<button type="primary" plain open-type="contact">在线客服</button>
<view bind:tap="callCustomService" class="contact-bth">
<image style="width: 36rpx;height: 36rpx;margin-right: 12rpx;" src="/icon/kefu.svg" />
客服电话
</view>
<view style="position: relative;" class="contact-bth">
<image style="width: 36rpx; height: 36rpx; margin-right: 12rpx;" src="/icon/zaixiankefu.svg" />
在线客服
<button type="primary" class="open-type-contact" plain open-type="contact"></button>
</view>
<!-- <button bind:tap="callCustomService" type="primary"></button> -->
</view>
</view>
</view>
@ -130,15 +138,15 @@
</view>
<view class="code-cont">核销时请出示此核销码~</view>
</view>
<view class="display_J_A display_A_C">
<button class="rounded-full" plain bind:tap="viewLogisticsDetails">查看物流</button>
</view>
<!-- <view class="display_J_E display_A_C">
<button class="logistics-btn rounded-full" type="warn" size="mini" plain bind:tap="viewLogisticsDetails">查看物流</button>
</view> -->
<view style="height:230rpx;"></view>
<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}}' catchtap="express">物流查询</view>
<view class="btn" wx:if="{{goods.status==3}}" data-item='{{goods}}' data-logistics-num='{{goods.logisticsNum}}' catchtap="viewLogisticsDetails">物流查询</view>
<view class="btn btn-red" catchtap="confirm" wx:if="{{goods.status==3}}">确认收货</view>
</view>

View File

@ -323,16 +323,44 @@ page {
}
.contact-b {
margin-top: 20rpx;
margin-top: 32rpx;
display: flex;
justify-content: space-between;
justify-content: center;
align-items: center;
}
.contact-bth {
display: flex;
align-items: center;
}
.contact-bth:last-child {
margin-left: 160rpx;
}
.open-type-contact {
position: absolute;
left: 0;
top: 0;
z-index: 99;
width: 100% !important;
height: 100%;
color: transparent !important;
border-color: transparent !important;
background-color: transparent !important;
}
.rounded-full {
border-radius: 9999px;
}
.logistics-btn {
margin-left: 0;
margin-right: 40rpx;
color: orange !important;
border-color: orange !important;
}
.code {
width: 750rpx;
height: 240rpx;