首页分类可滑动

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

View File

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

View File

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

View File

@ -78,18 +78,6 @@
</container-subgroup> </container-subgroup>
<!-- 底部导航 --> <!-- 底部导航 -->
<payment :totalPrice="totalPrice" @immediatePayment="goPayment"></payment> <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> </view>
</template> </template>
@ -110,9 +98,7 @@
addressInfo:'',// addressInfo:'',//
zPhone:'',// zPhone:'',//
isFocus:false, isFocus:false,
isSuccess:false,//
times:0,// times:0,//
checkGrounpId:0,
expressInfo:{ expressInfo:{
code:'',// code:'',//
default_price:0 // default_price:0 //

View File

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

View File

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

View File

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

View File

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