Browse Source

商户注册与个人信息

zhaoxiaohai 3 years ago
parent
commit
8d45a11585
58 changed files with 819 additions and 63 deletions
  1. 14 1
      README.md
  2. 17 4
      app.js
  3. 8 2
      app.json
  4. 30 0
      components/My_formCell/index.js
  5. 4 0
      components/My_formCell/index.json
  6. 13 0
      components/My_formCell/index.wxml
  7. 37 0
      components/My_formCell/index.wxss
  8. 23 0
      components/My_group_item/index.js
  9. 4 0
      components/My_group_item/index.json
  10. 24 0
      components/My_group_item/index.wxml
  11. 68 0
      components/My_group_item/index.wxss
  12. 23 0
      components/My_group_list/index.js
  13. 6 0
      components/My_group_list/index.json
  14. 8 0
      components/My_group_list/index.wxml
  15. 4 0
      components/My_group_list/index.wxss
  16. 44 0
      components/My_group_new-change/index.js
  17. 6 0
      components/My_group_new-change/index.json
  18. 21 0
      components/My_group_new-change/index.wxml
  19. 7 0
      components/My_group_new-change/index.wxss
  20. 14 5
      components/My_moreAccount/index.js
  21. 41 0
      components/My_navBar/index.js
  22. 4 0
      components/My_navBar/index.json
  23. 12 0
      components/My_navBar/index.wxml
  24. 24 0
      components/My_navBar/index.wxss
  25. 23 0
      components/My_product_list/index.js
  26. 4 0
      components/My_product_list/index.json
  27. 2 0
      components/My_product_list/index.wxml
  28. 1 0
      components/My_product_list/index.wxss
  29. 2 2
      components/My_userRegister/index.wxml
  30. 66 0
      pages/group&product/change.js
  31. 5 0
      pages/group&product/change.json
  32. 1 0
      pages/group&product/change.wxml
  33. 1 0
      pages/group&product/change.wxss
  34. 66 0
      pages/group&product/index.js
  35. 6 0
      pages/group&product/index.json
  36. 1 0
      pages/group&product/index.wxml
  37. 1 0
      pages/group&product/index.wxss
  38. 8 4
      pages/login/index.js
  39. 1 1
      pages/login/index.wxml
  40. 1 0
      pages/tabbarPage/ClientService/index.json
  41. 3 0
      pages/tabbarPage/ClientService/index.wxml
  42. 0 1
      pages/tabbarPage/Home/index.js
  43. 1 0
      pages/tabbarPage/Home/index.json
  44. 3 0
      pages/tabbarPage/Home/index.wxml
  45. 1 0
      pages/tabbarPage/Message/index.json
  46. 3 0
      pages/tabbarPage/Message/index.wxml
  47. 1 0
      pages/tabbarPage/Supply/index.json
  48. 3 0
      pages/tabbarPage/Supply/index.wxml
  49. 1 0
      pages/tabbarPage/User/index.json
  50. 4 1
      pages/tabbarPage/User/index.wxml
  51. 4 1
      pages/tabbarPage/User/index.wxss
  52. 45 10
      pages/userMessage/index.js
  53. 3 1
      pages/userMessage/index.wxml
  54. 5 1
      pages/userMessage/index.wxss
  55. 1 2
      pages/userPerfectMsg/index.wxml
  56. 10 4
      project.private.config.json
  57. 0 23
      utils/api.js
  58. 86 0
      utils/uploadfile.js

+ 14 - 1
README.md

@@ -2,6 +2,7 @@
 标题文字大小:34rpx
 普通文字大小:26rpx
 普通字体颜色:#646566
+灰色字体颜色:#CCCCCC
 边框颜色:#E4E4E4
 
 app.js 全局变量
@@ -13,17 +14,29 @@ login -- 登录和用户注册
 tabbarPage -- tabbar页面
 userPerfectMsg -- 商户注册信息完善
 userMessage -- 用户个人信息修改
+group&product -- 团队&产品
 
 自定义组件:
+My_formCell -- 模拟组件库单元格
+My_navBar -- tabbar页面公共导航栏
 My_inform_box -- 通告
 My_inform_item -- 通告项
 My_realTime_display -- 实时展示
 My_operation -- 3列宫格
 My_userRegister -- 个人注册
 My_moreAccount -- 多账号登录
+My_group_list -- 团队列表页面
+My_group_item -- 团队列表成员
+My_group_new-change -- 团队新增或修改
+My_product_list -- 产品列表页面
 
 utils文件
 Http.js -- 封装请求
 api.js -- 接口分类
 md5.js -- 验证码加密
-verify.js -- 表单校验
+verify.js -- 表单校验
+uploadfile.js -- 上传文件
+
+缓存
+userIndex -- 用户当前使用账户列表中的下标
+token -- 当前token

+ 17 - 4
app.js

@@ -2,16 +2,29 @@
 App({
   onLaunch() {
     /* 计算tabbar+iphone安全距离  tabbar页面+100rpx*/
-    let safeAreaBottom = 0;
+    let safeAreaBottom = 0,
+      capsule = wx.getMenuButtonBoundingClientRect(),
+      height = 200,
+      that = this;
+
     wx.getSystemInfo({
       success(res) {
+        //计算底部安全距离高度
         safeAreaBottom += res.screenHeight - res.safeArea.height;
+        //计算自定义导航的高度
+        height = capsule.height + res.statusBarHeight + (capsule.top - res.statusBarHeight) + 8;
+        that.globalData.safeAreaBottom = safeAreaBottom;
+        //判断是否为平板
+        if (res.model.slice(0, 4) == "iPad") return that.globalData.myNavBorHeight = height;
+        that.globalData.myNavBorHeight = height * 2;
       }
     })
-    this.globalData.safeAreaBottom = safeAreaBottom;
+    //返回数据
+
   },
   globalData: {
-    safeAreaBottom: 0,//底部安全距离
-    accountList:{},//角色列表
+    myNavBorHeight: null, //自定义头部导航高度
+    safeAreaBottom: 0, //底部安全距离
+    accountList: {}, //角色列表
   }
 })

+ 8 - 2
app.json

@@ -30,7 +30,9 @@
         "pages/tabbarPage/Message/index",
         "pages/tabbarPage/User/index",
         "pages/userPerfectMsg/index",
-        "pages/userMessage/index"
+        "pages/userMessage/index",
+        "pages/group&product/index",
+        "pages/group&product/change"
     ],
     "window": {
         "backgroundTextStyle": "light",
@@ -40,6 +42,7 @@
     },
     "sitemapLocation": "sitemap.json",
     "usingComponents": {
+        "My_navBar": "/components/My_navBar/index",
         "van-button": "@vant/weapp/button/index",
         "van-icon": "@vant/weapp/icon/index",
         "van-grid": "@vant/weapp/grid/index",
@@ -48,6 +51,9 @@
         "van-cell-group": "@vant/weapp/cell-group/index",
         "van-image": "@vant/weapp/image/index",
         "van-field": "@vant/weapp/field/index",
-        "van-uploader": "@vant/weapp/uploader/index"
+        "van-uploader": "@vant/weapp/uploader/index",
+        "van-search": "@vant/weapp/search/index",
+        "van-switch": "@vant/weapp/switch/index",
+        "van-action-sheet": "@vant/weapp/action-sheet/index"
     }
 }

+ 30 - 0
components/My_formCell/index.js

@@ -0,0 +1,30 @@
+// components/My_formCell/index.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        title:{
+            type:String,
+            value:"单元格"
+        },
+        required:{
+            type:Boolean,
+            value:false
+        }
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+
+    }
+})

+ 4 - 0
components/My_formCell/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 13 - 0
components/My_formCell/index.wxml

@@ -0,0 +1,13 @@
+  <!-- 自定义上传cell -->
+  <view class="cell_box">
+    <view class="cell_con">
+      <!-- 标题 -->
+      <view class="cell_con_title {{required ? 'required' : 'norequired'}}" >
+        {{title}}
+      </view>
+      <!-- 右侧自定义 -->
+      <view>
+        <slot></slot>
+      </view>
+    </view>
+  </view>

+ 37 - 0
components/My_formCell/index.wxss

@@ -0,0 +1,37 @@
+/* 品牌cell */
+.cell_box {
+    background-color: #ffffff;
+}
+
+.cell_con {
+    display: flex;
+    justify-content: space-between;
+    width: 92vw;
+    height: 48rpx;
+    font-size: 16px;
+    color: #646566;
+    margin: 0 auto;
+    border-bottom: 1px solid #F7F8F9;
+    padding: 24rpx 0;
+}
+
+.cell_con_title {
+    height: 48rpx;
+    margin-left: -15rpx;
+}
+
+.cell_con_title text {
+    margin-right: 3rpx;
+    color: #EE1929;
+}
+/* 必填型号 */
+.required::before{
+    content: '*';
+    margin-right: -6rpx;
+    color: #EE1929;
+}
+.norequired::before{
+    content: '';
+    margin-left: 18rpx;
+    color: #EE1929;
+}

+ 23 - 0
components/My_group_item/index.js

@@ -0,0 +1,23 @@
+// components/My_group_item/index.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+
+    }
+})

+ 4 - 0
components/My_group_item/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 24 - 0
components/My_group_item/index.wxml

@@ -0,0 +1,24 @@
+<!-- 成员列表 -->
+<view class="member_list">
+    <!-- 成员 -->
+    <view class="member_item">
+        <!-- 用户头像 -->
+        <view class="member_item_img">
+            <view></view>
+        </view>
+        <!-- 用户信息 -->
+        <view class="member_item_text">
+            <view class="member_item_text_title">
+                用户名
+            </view>
+            <view class="member_item_text_row">
+                身份/职位:
+            </view>
+            <view class="member_item_text_row">
+                手机:
+            </view>
+        </view>
+        <!-- 修改按钮 -->
+        <navigator url="/pages/group&product/change" class="member_item_amend">修改</navigator>
+    </view>
+</view>

+ 68 - 0
components/My_group_item/index.wxss

@@ -0,0 +1,68 @@
+/* 列表 */
+.member_list {
+    width: 100vw;
+    background-color: #ffffff;
+    border-top: 1px solid #E4E4E4;
+}
+
+/*  */
+.member_item {
+    display: flex;
+    align-items: center;
+    height: 180rpx;
+    border-bottom: 1px solid #E4E4E4;
+}
+
+/* 头像 */
+.member_item_img {
+    position: relative;
+    height: 100%;
+    width: 180rpx;
+}
+
+.member_item_img>view {
+    position: absolute;
+    width: 120rpx;
+    height: 120rpx;
+    background-color: #000;
+    border-radius: 50%;
+    overflow: hidden;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+}
+
+/* 用户信息 */
+.member_item_text {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+}
+
+/* 用户名 */
+.member_item_text_title {
+    font-size: 32rpx;
+    color: #1E1E1E;
+    font-weight: 550;
+}
+
+/* 用户身份与手机 */
+.member_item_text_row {
+    font-size: 30rpx;
+    color: #CCCCCC;
+    margin-top: 12rpx;
+}
+
+/* 修改 */
+.member_item_amend {
+    font-size: 34rpx;
+    width: 100rpx;
+    height: 55rpx;
+    line-height: 55rpx;
+    color: #ffffff;
+    text-align: center;
+    border-radius: 15rpx;
+    background-color: #169BD5;
+    margin-right: 30rpx;
+}

+ 23 - 0
components/My_group_list/index.js

@@ -0,0 +1,23 @@
+// components/My_group_list/index.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+
+    }
+})

+ 6 - 0
components/My_group_list/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "My_group_item":"../My_group_item/index"
+    }
+}

+ 8 - 0
components/My_group_list/index.wxml

@@ -0,0 +1,8 @@
+<!-- 搜索 -->
+<van-search value="{{ value }}" placeholder="请输入搜索关键词" shape="round" use-action-slot bind:change="onChange" bind:search="onSearch">
+  <view class="search_left" slot="action" bind:tap="onClick">
+    <van-icon name="add" style="color: #1ABC9C;" /> 新增
+  </view>
+</van-search>
+<!-- 列表 -->
+<My_group_item wx:for="{{3}}"></My_group_item>

+ 4 - 0
components/My_group_list/index.wxss

@@ -0,0 +1,4 @@
+/* 搜索左侧按钮 */
+.search_left{
+    font-size: 32rpx;
+}

+ 44 - 0
components/My_group_new-change/index.js

@@ -0,0 +1,44 @@
+// components/My_group_new&change/index.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+        userName: "", //账户名称
+        frole: "", //身份/职位
+        cellPhoneNum: "", //手机号码
+        checked: true, //权限
+        actionSheetShow: false
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        /* 是否启用 */
+        switchOnChange() {
+            this.setData({
+                checked: !this.data.checked
+            })
+        },
+        /* 打开弹出框 */
+        actionSheetShow() {
+            this.setData({
+                actionSheetShow: true
+            })
+        },
+        /* 关闭弹出框 */
+        onClose() {
+            this.setData({
+                actionSheetShow: false
+            })
+        }
+    }
+})

+ 6 - 0
components/My_group_new-change/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "My_formCell":"../My_formCell/index"
+    }
+}

+ 21 - 0
components/My_group_new-change/index.wxml

@@ -0,0 +1,21 @@
+<!-- 团队新增或修改 -->
+<van-cell-group>
+    <van-field model:value="{{ userName }}" required label="账号名称" placeholder="点击填写" input-align="right" size="large" />
+    <van-field model:value="{{ frole }}" required label="身份/职位" placeholder="点击填写" input-align="right" size="large" />
+    <van-field model:value="{{ cellPhoneNum }}" required label="手机号码" placeholder="点击填写" input-align="right" size="large" />
+    <My_formCell title="权限设置">
+        <view bindtap="actionSheetShow">点击设置</view>
+    </My_formCell>
+    <My_formCell title="是否启用">
+        <van-switch checked="{{ checked }}" bind:change="switchOnChange" size="24" />
+    </My_formCell>
+</van-cell-group>
+<view class="submit">
+    <van-button type="info" size="large" round>保存</van-button>
+</view>
+<!-- 底部弹出 -->
+<van-action-sheet show="{{ actionSheetShow }}" bind:close="onClose">
+    <view class="">
+
+    </view>
+</van-action-sheet>

+ 7 - 0
components/My_group_new-change/index.wxss

@@ -0,0 +1,7 @@
+/* 提交按钮 */
+.submit{
+    width: 300rpx;
+    height: 100rpx;
+    margin: 40rpx auto 0;
+    
+}

+ 14 - 5
components/My_moreAccount/index.js

@@ -3,17 +3,25 @@ Component({
     /**
      * 组件的属性列表
      */
-    properties: {
-        userList: {
-            type: Array
-        }
+    properties: {},
+    /* 组件的生命周期 */
+    lifetimes: {
+        attached: function () {
+            // 在组件实例进入页面节点树时执行
+            this.setData({
+                userList:getApp().globalData.accountList
+            })
+        },
+        detached: function () {
+            // 在组件实例被从页面节点树移除时执行
+        },
     },
 
     /**
      * 组件的初始数据
      */
     data: {
-
+        userList: [],
     },
 
     /**
@@ -22,6 +30,7 @@ Component({
     methods: {
         loginAccount(e) {
             //全局储存
+            wx.setStorageSync('userIndex', e.currentTarget.dataset.index)
             wx.setStorageSync('token', this.data.userList[e.currentTarget.dataset.index].token)
             wx.reLaunch({
                 url: '/pages/tabbarPage/Home/index'

+ 41 - 0
components/My_navBar/index.js

@@ -0,0 +1,41 @@
+// components/My_navBar/index.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+
+    },
+    lifetimes: {
+        attached: function () {
+            // 在组件实例进入页面节点树时执行
+            //获取当前登录用户名
+            const userName = getApp().globalData.accountList[wx.getStorageSync('userIndex')].fname;
+            this.setData({
+                userName
+            })
+        },
+        detached: function () {
+            // 在组件实例被从页面节点树移除时执行
+        },
+    },
+    /**
+     * 组件的初始数据
+     */
+    data: {
+        userName: "", //用户名
+        NavHeight: getApp().globalData.myNavBorHeight, //头部导航高度
+        capsule: wx.getMenuButtonBoundingClientRect(), //胶囊位置
+    },
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        a1212() {
+            //跳转到选择账号
+            wx.navigateTo({
+                url: '/pages/login/index?type=' + 2,
+            })
+        }
+    }
+})

+ 4 - 0
components/My_navBar/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 12 - 0
components/My_navBar/index.wxml

@@ -0,0 +1,12 @@
+<view class="header_nav" style="height:{{NavHeight}}rpx;">
+    <view class="header_nav_title" style="height: {{capsule.height}}px;top:{{capsule.top}}px">
+        布万家
+        <view class="header_user_choice" bindtap="a1212">
+            {{userName}}
+            <van-icon name="arrow-down" />
+        </view>
+    </view>
+</view>
+<!-- 占位 -->
+<view style="height:{{NavHeight}}rpx;">
+</view>

+ 24 - 0
components/My_navBar/index.wxss

@@ -0,0 +1,24 @@
+.header_nav {
+    position: fixed;
+    width: 100vw;
+    background-color: #3CC1CE;
+    top: 0;
+    left: 0;
+    z-index: 99999;
+}
+/* 标题 */
+.header_nav_title {
+    position: absolute;
+    display: flex;
+    width: 100%;
+    font-size: 28rpx;
+    align-items: center;
+    justify-content: center;
+    color: #ffffff;
+}
+/* 左侧账号选择 */
+.header_user_choice{
+    position: absolute;
+    font-size: 26rpx;
+    left: 30rpx;
+}

+ 23 - 0
components/My_product_list/index.js

@@ -0,0 +1,23 @@
+// components/My_product_list/index.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+
+    }
+})

+ 4 - 0
components/My_product_list/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 2 - 0
components/My_product_list/index.wxml

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

+ 1 - 0
components/My_product_list/index.wxss

@@ -0,0 +1 @@
+/* components/My_product_list/index.wxss */

+ 2 - 2
components/My_userRegister/index.wxml

@@ -1,11 +1,11 @@
 <view class="login">
     <view class="login_row">
         <view class="login_row_title" bindtap="setTacitlyApprove">账户名</view>
-        <input class="login_row_input" type="number" placeholder="用户名" value="{{userName}}" bindinput="setUserName" />
+        <input class="login_row_input" type="text" placeholder="用户名" value="{{userName}}" bindinput="setUserName" />
     </view>
     <view class="login_row">
         <view class="login_row_title">手机号</view>
-        <input class="login_row_input" type="number" value="{{userTelephone}}" disabled />
+        <input class="login_row_input" type="text" value="{{userTelephone}}" disabled />
     </view>
     <view class="login_row">
         <view class="login_row_title" style="margin-left: -48rpx;">身份/职位</view>

+ 66 - 0
pages/group&product/change.js

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

+ 5 - 0
pages/group&product/change.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "My_group_new-change":"../../components/My_group_new-change/index"
+  }
+}

+ 1 - 0
pages/group&product/change.wxml

@@ -0,0 +1 @@
+<My_group_new-change></My_group_new-change>

+ 1 - 0
pages/group&product/change.wxss

@@ -0,0 +1 @@
+/* pages/group&product/change.wxss */

+ 66 - 0
pages/group&product/index.js

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

+ 6 - 0
pages/group&product/index.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+    "My_group_list": "../../components/My_group_list/index",
+    "My_product_list": "../../components/My_product_list/index"
+  }
+}

+ 1 - 0
pages/group&product/index.wxml

@@ -0,0 +1 @@
+<My_group_list></My_group_list>

+ 1 - 0
pages/group&product/index.wxss

@@ -0,0 +1 @@
+/* pages/group&product/index.wxss */

+ 8 - 4
pages/login/index.js

@@ -9,8 +9,8 @@ Page({
      */
     data: {
         pageType: 0, //页面类型,0登录,1新账号注册,2多账号
-        userTelephone: 13732579910, //电话号
-        securityCode: 123456, //验证码
+        userTelephone: 13357394366, //电话号
+        securityCode: null, //验证码
         userList: [], //多账户用户列表
     },
 
@@ -18,7 +18,12 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
-
+        //进入页面类型
+        if (options.type) {
+            this.setData({
+                pageType: options.type
+            })
+        }
     },
     /* 赋值号码 */
     inputTelephone(e) {
@@ -63,7 +68,6 @@ Page({
             "phonenumber": this.data.userTelephone,
             "password": utilMd5.hexMD5(this.data.securityCode)
         }).then(s => {
-            console.log(s)
             if (s.msg != "成功") return wx.showToast({
                 title: s.msg,
                 icon: 'none',

+ 1 - 1
pages/login/index.wxml

@@ -18,4 +18,4 @@
 <!-- 个人注册 -->
 <My_userRegister wx:elif="{{pageType==1}}" userTelephone="{{userTelephone}}"></My_userRegister>
 <!-- 多账号登录 -->
-<My_moreAccount wx:elif="{{pageType==2}}" userList="{{userList}}"></My_moreAccount>
+<My_moreAccount wx:elif="{{pageType==2}}"></My_moreAccount>

+ 1 - 0
pages/tabbarPage/ClientService/index.json

@@ -1,3 +1,4 @@
 {
+  "navigationStyle": "custom",
   "usingComponents": {}
 }

+ 3 - 0
pages/tabbarPage/ClientService/index.wxml

@@ -1,2 +1,5 @@
 <!--pages/tabbarPage/ClientService/index.wxml-->
+<!-- 自定义头部 -->
+<My_navBar></My_navBar>
+<!-- 主体 -->
 <text>ClientService</text>

+ 0 - 1
pages/tabbarPage/Home/index.js

@@ -52,7 +52,6 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad: function () {
-        console.log(getApp().globalData.accountList.token);
     },
 
     /**

+ 1 - 0
pages/tabbarPage/Home/index.json

@@ -1,4 +1,5 @@
 {
+  "navigationStyle": "custom",
   "usingComponents": {
     "My_inform_box":"../../../components/My_inform_box/index",
     "My_inform_item":"../../../components/My_inform_item/index",

+ 3 - 0
pages/tabbarPage/Home/index.wxml

@@ -1,4 +1,7 @@
 <!-- tabbar--Home -->
+<!-- 自定义头部 -->
+<My_navBar></My_navBar>
+<!-- 主体 -->
 <view style="padding-bottom:{{safeAreaBottom+140}}rpx;">
     <!-- 轮播图 -->
     <swiper class="home_banner" autoplay circular indicator-dots indicator-color="#CCCCCC" indicator-active-color="#FFFFFF">

+ 1 - 0
pages/tabbarPage/Message/index.json

@@ -1,3 +1,4 @@
 {
+  "navigationStyle": "custom",
   "usingComponents": {}
 }

+ 3 - 0
pages/tabbarPage/Message/index.wxml

@@ -1,2 +1,5 @@
 <!--pages/tabbarPage/Message/index.wxml-->
+<!-- 自定义头部 -->
+<My_navBar></My_navBar>
+<!-- 主体 -->
 <text>Message</text>

+ 1 - 0
pages/tabbarPage/Supply/index.json

@@ -1,3 +1,4 @@
 {
+  "navigationStyle": "custom",
   "usingComponents": {}
 }

+ 3 - 0
pages/tabbarPage/Supply/index.wxml

@@ -1,2 +1,5 @@
 <!--pages/tabbarPage/Supply/index.wxml-->
+<!-- 自定义头部 -->
+<My_navBar></My_navBar>
+<!-- 主体 -->
 <text>Supply</text>

+ 1 - 0
pages/tabbarPage/User/index.json

@@ -1,3 +1,4 @@
 {
+  "navigationStyle": "custom",
   "usingComponents": {}
 }

+ 4 - 1
pages/tabbarPage/User/index.wxml

@@ -1,8 +1,11 @@
+<!-- 自定义头部 -->
+<My_navBar></My_navBar>
+<!-- 主体 -->
 <!-- tabbar--个人 -->
 <view class="user_box">
   <!-- 用户头像 -->
   <view class="user_img">
-    <!-- <image></image> -->
+    <image src="{{userMsg.attinfos[0].fobsurl}}" mode="aspectFill"></image>
   </view>
   <!-- 用户文字信息 -->
   <view class="user_text" bindtap="toUserMsg">

+ 4 - 1
pages/tabbarPage/User/index.wxss

@@ -17,11 +17,14 @@
 .user_img {
     width: 160rpx;
     height: 100%;
-    background-color: aqua;
     border-radius: 50%;
     overflow: hidden;
     margin-left: 40rpx;
 }
+.user_img image{
+    width: 100%;
+    height: 100%;
+}
 
 /* 用户-文字 */
 .user_text {

+ 45 - 10
pages/userMessage/index.js

@@ -14,6 +14,7 @@ Page({
      * 页面的初始数据
      */
     data: {
+        fobsurl: {}, //头像
         fname: "", //用户名
         frole: "", //角色
         fphonenumber: "", //手机号
@@ -36,6 +37,7 @@ Page({
         /* 初始化数据 */
         const data = JSON.parse(options.data)
         this.setData({
+            fobsurl: data.attinfos[0],
             fname: data.fname,
             frole: data.frole,
             fsex: data.fsex,
@@ -75,19 +77,23 @@ Page({
                                 "filename": 'wx' + timestamp,
                                 "filetype": ext,
                                 "ownertable": "tenterprise_users",
-                                "ownerid": getApp().globalData.accountList[0].userid,
+                                "ownerid": getApp().globalData.accountList[wx.getStorageSync('userIndex')].userid,
                                 "ftype": "headportrait",
                             }
                         }).then(res => {
-                            const a1 = _Http.uploadFile(res, fileData);
-                            console.log(a1)
-                            /* .then(res => {
-                                if (res.msg != "成功") return;
-                                console.log(res)
-                            }).catch(err => {
-                                console.log(err)
-                            }) */
-
+                            /* 删除之前头像 */
+                            _Http.basic({
+                                "accesstoken": wx.getStorageSync('token'),
+                                "classname": "system.system.docManage",
+                                "method": "deleteDoc",
+                                "content": {
+                                    "ownertable": "tnotice",
+                                    "ownerid": that.data.fobsurl.ownerid,
+                                    "tattachmentid": that.data.fobsurl.tattachmentid
+                                }
+                            })
+                            /* 上次并查询头像 */
+                            that.uploadFile(res, fileData)
                         }).catch(err => {
                             console.log(err)
                         })
@@ -97,6 +103,35 @@ Page({
             }
         })
     },
+
+    uploadFile(res, data) {
+        var that = this
+        wx.request({
+            url: res.data.obsuploadurl,
+            method: "PUT",
+            data: data,
+            header: {
+                'content-type': 'application/octet-stream' // 默认值
+            },
+            success() {
+                _Http.basic({
+                    "accesstoken": wx.getStorageSync('token'),
+                    "classname": "system.system.docManage",
+                    "method": "uploadSuccsess",
+                    "content": {
+                        "obsfilename": res.data.obsfilename
+                    }
+                }).then(res => {
+                    that.setData({
+                        fobsurl: res.data[0]
+                    })
+                }).catch(err => {
+                    console.log(err)
+                })
+            }
+        })
+    },
+
     /* input必填项获取焦点 */
     inputEssentialFocus(e) {
         const {

+ 3 - 1
pages/userMessage/index.wxml

@@ -1,6 +1,8 @@
 <!-- 用户修改信息页面 -->
 <view class="head">
-  <view class="user_img"></view>
+  <view class="user_img">
+    <image src="{{fobsurl.fobsurl}}" mode="aspectFit"></image>
+  </view>
   <view class="change_img" bindtap="changeUserImg">修改头像</view>
 </view>
 <van-cell-group>

+ 5 - 1
pages/userMessage/index.wxss

@@ -11,10 +11,14 @@
     width: 140rpx;
     height: 140rpx;
     border-radius: 50%;
-    background-color: aqua;
     overflow: hidden;
     margin-left: 20rpx;
 }
+.user_img image{
+    width: 100%;
+    height: 100%;
+    border-radius: 50%;
+}
 .change_img{
     font-size: 32rpx;
     margin-right: 34rpx;

+ 1 - 2
pages/userPerfectMsg/index.wxml

@@ -1,7 +1,7 @@
 <!-- 新用户注册完善商户信息页面 -->
 <van-cell-group>
   <van-field model:value="{{ brandName }}" required clearable label="品牌名" placeholder="点击填写" input-align="right" size="large" bindfocus="isInputFocus" bindblur="isInputBlur" data-name="brandNameErrRed" error="{{ErrRed.brandNameErrRed&&!brandName}}" />
-  <!-- 自定义上logo -->
+  <!-- 自定义上logo -->
   <view class="logo_box">
     <view class="logo_con">
       <view class="logo_con_title">
@@ -29,5 +29,4 @@
 <view class="login_but">
   <van-button type="info" size="large" bindtap="setUserMsg">立即创建</van-button>
 </view>
-
 <view class="jumpOver" bindtap="toHomePage">跳过</view>

+ 10 - 4
project.private.config.json

@@ -43,14 +43,20 @@
                     "scene": null
                 },
                 {
-                    "name": "用户",
-                    "pathName": "pages/tabbarPage/User/index",
+                    "name": "商户注册",
+                    "pathName": "pages/userPerfectMsg/index",
                     "query": "",
                     "scene": null
                 },
                 {
-                    "name": "商户注册",
-                    "pathName": "pages/userPerfectMsg/index",
+                    "name": "团队&产品",
+                    "pathName": "pages/group&product/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "团队&产品修改",
+                    "pathName": "pages/group&product/change",
                     "query": "",
                     "scene": null
                 }

+ 0 - 23
utils/api.js

@@ -23,29 +23,6 @@ class ApiModel extends HTTP {
             data
         })
     }
-
-    /* 上传成功反馈 */
-    uploadFile(res, data) {
-        let that = this
-        wx.request({
-            url: res.data.obsuploadurl,
-            method: "PUT",
-            data: data,
-            header: {
-                'content-type': 'application/octet-stream' // 默认值
-            },
-            success() {
-                that.basic({
-                    "accesstoken": wx.getStorageSync('token'),
-                    "classname": "system.system.docManage",
-                    "method": "uploadSuccsess",
-                    "content": {
-                        "obsfilename": res.data.obsfilename
-                    }
-                })
-            }
-        })
-    }
 }
 export {
     ApiModel

+ 86 - 0
utils/uploadfile.js

@@ -0,0 +1,86 @@
+/* import {
+    ApiModel
+} from './api'
+const _Http = new ApiModel();
+
+class {
+    changeUserImg() {
+        wx.chooseMedia({
+            count: 1,
+            mediaType: ['image'],
+            sourceType: ['album', 'camera'],
+            camera: 'back',
+            success(res) {
+                const file = res.tempFiles[0];
+                var index = file.tempFilePath.lastIndexOf(".");
+                var ext = file.tempFilePath.substr(index + 1);
+                var timestamp = Date.parse(new Date());
+                wx.getFileSystemManager().readFile({
+                    filePath: file.tempFilePath,
+                    // encoding:'utf-8',
+                    success: result => {
+                        //返回临时文件路径
+                        const fileData = result.data
+                        _Http.basic({
+                            "accesstoken": wx.getStorageSync('token'),
+                            "classname": "system.system.docManage",
+                            "method": "getFileName",
+                            "content": {
+                                "filename": 'wx' + timestamp,
+                                "filetype": ext,
+                                "ownertable": "tenterprise_users",
+                                // "ownerid": getApp().globalData.accountList[0].userid,
+                                "ftype": "headportrait",
+                            }
+                        }).then(res => {
+                            // 删除之前头像
+                            _Http.basic({
+                                "accesstoken": wx.getStorageSync('token'),
+                                "classname": "system.system.docManage",
+                                "method": "deleteDoc",
+                                "content": {
+                                    "ownertable": "tnotice",
+                                    "ownerid": that.data.fobsurl.ownerid,
+                                    "tattachmentid": that.data.fobsurl.tattachmentid
+                                }
+                            })
+                            // 上次并查询头像
+                            that.uploadFile(res, fileData)
+                        }).catch(err => {
+                            console.log(err)
+                        })
+                    },
+                    fail: console.error
+                })
+            }
+        })
+    }
+
+    uploadFile(res, data) {
+        var that = this
+        wx.request({
+            url: res.data.obsuploadurl,
+            method: "PUT",
+            data: data,
+            header: {
+                'content-type': 'application/octet-stream' // 默认值
+            },
+            success() {
+                _Http.basic({
+                    "accesstoken": wx.getStorageSync('token'),
+                    "classname": "system.system.docManage",
+                    "method": "uploadSuccsess",
+                    "content": {
+                        "obsfilename": res.data.obsfilename
+                    }
+                }).then(res => {
+                    that.setData({
+                        fobsurl: res.data[0]
+                    })
+                }).catch(err => {
+                    console.log(err)
+                })
+            }
+        })
+    }
+} */