zouyanyan 3 weeks ago
parent eb97161832
commit 5801151881

@ -94,7 +94,7 @@
</template> </template>
<script> <script>
import { myCache } from '../../utils/utils.js'; import { myCache,clearBadgeNumber } from '../../utils/utils.js';
import openlogin from "../components/openlogin.vue"; import openlogin from "../components/openlogin.vue";
export default { export default {
components: { components: {
@ -195,9 +195,7 @@
} else { } else {
// app // app
//#ifdef APP-PLUS clearBadgeNumber();
plus.runtime.setBadgeNumber(-1);
//#endif
} }
}, },
formatTime(timeStr) { formatTime(timeStr) {

@ -39,7 +39,7 @@
<script> <script>
import { mapState, mapGetters, mapActions } from 'vuex'; import { mapState, mapGetters, mapActions } from 'vuex';
import { myCache } from '../../utils/utils.js'; import { myCache,clearBadgeNumber } from '../../utils/utils.js';
import submit from '@/components/chat/submit.vue'; import submit from '@/components/chat/submit.vue';
import myVideo from "@/components/myVideo.vue"; import myVideo from "@/components/myVideo.vue";
// //
@ -242,9 +242,7 @@ export default {
} else { } else {
// app // app
//#ifdef APP-PLUS clearBadgeNumber();
plus.runtime.setBadgeNumber(-1);
//#endif
} }
}, },
// `this.chatStore.xxx` // `this.chatStore.xxx`

@ -56,7 +56,7 @@
<script> <script>
import { mapState, mapActions, mapGetters } from 'vuex' import { mapState, mapActions, mapGetters } from 'vuex'
import dateTime from '@/common/dateTime.js' import dateTime from '@/common/dateTime.js'
import {myCache} from "../../utils/utils"; import {myCache,clearBadgeNumber} from "../../utils/utils";
export default { export default {
data() { data() {
@ -132,9 +132,7 @@ export default {
index: 3 index: 3
}); });
// app // app
//#ifdef APP-PLUS clearBadgeNumber();
plus.runtime.setBadgeNumber(-1);
//#endif
} }
}, },

@ -61,7 +61,7 @@
</template> </template>
<script> <script>
import { myCache } from '../../utils/utils.js'; import { myCache,clearBadgeNumber } from '../../utils/utils.js';
export default { export default {
data() { data() {
return { return {
@ -193,9 +193,7 @@
myCache('shoplist',''); myCache('shoplist','');
// app // app
//#ifdef APP-PLUS clearBadgeNumber();
plus.runtime.setBadgeNumber(-1);
//#endif
uni.showModal({ uni.showModal({
title: '提示', title: '提示',

@ -185,7 +185,7 @@
</template> </template>
<script> <script>
import { myCache,getcartNum,getmessageNum,getRemoteFile } from '../../utils/utils.js'; import { myCache,getcartNum,getmessageNum,getRemoteFile,clearBadgeNumber } from '../../utils/utils.js';
import openlogin from "../components/openlogin.vue"; import openlogin from "../components/openlogin.vue";
import top from "../components/top.vue"; import top from "../components/top.vue";
@ -607,9 +607,7 @@
} }
// app // app
//#ifdef APP-PLUS clearBadgeNumber();
plus.runtime.setBadgeNumber(-1);
//#endif
this.$refs.uToast.show({ this.$refs.uToast.show({
title: '已退出登录!', title: '已退出登录!',
@ -619,6 +617,7 @@
uni.navigateTo({ uni.navigateTo({
url: `/pages/login/login` url: `/pages/login/login`
}); });
} }
} }
}); });
@ -701,9 +700,7 @@
} }
// app // app
//#ifdef APP-PLUS clearBadgeNumber();
plus.runtime.setBadgeNumber(-1);
//#endif
uni.showModal({ uni.showModal({
title: '提示', title: '提示',

@ -94,6 +94,7 @@ function ifnonet() {
}); });
return ret; return ret;
}; };
function getcartNum() { function getcartNum() {
var nowcart=myCache("carts"); var nowcart=myCache("carts");
// 加入购物车 // 加入购物车
@ -143,6 +144,24 @@ function getmessageNum() {
var num= myCache("massageCount")?myCache("massageCount"):0; var num= myCache("massageCount")?myCache("massageCount"):0;
return num; return num;
}; };
function clearBadgeNumber() {
const platform = uni.getSystemInfoSync().platform
if (platform === 'ios') {
console.log(platform,'iOS 设备iOS 设备iOS 设备');
//#ifdef APP-PLUS
plus.runtime.setBadgeNumber(0);
//#endif
} else if (platform === 'android') {
console.log('Android 设备');
//#ifdef APP-PLUS
plus.runtime.setBadgeNumber(-1);
//#endif
} else {
console.log('其他平台:', platform)
}
};
export { export {
myCache, myCache,
getRemoteFile, getRemoteFile,
@ -152,6 +171,7 @@ export {
ifnonet, ifnonet,
getcartNum, getcartNum,
getcartLoseNum, getcartLoseNum,
getmessageNum getmessageNum,
clearBadgeNumber
}; };

Loading…
Cancel
Save