Compare commits

...

2 Commits

1 changed files with 225 additions and 215 deletions

View File

@ -1,12 +1,14 @@
<template>
<view>
<u-popup :show="addShow"
<u-popup
:show="addShow"
closeable
:round="10"
mode="center"
@close="closeTap">
@close="closeTap"
>
<view class="height-auto">
<view style="padding: 0 40rpx;">
<view style="padding: 0 40rpx">
<view>{{ '购买数量' }}</view>
<view class="sum-view">
<input class="inputs" v-model="form.carryNum" placeholder="" />
@ -14,22 +16,29 @@
</view>
<view class="buttons">
<view class="btn" @click="closeTap">{{ '取消' }}</view>
<view class="btn" style="border-right: none;color: #005BAC;" @click="pickSubmit">{{'确定'}}</view>
<view
class="btn"
style="border-right: none; color: #005bac"
@click="pickSubmit"
>{{ '确定' }}</view
>
</view>
</view>
</u-popup>
<view class="goods">
<view class="pick-up" v-for="item in dataList">
<view class="banner">
<image :src="item.pickCover">
</image>
<view class="sum">
{{'数量'}}:{{item.usableQuantity}}
<image :src="item.pickCover"> </image>
<view class="sum"> {{ '数量' }}:{{ item.usableQuantity }} </view>
</view>
</view>
<view class="time" v-if="item.receiveTime">{{'截止时间'}}{{item.receiveTime}}</view>
<view class="button" v-if="item.pickFlag==0" @click="pickSubmitShow(item)">
<view class="time" v-if="item.receiveTime"
>{{ '截止时间' }}{{ item.receiveTime }}</view
>
<view
class="button"
v-if="item.pickFlag == 0"
@click="pickSubmitShow(item)"
>
{{ '申请提货' }}
</view>
</view>
@ -49,11 +58,9 @@
pageSize: 50,
},
rules: {
carryNum: [
{required: true, message: '请输入', trigger: "blur"},
],
carryNum: [{ required: true, message: '请输入', trigger: 'blur' }],
},
dataList:[]
dataList: [],
}
},
mounted() {
@ -61,11 +68,10 @@
},
onNavigationBarButtonTap(e) {
uni.navigateTo({
url:"/pages/pickupList/index"
url: '/pages/pickupList/index',
})
},
methods: {
closeTap() {
this.addShow = false
},
@ -73,15 +79,15 @@
if (this.form.carryNum < 1) {
uni.showToast({
title: '提货数量不能小于1',
icon:"none",
icon: 'none',
})
return
}
if (this.carryGoodsItem.baseQuantity > 1) {
if(this.form.carryNum%this.carryGoodsItem.baseQuantity !== 0){
if (this.form.carryNum < this.carryGoodsItem.baseQuantity) {
uni.showToast({
title:'提货数量必须是'+this.carryGoodsItem.baseQuantity+'的基数',
icon:"none",
title: '提货数量必须大于等于' + this.carryGoodsItem.baseQuantity,
icon: 'none',
})
return
}
@ -89,32 +95,37 @@
if (this.form.carryNum > this.carryGoodsItem.usableQuantity) {
uni.showToast({
title: '提货数量大于可提数量',
icon:"none",
icon: 'none',
})
return
}
this.addShow = false;
this.addShow = false
uni.navigateTo({
url: '/pages/thOrder/index?pkId='+ this.carryGoodsItem.pkId
+'&num='+this.form.carryNum ,
url:
'/pages/thOrder/index?pkId=' +
this.carryGoodsItem.pkId +
'&num=' +
this.form.carryNum,
})
},
pickSubmitShow(item) {
if (item.pickFlag == 1) {
//
uni.navigateTo({
url: '/pages/thOrder/index?pkId='+ item.pkId
+'&num='+this.form.carryNum ,
url:
'/pages/thOrder/index?pkId=' +
item.pkId +
'&num=' +
this.form.carryNum,
})
return
}
this.form.carryNum = item.baseQuantity
this.form.carryNum1 = item.baseQuantity
this.form.usableQuantity = item.usableQuantity
this.addShow = true;
this.carryGoodsItem = item;
this.addShow = true
this.carryGoodsItem = item
// this.$refs['form'].validate(valid => {
// if (!valid) {
// return false
@ -124,11 +135,11 @@
// })
},
getUserPickUpList() {
apis.pickList(this.query).then((res)=>{
apis.pickList(this.query).then(res => {
this.dataList = res.data
})
}
}
},
},
}
</script>
@ -156,24 +167,23 @@
.sum-view {
width: 440rpx;
height: 64rpx;
background: #FFFFFF;
border: 1rpx solid #DDDDDD;
background: #ffffff;
border: 1rpx solid #dddddd;
border-radius: 32rpx;
line-height: 64rpx;
margin: 30rpx auto;
}
.height-auto {
padding: 40rpx 0;
width: 525rpx;
height: 220rpx;
background: #FFFFFF;
background: #ffffff;
border-radius: 25rpx;
}
.button {
width: 182rpx;
height: 52rpx;
background: #005BAC;
background: #005bac;
border-radius: 26rpx;
text-align: center;
line-height: 52rpx;
@ -213,7 +223,7 @@
.pick-up {
// width: 330rpx;
// height: 413rpx;
background: #FFFFFF;
background: #ffffff;
box-shadow: 0px 5rpx 5rpx 0px rgba(0, 0, 0, 0.05);
border-radius: 15rpx;
margin-left: 30rpx;