wangfukang 1 month ago
parent
commit
7a1132e66f
  1. 1159
      components/tab-bar/homeGroupPending.vue
  2. 15
      components/tab-bar/tab-bar.vue

1159
components/tab-bar/homeGroupPending.vue

File diff suppressed because it is too large

15
components/tab-bar/tab-bar.vue

@ -43,7 +43,6 @@
}, { }, {
tabName: '配送', tabName: '配送',
pageIndex: 1, pageIndex: 1,
hideInSocial: true,
tabIcon: '/static/images/tabbar/peisong1.png', tabIcon: '/static/images/tabbar/peisong1.png',
tabIconSelect: '/static/images/tabbar/peisong.png', tabIconSelect: '/static/images/tabbar/peisong.png',
isCheck: false, isCheck: false,
@ -95,13 +94,17 @@
socialMode: { socialMode: {
type: Boolean, type: Boolean,
default: false default: false
},
socialDeliveryEnabled: {
type: Boolean,
default: true
} }
}, },
computed: { computed: {
displayTabs() { displayTabs() {
if (!this.socialMode) return this.tabList if (!this.socialMode) return this.tabList
return this.tabList return this.tabList
.filter((item) => !item.hideInSocial) .filter((item) => this.socialDeliveryEnabled || item.pageIndex !== 1)
.map((item) => { .map((item) => {
if (item.pageIndex === 2) { if (item.pageIndex === 2) {
return Object.assign({}, item, { tabName: '同城圈' }) return Object.assign({}, item, { tabName: '同城圈' })
@ -117,6 +120,9 @@
}, },
socialMode() { socialMode() {
this.syncTabCheck(this.currentIndex) this.syncTabCheck(this.currentIndex)
},
socialDeliveryEnabled() {
this.syncTabCheck(this.currentIndex)
} }
}, },
mounted() { mounted() {
@ -141,6 +147,9 @@
const token = uni.getStorageSync('hiver_token') const token = uni.getStorageSync('hiver_token')
return !!(token && typeof token === 'string' && token.trim() && token !== 'null' && token !== 'undefined') return !!(token && typeof token === 'string' && token.trim() && token !== 'null' && token !== 'undefined')
}, },
shouldRequestDeliveryCounts() {
return !this.socialMode || this.socialDeliveryEnabled
},
goLogin(index) { goLogin(index) {
const redirectKey = 'login_redirect_' + Date.now() const redirectKey = 'login_redirect_' + Date.now()
uni.setStorageSync(redirectKey, '/pages/index/index?tabIndex=' + index) uni.setStorageSync(redirectKey, '/pages/index/index?tabIndex=' + index)
@ -233,7 +242,7 @@
uni.$emit('campusUnreadChange', result) uni.$emit('campusUnreadChange', result)
} }
}).catch(() => {})) }).catch(() => {}))
if(worker){ if(worker && this.shouldRequestDeliveryCounts()){
const area = uni.getStorageSync('area') ? JSON.parse(uni.getStorageSync('area')) : {} const area = uni.getStorageSync('area') ? JSON.parse(uni.getStorageSync('area')) : {}
tasks.push(this.tui.request("/mall/delivery/countOrderByStatus", "POST", {workerId:worker.workerId,regionId:area.id}, false, true).then((res) => { tasks.push(this.tui.request("/mall/delivery/countOrderByStatus", "POST", {workerId:worker.workerId,regionId:area.id}, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {

Loading…
Cancel
Save