Browse Source

营销物料需要校验是否付费

xiaohaizhao 1 year ago
parent
commit
f84bd8db20
1 changed files with 20 additions and 9 deletions
  1. 20 9
      custom-tab-bar/index.js

+ 20 - 9
custom-tab-bar/index.js

@@ -50,15 +50,26 @@ Component({
         ],
     },
     methods: {
-        onChange(event) {
-            let active = event.detail,
-                obj = this.data.tabbarList.find(v => v.name == active);
-            wx.switchTab({
-                url: obj.url
-            });
-            this.setData({
-                active
-            });
+        onChange({
+            detail
+        }) {
+            if (detail == "smartStore") {
+                let item = wx.getStorageSync('gridList').find(v => v.label == '营销物料');
+                if (!item) return wx.showToast({
+                    title: `暂无进入‘营销物料’应用权限`,
+                    icon: "none",
+                    mask: true
+                })
+                getApp().globalData.evidence(item)
+            } else {
+                const obj = this.data.tabbarList.find(v => v.name == detail);
+                wx.switchTab({
+                    url: obj.url
+                });
+                this.setData({
+                    active: detail
+                });
+            }
         },
         init() {
             const page = getCurrentPages().pop();