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.

617 lines
16 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"
1 year ago
:actions="statusValue.map(x=>({name:x.label,value:x.value}))"
1 year ago
title="请选择状态"
@close="show = false"
@select="statusSelect"
>
</u-action-sheet>
<div @click="openStatus" class="wrap1">
<div class="wrap1_1">
1 year ago
<div class="wrap1_1_1">{{ statusValue.find(x => x.value === artworkStatus).label }}</div>
1 year ago
<image style="width: 12rpx;height: 8rpx" src="../../static/dbx2@3x.png"></image>
</div>
1 year ago
</div>
</template>
</title-block>
<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
1 year ago
<div class="content3">
<scroll-view :style="{height:`${elementBottom}rpx`}" class="scrollbox" :scroll-y="true" @scrolltolower="loadMore">
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)}"
1 year ago
@click="goRouter(item)"
1 year ago
:style="{transform: `translateX(${item.distanceX}px)`}" class="wrap1">
<div class="wrap1_1">
1 year ago
<image :src="item.artworkImg?item.artworkImg:'../../static/jx632@3x.png'"></image>
1 year ago
</div>
1 year ago
<div class="wrap1_2">
1 year ago
<div class="wrap1_2_1">{{ item.artworkName }}</div>
1 year ago
<!-- <div class="wrap1_2_2">订单号:{{ item.artworkName }}</div>-->
1 year ago
<div class="wrap1_2_3">{{ item.artworkSquareSize }}平尺</div>
1 year ago
<div class="wrap1_2_4">
1 year ago
<div v-if="![1].includes(item.artworkStatus)">
12 months ago
{{ item.startAt.replaceAll('-','.') || '' }}-{{ item.endAt.replaceAll('-','.') || '' }}
1 year ago
</div>
<div v-else>{{item.cycleName}} </div>
</div>
1 year ago
</div>
1 year ago
<div class="wrap1_3" :class="[`status${item.artworkStatus}`]">
<div class="wrap1_3_1" v-if="item.artworkStatus===4">
1 year ago
<div class="wrap1_3_1_1">{{ item.endAt }}</div>
1 year ago
<div class="wrap1_3_1_2">已延期</div>
1 year ago
<div class="wrap1_3_1_3" v-if="item.isSupplementary" @click.stop="openShow2(item)"></div>
1 year ago
</div>
1 year ago
<div class="wrap1_3_3" v-if="item.artworkStatus!==4">
<div class="wrap1_3_3_1">{{ statusValue.find(x => x.value === item.artworkStatus).label }}</div>
1 year ago
</div>
1 year ago
<div v-if="item.shelvesNum" class="wrap1_3_2">
<div class="wrap1_3_2_1">货架号:</div>
1 year ago
<div class="wrap1_3_2_2">{{ item.shelvesNum }}</div>
1 year ago
</div>
9 months ago
<div v-if="!item.shelvesNum" class="wrap1_3_2" >
1 year ago
<div class="wrap1_3_2_2">{{item.warehouseName}}</div>
</div>
9 months ago
<div class="wrap1_3_4" v-if="![1,5].includes(item.artworkStatus)" @click.stop="pickUp(item)">
9 months ago
{{item.isUserApplyPickUp?'取消申请':'申请取货'}}
9 months ago
</div>
1 year ago
</div>
1 year ago
<div class="wrap1_4" v-if="item.isRight&&item.artworkStatus===5" @click.stop="openDelete(item)">
1 year ago
<image style="width: 80rpx;height: 80rpx" src="../../static/zu154@3x.png"></image>
</div>
1 year ago
</div>
1 year ago
</scroll-view>
</div>
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog :type="'info'" cancelText="关闭" confirmText="确认" title="提示" :content="messageText"
@confirm="popForward"
></uni-popup-dialog>
</uni-popup>
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
messageText: '',
1 year ago
show_1: false,
1 year ago
show: false,
mobileKey: '',
1 year ago
startX: 0,
1 year ago
windowWidth: 0,
page: 1,
1 year ago
elementBottom: '',
1 year ago
item: null,
1 year ago
artworkStatus: 0,
1 year ago
pageSize: 999,
mainList: [],
1 year ago
statusValue: [{label: '全部状态', value: 0}, {label: '待入库', value: 1}, {
1 year ago
label: '已入库',
value: 2
12 months ago
}, {label: '即将到期', value: 3}, {label: '延期未补款', value: 4}, {label: '延期已补款', value: 7}, {label: '已取出', value: 5}]
1 year ago
}
},
1 year ago
components: {UImage, tabbar},
1 year ago
mounted() {
1 year ago
1 year ago
uni.getSystemInfo({
1 year ago
success: (res) => {
this.windowWidth = res.windowWidth
1 year ago
}
})
1 year ago
this.getDistanceFromTopToPageBottom('.content3')
},
1 year ago
onShow(){
this.getData()
},
1 year ago
computed: {},
1 year ago
methods: {
9 months ago
async pickUp(item){
let url=''
9 months ago
if (!item.isUserApplyPickUp){
9 months ago
url='/api/warehouse/apply/pickup'
}else {
url='/api/warehouse/apply/pickup/cancel'
}
const data={
ID:item.ID
}
const res = await postDataByParams(url, data)
if (res.code===200){
uni.showToast({
title: '请求成功',
icon: 'none'
})
}else {
uni.showToast({
title:res.msg,
icon: 'none'
})
}
this.getData()
},
1 year ago
popForward() {
1 year ago
1 year ago
if (this.messageText === '确认补款吗') {
this.supplementaryPayment()
} else if (this.messageText === '确认删除吗') {
this.deleteClick()
}
},
1 year ago
openShow2(item) {
this.item = item
1 year ago
this.messageText = `确认补款吗`
this.$refs.alertDialog.open()
},
1 year ago
async supplementaryPayment() {
1 year ago
const data = {
1 year ago
ID: this.item.ID
}
const res = await postDataByParams('/api/warehouse/supply/paid', data)
if (res.code===200){
11 months ago
uni.requestPayment({...res.data,fail:(res)=>{
},success:()=>{
this.getData()
uni.showToast({
title: '补款成功',
icon: 'none'
})
}})
1 year ago
}else {
uni.showToast({
title: res.msg,
icon: 'none'
})
1 year ago
}
},
1 year ago
async getDistanceFromTopToPageBottom(classValue) {
1 year ago
const {windowHeight, windowWidth} = await uni.getSystemInfo();
const [{top}] = await new Promise(resolve => uni.createSelectorQuery().select(classValue).boundingClientRect().exec(resolve));
1 year ago
this.elementBottom = ((windowHeight - top) / windowWidth) * 750 - 175;
/* if(uni.getSystemInfoSync().platform === 'ios'){
1 year ago
this.elementBottom = ((windowHeight - top) / windowWidth) * 750 - 175;
}else {
this.elementBottom = ((windowHeight - top) / windowWidth) * 750 - 110;
1 year ago
}*/
1 year ago
},
1 year ago
openDelete(item) {
1 year ago
this.messageText = `确认删除吗`
this.$refs.alertDialog.open()
1 year ago
this.item = item
},
async deleteClick() {
this.show_1 = false
const data = {
ID: this.item.ID
}
const res = await postDataByParams('/api/warehouse/remove', data)
if (res.code === 200) {
this.getData()
uni.showToast({
title: '删除成功',
icon: 'none'
})
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
},
goRouter(item) {
uni.navigateTo({
url: `/pages/order-goods/order-details?ID=${item.ID}`
})
1 year ago
},
1 year ago
search() {
this.getData()
},
statusSelect(data) {
1 year ago
this.artworkStatus = data.value
1 year ago
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.artworkStatus, //状态(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)
})
1 year ago
} else {
1 year ago
uni.showToast({
title: res.msg,
1 year ago
icon: 'none'
1 year ago
})
1 year ago
}
},
touchMove(e, index) {
1 year ago
if (this.mainList[index].artworkStatus!==5){
return
}
1 year ago
this.mainList[index].distanceX = e.touches[0].clientX - this.startX;
1 year ago
},
1 year ago
touchStart(e, index) {
1 year ago
if (this.mainList[index].artworkStatus!==5){
return
}
1 year ago
this.mainList[index].isRight = true
1 year ago
this.startX = e.touches[0].clientX;
1 year ago
},
1 year ago
touchEnd(index) {
1 year ago
if (this.mainList[index].artworkStatus!==5){
return
}
1 year ago
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
box-sizing: border-box;
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
padding-left: 30rpx;
padding-right: 30rpx;
background-size: cover;
width: 100vw;
height: 100vh;
1 year ago
.content3 {
1 year ago
margin-top: 20rpx;
1 year ago
1 year ago
margin-bottom: 300rpx;
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;
position: relative;
width: 144rpx;
height: 228rpx;
1 year ago
&.status5 {
1 year ago
background: #939393;
1 year ago
1 year ago
.wrap1_3_3_1 {
color: #939393;
}
}
1 year ago
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;
}
}
12 months ago
&.status7 {
background: #76C458;
1 year ago
12 months ago
.wrap1_3_3_1 {
12 months ago
font-size: 23rpx!important;
12 months ago
}
}
1 year ago
&.status3 {
1 year ago
background: #76C458;
1 year ago
.wrap1_3_3_1 {
color: #FF4848;
}
}
1 year ago
1 year ago
&.status4 {
background: #FF4848;
.wrap1_3_3_1 {
1 year ago
color: #FF4848;
}
}
9 months ago
.wrap1_3_4{
display: flex;
align-items: center;
justify-content: center;
border-radius: 8rpx;
color: #fff;
width: 110rpx;
height: 35rpx;
background-color: #000;
left: 20rpx;
position: absolute;
bottom: 16rpx;
font-size: 18rpx;
}
1 year ago
.wrap1_3_2 {
1 year ago
display: flex;
flex-direction: column;
9 months ago
left: 50%;
transform: translateX(-50%);
1 year ago
position: absolute;
1 year ago
bottom: 60rpx;
9 months ago
min-width: fit-content;
1 year ago
.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>