|
|
|
@ -24,9 +24,9 @@ export default defineStore("store", |
|
|
|
* @returns {storeType} |
|
|
|
*/ |
|
|
|
() => { |
|
|
|
/** |
|
|
|
* 购物车数量 |
|
|
|
*/ |
|
|
|
/** |
|
|
|
* 购物车数量 |
|
|
|
*/ |
|
|
|
const count = ref(0); |
|
|
|
/** |
|
|
|
* 搜索内容 |
|
|
|
@ -55,18 +55,6 @@ export default defineStore("store", |
|
|
|
*/ |
|
|
|
function increment(info) { |
|
|
|
count.value = info; |
|
|
|
if (info > 0) { |
|
|
|
uni.setTabBarBadge({ |
|
|
|
index: 3, // 你的tabBar索引
|
|
|
|
text: info > 999 ? "99+" : info.toString(), |
|
|
|
fail: () => {}, // 失败时不做处理
|
|
|
|
}); |
|
|
|
} |
|
|
|
else { |
|
|
|
uni.removeTabBarBadge({ |
|
|
|
index: 3, |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|