You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

454 lines
10 KiB
Vue

1 year ago
<template>
1 year ago
<div class="order-goods">
<title-block title="订单库">
<template #left>
1 year ago
<u-action-sheet
:show="show"
:actions="this.statusValue.map(x=>({name:x.label,value:x.value}))"
title="请选择状态"
@close="show = false"
@select="statusSelect"
>
</u-action-sheet>
<div @click="openStatus" class="wrap1">
<div class="wrap1_1">
<div class="wrap1_1_1">{{ statusValue.find(x => x.value === status).label }}</div>
<image style="width: 12rpx;height: 8rpx" src="../../static/dbx2@3x.png"></image>
</div>
1 year ago
1 year ago
</div>
</template>
</title-block>
1 year ago
1 year ago
<div class="content2">
1 year ago
<div class="wrap1">
<div class="wrap1_1">
<image src="../../static/zu1@3x.png"></image>
</div>
<div class="wrap1_2"></div>
1 year ago
<input v-model="mobileKey" placeholder-style="color: #C7C7C7;font-size: 20rpx;"
placeholder="在此处搜索您的订单"/>
1 year ago
</div>
1 year ago
<div class="wrap2" @click="search">
1 year ago
搜索
</div>
</div>
1 year ago
<scroll-view style=" margin-top: 28rpx;" class="scrollbox" :scroll-y="true" @scrolltolower="loadMore">
1 year ago
<div class="content3">
1 year ago
<div
v-for="(item,index) in mainList" :key="index"
@touchstart="(e)=>{touchStart(e,index)}"
@touchmove="(e)=>{touchMove(e,index)}"
@touchend="()=>{touchEnd(index)}"
:style="{transform: `translateX(${item.distanceX}px)`}" class="wrap1">
<div class="wrap1_1">
<image src="../../static/jx632@3x.png"></image>
1 year ago
</div>
1 year ago
<div class="wrap1_2">
<div class="wrap1_2_1">画作的名称</div>
<div class="wrap1_2_2">订单号:0129181232101</div>
<div class="wrap1_2_3">16平尺</div>
<div class="wrap1_2_4">2023.09.01-2023.09.18</div>
1 year ago
</div>
1 year ago
<div class="wrap1_3" :class="[`status${item.status}`]">
<div class="wrap1_3_1" v-if="item.status===4">
<div class="wrap1_3_1_1">2023.09.28</div>
<div class="wrap1_3_1_2">已超时</div>
<div class="wrap1_3_1_3">点击补款</div>
</div>
<div class="wrap1_3_3" v-if="item.status!==4">
<div class="wrap1_3_3_1">{{ statusValue.find(x => x.value === item.status).label }}</div>
</div>
<div class="wrap1_3_2">
<div class="wrap1_3_2_1">货架号:</div>
<div class="wrap1_3_2_2">12-02-13</div>
</div>
1 year ago
</div>
1 year ago
<div class="wrap1_4" v-if="item.isRight">
<image style="width: 80rpx;height: 80rpx" src="../../static/zu154@3x.png"></image>
</div>
1 year ago
</div>
</div>
1 year ago
</scroll-view>
1 year ago
1 year ago
<tabbar :current="1"></tabbar>
</div>
</template>
1 year ago
<script>
1 year ago
import tabbar from "../../components/uiq-tabbar/uiq-tabbar.vue";
1 year ago
import UImage from "../../uview-ui/components/u--image/u--image.vue";
1 year ago
import {postDataByParams} from "../../http/service";
1 year ago
1 year ago
export default {
1 year ago
name: "index",
1 year ago
data() {
1 year ago
return {
1 year ago
show: false,
mobileKey: '',
1 year ago
startX: 0,
1 year ago
windowWidth: 0,
page: 1,
1 year ago
status: 0,
1 year ago
pageSize: 999,
mainList: [],
1 year ago
statusValue: [{label: '全部状态', value: 0}, {label: '未入库', value: 1}, {
label: '已入库',
value: 2
}, {label: '即将到期', value: 3}, {label: '超时', value: 4}, {label: '已取货', value: 5}]
1 year ago
}
},
1 year ago
components: {UImage, tabbar},
1 year ago
mounted() {
1 year ago
this.getData()
1 year ago
uni.getSystemInfo({
1 year ago
success: (res) => {
this.windowWidth = res.windowWidth
1 year ago
}
})
},
1 year ago
methods: {
1 year ago
search() {
this.getData()
},
statusSelect(data) {
this.status = data.value
this.getData()
1 year ago
},
1 year ago
openStatus() {
this.show = true
},
loadMore() {
1 year ago
console.log('loadMore')
},
1 year ago
async getData() {
const data = {
page: this.page, //分页
pageSize: this.pageSize, //每页数据量
1 year ago
status: this.status, //状态(1-未入库 2-已入库 3-即将到期 4-超时 5-已取货)
1 year ago
mobileKey: this.mobileKey
}
const res = await postDataByParams('/api/warehouse/list', data)
if (res.code === 200) {
this.mainList = res.data.data
1 year ago
this.mainList?.forEach((x) => {
1 year ago
this.$set(x, 'distanceX', 0)
this.$set(x, 'isRight', false)
})
}
},
touchMove(e, index) {
this.mainList[index].distanceX = e.touches[0].clientX - this.startX;
1 year ago
},
1 year ago
touchStart(e, index) {
this.mainList[index].isRight = true
1 year ago
this.startX = e.touches[0].clientX;
1 year ago
},
1 year ago
touchEnd(index) {
if (this.mainList[index].distanceX < -((144 / 750) * this.windowWidth)) {
this.mainList[index].distanceX = -((144 / 750) * this.windowWidth);
1 year ago
} else {
1 year ago
this.mainList[index].isRight = false
this.mainList[index].distanceX = 0;
1 year ago
}
1 year ago
}
}
1 year ago
}
</script>
<style scoped lang="scss">
1 year ago
.order-goods {
1 year ago
overflow: hidden;
1 year ago
background-image: url("https://cdns.fontree.cn/fonchain-main/prod/image/default/artwork/4fdc9a0f-d72a-46b6-a04d-ed56d5465213.png");
1 year ago
box-sizing: border-box;
1 year ago
1 year ago
padding-left: 30rpx;
padding-right: 30rpx;
background-size: cover;
width: 100vw;
height: 100vh;
1 year ago
.content3 {
1 year ago
height: 2000rpx;
1 year ago
1 year ago
margin-bottom: 166rpx;
1 year ago
1 year ago
.wrap1 {
margin-bottom: 20rpx;
1 year ago
position: relative;
1 year ago
padding-left: 20rpx;
border-radius: 20rpx;
background-color: #fff;
height: 228rpx;
display: flex;
align-items: center;
1 year ago
1 year ago
.wrap1_4 {
1 year ago
display: flex;
justify-content: center;
align-items: center;
height: 228rpx;
width: 154rpx;
background-color: #B7C0C8;
right: -144rpx;
position: absolute;
z-index: -1;
}
1 year ago
.wrap1_3 {
1 year ago
border-top-right-radius: 20rpx;
border-bottom-right-radius: 20rpx;
1 year ago
display: flex;
margin-left: auto;
1 year ago
1 year ago
position: relative;
width: 144rpx;
height: 228rpx;
1 year ago
&.status1 {
1 year ago
background: #FFBA00;
1 year ago
.wrap1_3_3_1 {
1 year ago
color: #FFBA00;
}
}
1 year ago
&.status2 {
1 year ago
background: #76C458;
1 year ago
.wrap1_3_3_1 {
1 year ago
color: #76C458;
}
}
1 year ago
&.status3 {
1 year ago
background: #76C458;
1 year ago
.wrap1_3_3_1 {
color: #FF4848;
}
}
&.status4 {
background: #FF4848;
.wrap1_3_3_1 {
1 year ago
color: #FF4848;
}
}
1 year ago
1 year ago
.wrap1_3_2 {
1 year ago
display: flex;
flex-direction: column;
1 year ago
left: 20rpx;
1 year ago
position: absolute;
1 year ago
bottom: 60rpx;
.wrap1_3_2_1 {
color: #fff;
font-size: 16rpx;
}
.wrap1_3_2_2 {
1 year ago
color: #fff;
font-size: 24rpx;
}
}
1 year ago
.wrap1_3_3 {
padding-top: 18rpx;
1 year ago
padding-bottom: 18rpx;
display: flex;
flex-direction: column;
align-items: center;
border-top-right-radius: 15rpx;
left: 4rpx;
top: 4rpx;
width: 136rpx;
background-color: #fff;
position: absolute;
1 year ago
.wrap1_3_3_1 {
1 year ago
text-align: center;
font-size: 28rpx;
}
}
1 year ago
1 year ago
.wrap1_3_1 {
1 year ago
1 year ago
padding-bottom: 6rpx;
display: flex;
flex-direction: column;
align-items: center;
1 year ago
border-top-right-radius: 15rpx;
1 year ago
left: 4rpx;
top: 4rpx;
width: 136rpx;
background-color: #fff;
position: absolute;
1 year ago
.wrap1_3_1_1 {
1 year ago
font-size: 16rpx;
color: #FF4848;
}
1 year ago
.wrap1_3_1_2 {
1 year ago
font-size: 24rpx;
color: #FF4848;
}
1 year ago
.wrap1_3_1_3 {
1 year ago
display: flex;
align-items: center;
justify-content: center;
border-radius: 8rpx;
color: #fff;
font-size: 16rpx;
1 year ago
width: 110rpx;
height: 34rpx;
background-color: #000;
1 year ago
}
}
}
1 year ago
.wrap1_2 {
1 year ago
margin-left: 14rpx;
display: flex;
flex-direction: column;
align-items: start;
1 year ago
.wrap1_2_1 {
margin-bottom: 12rpx;
1 year ago
color: #000;
font-size: 28rpx;
}
1 year ago
.wrap1_2_2 {
1 year ago
margin-bottom: 12rpx;
color: #808080;
font-size: 24rpx;
}
1 year ago
.wrap1_2_3 {
1 year ago
margin-bottom: 12rpx;
color: #808080;
font-size: 24rpx;
}
1 year ago
.wrap1_2_4 {
1 year ago
color: #FF4848;
font-size: 24rpx;
}
}
1 year ago
.wrap1_1 {
image {
1 year ago
width: 188rpx;
height: 188rpx;
}
}
}
}
1 year ago
.content2 {
margin-top: 26rpx;
1 year ago
display: flex;
1 year ago
justify-content: space-between;
1 year ago
1 year ago
.wrap2 {
display: flex;
justify-content: center;
align-items: center;
border-radius: 20rpx;
color: #fff;
font-size: 20rpx;
width: 94rpx;
height: 52rpx;
background-color: #4E964D;
1 year ago
}
1 year ago
.wrap1 {
align-items: center;
display: flex;
border-radius: 20rpx;
background-color: rgba(0, 0, 0, 0.5);
width: 586rpx;
height: 52rpx;
.wrap1_2 {
margin-left: 20rpx;
margin-right: 20rpx;
width: 1rpx;
height: 30rpx;
background-color: #fff;
}
input {
}
.wrap1_1 {
margin-left: 26rpx;
image {
width: 28rpx;
height: 28rpx;
}
1 year ago
}
}
}
1 year ago
1 year ago
.content1 {
display: flex;
justify-content: space-between;
1 year ago
.wrap3 {
font-size: 24rpx;
color: #fff;
width: 132rpx;
height: 52rpx;
background-color: #76C458;
display: flex;
justify-content: center;
align-items: center;
border-radius: 20rpx;
}
1 year ago
.wrap2 {
display: flex;
flex-direction: column;
align-items: center;
1 year ago
1 year ago
.wrap2_1 {
color: #4E964D;
font-size: 32rpx;
}
1 year ago
1 year ago
.wrap2_2 {
1 year ago
color: #7C9F6F;
1 year ago
font-size: 16rpx;
}
}
.wrap1 {
.wrap1_1 {
justify-content: center;
border-radius: 20rpx;
width: 156rpx;
height: 52rpx;
background-color: #4E964D;
color: #fff;
font-size: 24rpx;
display: flex;
align-items: center;
}
}
}
}
1 year ago
</style>