首页分类可滑动

master
chen 2022-03-01 14:29:24 +08:00
parent bfc54c0006
commit df73406429
8 changed files with 60 additions and 70 deletions

View File

@ -38,7 +38,7 @@
</view>
</view>
</view>
<pitera v-if="total==dataList.length"></pitera>
<pitera v-if="total==dataList.length || dataList.length==0"></pitera>
</scroll-view>
<!-- 底部导航 -->
<view class="display-between-center cart-foot-box">
@ -169,7 +169,7 @@
},
methods:{
touchBottomEv(){// scroll-view
if(this.total != this.dataList.length){
if(this.total != this.dataList.length && this.dataList.length!=0){
this.page++;
this.checkList();
}
@ -283,7 +283,6 @@
this.total = res.data.total;
if(res.data.list.length){
res.data.list.forEach(item=>{
console.log(item,286);
// let newspec = [];
// if(item.sku.spec_text.length){
// item.sku.spec_text.forEach(itemspec=>{
@ -292,19 +291,21 @@
// }
// })
// }
let obj = {
id:item.id,
coding:item.sku.coding,
isActive:false,
imgSrc:item.spu.spu_cover,
title:item.spu_name,
specs:item.sku.spec_text,
// price:this.$toolAll.tools.changeNum(item.price*1),
price:item.price,
reckonPrice:item.price,
num:item.num
if(item.sku!=null){
let obj = {
id:item.id,
coding:item.sku.coding,
isActive:false,
imgSrc:item.spu.spu_cover,
title:item.spu_name,
specs:item.sku.spec_info,
// price:this.$toolAll.tools.changeNum(item.price*1),
price:item.price,
reckonPrice:item.price,
num:item.num
}
this.dataList.push(obj);
}
this.dataList.push(obj);
})
this.dataList.concat(this.dataList);
} else {

View File

@ -373,5 +373,11 @@
</script>
<style>
scroll-view ::-webkit-scrollbar {
display: none !important;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
</style>

View File

@ -122,7 +122,7 @@
}
},
onReachBottom() {
if(this.total!=this.dataList){
if(this.total!=this.dataList.length){
this.page++;
//
this.checkCommissionEv();
@ -156,11 +156,11 @@
this.distributionInfo.withdrawal_total = this.$toolAll.tools.addXiaoShu(this.distributionInfo.withdrawal_total);
//
this.commission = this.distributionInfo.commission;
//
this.dataList = this.dataList.concat(this.distributionInfo.log.list);
//
this.total = this.distributionInfo.log.total;
this.log(this.total,this.dataList.length)
//
this.dataList = this.dataList.concat(this.distributionInfo.log.list);
// this.log(this.total,this.dataList.length)
} else {
this.$toolAll.tools.showToast(err.msg);
}

View File

@ -78,18 +78,6 @@
</container-subgroup>
<!-- 底部导航 -->
<payment :totalPrice="totalPrice" @immediatePayment="goPayment"></payment>
<!-- 支付成功 -->
<view v-if="isSuccess" class="posAll" style="z-index: 3;background-color: #F5F5F5;">
<view class="bacf radius20 mar-s20 mar-zy20 success-box">
<image src="/static/public/pay-success.png" mode=""></image>
<view class="fon28 col3 pad-s20 pad-x40">支付成功</view>
<view class="success-hj"><span>{{jsPrice<0?0:jsPrice}}</span></view>
<view class="disja success-btn">
<view @tap="goDetail"></view>
<view @tap="goShop" class="colf" :style="{background:publicColor}">再逛一逛</view>
</view>
</view>
</view>
</view>
</template>
@ -110,9 +98,7 @@
addressInfo:'',//
zPhone:'',//
isFocus:false,
isSuccess:false,//
times:0,//
checkGrounpId:0,
expressInfo:{
code:'',//
default_price:0 //

View File

@ -95,26 +95,25 @@
export default {
data() {
return {
statusHNH:uni.getStorageSync('statusHNH'),
publicColor:uni.getStorageSync('publicColor'),//
dataList:[],
idEdit:false,
userName:'',
userPhone:'',
userProvince:'',
userCity:'',
userCounty:'',
userAddress:'',
userName:'',//
userPhone:'',//
userProvince:'',//
userCity:'',//
userCounty:'',//
userAddress:'',//
isChoose:'',//id
delNum:0,//
loading:false,
provinceArr:[],
cityArr:[],
countyArr:[],
isAddress:0,
isWhere:1,
isMo:0,
flag:true
provinceArr:[],//
cityArr:[],//
countyArr:[],//
isAddress:0,//
isWhere:1,//
isMo:0,//
flag:true//
}
},
onShow() {
@ -228,7 +227,7 @@
this.userCounty = this.countyArr[index].name;
},
async checkList(){//
this.$requst.post('/api/user/address').then(res=>{
this.$requst.post('/api/user/address',{page:1,size:100}).then(res=>{
if(res.code==0){
this.flag = true;
this.dataList = [];
@ -256,8 +255,8 @@
uni.removeStorageSync('chooseAddress');
}
this.loading = true;
}
})
} else this.$toolAll.tools.showToast(res.msg);
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
},
checkActive(){//
let have = this.dataList.findIndex((res)=>{
@ -339,8 +338,8 @@
this.dataList[index].isActive = true;
this.dataList[index].is_default = 1;
this.checkActive();
}
})
} else this.$toolAll.tools.showToast(res.msg);
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
},
editAddress(index){//
this.idEdit = true;

View File

@ -204,8 +204,8 @@
this.orderList[this.current].push(obj);
})
}
}
})
} else this.$toolAll.tools.showToast(res.msg);
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
},
payMentEv(coding){//
if(this.times==0){
@ -228,7 +228,7 @@
this.implementListEv();
} else this.$toolAll.tools.showToast(res.msg);
})
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
},
fail:()=> {
this.$toolAll.tools.showToast('取消支付');
@ -264,7 +264,7 @@
//
this.implementListEv();
} else this.$toolAll.tools.showToast(res.msg);
})
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
}
},
confirmReceipt(id){//
@ -274,7 +274,7 @@
//
this.implementListEv();
} else this.$toolAll.tools.showToast(res.msg);
})
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
},
goDetail(id){//
uni.navigateTo({

View File

@ -176,7 +176,7 @@
this.$toolAll.tools.showToast('收货成功');
this.checkInfo(this.orderInfo.id);
} else this.$toolAll.tools.showToast(res.msg);
})
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
},
make(index){
this.isHeyan = true;
@ -195,8 +195,8 @@
this.checkInfo(this.orderInfo.id);
clearInterval(this.timer);
}
}
})
} else this.$toolAll.tools.showToast(res.msg);
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
},3000)
},
cancleEv(){//
@ -207,8 +207,8 @@
this.$toolAll.tools.showToast('取消订单成功');
this.checkInfo(this.orderInfo.id);
this.times = 0;
}
})
} else this.$toolAll.tools.showToast(res.msg);
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
} else {
setTimeout(()=>{
this.times = 0;
@ -241,8 +241,8 @@
})
}
});
}
})
} else this.$toolAll.tools.showToast(res.msg);
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
}
},
checkInfo(id){//

View File

@ -198,9 +198,7 @@
this.discountPrice = this.detailObj.price;
//
this.shopRich = this.$toolAll.tools.escape2Html(res.data.detail.content);
} else {
}
} else this.$toolAll.tools.showToast(res.msg);
}).catch(err=>{
this.$toolAll.tools.showToast(err.msg);
})
@ -245,8 +243,8 @@
this.$toolAll.tools.showToast('添加购物车成功(*^▽^*)');
this.csNum = 0;
}
}
})
} else this.$toolAll.tools.showToast(res.msg);
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
}
} else {
this.$toolAll.tools.showToast('请选择商品参数')