Bladeren bron

Merge branch 'master' of http://git.cc-lotus.info/Consumables/mobiles-two

zs 2 jaren geleden
bovenliggende
commit
b997d48751

+ 3 - 1
app.json

@@ -1,9 +1,9 @@
 {
   "pages": [
+    "pages/home/index",
     "pages/index/index",
     "pages/login/index",
     "pages/login/agreement",
-    "pages/home/index",
     "pages/apply/index",
     "pages/apply/detail",
     "pages/apply_examine/index",
@@ -12,6 +12,8 @@
     "pages/market_buy/detail",
     "pages/market/index",
     "pages/market/detail",
+    "pages/order/index",
+    "pages/payment/index",
     "pages/basic/index",
     "pages/user/index",
     "pages/user/detail",

+ 35 - 6
pages/apply/detail.js

@@ -1,3 +1,4 @@
+import WxValidate from '../../utils/wxValidate'
 const app = getApp()
 Page({
 
@@ -8,13 +9,19 @@ Page({
     frameStyle: { useTop: true, name: '需求信息添加', leftArrow: true, useBar: false },
     // 主体高度
     infoHeight: '',
-    form: {},
+    form: { user_name: '张小丽', user_phone: '12345678901' },
     // 商品列表
     order: [],
     user_id: '12333',
     // 弹框
     dialog: { title: '添加商品', show: false, type: '1' },
   },
+  initValidate() {
+    const rules = { user_name: { required: true, }, user_phone: { required: true, tel: true } }
+    // 验证字段的提示信息,若不传则调用默认的信息
+    const messages = { user_name: { required: '请输入姓名', }, user_phone: { required: '请输入电话', } };
+    this.WxValidate = new WxValidate(rules, messages)
+  },
   back: function () {
     wx.navigateBack({ url: '/pages/apply/index' })
   },
@@ -45,16 +52,38 @@ Page({
   // 提交保存
   onSubmit: function (e) {
     const params = e.detail.value;
-    params.order = this.data.order;
-    params.user_id = this.data.user_id;
-    console.log(params);
+    if (!this.WxValidate.checkForm(params)) {
+      const error = this.WxValidate.errorList[0];
+      wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+      return false
+    } else {
+      params.order = this.data.order;
+      if (params.order.length > 0) {
+        wx.showModal({
+          title: '提示',
+          content: '是否确认提交',
+          success(res) {
+            if (res.confirm) {
+              wx.showToast({ title: '提交成功', icon: 'success', duration: 2000 })
+            } else if (res.cancel) {
+              console.log('用户点击取消')
+            }
+          }
+        })
+      } else {
+        wx.showToast({ title: `缺少商品`, icon: 'error', duration: 2000 })
+      }
+    }
+
+
+
   },
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    // 监听用户是否登录
-    // this.watchLogin();
+    //验证规则函数
+    this.initValidate()
     // 计算高度
     this.searchHeight();
   },

+ 2 - 2
pages/apply/detail.wxml

@@ -15,7 +15,7 @@
                         <text class="icon iconfont icon-xingming1"></text>
                     </view>
                     <view class="right">
-                        <input name="user_name" value="{{form.user_name}}" placeholder='请输入姓名' placeholder-class="placeholder"></input>
+                        <input name="user_name" value="{{form.user_name}}" placeholder='请输入姓名' placeholder-class="placeholder" disabled></input>
                     </view>
                 </view>
                 <view class="content">
@@ -23,7 +23,7 @@
                         <text class="icon iconfont icon-dianhua"></text>
                     </view>
                     <view class="right">
-                        <input name="user_phone" type="number" maxlength="11" value="{{form.user_phone}}" placeholder='请输入电话' placeholder-class="placeholder"></input>
+                        <input name="user_phone" type="number" maxlength="11" value="{{form.user_phone}}" placeholder='请输入电话' placeholder-class="placeholder" disabled></input>
                     </view>
                 </view>
                 <view class="order">

+ 0 - 2
pages/apply/index.js

@@ -34,8 +34,6 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    // 监听用户是否登录
-    // this.watchLogin();
     // 计算高度
     this.searchHeight();
   },

+ 134 - 134
pages/apply_examine/index.js

@@ -2,151 +2,151 @@ const { apply_status } = require('../../utils/dict');
 const app = getApp();
 Page({
 
- /**
-  * 页面的初始数据
-  */
- data: {
-  frameStyle: { useTop: true, name: '采购申请审核', leftArrow: true, useBar: false },
-  // 主体高度
-  infoHeight: '',
-  // 采购申请审核
-  list: [
-   { id: '001', user_name: '法外狂徒张三', user_phone: '12345678901', examine_name: '李四', examine_date: '111', status_name: '待审', status: '0', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], },
-   { id: '002', user_name: '小红帽', user_phone: '98765432109', examine_date: '222', examine_name: '赵五', status_name: '待审', status: '0', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], }
-  ],
-  // 弹框
-  dialog: { title: '详细信息', show: false, type: '1' },
-  // 详细信息
-  info: {},
-  // 审核
-  checkForm: { examine_name: '李四' },
-  // 导出条件
-  exportForm: {},
-  // 商品状态
-  statusList: apply_status
- },
- back: function () {
-  wx.navigateBack({ url: '/pages/home/index' })
- },
- // 导出条件
- export_term: function () {
-  this.setData({ dialog: { title: '导出条件', show: true, type: '3' }, })
- },
- // 选择状态
- statusChange: function (e) {
-  let { value } = e.detail;
-  if (value) {
-   let data = this.data.statusList[value];
-   this.setData({ 'exportForm.status': data.value })
-  }
- },
- // 开始时间
- startChange: function (e) {
-  let { value } = e.detail;
-  this.setData({ 'exportForm.apply_date@start': value })
- },
- // 结束时间
- endChange: function (e) {
-  let { value } = e.detail;
-  this.setData({ 'exportForm.apply_date@end': value })
- },
- // 重置条件
- expertReset: function (e) {
-  this.setData({ exportForm: { user_name: '', status: '' } })
- },
- // 确认导出
- exportSubmit: function (e) {
-  console.log('打开文档成功')
- },
- // 采购申请审核
- toCheck: function (e) {
-  this.setData({ dialog: { title: '采购申请审核', show: true, type: '2' } })
- },
- // 提交审核
- checkSubmit: function (e) {
-  wx.showToast({ title: `审核信息成功`, icon: 'success', duration: 2000 });
-  this.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
- },
- // 详细信息
- toView: function (e) {
-  let item = e.currentTarget.dataset.item;
-  this.setData({ info: item })
-  this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
- },
- // 刪除信息
- toDel: function (e) {
- },
- // 查询
- shoppinginput: function (e) {
-  this.setData({ shoopingtext: e.detail.value })
- },
- /**
-  * 生命周期函数--监听页面加载
-  */
- onLoad: function (options) {
-  // 计算高度
-  this.searchHeight();
- },
- // 查询数据
- search: function (e) {
- },
- // 计算高度
- 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 })
- },
+   /**
+    * 页面的初始数据
+    */
+   data: {
+      frameStyle: { useTop: true, name: '采购申请审核', leftArrow: true, useBar: false },
+      // 主体高度
+      infoHeight: '',
+      // 采购申请审核
+      list: [
+         { id: '001', user_name: '法外狂徒张三', user_phone: '12345678901', examine_name: '李四', examine_date: '111', status_name: '待审', status: '0', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], },
+         { id: '002', user_name: '小红帽', user_phone: '98765432109', examine_date: '222', examine_name: '赵五', status_name: '待审', status: '0', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], }
+      ],
+      // 弹框
+      dialog: { title: '详细信息', show: false, type: '1' },
+      // 详细信息
+      info: {},
+      // 审核
+      checkForm: { examine_name: '李四' },
+      // 导出条件
+      exportForm: {},
+      // 商品状态
+      statusList: apply_status
+   },
+   back: function () {
+      wx.navigateBack({ url: '/pages/home/index' })
+   },
+   // 导出条件
+   export_term: function () {
+      this.setData({ dialog: { title: '导出条件', show: true, type: '3' }, })
+   },
+   // 选择状态
+   statusChange: function (e) {
+      let { value } = e.detail;
+      if (value) {
+         let data = this.data.statusList[value];
+         this.setData({ 'exportForm.status': data.value })
+      }
+   },
+   // 开始时间
+   startChange: function (e) {
+      let { value } = e.detail;
+      this.setData({ 'exportForm.apply_date@start': value })
+   },
+   // 结束时间
+   endChange: function (e) {
+      let { value } = e.detail;
+      this.setData({ 'exportForm.apply_date@end': value })
+   },
+   // 重置条件
+   expertReset: function (e) {
+      this.setData({ exportForm: { user_name: '', status: '' } })
+   },
+   // 确认导出
+   exportSubmit: function (e) {
+      wx.showModal({
+         title: '是否确认导出',
+         success: (res) => {
+            if (res.confirm) wx.showToast({ title: `操作成功`, icon: 'success', duration: 2000 })
+            else if (res.cancel) { }
+         }
+      })
+   },
+   // 采购申请审核
+   toCheck: function (e) {
+      this.setData({ dialog: { title: '采购申请审核', show: true, type: '2' } })
+   },
+   // 提交审核
+   checkSubmit: function (e) {
+      wx.showToast({ title: `审核信息成功`, icon: 'success', duration: 2000 });
+      this.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
+   },
+   // 详细信息
+   toView: function (e) {
+      let item = e.currentTarget.dataset.item;
+      this.setData({ info: item })
+      this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+   },
+   // 查询
+   shoppinginput: function (e) {
+      this.setData({ shoopingtext: e.detail.value })
+   },
+   /**
+    * 生命周期函数--监听页面加载
+    */
+   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 () {
+   /**
+    * 生命周期函数--监听页面初次渲染完成
+    */
+   onReady: function () {
 
- },
+   },
 
- /**
-  * 生命周期函数--监听页面显示
-  */
- onShow: function () {
-  this.search();
- },
+   /**
+    * 生命周期函数--监听页面显示
+    */
+   onShow: function () {
+      this.search();
+   },
 
- /**
-  * 生命周期函数--监听页面隐藏
-  */
- onHide: function () {
+   /**
+    * 生命周期函数--监听页面隐藏
+    */
+   onHide: function () {
 
- },
+   },
 
- /**
-  * 生命周期函数--监听页面卸载
-  */
- onUnload: function () {
+   /**
+    * 生命周期函数--监听页面卸载
+    */
+   onUnload: function () {
 
- },
+   },
 
- /**
-  * 页面相关事件处理函数--监听用户下拉动作
-  */
- onPullDownRefresh: function () {
+   /**
+    * 页面相关事件处理函数--监听用户下拉动作
+    */
+   onPullDownRefresh: function () {
 
- },
+   },
 
- /**
-  * 页面上拉触底事件的处理函数
-  */
- onReachBottom: function () {
+   /**
+    * 页面上拉触底事件的处理函数
+    */
+   onReachBottom: function () {
 
- },
+   },
 
- /**
-  * 用户点击右上角分享
-  */
- onShareAppMessage: function () {
+   /**
+    * 用户点击右上角分享
+    */
+   onShareAppMessage: function () {
 
- }
+   }
 })

+ 101 - 105
pages/apply_review/index.js

@@ -2,122 +2,118 @@ const { apply_status } = require('../../utils/dict');
 const app = getApp();
 Page({
 
- /**
-  * 页面的初始数据
-  */
- data: {
-  frameStyle: { useTop: true, name: '采购需求信息', leftArrow: true, useBar: false },
-  // 主体高度
-  infoHeight: '',
-  // 采购申请
-  list: [
-   { id: '001', user_name: '法外狂徒张三', user_phone: '12345678901', examine_name: '李四', examine_date: '111', status_name: '待审', status: '1', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], },
-   { id: '002', user_name: '小红帽', user_phone: '98765432109', examine_date: '222', examine_name: '赵五', status_name: '待审', status: '1', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], }
-  ],
-  // 弹框
-  dialog: { title: '详细信息', show: false, type: '1' },
-  // 详细信息
-  info: {},
-  // 查询
-  shoopingtext: '',
-  // 审核
-  checkForm: {},
-  // 比对结果
-  resultList: [{ name: '121', num: '9999999' }]
- },
- back: function () {
-  wx.navigateBack({ url: '/pages/home/index' })
- },
- // 详细信息
- toView: function (e) {
-  let item = e.currentTarget.dataset.item;
-  this.setData({ info: item })
-  this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
- },
- // 自动对比库存
- toContrast: function (e) {
-  this.setData({ dialog: { title: '比对结果', show: true, type: '3' } })
- },
- // 审核信息是否是采买,还是领取
- toCheck: function (e) {
-  this.setData({ dialog: { title: '审核信息', show: true, type: '2' } })
- },
- // 提交审核
- checkSubmit: function (e) {
-  this.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
- },
- // 查询
- shoppinginput: function (e) {
-  console.log('搜索', e.detail.value);
-  this.setData({ shoopingtext: e.detail.value })
- },
- /**
-  * 生命周期函数--监听页面加载
-  */
- onLoad: function (options) {
-  // 计算高度
-  this.searchHeight();
- },
- // 查询数据
- search: function (e) {
- },
- // 计算高度
- 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 })
- },
+   /**
+    * 页面的初始数据
+    */
+   data: {
+      frameStyle: { useTop: true, name: '采购需求信息', leftArrow: true, useBar: false },
+      // 主体高度
+      infoHeight: '',
+      // 采购申请
+      list: [
+         { id: '001', user_name: '法外狂徒张三', user_phone: '12345678901', examine_name: '李四', examine_date: '111', status_name: '待审', status: '1', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], },
+         { id: '002', user_name: '小红帽', user_phone: '98765432109', examine_date: '222', examine_name: '赵五', status_name: '待审', status: '1', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], }
+      ],
+      // 弹框
+      dialog: { title: '详细信息', show: false, type: '1' },
+      // 详细信息
+      info: {},
+      // 查询
+      shoopingtext: '',
+      // 审核
+      checkForm: {},
+      // 比对结果
+      resultList: [{ name: '121', num: '9999999' }]
+   },
+   back: function () {
+      wx.navigateBack({ url: '/pages/home/index' })
+   },
+   // 详细信息
+   toView: function (e) {
+      let item = e.currentTarget.dataset.item;
+      this.setData({ info: item })
+      this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+   },
+   // 自动对比库存
+   toContrast: function (e) {
+      this.setData({ dialog: { title: '比对结果', show: true, type: '3' } })
+   },
+   // 审核信息是否是采买,还是领取
+   toCheck: function (e) {
+      this.setData({ dialog: { title: '审核信息', show: true, type: '2' } })
+   },
+   // 提交审核
+   checkSubmit: function (e) {
+      this.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
+   },
+   // 查询
+   shoppinginput: function (e) {
+      console.log('搜索', e.detail.value);
+      this.setData({ shoopingtext: e.detail.value })
+   },
+   /**
+    * 生命周期函数--监听页面加载
+    */
+   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 () {
+   /**
+    * 生命周期函数--监听页面初次渲染完成
+    */
+   onReady: function () {
 
- },
+   },
 
- /**
-  * 生命周期函数--监听页面显示
-  */
- onShow: function () {
-  this.search();
- },
+   /**
+    * 生命周期函数--监听页面显示
+    */
+   onShow: function () {
+   },
 
- /**
-  * 生命周期函数--监听页面隐藏
-  */
- onHide: function () {
+   /**
+    * 生命周期函数--监听页面隐藏
+    */
+   onHide: function () {
 
- },
+   },
 
- /**
-  * 生命周期函数--监听页面卸载
-  */
- onUnload: function () {
+   /**
+    * 生命周期函数--监听页面卸载
+    */
+   onUnload: function () {
 
- },
+   },
 
- /**
-  * 页面相关事件处理函数--监听用户下拉动作
-  */
- onPullDownRefresh: function () {
+   /**
+    * 页面相关事件处理函数--监听用户下拉动作
+    */
+   onPullDownRefresh: function () {
 
- },
+   },
 
- /**
-  * 页面上拉触底事件的处理函数
-  */
- onReachBottom: function () {
+   /**
+    * 页面上拉触底事件的处理函数
+    */
+   onReachBottom: function () {
 
- },
+   },
 
- /**
-  * 用户点击右上角分享
-  */
- onShareAppMessage: function () {
+   /**
+    * 用户点击右上角分享
+    */
+   onShareAppMessage: function () {
 
- }
+   }
 })

+ 159 - 63
pages/market/detail.js

@@ -1,66 +1,162 @@
 // pages/market/detail.js
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
 Page({
 
-    /**
-     * 页面的初始数据
-     */
-    data: {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
-
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage: function () {
-
-    }
-})
+   /**
+    * 页面的初始数据
+    */
+   data: {
+      frameStyle: { useTop: true, name: '信息管理', leftArrow: true, useBar: false },
+      // 主体高度
+      infoHeight: '',
+      userInfo: { id: '00010102883', name: '供货单位' },
+      form: {},
+      // 商品类型
+      typeList: [
+         { code: "8", id: "61dd3480bf70154c7fa35ac5", name: "办公用品" },
+         { code: "8", id: "61dd3480bf70154c7fa35ac5", name: "金融用品" },
+         { code: "8", id: "61dd3480bf70154c7fa35ac5", name: "书写工具" },
+         { code: "8", id: "61dd3480bf70154c7fa35ac5", name: "办公机械" },
+         { code: "8", id: "61dd3480bf70154c7fa35ac5", name: "文件用品" },
+         { code: "8", id: "61dd3480bf70154c7fa35ac5", name: "其他用品" },
+      ],
+      // 图片
+      img_url: [],
+   },
+   initValidate() {
+      const rules = { type_name: { required: true }, name: { required: true, }, brief: { required: true, }, money: { required: true, }, }
+      // 验证字段的提示信息,若不传则调用默认的信息
+      const messages = { type_name: { required: '请选择商品类型', }, name: { required: '请输入商品名称', }, brief: { required: '请输入商品简介', }, money: { required: '请输入商品价格', }, };
+      this.WxValidate = new WxValidate(rules, messages)
+   },
+   back: function () {
+      wx.navigateBack({ url: '/pages/market/index' })
+   },
+   // 类型选择
+   typeChange: function (e) {
+      let { value } = e.detail;
+      let data = this.data.typeList[value];
+      this.setData({ 'form.type_id': data.id })
+      this.setData({ 'form.type_name': data.name })
+   },
+   // 上传图片
+   afterRead: function (event) {
+      const { file } = event.detail;
+      // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+      wx.uploadFile({
+         url: app.globalData.fileUrl + '/files/consumables/market/upload',
+         filePath: file.url,
+         name: 'file',
+         formData: {},
+         success: (res) => {
+            if (res.statusCode == '200') {
+               let data = [{ name: JSON.parse(res.data).name, url: `${app.globalData.fileUrl}` + JSON.parse(res.data).uri }]
+               this.setData({ img_url: this.data.img_url.concat(data) })
+            } else {
+               wx.showToast({ title: `${res.data.errmsg}`, icon: 'fail', duration: 2000 })
+            }
+         },
+      });
+   },
+   // 删除图片
+   uploadDelete: function (e) {
+      const index = e.detail.index;
+      const imgList = this.data.img_url;
+      if (imgList.length === 1) this.setData({ img_url: [] })
+      else { let data = imgList.splice(0, 1); this.setData({ img_url: data }) }
+   },
+   // 取消保存
+   onReset: function (e) {
+      this.back()
+   },
+   // 提交保存
+   onSubmit: function (e) {
+      const params = e.detail.value;
+      params.img_url = this.data.img_url;
+      if (!this.WxValidate.checkForm(params)) {
+         const error = this.WxValidate.errorList[0];
+         wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+         return false
+      } else {
+         wx.showModal({
+            title: '是否确认提交商品',
+            success(res) {
+               if (res.confirm) {
+                  wx.showToast({ title: `提交商品成功`, icon: 'success', duration: 2000 });
+               } else if (res.cancel) {
+               }
+            }
+         })
+      }
+   },
+   /**
+    * 生命周期函数--监听页面加载
+    */
+   onLoad: function (options) {
+      this.setData({ 'form.mech_name': this.data.userInfo.name, 'form.mech_id': this.data.userInfo.id, })
+      //验证规则函数
+      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 () {
+
+   }
+})

+ 5 - 2
pages/market/detail.json

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

+ 129 - 0
pages/market/detail.less

@@ -0,0 +1,129 @@
+.main {
+   position: relative;
+   width: 100%;
+
+   .one {
+      position: relative;
+      padding: 10px;
+
+      .content {
+         position: relative;
+         padding: 10px 0;
+         box-shadow: 0 0 5px #000000;
+         margin: 0 0 10px 0;
+         border-radius: 5px;
+
+         .left {
+            float: left;
+            margin: 0 10px;
+
+            .icon {
+               color: #000000;
+            }
+         }
+
+         .right {
+            input {
+               color: #000000;
+            }
+         }
+      }
+
+      .save {
+         text-align: center;
+
+         button {
+            margin: 10px;
+         }
+      }
+
+      .order {
+         position: relative;
+         padding: 10px;
+         box-shadow: 0 0 5px #000000;
+         margin: 0 0 10px 0;
+         border-radius: 5px;
+
+         .order_1 {
+            position: relative;
+            text-align: center;
+         }
+
+         .order_2 {
+            position: relative;
+
+            .list {
+               margin: 0 0 8px 0;
+               background-color: #f9f9f9;
+               border-radius: 5px;
+               padding: 8px 0;
+
+               .name {
+                  font-size: 16px;
+                  margin: 0 0 5px 0;
+                  padding: 0 10px;
+               }
+
+               .other {
+                  .otherInfo {
+                     margin: 0 0 5px 0;
+                     font-size: 14px;
+                     color: #666666;
+                     padding: 0 10px;
+
+                     text {
+                        color: #000000;
+                     }
+                  }
+               }
+            }
+         }
+      }
+   }
+}
+
+.dialog {
+   min-height: 30px;
+   max-height: 320px;
+   overflow-y: auto;
+   padding: 0 8px;
+
+   .dialog_1 {
+      .content {
+         position: relative;
+         padding: 8px 0;
+         border-radius: 6px;
+         margin: 0 0 5px 0;
+         background-color: #f1f1f1;
+
+         .left {
+            float: left;
+            margin: 0 10px;
+
+            text {
+               font-size: 14px;
+               color: #666666;
+            }
+         }
+
+         .right {
+            input {
+               font-size: 12px;
+            }
+         }
+      }
+
+      .save {
+         text-align: center;
+
+         button {
+            margin: 10px;
+         }
+      }
+   }
+}
+
+.van-dialog__header {
+   padding-top: 0 !important;
+   padding: 10px 0 !important;
+}

+ 86 - 2
pages/market/detail.wxml

@@ -1,2 +1,86 @@
-<!--pages/market/detail.wxml-->
-<text>pages/market/detail.wxml</text>
+<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-xingming"></text>
+          </view>
+          <view class="right">
+            <input name="id" value="{{form.id}}" 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="mech_id" value="{{form.mech_id}}" disabled></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-xingming"></text>
+          </view>
+          <view class="right">
+            <input name="mech_name" value="{{form.mech_name}}" disabled></input>
+          </view>
+        </view>
+        <view class="content" style="display: none;">
+          <view class="left">
+            <text class="icon iconfont icon-leixing"></text>
+          </view>
+          <view class="right">
+            <input name="type_id" value="{{form.type_id}}" disabled></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-leixing"></text>
+          </view>
+          <view class="right">
+            <picker class="picker" bindchange="typeChange" name="type_name" value="{{form.type_name}}" range="{{typeList}}" range-key="name">
+              <view>{{form.type_name||'选择商品类型'}}</view>
+            </picker>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-jianjie"></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-mingcheng"></text>
+          </view>
+          <view class="right">
+            <input name="brief" value="{{form.brief}}" placeholder='请输入商品简介' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-jiage"></text>
+          </view>
+          <view class="right">
+            <input name="money" value="{{form.money}}" type="number" placeholder='请输入商品价格' placeholder-class="placeholder"></input>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left">
+            <text class="icon iconfont icon-tupian"></text>
+          </view>
+          <view class="right">
+            <van-uploader file-list="{{ img_url }}" bind:after-read="afterRead" bind:delete="uploadDelete" />
+          </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>

+ 99 - 1
pages/market/detail.wxss

@@ -1 +1,99 @@
-/* pages/market/detail.wxss */
+.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;
+}
+.main .one .order {
+  position: relative;
+  padding: 10px;
+  box-shadow: 0 0 5px #000000;
+  margin: 0 0 10px 0;
+  border-radius: 5px;
+}
+.main .one .order .order_1 {
+  position: relative;
+  text-align: center;
+}
+.main .one .order .order_2 {
+  position: relative;
+}
+.main .one .order .order_2 .list {
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+}
+.main .one .order .order_2 .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.main .one .order .order_2 .list .other .otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.main .one .order .order_2 .list .other .otherInfo text {
+  color: #000000;
+}
+.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;
+}
+.dialog .dialog_1 .save {
+  text-align: center;
+}
+.dialog .dialog_1 .save button {
+  margin: 10px;
+}
+.van-dialog__header {
+  padding-top: 0 !important;
+  padding: 10px 0 !important;
+}

+ 3 - 1
pages/market/index.js

@@ -39,7 +39,9 @@ Page({
          title: '操作提示',
          content: '您确认上架/下架此产品吗?',
          success: (res) => {
-            wx.showToast({ title: `操作成功`, icon: 'success', duration: 2000 })
+            if (res.confirm) {
+               wx.showToast({ title: `操作成功`, icon: 'success', duration: 2000 })
+            }
          }
       })
    },

+ 175 - 151
pages/market_buy/detail.js

@@ -1,170 +1,194 @@
 // pages/market_buy/detail.js
+import WxValidate from '../../utils/wxValidate';
 const app = getApp();
 Page({
 
- /**
-  * 页面的初始数据
-  */
- data: {
-  frameStyle: { useTop: true, name: '信息管理', leftArrow: true, useBar: false },
-  // 主体高度
-  infoHeight: '',
-  userInfo: { user_id: '00038494480001', name: '123', phone: '1239999999' },
-  // 上架的商品
-  marketList: [
-   { id: '001', name: '喜羊羊', money: '22', type_name: '羊肉', type_id: '111', brief: '一份', mech_id: '000000001', mech_name: '羊村' },
-   { id: '002', name: '美羊羊', money: '23', type_name: '羊肉', type_id: '222', brief: '一份', mech_id: '000000001', mech_name: '羊村' },
-   { id: '003', name: '懒羊羊', money: '24', type_name: '羊肉', type_id: '333', brief: '一份', mech_id: '000000001', mech_name: '羊村' },
-   { id: '004', name: '沸羊羊', money: '25', type_name: '羊肉', type_id: '444', brief: '一份', mech_id: '000000001', mech_name: '羊村' },
-   { id: '005', name: '慢羊羊', money: '26', type_name: '羊肉', type_id: '555', brief: '一份', mech_id: '000000001', mech_name: '羊村' },
-   { id: '006', name: '暖羊羊', money: '27', type_name: '羊肉', type_id: '666', brief: '一份', mech_id: '000000001', mech_name: '羊村' }
-  ],
-  // 类型
-  typeList: [],
-  // 详细信息
-  info: {},
-  // 弹框
-  dialog: { title: '详细信息', show: false, type: '1' },
-  // 选购
-  formList: [],
-  list: [],
-  // 收货信息
-  receiveForm: {}
- },
- back: function () {
-  wx.navigateBack({ url: '/pages/home/index' })
- },
- // 详细信息
- toView: function (e) {
-  let item = e.currentTarget.dataset.item;
-  this.setData({ info: item })
-  this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
- },
- // 添加
- toPlus: function (e) {
-  let p1 = this.data.formList;
-  // console.log(this.data.formList);
-  // 商品
-  let { item } = e.currentTarget.dataset;
-  // console.log(e.currentTarget.dataset);
-  let data = { user_id: this.data.userInfo.id, user_name: this.data.userInfo.name, user_phone: this.data.userInfo.phone, order: [] };
-  // 查询是否已有订单
-  if (p1.length > 0) {
-   // 查询供货单位是否已经加入商品
-   let p2 = p1.find(i => i.mech_id == item.mech_id);
-   if (p2) {
-    // 查找该商品是否已经加入订单
-    let p3 = p2.order.find(i => i.id == item.id);
-    if (p3) {
-     p3.num = p3.num + 1;
-     p2.money = p2.money + p3.money;
-    }
-    else {
-     item.num = 1; p2.money = p2.money + item.money; p2.order.push(item);
-    }
-   } else {
-    item.num = 1; data.mech_id = item.mech_id; data.mech_name = item.mech_name; data.money = item.money * item.num; data.order.push(item); p1.push(data);
-   }
-  } else {
-   item.num = 1; data.mech_id = item.mech_id; data.mech_name = item.mech_name; data.money = item.money * item.num; data.order.push(item); p1.push(data);
-  }
- },
- // 減少
- toMinus: function (e) {
-  let p1 = this.data.formList;
-  // 商品
-  let { item } = e.currentTarget.dataset;
-  let p2 = p1.find(i => i.mech_id == item.mech_id);
-  if (p2) {
-   p2.money = p2.money - item.money;
-   if (p2 && p2.money === 0) {
-    // 获取索引值,删除指定无商品商家信息
-    var key = p1.indexOf(p2.mech_id);
-    p1.splice(key, 1);
-   } else {
-    let p3 = p2.order.find(i => i.id == item.id);
-    if (p3) p3.num = p3.num - 1;
-    if (p3 && p3.num === 0) p3 = {};
-   }
-  }
- },
- // 查看选购
- toBuy: function () {
-  this.setData({ list: this.data.formList })
-  this.setData({ dialog: { title: '查看选购', show: true, type: '2' } })
- },
- // 确认选购
- toConfirm: function () {
-  this.setData({ dialog: { title: '收货信息', show: true, type: '3' } })
- },
- // 提交订单
- onSubmit: function (e) {
-  wx.showToast({ title: `采买发布成功`, icon: 'error', 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 })
- },
+   /**
+    * 页面的初始数据
+    */
+   data: {
+      frameStyle: { useTop: true, name: '信息管理', leftArrow: true, useBar: false },
+      // 主体高度
+      infoHeight: '',
+      userInfo: { id: '00038494480001', user_id: '00038494480001', name: '法外狂徒张三', phone: '1239999999' },
+      // 上架的商品
+      marketList: [
+         { id: '001', name: '喜羊羊', money: '20', type_name: '羊肉', type_id: '111', brief: '一份', mech_id: '000000001', mech_name: '羊村', img_one: '', img_url: [], status: '1' },
+         { id: '002', name: '美羊羊', money: '30', type_name: '羊肉', type_id: '222', brief: '一份', mech_id: '000000001', mech_name: '羊村' },
+         { id: '003', name: '懒羊羊', money: '15', type_name: '羊肉', type_id: '333', brief: '一份', mech_id: '000000001', mech_name: '羊村' },
+         { id: '004', name: '沸羊羊', money: '25', type_name: '羊肉', type_id: '444', brief: '一份', mech_id: '000000001', mech_name: '羊村' },
+         { id: '005', name: '慢羊羊', money: '26', type_name: '羊肉', type_id: '555', brief: '一份', mech_id: '000000001', mech_name: '羊村' },
+         { id: '006', name: '暖羊羊', money: '27', type_name: '羊肉', type_id: '666', brief: '一份', mech_id: '000000001', mech_name: '羊村' }
+      ],
+      // 类型
+      typeList: [],
+      // 详细信息
+      info: {},
+      // 弹框
+      dialog: { title: '详细信息', show: false, type: '1' },
+      // 选购
+      formList: [],
+      list: [],
+      // 收货信息
+      receiveForm: {}
+   },
+   initValidate() {
+      const rules = { receive_user_name: { required: true, }, receive_user_phone: { required: true, }, receive_address: { required: true, } }
+      // 验证字段的提示信息,若不传则调用默认的信息
+      const messages = { receive_user_name: { required: '请输入收货人', }, receive_user_phone: { required: '请输入收货电话', }, receive_address: { required: '请输入收货地址', } };
+      this.WxValidate = new WxValidate(rules, messages)
+   },
+   back: function () {
+      wx.navigateBack({ url: '/pages/home/index' })
+   },
+   // 详细信息
+   toView: function (e) {
+      let item = e.currentTarget.dataset.item;
+      this.setData({ info: item })
+      this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+   },
+   // 添加
+   toPlus: function (e) {
+      let p1 = this.data.formList;
+      // 商品
+      let { item } = e.currentTarget.dataset;
+      let data = { user_id: this.data.userInfo.id, user_name: this.data.userInfo.name, user_phone: this.data.userInfo.phone, order: [] };
+      // 查询是否已有订单
+      if (p1.length > 0) {
+         // 查询供货单位是否已经加入商品
+         let p2 = p1.find(i => i.mech_id == item.mech_id);
+         if (p2) {
+            // 查找该商品是否已经加入订单
+            let p3 = p2.order.find(i => i.id == item.id);
+            if (p3) {
+               p3.num = p3.num + 1;
+               p2.money = Number(p2.money) + Number(p3.money);
+            }
+            else {
+               item.num = 1;
+               p2.money = Number(p2.money) + Number(item.money); p2.order.push(item);
+            }
+         } else {
+            item.num = 1; data.mech_id = item.mech_id; data.mech_name = item.mech_name; data.money = item.money * item.num; data.order.push(item); p1.push(data);
+         }
+      } else {
+         item.num = 1; data.mech_id = item.mech_id; data.mech_name = item.mech_name; data.money = item.money * item.num; data.order.push(item); p1.push(data);
+      }
+   },
+   // 減少
+   toMinus: function (e) {
+      let p1 = this.data.formList;
+      // 商品
+      let { item } = e.currentTarget.dataset;
+      let p2 = p1.find(i => i.mech_id == item.mech_id);
+      if (p2) {
+         p2.money = p2.money - item.money;
+         if (p2 && p2.money === 0) {
+            // 获取索引值,删除指定无商品商家信息
+            var key = p1.indexOf(p2.mech_id);
+            p1.splice(key, 1);
+         } else {
+            let p3 = p2.order.find(i => i.id == item.id);
+            if (p3) p3.num = p3.num - 1;
+            if (p3 && p3.num === 0) p3 = {};
+         }
+      }
+   },
+   // 查看选购
+   toBuy: function () {
+      this.setData({ list: this.data.formList })
+      this.setData({ dialog: { title: '查看选购', show: true, type: '2' } })
+   },
+   // 确认选购
+   toConfirm: function () {
+      this.setData({ dialog: { title: '收货信息', show: true, type: '3' } })
+   },
+   // 提交订单
+   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.showModal({
+            title: '是否确认提交订单',
+            success(res) {
+               if (res.confirm) {
+                  wx.showToast({ title: `提交订单成功`, icon: 'success', duration: 2000 });
+               } else if (res.cancel) {
+               }
+            }
+         })
+      }
+   },
+   /**
+    * 生命周期函数--监听页面加载
+    */
+   onLoad: function (options) {
+      this.setData({ 'receiveForm.receive_user_name': this.data.userInfo.name, 'receiveForm.receive_user_id': this.data.userInfo.user_id, 'receiveForm.receive_user_phone': this.data.userInfo.phone, })
+      //验证规则函数
+      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 () {
+   /**
+    * 生命周期函数--监听页面初次渲染完成
+    */
+   onReady: function () {
 
- },
+   },
 
- /**
-  * 生命周期函数--监听页面显示
-  */
- onShow: function () {
+   /**
+    * 生命周期函数--监听页面显示
+    */
+   onShow: function () {
 
- },
+   },
 
- /**
-  * 生命周期函数--监听页面隐藏
-  */
- onHide: function () {
+   /**
+    * 生命周期函数--监听页面隐藏
+    */
+   onHide: function () {
 
- },
+   },
 
- /**
-  * 生命周期函数--监听页面卸载
-  */
- onUnload: function () {
+   /**
+    * 生命周期函数--监听页面卸载
+    */
+   onUnload: function () {
 
- },
+   },
 
- /**
-  * 页面相关事件处理函数--监听用户下拉动作
-  */
- onPullDownRefresh: function () {
+   /**
+    * 页面相关事件处理函数--监听用户下拉动作
+    */
+   onPullDownRefresh: function () {
 
- },
+   },
 
- /**
-  * 页面上拉触底事件的处理函数
-  */
- onReachBottom: function () {
+   /**
+    * 页面上拉触底事件的处理函数
+    */
+   onReachBottom: function () {
 
- },
+   },
 
- /**
-  * 用户点击右上角分享
-  */
- onShareAppMessage: function () {
+   /**
+    * 用户点击右上角分享
+    */
+   onShareAppMessage: function () {
 
- }
+   }
 })

+ 96 - 96
pages/market_buy/detail.wxml

@@ -1,103 +1,103 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
- <view slot="info" class="main" style="height:{{infoHeight}}px;">
-  <view class="one" style="height:{{infoHeight-60}}px;">
-   <view class="list" wx:key="item" wx:for="{{marketList}}">
-    <image class="images" src='{{item.img_one}}' bindtap="toView" data-item="{{item}}" data-id="{{item.id}}"></image>
-    <view class="info">
-     <view class="name textOver">{{item.name}}</view>
-     <view class="money"><text style="vertical-align: sub;">¥</text>{{item.money}}</view>
-     <view class="btn">
-      <van-stepper v-model="item.num" theme="round" button-size="25" disable-input min='0' data-item="{{item}}" bind:plus="toPlus" bind:minus="toMinus" long-press="{{false}}" />
-     </view>
-    </view>
+   <view slot="info" class="main" style="height:{{infoHeight}}px;">
+      <view class="one" style="height:{{infoHeight-60}}px;">
+         <view class="list" wx:key="item" wx:for="{{marketList}}">
+            <image class="images" src='{{item.img_one}}' bindtap="toView" data-item="{{item}}" data-id="{{item.id}}"></image>
+            <view class="info">
+               <view class="name textOver">{{item.name}}</view>
+               <view class="money"><text style="vertical-align: sub;">¥</text>{{item.money}}</view>
+               <view class="btn">
+                  <van-stepper v-model="item.num" theme="round" button-size="25" disable-input min='0' data-item="{{item}}" bind:plus="toPlus" bind:minus="toMinus" long-press="{{false}}" />
+               </view>
+            </view>
+         </view>
+      </view>
+      <view class="two">
+         <button type="primary" size="mini" bindtap="toBuy">查看选购</button>
+         <button type="primary" size="mini" bindtap="toConfirm">确认选购</button>
+      </view>
    </view>
-  </view>
-  <view class="two">
-   <button type="primary" size="mini" bindtap="toBuy">查看选购</button>
-   <button type="primary" size="mini" bindtap="toConfirm">确认选购</button>
-  </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="right">
-      <swiper indicator-dots='true' autoplay='true' interval='2000' duration='1000' circular='true'>
-       <block wx:for="{{info.img_url}}" wx:key="item">
-        <swiper-item>
-         <image src='{{item.url}}' mode='aspectFill'></image>
-        </swiper-item>
-       </block>
-      </swiper>
-     </view>
-    </view>
-    <view class="content">
-     <view class="left"><text>商品名称:</text></view>
-     <view class="right">{{info.name||'暂无'}}</view>
-    </view>
-    <view class="content">
-     <view class="left"><text>商品类型:</text></view>
-     <view class="right">{{info.type_name||'暂无'}}</view>
-    </view>
-    <view class="content">
-     <view class="left"><text>商品单价(元):</text></view>
-     <view class="right" style="color: #ff0000;">{{info.money||'暂无'}}</view>
-    </view>
-    <view class="content">
-     <view class="left"><text>商品简介:</text></view>
-     <view class="right">{{info.brief||'暂无'}}</view>
-    </view>
-   </form>
-  </view>
-  <view wx:if="{{dialog.type=='2'}}" class="dialog_2">
-   <view class="list" wx:key="item" wx:for="{{list}}">
-    <view class="list_other">
-     <view class="list_otherInfo textOver">供货单位:<text>{{item.mech_name }}</text></view>
-     <view class="list_otherInfo textOver">选购总价:<text style="color: #ff0000;">{{item.money }}¥</text></view>
-    </view>
-    <view class="order">
-     <view class="orderList" wx:key="tag" wx:for="{{item.order}}">
-      <view class="orderList_name">{{item.name}}</view>
-      <view class="order_other">
-       <view class="order_otherInfo textOver">选购数量:<text>{{item.num }}</text></view>
-       <view class="order_otherInfo textOver">商品单价:<text style="color: #ff0000;">{{item.money }}¥</text></view>
+   <view class="dialog">
+      <view wx:if="{{dialog.type=='1'}}" class="dialog_1">
+         <form>
+            <view class="content">
+               <view class="right">
+                  <swiper indicator-dots='true' autoplay='true' interval='2000' duration='1000' circular='true'>
+                     <block wx:for="{{info.img_url}}" wx:key="item">
+                        <swiper-item>
+                           <image src='{{item.url}}' mode='aspectFill'></image>
+                        </swiper-item>
+                     </block>
+                  </swiper>
+               </view>
+            </view>
+            <view class="content">
+               <view class="left"><text>商品名称:</text></view>
+               <view class="right">{{info.name||'暂无'}}</view>
+            </view>
+            <view class="content">
+               <view class="left"><text>商品类型:</text></view>
+               <view class="right">{{info.type_name||'暂无'}}</view>
+            </view>
+            <view class="content">
+               <view class="left"><text>商品单价(元):</text></view>
+               <view class="right" style="color: #ff0000;">{{info.money||'暂无'}}</view>
+            </view>
+            <view class="content">
+               <view class="left"><text>商品简介:</text></view>
+               <view class="right">{{info.brief||'暂无'}}</view>
+            </view>
+         </form>
+      </view>
+      <view wx:if="{{dialog.type=='2'}}" class="dialog_2">
+         <view class="list" wx:key="item" wx:for="{{list}}">
+            <view class="list_other">
+               <view class="list_otherInfo textOver">供货单位:<text>{{item.mech_name }}</text></view>
+               <view class="list_otherInfo textOver">选购总价:<text style="color: #ff0000;">{{item.money }}¥</text></view>
+            </view>
+            <view class="order">
+               <view class="orderList" wx:key="tag" wx:for="{{item.order}}">
+                  <view class="orderList_name">{{item.name}}</view>
+                  <view class="order_other">
+                     <view class="order_otherInfo textOver">选购数量:<text>{{item.num }}</text></view>
+                     <view class="order_otherInfo textOver">商品单价:<text style="color: #ff0000;">{{item.money }}¥</text></view>
+                  </view>
+               </view>
+            </view>
+         </view>
+      </view>
+      <view wx:if="{{dialog.type=='3'}}" class="dialog_3">
+         <form bindsubmit="onSubmit">
+            <view class="content">
+               <view class="left">
+                  <text class="icon iconfont icon-xingming"></text>
+               </view>
+               <view class="right">
+                  <input name="receive_user_name" value="{{receiveForm.receive_user_name}}" placeholder='请输入收货人' placeholder-class="placeholder" disabled></input>
+               </view>
+            </view>
+            <view class="content">
+               <view class="left">
+                  <text class="icon iconfont icon-dianhua"></text>
+               </view>
+               <view class="right">
+                  <input name="receive_user_phone" value="{{receiveForm.receive_user_phone}}" type="number" maxlength="11" placeholder='请输入收货电话' placeholder-class="placeholder" disabled></input>
+               </view>
+            </view>
+            <view class="content">
+               <view class="left">
+                  <text class="icon iconfont icon-dizhi"></text>
+               </view>
+               <view class="right">
+                  <input name="receive_address" value="{{receiveForm.receive_address}}" placeholder='请输入收货地址' placeholder-class="placeholder"></input>
+               </view>
+            </view>
+            <view class="save">
+               <button type="primary" size="mini" formType="submit">提交订单</button>
+            </view>
+         </form>
       </view>
-     </view>
-    </view>
    </view>
-  </view>
-  <view wx:if="{{dialog.type=='3'}}" class="dialog_3">
-   <form bindsubmit="onSubmit">
-    <view class="content">
-     <view class="left">
-      <text class="icon iconfont icon-xingming"></text>
-     </view>
-     <view class="right">
-      <input name="receive_user_name" value="{{receiveForm.receive_user_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 name="receive_user_phone" value="{{receiveForm.receive_user_phone}}" type="number" maxlength="11" 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="receive_address" value="{{receiveForm.receive_address}}" placeholder='请输入收货地址' placeholder-class="placeholder"></input>
-     </view>
-    </view>
-    <view class="save">
-     <button type="primary" size="mini" formType="submit">提交订单</button>
-    </view>
-   </form>
-  </view>
- </view>
 </van-dialog>

+ 129 - 121
pages/market_buy/index.js

@@ -3,139 +3,147 @@ const { buy_status } = require('../../utils/dict');
 const app = getApp();
 Page({
 
- /**
-  * 页面的初始数据
-  */
- data: {
-  frameStyle: { useTop: true, name: '采买需求信息', leftArrow: true, useBar: false },
-  // 主体高度
-  infoHeight: '',
-  // 采买列表
-  list: [{ order_num: 'Hgj4757945hdFueu', receive_user_name: '胡图图', mech_name: '翻斗幼儿园-小豆班', status_name: '待供货单位确认', status: '1', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', order: [{ name: '小洋人', num: '123', money: '3000' }, { name: '娃哈哈', num: '123', money: '344' }] }],
-  // 弹框
-  dialog: { title: '详细信息', show: false, type: '1' },
-  // 详细信息
-  info: {},
-  // 导出条件
-  exportForm: {},
-  // 商品状态
-  statusList: buy_status
- },
- back: function () {
-  wx.navigateBack({ url: '/pages/home/index' })
- },
- // 导出条件
- export_term: function () {
-  this.setData({ dialog: { title: '导出条件', show: true, type: '2' }, })
- },
- // 选择状态
- statusChange: function (e) {
-  let { value } = e.detail;
-  if (value) {
-   let data = this.data.statusList[value];
-   this.setData({ 'exportForm.status': data.value })
-  }
- },
- // 开始时间
- startChange: function (e) {
-  let { value } = e.detail;
-  this.setData({ 'exportForm.apply_date@start': value })
- },
- // 结束时间
- endChange: function (e) {
-  let { value } = e.detail;
-  this.setData({ 'exportForm.apply_date@end': value })
- },
- // 重置条件
- expertReset: function (e) {
-  this.setData({ exportForm: { user_name: '', mech_name: '', receive_user_name: '', status: null } })
- },
- // 确认导出
- exportSubmit: function (e) {
-  console.log(e.detail.value);
-  console.log('打开文档成功')
- },
- // 添加采购申请
- toAdd: function () {
-  wx.navigateTo({ url: `/pages/market_buy/detail` })
- },
- // 详细信息
- toView: function (e) {
-  let item = e.currentTarget.dataset.item;
-  this.setData({ info: item })
-  this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
- },
- // 订单签收
- toSign: function (e) {
-  wx.showToast({ title: `订单签收完成`, icon: 'success', duration: 2000 })
- },
- /**
-  * 生命周期函数--监听页面加载
-  */
- onLoad: function (options) {
-  // 计算高度
-  this.searchHeight();
- },
- search: function (data) {
+   /**
+    * 页面的初始数据
+    */
+   data: {
+      frameStyle: { useTop: true, name: '采买需求信息', leftArrow: true, useBar: false },
+      // 主体高度
+      infoHeight: '',
+      // 采买列表
+      list: [{ order_num: 'Hgj4757945hdFueu', receive_user_name: '胡图图', mech_name: '翻斗幼儿园-小豆班', status_name: '待供货单位确认', status: '1', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', order: [{ name: '小洋人', num: '123', money: '3000' }, { name: '娃哈哈', num: '123', money: '344' }] }],
+      // 弹框
+      dialog: { title: '详细信息', show: false, type: '1' },
+      // 详细信息
+      info: {},
+      // 导出条件
+      exportForm: {},
+      // 商品状态
+      statusList: buy_status
+   },
+   back: function () {
+      wx.navigateBack({ url: '/pages/home/index' })
+   },
+   // 导出条件
+   export_term: function () {
+      this.setData({ dialog: { title: '导出条件', show: true, type: '2' }, })
+   },
+   // 选择状态
+   statusChange: function (e) {
+      let { value } = e.detail;
+      if (value) {
+         let data = this.data.statusList[value];
+         this.setData({ 'exportForm.status': data.value })
+      }
+   },
+   // 开始时间
+   startChange: function (e) {
+      let { value } = e.detail;
+      this.setData({ 'exportForm.apply_date@start': value })
+   },
+   // 结束时间
+   endChange: function (e) {
+      let { value } = e.detail;
+      this.setData({ 'exportForm.apply_date@end': value })
+   },
+   // 重置条件
+   expertReset: function (e) {
+      this.setData({ exportForm: { user_name: '', mech_name: '', receive_user_name: '', status: null } })
+   },
+   // 确认导出
+   exportSubmit: function (e) {
+      console.log(e.detail.value);
+      console.log('打开文档成功')
+   },
+   // 添加采购申请
+   toAdd: function () {
+      wx.navigateTo({ url: `/pages/market_buy/detail` })
+   },
+   // 详细信息
+   toView: function (e) {
+      let item = e.currentTarget.dataset.item;
+      this.setData({ info: item })
+      this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+   },
+   // 订单签收
+   toSign: function (e) {
+      wx.showModal({
+         title: '是否确认签收订单',
+         success(res) {
+            if (res.confirm) {
+               wx.showToast({ title: `订单签收完成`, icon: 'success', duration: 2000 })
+            } else if (res.cancel) {
+            }
+         }
+      })
+   },
+   /**
+    * 生命周期函数--监听页面加载
+    */
+   onLoad: function (options) {
+      // 计算高度
+      this.searchHeight();
+   },
+   search: function (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 })
- },
+   },
+   // 计算高度
+   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 () {
+   /**
+    * 生命周期函数--监听页面初次渲染完成
+    */
+   onReady: function () {
 
- },
+   },
 
- /**
-  * 生命周期函数--监听页面显示
-  */
- onShow: function () {
-  this.search();
- },
+   /**
+    * 生命周期函数--监听页面显示
+    */
+   onShow: function () {
+      this.search();
+   },
 
- /**
-  * 生命周期函数--监听页面隐藏
-  */
- onHide: function () {
+   /**
+    * 生命周期函数--监听页面隐藏
+    */
+   onHide: function () {
 
- },
+   },
 
- /**
-  * 生命周期函数--监听页面卸载
-  */
- onUnload: function () {
+   /**
+    * 生命周期函数--监听页面卸载
+    */
+   onUnload: function () {
 
- },
+   },
 
- /**
-  * 页面相关事件处理函数--监听用户下拉动作
-  */
- onPullDownRefresh: function () {
+   /**
+    * 页面相关事件处理函数--监听用户下拉动作
+    */
+   onPullDownRefresh: function () {
 
- },
+   },
 
- /**
-  * 页面上拉触底事件的处理函数
-  */
- onReachBottom: function () {
+   /**
+    * 页面上拉触底事件的处理函数
+    */
+   onReachBottom: function () {
 
- },
+   },
 
- /**
-  * 用户点击右上角分享
-  */
- onShareAppMessage: function () {
+   /**
+    * 用户点击右上角分享
+    */
+   onShareAppMessage: function () {
 
- }
+   }
 })

+ 113 - 0
pages/order/index.js

@@ -0,0 +1,113 @@
+// pages/order/index.js
+const app = getApp();
+Page({
+
+   /**
+    * 页面的初始数据
+    */
+   data: {
+      frameStyle: { useTop: true, name: '订单信息', leftArrow: true, useBar: false },
+      // 主体高度
+      infoHeight: '',
+      userInfo: {},
+      // 查询
+      shoopingtext: '',
+      // 采购申请审核
+      list: [
+         { order_num: 'Ygj4757945hdFueu', receive_user_name: '胡英俊', mech_name: '翻斗幼儿园-小豆班', status_name: '待供货单位确认', status: '0', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', },
+         { order_num: 'Hgj4757945hdFueu', receive_user_name: '胡图图', mech_name: '翻斗幼儿园-小豆班', status_name: '待供货单位确认', status: '1', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', order: [{ name: '小洋人', num: '123', money: '3000' }, { name: '娃哈哈', num: '123', money: '344' }] }
+      ],
+      // 弹框
+      dialog: { title: '详细信息', show: false, type: '1' },
+      // 详细信息
+      info: {},
+   },
+
+   back: function () {
+      wx.navigateBack({ url: '/pages/home/index' })
+   },
+   // 详细信息
+   toView: function (e) {
+      let item = e.currentTarget.dataset.item;
+      this.setData({ info: item })
+      this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+   },
+   // 订单确认
+   toCheck: function (e) {
+      wx.showModal({
+         title: '订单确认',
+         content: '您是否同意订单?',
+         confirmText: '同意',
+         cancelText: '拒绝',
+         success: (res) => {
+            if (res.confirm) wx.showToast({ title: `已成功同意订单`, icon: 'success', duration: 2000 })
+            else if (res.cancel) wx.showToast({ title: `已拒绝该订单`, icon: 'error', 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/order/index.json

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

+ 153 - 0
pages/order/index.less

@@ -0,0 +1,153 @@
+.main {
+   position: relative;
+   width: 100%;
+
+   .one {
+      position: relative;
+      padding: 0 8px;
+      height: 40px;
+      overflow: hidden;
+      border-bottom: 1px dashed #000000;
+
+      input {
+         float: left;
+         width: 85%;
+         padding: 2px 5px;
+         margin: 5px 0;
+         border-radius: 5px;
+         border: 1px solid #cccccc;
+         background-color: #ffffff;
+      }
+
+      text {
+         position: relative;
+         left: 10px;
+         top: 6px;
+         font-size: 17px;
+      }
+
+   }
+
+   .two {
+      position: relative;
+      padding: 10px;
+
+      .list {
+         float: left;
+         width: 100%;
+         margin: 0 0 8px 0;
+         background-color: #f9f9f9;
+         border-radius: 5px;
+         padding: 8px 0;
+
+         .name {
+            font-size: 16px;
+            margin: 0 0 5px 0;
+            padding: 0 10px;
+            font-weight: bold;
+         }
+      }
+   }
+}
+
+
+.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;
+}
+
+.dialog .dialog_1 .order {
+   position: relative;
+   padding: 8px 0;
+   border-radius: 6px;
+   margin: 0 0 5px 0;
+   background-color: #f1f1f1;
+}
+
+.dialog .dialog_1 .order .order_1 {
+   position: relative;
+   margin: 0 10px;
+}
+
+.dialog .dialog_1 .order .order_1 text {
+   font-size: 14px;
+   color: #666666;
+}
+
+.dialog .dialog_1 .order .order_2 {
+   position: relative;
+   padding: 0 5px;
+   margin: 5px 0 0 0;
+}
+
+.dialog .dialog_1 .order .order_2 .list {
+   margin: 0 0 8px 0;
+   background-color: #f9f9f9;
+   border-radius: 5px;
+   padding: 8px 0;
+}
+
+.dialog .dialog_1 .order .order_2 .list .name {
+   font-size: 16px;
+   margin: 0 0 5px 0;
+   padding: 0 10px;
+}
+
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo {
+   margin: 0 0 5px 0;
+   font-size: 14px;
+   color: #666666;
+   padding: 0 10px;
+}
+
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo text {
+   color: #000000;
+}
+
+.van-dialog__header {
+   padding-top: 0 !important;
+   padding: 10px 0 !important;
+}

+ 76 - 0
pages/order/index.wxml

@@ -0,0 +1,76 @@
+<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.order_num}}</view>
+        <view class="other">
+          <view class="otherInfo textOver">收货人:<text>{{item.receive_user_name }}</text></view>
+          <view class="otherInfo textOver">收货电话:<text>{{item.receive_user_phone }}</text></view>
+          <view class="otherInfo textOver">收货地址:<text>{{item.receive_address }}</text></view>
+          <view class="otherInfo textOver">货物状态:<text>{{item.status_name }}</text></view>
+        </view>
+        <view class="btn">
+          <button type="info" size="mini" bindtap="toView" data-id="{{item.id}}" data-item="{{item}}">详细信息</button>
+          <button type="primary" size="mini" bindtap="toCheck" data-id="{{item.id}}" wx:if="{{item.status=='0'}}">订单确认</button>
+          <button type="primary" size="mini" bindtap="toSign" data-id="{{item.id}}" wx:if="{{item.status=='2'}}">订单确认签收</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="order_num" value="{{info.order_num}}" 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="user_phone" value="{{info.user_phone}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>供货单位:</text></view>
+          <view class="right"><input name="mech_name" value="{{info.mech_name}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>供货总价(元):</text></view>
+          <view class="right" style="color: #ff0000;font-weight: bold;"><input name="money" value="{{info.money}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>收货人:</text></view>
+          <view class="right"><input name="receive_user_name" value="{{info.receive_user_name}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>收货人电话:</text></view>
+          <view class="right"><input name="receive_user_phone" value="{{info.receive_user_phone}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>收货地址:</text></view>
+          <view class="right"><input name="receive_address" value="{{info.receive_address}}" disabled></input></view>
+        </view>
+        <view class="order">
+          <view class="order_1"><text>商品列表:</text></view>
+          <view class="order_2">
+            <view class="list" wx:key="item" wx:for="{{info.order}}">
+              <view class="name">{{item.name}}</view>
+              <view class="other">
+                <view class="otherInfo">购买数量:<text>{{item.num||'暂无' }}</text></view>
+                <view class="otherInfo">商品单价:<text>{{item.money||'暂无' }}</text></view>
+              </view>
+            </view>
+          </view>
+        </view>
+      </form>
+    </view>
+  </view>
+</van-dialog>

+ 127 - 0
pages/order/index.wxss

@@ -0,0 +1,127 @@
+.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;
+  font-weight: bold;
+}
+.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;
+}
+.dialog .dialog_1 .order {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_1 .order .order_1 {
+  position: relative;
+  margin: 0 10px;
+}
+.dialog .dialog_1 .order .order_1 text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_1 .order .order_2 {
+  position: relative;
+  padding: 0 5px;
+  margin: 5px 0 0 0;
+}
+.dialog .dialog_1 .order .order_2 .list {
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+}
+.dialog .dialog_1 .order .order_2 .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo text {
+  color: #000000;
+}
+.van-dialog__header {
+  padding-top: 0 !important;
+  padding: 10px 0 !important;
+}

+ 105 - 0
pages/payment/index.js

@@ -0,0 +1,105 @@
+// pages/payment/index.js
+const app = getApp();
+Page({
+
+   /**
+    * 页面的初始数据
+    */
+   data: {
+      frameStyle: { useTop: true, name: '订单信息', leftArrow: true, useBar: false },
+      // 主体高度
+      infoHeight: '',
+      // 采购申请审核
+      list: [
+         { order_num: 'Ygj4757945hdFueu', receive_user_name: '胡英俊', mech_name: '翻斗幼儿园-小豆班', status_name: '待财务确认', status: '3', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', },
+         { order_num: 'Hgj4757945hdFueu', receive_user_name: '胡图图', mech_name: '翻斗幼儿园-小豆班', status_name: '待财务确认', status: '3', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', order: [{ name: '小洋人', num: '123', money: '3000' }, { name: '娃哈哈', num: '123', money: '344' }] },
+      ],
+   },
+   back: function () {
+      wx.navigateBack({ url: '/pages/home/index' })
+   },
+   // 详细信息
+   toView: function (e) {
+      let item = e.currentTarget.dataset.item;
+      this.setData({ info: item })
+      this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+   },
+   // 财务确认订单
+   toSign: function (e) {
+      wx.showModal({
+         title: '订单确认',
+         content: '您是否确认订单?',
+         confirmText: '同意',
+         success: (res) => {
+            if (res.confirm) wx.showToast({ title: `已成功同意订单`, icon: 'success', duration: 2000 })
+            else if (res.cancel) { }
+         }
+      })
+   },
+   /**
+    * 生命周期函数--监听页面加载
+    */
+   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/payment/index.json

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

+ 153 - 0
pages/payment/index.less

@@ -0,0 +1,153 @@
+.main {
+   position: relative;
+   width: 100%;
+
+   .one {
+      position: relative;
+      padding: 0 8px;
+      height: 40px;
+      overflow: hidden;
+      border-bottom: 1px dashed #000000;
+
+      input {
+         float: left;
+         width: 85%;
+         padding: 2px 5px;
+         margin: 5px 0;
+         border-radius: 5px;
+         border: 1px solid #cccccc;
+         background-color: #ffffff;
+      }
+
+      text {
+         position: relative;
+         left: 10px;
+         top: 6px;
+         font-size: 17px;
+      }
+
+   }
+
+   .two {
+      position: relative;
+      padding: 10px;
+
+      .list {
+         float: left;
+         width: 100%;
+         margin: 0 0 8px 0;
+         background-color: #f9f9f9;
+         border-radius: 5px;
+         padding: 8px 0;
+
+         .name {
+            font-size: 16px;
+            margin: 0 0 5px 0;
+            padding: 0 10px;
+            font-weight: bold;
+         }
+      }
+   }
+}
+
+
+.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;
+}
+
+.dialog .dialog_1 .order {
+   position: relative;
+   padding: 8px 0;
+   border-radius: 6px;
+   margin: 0 0 5px 0;
+   background-color: #f1f1f1;
+}
+
+.dialog .dialog_1 .order .order_1 {
+   position: relative;
+   margin: 0 10px;
+}
+
+.dialog .dialog_1 .order .order_1 text {
+   font-size: 14px;
+   color: #666666;
+}
+
+.dialog .dialog_1 .order .order_2 {
+   position: relative;
+   padding: 0 5px;
+   margin: 5px 0 0 0;
+}
+
+.dialog .dialog_1 .order .order_2 .list {
+   margin: 0 0 8px 0;
+   background-color: #f9f9f9;
+   border-radius: 5px;
+   padding: 8px 0;
+}
+
+.dialog .dialog_1 .order .order_2 .list .name {
+   font-size: 16px;
+   margin: 0 0 5px 0;
+   padding: 0 10px;
+}
+
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo {
+   margin: 0 0 5px 0;
+   font-size: 14px;
+   color: #666666;
+   padding: 0 10px;
+}
+
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo text {
+   color: #000000;
+}
+
+.van-dialog__header {
+   padding-top: 0 !important;
+   padding: 10px 0 !important;
+}

+ 75 - 0
pages/payment/index.wxml

@@ -0,0 +1,75 @@
+<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.order_num}}</view>
+            <view class="other">
+               <view class="otherInfo textOver">采买人:<text>{{item.user_name }}</text></view>
+               <view class="otherInfo textOver">供货单位:<text>{{item.mech_name }}</text></view>
+               <view class="otherInfo textOver">供货总价(元):<text style="color: #ff0000;">{{item.money }}</text></view>
+               <view class="otherInfo textOver">货物状态:<text>{{item.status_name }}</text></view>
+            </view>
+            <view class="btn">
+               <button type="info" size="mini" bindtap="toView" data-item="{{item}}" data-id="{{item.id}}">详细信息</button>
+               <button type="primary" size="mini" bindtap="toSign" data-id="{{item.id}}" wx:if="{{item.status=='3'}}">订单确认</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="order_num" value="{{info.order_num}}" 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="user_phone" value="{{info.user_phone}}" disabled></input></view>
+            </view>
+            <view class="content">
+               <view class="left"><text>供货单位:</text></view>
+               <view class="right"><input name="mech_name" value="{{info.mech_name}}" disabled></input></view>
+            </view>
+            <view class="content">
+               <view class="left"><text>供货总价(元):</text></view>
+               <view class="right" style="color: #ff0000;font-weight: bold;"><input name="money" value="{{info.money}}" disabled></input></view>
+            </view>
+            <view class="content">
+               <view class="left"><text>收货人:</text></view>
+               <view class="right"><input name="receive_user_name" value="{{info.receive_user_name}}" disabled></input></view>
+            </view>
+            <view class="content">
+               <view class="left"><text>收货人电话:</text></view>
+               <view class="right"><input name="receive_user_phone" value="{{info.receive_user_phone}}" disabled></input></view>
+            </view>
+            <view class="content">
+               <view class="left"><text>收货地址:</text></view>
+               <view class="right"><input name="receive_address" value="{{info.receive_address}}" disabled></input></view>
+            </view>
+            <view class="order">
+               <view class="order_1"><text>商品列表:</text></view>
+               <view class="order_2">
+                  <view class="list" wx:key="item" wx:for="{{info.order}}">
+                     <view class="name">{{item.name}}</view>
+                     <view class="other">
+                        <view class="otherInfo">购买数量:<text>{{item.num||'暂无' }}</text></view>
+                        <view class="otherInfo">商品单价:<text>{{item.money||'暂无' }}</text></view>
+                     </view>
+                  </view>
+               </view>
+            </view>
+         </form>
+      </view>
+   </view>
+</van-dialog>

+ 127 - 0
pages/payment/index.wxss

@@ -0,0 +1,127 @@
+.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;
+  font-weight: bold;
+}
+.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;
+}
+.dialog .dialog_1 .order {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_1 .order .order_1 {
+  position: relative;
+  margin: 0 10px;
+}
+.dialog .dialog_1 .order .order_1 text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_1 .order .order_2 {
+  position: relative;
+  padding: 0 5px;
+  margin: 5px 0 0 0;
+}
+.dialog .dialog_1 .order .order_2 .list {
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+}
+.dialog .dialog_1 .order .order_2 .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo text {
+  color: #000000;
+}
+.van-dialog__header {
+  padding-top: 0 !important;
+  padding: 10px 0 !important;
+}