Commit 92e7a0d3 by 宋冰琦

修复首页登录成功后订单获取问题

parent 01b800ad
<template>
<view class="tabbar">
<view class="navigator">
<view class="tabbar" :style="{'padding-bottom':BottomSafeHeight+'px'}">
<view class="navigator" >
<view class="navigator-item" v-for="(item,index) in tabBar.list" :key="item.pagePath"
@click="switchTab(index)">
<img :src="item.iconPath" class="icon" v-if="selectedIndex !== index">
......@@ -22,6 +22,11 @@
}
},
mounted(){
this.BottomSafeHeight = uni.getStorageSync('BottomSafeHeight')||10
uni.setStorageSync("taBarHeight",(this.BottomSafeHeight+376))
uni.setStorageSync("shopCar",this.BottomSafeHeight==10?120:(this.BottomSafeHeight+288)/2)
uni.setStorageSync("orderBottom",(this.BottomSafeHeight+150))
this.selectedIndex = Number(this.select)
// console.log(this.select)
// this.selectedIndex = Number(this.select)
// this.selectedIndex = 0
......@@ -34,6 +39,7 @@
return {
selectedIndex: 0,
showselected: false,
BottomSafeHeight:0,
tabBar: {
list: [
{
......@@ -77,13 +83,13 @@
width: 100%;
height: 100rpx;
z-index: 999;
background: #F5F5F5;
border-top: 2rpx solid #eee;
background: #FFFFFF;
border-top: 2rpx solid #FFFFFF;
}
.navigator {
display: flex;
justify-content: space-between;
justify-content: space-around;
width: 85%;
margin: 0 auto;
padding: 20rpx;
......@@ -98,7 +104,7 @@
}
.item-text {
margin-top: 6rpx;
margin-top: 12rpx;
color: #777E86;
font-size: 24rpx;
}
......@@ -108,7 +114,7 @@
}
.icon {
width: 20px;
height: 20px;
width: 40rpx;
height: 40rpx;
}
</style>
\ No newline at end of file
......@@ -22,9 +22,21 @@ export default {
selectIndex: 0
}
},
computed:{
a(){
console.log(uni.getStorage('tabIndex'),'ccccccccc')
return uni.getStorageSync('tabIndex')
}
},
mounted(){
this.$nextTick(()=>{
console.log(uni.getStorageSync('tabIndex'))
})
this.selectIndex = uni.getStorageSync('tabIndex')
},
methods:{
acceptIndex(e){
console.log(e)
console.log(e,'hhhhhhhhhhhhhhh')
this.selectIndex = e
}
}
......
......@@ -137,7 +137,7 @@ export default {
});
User.getShopInfo(params);
},
async getHomeOrder(id){
async getHomeOrder(id = this.shopInfo.id){
if (!this.userms) return;
const res = await Order.getHomeOrder({shopId:id})
const data = res?.data
......@@ -212,7 +212,7 @@ export default {
getPhoneNumber(e) {
if (e.detail.errMsg == 'getPhoneNumber:ok') {
e.loginInfo = this.loginInfo
User.getPhoneNumber(e);
User.getPhoneNumber(e,this.getHomeOrder);
} else if (e.detail.errMsg == "getPhoneNumber:fail user deny") {
this.showToast({ title: '已拒绝手机号授权', icon: 'error' })
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment