|
|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<view class="container">
|
|
|
<view style="background-color: #03803B;">
|
|
|
- <uni-search-bar bgColor="#fff" v-model="name" placeholder="请输入综合查询" @confirm="custom"
|
|
|
- @clear="custom" :radius="100" cancelButton="none">
|
|
|
+ <uni-search-bar bgColor="#fff" v-model="name" placeholder="请输入综合查询" @confirm="custom" @clear="custom"
|
|
|
+ :radius="100" cancelButton="none">
|
|
|
</uni-search-bar>
|
|
|
</view>
|
|
|
<view class="recentSearches" v-if="recentSearches.length != 0">
|
|
|
@@ -31,7 +31,8 @@
|
|
|
</u-tag>
|
|
|
</view>
|
|
|
<view style="margin:0 6rpx;">
|
|
|
- <u-tag text="品牌" :bgColor="search.brandId?'#03803B':'#fff'" borderColor='#03803B' :color="search.brandId?'#fff':'#03803B'" @click="openBrand" size="mini">
|
|
|
+ <u-tag text="品牌" :bgColor="search.brandId?'#03803B':'#fff'" borderColor='#03803B'
|
|
|
+ :color="search.brandId?'#fff':'#03803B'" @click="openBrand" size="mini">
|
|
|
</u-tag>
|
|
|
</view>
|
|
|
<view style="margin:0 6rpx;width: 2rpx;height: 43rpx;background: #03803B;border-radius: 1rpx;"></view>
|
|
|
@@ -144,7 +145,7 @@
|
|
|
} from '@/api/home/index.js'
|
|
|
import {
|
|
|
isProcurement
|
|
|
- } from '@/api/goods/index.js'
|
|
|
+ } from '@/api/goods/index.js'
|
|
|
import {
|
|
|
shoppingCartList
|
|
|
} from '@/api/shoppingCart/index.js'
|
|
|
@@ -183,7 +184,7 @@
|
|
|
},
|
|
|
search: {
|
|
|
whether: '0',
|
|
|
- brandId:null,
|
|
|
+ brandId: null,
|
|
|
},
|
|
|
checkStatus: null,
|
|
|
recentSearches: [], // 搜索数据
|
|
|
@@ -228,7 +229,7 @@
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
this.getBadge()
|
|
|
// 获取最近搜索数据
|
|
|
if (uni.getStorageSync('recentSearches')) {
|
|
|
@@ -239,10 +240,16 @@
|
|
|
getBadge() {
|
|
|
shoppingCartList().then(res => {
|
|
|
let num = res.data.length
|
|
|
- uni.setTabBarBadge({
|
|
|
- index: 3, // tabIndex,tabBar的哪一项,从0开始
|
|
|
- text: num.toString() // 显示的文本,超过 99 显示成 “…”
|
|
|
- })
|
|
|
+ if (num) {
|
|
|
+ uni.setTabBarBadge({
|
|
|
+ index: 3, // tabIndex,tabBar的哪一项,从0开始
|
|
|
+ text: num.toString() // 显示的文本,超过 99 显示成 “…”
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.removeTabBarBadge({
|
|
|
+ index: 3, // tabIndex,tabBar的哪一项,从0开始
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
opensalesman() {
|
|
|
@@ -308,7 +315,7 @@
|
|
|
this.checkboxValue = []
|
|
|
this.search = {
|
|
|
whether: '0',
|
|
|
- brandId:null
|
|
|
+ brandId: null
|
|
|
}
|
|
|
this.$refs.paging.reload()
|
|
|
},
|
|
|
@@ -577,6 +584,7 @@
|
|
|
position: relative;
|
|
|
top: 6rpx;
|
|
|
height: 36rpx;
|
|
|
+
|
|
|
.cardKc {
|
|
|
text-align: center;
|
|
|
position: absolute;
|