Commit 92e7a0d3 by 宋冰琦

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

parent 01b800ad
<template> <template>
<view class="tabbar"> <view class="tabbar" :style="{'padding-bottom':BottomSafeHeight+'px'}">
<view class="navigator"> <view class="navigator" >
<view class="navigator-item" v-for="(item,index) in tabBar.list" :key="item.pagePath" <view class="navigator-item" v-for="(item,index) in tabBar.list" :key="item.pagePath"
@click="switchTab(index)"> @click="switchTab(index)">
<img :src="item.iconPath" class="icon" v-if="selectedIndex !== index"> <img :src="item.iconPath" class="icon" v-if="selectedIndex !== index">
...@@ -22,6 +22,11 @@ ...@@ -22,6 +22,11 @@
} }
}, },
mounted(){ 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) // console.log(this.select)
// this.selectedIndex = Number(this.select) // this.selectedIndex = Number(this.select)
// this.selectedIndex = 0 // this.selectedIndex = 0
...@@ -34,6 +39,7 @@ ...@@ -34,6 +39,7 @@
return { return {
selectedIndex: 0, selectedIndex: 0,
showselected: false, showselected: false,
BottomSafeHeight:0,
tabBar: { tabBar: {
list: [ list: [
{ {
...@@ -77,13 +83,13 @@ ...@@ -77,13 +83,13 @@
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
z-index: 999; z-index: 999;
background: #F5F5F5; background: #FFFFFF;
border-top: 2rpx solid #eee; border-top: 2rpx solid #FFFFFF;
} }
.navigator { .navigator {
display: flex; display: flex;
justify-content: space-between; justify-content: space-around;
width: 85%; width: 85%;
margin: 0 auto; margin: 0 auto;
padding: 20rpx; padding: 20rpx;
...@@ -98,7 +104,7 @@ ...@@ -98,7 +104,7 @@
} }
.item-text { .item-text {
margin-top: 6rpx; margin-top: 12rpx;
color: #777E86; color: #777E86;
font-size: 24rpx; font-size: 24rpx;
} }
...@@ -108,7 +114,7 @@ ...@@ -108,7 +114,7 @@
} }
.icon { .icon {
width: 20px; width: 40rpx;
height: 20px; height: 40rpx;
} }
</style> </style>
\ No newline at end of file
...@@ -22,9 +22,21 @@ export default { ...@@ -22,9 +22,21 @@ export default {
selectIndex: 0 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:{ methods:{
acceptIndex(e){ acceptIndex(e){
console.log(e) console.log(e,'hhhhhhhhhhhhhhh')
this.selectIndex = e this.selectIndex = e
} }
} }
......
...@@ -137,7 +137,7 @@ export default { ...@@ -137,7 +137,7 @@ export default {
}); });
User.getShopInfo(params); User.getShopInfo(params);
}, },
async getHomeOrder(id){ async getHomeOrder(id = this.shopInfo.id){
if (!this.userms) return; if (!this.userms) return;
const res = await Order.getHomeOrder({shopId:id}) const res = await Order.getHomeOrder({shopId:id})
const data = res?.data const data = res?.data
...@@ -212,7 +212,7 @@ export default { ...@@ -212,7 +212,7 @@ export default {
getPhoneNumber(e) { getPhoneNumber(e) {
if (e.detail.errMsg == 'getPhoneNumber:ok') { if (e.detail.errMsg == 'getPhoneNumber:ok') {
e.loginInfo = this.loginInfo e.loginInfo = this.loginInfo
User.getPhoneNumber(e); User.getPhoneNumber(e,this.getHomeOrder);
} else if (e.detail.errMsg == "getPhoneNumber:fail user deny") { } else if (e.detail.errMsg == "getPhoneNumber:fail user deny") {
this.showToast({ title: '已拒绝手机号授权', icon: 'error' }) 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