|
@@ -1,6 +1,12 @@
|
|
<template>
|
|
<template>
|
|
<view class="container cart clearfix">
|
|
<view class="container cart clearfix">
|
|
- <view class="container-cart-main">
|
|
|
|
|
|
+ <view class="record-content-empty" v-if="isEmpty" :style="{'height': windowHeight ? windowHeight - CustomBar+'px' : 'auto'}">
|
|
|
|
+ <view class="record-container clearfix">
|
|
|
|
+ <image class="club-empty-image" src="https://img.caimei365.com/group1/M00/03/B7/Cmis2178OfaAEjhLAABqsz9OXM0847.png" mode="aspectFit"></image>
|
|
|
|
+ <view class="txt">未发货商品已全部取消,无需再发货~</view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="container-cart-main" v-else>
|
|
<view class="container-cart">
|
|
<view class="container-cart">
|
|
<view class="cart-content" :style="{paddingBottom :isIphoneX ? '130rpx' : '100rpx'}">
|
|
<view class="cart-content" :style="{paddingBottom :isIphoneX ? '130rpx' : '100rpx'}">
|
|
<view class="goods-title">请选择合适的商品数量进行发货</view>
|
|
<view class="goods-title">请选择合适的商品数量进行发货</view>
|
|
@@ -67,49 +73,60 @@
|
|
export default{
|
|
export default{
|
|
data(){
|
|
data(){
|
|
return{
|
|
return{
|
|
|
|
+ isEmpty:false,
|
|
CustomBar:this.CustomBar,// 顶部导航栏高度
|
|
CustomBar:this.CustomBar,// 顶部导航栏高度
|
|
isIphoneX:this.$store.state.isIphoneX,
|
|
isIphoneX:this.$store.state.isIphoneX,
|
|
shopOrderId:'',
|
|
shopOrderId:'',
|
|
productsList:[],//发货的商品
|
|
productsList:[],//发货的商品
|
|
isCheckAll:false,//是否全选
|
|
isCheckAll:false,//是否全选
|
|
|
|
+ scrollHeight: '',
|
|
|
|
+ windowHeight: '',
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(option){
|
|
onLoad(option){
|
|
- console.log(option)
|
|
|
|
- this.shopOrderId = option.shopOrderId
|
|
|
|
- this.initShopOrderShipmentsInfo();
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState(['hasLogin','userInfo'])
|
|
...mapState(['hasLogin','userInfo'])
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
- initShopOrderShipmentsInfo(){//初始化购物车 index:1
|
|
|
|
|
|
+ initShopOrderShipmentsInfo(){//初始化
|
|
this.ShopService.ShopOrderShipmentsInfo({ shopOrderId : this.shopOrderId }).then(response =>{
|
|
this.ShopService.ShopOrderShipmentsInfo({ shopOrderId : this.shopOrderId }).then(response =>{
|
|
- let orderProductList = response.data.orderProductList
|
|
|
|
- let elObject = {}
|
|
|
|
- let isReduceNum = false
|
|
|
|
- let creatProductList = []
|
|
|
|
- orderProductList.forEach(el =>{
|
|
|
|
- let uninNum = el.notOutStore - el.actualCancelNum//未发货数量
|
|
|
|
- if(uninNum == 1){
|
|
|
|
- isReduceNum = true
|
|
|
|
- }else{
|
|
|
|
- isReduceNum = false
|
|
|
|
- }
|
|
|
|
- elObject = {
|
|
|
|
- shipmentCount:uninNum,
|
|
|
|
- isReduceNum:isReduceNum,
|
|
|
|
- checked:false
|
|
|
|
- }
|
|
|
|
- creatProductList.push(Object.assign({},el,elObject))
|
|
|
|
- })
|
|
|
|
- this.productsList = creatProductList
|
|
|
|
- console.log(this.productsList)
|
|
|
|
|
|
+ if( response.data.orderProductList.length>0){
|
|
|
|
+ let orderProductList = response.data.orderProductList
|
|
|
|
+ let elObject = {}
|
|
|
|
+ let isReduceNum = false
|
|
|
|
+ let creatProductList = []
|
|
|
|
+ this.isEmpty = false
|
|
|
|
+ orderProductList.forEach(el =>{
|
|
|
|
+ let uninNum = el.notOutStore - el.actualCancelNum//未发货数量
|
|
|
|
+ if(uninNum == 1){
|
|
|
|
+ isReduceNum = true
|
|
|
|
+ }else{
|
|
|
|
+ isReduceNum = false
|
|
|
|
+ }
|
|
|
|
+ elObject = {
|
|
|
|
+ shipmentCount:uninNum,
|
|
|
|
+ isReduceNum:isReduceNum,
|
|
|
|
+ checked:false
|
|
|
|
+ }
|
|
|
|
+ creatProductList.push(Object.assign({},el,elObject))
|
|
|
|
+ })
|
|
|
|
+ this.productsList = creatProductList
|
|
|
|
+ console.log(this.productsList)
|
|
|
|
+ }else{
|
|
|
|
+ this.isEmpty = true
|
|
|
|
+ }
|
|
}).catch(error =>{
|
|
}).catch(error =>{
|
|
this.$util.msg(error.msg,2000);
|
|
this.$util.msg(error.msg,2000);
|
|
})
|
|
})
|
|
|
|
|
|
},
|
|
},
|
|
|
|
+ setScrollHeight() {
|
|
|
|
+ const {windowHeight, pixelRatio} = wx.getSystemInfoSync();
|
|
|
|
+ this.windowHeight = windowHeight - 1;
|
|
|
|
+ this.scrollHeight = windowHeight - 1;
|
|
|
|
+ },
|
|
ischeck(pro){//为未选中的时候改变为true,反之为true
|
|
ischeck(pro){//为未选中的时候改变为true,反之为true
|
|
pro.checked = !pro.checked;
|
|
pro.checked = !pro.checked;
|
|
this.updateCheckAllBtn();
|
|
this.updateCheckAllBtn();
|
|
@@ -181,11 +198,13 @@
|
|
},
|
|
},
|
|
},
|
|
},
|
|
onPullDownRefresh() {//下拉刷新
|
|
onPullDownRefresh() {//下拉刷新
|
|
- // this.initShopOrderShipmentsInfo()
|
|
|
|
- // uni.stopPullDownRefresh()
|
|
|
|
|
|
+ this.initShopOrderShipmentsInfo()
|
|
|
|
+ uni.stopPullDownRefresh()
|
|
},
|
|
},
|
|
onShow(){
|
|
onShow(){
|
|
-
|
|
|
|
|
|
+ this.shopOrderId = uni.getStorageSync('shopOrderId')
|
|
|
|
+ this.setScrollHeight()
|
|
|
|
+ this.initShopOrderShipmentsInfo();
|
|
},
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -195,6 +214,40 @@
|
|
background: #f7f7f7;
|
|
background: #f7f7f7;
|
|
height: auto;
|
|
height: auto;
|
|
}
|
|
}
|
|
|
|
+ .record-content-empty{
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ .record-container{
|
|
|
|
+ width: 465rpx;
|
|
|
|
+ height: auto;
|
|
|
|
+ image{
|
|
|
|
+ width: 400rpx;
|
|
|
|
+ height: 400rpx;
|
|
|
|
+ display: block;
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ }
|
|
|
|
+ .txt{
|
|
|
|
+ font-size: $font-size-28;
|
|
|
|
+ text-align: center;
|
|
|
|
+ color: #333;
|
|
|
|
+ line-height: 30rpx;
|
|
|
|
+ margin-bottom: 20rpx;
|
|
|
|
+ }
|
|
|
|
+ .btn{
|
|
|
|
+ width: 400rpx;
|
|
|
|
+ height: 80rpx;
|
|
|
|
+ background: $btn-confirm;
|
|
|
|
+ border-radius: 10rpx;
|
|
|
|
+ line-height: 80rpx;
|
|
|
|
+ font-size: $font-size-28;
|
|
|
|
+ text-align: center;
|
|
|
|
+ color: #FFFFFF;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
.cart-content{
|
|
.cart-content{
|
|
position: relative;
|
|
position: relative;
|
|
}
|
|
}
|