guhongwei 3 роки тому
батько
коміт
8807a62177

+ 2 - 2
app.js

@@ -1,6 +1,6 @@
-import login from './utils/login'
+import login from './utils/login';
 import * as httpUtil from "./utils/httpUtil";
-const app = getApp()
+const app = getApp();
 App({
   onLaunch() {
     // 展示本地存储能力

+ 9 - 1
app.json

@@ -1,10 +1,18 @@
 {
   "pages": [
-    "pages/login/index",
     "pages/home/index",
+    "pages/login/index",
     "pages/county/index",
     "pages/county/detail",
+    "pages/user/index",
+    "pages/user/detail",
+    "pages/merchant/index",
+    "pages/merchant/detail",
+    "pages/merchant/seat",
+    "pages/inspect/index",
     "pages/password/index",
+    "pages/market/index",
+    "pages/market/detail",
     "pages/test/index",
     "pages/index/index"
   ],

+ 1 - 1
commpents/mobile-frame/foot.js

@@ -6,7 +6,7 @@ Component({
    */
   options: { multipleSlots: true },
   properties: {
-    tabSelectid: { type: 'string' }
+    tabSelectid: { type: 'string', value: '' }
   },
 
   // 生命周期函数,可以为函数,或一个在methods段中定义的方法名

+ 36 - 4
icon/icon.wxss

@@ -1,9 +1,9 @@
 @font-face {
   font-family: "iconfont";
   /* Project id 3094003 */
-  src: url('//at.alicdn.com/t/font_3094003_z3j0v2jnnuj.woff2?t=1640770192881') format('woff2'),
-    url('//at.alicdn.com/t/font_3094003_z3j0v2jnnuj.woff?t=1640770192881') format('woff'),
-    url('//at.alicdn.com/t/font_3094003_z3j0v2jnnuj.ttf?t=1640770192881') format('truetype');
+  src: url('//at.alicdn.com/t/font_3094003_4ko0jkq0zdj.woff2?t=1640857019614') format('woff2'),
+    url('//at.alicdn.com/t/font_3094003_4ko0jkq0zdj.woff?t=1640857019614') format('woff'),
+    url('//at.alicdn.com/t/font_3094003_4ko0jkq0zdj.ttf?t=1640857019614') format('truetype');
 }
 
 .iconfont {
@@ -14,6 +14,38 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-name:before {
+  content: "\e6b4";
+}
+
+.icon-jianjie:before {
+  content: "\e617";
+}
+
+.icon-bianhao:before {
+  content: "\e635";
+}
+
+.icon-shouye:before {
+  content: "\e621";
+}
+
+.icon-shangpinxinxi:before {
+  content: "\e691";
+}
+
+.icon-shanghuguanli:before {
+  content: "\e61d";
+}
+
+.icon-zhiwu:before {
+  content: "\e601";
+}
+
+.icon-kuaibananjian:before {
+  content: "\e61e";
+}
+
 .icon-dianhua:before {
   content: "\e8ad";
 }
@@ -64,4 +96,4 @@
 
 .icon-shenfenleibie:before {
   content: "\e64c";
-}
+}

Різницю між файлами не показано, бо вона завелика
+ 31 - 0
libs/amap-wx.js


+ 6 - 0
pages/county/index.js

@@ -50,6 +50,12 @@ Page({
     console.log(id);
     wx.showToast({ title: `微信解绑成功`, icon: 'success', duration: 2000 })
   },
+  // 账号注销
+  toCancel: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    wx.showToast({ title: `账号注销成功`, icon: 'success', duration: 2000 })
+  },
   /**
    * 生命周期函数--监听页面加载
    */

+ 4 - 2
pages/county/index.wxml

@@ -13,8 +13,10 @@
         <view class="btn">
           <button type="info" size="mini" bindtap="toView" data-id="{{item.id}}">详细信息</button>
           <button type="info" size="mini" bindtap="toEdit" data-id="{{item.id}}">信息变更</button>
-          <button type="warn" size="mini" bindtap="toReset" data-id="{{item.id}}">密码重置</button>
-          <button type="warn" size="mini" bindtap="toUnbound" data-id="{{item.id}}">微信解绑</button>
+          <button type="primary" size="mini" bindtap="toReset" data-id="{{item.id}}">密码重置</button>
+          <button type="primary" size="mini" bindtap="toUnbound" data-id="{{item.id}}">微信解绑</button>
+          <button type="warn" size="mini" bindtap="toCancel" data-id="{{item.id}}">账号注销</button>
+
         </view>
       </view>
     </view>

+ 4 - 0
pages/home/index.js

@@ -14,6 +14,10 @@ Page({
     userInfo: {},
     routerList: [
       { icon: 'icon-quxiantongxunlu', title: '区县人员', router: 'county' },
+      { icon: 'icon-kuaibananjian', title: '办案人员', router: 'user' },
+      { icon: 'icon-shanghuguanli', title: '商户信息', router: 'merchant' },
+      { icon: 'icon-shouye', title: '检查历史', router: 'inspect' },
+      { icon: 'icon-shangpinxinxi', title: '商品信息', router: 'market' },
       { icon: 'icon-bangdingweixin', title: '绑定微信', router: '', is_routine: '1' },
       { icon: 'icon-xiugaimima', title: '修改密码', router: 'password', },
       { icon: 'icon-tuichudenglu', title: '退出登录', router: 'login' },

+ 83 - 0
pages/inspect/index.js

@@ -0,0 +1,83 @@
+// pages/login/login.js
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '检查历史', leftArrow: true, useBar: false },
+    // 主体高度
+    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 - (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/inspect/index.json

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

+ 5 - 0
pages/inspect/index.wxml

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

+ 4 - 0
pages/inspect/index.wxss

@@ -0,0 +1,4 @@
+.main {
+  position: relative;
+  width: 100%;
+}

+ 115 - 0
pages/market/detail.js

@@ -0,0 +1,115 @@
+// pages/login/login.js
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '信息管理', leftArrow: true, useBar: false },
+    // 主体高度
+    infoHeight: '',
+    form: {},
+  },
+  initValidate() {
+    const rules = { number: { required: true }, name: { required: true }, brief: { required: true } }
+    // 验证字段的提示信息,若不传则调用默认的信息
+    const messages = { number: { required: '请输入编号', }, name: { required: '请输入商品名称', }, brief: { required: '请输入简介', } };
+    this.WxValidate = new WxValidate(rules, messages)
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/market/index' })
+  },
+  // 取消保存
+  onReset: function (e) {
+    this.back()
+  },
+  // 提交保存
+  onSubmit: function (e) {
+    const params = e.detail.value;
+    if (!this.WxValidate.checkForm(params)) {
+      const error = this.WxValidate.errorList[0];
+      wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+      return false
+    } else {
+      console.log(params);
+      wx.showToast({ title: `创建信息成功`, icon: 'success', duration: 2000 })
+    }
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    //验证规则函数
+    this.initValidate()
+    const { id } = options;
+    // 查询信息
+    if (id) this.search(id);
+    // 计算高度
+    this.searchHeight()
+  },
+  // 查询信息
+  search: function (id) {
+    console.log(id);
+  },
+  // 计算高度
+  searchHeight: function () {
+    let frameStyle = this.data.frameStyle;
+    let client = app.globalData.client;
+    // 减去状态栏
+    let infoHeight = client.windowHeight - (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/market/detail.json

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

+ 36 - 0
pages/market/detail.wxml

@@ -0,0 +1,36 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+  <view slot="info" class="main" style="height:{{infoHeight}}px;">
+    <view class="one">
+      <form bindsubmit="onSubmit" catchreset="onReset">
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-bianhao"></text>
+          </view>
+          <view class="right">
+            <input name="number" value="{{form.number}}" placeholder='请输入编号' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-name"></text>
+          </view>
+          <view class="right">
+            <input name="name" value="{{form.name}}" placeholder='请输入商品名称' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-jianjie"></text>
+          </view>
+          <view class="right">
+            <input name="brief" value="{{form.brief}}" placeholder='请输入简介' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="save">
+          <button type="warn" size="mini" formType="reset">取消保存</button>
+          <button type="primary" size="mini" formType="submit">提交保存</button>
+        </view>
+      </form>
+    </view>
+  </view>
+</mobile-main>

+ 38 - 0
pages/market/detail.wxss

@@ -0,0 +1,38 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+
+.main .one {
+  position: relative;
+  padding: 10px;
+}
+
+.main .one .content {
+  position: relative;
+  padding: 10px 0;
+  box-shadow: 0 0 5px #000000;
+  margin: 0 0 10px 0;
+  border-radius: 5px;
+}
+
+.main .one .content .left {
+  float: left;
+  margin: 0 10px;
+}
+
+.main .one .content .left .icon {
+  color: #000000;
+}
+
+.main .one .content .right input {
+  color: #000000;
+}
+
+.main .one .save {
+  text-align: center;
+}
+
+.main .one .save button {
+  margin: 10px;
+}

+ 121 - 0
pages/market/index.js

@@ -0,0 +1,121 @@
+// pages/login/login.js
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '商品信息', leftArrow: true, useBar: false },
+    // 主体高度
+    infoHeight: '',
+    // 商品信息
+    list: [
+      { id: '1', name: '测试商品1', number: '1', },
+      { id: '2', name: '测试商品2', number: '2', },
+    ],
+    // 弹框
+    dialog: { title: '详细信息', show: false, type: '1' },
+    // 详细信息
+    info: { id: '2', name: '测试商品2', number: '2', },
+    bnrUrl: [
+      {
+        "url": "/image/background.jpg"
+      },
+      {
+        "url": "/image/background.jpg"
+      },
+    ]
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/home/index' })
+  },
+  // 添加商品
+  toAdd: function () {
+    wx.navigateTo({ url: `/pages/market/detail` })
+  },
+  // 详细信息
+  toView: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    // this.setData({ info: {} })
+    this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+  },
+  // 信息变更
+  toEdit: function (e) {
+    const { id } = e.currentTarget.dataset;
+    wx.navigateTo({ url: `/pages/market/detail?id=${id}` })
+  },
+  // 账号注销
+  toCancel: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    wx.showToast({ title: `商品注销成功`, icon: 'success', duration: 2000 })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // 计算高度
+    this.searchHeight()
+  },
+  // 计算高度
+  searchHeight: function () {
+    let frameStyle = this.data.frameStyle;
+    let client = app.globalData.client;
+    // 减去状态栏
+    let infoHeight = client.windowHeight - (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/market/index.json

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

+ 49 - 0
pages/market/index.wxml

@@ -0,0 +1,49 @@
+<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.number||'暂无' }}</text></view>
+        </view>
+        <view class="btn">
+          <button type="info" size="mini" bindtap="toView" data-id="{{item.id}}">详细信息</button>
+          <button type="info" size="mini" bindtap="toEdit" data-id="{{item.id}}">信息变更</button>
+          <button type="warn" size="mini" bindtap="toCancel" data-id="{{item.id}}">商品注销</button>
+        </view>
+      </view>
+    </view>
+  </view>
+</mobile-main>
+<van-dialog use-slot title="{{dialog.title}}" show="{{ dialog.show }}" confirmButtonText="返回">
+  <view class="dialog">
+    <view wx:if="{{dialog.type=='1'}}" class="dialog_1">
+      <form>
+        <view class="content">
+          <view class="left"><text>编号:</text></view>
+          <view class="right"><input name="number" value="{{info.number}}" disabled></input></view>
+        </view>
+        <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="brief" value="{{info.brief}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <swiper indicator-dots='true' autoplay='true' interval='2000' duration='1000' circular='true'>
+            <block wx:for="{{bnrUrl}}" wx:key="item">
+              <swiper-item>
+                <image src='{{item.url}}' mode='aspectFill'></image>
+              </swiper-item>
+            </block>
+          </swiper>
+        </view>
+      </form>
+    </view>
+  </view>
+</van-dialog>

+ 88 - 0
pages/market/index.wxss

@@ -0,0 +1,88 @@
+.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 .dialog_1 .content {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+
+.dialog .dialog_1 .content .left {
+  float: left;
+  margin: 0 10px;
+}
+
+.dialog .dialog_1 .content .left text {
+  font-size: 14px;
+  color: #666666;
+}
+
+.dialog .dialog_1 .content .right input {
+  font-size: 12px;
+}
+
+.van-dialog__header {
+  padding-top: 0 !important;
+  padding: 10px 0 !important;
+}

+ 128 - 0
pages/merchant/detail.js

@@ -0,0 +1,128 @@
+// pages/login/login.js
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '信息管理', leftArrow: true, useBar: false },
+    // 主体高度
+    infoHeight: '',
+    form: {},
+    // 县区列表
+    countyList: [
+      { id: '12', name: '测试区县1' },
+      { id: '34', name: '测试区县2' },
+
+    ]
+  },
+  initValidate() {
+    const rules = { name: { required: true, }, phone: { required: true }, email: { required: true }, address: { required: true, } }
+    // 验证字段的提示信息,若不传则调用默认的信息
+    const messages = { name: { required: '请输入姓名', }, phone: { required: '请输入联系电话', }, email: { required: '请输入电子邮箱', }, address: { required: '请输入联系地址', } };
+    this.WxValidate = new WxValidate(rules, messages)
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/merchant/index' })
+  },
+  // 选择区县
+  countyChange: function (e) {
+    let { value } = e.detail;
+    let data = this.data.countyList[value];
+    this.setData({ 'form.county_id': data.id })
+    this.setData({ 'form.county_name': data.name })
+  },
+  // 取消保存
+  onReset: function (e) {
+    this.back()
+  },
+  // 提交保存
+  onSubmit: function (e) {
+    const params = e.detail.value;
+    if (!this.WxValidate.checkForm(params)) {
+      const error = this.WxValidate.errorList[0];
+      wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+      return false
+    } else {
+      console.log(params);
+      wx.showToast({ title: `创建信息成功`, icon: 'success', duration: 2000 })
+    }
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    //验证规则函数
+    this.initValidate()
+    const { id } = options;
+    // 查询信息
+    if (id) this.search(id);
+    // 计算高度
+    this.searchHeight()
+  },
+  // 查询信息
+  search: function (id) {
+    console.log(id);
+  },
+  // 计算高度
+  searchHeight: function () {
+    let frameStyle = this.data.frameStyle;
+    let client = app.globalData.client;
+    // 减去状态栏
+    let infoHeight = client.windowHeight - (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/merchant/detail.json

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

+ 62 - 0
pages/merchant/detail.wxml

@@ -0,0 +1,62 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+  <view slot="info" class="main" style="height:{{infoHeight}}px;">
+    <view class="one">
+      <form bindsubmit="onSubmit" catchreset="onReset">
+        <view class="content" style="display: none;">
+          <view class="left">
+            <text class="icon iconfont icon-quxiantongxunlu"></text>
+          </view>
+          <view class="right">
+            <input name="county_id" value="{{form.county_id}}" disabled></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-quxiantongxunlu"></text>
+          </view>
+          <view class="right">
+            <picker class="picker" bindchange="countyChange" name="county_name" value="{{form.county_name}}" range="{{countyList}}" range-key="name">
+              <view>{{form.county_name||'选择所属区县'}}</view>
+            </picker>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-xingming"></text>
+          </view>
+          <view class="right">
+            <input name="name" value="{{form.name}}" placeholder='请输入姓名' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-dianhua"></text>
+          </view>
+          <view class="right">
+            <input type='number' name="phone" value="{{form.phone}}" maxlength="11" placeholder='请输入联系电话' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-dianziyouxiang1"></text>
+          </view>
+          <view class="right">
+            <input name="email" value="{{form.email}}" placeholder='请输入电子邮箱' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-dizhi"></text>
+          </view>
+          <view class="right">
+            <input name="address" value="{{form.address}}" placeholder='请输入联系地址' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="save">
+          <button type="warn" size="mini" formType="reset">取消保存</button>
+          <button type="primary" size="mini" formType="submit">提交保存</button>
+        </view>
+      </form>
+    </view>
+  </view>
+</mobile-main>

+ 38 - 0
pages/merchant/detail.wxss

@@ -0,0 +1,38 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+
+.main .one {
+  position: relative;
+  padding: 10px;
+}
+
+.main .one .content {
+  position: relative;
+  padding: 10px 0;
+  box-shadow: 0 0 5px #000000;
+  margin: 0 0 10px 0;
+  border-radius: 5px;
+}
+
+.main .one .content .left {
+  float: left;
+  margin: 0 10px;
+}
+
+.main .one .content .left .icon {
+  color: #000000;
+}
+
+.main .one .content .right input {
+  color: #000000;
+}
+
+.main .one .save {
+  text-align: center;
+}
+
+.main .one .save button {
+  margin: 10px;
+}

+ 130 - 0
pages/merchant/index.js

@@ -0,0 +1,130 @@
+// pages/login/login.js
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '商户人员', leftArrow: true, useBar: false },
+    // 主体高度
+    infoHeight: '',
+    // 区县人员
+    list: [
+      { id: '1', name: '测试商户1', phone: '13174420325', address: '吉林省长春市', status: '0' },
+      { id: '2', name: '测试商户2', phone: '13174420325', address: '吉林省长春市', status: '0' },
+    ],
+    // 弹框
+    dialog: { title: '详细信息', show: false, type: '1' },
+    // 详细信息
+    info: { id: '2', name: '测试商户2', phone: '13174420325', address: '吉林省长春市', status: '0' },
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/home/index' })
+  },
+  // 添加人员
+  toAdd: function () {
+    wx.navigateTo({ url: `/pages/merchant/detail` })
+  },
+  // 详细信息
+  toView: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    // this.setData({ info: {} })
+    this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+  },
+  // 信息变更
+  toEdit: function (e) {
+    const { id } = e.currentTarget.dataset;
+    wx.navigateTo({ url: `/pages/merchant/detail?id=${id}` })
+  },
+  // 县区登记审批
+  toCheck: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    wx.showToast({ title: `县区登记审批`, icon: 'success', duration: 2000 })
+  },
+  // 位置信息登记
+  toSeat: function (e) {
+    const { id } = e.currentTarget.dataset;
+    wx.navigateTo({ url: `/pages/merchant/seat?id=${id}` })
+  },
+  // 检查信息登记
+  toInspect: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    wx.showToast({ title: `检查信息登记`, icon: 'success', duration: 2000 })
+  },
+  // 账号注销
+  toCancel: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    wx.showToast({ title: `商户注销成功`, icon: 'success', duration: 2000 })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // 计算高度
+    this.searchHeight()
+  },
+  // 计算高度
+  searchHeight: function () {
+    let frameStyle = this.data.frameStyle;
+    let client = app.globalData.client;
+    // 减去状态栏
+    let infoHeight = client.windowHeight - (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/merchant/index.json

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

+ 61 - 0
pages/merchant/index.wxml

@@ -0,0 +1,61 @@
+<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.address||'暂无' }}</text></view>
+          <view class="otherInfo textOver">审批状态:<text>{{item.status||'暂无' }}</text></view>
+        </view>
+        <view class="btn">
+          <button type="info" size="mini" bindtap="toView" data-id="{{item.id}}">详细信息</button>
+          <button type="info" size="mini" bindtap="toEdit" data-id="{{item.id}}">信息变更</button>
+          <button type="info" size="mini" bindtap="toCheck" data-id="{{item.id}}">县区登记审批</button>
+          <button type="info" size="mini" bindtap="toSeat" data-id="{{item.id}}">位置信息登记</button>
+          <button type="info" size="mini" bindtap="toInspect" data-id="{{item.id}}">检查信息登记</button>
+          <button type="warn" size="mini" bindtap="toCancel" data-id="{{item.id}}">商户注销</button>
+        </view>
+      </view>
+    </view>
+  </view>
+</mobile-main>
+<van-dialog use-slot title="{{dialog.title}}" show="{{ dialog.show }}" confirmButtonText="返回">
+  <view class="dialog">
+    <view wx:if="{{dialog.type=='1'}}" class="dialog_1">
+      <form>
+        <view class="content">
+          <view class="left"><text>所属区县名称:</text></view>
+          <view class="right"><input name="county_name" value="{{info.county_name||'暂无'}}" disabled></input></view>
+        </view>
+        <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="longitude" value="{{info.longitude||'暂无'}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>维度:</text></view>
+          <view class="right"><input name="latitude" value="{{info.latitude||'暂无'}}" disabled></input></view>
+        </view>
+      </form>
+    </view>
+  </view>
+</van-dialog>

+ 88 - 0
pages/merchant/index.wxss

@@ -0,0 +1,88 @@
+.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 .dialog_1 .content {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+
+.dialog .dialog_1 .content .left {
+  float: left;
+  margin: 0 0 0 10px;
+}
+
+.dialog .dialog_1 .content .left text {
+  font-size: 14px;
+  color: #666666;
+}
+
+.dialog .dialog_1 .content .right input {
+  font-size: 12px;
+}
+
+.van-dialog__header {
+  padding-top: 0 !important;
+  padding: 10px 0 !important;
+}

+ 129 - 0
pages/merchant/seat.js

@@ -0,0 +1,129 @@
+// pages/login/login.js
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '位置信息登记', leftArrow: true, useBar: false },
+    // 主体高度
+    infoHeight: '',
+    // 查询
+    form: {},
+    // 地图
+    key: 'AFMBZ-7LJC6-TKWSZ-E232O-TUK7K-TIBPU',
+    markers: [],
+    positionInfo: { longitude: 126.414274, latitude: 41.944132 }
+  },
+  initValidate() {
+    const rules = { boundary: { required: true, }, keyword: { required: true } }
+    // 验证字段的提示信息,若不传则调用默认的信息
+    const messages = { boundary: { required: '请输入城市名称', }, keyword: { required: '请输入关键词', } };
+    this.WxValidate = new WxValidate(rules, messages)
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/merchant/index' })
+  },
+  // 查询数据
+  onSubmit: function (e) {
+    const params = e.detail.value;
+    if (!this.WxValidate.checkForm(params)) {
+      const error = this.WxValidate.errorList[0];
+      wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+      return false
+    } else {
+      wx.serviceMarket.invokeService({
+        service: 'wxc1c68623b7bdea7b',
+        api: 'poiSearch',
+        data: { "boundary": `region(${params.boundary})`, "keyword": params.keyword, page_size: 20 },
+      }).then(res => {
+        const markers = res.data.data.map((i) => ({ title: i.title, longitude: i.location.lng, latitude: i.location.lat }))
+        if (markers) this.setData({ markers: markers })
+        if (markers) this.setData({ positionInfo: markers[0] })
+      }).catch(err => {
+        console.log(err);
+      })
+    }
+  },
+  // 选点
+  toOne: function (e) {
+    const data = e.detail;
+    this.setData({ positionInfo: data })
+    this.setData({ markers: [data] })
+  },
+  // 确认选点
+  toCheck: function () {
+    let data = this.data.positionInfo;
+    console.log(data);
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    //验证规则函数
+    this.initValidate()
+    // 计算高度
+    this.searchHeight();
+  },
+  // 计算高度
+  searchHeight: function () {
+    let frameStyle = this.data.frameStyle;
+    let client = app.globalData.client;
+    // 减去状态栏
+    let infoHeight = client.windowHeight - (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/merchant/seat.json

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

+ 27 - 0
pages/merchant/seat.wxml

@@ -0,0 +1,27 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+  <view slot="info" class="main" style="height:{{infoHeight}}px;">
+    <view class="one">
+      <form bindsubmit="onSubmit">
+        <view class="content">
+          <view class="left"><text class="icon">城市名称</text></view>
+          <view class="right">
+            <input name="boundary" value="{{form.boundary}}" placeholder='请输入城市名称' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left"><text class="icon">关键词</text></view>
+          <view class="right">
+            <input name="keyword" value="{{form.keyword}}" placeholder='请输入关键词' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="save">
+          <button type="primary" size="mini" form-type="submit">提交登录</button>
+          <button type="primary" size="mini" bindtap="toCheck">确认选点</button>
+        </view>
+      </form>
+    </view>
+    <view class="two">
+      <map class="map" style="height:{{infoHeight-180}}px;" id="map" markers="{{markers}}" subkey="{{key}}" longitude="{{positionInfo.longitude}}" latitude="{{positionInfo.latitude}}" layer-style="1" bindtap="toOne" enable-traffic></map>
+    </view>
+  </view>
+</mobile-main>

+ 53 - 0
pages/merchant/seat.wxss

@@ -0,0 +1,53 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+
+.main .one {
+  position: relative;
+  padding: 10px;
+  height: 140px;
+  border-bottom: 1px dashed #cccccc;
+}
+
+.main .one .content {
+  position: relative;
+  padding: 10px 0;
+  box-shadow: 0 0 5px #000000;
+  margin: 0 0 10px 0;
+  border-radius: 5px;
+}
+
+.main .one .content .left {
+  float: left;
+  margin: 0 10px;
+}
+
+.main .one .content .left .icon {
+  color: #000000;
+  font-size: 14px;
+}
+
+.main .one .content .right input {
+  color: #000000;
+  font-size: 14px;
+}
+
+.main .one .save {
+  text-align: center;
+}
+
+.main .one .save button {
+  margin: 5px 10px;
+}
+
+.main .two {
+  position: relative;
+  padding: 5px 10px;
+  margin: 0 0 10px 0;
+}
+
+.main .two .map {
+  width: 100%;
+  border: 1px solid #666666;
+}

+ 115 - 0
pages/user/detail.js

@@ -0,0 +1,115 @@
+// pages/login/login.js
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '信息管理', leftArrow: true, useBar: false },
+    // 主体高度
+    infoHeight: '',
+    form: {},
+  },
+  initValidate() {
+    const rules = { name: { required: true, }, phone: { required: true, tel: true }, password: { required: true, }, email: { required: true }, address: { required: true, }, company: { required: true, }, post: { required: true, } }
+    // 验证字段的提示信息,若不传则调用默认的信息
+    const messages = { name: { required: '请输入姓名', }, phone: { required: '请输入联系电话', }, password: { required: '请输入密码', }, email: { required: '请输入电子邮箱', }, address: { required: '请输入联系地址', }, company: { required: '请输入工作单位', }, post: { required: '请输入职务', } };
+    this.WxValidate = new WxValidate(rules, messages)
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/user/index' })
+  },
+  // 取消保存
+  onReset: function (e) {
+    this.back()
+  },
+  // 提交保存
+  onSubmit: function (e) {
+    const params = e.detail.value;
+    if (!this.WxValidate.checkForm(params)) {
+      const error = this.WxValidate.errorList[0];
+      wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+      return false
+    } else {
+      console.log(params);
+      wx.showToast({ title: `创建信息成功`, icon: 'success', duration: 2000 })
+    }
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    //验证规则函数
+    this.initValidate()
+    const { id } = options;
+    // 查询信息
+    if (id) this.search(id);
+    // 计算高度
+    this.searchHeight()
+  },
+  // 查询信息
+  search: function (id) {
+    console.log(id);
+  },
+  // 计算高度
+  searchHeight: function () {
+    let frameStyle = this.data.frameStyle;
+    let client = app.globalData.client;
+    // 减去状态栏
+    let infoHeight = client.windowHeight - (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/detail.json

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

+ 68 - 0
pages/user/detail.wxml

@@ -0,0 +1,68 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+  <view slot="info" class="main" style="height:{{infoHeight}}px;">
+    <view class="one">
+      <form bindsubmit="onSubmit" catchreset="onReset">
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-xingming"></text>
+          </view>
+          <view class="right">
+            <input name="name" value="{{form.name}}" placeholder='请输入姓名' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-dianhua"></text>
+          </view>
+          <view class="right">
+            <input type='number' name="phone" value="{{form.phone}}" maxlength="11" placeholder='请输入联系电话' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-mima"></text>
+          </view>
+          <view class="right">
+            <input type='text' name="password" value="{{form.password}}" password placeholder='请输入登录密码' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-dianziyouxiang1"></text>
+          </view>
+          <view class="right">
+            <input name="email" value="{{form.email}}" placeholder='请输入电子邮箱' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-dizhi"></text>
+          </view>
+          <view class="right">
+            <input name="address" value="{{form.address}}" placeholder='请输入联系地址' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-commpany"></text>
+          </view>
+          <view class="right">
+            <input name="company" value="{{form.company}}" placeholder='请输入工作单位' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-zhiwu"></text>
+          </view>
+          <view class="right">
+            <input name="post" value="{{form.post}}" placeholder='请输入职务' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="save">
+          <button type="warn" size="mini" formType="reset">取消保存</button>
+          <button type="primary" size="mini" formType="submit">提交保存</button>
+        </view>
+      </form>
+    </view>
+  </view>
+</mobile-main>

+ 38 - 0
pages/user/detail.wxss

@@ -0,0 +1,38 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+
+.main .one {
+  position: relative;
+  padding: 10px;
+}
+
+.main .one .content {
+  position: relative;
+  padding: 10px 0;
+  box-shadow: 0 0 5px #000000;
+  margin: 0 0 10px 0;
+  border-radius: 5px;
+}
+
+.main .one .content .left {
+  float: left;
+  margin: 0 10px;
+}
+
+.main .one .content .left .icon {
+  color: #000000;
+}
+
+.main .one .content .right input {
+  color: #000000;
+}
+
+.main .one .save {
+  text-align: center;
+}
+
+.main .one .save button {
+  margin: 10px;
+}

+ 125 - 0
pages/user/index.js

@@ -0,0 +1,125 @@
+// pages/login/login.js
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '办案人员', leftArrow: true, useBar: false },
+    // 主体高度
+    infoHeight: '',
+    // 区县人员
+    list: [
+      { id: '1', name: '测试办案人员1', phone: '13174420325', address: '吉林省长春市', post: '警长' },
+      { id: '2', ame: '测试办案人员2', phone: '13174420325', address: '吉林省长春市', post: '小兵' },
+    ],
+    // 弹框
+    dialog: { title: '详细信息', show: false, type: '1' },
+    // 详细信息
+    info: { id: '1', name: '测试办案人员1', phone: '13174420325', address: '吉林省长春市' },
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/home/index' })
+  },
+  // 添加人员
+  toAdd: function () {
+    wx.navigateTo({ url: `/pages/user/detail` })
+  },
+  // 详细信息
+  toView: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    // this.setData({ info: {} })
+    this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+  },
+  // 信息变更
+  toEdit: function (e) {
+    const { id } = e.currentTarget.dataset;
+    wx.navigateTo({ url: `/pages/user/detail?id=${id}` })
+  },
+  // 密码重置
+  toReset: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    wx.showToast({ title: `密码重置成功`, icon: 'success', duration: 2000 })
+  },
+  // 微信解绑
+  toUnbound: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    wx.showToast({ title: `微信解绑成功`, icon: 'success', duration: 2000 })
+  },
+  // 账号注销
+  toCancel: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    wx.showToast({ title: `账号注销成功`, icon: 'success', duration: 2000 })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // 计算高度
+    this.searchHeight()
+  },
+  // 计算高度
+  searchHeight: function () {
+    let frameStyle = this.data.frameStyle;
+    let client = app.globalData.client;
+    // 减去状态栏
+    let infoHeight = client.windowHeight - (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/index.json

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

+ 56 - 0
pages/user/index.wxml

@@ -0,0 +1,56 @@
+<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.address||'暂无' }}</text></view>
+          <view class="otherInfo">职务:<text>{{item.post||'暂无' }}</text></view>
+        </view>
+        <view class="btn">
+          <button type="info" size="mini" bindtap="toView" data-id="{{item.id}}">详细信息</button>
+          <button type="info" size="mini" bindtap="toEdit" data-id="{{item.id}}">信息变更</button>
+          <button type="primary" size="mini" bindtap="toReset" data-id="{{item.id}}">密码重置</button>
+          <button type="primary" size="mini" bindtap="toUnbound" data-id="{{item.id}}">微信解绑</button>
+          <button type="warn" size="mini" bindtap="toCancel" data-id="{{item.id}}">账号注销</button>
+        </view>
+      </view>
+    </view>
+  </view>
+</mobile-main>
+<van-dialog use-slot title="{{dialog.title}}" show="{{ dialog.show }}" confirmButtonText="返回">
+  <view class="dialog">
+    <view wx:if="{{dialog.type=='1'}}" class="dialog_1">
+      <form>
+        <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="company" value="{{info.company}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>职务</text></view>
+          <view class="right"><input name="post" value="{{info.post}}" disabled></input></view>
+        </view>
+      </form>
+    </view>
+  </view>
+</van-dialog>

+ 88 - 0
pages/user/index.wxss

@@ -0,0 +1,88 @@
+.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 .dialog_1 .content {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+
+.dialog .dialog_1 .content .left {
+  float: left;
+  margin: 0 10px;
+}
+
+.dialog .dialog_1 .content .left text {
+  font-size: 14px;
+  color: #666666;
+}
+
+.dialog .dialog_1 .content .right input {
+  font-size: 12px;
+}
+
+.van-dialog__header {
+  padding-top: 0 !important;
+  padding: 10px 0 !important;
+}

+ 4 - 5
project.config.json

@@ -17,7 +17,7 @@
     "minified": true,
     "newFeature": false,
     "coverView": true,
-    "nodeModules": false,
+    "nodeModules": true,
     "autoAudits": false,
     "showShadowRootInWxmlPanel": true,
     "scopeDataCheck": false,
@@ -43,12 +43,11 @@
     "disableUseStrict": false,
     "minifyWXML": true,
     "showES6CompileOption": false,
-    "useCompilerPlugins": false,
-    "ignoreUploadUnusedFiles": true
+    "useCompilerPlugins": false
   },
   "compileType": "miniprogram",
-  "libVersion": "2.19.4",
-  "appid": "wx2c50f82dae28a9f5",
+  "libVersion": "2.21.2",
+  "appid": "wx0fd4b616bc7cf3bb",
   "projectname": "%E7%83%9F%E8%8D%89-%E5%B0%8F%E7%A8%8B%E5%BA%8F",
   "debugOptions": {
     "hidedInDevtools": []

+ 3 - 3
utils/login.js

@@ -5,7 +5,8 @@ module.exports = {
       wx.login({
         success: res => {
           const app = getApp()
-          const { code: js_code } = res
+          const { code: js_code } = res;
+          console.log(res);
           // 发送 res.code 到后台换取 openId, sessionKey, unionId
           // wx.request({
           //   url: `${app.globalData.publicUrl}/api/hc/wx/openid?js_code=` + js_code,
@@ -28,8 +29,7 @@ module.exports = {
           // })
         }
       })
-
-
+      // 获取access_token
     })
   }
 }