Compare commits

...

2 Commits

1 changed files with 225 additions and 215 deletions

View File

@ -1,36 +1,45 @@
<template> <template>
<view> <view>
<u-popup :show="addShow" <u-popup
:show="addShow"
closeable closeable
:round="10" :round="10"
mode="center" mode="center"
@close="closeTap"> @close="closeTap"
>
<view class="height-auto"> <view class="height-auto">
<view style="padding: 0 40rpx;"> <view style="padding: 0 40rpx">
<view>{{'购买数量'}}</view> <view>{{ '购买数量' }}</view>
<view class="sum-view"> <view class="sum-view">
<input class="inputs" v-model="form.carryNum" placeholder="" /> <input class="inputs" v-model="form.carryNum" placeholder="" />
</view> </view>
</view> </view>
<view class="buttons"> <view class="buttons">
<view class="btn" @click="closeTap">{{'取消'}}</view> <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>
</view> </view>
</u-popup> </u-popup>
<view class="goods"> <view class="goods">
<view class="pick-up" v-for="item in dataList"> <view class="pick-up" v-for="item in dataList">
<view class="banner"> <view class="banner">
<image :src="item.pickCover"> <image :src="item.pickCover"> </image>
<view class="sum"> {{ '数量' }}:{{ item.usableQuantity }} </view>
</image>
<view class="sum">
{{'数量'}}:{{item.usableQuantity}}
</view> </view>
</view> <view class="time" v-if="item.receiveTime"
<view class="time" v-if="item.receiveTime">{{'截止时间'}}{{item.receiveTime}}</view> >{{ '截止时间' }}{{ item.receiveTime }}</view
<view class="button" v-if="item.pickFlag==0" @click="pickSubmitShow(item)"> >
{{'申请提货'}} <view
class="button"
v-if="item.pickFlag == 0"
@click="pickSubmitShow(item)"
>
{{ '申请提货' }}
</view> </view>
</view> </view>
</view> </view>
@ -38,22 +47,20 @@
</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() { mounted() {
@ -61,60 +68,64 @@
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
uni.navigateTo({ uni.navigateTo({
url:"/pages/pickupList/index" url: '/pages/pickupList/index',
}) })
}, },
methods: { methods: {
closeTap() {
closeTap(){
this.addShow = false this.addShow = false
}, },
pickSubmit() { pickSubmit() {
if(this.form.carryNum<1){ if (this.form.carryNum < 1) {
uni.showToast({ uni.showToast({
title:'提货数量不能小于1', title: '提货数量不能小于1',
icon:"none", icon: 'none',
}) })
return return
} }
if(this.carryGoodsItem.baseQuantity>1){ if (this.carryGoodsItem.baseQuantity > 1) {
if(this.form.carryNum%this.carryGoodsItem.baseQuantity !== 0){ if (this.form.carryNum < this.carryGoodsItem.baseQuantity) {
uni.showToast({ uni.showToast({
title:'提货数量必须是'+this.carryGoodsItem.baseQuantity+'的基数', title: '提货数量必须大于等于' + this.carryGoodsItem.baseQuantity,
icon:"none", icon: 'none',
}) })
return return
} }
} }
if(this.form.carryNum > this.carryGoodsItem.usableQuantity){ if (this.form.carryNum > this.carryGoodsItem.usableQuantity) {
uni.showToast({ uni.showToast({
title:'提货数量大于可提数量', title: '提货数量大于可提数量',
icon:"none", icon: 'none',
}) })
return return
} }
this.addShow = false; this.addShow = false
uni.navigateTo({ uni.navigateTo({
url: '/pages/thOrder/index?pkId='+ this.carryGoodsItem.pkId url:
+'&num='+this.form.carryNum , '/pages/thOrder/index?pkId=' +
this.carryGoodsItem.pkId +
'&num=' +
this.form.carryNum,
}) })
}, },
pickSubmitShow(item) { pickSubmitShow(item) {
if(item.pickFlag==1){ if (item.pickFlag == 1) {
// //
uni.navigateTo({ uni.navigateTo({
url: '/pages/thOrder/index?pkId='+ item.pkId url:
+'&num='+this.form.carryNum , '/pages/thOrder/index?pkId=' +
item.pkId +
'&num=' +
this.form.carryNum,
}) })
return return
} }
this.form.carryNum = item.baseQuantity this.form.carryNum = item.baseQuantity
this.form.carryNum1 = item.baseQuantity this.form.carryNum1 = item.baseQuantity
this.form.usableQuantity = item.usableQuantity this.form.usableQuantity = item.usableQuantity
this.addShow = true; this.addShow = true
this.carryGoodsItem = item; this.carryGoodsItem = item
// this.$refs['form'].validate(valid => { // this.$refs['form'].validate(valid => {
// if (!valid) { // if (!valid) {
// return false // return false
@ -123,101 +134,100 @@
// } // }
// }) // })
}, },
getUserPickUpList(){ getUserPickUpList() {
apis.pickList(this.query).then((res)=>{ apis.pickList(this.query).then(res => {
this.dataList = res.data 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>