d第一次提交

This commit is contained in:
dt_2916866708
2024-02-28 17:34:03 +08:00
commit 0689cf2677
1234 changed files with 144804 additions and 0 deletions

51
pages/home/index.scss Normal file
View File

@@ -0,0 +1,51 @@
.home-container {
height: 100%;
width: 100vw;
position: relative;
overflow: hidden;
.list-container{
width: 690rpx;
height: 100%;
border-radius: 10rpx ;
overflow: hidden;
margin: auto;
margin-bottom: 30rpx;
}
.promptBox {
width: 690rpx;
background: linear-gradient(90deg, #a7ceff 0%, #ddecff 100%);
opacity: 1;
border-radius: 20rpx;
font-size: 26rpx;
color: #007dff;
font-size: 26rpx;
padding: 15rpx 19rpx;
box-sizing: border-box;
margin-bottom: 30rpx;
.promptBoxIcons{
width: 46rpx;
height: 46rpx;
margin-right: 30rpx;
image{
width: 46rpx;
height: 46rpx;
}
}
}
.banner {
width: 690rpx;
height: 263rpx;
border-radius: 20rpx;
margin-bottom: 30rpx;
image {
width: 100%;
height: 100%;
}
}
}
.CENTER {
position: relative;
left: 0;
right: 0;
margin: 0 auto;
}

117
pages/home/index.vue Normal file
View File

@@ -0,0 +1,117 @@
<template>
<view class="home-container flex column">
<!-- 顶部导航栏 -->
<topbar :configuration='configuration' :titleStyle='titleStyle'></topbar>
<!-- 轮播图 -->
<view class="banner CENTER">
<image src="../../static/banner.png"></image>
</view>
<!-- 提示 -->
<view class=" flex ac promptBox CENTER">
<view class="promptBoxIcons">
<image src="../../static/lb.png"></image>
</view>
待处理订单{{pendingCount}}
</view>
<!-- 列表 -->
<view class="list-container oneflex">
<scroll-view :show-scrollbar="false" @refresherrefresh='refresherrefresh' :refresher-enabled='true'
:refresher-triggered='refresherTriggered' style="height: 100%;" scroll-y="true"
@scrolltolower='scrolltolower'>
<order-item @orderItemCenterClick='orderItemCenterClick' @orderItemFooterClick='orderItemFooterClick'
:order-data="item" :key="index" v-for="(item,index) in orderList"></order-item>
<view class="flex ac jc " v-if="!orderList.length">
<image src="../../static/qx.png" mode="heightFix"></image>
</view>
</scroll-view>
</view>
<u-toast ref="uToast"></u-toast>
</view>
</template>
<script>
import orderApi from '@/api/order.js'
import topbar from '@/components/TopBar/index.vue'
import orderItem from "@/components/orderItem/orderItem.vue"
import tool from '../../utils/tool'
export default {
components: {
topbar,
orderItem,
},
data() {
return {
timer: null,
pendingCount: 0,
orderList: [],
page: {
"pageSize": 10,
"currentPage": 1,
"params": {
"driverId": uni.getStorageSync('user')?.driverId || "",
"pending": "1"
}
},
refresherTriggered: false,
configuration: {
title: "首页"
},
titleStyle: this.$parent.setingMenuData || null
}
},
created() {
this.init();
},
methods: {
orderItemCenterClick(e) {
uni.navigateTo({
url: `/Order/pages/details/index?orderData=${encodeURIComponent(JSON.stringify(e))}`
})
console.log(e, '跳转详情')
},
init() {
uni.$on('onshow', () => {
this.refresherrefresh()
})
},
getList() {
orderApi.getOwnFleetOrders(this.page).then(res => {
({
pendingCount: this.pendingCount = 0
} = res.data);
if (res.code == 20000) {
if (this.page.currentPage !== 1) {
this.orderList = this.orderList.concat(res.data.list)
} else {
this.orderList = res.data.list
}
}
this.refresherTriggered = false
})
},
orderItemFooterClick(e) {
if (e.status == '4') return
uni.navigateTo({
url: `/Enter/pages/${tool.orderStatus(e.status).router}/index?orderData=${encodeURIComponent(JSON.stringify(e))}`
})
},
scrolltolower() {
clearTimeout(this.timer);
this.timer = null;
this.timer = setTimeout(() => {
this.page.currentPage += 1;
this.getList()
}, 500)
},
refresherrefresh() {
this.page.currentPage = 1;
this.refresherTriggered = true;
this.getList();
},
}
}
</script>
<style lang="scss" scoped>
@import 'index.scss';
</style>