guhongwei 3 lat temu
rodzic
commit
70d18a8475

+ 1 - 1
app.json

@@ -1,9 +1,9 @@
 {
     "pages": [
         "pages/index/index",
-        "pages/home/index",
         "pages/login/index",
         "pages/login/agreement",
+        "pages/home/index",
         "pages/basic/index",
         "pages/user/index",
         "pages/user/detail",

+ 84 - 0
pages/user copy/detail.js

@@ -0,0 +1,84 @@
+// pages/login/login.js
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '基本信息', leftArrow: false, useBar: true },
+    // 主体高度
+    infoHeight: '',
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/home/index' })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // 计算高度
+    this.searchHeight()
+  },
+  // 计算高度
+  searchHeight: function () {
+    let frameStyle = this.data.frameStyle;
+    let client = app.globalData.client;
+    let infoHeight = client.windowHeight;
+    // 是否去掉状态栏
+    if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+    // 是否减去底部菜单
+    if (frameStyle.useBar) infoHeight = infoHeight - 50;
+    if (infoHeight) this.setData({ infoHeight: infoHeight })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 6 - 0
pages/user copy/detail.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "mobile-main": "/commpents/mobile-frame/mobile-main"
+  }
+}

+ 8 - 0
pages/user copy/detail.less

@@ -0,0 +1,8 @@
+.main {
+    position: relative;
+    width: 100%;
+
+    .one {
+        text-align: center; 
+    }
+}

+ 5 - 0
pages/user copy/detail.wxml

@@ -0,0 +1,5 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="main" style="height:{{infoHeight}}px;">
+        模板
+    </view>
+</mobile-main>

+ 7 - 0
pages/user copy/detail.wxss

@@ -0,0 +1,7 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+.main .one {
+  text-align: center;
+}

+ 106 - 0
pages/user copy/index.js

@@ -0,0 +1,106 @@
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '用户管理', leftArrow: false, useBar: true },
+    // 主体高度
+    infoHeight: '',
+    // 信息列表
+    list: [{ name: '测试人员', phone: '12345678901', email: '123456@qq.com' }],
+    // 弹框
+    dialog: { title: '详细信息', show: false, type: '1' },
+    // 详细信息
+    info: { name: '测试人员', phone: '12345678901', email: '123456@qq.com', address: '1', dept: '1', zw: '1', company: '1', type: '超级管理员' },
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/home/index' })
+  },
+  // 添加用户
+  toAdd: function () {
+    wx.navigateTo({ url: `/pages/user/detail` })
+  },
+  // 详细信息
+  toView: function (e) {
+    this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+  },
+  // 信息变更
+  toEdit: function (e) {
+  },
+  // 密码重置
+  toReset: function (e) {
+  },
+  // 刪除信息
+  toDel: function (e) {
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // 计算高度
+    this.searchHeight()
+  },
+  // 计算高度
+  searchHeight: function () {
+    let frameStyle = this.data.frameStyle;
+    let client = app.globalData.client;
+    let infoHeight = client.windowHeight;
+    // 是否去掉状态栏
+    if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+    // 是否减去底部菜单
+    if (frameStyle.useBar) infoHeight = infoHeight - 50;
+    if (infoHeight) this.setData({ infoHeight: infoHeight })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 6 - 0
pages/user copy/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "mobile-main": "/commpents/mobile-frame/mobile-main"
+  }
+}

+ 82 - 0
pages/user copy/index.less

@@ -0,0 +1,82 @@
+.main {
+    position: relative;
+    width: 100%;
+
+    .one {
+        position: relative;
+        width: 100%;
+        text-align: center;
+        border-bottom: 1px dashed #000000;
+    }
+
+    .one button {
+        margin: 10px;
+    }
+
+    .two {
+        position: relative;
+        padding: 10px;
+
+        .list {
+            float: left;
+            width: 100%;
+            margin: 0 0 8px 0;
+            background-color: #f9f9f9;
+            border-radius: 5px;
+            padding: 8px 0;
+
+            .name {
+                font-size: 16px;
+                margin: 0 0 5px 0;
+                padding: 0 10px;
+            }
+
+            .other {
+                .otherInfo {
+                    margin: 0 0 5px 0;
+                    font-size: 14px;
+                    color: #666666;
+                    padding: 0 10px;
+                }
+
+                .otherInfo text {
+                    color: #000000;
+                }
+            }
+
+            .btn {
+                text-align: center;
+            }
+
+            .btn button {
+                margin: 0 5px;
+            }
+        }
+    }
+}
+
+.dialog {
+    min-height: 30px;
+    max-height: 320px;
+    overflow-y: auto;
+    padding: 0 8px;
+
+    .content {
+        position: relative;
+        padding: 8px 0;
+        border-radius: 6px;
+        margin: 0 0 5px 0;
+        background-color: #f1f1f1;
+        .left {
+            float: left;
+            margin: 0 10px;
+          }
+          .left text {
+            font-size: 14px;
+            color: #666666;
+          }
+          .right input {
+            font-size: 12px;
+          }
+    }
+}

+ 58 - 0
pages/user copy/index.wxml

@@ -0,0 +1,58 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="main" style="height:{{infoHeight}}px;">
+        <view class="one">
+            <button type="primary" size="mini" bindtap="toAdd">添加用户</button>
+        </view>
+        <view class="two">
+            <view class="list" wx:key="item" wx:for="{{list}}">
+                <view class="name">{{item.name}}</view>
+                <view class="other">
+                    <view class="otherInfo">联系电话:<text>{{item.phone||'暂无' }}</text></view>
+                    <view class="otherInfo textOver">电子邮箱:<text>{{item.email||'暂无' }}</text></view>
+                </view>
+                <view class="btn">
+                    <button type="info" size="mini" bindtap="toView">详细信息</button>
+                    <button type="info" size="mini" bindtap="toEdit">信息变更</button>
+                    <button type="primary" size="mini" bindtap="toReset">密码重置</button>
+                    <button type="warn" size="mini" bindtap="toDel">删除信息</button>
+                </view>
+            </view>
+        </view>
+    </view>
+</mobile-main>
+<van-dialog use-slot title="{{dialog.title}}" show="{{ dialog.show }}" confirmButtonText="返回">
+    <view class="dialog">
+        <view class="content">
+            <view class="left"><text>姓名:</text></view>
+            <view class="right"><input name="name" value="{{info.name}}" disabled></input></view>
+        </view>
+        <view class="content">
+            <view class="left"><text>电话:</text></view>
+            <view class="right"><input name="phone" value="{{info.phone}}" disabled></input></view>
+        </view>
+        <view class="content">
+            <view class="left"><text>电子邮箱:</text></view>
+            <view class="right"><input name="email" value="{{info.email}}" disabled></input></view>
+        </view>
+        <view class="content">
+            <view class="left"><text>联系地址:</text></view>
+            <view class="right"><input name="address" value="{{info.address}}" disabled></input></view>
+        </view>
+        <view class="content">
+            <view class="left"><text>部门:</text></view>
+            <view class="right"><input name="dept" value="{{info.dept}}" disabled></input></view>
+        </view>
+        <view class="content">
+            <view class="left"><text>职务:</text></view>
+            <view class="right"><input name="zw" value="{{info.zw}}" disabled></input></view>
+        </view>
+        <view class="content">
+            <view class="left"><text>工作单位:</text></view>
+            <view class="right"><input name="company" value="{{info.company}}" disabled></input></view>
+        </view>
+        <view class="content">
+            <view class="left"><text>用户类型:</text></view>
+            <view class="right"><input name="type" value="{{info.type}}" disabled></input></view>
+        </view>
+    </view>
+</van-dialog>

+ 69 - 0
pages/user copy/index.wxss

@@ -0,0 +1,69 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+.main .one {
+  position: relative;
+  width: 100%;
+  text-align: center;
+  border-bottom: 1px dashed #000000;
+}
+.main .one button {
+  margin: 10px;
+}
+.main .two {
+  position: relative;
+  padding: 10px;
+}
+.main .two .list {
+  float: left;
+  width: 100%;
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+}
+.main .two .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.main .two .list .other .otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.main .two .list .other .otherInfo text {
+  color: #000000;
+}
+.main .two .list .btn {
+  text-align: center;
+}
+.main .two .list .btn button {
+  margin: 0 5px;
+}
+.dialog {
+  min-height: 30px;
+  max-height: 320px;
+  overflow-y: auto;
+  padding: 0 8px;
+}
+.dialog .content {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .content .left {
+  float: left;
+  margin: 0 10px;
+}
+.dialog .content .left text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .content .right input {
+  font-size: 12px;
+}

+ 2 - 21
pages/user/index.js

@@ -7,35 +7,16 @@ Page({
    * 页面的初始数据
    */
   data: {
-    frameStyle: { useTop: true, name: '用户管理', leftArrow: false, useBar: true },
+    frameStyle: { useTop: true, name: '用户管理', leftArrow: true, useBar: false },
     // 主体高度
     infoHeight: '',
-    // 信息列表
-    list: [{ name: '测试人员', phone: '12345678901', email: '123456@qq.com' }],
-    // 弹框
-    dialog: { title: '详细信息', show: false, type: '1' },
-    // 详细信息
-    info: { name: '测试人员', phone: '12345678901', email: '123456@qq.com', address: '1', dept: '1', zw: '1', company: '1', type: '超级管理员' },
   },
   back: function () {
     wx.navigateBack({ url: '/pages/home/index' })
   },
   // 添加用户
   toAdd: function () {
-    wx.navigateTo({ url: `/pages/user/detail` })
-  },
-  // 详细信息
-  toView: function (e) {
-    this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
-  },
-  // 信息变更
-  toEdit: function (e) {
-  },
-  // 密码重置
-  toReset: function (e) {
-  },
-  // 刪除信息
-  toDel: function (e) {
+    console.log('1');
   },
   /**
    * 生命周期函数--监听页面加载

+ 0 - 78
pages/user/index.less

@@ -1,82 +1,4 @@
 .main {
     position: relative;
     width: 100%;
-
-    .one {
-        position: relative;
-        width: 100%;
-        text-align: center;
-        border-bottom: 1px dashed #000000;
-    }
-
-    .one button {
-        margin: 10px;
-    }
-
-    .two {
-        position: relative;
-        padding: 10px;
-
-        .list {
-            float: left;
-            width: 100%;
-            margin: 0 0 8px 0;
-            background-color: #f9f9f9;
-            border-radius: 5px;
-            padding: 8px 0;
-
-            .name {
-                font-size: 16px;
-                margin: 0 0 5px 0;
-                padding: 0 10px;
-            }
-
-            .other {
-                .otherInfo {
-                    margin: 0 0 5px 0;
-                    font-size: 14px;
-                    color: #666666;
-                    padding: 0 10px;
-                }
-
-                .otherInfo text {
-                    color: #000000;
-                }
-            }
-
-            .btn {
-                text-align: center;
-            }
-
-            .btn button {
-                margin: 0 5px;
-            }
-        }
-    }
-}
-
-.dialog {
-    min-height: 30px;
-    max-height: 320px;
-    overflow-y: auto;
-    padding: 0 8px;
-
-    .content {
-        position: relative;
-        padding: 8px 0;
-        border-radius: 6px;
-        margin: 0 0 5px 0;
-        background-color: #f1f1f1;
-        .left {
-            float: left;
-            margin: 0 10px;
-          }
-          .left text {
-            font-size: 14px;
-            color: #666666;
-          }
-          .right input {
-            font-size: 12px;
-          }
-    }
 }

+ 2 - 50
pages/user/index.wxml

@@ -4,55 +4,7 @@
             <button type="primary" size="mini" bindtap="toAdd">添加用户</button>
         </view>
         <view class="two">
-            <view class="list" wx:key="item" wx:for="{{list}}">
-                <view class="name">{{item.name}}</view>
-                <view class="other">
-                    <view class="otherInfo">联系电话:<text>{{item.phone||'暂无' }}</text></view>
-                    <view class="otherInfo textOver">电子邮箱:<text>{{item.email||'暂无' }}</text></view>
-                </view>
-                <view class="btn">
-                    <button type="info" size="mini" bindtap="toView">详细信息</button>
-                    <button type="info" size="mini" bindtap="toEdit">信息变更</button>
-                    <button type="primary" size="mini" bindtap="toReset">密码重置</button>
-                    <button type="warn" size="mini" bindtap="toDel">删除信息</button>
-                </view>
-            </view>
+            测试
         </view>
     </view>
-</mobile-main>
-<van-dialog use-slot title="{{dialog.title}}" show="{{ dialog.show }}" confirmButtonText="返回">
-    <view class="dialog">
-        <view class="content">
-            <view class="left"><text>姓名:</text></view>
-            <view class="right"><input name="name" value="{{info.name}}" disabled></input></view>
-        </view>
-        <view class="content">
-            <view class="left"><text>电话:</text></view>
-            <view class="right"><input name="phone" value="{{info.phone}}" disabled></input></view>
-        </view>
-        <view class="content">
-            <view class="left"><text>电子邮箱:</text></view>
-            <view class="right"><input name="email" value="{{info.email}}" disabled></input></view>
-        </view>
-        <view class="content">
-            <view class="left"><text>联系地址:</text></view>
-            <view class="right"><input name="address" value="{{info.address}}" disabled></input></view>
-        </view>
-        <view class="content">
-            <view class="left"><text>部门:</text></view>
-            <view class="right"><input name="dept" value="{{info.dept}}" disabled></input></view>
-        </view>
-        <view class="content">
-            <view class="left"><text>职务:</text></view>
-            <view class="right"><input name="zw" value="{{info.zw}}" disabled></input></view>
-        </view>
-        <view class="content">
-            <view class="left"><text>工作单位:</text></view>
-            <view class="right"><input name="company" value="{{info.company}}" disabled></input></view>
-        </view>
-        <view class="content">
-            <view class="left"><text>用户类型:</text></view>
-            <view class="right"><input name="type" value="{{info.type}}" disabled></input></view>
-        </view>
-    </view>
-</van-dialog>
+</mobile-main>

+ 0 - 65
pages/user/index.wxss

@@ -2,68 +2,3 @@
   position: relative;
   width: 100%;
 }
-.main .one {
-  position: relative;
-  width: 100%;
-  text-align: center;
-  border-bottom: 1px dashed #000000;
-}
-.main .one button {
-  margin: 10px;
-}
-.main .two {
-  position: relative;
-  padding: 10px;
-}
-.main .two .list {
-  float: left;
-  width: 100%;
-  margin: 0 0 8px 0;
-  background-color: #f9f9f9;
-  border-radius: 5px;
-  padding: 8px 0;
-}
-.main .two .list .name {
-  font-size: 16px;
-  margin: 0 0 5px 0;
-  padding: 0 10px;
-}
-.main .two .list .other .otherInfo {
-  margin: 0 0 5px 0;
-  font-size: 14px;
-  color: #666666;
-  padding: 0 10px;
-}
-.main .two .list .other .otherInfo text {
-  color: #000000;
-}
-.main .two .list .btn {
-  text-align: center;
-}
-.main .two .list .btn button {
-  margin: 0 5px;
-}
-.dialog {
-  min-height: 30px;
-  max-height: 320px;
-  overflow-y: auto;
-  padding: 0 8px;
-}
-.dialog .content {
-  position: relative;
-  padding: 8px 0;
-  border-radius: 6px;
-  margin: 0 0 5px 0;
-  background-color: #f1f1f1;
-}
-.dialog .content .left {
-  float: left;
-  margin: 0 10px;
-}
-.dialog .content .left text {
-  font-size: 14px;
-  color: #666666;
-}
-.dialog .content .right input {
-  font-size: 12px;
-}