Compare commits

...

2 Commits

1 changed files with 225 additions and 215 deletions

View File

@ -1,223 +1,233 @@
<template> <template>
<view> <view>
<u-popup :show="addShow" <u-popup
closeable :show="addShow"
:round="10" closeable
mode="center" :round="10"
@close="closeTap"> mode="center"
<view class="height-auto"> @close="closeTap"
<view style="padding: 0 40rpx;"> >
<view>{{'购买数量'}}</view> <view class="height-auto">
<view class="sum-view"> <view style="padding: 0 40rpx">
<input class="inputs" v-model="form.carryNum" placeholder="" /> <view>{{ '购买数量' }}</view>
</view> <view class="sum-view">
</view> <input class="inputs" v-model="form.carryNum" placeholder="" />
<view class="buttons"> </view>
<view class="btn" @click="closeTap">{{'取消'}}</view> </view>
<view class="btn" style="border-right: none;color: #005BAC;" @click="pickSubmit">{{'确定'}}</view> <view class="buttons">
</view> <view class="btn" @click="closeTap">{{ '取消' }}</view>
</view> <view
</u-popup> class="btn"
<view class="goods"> style="border-right: none; color: #005bac"
<view class="pick-up" v-for="item in dataList"> @click="pickSubmit"
<view class="banner"> >{{ '确定' }}</view
<image :src="item.pickCover"> >
</view>
</image> </view>
<view class="sum"> </u-popup>
{{'数量'}}:{{item.usableQuantity}} <view class="goods">
</view> <view class="pick-up" v-for="item in dataList">
</view> <view class="banner">
<view class="time" v-if="item.receiveTime">{{'截止时间'}}{{item.receiveTime}}</view> <image :src="item.pickCover"> </image>
<view class="button" v-if="item.pickFlag==0" @click="pickSubmitShow(item)"> <view class="sum"> {{ '数量' }}:{{ item.usableQuantity }} </view>
{{'申请提货'}} </view>
</view> <view class="time" v-if="item.receiveTime"
</view> >{{ '截止时间' }}{{ item.receiveTime }}</view
</view> >
</view> <view
class="button"
v-if="item.pickFlag == 0"
@click="pickSubmitShow(item)"
>
{{ '申请提货' }}
</view>
</view>
</view>
</view>
</template> </template>
<script> <script>
import * as apis from '@/config/index.js' import * as apis from '@/config/index.js'
export default { export default {
data() { data() {
return { return {
addShow:false, addShow: false,
form: {carryNum:''}, form: { carryNum: '' },
query:{ query: {
pageNum:1, pageNum: 1,
pageSize:50, pageSize: 50,
}, },
rules: { rules: {
carryNum: [ carryNum: [{ required: true, message: '请输入', trigger: 'blur' }],
{required: true, message: '请输入', trigger: "blur"}, },
], dataList: [],
}, }
dataList:[] },
} mounted() {
}, this.getUserPickUpList()
mounted() { },
this.getUserPickUpList() onNavigationBarButtonTap(e) {
}, uni.navigateTo({
onNavigationBarButtonTap(e) { url: '/pages/pickupList/index',
uni.navigateTo({ })
url:"/pages/pickupList/index" },
}) methods: {
}, closeTap() {
methods: { this.addShow = false
},
closeTap(){ pickSubmit() {
this.addShow = false if (this.form.carryNum < 1) {
}, uni.showToast({
pickSubmit() { title: '提货数量不能小于1',
if(this.form.carryNum<1){ icon: 'none',
uni.showToast({ })
title:'提货数量不能小于1', return
icon:"none", }
}) if (this.carryGoodsItem.baseQuantity > 1) {
return if (this.form.carryNum < this.carryGoodsItem.baseQuantity) {
} uni.showToast({
if(this.carryGoodsItem.baseQuantity>1){ title: '提货数量必须大于等于' + this.carryGoodsItem.baseQuantity,
if(this.form.carryNum%this.carryGoodsItem.baseQuantity !== 0){ icon: 'none',
uni.showToast({ })
title:'提货数量必须是'+this.carryGoodsItem.baseQuantity+'的基数', return
icon:"none", }
}) }
return if (this.form.carryNum > this.carryGoodsItem.usableQuantity) {
} uni.showToast({
} title: '提货数量大于可提数量',
if(this.form.carryNum > this.carryGoodsItem.usableQuantity){ icon: 'none',
uni.showToast({ })
title:'提货数量大于可提数量', return
icon:"none", }
}) this.addShow = false
return
} uni.navigateTo({
this.addShow = false; url:
'/pages/thOrder/index?pkId=' +
this.carryGoodsItem.pkId +
uni.navigateTo({ '&num=' +
url: '/pages/thOrder/index?pkId='+ this.carryGoodsItem.pkId this.form.carryNum,
+'&num='+this.form.carryNum , })
}) },
}, pickSubmitShow(item) {
pickSubmitShow(item) { if (item.pickFlag == 1) {
if(item.pickFlag==1){ //
// uni.navigateTo({
uni.navigateTo({ url:
url: '/pages/thOrder/index?pkId='+ item.pkId '/pages/thOrder/index?pkId=' +
+'&num='+this.form.carryNum , item.pkId +
}) '&num=' +
return this.form.carryNum,
} })
this.form.carryNum = item.baseQuantity return
this.form.carryNum1 = item.baseQuantity }
this.form.usableQuantity = item.usableQuantity this.form.carryNum = item.baseQuantity
this.addShow = true; this.form.carryNum1 = item.baseQuantity
this.carryGoodsItem = item; this.form.usableQuantity = item.usableQuantity
// this.$refs['form'].validate(valid => { this.addShow = true
// if (!valid) { this.carryGoodsItem = item
// return false // this.$refs['form'].validate(valid => {
// }else{ // if (!valid) {
// console.error("11") // return false
// } // }else{
// }) // console.error("11")
}, // }
getUserPickUpList(){ // })
apis.pickList(this.query).then((res)=>{ },
this.dataList = res.data getUserPickUpList() {
}) apis.pickList(this.query).then(res => {
} this.dataList = res.data
} })
} },
},
}
</script> </script>
<style lang="scss"> <style lang="scss">
.inputs{ .inputs {
padding-left: 30rpx ; padding-left: 30rpx;
padding-top: 8rpx; padding-top: 8rpx;
text-align: center; text-align: center;
width: 360rpx; width: 360rpx;
} }
.buttons{ .buttons {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
border-top: 1rpx solid #ddd; border-top: 1rpx solid #ddd;
} }
.btn{ .btn {
width: 330rpx; width: 330rpx;
height: 88rpx; height: 88rpx;
// background: #DDDDDD; // background: #DDDDDD;
line-height: 88rpx; line-height: 88rpx;
border-right: 1px solid #ddd; border-right: 1px solid #ddd;
text-align: center; text-align: center;
} }
.sum-view{ .sum-view {
width: 440rpx; width: 440rpx;
height: 64rpx; height: 64rpx;
background: #FFFFFF; background: #ffffff;
border: 1rpx solid #DDDDDD; border: 1rpx solid #dddddd;
border-radius: 32rpx; border-radius: 32rpx;
line-height: 64rpx; line-height: 64rpx;
margin: 30rpx auto; margin: 30rpx auto;
} }
.height-auto{ .height-auto {
padding: 40rpx 0;
padding: 40rpx 0; width: 525rpx;
width: 525rpx; height: 220rpx;
height: 220rpx; background: #ffffff;
background: #FFFFFF; border-radius: 25rpx;
border-radius: 25rpx; }
} .button {
.button{ width: 182rpx;
width: 182rpx; height: 52rpx;
height: 52rpx; background: #005bac;
background: #005BAC; border-radius: 26rpx;
border-radius: 26rpx; text-align: center;
text-align: center; line-height: 52rpx;
line-height: 52rpx; color: #fff;
color: #fff; font-size: 24rpx;
font-size: 24rpx; margin: 30rpx auto auto auto;
margin: 30rpx auto auto auto; }
} .time {
.time{ color: #999;
color: #999; font-size: 24rpx;
font-size: 24rpx; margin-top: 20rpx;
margin-top: 20rpx; }
} .banner {
.banner{ position: relative;
position: relative; image {
image{ width: 295rpx;
width: 295rpx; height: 180rpx;
height: 180rpx; position: relative;
position: relative; }
} }
} .sum {
.sum{ position: absolute;
position: absolute; right: 15rpx;
right: 15rpx; z-index: 1;
z-index: 1; bottom: 20rpx;
bottom: 20rpx; color: #fff;
color: #fff; font-size: 20rpx;
font-size: 20rpx; }
} page {
page{ background-color: #f2f2f2;
background-color: #f2f2f2; }
} .goods {
.goods{ display: flex;
display: flex; flex-wrap: wrap;
flex-wrap: wrap; padding: 30rpx 0;
padding: 30rpx 0; }
} .pick-up {
.pick-up{ // width: 330rpx;
// width: 330rpx; // height: 413rpx;
// height: 413rpx; background: #ffffff;
background: #FFFFFF; box-shadow: 0px 5rpx 5rpx 0px rgba(0, 0, 0, 0.05);
box-shadow: 0px 5rpx 5rpx 0px rgba(0,0,0,0.05); border-radius: 15rpx;
border-radius: 15rpx; margin-left: 30rpx;
margin-left: 30rpx; padding: 20rpx;
padding: 20rpx; margin-bottom: 30rpx;
margin-bottom: 30rpx; }
}
</style> </style>