2024-09-23 18:46:46 +08:00
|
|
|
<template>
|
|
|
|
<view style="background-color: #ffffff;">
|
2024-09-25 17:41:45 +08:00
|
|
|
<up-sticky offset-top="0" style="background-color: #ffffff;">
|
|
|
|
<view class="navbar">
|
|
|
|
<view style="width: 580rpx;">
|
|
|
|
<up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword"
|
|
|
|
:showAction="false"></up-search>
|
|
|
|
</view>
|
|
|
|
<view class="nav-item" @click="calendarShow=true">
|
|
|
|
<up-icon name="calendar" color="#2979ff" size="28"></up-icon>
|
2024-09-23 18:46:46 +08:00
|
|
|
|
2024-09-25 17:41:45 +08:00
|
|
|
<text>筛选日期</text>
|
|
|
|
</view>
|
2024-09-23 18:46:46 +08:00
|
|
|
</view>
|
2024-09-25 17:41:45 +08:00
|
|
|
</up-sticky>
|
2024-09-23 18:46:46 +08:00
|
|
|
|
|
|
|
<view class="content">
|
|
|
|
<up-transition :show="true" mode="slide-left">
|
2024-09-25 17:41:45 +08:00
|
|
|
<up-list @scrolltolower="scrolltolower" v-if="goodsList1.length>0">
|
|
|
|
<up-list-item class="card" v-for="(item,index) in goodsList1" :key='index'>
|
|
|
|
|
2024-09-23 18:46:46 +08:00
|
|
|
<view class="card-content">
|
|
|
|
<view class="card-content-l" style="width: 152rpx;height: 152rpx;">
|
|
|
|
<image style="width: 152rpx;height: 152rpx;" :src="item.image" mode=""></image>
|
|
|
|
</view>
|
|
|
|
<view class="card-content-r">
|
|
|
|
<view class="title ellipsis">
|
|
|
|
{{item.store_name}}
|
|
|
|
</view>
|
|
|
|
<view>
|
2024-09-25 17:41:45 +08:00
|
|
|
时间:{{item.create_time}}
|
2024-09-23 18:46:46 +08:00
|
|
|
</view>
|
|
|
|
<view>
|
|
|
|
规格:{{item.store_info}}
|
|
|
|
</view>
|
2024-09-25 17:41:45 +08:00
|
|
|
|
|
|
|
<view>
|
|
|
|
单价:<span style="margin-right: 20rpx;color: red;">{{item.price}}</span>
|
|
|
|
数量:<span style="margin-right: 20rpx;color: red;">{{item.cart_num}}/{{item.unit_name}}</span>
|
|
|
|
总价:<span style="margin-right: 20rpx;color: red;">{{item.total_price}}</span>
|
2024-09-23 18:46:46 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
<up-line style="margin-top: 30rpx;" color="#F3F3F3"></up-line>
|
2024-09-25 17:41:45 +08:00
|
|
|
</up-list-item>
|
|
|
|
</up-list>
|
2024-09-23 18:46:46 +08:00
|
|
|
<up-empty @click='test2' v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
|
|
|
|
</up-empty>
|
|
|
|
</up-transition>
|
|
|
|
</view>
|
|
|
|
</view>
|
2024-09-25 17:41:45 +08:00
|
|
|
<up-calendar :show="calendarShow" @confirm="calendarConfirm" @close="calendarShow=false"
|
|
|
|
:closeOnClickOverlay="true" :min-date="min_date" monthNum="13"></up-calendar>
|
|
|
|
|
2024-09-23 18:46:46 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2024-09-25 17:41:45 +08:00
|
|
|
import {
|
|
|
|
timeFrom
|
|
|
|
} from '@/uni_modules/uview-plus';
|
|
|
|
|
2024-09-23 18:46:46 +08:00
|
|
|
import {
|
|
|
|
ref,
|
|
|
|
reactive,
|
|
|
|
} from "vue"
|
|
|
|
import {
|
2024-09-25 17:41:45 +08:00
|
|
|
StoreOrderCartInfoLists,
|
|
|
|
} from "@/api/store_order_cart_info.js"
|
2024-09-23 18:46:46 +08:00
|
|
|
|
|
|
|
const test2 = () => {
|
|
|
|
console.log("点解")
|
|
|
|
uni.navigateTo({
|
|
|
|
url: '/pages/index/index'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
const show = ref(false)
|
2024-09-25 17:41:45 +08:00
|
|
|
const min_date = ref('')
|
|
|
|
const where = ref({
|
|
|
|
store_name: '',
|
|
|
|
page_no: 1,
|
|
|
|
start_time: timeFrom(new Date()),
|
|
|
|
end_time: timeFrom(new Date())
|
2024-09-23 18:46:46 +08:00
|
|
|
})
|
2024-09-25 17:41:45 +08:00
|
|
|
const calendarShow = ref(false)
|
|
|
|
|
|
|
|
const calendarConfirm = (e) => {
|
|
|
|
where.value.start_time = e[0];
|
|
|
|
where.value.end_time = e[0];
|
|
|
|
goodsList1.value = []
|
|
|
|
getGoodsList()
|
|
|
|
calendarShow.value = false
|
2024-09-23 18:46:46 +08:00
|
|
|
}
|
2024-09-25 17:41:45 +08:00
|
|
|
let currentDate = new Date();
|
|
|
|
min_date.value=currentDate.setFullYear(currentDate.getFullYear() - 1);
|
2024-09-23 18:46:46 +08:00
|
|
|
// 列表
|
2024-09-25 17:41:45 +08:00
|
|
|
|
2024-09-23 18:46:46 +08:00
|
|
|
const goodsList1 = ref([])
|
|
|
|
|
|
|
|
const getGoodsList = async () => {
|
2024-09-25 17:41:45 +08:00
|
|
|
let res = await StoreOrderCartInfoLists(where.value)
|
|
|
|
goodsList1.value.push(...res.data.lists)
|
2024-09-23 18:46:46 +08:00
|
|
|
}
|
2024-09-25 17:41:45 +08:00
|
|
|
|
|
|
|
const keyword = ref('');
|
|
|
|
|
|
|
|
const searchKeyword = () => {
|
|
|
|
where.value.store_name = keyword.value;
|
|
|
|
goodsList1.value = []
|
|
|
|
getGoodsList();
|
2024-09-23 18:46:46 +08:00
|
|
|
}
|
2024-09-25 17:41:45 +08:00
|
|
|
const scrolltolower = () => {
|
|
|
|
where.value.page_no += 1
|
|
|
|
getGoodsList()
|
2024-09-23 18:46:46 +08:00
|
|
|
}
|
|
|
|
getGoodsList()
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.navbar {
|
|
|
|
padding: 0 20rpx;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
font-size: 22rpx;
|
|
|
|
color: #777;
|
2024-09-25 17:41:45 +08:00
|
|
|
|
2024-09-23 18:46:46 +08:00
|
|
|
.nav-item {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
position: relative;
|
2024-09-25 17:41:45 +08:00
|
|
|
|
2024-09-23 18:46:46 +08:00
|
|
|
image {
|
|
|
|
height: 40rpx;
|
|
|
|
width: 40rpx;
|
|
|
|
}
|
2024-09-25 17:41:45 +08:00
|
|
|
|
2024-09-23 18:46:46 +08:00
|
|
|
.badge {
|
|
|
|
position: absolute;
|
|
|
|
top: -10rpx;
|
|
|
|
right: 10rpx;
|
|
|
|
background-color: #FF0000;
|
|
|
|
color: #FFFFFF;
|
|
|
|
text-align: center;
|
|
|
|
width: 30rpx;
|
|
|
|
height: 30rpx;
|
|
|
|
border-radius: 30rpx;
|
|
|
|
font-size: 18rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-25 17:41:45 +08:00
|
|
|
|
2024-09-23 18:46:46 +08:00
|
|
|
.content {
|
|
|
|
padding: 20rpx;
|
|
|
|
padding-bottom: 150rpx;
|
|
|
|
|
|
|
|
.card {
|
|
|
|
width: 710rpx;
|
|
|
|
margin: 0 auto;
|
|
|
|
padding: 20rpx;
|
|
|
|
box-sizing: border-box;
|
|
|
|
background-color: white;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.card-content {
|
|
|
|
display: flex;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
.card-content-l {
|
|
|
|
margin-right: 20rpx;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.card-content-r {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
.title {
|
|
|
|
font-size: 30rpx;
|
|
|
|
width: 500rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.need {
|
|
|
|
color: #777777;
|
|
|
|
font-size: 24rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ipt {
|
|
|
|
display: flex;
|
|
|
|
height: 56rpx;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-09-25 17:41:45 +08:00
|
|
|
|
|
|
|
|
2024-09-23 18:46:46 +08:00
|
|
|
.ellipsis {
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
</style>
|