This commit is contained in:
weipengfei 2024-05-06 15:32:45 +08:00
parent 7825a73d37
commit dcbbe57d64
5 changed files with 88 additions and 13 deletions

View File

@ -15,7 +15,12 @@ export const orderDetailApi = (data)=>{
return request.get('/order/RetailOrder/detail', data);
}
//提交
//重新发起支付
export const rePaymentApi = (data)=>{
return request.post('/order/RetailOrder/Repayment', data);
}
//订单数量统计
export const orderCountApi = (data)=>{
return request.post('/order/RetailOrder/order_count', data);
}

View File

@ -21,14 +21,17 @@
<view class="list-item" @click="navTo(1)">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/f335a202404261401535608.png"></image>
<view class="">待付款</view>
<view class="badge" v-if="orderCount.no_pay">{{orderCount.no_pay}}</view>
</view>
<view class="list-item" @click="navTo(2)">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/96915202404261403582769.png"></image>
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/53747202405061509465296.png"></image>
<view class="">待发货</view>
<view class="badge" v-if="orderCount.waiting">{{orderCount.waiting}}</view>
</view>
<view class="list-item" @click="navTo(3)">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/45241202404261403353935.png"></image>
<view class="">待收货</view>
<view class="badge" v-if="orderCount.receiving">{{orderCount.receiving}}</view>
</view>
<!-- <view class="list-item">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/96915202404261403582769.png"></image>
@ -61,11 +64,24 @@
<script setup>
import { ref } from "vue";
import useUserStore from "@/store/user";
import { orderCountApi } from "@/api/order.js";
const userStore = useUserStore();
const userInfo = userStore.userInfo;
const orderCount = ref({
no_pay: 0,
receiving: 0,
waiting: 0
})
const getOrderCount = ()=>{
orderCountApi().then(res=>{
orderCount.value = res.data;
})
}
getOrderCount();
const navTo = (type=0) => {
uni.navigateTo({
url: `/pagesOrder/order/order?type=${type}`
@ -156,10 +172,24 @@
flex-direction: column;
justify-content: space-between;
align-items: center;
position: relative;
image{
width: 64rpx;
height: 64rpx;
}
.badge{
position: absolute;
top: 0;
right: 20%;
width: 30rpx;
height: 30rpx;
border-radius: 50%;
text-align: center;
line-height: 30rpx;
font-size: 22rpx;
color: #fff;
background-color: #F55726;
}
}
}
}

View File

@ -1,6 +1,9 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const store_user = require("../../store/user.js");
const api_order = require("../../api/order.js");
require("../../utils/request.js");
require("../../config/app.js");
if (!Array) {
const _easycom_up_navbar2 = common_vendor.resolveComponent("up-navbar");
const _easycom_up_avatar2 = common_vendor.resolveComponent("up-avatar");
@ -20,13 +23,24 @@ const _sfc_main = {
setup(__props) {
const userStore = store_user.useUserStore();
const userInfo = userStore.userInfo;
const orderCount = common_vendor.ref({
no_pay: 0,
receiving: 0,
waiting: 0
});
const getOrderCount = () => {
api_order.orderCountApi().then((res) => {
orderCount.value = res.data;
});
};
getOrderCount();
const navTo = (type = 0) => {
common_vendor.index.navigateTo({
url: `/pagesOrder/order/order?type=${type}`
});
};
return (_ctx, _cache) => {
return {
return common_vendor.e({
a: common_vendor.p({
title: "我的",
bgColor: "rgba(0,0,0,0)",
@ -38,29 +52,41 @@ const _sfc_main = {
}),
c: common_vendor.t(common_vendor.unref(userInfo).nickname),
d: common_vendor.t(common_vendor.unref(userInfo).id),
e: common_vendor.o(($event) => navTo(1)),
f: common_vendor.o(($event) => navTo(2)),
g: common_vendor.o(($event) => navTo(3)),
h: common_vendor.o(($event) => navTo()),
i: common_vendor.p({
e: orderCount.value.no_pay
}, orderCount.value.no_pay ? {
f: common_vendor.t(orderCount.value.no_pay)
} : {}, {
g: common_vendor.o(($event) => navTo(1)),
h: orderCount.value.waiting
}, orderCount.value.waiting ? {
i: common_vendor.t(orderCount.value.waiting)
} : {}, {
j: common_vendor.o(($event) => navTo(2)),
k: orderCount.value.receiving
}, orderCount.value.receiving ? {
l: common_vendor.t(orderCount.value.receiving)
} : {}, {
m: common_vendor.o(($event) => navTo(3)),
n: common_vendor.o(($event) => navTo()),
o: common_vendor.p({
title: "我的地址",
isLink: true,
url: "/pagesOrder/addressList/addressList"
}),
j: common_vendor.p({
p: common_vendor.p({
title: "意见反馈",
isLink: true
}),
k: common_vendor.p({
q: common_vendor.p({
title: "关于我们",
isLink: true
}),
l: common_vendor.p({
r: common_vendor.p({
title: "退出登录",
isLink: true,
url: "/pages/login/login"
})
};
});
};
}
};

View File

@ -1 +1 @@
<view><up-navbar wx:if="{{a}}" u-i="39cfeb26-0" bind:__l="__l" u-p="{{a}}"></up-navbar><view class="user-info"><image class="bg" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp" mode="widthFix"></image><view class="u-card"><up-avatar wx:if="{{b}}" u-i="39cfeb26-1" bind:__l="__l" u-p="{{b}}"></up-avatar><view class="content"><view class="u-phone">{{c}}</view><view class="u-id">ID: {{d}}</view></view></view></view><view class="order-info-box"><view class="order-info"><view class="info-head">我的订单</view><view class="info-list"><view class="list-item" bindtap="{{e}}"><image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/f335a202404261401535608.png"></image><view class="">待付款</view></view><view class="list-item" bindtap="{{f}}"><image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/96915202404261403582769.png"></image><view class="">待发货</view></view><view class="list-item" bindtap="{{g}}"><image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/45241202404261403353935.png"></image><view class="">待收货</view></view><view class="list-item" bindtap="{{h}}"><image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/abdcd202404261406199643.png"></image><view class="">全部订单</view></view></view></view></view><view class="card"><up-cell-group u-s="{{['d']}}" u-i="39cfeb26-2" bind:__l="__l"><up-cell wx:if="{{i}}" u-i="39cfeb26-3,39cfeb26-2" bind:__l="__l" u-p="{{i}}"></up-cell></up-cell-group></view><view class="card"><up-cell-group u-s="{{['d']}}" u-i="39cfeb26-4" bind:__l="__l"><up-cell wx:if="{{j}}" u-i="39cfeb26-5,39cfeb26-4" bind:__l="__l" u-p="{{j}}"></up-cell><up-cell wx:if="{{k}}" u-i="39cfeb26-6,39cfeb26-4" bind:__l="__l" u-p="{{k}}"></up-cell><up-cell wx:if="{{l}}" u-i="39cfeb26-7,39cfeb26-4" bind:__l="__l" u-p="{{l}}"></up-cell></up-cell-group></view></view>
<view><up-navbar wx:if="{{a}}" u-i="39cfeb26-0" bind:__l="__l" u-p="{{a}}"></up-navbar><view class="user-info"><image class="bg" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp" mode="widthFix"></image><view class="u-card"><up-avatar wx:if="{{b}}" u-i="39cfeb26-1" bind:__l="__l" u-p="{{b}}"></up-avatar><view class="content"><view class="u-phone">{{c}}</view><view class="u-id">ID: {{d}}</view></view></view></view><view class="order-info-box"><view class="order-info"><view class="info-head">我的订单</view><view class="info-list"><view class="list-item" bindtap="{{g}}"><image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/f335a202404261401535608.png"></image><view class="">待付款</view><view wx:if="{{e}}" class="badge">{{f}}</view></view><view class="list-item" bindtap="{{j}}"><image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/53747202405061509465296.png"></image><view class="">待发货</view><view wx:if="{{h}}" class="badge">{{i}}</view></view><view class="list-item" bindtap="{{m}}"><image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/45241202404261403353935.png"></image><view class="">待收货</view><view wx:if="{{k}}" class="badge">{{l}}</view></view><view class="list-item" bindtap="{{n}}"><image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/abdcd202404261406199643.png"></image><view class="">全部订单</view></view></view></view></view><view class="card"><up-cell-group u-s="{{['d']}}" u-i="39cfeb26-2" bind:__l="__l"><up-cell wx:if="{{o}}" u-i="39cfeb26-3,39cfeb26-2" bind:__l="__l" u-p="{{o}}"></up-cell></up-cell-group></view><view class="card"><up-cell-group u-s="{{['d']}}" u-i="39cfeb26-4" bind:__l="__l"><up-cell wx:if="{{p}}" u-i="39cfeb26-5,39cfeb26-4" bind:__l="__l" u-p="{{p}}"></up-cell><up-cell wx:if="{{q}}" u-i="39cfeb26-6,39cfeb26-4" bind:__l="__l" u-p="{{q}}"></up-cell><up-cell wx:if="{{r}}" u-i="39cfeb26-7,39cfeb26-4" bind:__l="__l" u-p="{{r}}"></up-cell></up-cell-group></view></view>

View File

@ -95,11 +95,25 @@
flex-direction: column;
justify-content: space-between;
align-items: center;
position: relative;
}
.order-info-box .order-info .info-list .list-item image {
width: 64rpx;
height: 64rpx;
}
.order-info-box .order-info .info-list .list-item .badge {
position: absolute;
top: 0;
right: 20%;
width: 30rpx;
height: 30rpx;
border-radius: 50%;
text-align: center;
line-height: 30rpx;
font-size: 22rpx;
color: #fff;
background-color: #F55726;
}
.card {
margin: 20rpx;
background-color: #fff;