zhaoxiaohai 4 lat temu
rodzic
commit
4257f51557

+ 28 - 2
app.json

@@ -1,15 +1,41 @@
 {
+    "tabBar": {
+        "custom": true,
+        "color": "#000000",
+        "selectedColor": "#000000",
+        "backgroundColor": "#000000",
+        "list": [
+            {
+                "pagePath": "pages/tabbar-pages/home/index"
+            },
+            {
+                "pagePath": "pages/tabbar-pages/customer-service-staff/index"
+            },
+            {
+                "pagePath": "pages/tabbar-pages/supplyAndDemand/index"
+            },
+            {
+                "pagePath": "pages/tabbar-pages/message/index"
+            },
+            {
+                "pagePath": "pages/tabbar-pages/user/index"
+            }
+        ]
+    },
     "pages": [
         "pages/login/index",
         "pages/userCenter/index",
-        "pages/tabbar-pages/user/index",
         "pages/teamManagement/index",
         "pages/teamManagement/change",
         "pages/productManagement/index",
         "pages/storeMessage/index",
         "pages/announceDemand/index",
         "pages/productManagement/change",
-        "pages/tabbar-pages/supplyAndDemand/index"
+        "pages/tabbar-pages/home/index",
+        "pages/tabbar-pages/customer-service-staff/index",
+        "pages/tabbar-pages/supplyAndDemand/index",
+        "pages/tabbar-pages/message/index",
+        "pages/tabbar-pages/user/index"
     ],
     "usingComponents": {
         "van-button": "@vant/weapp/button/index",

+ 5 - 2
components/My_SearchInputBox/index.wxml

@@ -1,8 +1,11 @@
 <view class="search_box">
-    <view class="searc">
+    <view class="searc" wx:if="{{route!='team'}}">
         <van-icon name="search" /><input type="search" confirm-type="search" placeholder="请输入搜索关键字" value="{{text}}" bindblur='searchBlur' bindinput="inputText" />
-        <view class="clear" bindtap="clearInput"><van-icon name="clear" /></view>
+        <view class="clear" bindtap="clearInput">
+            <van-icon name="clear" />
+        </view>
     </view>
+    <view class="searc" wx:else style="opacity: 0;"></view>
     <view class="searc_but" bindtap="itemAdd" wx:if="{{fisadministrator}}">
         <van-icon name="add" />新增
     </view>

+ 61 - 0
custom-tab-bar/index.js

@@ -0,0 +1,61 @@
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+        active: 0,
+        tabbarList: [{
+                icon: 'home-o',
+                text: '首页',
+                url: '/pages/tabbar-pages/home/index'
+            },
+            {
+                icon: 'service-o',
+                text: '在线客服',
+                url: '/pages/tabbar-pages/customer-service-staff/index'
+            },
+            {
+                icon: 'chat-o',
+                text: '供需广场',
+                url: '/pages/tabbar-pages/supplyAndDemand/index'
+            },
+            {
+                icon: 'chat-o',
+                text: '消息',
+                url: '/pages/tabbar-pages/message/index'
+            },
+            {
+                icon: 'contact',
+                text: '我的',
+                url: '/pages/tabbar-pages/user/index'
+            }
+        ]
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        /* tabbar */
+        onChange(event) {
+            this.setData({
+                active: event.target.dataset.index
+            });
+            wx.switchTab({
+                url: this.data.tabbarList[event.target.dataset.index].url
+            });
+        },
+        init() {
+            const page = getCurrentPages().pop();
+            this.setData({
+                active: this.data.tabbarList.findIndex(item => item.url === `/${page.route}`)
+            });
+        },
+    }
+})

+ 7 - 0
custom-tab-bar/index.json

@@ -0,0 +1,7 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-tabbar": "@vant/weapp/tabbar/index",
+        "van-tabbar-item": "@vant/weapp/tabbar-item/index"
+    }
+}

+ 3 - 0
custom-tab-bar/index.wxml

@@ -0,0 +1,3 @@
+<van-tabbar active="{{ active }}" placeholder>
+    <van-tabbar-item bindtap="onChange" data-index="{{index}}" wx:for="{{tabbarList}}" wx:key="index" icon="{{item.icon}}">{{item.text}}</van-tabbar-item>
+</van-tabbar>

+ 1 - 0
custom-tab-bar/index.wxss

@@ -0,0 +1 @@
+/* custom-tab-bar/index.wxss */

+ 3 - 1
pages/login/index.js

@@ -327,7 +327,9 @@ Page({
             this.savePersonalInformation()
         }
         /* 跳转到首页 */
-        console.log('跳转首页')
+        wx.reLaunch({
+            url: '/pages/tabbar-pages/home/index'
+        })
     },
     /* 修改按钮内容 */
     changeButText() {

+ 65 - 0
pages/tabbar-pages/customer-service-staff/index.js

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

+ 3 - 0
pages/tabbar-pages/customer-service-staff/index.json

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

+ 2 - 0
pages/tabbar-pages/customer-service-staff/index.wxml

@@ -0,0 +1,2 @@
+<!--pages/tabbar-pages/customer-service-staff/index.wxml-->
+<text>pages/tabbar-pages/customer-service-staff/index.wxml</text>

+ 1 - 0
pages/tabbar-pages/customer-service-staff/index.wxss

@@ -0,0 +1 @@
+/* pages/tabbar-pages/customer-service-staff/index.wxss */

+ 65 - 0
pages/tabbar-pages/home/index.js

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

+ 3 - 0
pages/tabbar-pages/home/index.json

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

+ 2 - 0
pages/tabbar-pages/home/index.wxml

@@ -0,0 +1,2 @@
+<!--pages/tabbar-pages/home/index.wxml-->
+<text>pages/tabbar-pages/home/index.wxml</text>

+ 1 - 0
pages/tabbar-pages/home/index.wxss

@@ -0,0 +1 @@
+/* pages/tabbar-pages/home/index.wxss */

+ 65 - 0
pages/tabbar-pages/message/index.js

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

+ 3 - 0
pages/tabbar-pages/message/index.json

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

+ 2 - 0
pages/tabbar-pages/message/index.wxml

@@ -0,0 +1,2 @@
+<!--pages/tabbar-pages/message/index.wxml-->
+<text>pages/tabbar-pages/message/index.wxml</text>

+ 1 - 0
pages/tabbar-pages/message/index.wxss

@@ -0,0 +1 @@
+/* pages/tabbar-pages/message/index.wxss */

+ 1 - 2
pages/tabbar-pages/supplyAndDemand/index.js

@@ -1,4 +1,3 @@
-// pages/tabbar-pages/supplyAndDemand/index.js
 Page({
 
     /**
@@ -59,7 +58,7 @@ Page({
      * 生命周期函数--监听页面显示
      */
     onShow: function () {
-
+        this.getTabBar().init();
     },
 
     /**

+ 2 - 1
pages/tabbar-pages/supplyAndDemand/index.wxml

@@ -93,4 +93,5 @@
     </van-tabs>
 </view>
 <!-- 右侧吸附按钮 -->
-<My_adsorbRight></My_adsorbRight>
+<My_adsorbRight></My_adsorbRight>
+<view style="height: 34px;"></view>

+ 1 - 0
pages/tabbar-pages/user/index.js

@@ -91,6 +91,7 @@ Page({
      * 生命周期函数--监听页面显示
      */
     onShow: function () {
+        this.getTabBar().init();
         // 获取用户信息
         _Http.basic({
             "accesstoken": wx.getStorageSync('userData').token,

+ 29 - 14
pages/teamManagement/change.js

@@ -11,6 +11,7 @@ Page({
      * 页面的初始数据
      */
     data: {
+        newAdd: false, //是否新增
         fname: '', //用户名称
         frole: '', //身份/职位
         fphonenumber: '', //手机号码
@@ -31,7 +32,6 @@ Page({
     onLoad: function (options) {
         if (options.data) {
             const memberMessage = JSON.parse(options.data);
-            console.log(memberMessage)
             this.setData({
                 fname: memberMessage.fname,
                 frole: memberMessage.frole,
@@ -40,6 +40,10 @@ Page({
                 subusers: memberMessage.subusers,
                 tenterprise_userid: memberMessage.tenterprise_userid
             })
+        } else {
+            this.setData({
+                newAdd: true
+            })
         }
     },
     /* 提交 */
@@ -48,28 +52,37 @@ Page({
             title: '请检查表单内容',
             icon: "none"
         });
+        let content = {
+            "tenterprise_userid": this.data.tenterprise_userid,
+            "fname": this.data.fname,
+            "frole": this.data.frole,
+            "fphonenumber": this.data.fphonenumber,
+            "subusers": this.data.subusers
+        };
+        if (this.data.newAdd) {
+            content = {
+                "tenterprise_userid": 0
+            }
+        }
         _Http.basic({
             "accesstoken": wx.getStorageSync('userData').token,
             "classname": "customer.usercenter.teammsg.teammsg",
             "method": "update_userMsg",
-            "content": {
-                "tenterprise_userid": this.data.tenterprise_userid,
-                "fname": this.data.fname,
-                "frole": this.data.frole,
-                "fphonenumber": this.data.fphonenumber,
-                "subusers": this.data.subusers
-            }
+            "content": content
         }).then(res => {
             console.log(res)
-            if (res.msg == "成功") {
+            if (res.msg == "成功" && !this.data.newAdd) {
                 wx.showToast({
-                  title: '保存成功',
+                    title: '保存成功',
                 });
-                setTimeout(()=>{
+                this.setData({
+                    newAdd: false
+                })
+                setTimeout(() => {
                     wx.navigateBack({
                         delta: 1
-                      })
-                },500)
+                    })
+                }, 500)
             }
         })
     },
@@ -160,7 +173,9 @@ Page({
      * 生命周期函数--监听页面卸载
      */
     onUnload: function () {
-
+        if(this.data.newAdd){
+            console.log("成员删除")
+        }
     },
 
     /**

+ 2 - 1
pages/teamManagement/index.json

@@ -1,5 +1,6 @@
 {
   "usingComponents": {
-    "My_MembersAndProducts": "/components/My_MembersAndProducts/index"
+    "My_MembersAndProducts": "/components/My_MembersAndProducts/index",
+    "My_SearchInputBox":"/components/My_SearchInputBox/index"
   }
 }

+ 2 - 0
pages/teamManagement/index.wxml

@@ -1,3 +1,5 @@
+<!-- 搜索 -->
+<My_SearchInputBox route="team" fisadministrator="{{fisadministrator}}"></My_SearchInputBox>
 <!-- 列表 -->
 <My_GeneralTemplate>
     <view class="member_list">

+ 1 - 1
project.config.json

@@ -46,7 +46,7 @@
         "useCompilerPlugins": false
     },
     "compileType": "miniprogram",
-    "libVersion": "2.21.1",
+    "libVersion": "2.19.6",
     "appid": "wx210f6f5080f20d0c",
     "projectname": "%E5%B8%83%E4%B8%87%E5%AE%B6%E5%B0%8F%E7%A8%8B%E5%BA%8F",
     "debugOptions": {