|
@@ -33,7 +33,7 @@ Page({
|
|
|
})
|
|
|
/* 首页宫格授权查询 */
|
|
|
if (wx.getStorageSync('userauth').length != 0) {
|
|
|
- let auth = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['通告', '推广素材', '商学院', '提报', '销售线索']),
|
|
|
+ let auth = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['通告', '推广素材', '商学院', '提报', '销售线索', '营销物料', '销售预测', '销售目标']),
|
|
|
gridList = [],
|
|
|
subassembly = [];
|
|
|
auth.forEach(v => {
|
|
@@ -74,6 +74,14 @@ Page({
|
|
|
apps: v.apps
|
|
|
})
|
|
|
break;
|
|
|
+ case "营销物料":
|
|
|
+ gridList.push({
|
|
|
+ name: "营销物料",
|
|
|
+ path: "/pages/tabbar/smartStore/index",
|
|
|
+ icon: "icon-a-shouyejingangquyingxiaowuliao",
|
|
|
+ apps: v.apps
|
|
|
+ })
|
|
|
+ break;
|
|
|
case "销售线索":
|
|
|
gridList.push({
|
|
|
name: "销售线索",
|
|
@@ -84,11 +92,34 @@ Page({
|
|
|
//获取销售线索待办数量
|
|
|
setTimeout(this.getCount, 100);
|
|
|
break;
|
|
|
+ case "销售预测":
|
|
|
+ gridList.push({
|
|
|
+ name: "销售预测",
|
|
|
+ path: "/packageA/forecast/index",
|
|
|
+ icon: "icon-xiaochengxu_xiaoshouyuce",
|
|
|
+ apps: v.apps
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case "销售目标":
|
|
|
+ gridList.push({
|
|
|
+ name: "销售目标",
|
|
|
+ path: "/packageA/target/index",
|
|
|
+ icon: "icon-xiaochengxu_xiaoshoumubiao",
|
|
|
+ apps: v.apps
|
|
|
+ })
|
|
|
+ break;
|
|
|
};
|
|
|
});
|
|
|
/* 首页小组件查询 */
|
|
|
- let home = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['首页'])[0].apps[0].meta.wedgits;
|
|
|
- if (home.some(v => v.wedgit == 'homedatadisplay')) subassembly.push('homedatadisplay');
|
|
|
+ try {
|
|
|
+ let home = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['首页'])[0].apps[0].meta.wedgits;
|
|
|
+ if (home.some(v => v.wedgit == 'homedatadisplay')) subassembly.push('homedatadisplay');
|
|
|
+ } catch (e) {
|
|
|
+ this.setData({
|
|
|
+ gridList,
|
|
|
+ subassembly: []
|
|
|
+ })
|
|
|
+ }
|
|
|
this.setData({
|
|
|
gridList,
|
|
|
subassembly
|
|
@@ -107,7 +138,7 @@ Page({
|
|
|
/* 销售线索待办 */
|
|
|
getCount() {
|
|
|
const index = this.data.gridList.findIndex(v => v.name == '销售线索');
|
|
|
- if (!index) return;
|
|
|
+ if (index == -1) return;
|
|
|
_Http.basic({
|
|
|
"classname": "saletool.orderclue.web.orderclue",
|
|
|
"method": "getCount",
|
|
@@ -116,9 +147,13 @@ Page({
|
|
|
"status": "待跟进"
|
|
|
}
|
|
|
}, false).then(res => {
|
|
|
- if (res.data.count == 0) return;
|
|
|
+ if (res.data.count == 0) res.data.count = '';
|
|
|
if (res.data.count > 99) res.data.count = '99+';
|
|
|
- this.data.gridList[index].count = res.data.count;
|
|
|
+ try {
|
|
|
+ this.data.gridList[index].count = res.data.count;
|
|
|
+ } catch (e) {
|
|
|
+
|
|
|
+ }
|
|
|
this.setData({
|
|
|
gridList: this.data.gridList
|
|
|
})
|
|
@@ -196,9 +231,16 @@ Page({
|
|
|
const {
|
|
|
item
|
|
|
} = e.currentTarget.dataset;
|
|
|
- wx.navigateTo({
|
|
|
- url: `${item.path}?auth=${JSON.stringify(item.apps)}`,
|
|
|
- });
|
|
|
+ const url = `${item.path}?auth=${JSON.stringify(item.apps)}`
|
|
|
+ if (item.name == "营销物料") {
|
|
|
+ wx.switchTab({
|
|
|
+ url
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ wx.navigateTo({
|
|
|
+ url
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
/* 去消息详情 */
|
|
|
toMsg(e) {
|
|
@@ -221,12 +263,13 @@ Page({
|
|
|
},
|
|
|
/* banner */
|
|
|
bannerClick(e) {
|
|
|
- const hyperlink = e.currentTarget.dataset.hyperlink.split(":");
|
|
|
- if (hyperlink[0] == 'path') {
|
|
|
- wx.navigateTo({
|
|
|
- url: hyperlink[1]
|
|
|
- })
|
|
|
- }
|
|
|
+ const {
|
|
|
+ item
|
|
|
+ } = e.currentTarget.dataset,
|
|
|
+ hyperlink = item.hyperlink.split(":");
|
|
|
+ if (hyperlink[0] == 'path') wx.navigateTo({
|
|
|
+ url: hyperlink[1]
|
|
|
+ })
|
|
|
},
|
|
|
onShow() {
|
|
|
this.getTabBar().init();
|
|
@@ -238,4 +281,5 @@ Page({
|
|
|
onHide() {
|
|
|
clearInterval(DataCarousel);
|
|
|
},
|
|
|
+ onShareAppMessage() {}
|
|
|
})
|