修改订单列表,详情

This commit is contained in:
2025-03-10 14:07:59 +08:00
parent 8b321d8d44
commit 1a3311b6aa
10 changed files with 34 additions and 33 deletions

View File

@ -35,6 +35,7 @@ export default {
detail:(activity_id)=>request.get(`/api/coupon-activities/${activity_id}`),
receive:(activity_id)=>request.post(`/api/coupon-activities/${activity_id}/receive`,{},{noTips:true})
},
getPickupCodeWidthImgUrl:(url)=>request.post('/api/ai/recognition/pickup_code_with_url',{url}),
uploadImg(file,progress){
if(!app)app = getApp();
return new Promise((rs,rj)=>{

View File

@ -81,7 +81,7 @@ export default {
list:()=>request.get('/api/user/referrals')
},
updateUser:(data)=>request.put('/api/user/update',data),
createPayment(order_id,order_type){
return request.post('/api/wechat/create-payment',{order_id,order_type});
createPayment(order_id){
return request.post('/api/wechat/create-payment',{order_id});
}
}

2
app.js
View File

@ -1,7 +1,6 @@
import userApi from './api/user';
import commonApi from './api/common';
let token = wx.getStorageSync('accessToken');
console.log(1);
App({
async onLaunch(options){
wx.getStorage({
@ -15,7 +14,6 @@ App({
const currentPage = page[page.length-1];
if(currentPage){
currentPage.onShareAppMessage = async()=>{
console.log(this.globalData.userInfo.user_code);
if(!(this.globalData.appConfig&&this.globalData.appConfig.share_card_title)){
await this.getAppConfig();
}

View File

@ -45,7 +45,7 @@ Component({
});
},
createPayment(orderId,needStay){
userApi.createPayment(orderId,'PRODUCT').then((data)=>{
userApi.createPayment(orderId).then((data)=>{
wx.requestPayment({
timeStamp:data.payment_params.timeStamp,
nonceStr:data.payment_params.nonceStr,

View File

@ -39,7 +39,6 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log('onLoad',new Date().getTime());
let height = this.selectComponent("#navBar").getHeight();
this.setData({
navBarHeight:height
@ -65,17 +64,14 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
console.log('onReady',new Date().getTime());
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
console.log('onShow',new Date().getTime());
wx.getStorage({
key:'pre-order',
success:(res)=>{
console.log(res);
const name = [];
let count = 0;
if(res.data.price_request.pickup_images){
@ -135,7 +131,6 @@ Page({
});
},
changeCommunity(community){
console.log('changeCommunity',community);
//手动设置社区之后 做个标记
this.setData({
currentCommunity:{
@ -250,11 +245,9 @@ Page({
});
},
enterPageContainer(){
console.log('enterPageContainer');
// wx.hideTabBar();
},
leavePageContainer(){
console.log('leavePageContainer');
wx.showTabBar();
},
/**

View File

@ -123,6 +123,12 @@
</label>
</view>
</view>
<view class="kv" wx:if="{{orderDetail.additional_fee_amount}}">
<view class="key">加价金额</view>
<view class="value">
<label class="money money-normal">{{orderDetail.additional_fee_amount}}</label>
</view>
</view>
<view class="kv">
<view class="key">支付金额</view>
<view class="value">

View File

@ -212,7 +212,10 @@ Page({
pay(event){
const item = event.currentTarget.dataset.item;
const orderConfirm = this.selectComponent("#merchantOrderConfirm");
orderConfirm.createPayment(item.order_id);
orderConfirm.createPayment(item.orderid||item.order_id,true);
},
paySuccess(){
this.refreshList();
},
/**
* 生命周期函数--监听页面初次渲染完成

View File

@ -26,21 +26,24 @@
<view class="icon-con">
<image class="icon" src="/assets/icon/order/package@2x.png"/>
</view>
<view class="center">代取快递</view>
<view class="center">订单号 {{item.orderid}}</view>
<view class="status {{item.status}}">
{{orderStatusKV[item.status]}}
</view>
</view>
<view class="content">
<view class="spliter"></view>
<view class="address">{{item.address.community_name}}{{item.address.address_detail}}</view>
<view class="time">下单时间:{{item.create_time}}</view>
<view class="pay" wx:if="{{item.status==orderStatus.UNPAID}}">
<view class="kv">
<view>快递数量10 件</view>
<view>送达地址:{{item.address.community_name}}{{item.address.address_detail}}</view>
<view>下单时间:{{item.create_time}}</view>
</view>
<view class="pay" wx:if="{{item.status==orderStatus.unpaid}}">
<view class="left">
<label>跑腿费用</label>
<label class="money">{{item.final_amount}}</label>
</view>
<button class="button" type="primary" plain size="mini">立即支付</button>
<button class="button" type="primary" size="mini" capture-catch:tap="pay" data-item="{{item}}">立即支付</button>
</view>
</view>
</view>
@ -134,4 +137,4 @@
</list-view>
<!-- </swiper-item>
</swiper> -->
<merchant-order id="merchantOrderConfirm" bind:orderCreated="orderCreated"/>
<merchant-order id="merchantOrderConfirm" bind:orderCreated="orderCreated" bind:paySuccess="paySuccess"/>

View File

@ -8,7 +8,7 @@
background-color: #fff;
border-radius: 18rpx;
margin:24rpx 0;
padding:30rpx;
padding:30rpx 30rpx 50rpx 30rpx;
}
.order-list .head{
display: flex;
@ -17,7 +17,7 @@
.order-list .head .center{
margin-left:24rpx;
flex:1;
font-size:34rpx;
font-size:32rpx;
font-weight: 500;
}
.order-list .head .status{
@ -42,25 +42,22 @@
display: flex;
}
.order-list .content{
margin-top:24rpx;
margin-left:80rpx;
}
.order-list .content .address{
margin-top:30rpx;
font-size: 34rpx;
font-weight: 500;
.order-list .content .kv{
display: flex;
flex-direction: column;
gap: 24rpx;
color: #222222;
}
.order-list .content .time{
font-size: 26rpx;
color:#888888;
margin-top:24rpx;
padding-bottom:48rpx;
.order-list .content .spliter{
margin:24rpx 0 30rpx 0;
}
.order-list .content .pay{
display: flex;
justify-content: space-between;
align-items: center;
margin-top:12rpx;
margin-top:60rpx;
font-size: 26rpx;
color: #888888;
}

View File

@ -34,7 +34,7 @@ Page({
},
merchantPay(){
shopApi.merchantPay(this.data.shopId,this.data.amount).then((data)=>{
userApi.createPayment(data.order_id,'ONLINE_PAY').then((data)=>{
userApi.createPayment(data.order_id).then((data)=>{
wx.requestPayment({
timeStamp:data.payment_params.timeStamp,
nonceStr:data.payment_params.nonceStr,