|
|
|
@ -1,59 +1,104 @@
|
|
|
|
const app = getApp();
|
|
|
|
const app = getApp();
|
|
|
|
Component({
|
|
|
|
Component({
|
|
|
|
data: {
|
|
|
|
data: {
|
|
|
|
isShow: false,
|
|
|
|
isShow: true,
|
|
|
|
toTop: false,
|
|
|
|
toTop: false,
|
|
|
|
selected: 0,
|
|
|
|
selected: 0,
|
|
|
|
color: "#666",
|
|
|
|
color: "#888",
|
|
|
|
selectedColor: "#1890ff",
|
|
|
|
selectedColor: "#3578f6",
|
|
|
|
|
|
|
|
appId: app.globalData.appId,
|
|
|
|
list: [
|
|
|
|
list: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
iconPath: "../assets/images/tabbar/home_active.svg",
|
|
|
|
"iconPath": "icon-home",
|
|
|
|
selectedIconPath: "../assets/images/tabbar/home.svg",
|
|
|
|
// "selectedIconPath": "/static/image/tabbar/home.svg",
|
|
|
|
pagePath: "/pages/firstBill/index",
|
|
|
|
"pagePath": "/pages/firstBill/index",
|
|
|
|
text: "首页",
|
|
|
|
"text": "首页",
|
|
|
|
index: 0,
|
|
|
|
"index": 0
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"iconPath": "../assets/images/tabbar/order_active.svg",
|
|
|
|
iconPath: "icon-order_active",
|
|
|
|
"selectedIconPath": "../assets/images/tabbar/order.svg",
|
|
|
|
text: '工单',
|
|
|
|
"pagePath": "/pages/myBill/index",
|
|
|
|
"index": 3,
|
|
|
|
"text": "工单",
|
|
|
|
pagePath: "/pages/myBill/index",
|
|
|
|
index: 1,
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// "iconPath": "/static/image/tabbar/chat.svg",
|
|
|
|
|
|
|
|
// "selectedIconPath": "/static/image/tabbar/chat.svg",
|
|
|
|
|
|
|
|
// "pagePath": "/pages/ai/index",
|
|
|
|
|
|
|
|
// "text": "AI",
|
|
|
|
|
|
|
|
// "index": 2
|
|
|
|
|
|
|
|
// },
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"iconPath": "../assets/images/tabbar/message_active.svg",
|
|
|
|
"iconPath": "icon-message",
|
|
|
|
"selectedIconPath": "../assets/images/tabbar/message.svg",
|
|
|
|
// "iconPath": "/static/image/tabbar/message_active.svg",
|
|
|
|
|
|
|
|
// "selectedIconPath": "/static/image/tabbar/message.svg",
|
|
|
|
"pagePath": "/pages/message/index",
|
|
|
|
"pagePath": "/pages/message/index",
|
|
|
|
"text": "消息",
|
|
|
|
"text": "消息",
|
|
|
|
index: 2,
|
|
|
|
"index": 1
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
iconPath: "../assets/images/tabbar/unit_active.svg",
|
|
|
|
"iconPath": "icon-appstore",
|
|
|
|
selectedIconPath: "../assets/images/tabbar/unit.svg",
|
|
|
|
// "iconPath": "/static/image/tabbar/message_active.svg",
|
|
|
|
pagePath: "/pages/workBench/index",
|
|
|
|
// "selectedIconPath": "/static/image/tabbar/message.svg",
|
|
|
|
text: "工作台",
|
|
|
|
"pagePath": "/pages/workBench/index",
|
|
|
|
index: 3,
|
|
|
|
"text": "工作台",
|
|
|
|
|
|
|
|
"index": 4
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
iconPath: "../assets/images/tabbar/user_active.svg",
|
|
|
|
"iconPath": "icon-user",
|
|
|
|
selectedIconPath: "../assets/images/tabbar/user.svg",
|
|
|
|
// "iconPath": "/static/image/tabbar/user_active.svg",
|
|
|
|
pagePath: "/pages/mine/index",
|
|
|
|
// "selectedIconPath": "/static/image/tabbar/user.svg",
|
|
|
|
text: "我的",
|
|
|
|
"pagePath": "/pages/mine/index",
|
|
|
|
index: 4,
|
|
|
|
"text": "我的",
|
|
|
|
},
|
|
|
|
"index": 2
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
lifetimes: {
|
|
|
|
lifetimes: {
|
|
|
|
show: function () {
|
|
|
|
show: function () {
|
|
|
|
// 页面被展示
|
|
|
|
// 页面被展示
|
|
|
|
console.log("tabbar show");
|
|
|
|
console.log("tabbar show");
|
|
|
|
|
|
|
|
console.log('this.data.appid', this.data.appId);
|
|
|
|
|
|
|
|
if (this.data.appId == 'wxb0c590fd696b79be') {
|
|
|
|
|
|
|
|
console.log('');
|
|
|
|
|
|
|
|
// this.data.list = [
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// "iconPath": "/static/image/nav_home_normal.png",
|
|
|
|
|
|
|
|
// "selectedIconPath": "/static/image/nav_home_selected_lao.png",
|
|
|
|
|
|
|
|
// "pagePath": "/pages/home/index",
|
|
|
|
|
|
|
|
// "text": "首页",
|
|
|
|
|
|
|
|
// "index": 0
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// // {
|
|
|
|
|
|
|
|
// // "iconPath": "/static/image/chat.png",
|
|
|
|
|
|
|
|
// // "selectedIconPath": "/static/image/chat.png",
|
|
|
|
|
|
|
|
// // "pagePath": "/pages/ai/index",
|
|
|
|
|
|
|
|
// // "text": "AI",
|
|
|
|
|
|
|
|
// // "index": 2
|
|
|
|
|
|
|
|
// // },
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// "iconPath": "/static/image/xx.png",
|
|
|
|
|
|
|
|
// "selectedIconPath": "/static/image/xx1_lao.png",
|
|
|
|
|
|
|
|
// "pagePath": "/pages/message/index",
|
|
|
|
|
|
|
|
// "text": "消息",
|
|
|
|
|
|
|
|
// "index":1
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// "iconPath": "/static/image/nav_my_normal.png",
|
|
|
|
|
|
|
|
// "selectedIconPath": "/static/image/nav_my_selected_lao.png",
|
|
|
|
|
|
|
|
// "pagePath": "/pages/person/index",
|
|
|
|
|
|
|
|
// "text": "我的",
|
|
|
|
|
|
|
|
// "index": 2
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// ]
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
attached: function () {
|
|
|
|
attached: function () {
|
|
|
|
// 在组件实例进入页面节点树时执行
|
|
|
|
// 在组件实例进入页面节点树时执行
|
|
|
|
console.log("tabbar attached");
|
|
|
|
console.log("tabbar attached");
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
detached: function () {
|
|
|
|
detached: function () {
|
|
|
|
// 在组件实例被从页面节点树移除时执行
|
|
|
|
// 在组件实例被从页面节点树移除时执行
|
|
|
|
@ -61,27 +106,11 @@ Component({
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
switchTab (e) {
|
|
|
|
switchTab (e) {
|
|
|
|
console.log('e',e)
|
|
|
|
|
|
|
|
const data = e.currentTarget.dataset;
|
|
|
|
const data = e.currentTarget.dataset;
|
|
|
|
const url = data.path;
|
|
|
|
const url = data.path;
|
|
|
|
wx.vibrateShort({
|
|
|
|
|
|
|
|
type: "heavy",
|
|
|
|
|
|
|
|
success: function (e) {
|
|
|
|
|
|
|
|
console.log(e);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (data.index == 0 && this.data.selected == 0) {
|
|
|
|
// if (!wx.getStorageSync("apply-userinfo")) {
|
|
|
|
if (this.data.toTop) {
|
|
|
|
// if (data.index == 2) {
|
|
|
|
app.globalData.toTop = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
app.globalData.refresh = 1
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (!app.globalData.isLogin) {
|
|
|
|
|
|
|
|
// if (data.index == 1) {
|
|
|
|
|
|
|
|
// wx.navigateTo({
|
|
|
|
// wx.navigateTo({
|
|
|
|
// url: "/pages/login/index",
|
|
|
|
// url: "/pages/login/index",
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
@ -89,23 +118,18 @@ Component({
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// else {
|
|
|
|
// else {
|
|
|
|
// if (data.index == 1) {
|
|
|
|
// if (data.index == 2) {
|
|
|
|
// if (app.globalData.loginUserInfo.agencyStatus != 1) {
|
|
|
|
|
|
|
|
// wx.navigateTo({
|
|
|
|
// wx.navigateTo({
|
|
|
|
// url: "/pages/tobeAgency/index",
|
|
|
|
// url: "/pages/message/child/chat",
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// wx.navigateTo({
|
|
|
|
|
|
|
|
// url,
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// // wx.redirectTo({});
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// return;
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// this.setData({
|
|
|
|
// this.setData({
|
|
|
|
// selected: data.index,
|
|
|
|
// selected: data.index
|
|
|
|
// });
|
|
|
|
// })
|
|
|
|
|
|
|
|
// this.data.selected = data.index
|
|
|
|
|
|
|
|
console.log('--', url)
|
|
|
|
wx.switchTab({ url });
|
|
|
|
wx.switchTab({ url });
|
|
|
|
},
|
|
|
|
},
|
|
|
|
touchMove () {
|
|
|
|
touchMove () {
|
|
|
|
|