|
|
|
@ -8,88 +8,71 @@
|
|
|
|
import { getMsgContentTipByType, setTabUnread } from "../pages/NEUIKit/utils/msg";
|
|
|
|
import { getMsgContentTipByType, setTabUnread } from "../pages/NEUIKit/utils/msg";
|
|
|
|
import { trackInit } from "../pages/NEUIKit/utils/reporter.ts";
|
|
|
|
import { trackInit } from "../pages/NEUIKit/utils/reporter.ts";
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
// created() {
|
|
|
|
|
|
|
|
// let that = this;
|
|
|
|
|
|
|
|
// this.isLogin = uni.getStorageSync("apply-userinfo") ? true : false;
|
|
|
|
|
|
|
|
// console.log("createdcreatedcreated");
|
|
|
|
|
|
|
|
// if (this.isLogin) {
|
|
|
|
|
|
|
|
// if (uni.$UIKitStore) {
|
|
|
|
|
|
|
|
// trackInit("ConversationUIKit");
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
|
|
// // 获取未读信息数
|
|
|
|
|
|
|
|
// setTabUnread();
|
|
|
|
|
|
|
|
// }, 100);
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
|
|
// // 初始化会话列表
|
|
|
|
|
|
|
|
// trackInit("ConversationUIKit");
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
|
|
// // 获取未读信息数
|
|
|
|
|
|
|
|
// setTabUnread();
|
|
|
|
|
|
|
|
// }, 2000);
|
|
|
|
|
|
|
|
// }, 2000);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// // 聊天会话通知触发小红点数量提示
|
|
|
|
|
|
|
|
// uni.$on("newMessage", function (data) {
|
|
|
|
|
|
|
|
// console.log("newMessage 接收", data);
|
|
|
|
|
|
|
|
// that.setBadge(data);
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// // 用户身份认证权限改变触发
|
|
|
|
|
|
|
|
// uni.$on("userAuthChange", function (data) {
|
|
|
|
|
|
|
|
// console.log("newMessage 接收", data);
|
|
|
|
|
|
|
|
// that.corpUserFlag = uni.getStorageSync("apply-userinfo").corpUserFlag;
|
|
|
|
|
|
|
|
// this.checkUserAuth();
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// this.checkUserAuth();
|
|
|
|
|
|
|
|
// this.setBadge();
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
onShow() {
|
|
|
|
|
|
|
|
console.log(123123123123);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
if (this.userInfo.agencyId) {
|
|
|
|
let that = this;
|
|
|
|
this.tabbarInfo = [
|
|
|
|
this.isLogin = uni.getStorageSync("apply-userinfo") ? true : false;
|
|
|
|
{
|
|
|
|
console.log("createdcreatedcreated");
|
|
|
|
iconPath: "icon-home g_c_9",
|
|
|
|
if (this.isLogin) {
|
|
|
|
selectedIconPath: "icon-home g_c_main",
|
|
|
|
if (uni.$UIKitStore) {
|
|
|
|
pagePath: "/pages/home/index",
|
|
|
|
trackInit("ConversationUIKit");
|
|
|
|
text: "首页",
|
|
|
|
setTimeout(() => {
|
|
|
|
iconSize: 48,
|
|
|
|
// 获取未读信息数
|
|
|
|
},
|
|
|
|
setTabUnread();
|
|
|
|
{
|
|
|
|
}, 100);
|
|
|
|
iconPath: "icon-fadanhao-32 g_c_9",
|
|
|
|
} else {
|
|
|
|
selectedIconPath: "icon-fadanhao-32 g_c_main",
|
|
|
|
setTimeout(() => {
|
|
|
|
pagePath: "/pages/home/order",
|
|
|
|
// 初始化会话列表
|
|
|
|
text: "发单号",
|
|
|
|
trackInit("ConversationUIKit");
|
|
|
|
iconSize: 48,
|
|
|
|
setTimeout(() => {
|
|
|
|
},
|
|
|
|
// 获取未读信息数
|
|
|
|
|
|
|
|
setTabUnread();
|
|
|
|
|
|
|
|
}, 2000);
|
|
|
|
|
|
|
|
}, 2000);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// if (this.userInfo.agencyId) {
|
|
|
|
|
|
|
|
// this.tabbarInfo = [
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// iconPath: "icon-home g_c_9",
|
|
|
|
|
|
|
|
// selectedIconPath: "icon-home g_c_main",
|
|
|
|
|
|
|
|
// pagePath: "/pages/home/index",
|
|
|
|
|
|
|
|
// text: "首页",
|
|
|
|
|
|
|
|
// iconSize: 48,
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// iconPath: "icon-fadanhao-32 g_c_9",
|
|
|
|
|
|
|
|
// selectedIconPath: "icon-fadanhao-32 g_c_main",
|
|
|
|
|
|
|
|
// pagePath: "/pages/home/order",
|
|
|
|
|
|
|
|
// text: "发单号",
|
|
|
|
|
|
|
|
// iconSize: 48,
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
iconPath: "icon-order_active g_c_9",
|
|
|
|
// iconPath: "icon-order_active g_c_9",
|
|
|
|
selectedIconPath: "icon-order_active g_c_main",
|
|
|
|
// selectedIconPath: "icon-order_active g_c_main",
|
|
|
|
pagePath: "/pages/workBench/index",
|
|
|
|
// pagePath: "/pages/workBench/index",
|
|
|
|
text: "工单",
|
|
|
|
// text: "工单",
|
|
|
|
iconSize: 48,
|
|
|
|
// iconSize: 48,
|
|
|
|
count: 0,
|
|
|
|
// count: 0,
|
|
|
|
},
|
|
|
|
// },
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
iconPath: "icon-message g_c_9",
|
|
|
|
// iconPath: "icon-message g_c_9",
|
|
|
|
selectedIconPath: "icon-message g_c_main",
|
|
|
|
// selectedIconPath: "icon-message g_c_main",
|
|
|
|
pagePath: "/pages/message/index",
|
|
|
|
// pagePath: "/pages/message/index",
|
|
|
|
text: "消息",
|
|
|
|
// text: "消息",
|
|
|
|
iconSize: 78,
|
|
|
|
// iconSize: 78,
|
|
|
|
iconType: "custom",
|
|
|
|
// iconType: "custom",
|
|
|
|
},
|
|
|
|
// },
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
iconPath: "icon-user g_c_9",
|
|
|
|
// iconPath: "icon-user g_c_9",
|
|
|
|
selectedIconPath: "icon-user g_c_main",
|
|
|
|
// selectedIconPath: "icon-user g_c_main",
|
|
|
|
pagePath: "/pages/person/index",
|
|
|
|
// pagePath: "/pages/person/index",
|
|
|
|
text: "我的",
|
|
|
|
// text: "我的",
|
|
|
|
iconSize: 48,
|
|
|
|
// iconSize: 48,
|
|
|
|
},
|
|
|
|
// },
|
|
|
|
];
|
|
|
|
// ];
|
|
|
|
} else {
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
if (!this.userInfo.agencyId) {
|
|
|
|
this.tabbarInfo = [
|
|
|
|
this.tabbarInfo = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
iconPath: "icon-home g_c_9",
|
|
|
|
iconPath: "icon-home g_c_9",
|
|
|
|
@ -114,6 +97,7 @@ export default {
|
|
|
|
text: "消息",
|
|
|
|
text: "消息",
|
|
|
|
iconSize: 78,
|
|
|
|
iconSize: 78,
|
|
|
|
iconType: "custom",
|
|
|
|
iconType: "custom",
|
|
|
|
|
|
|
|
count: 0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
iconPath: "icon-user g_c_9",
|
|
|
|
iconPath: "icon-user g_c_9",
|
|
|
|
@ -124,6 +108,22 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 聊天会话通知触发小红点数量提示
|
|
|
|
|
|
|
|
uni.$on("newMessage", function (data) {
|
|
|
|
|
|
|
|
console.log("newMessage 接收", data);
|
|
|
|
|
|
|
|
that.setBadge(data);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// 用户身份认证权限改变触发
|
|
|
|
|
|
|
|
uni.$on("userAuthChange", function (data) {
|
|
|
|
|
|
|
|
console.log("newMessage 接收", data);
|
|
|
|
|
|
|
|
that.corpUserFlag = uni.getStorageSync("apply-userinfo").corpUserFlag;
|
|
|
|
|
|
|
|
// this.checkUserAuth();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// this.checkUserAuth();
|
|
|
|
|
|
|
|
this.setBadge();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onShow() {
|
|
|
|
|
|
|
|
console.log(123123123123);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
@ -132,46 +132,6 @@ export default {
|
|
|
|
corpUserFlag: uni.getStorageSync("apply-userinfo").corpUserFlag,
|
|
|
|
corpUserFlag: uni.getStorageSync("apply-userinfo").corpUserFlag,
|
|
|
|
userInfo: uni.getStorageSync("apply-userinfo"),
|
|
|
|
userInfo: uni.getStorageSync("apply-userinfo"),
|
|
|
|
globalData: getApp().globalData,
|
|
|
|
globalData: getApp().globalData,
|
|
|
|
|
|
|
|
|
|
|
|
// tabbarInfo: [
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// iconPath: "/static/image/home.png",
|
|
|
|
|
|
|
|
// selectedIconPath: "/static/image/home-active.png",
|
|
|
|
|
|
|
|
// pagePath: "/pages/home/index",
|
|
|
|
|
|
|
|
// text: "首页",
|
|
|
|
|
|
|
|
// iconSize: 48,
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// iconPath: "/static/image/apply.png",
|
|
|
|
|
|
|
|
// selectedIconPath: "/static/image/apply-active.png",
|
|
|
|
|
|
|
|
// pagePath: "/pages/workBench/index",
|
|
|
|
|
|
|
|
// text: "工单",
|
|
|
|
|
|
|
|
// iconSize: 48,
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// iconPath: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/dailibaoming/v3/add.svg",
|
|
|
|
|
|
|
|
// selectedIconPath: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/dailibaoming/v3/add.svg",
|
|
|
|
|
|
|
|
// pagePath: "/pages/addJob/index",
|
|
|
|
|
|
|
|
// text: "",
|
|
|
|
|
|
|
|
// iconSize: 78,
|
|
|
|
|
|
|
|
// iconType: "custom",
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// iconPath: "/static/image/message.png",
|
|
|
|
|
|
|
|
// selectedIconPath: "/static/image/message_active.png",
|
|
|
|
|
|
|
|
// pagePath: "/pages/message/index",
|
|
|
|
|
|
|
|
// text: "消息",
|
|
|
|
|
|
|
|
// iconSize: 48,
|
|
|
|
|
|
|
|
// count: 0,
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// iconPath: "/static/image/person.png",
|
|
|
|
|
|
|
|
// selectedIconPath: "/static/image/person-active.png",
|
|
|
|
|
|
|
|
// pagePath: "/pages/person/index",
|
|
|
|
|
|
|
|
// text: "我的",
|
|
|
|
|
|
|
|
// iconSize: 48,
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
tabbarInfo: [
|
|
|
|
tabbarInfo: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
iconPath: "icon-home g_c_9",
|
|
|
|
iconPath: "icon-home g_c_9",
|
|
|
|
@ -203,6 +163,7 @@ export default {
|
|
|
|
text: "消息",
|
|
|
|
text: "消息",
|
|
|
|
iconSize: 78,
|
|
|
|
iconSize: 78,
|
|
|
|
iconType: "custom",
|
|
|
|
iconType: "custom",
|
|
|
|
|
|
|
|
count: 0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
iconPath: "icon-user g_c_9",
|
|
|
|
iconPath: "icon-user g_c_9",
|
|
|
|
@ -227,42 +188,44 @@ export default {
|
|
|
|
uploadPage() {
|
|
|
|
uploadPage() {
|
|
|
|
uni.vibrateShort();
|
|
|
|
uni.vibrateShort();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// setBadge(data) {
|
|
|
|
setBadge(data) {
|
|
|
|
// let that = this;
|
|
|
|
let that = this;
|
|
|
|
// // console.log("datadatadatadatadatadata", data);
|
|
|
|
console.log("datadatadatadatadatadata", data);
|
|
|
|
// for (var k in that.tabbarInfo) {
|
|
|
|
for (var k in that.tabbarInfo) {
|
|
|
|
// if (that.tabbarInfo[k].pagePath == "/pages/message/indexcopy") {
|
|
|
|
console.log("that.tabbarInfo[k].pagePath", that.tabbarInfo[k]);
|
|
|
|
// if (data) {
|
|
|
|
if (that.tabbarInfo[k].pagePath == "/pages/message/index") {
|
|
|
|
// // console.log(that.messageCount + "+++++++++++++++++" + that.noticeCount);
|
|
|
|
if (data) {
|
|
|
|
// if (data.type == "message") {
|
|
|
|
// console.log(that.messageCount + "+++++++++++++++++" + that.noticeCount);
|
|
|
|
// that.messageCount = data.count || 0;
|
|
|
|
if (data.type == "message") {
|
|
|
|
// } else if (data.type == "notice") {
|
|
|
|
that.messageCount = data.count || 0;
|
|
|
|
// that.noticeCount = data.count || 0;
|
|
|
|
} else if (data.type == "notice") {
|
|
|
|
// }
|
|
|
|
that.noticeCount = data.count || 0;
|
|
|
|
// // console.log(that.messageCount + "-------------------------" + that.noticeCount);
|
|
|
|
}
|
|
|
|
// } else {
|
|
|
|
// console.log(that.messageCount + "-------------------------" + that.noticeCount);
|
|
|
|
// that.messageCount = uni.getStorageSync("chat_info").count || 0;
|
|
|
|
} else {
|
|
|
|
// that.noticeCount = uni.getStorageSync("notice_info").count || 0;
|
|
|
|
that.messageCount = uni.getStorageSync("chat_info").count || 0;
|
|
|
|
// }
|
|
|
|
that.noticeCount = uni.getStorageSync("notice_info").count || 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// that.tabbarInfo[k].count = that.messageCount + that.noticeCount;
|
|
|
|
that.tabbarInfo[k].count = that.messageCount + that.noticeCount;
|
|
|
|
// // console.log("that.tabbarInfo[k].count", that.tabbarInfo[k].count);
|
|
|
|
console.log("that.tabbarInfo[k].count", that.tabbarInfo[k].count);
|
|
|
|
// // that.tabbarInfo[k].type = data.type;
|
|
|
|
// that.tabbarInfo[k].type = data.type;
|
|
|
|
// } else if (that.tabbarInfo[k].pagePath == "/pages/workBench/index") {
|
|
|
|
}
|
|
|
|
// if (data) {
|
|
|
|
// else if (that.tabbarInfo[k].pagePath == "/pages/workBench/index") {
|
|
|
|
// // console.log(that.messageCount + "+++++++++++++++++" + that.noticeCount);
|
|
|
|
// if (data) {
|
|
|
|
// if (data.type == "follow") {
|
|
|
|
// // console.log(that.messageCount + "+++++++++++++++++" + that.noticeCount);
|
|
|
|
// that.followCount = data.count || 0;
|
|
|
|
// if (data.type == "follow") {
|
|
|
|
// }
|
|
|
|
// that.followCount = data.count || 0;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// // console.log(that.messageCount + "-------------------------" + that.noticeCount);
|
|
|
|
// // console.log(that.messageCount + "-------------------------" + that.noticeCount);
|
|
|
|
// } else {
|
|
|
|
// } else {
|
|
|
|
// that.followCount = uni.getStorageSync("follow_info").count || 0;
|
|
|
|
// that.followCount = uni.getStorageSync("follow_info").count || 0;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// that.tabbarInfo[k].count = that.followCount;
|
|
|
|
// that.tabbarInfo[k].count = that.followCount;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// },
|
|
|
|
},
|
|
|
|
// checkUserAuth() {
|
|
|
|
// checkUserAuth() {
|
|
|
|
// this.tabbarInfo = [
|
|
|
|
// this.tabbarInfo = [
|
|
|
|
// {
|
|
|
|
// {
|
|
|
|
|