Browse Source

E订单融合E服务

zhaoxiaohai 2 years ago
parent
commit
32296a9493

+ 66 - 0
Eservice/index.js

@@ -0,0 +1,66 @@
+// Eservice/index.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
Eservice/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 1 - 0
Eservice/index.scss

@@ -0,0 +1 @@
+/* Eservice/index.wxss */

+ 2 - 0
Eservice/index.wxml

@@ -0,0 +1,2 @@
+<!--Eservice/index.wxml-->
+<text>Eservice/index.wxml</text>

+ 8 - 0
app.json

@@ -60,12 +60,19 @@
         "activity/index",
         "orderFormLine/index"
       ]
+    },
+    {
+      "root": "Eservice",
+      "pages": [
+        "index"
+      ]
     }
   ],
   "preloadRule": {
     "pages/tabbar/home/index": {
       "packages": [
         "packageA",
+        "Eservice",
         "select"
       ],
       "network": "all"
@@ -73,6 +80,7 @@
     "pages/login/phone": {
       "packages": [
         "packageA",
+        "Eservice",
         "select"
       ],
       "network": "all"

+ 1 - 1
pages/login/modules/account.js

@@ -54,7 +54,7 @@ Component({
             _Http.login({
                 "accountno": this.data.accountno,
                 "password": md5.hexMD5(this.data.password),
-                "systemclient": "wechatsaletool"
+                "systemclient": "wechatservice"
             }).then(res => {
                 getCurrentPages()[0].setData({
                     loading: false

+ 2 - 2
pages/login/modules/phone.js

@@ -31,7 +31,7 @@ Component({
             if (!Check.CheckPhoneNumber(this.data.phonenumber)) return;
             _Http.getpassword({
                 "phonenumber": this.data.phonenumber,
-                "systemclient": "wechatsaletool"
+                "systemclient": "wechatservice"
             }).then(res => {
                 wx.showToast({
                     title: res.msg,
@@ -78,7 +78,7 @@ Component({
             _Http.plogin({
                 "phonenumber": this.data.phonenumber,
                 "password": md5.hexMD5(this.data.password),
-                "systemclient": "wechatsaletool"
+                "systemclient": "wechatservice"
             }).then(res => {
                 getCurrentPages()[0].setData({
                     loading: false

+ 1 - 1
pages/login/phone.js

@@ -23,7 +23,7 @@ Page({
                 if (res.code) {
                     _Http.loginbywechat({
                         wechat_code: res.code,
-                        "systemclient": "wechatsaletool"
+                        "systemclient": "wechatservice"
                     }).then(res => {
                         console.log("微信快捷登录", res)
                         if (res.code == 0) return wx.showToast({

+ 56 - 81
pages/tabbar/home/index.js

@@ -10,76 +10,11 @@ Page({
         msgList: [], //消息列表
     },
     onLoad(options) {
-        console.log(options)
         this.setData({ //获取胶囊位置信息
             capsule: wx.getMenuButtonBoundingClientRect()
         })
         this.refreshData() //更新权限等信息
     },
-
-    queryApp(name) {
-        const routeList = [{
-            name: "商城",
-            path: "/packageA/market/index",
-            icon: "icon-shangcheng"
-        }, {
-            name: "销售订单",
-            path: "/packageA/orderForm/index",
-            icon: "icon-dingdan"
-        }, {
-            name: "收货",
-            path: "/packageA/shipment/index",
-            icon: "icon-shouhuo"
-        }, {
-            name: "业绩目标",
-            path: "/packageA/target/index",
-            icon: "icon-yejimubiao"
-        }, {
-            name: "账户",
-            path: "/packageA/account/index",
-            icon: "icon-zhanghu"
-        }, {
-            name: "促销活动",
-            path: "/packageA/activity/index",
-            icon: "icon-cuxiaohuodong"
-        }, {
-            name: "工具查询",
-            path: "/packageA/tool/index",
-            icon: "icon-kaipiao"
-        }, {
-            name: "购物车",
-            path: "/packageA/shopping/index",
-            icon: "icon-kaipiao"
-        }, {
-            name: "开票",
-            path: "/packageA/invoice/index",
-            icon: "icon-kaipiao"
-        }, {
-            name: "打款凭证",
-            path: "/packageA/remitVoucher/index",
-            icon: "icon-shujuchaxun"
-        }, {
-            name: "工具借用",
-            path: "/packageA/borrow/index",
-            icon: "icon-shujuchaxun"
-        }, {
-            name: "工具归还",
-            path: "/packageA/toolBill/index",
-            icon: "icon-shujuchaxun"
-        }, {
-            name: "居间费结算",
-            path: "/packageA/betweenFee/index",
-            icon: "icon-shujuchaxun"
-        }, {
-            name: "数据查询",
-            path: "#",
-            icon: "icon-shujuchaxun"
-        }];
-        let i = routeList.findIndex(v => v.name == name);
-        routeList[i].index = i
-        return routeList[i]
-    },
-
     /* 更新站点信息 */
     refreshData() {
         this.setData({
@@ -88,11 +23,6 @@ Page({
         if (wx.getStorageSync('userauth').length != 0) {
             let authList = {},
                 entrance = [{
-                    label: "E-订单",
-                    appid: "wxc1b6ae925ac1d06a",
-                    icon: "work-E-dingdan",
-                    list: getedd()
-                }, {
                     label: "通用",
                     icon: "work-tongyong",
                     appid: "wx08b337e860e3ea58",
@@ -110,8 +40,18 @@ Page({
                         icon: "work-xiaochengxutongxunlu"
                     }])
                 }, {
-                    label: "营销工具",
+                    label: "E-订单",
+                    appid: "wxc1b6ae925ac1d06a",
                     icon: "work-E-dingdan",
+                    list: getedd()
+                }, {
+                    label: "E-服务",
+                    appid: "wxc1b6ae925ac1d06a",
+                    icon: "work-E-fuwu",
+                    list: geteservice()
+                }, {
+                    label: "营销工具",
+                    icon: "work-yingxiaogongju",
                     appid: "wx08b337e860e3ea58",
                     list: gettool()
                 }, {
@@ -266,7 +206,7 @@ Page({
                 }, {
                     name: "打款凭证",
                     path: "/packageA/remitVoucher/index",
-                    icon: "work-shujuchaxun"
+                    icon: "work-dakuanpingzheng"
                 }, {
                     name: "工具借用",
                     path: "/packageA/borrow/index",
@@ -278,12 +218,13 @@ Page({
                 }, {
                     name: "居间费结算",
                     path: "/packageA/betweenFee/index",
-                    icon: "work-shujuchaxun"
-                }, {
+                    icon: "work-jujianfeijiesuan"
+                }, ];
+                /* {
                     name: "数据查询",
                     path: "#",
                     icon: "work-shujuchaxun"
-                }];
+                } */
                 let edd = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-订单"], ["商品档案", "销售管理", "财务管理", "售后管理", "发货与库存", "业绩查询"]),
                     list = [];
                 edd.forEach(v => {
@@ -303,6 +244,44 @@ Page({
                 });
                 return dye(list.sort((a, b) => a.index - b.index))
             };
+            //E服务
+            function geteservice() {
+                let paths = [{
+                    name: "工单",
+                    path: "/packageA/target/index",
+                    icon: "work-yejimubiao"
+                }, {
+                    name: "申请单",
+                    path: "/packageA/market/index",
+                    icon: "work-shangcheng"
+                }, {
+                    name: "申请单管理",
+                    path: "/packageA/orderForm/index",
+                    icon: "work-dingdan"
+                }, {
+                    name: "业务员服务申请单",
+                    path: "/packageA/shipment/index",
+                    icon: "work-shouhuo"
+                }];
+                let eservice = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-服务"], ["工单管理"]),
+                    list = [];
+                eservice.forEach(v => {
+                    v.apps.forEach(s => {
+                        authList[s.name] = {
+                            options: s.meta.auth.map(a => a.option),
+                            optionnames: s.meta.auth.map(a => a.optionname),
+                        }
+                        if (authList[s.name].options.some(s => s == "read")) {
+                            let i = paths.findIndex(k => k.name == s.meta.title);
+                            if (i != -1) {
+                                paths[i].index = i;
+                                list.push(paths[i])
+                            }
+                        }
+                    })
+                });
+                return dye(list.sort((a, b) => a.index - b.index))
+            }
             //染色
             function dye(list) {
                 let colorList = [{
@@ -358,21 +337,17 @@ Page({
                     }
                 })
             };
-
+            wx.setStorageSync('auth', authList)
             this.setData({
                 entrance,
                 auth: JSON.stringify(authList),
                 userMsg: JSON.stringify(wx.getStorageSync('userMsg'))
             })
-
             /* 获取首页banner */
             let banner = wx.getStorageSync('banner_list').find(v => v.location == "index_top");
             if (banner) this.setData({
                 bannerList: banner.ads
             })
-
-            wx.setStorageSync('auth', authList)
-
         } else {
             setTimeout(this.refreshData, 10);
             return;
@@ -443,7 +418,7 @@ Page({
         clearInterval(DataCarousel);
     },
     onReady() {
-        this.setListHeight();
+        // this.setListHeight();
     },
     /* 设置页面高度 */
     setListHeight() {

+ 1 - 1
pages/tabbar/home/index.wxml

@@ -29,7 +29,7 @@
                     <view class="icon-box" style="background-color: {{it.bColor}};">
                         <text class="work {{it.icon}}" style="color: {{it.color}};" />
                     </view>
-                    <view class="name line-1">{{it.name}}</view>
+                    <view class="name">{{it.name}}</view>
                 </navigator>
             </view>
         </view>

+ 15 - 3
static/work-icon.wxss

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "work"; /* Project id 3902307 */
-  src: url('//at.alicdn.com/t/c/font_3902307_kfk4eq089at.woff2?t=1676630415835') format('woff2'),
-       url('//at.alicdn.com/t/c/font_3902307_kfk4eq089at.woff?t=1676630415835') format('woff'),
-       url('//at.alicdn.com/t/c/font_3902307_kfk4eq089at.ttf?t=1676630415835') format('truetype');
+  src: url('//at.alicdn.com/t/c/font_3902307_s4g8mtua5si.woff2?t=1676634797922') format('woff2'),
+       url('//at.alicdn.com/t/c/font_3902307_s4g8mtua5si.woff?t=1676634797922') format('woff'),
+       url('//at.alicdn.com/t/c/font_3902307_s4g8mtua5si.ttf?t=1676634797922') format('truetype');
 }
 
 .work {
@@ -13,6 +13,18 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.work-jujianfeijiesuan:before {
+  content: "\e684";
+}
+
+.work-dakuanpingzheng:before {
+  content: "\e685";
+}
+
+.work-yingxiaogongju:before {
+  content: "\e683";
+}
+
 .work-a-shangxueyuanxuexi:before {
   content: "\e63d";
 }

+ 2 - 2
utils/Http.js

@@ -1,6 +1,6 @@
 // const baseUrl = "https://meida.cnyunl.com/yos/rest/index";
-// const baseUrl = "http://61.164.207.46:8000/yos/rest/index";
-const baseUrl = "http://122.226.136.204:8082/yos/rest/index";
+const baseUrl = "http://61.164.207.46:8000/yos/rest/index";
+// const baseUrl = "http://122.226.136.204:8082/yos/rest/index";
 
 class HTTP {
     request({