Browse Source

初步页面完成

guhongwei 3 năm trước cách đây
mục cha
commit
790026f111
45 tập tin đã thay đổi với 2479 bổ sung103 xóa
  1. 12 3
      app.json
  2. 7 3
      icon/icon.wxss
  3. 119 0
      pages/county_merchant/detail.js
  4. 6 0
      pages/county_merchant/detail.json
  5. 44 0
      pages/county_merchant/detail.wxml
  6. 38 0
      pages/county_merchant/detail.wxss
  7. 105 0
      pages/county_merchant/index.js
  8. 6 0
      pages/county_merchant/index.json
  9. 57 0
      pages/county_merchant/index.wxml
  10. 88 0
      pages/county_merchant/index.wxss
  11. 129 0
      pages/county_merchant/seat.js
  12. 6 0
      pages/county_merchant/seat.json
  13. 27 0
      pages/county_merchant/seat.wxml
  14. 53 0
      pages/county_merchant/seat.wxss
  15. 40 14
      pages/home/index.js
  16. 84 40
      pages/index/index.js
  17. 4 1
      pages/index/index.json
  18. 6 22
      pages/index/index.wxml
  19. 6 16
      pages/index/index.wxss
  20. 2 4
      pages/login/index.js
  21. 114 0
      pages/merchant_error/index.js
  22. 6 0
      pages/merchant_error/index.json
  23. 40 0
      pages/merchant_error/index.wxml
  24. 102 0
      pages/merchant_error/index.wxss
  25. 140 0
      pages/user_market/index.js
  26. 6 0
      pages/user_market/index.json
  27. 51 0
      pages/user_market/index.wxml
  28. 88 0
      pages/user_market/index.wxss
  29. 129 0
      pages/user_merchant/error.js
  30. 6 0
      pages/user_merchant/error.json
  31. 54 0
      pages/user_merchant/error.wxml
  32. 38 0
      pages/user_merchant/error.wxss
  33. 126 0
      pages/user_merchant/history.js
  34. 6 0
      pages/user_merchant/history.json
  35. 49 0
      pages/user_merchant/history.wxml
  36. 102 0
      pages/user_merchant/history.wxss
  37. 128 0
      pages/user_merchant/index.js
  38. 6 0
      pages/user_merchant/index.json
  39. 60 0
      pages/user_merchant/index.wxml
  40. 102 0
      pages/user_merchant/index.wxss
  41. 145 0
      pages/user_merchant/inspect.js
  42. 6 0
      pages/user_merchant/inspect.json
  43. 74 0
      pages/user_merchant/inspect.wxml
  44. 38 0
      pages/user_merchant/inspect.wxss
  45. 24 0
      utils/dict.js

+ 12 - 3
app.json

@@ -1,7 +1,8 @@
 {
 {
   "pages": [
   "pages": [
-    "pages/home/index",
+    "pages/index/index",
     "pages/login/index",
     "pages/login/index",
+    "pages/home/index",
     "pages/county/index",
     "pages/county/index",
     "pages/county/detail",
     "pages/county/detail",
     "pages/user/index",
     "pages/user/index",
@@ -10,12 +11,20 @@
     "pages/merchant/detail",
     "pages/merchant/detail",
     "pages/merchant/seat",
     "pages/merchant/seat",
     "pages/merchant/inspect",
     "pages/merchant/inspect",
+    "pages/merchant_error/index",
     "pages/inspect/index",
     "pages/inspect/index",
+    "pages/county_merchant/index",
+    "pages/county_merchant/detail",
+    "pages/county_merchant/seat",
     "pages/password/index",
     "pages/password/index",
     "pages/market/index",
     "pages/market/index",
     "pages/market/detail",
     "pages/market/detail",
-    "pages/test/index",
-    "pages/index/index"
+    "pages/user_market/index",
+    "pages/user_merchant/index",
+    "pages/user_merchant/inspect",
+    "pages/user_merchant/history",
+    "pages/user_merchant/error",
+    "pages/test/index"
   ],
   ],
   "usingComponents": {
   "usingComponents": {
     "van-button": "/miniprogram_npm/vant-weapp/button/index",
     "van-button": "/miniprogram_npm/vant-weapp/button/index",

+ 7 - 3
icon/icon.wxss

@@ -1,9 +1,9 @@
 @font-face {
 @font-face {
   font-family: "iconfont";
   font-family: "iconfont";
   /* Project id 3094003 */
   /* Project id 3094003 */
-  src: url('//at.alicdn.com/t/font_3094003_iaeveopxqtg.woff2?t=1640915562236') format('woff2'),
-    url('//at.alicdn.com/t/font_3094003_iaeveopxqtg.woff?t=1640915562236') format('woff'),
-    url('//at.alicdn.com/t/font_3094003_iaeveopxqtg.ttf?t=1640915562236') format('truetype');
+  src: url('//at.alicdn.com/t/font_3094003_xu5no0ebyg.woff2?t=1640938844892') format('woff2'),
+    url('//at.alicdn.com/t/font_3094003_xu5no0ebyg.woff?t=1640938844892') format('woff'),
+    url('//at.alicdn.com/t/font_3094003_xu5no0ebyg.ttf?t=1640938844892') format('truetype');
 }
 }
 
 
 .iconfont {
 .iconfont {
@@ -14,6 +14,10 @@
   -moz-osx-font-smoothing: grayscale;
   -moz-osx-font-smoothing: grayscale;
 }
 }
 
 
+.icon-jiucuo:before {
+  content: "\e614";
+}
+
 .icon-shijian:before {
 .icon-shijian:before {
   content: "\e665";
   content: "\e665";
 }
 }

+ 119 - 0
pages/county_merchant/detail.js

@@ -0,0 +1,119 @@
+// pages/login/login.js
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '信息管理', leftArrow: true, useBar: false },
+    // 主体高度
+    infoHeight: '',
+    // 用戶信息
+    userInfo: {},
+    form: {},
+  },
+  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/county_merchant/index' })
+  },
+  // 添加位置信息
+  toSeat: function () {
+    wx.navigateTo({ url: `/pages/county_merchant/seat` })
+  },
+  // 取消保存
+  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 {
+      params.county_id = this.data.userInfo.id;
+      params.county_name = this.data.userInfo.name;
+      console.log(params);
+      wx.showToast({ title: `创建信息成功`, icon: 'success', duration: 2000 })
+    }
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    //验证规则函数
+    this.initValidate()
+    // 计算高度
+    this.searchHeight();
+    let userInfo = app.globalData.userInfo;
+    if (userInfo) this.setData({ userInfo: userInfo });
+  },
+
+  // 计算高度
+  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/county_merchant/detail.json

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

+ 44 - 0
pages/county_merchant/detail.wxml

@@ -0,0 +1,44 @@
+<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-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/county_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;
+}

+ 105 - 0
pages/county_merchant/index.js

@@ -0,0 +1,105 @@
+// 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' },
+    ],
+    // 弹框
+    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/county_merchant/detail` })
+  },
+  // 详细信息
+  toView: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    // this.setData({ info: {} })
+    this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+  },
+  // 位置信息登记
+  toSeat: function (e) {
+    const { id } = e.currentTarget.dataset;
+    wx.navigateTo({ url: `/pages/county_merchant/seat?id=${id}` })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  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/county_merchant/index.json

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

+ 57 - 0
pages/county_merchant/index.wxml

@@ -0,0 +1,57 @@
+<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="toSeat" 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/county_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/county_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/county_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/county_merchant/seat.json

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

+ 27 - 0
pages/county_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/county_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;
+}

+ 40 - 14
pages/home/index.js

@@ -1,5 +1,6 @@
 // pages/login/login.js
 // pages/login/login.js
-const app = getApp()
+const app = getApp();
+const { system, admin, county, user } = require('../../utils/dict');
 const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
 const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
 Page({
 Page({
 
 
@@ -12,16 +13,7 @@ Page({
     infoHeight: '',
     infoHeight: '',
     avatarUrl: defaultAvatarUrl,
     avatarUrl: defaultAvatarUrl,
     userInfo: {},
     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' },
-    ]
+    routerList: []
   },
   },
   // 获取头像
   // 获取头像
   onChooseAvatar(e) {
   onChooseAvatar(e) {
@@ -33,6 +25,14 @@ Page({
     const { data } = e.currentTarget.dataset;
     const { data } = e.currentTarget.dataset;
     if (data.is_routine && data.is_routine == '1') {
     if (data.is_routine && data.is_routine == '1') {
       wx.showToast({ title: `绑定微信成功`, icon: 'success', duration: 2000 })
       wx.showToast({ title: `绑定微信成功`, icon: 'success', duration: 2000 })
+    } else if (data.is_routine && data.is_routine == '2') {
+      wx.clearStorage({
+        key: 'toekn',
+        success: res => {
+          wx.showToast({ title: `退出登录成功`, icon: 'success', duration: 2000 })
+          wx.redirectTo({ url: '/pages/login/index', })
+        }
+      })
     } else {
     } else {
       wx.navigateTo({ url: `/pages/${data.router}/index` })
       wx.navigateTo({ url: `/pages/${data.router}/index` })
     }
     }
@@ -41,10 +41,23 @@ Page({
    * 生命周期函数--监听页面加载
    * 生命周期函数--监听页面加载
    */
    */
   onLoad: function (options) {
   onLoad: function (options) {
+    // 查询用户是否登录
+    wx.getStorage({
+      key: 'token',
+      success: res => {
+        if (res.data) {
+          let userInfo = app.globalData.userInfo;
+          if (userInfo) this.setData({ userInfo: userInfo });
+          // 查询菜单
+          if (userInfo) this.searchRouter();
+        } else {
+          wx.redirectTo({ url: '/pages/login/index', })
+        }
+      }
+    })
     // 计算高度
     // 计算高度
-    this.searchHeight()
-    let userInfo = app.globalData.userInfo;
-    if (userInfo) this.setData({ userInfo: userInfo })
+    this.searchHeight();
+
   },
   },
   // 计算高度
   // 计算高度
   searchHeight: function () {
   searchHeight: function () {
@@ -56,6 +69,19 @@ Page({
     if (frameStyle.useBar) infoHeight = infoHeight - 50;
     if (frameStyle.useBar) infoHeight = infoHeight - 50;
     if (infoHeight) this.setData({ infoHeight: infoHeight })
     if (infoHeight) this.setData({ infoHeight: infoHeight })
   },
   },
+  // 查询菜单
+  searchRouter() {
+    wx.getStorage({
+      key: 'role',
+      success: res => {
+        var data = [];
+        if (res.data == '1') { data = [...admin, ...system] }
+        else if (res.data == '2') { data = [...county, ...system] }
+        else if (res.data == '3') { data = [...user, ...system] }
+        this.setData({ routerList: data })
+      }
+    })
+  },
   /**
   /**
    * 生命周期函数--监听页面初次渲染完成
    * 生命周期函数--监听页面初次渲染完成
    */
    */

+ 84 - 40
pages/index/index.js

@@ -1,48 +1,92 @@
-// index.js
-// 获取应用实例
 const app = getApp()
 const app = getApp()
-
 Page({
 Page({
+
+  /**
+   * 页面的初始数据
+   */
   data: {
   data: {
-    motto: 'Hello World',
-    userInfo: {},
-    hasUserInfo: false,
-    canIUse: wx.canIUse('button.open-type.getUserInfo'),
-    canIUseGetUserProfile: false,
-    canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false
-  },
-  // 事件处理函数
-  bindViewTap() {
-    wx.navigateTo({
-      url: '../logs/logs'
-    })
+    frameStyle: { useTop: true, name: '系统首页', leftArrow: false, useBar: false },
+    // 主体高度
+    infoHeight: '',
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // 监听用户是否登录
+    this.watchLogin();
+    // 计算高度
+    this.searchHeight();
   },
   },
-  onLoad() {
-    if (wx.getUserProfile) {
-      this.setData({
-        canIUseGetUserProfile: true
-      })
-    }
-  },
-  getUserProfile(e) {
-    // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
-    wx.getUserProfile({
-      desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
-      success: (res) => {
-        console.log(res)
-        this.setData({
-          userInfo: res.userInfo,
-          hasUserInfo: true
-        })
+  // 监听用户是否登录
+  watchLogin: function () {
+    wx.getStorage({
+      key: 'token',
+      success: res => {
+        if (res.data) wx.redirectTo({ url: '/pages/home/index', })
+      },
+      fail: res => {
+        wx.redirectTo({ url: '/pages/login/index', })
       }
       }
     })
     })
   },
   },
-  getUserInfo(e) {
-    // 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息
-    console.log(e)
-    this.setData({
-      userInfo: e.detail.userInfo,
-      hasUserInfo: true
-    })
+  // 计算高度
+  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 () {
+
   }
   }
-})
+})

+ 4 - 1
pages/index/index.json

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

+ 6 - 22
pages/index/index.wxml

@@ -1,23 +1,7 @@
-<!--index.wxml-->
-<view class="container">
-  <view class="userinfo">
-    <block wx:if="{{canIUseOpenData}}">
-      <view class="userinfo-avatar" bindtap="bindViewTap">
-        <open-data type="userAvatarUrl"></open-data>
-      </view>
-      <open-data type="userNickName"></open-data>
-    </block>
-    <block wx:elif="{{!hasUserInfo}}">
-      <button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button>
-      <button wx:elif="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
-      <view wx:else> 请使用1.4.4及以上版本基础库 </view>
-    </block>
-    <block wx:else>
-      <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
-      <text class="userinfo-nickname">{{userInfo.nickName}}</text>
-    </block>
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+  <view slot="info" class="main" style="height:{{infoHeight}}px;">
+    <view class="one">
+      系统首页
+    </view>
   </view>
   </view>
-  <view class="usermotto">
-    <text class="user-motto">{{motto}}1</text>
-  </view>
-</view>
+</mobile-main>

+ 6 - 16
pages/index/index.wxss

@@ -1,19 +1,9 @@
-/**index.wxss**/
-.userinfo {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  color: #aaa;
+.main {
+  position: relative;
+  width: 100%;
 }
 }
 
 
-.userinfo-avatar {
-  overflow: hidden;
-  width: 128rpx;
-  height: 128rpx;
-  margin: 20rpx;
-  border-radius: 50%;
-}
-
-.usermotto {
-  margin-top: 200px;
+.main .one {
+  text-align: center;
+  padding: 10px 0;
 }
 }

+ 2 - 4
pages/login/index.js

@@ -39,8 +39,9 @@ Page({
       wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
       wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
       return false
       return false
     } else {
     } else {
-      console.log(params);
       app.globalData.userInfo = params;
       app.globalData.userInfo = params;
+      wx.setStorage({ key: "token", data: 'token' })
+      wx.setStorage({ key: "role", data: params.role })
       wx.showToast({ title: `账号登录成功`, icon: 'success', duration: 2000 })
       wx.showToast({ title: `账号登录成功`, icon: 'success', duration: 2000 })
       wx.navigateTo({ url: '/pages/home/index' })
       wx.navigateTo({ url: '/pages/home/index' })
     }
     }
@@ -69,19 +70,16 @@ Page({
     if (frameStyle.useBar) infoHeight = infoHeight - 50;
     if (frameStyle.useBar) infoHeight = infoHeight - 50;
     if (infoHeight) this.setData({ infoHeight: infoHeight })
     if (infoHeight) this.setData({ infoHeight: infoHeight })
   },
   },
-
   /**
   /**
    * 生命周期函数--监听页面初次渲染完成
    * 生命周期函数--监听页面初次渲染完成
    */
    */
   onReady: function () {
   onReady: function () {
-
   },
   },
 
 
   /**
   /**
    * 生命周期函数--监听页面显示
    * 生命周期函数--监听页面显示
    */
    */
   onShow: function () {
   onShow: function () {
-
   },
   },
 
 
   /**
   /**

+ 114 - 0
pages/merchant_error/index.js

@@ -0,0 +1,114 @@
+// pages/login/login.js
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '商户信息纠错', leftArrow: true, useBar: false },
+    // 主体高度
+    infoHeight: '',
+    // 区县人员
+    list: [],
+    // 弹框
+    dialog: { title: '详细信息', show: false, type: '1' },
+    // 详细信息
+    info: { id: '1', merchant_name: '测试商户', user_name: '办案人员', content: '纠错内容' },
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/home/index' })
+  },
+  // 添加人员
+  toAdd: function () {
+    wx.navigateTo({ url: `/pages/county/detail` })
+  },
+  // 详细信息
+  toView: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    // this.setData({ info: {} })
+    this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // 计算高度
+    this.searchHeight();
+    // 查询信息
+    this.search();
+  },
+  // 查询列表
+  search: function () {
+    let merchant_name = this.data.shoopingtext;
+    if (merchant_name) {
+      console.log(merchant_name);
+    }
+    let data = [{ id: '1', merchant_name: '测试商户', user_name: '办案人员', content: '纠错内容' },
+    { id: '2', merchant_name: '测试商户', user_name: '办案人员', content: '纠错内容' },]
+    this.setData({ list: data })
+  },
+  shoppinginput: function (e) {
+    this.setData({ shoopingtext: e.detail.value })
+  },
+  // 计算高度
+  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_error/index.json

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

+ 40 - 0
pages/merchant_error/index.wxml

@@ -0,0 +1,40 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+  <view slot="info" class="main" style="height:{{infoHeight}}px;">
+    <view class="one">
+      <input value="{{shoopingtext}}" bindinput="shoppinginput" placeholder="请输入商户名称"></input>
+      <text bindtap="search">搜索</text>
+    </view>
+    <view class="two">
+      <view class="list" wx:key="item" wx:for="{{list}}">
+        <view class="name">{{item.merchant_name}}</view>
+        <view class="other">
+          <view class="otherInfo">办案人员:<text>{{item.user_name||'暂无' }}</text></view>
+          <view class="otherInfo textOver">纠错时间:<text>{{item.address||'暂无' }}</text></view>
+        </view>
+        <view class="btn">
+          <button type="info" size="mini" bindtap="toView" 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="merchant_name" value="{{info.merchant_name}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>办案人员:</text></view>
+          <view class="right"><input name="user_name" value="{{info.user_name}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>纠错内容:</text></view>
+          <view class="right"><input name="content" value="{{info.content}}" disabled></input></view>
+        </view>
+      </form>
+    </view>
+  </view>
+</van-dialog>

+ 102 - 0
pages/merchant_error/index.wxss

@@ -0,0 +1,102 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+
+.main .one {
+  position: relative;
+  padding: 0 8px;
+  height: 40px;
+  overflow: hidden;
+  border-bottom: 1px dashed #000000;
+}
+
+.main .one input {
+  float: left;
+  width: 85%;
+  padding: 2px 5px;
+  margin: 5px 0;
+  border-radius: 5px;
+  border: 1px solid #cccccc;
+  background-color: #ffffff;
+}
+
+.main .one text {
+  position: relative;
+  left: 10px;
+  top: 6px;
+  font-size: 17px;
+}
+
+.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;
+}

+ 140 - 0
pages/user_market/index.js

@@ -0,0 +1,140 @@
+// pages/login/login.js
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '商品信息', leftArrow: true, useBar: false },
+    // 主体高度
+    infoHeight: '',
+    // 查询条件
+    searchForm: {},
+    // 商品信息
+    list: [],
+    // 弹框
+    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' })
+  },
+  // 详细信息
+  toView: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    // this.setData({ info: {} })
+    this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+  },
+  // 名称查询
+  toSearch: function (e) {
+    const { title } = e.currentTarget.dataset;
+    wx.showModal({
+      title: title == 'name' ? '名称查询' : '编号查询',
+      content: '',
+      editable: true,
+      success: (res) => {
+        if (res.confirm) {
+          var key = `searchForm.${title}`
+          this.setData({ [key]: res.content })
+          this.search();
+        }
+        else if (res.cancel) {
+          console.log('2');
+        }
+      }
+    })
+  },
+  // 重置查询
+  resetSearch: function () {
+    this.setData({ searchForm: {} })
+    this.search()
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // 计算高度
+    this.searchHeight();
+    // 查询数据
+    this.search();
+  },
+  // 查询数据
+  search: function () {
+    // 查询条件
+    console.log(this.data.searchForm);
+    let data = [
+      { id: '1', name: '测试商品1', number: '1', },
+      { id: '2', name: '测试商品2', number: '2', },
+    ]
+    this.setData({ list: data })
+  },
+  // 计算高度
+  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_market/index.json

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

+ 51 - 0
pages/user_market/index.wxml

@@ -0,0 +1,51 @@
+<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="toSearch" data-title='name'>名称查询</button>
+      <button type="primary" size="mini" bindtap="toSearch" data-title='number'>编号查询</button>
+      <button type="primary" size="mini">图片查询</button>
+      <button type="primary" size="mini" bindtap="resetSearch">重置查询</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>
+        </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/user_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 3px;
+}
+
+.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;
+}

+ 129 - 0
pages/user_merchant/error.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: {},
+    // 办案人员
+    userList: [
+      { id: 1, name: '办案人员' },
+      { id: 2, name: '办案人员' }
+    ]
+
+  },
+  initValidate() {
+    const rules = { user_name: { required: true, }, content: { required: true, } }
+    // 验证字段的提示信息,若不传则调用默认的信息
+    const messages = { user_name: { required: '请选择办案人员', }, content: { required: '请输入纠错内容', } };
+    this.WxValidate = new WxValidate(rules, messages)
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/county/index' })
+  },
+  // 选择办案人员
+  userChange: function (e) {
+    let { value } = e.detail;
+    let data = this.data.userList[value];
+    this.setData({ 'form.user_id': data.id })
+    this.setData({ 'form.user_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) {
+    this.setData({ 'form.merchant_id': id })
+    this.setData({ 'form.merchant_name': '测试商户' })
+  },
+  // 计算高度
+  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_merchant/error.json

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

+ 54 - 0
pages/user_merchant/error.wxml

@@ -0,0 +1,54 @@
+<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-shanghuguanli"></text>
+          </view>
+          <view class="right">
+            <input name="merchant_id" value="{{form.merchant_id}}" disabled></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-shanghuguanli"></text>
+          </view>
+          <view class="right">
+            <input name="merchant_name" value="{{form.merchant_name}}" disabled></input>
+          </view>
+        </view>
+        <view class="content" style="display: none;">
+          <view class="left">
+            <text class="icon iconfont icon-xingming"></text>
+          </view>
+          <view class="right">
+            <input name="user_id" value="{{form.user_id}}" disabled></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-xingming"></text>
+          </view>
+          <view class="right">
+            <picker class="picker" bindchange="userChange" name="user_name" value="{{form.user_name}}" range="{{userList}}" range-key="name">
+              <view>{{form.user_name||'选择办案人员'}}</view>
+            </picker>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-neirong2"></text>
+          </view>
+          <view class="right">
+            <input name="content" value="{{form.content}}" 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_merchant/error.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;
+}

+ 126 - 0
pages/user_merchant/history.js

@@ -0,0 +1,126 @@
+// pages/login/login.js
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '检查历史', leftArrow: true, useBar: false },
+    // 主体高度
+    infoHeight: '',
+    // 查询
+    shoopingtext: '',
+    // 区县人员
+    list: [],
+    // 弹框
+    dialog: { title: '详细信息', show: false, type: '1' },
+    // 详细信息
+    info: { id: '1', merchant_name: '测试商户', grade: '一级', user_name: '办案人员', inspect_date: '2021-12-31', content: '检查内容' },
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/home/index' })
+  },
+  // 添加人员
+  toAdd: function () {
+    wx.navigateTo({ url: `/pages/user_merchant/index` })
+  },
+  // 详细信息
+  toView: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    // this.setData({ info: {} })
+    this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+  },
+
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // 计算高度
+    this.searchHeight();
+    // 查询数据
+    this.search();
+  },
+  // 查詢數據
+  search: function () {
+    let merchant_name = this.data.shoopingtext;
+    if (merchant_name) {
+      console.log(merchant_name);
+    }
+    let data = [
+      { id: '1', merchant_name: '测试商户', grade: '一级', user_name: '办案人员', inspect_date: '2021-12-31', content: '检查内容' },
+      { id: '2', merchant_name: '测试商户', grade: '一级', user_name: '办案人员', inspect_date: '2021-12-31', content: '检查内容' },
+      { id: '2', merchant_name: '测试商户', grade: '一级', user_name: '办案人员', inspect_date: '2021-12-31', content: '检查内容' },
+      { id: '2', merchant_name: '测试商户', grade: '一级', user_name: '办案人员', inspect_date: '2021-12-31', content: '检查内容' },
+      { id: '2', merchant_name: '测试商户', grade: '一级', user_name: '办案人员', inspect_date: '2021-12-31', content: '检查内容' },
+      { id: '2', merchant_name: '测试商户', grade: '一级', user_name: '办案人员', inspect_date: '2021-12-31', content: '检查内容' },
+      { id: '2', merchant_name: '测试商户', grade: '一级', user_name: '办案人员', inspect_date: '2021-12-31', content: '检查内容' },
+
+    ];
+    this.setData({ list: data });
+  },
+  shoppinginput: function (e) {
+    this.setData({ shoopingtext: e.detail.value })
+  },
+  // 计算高度
+  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_merchant/history.json

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

+ 49 - 0
pages/user_merchant/history.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> -->
+      <input value="{{shoopingtext}}" bindinput="shoppinginput" placeholder="请输入商户名称"></input>
+      <text bindtap="search">搜索</text>
+    </view>
+    <view class="two">
+      <view class="list" wx:key="item" wx:for="{{list}}">
+        <view class="name">{{item.merchant_name}}</view>
+        <view class="other">
+          <view class="otherInfo">办案人员:<text>{{item.user_name||'暂无' }}</text></view>
+          <view class="otherInfo textOver">检查时间:<text>{{item.inspect_date||'暂无' }}</text></view>
+        </view>
+        <view class="btn">
+          <button type="info" size="mini" bindtap="toView" 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.merchant_name}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>违规等级:</text></view>
+          <view class="right"><input name="name" value="{{info.grade}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>办案人员:</text></view>
+          <view class="right"><input name="name" value="{{info.user_name}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>检查时间:</text></view>
+          <view class="right"><input name="name" value="{{info.inspect_date}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>检查内容:</text></view>
+          <view class="right"><input name="name" value="{{info.content}}" disabled></input></view>
+        </view>
+      </form>
+    </view>
+  </view>
+</van-dialog>

+ 102 - 0
pages/user_merchant/history.wxss

@@ -0,0 +1,102 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+
+.main .one {
+  position: relative;
+  padding: 0 8px;
+  height: 40px;
+  overflow: hidden;
+  border-bottom: 1px dashed #000000;
+}
+
+.main .one input {
+  float: left;
+  width: 85%;
+  padding: 2px 5px;
+  margin: 5px 0;
+  border-radius: 5px;
+  border: 1px solid #cccccc;
+  background-color: #ffffff;
+}
+
+.main .one text {
+  position: relative;
+  left: 10px;
+  top: 6px;
+  font-size: 17px;
+}
+
+.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/user_merchant/index.js

@@ -0,0 +1,128 @@
+// pages/login/login.js
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '商户人员', leftArrow: true, useBar: false },
+    // 主体高度
+    infoHeight: '',
+    // 查询条件
+    shoopingtext: '',
+    list: [],
+    // 弹框
+    dialog: { title: '详细信息', show: false, type: '1' },
+    // 详细信息
+    info: { id: '2', name: '测试商户2', phone: '13174420325', address: '吉林省长春市', status: '0' },
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/home/index' })
+  },
+  // 详细信息
+  toView: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    // this.setData({ info: {} })
+    this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+  },
+  // 检查信息登记
+  toInspect: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    wx.navigateTo({ url: `/pages/user_merchant/inspect?id=${id}` })
+  },
+  // 信息纠错
+  toError: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    wx.navigateTo({ url: `/pages/user_merchant/error?id=${id}` })
+  },
+  // 既往检查历史
+  toHistory: function (e) {
+    const { id } = e.currentTarget.dataset;
+    console.log(id);
+    wx.navigateTo({ url: `/pages/user_merchant/history?id=${id}` })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // 计算高度
+    this.searchHeight();
+    // 查询信息
+    this.search();
+  },
+  // 查询条件
+  search: function () {
+    let name = this.data.shoopingtext;
+    if (name) {
+      console.log(name);
+    }
+    let data = [{ id: '1', name: '测试商户1', phone: '13174420325', address: '吉林省长春市', status: '0' },]
+    this.setData({ list: data })
+  },
+  shoppinginput: function (e) {
+    this.setData({ shoopingtext: e.detail.value })
+  },
+  // 计算高度
+  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_merchant/index.json

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

+ 60 - 0
pages/user_merchant/index.wxml

@@ -0,0 +1,60 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+  <view slot="info" class="main" style="height:{{infoHeight}}px;">
+    <view class="one">
+      <input value="{{shoopingtext}}" bindinput="shoppinginput" placeholder="请输入商户名称"></input>
+      <text bindtap="search">搜索</text>
+    </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="toInspect" data-id="{{item.id}}">检查信息登记</button>
+          <button type="info" size="mini" bindtap="toError" data-id="{{item.id}}">信息纠错</button>
+          <button type="info" size="mini" bindtap="toHistory" 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>

+ 102 - 0
pages/user_merchant/index.wxss

@@ -0,0 +1,102 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+
+.main .one {
+  position: relative;
+  padding: 0 8px;
+  height: 40px;
+  overflow: hidden;
+  border-bottom: 1px dashed #000000;
+}
+
+.main .one input {
+  float: left;
+  width: 85%;
+  padding: 2px 5px;
+  margin: 5px 0;
+  border-radius: 5px;
+  border: 1px solid #cccccc;
+  background-color: #ffffff;
+}
+
+.main .one text {
+  position: relative;
+  left: 10px;
+  top: 6px;
+  font-size: 17px;
+}
+
+.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;
+}

+ 145 - 0
pages/user_merchant/inspect.js

@@ -0,0 +1,145 @@
+// pages/login/login.js
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '检查信息登记', leftArrow: true, useBar: false },
+    // 主体高度
+    infoHeight: '',
+    form: {},
+    // 违规等级
+    gradeList: [
+      { name: '一级' },
+      { name: '二级' },
+      { name: '三级' },
+    ],
+    // 办案人员
+    userList: [
+      { id: '1', name: '办案人员1' },
+      { id: '2', name: '办案人员2' },
+    ]
+  },
+  initValidate() {
+    const rules = { grade: { required: true, }, user_name: { required: true, }, inspect_date: { required: true, }, content: { required: true, } }
+    // 验证字段的提示信息,若不传则调用默认的信息
+    const messages = { grade: { required: '请选择违规等级', }, user_name: { required: '请选择办案人员', }, inspect_date: { required: '请选择检查时间', }, content: { required: '请输入检查内容', } };
+    this.WxValidate = new WxValidate(rules, messages)
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/user_merchant/index' })
+  },
+  // 选择违规等级
+  gradeChange: function (e) {
+    let { value } = e.detail;
+    let data = this.data.gradeList[value];
+    this.setData({ 'form.grade': data.name })
+  },
+  // 选择办案人员
+  userChange: function (e) {
+    let { value } = e.detail;
+    let data = this.data.userList[value];
+    this.setData({ 'form.user_id': data.id })
+    this.setData({ 'form.user_name': data.name })
+  },
+  // 选择检查时间
+  inspectdateChange: function (e) {
+    let { value } = e.detail;
+    this.setData({ 'form.inspect_date': value })
+  },
+  // 取消保存
+  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) {
+    let data = { merchant_id: id, merchant_name: '测试商户', }
+    this.setData({ form: data })
+  },
+  // 计算高度
+  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_merchant/inspect.json

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

+ 74 - 0
pages/user_merchant/inspect.wxml

@@ -0,0 +1,74 @@
+<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-shanghuguanli"></text>
+          </view>
+          <view class="right">
+            <input name="merchant_id" value="{{form.merchant_id}}" disabled></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-shanghuguanli"></text>
+          </view>
+          <view class="right">
+            <input name="merchant_name" value="{{form.merchant_name}}" disabled></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-dengji"></text>
+          </view>
+          <view class="right">
+            <picker class="picker" bindchange="gradeChange" name="grade" value="{{form.grade}}" range="{{gradeList}}" range-key="name">
+              <view>{{form.grade||'选择违规等级'}}</view>
+            </picker>
+          </view>
+        </view>
+        <view class="content" style="display: none;">
+          <view class="left">
+            <text class="icon iconfont icon-xingming"></text>
+          </view>
+          <view class="right">
+            <input name="user_id" value="{{form.user_id}}" disabled></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-xingming"></text>
+          </view>
+          <view class="right">
+            <picker class="picker" bindchange="userChange" name="user_name" value="{{form.user_name}}" range="{{userList}}" range-key="name">
+              <view>{{form.user_name||'选择办案人员'}}</view>
+            </picker>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-shijian"></text>
+          </view>
+          <view class="right">
+            <picker mode="date" name="inspect_date" bindchange="inspectdateChange" value="{{form.inspect_date}}">
+              <view>{{form.inspect_date||'选择检查时间'}}</view>
+            </picker>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-neirong2"></text>
+          </view>
+          <view class="right">
+            <input name="content" value="{{form.content}}" 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_merchant/inspect.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;
+}

+ 24 - 0
utils/dict.js

@@ -0,0 +1,24 @@
+// 菜单
+export const system = [
+  { icon: 'icon-bangdingweixin', title: '绑定微信', router: '', is_routine: '1' },
+  { icon: 'icon-xiugaimima', title: '修改密码', router: 'password', },
+  { icon: 'icon-tuichudenglu', title: '退出登录', router: 'login', is_routine: '2' },
+]
+// 管理员
+export const admin = [
+  { icon: 'icon-quxiantongxunlu', title: '区县人员', router: 'county' },
+  { icon: 'icon-kuaibananjian', title: '办案人员', router: 'user' },
+  { icon: 'icon-shanghuguanli', title: '商户信息', router: 'merchant' },
+  { icon: 'icon-jiucuo', title: '商户信息纠错', router: 'merchant_error' },
+  { icon: 'icon-shouye', title: '检查历史', router: 'inspect' },
+  { icon: 'icon-shangpinxinxi', title: '商品信息', router: 'market' },
+]
+// 区县
+export const county = [
+  { icon: 'icon-shanghuguanli', title: '商户信息', router: 'county_merchant' },
+]
+// 办案人员
+export const user = [
+  { icon: 'icon-shanghuguanli', title: '商户信息', router: 'user_merchant' },
+  { icon: 'icon-shangpinxinxi', title: '商品信息', router: 'user_market' },
+]