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

@ -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>