浏览代码

Merge branch 'master' of http://121.37.83.100:3000/sooka_edyj/sooka_edyj_minapp

menc 2 年之前
父节点
当前提交
d14e6cfcc1

+ 3 - 1
app.json

@@ -25,7 +25,9 @@
     "pages/notice/notice",
     "pages/notice/notice_details",
     "pages/material/material",
-    "pages/denglu/denglu"
+    "pages/denglu/denglu",
+    "pages/material/material_details"
+ 
   
   ],
   "requiredPrivateInfos": [

+ 40 - 31
pages/index/index.js

@@ -44,36 +44,36 @@ Page({
     //记录首页点击-登录后继续跳转
     dofun: null,
     xunjianImgCount: '000,000',
-    NoticeTitle:"登录查看公告"
+    NoticeTitle: "登录查看公告"
   },
 
   onLoad() {
     this.setData({
       imgUrls: [
-        this.data.host+'/images/banner.jpg',
-        this.data.host+'/images/banner3.jpg',
-        this.data.host+'/images/banner2.jpg'
+        this.data.host + '/images/banner.jpg',
+        this.data.host + '/images/banner3.jpg',
+        this.data.host + '/images/banner2.jpg'
       ]
     })
   },
 
-  onShow(){
-    let token =wx.getStorageSync('access_token')
-    if(token==''||token==null){
-      app.globalToken=null
+  onShow() {
+    let token = wx.getStorageSync('access_token')
+    if (token == '' || token == null) {
+      app.globalToken = null
       wx.showToast({
         title: '尚未登录,登录后即可使用',
-        icon:'none'
+        icon: 'none'
       })
     }
-    
+
     this.initIndexPage();
   },
 
   // 待办跳转
   bindViewDaiBan() {
     // wx.navigateTo({
-      // url: '../daiban/daiban'
+    // url: '../daiban/daiban'
     // })
   },
   // 企业跳转
@@ -94,6 +94,12 @@ Page({
       url: '../notice/notice'
     })
   },
+  //物资跳转
+  bindViewWuZi() {
+    wx.navigateTo({
+      url: '../material/material',
+    })
+  },
   // 新手指南跳转
   bindViewNewComer() {
     wx.navigateTo({
@@ -103,7 +109,7 @@ Page({
   //巡检跳转
   bindViewXunJian() {
     // wx.navigateTo({
-      // url: '../xunjian/xunjian',
+    // url: '../xunjian/xunjian',
     // })
   },
   // 使用攻略跳转
@@ -172,7 +178,7 @@ Page({
 
     //   })
     // } else {
-      this.callByName(this.data.dofun)
+    this.callByName(this.data.dofun)
     // }
   },
 
@@ -189,35 +195,38 @@ Page({
       this.bindViewXunCha()
     } else if (name == "bindViewXunjianimg") {
       this.bindViewXunjianimg()
-    }else if(name=="bindViewGengDuo"){
+    } else if (name == "bindViewGengDuo") {
       this.bindViewGengDuo()
+    } else if (name == "bindViewWuZi") {
+      this.bindViewWuZi()
     }
   },
 
   initIndexPage() {
-    if(app.globalToken==null||app.globalToken==''){
+    if (app.globalToken == null || app.globalToken == '') {
       return
     }
-   
+
     http.send_post("/system/AppIndexController/getIndexPageData", null, this.initIndexPageSuccess)
   },
- 
+
   initIndexPageSuccess(res) {
-    if(res.code==200){
-      this.setData({
-          xunjianImgCount: res.xunjianImgCount,
-        })
-    if(res.noticeList.length>0){
-      this.setData({
-        NoticeTitle:res.noticeList[0].noticeTitle
-      })
-    }else{
+    
+    if (res.code == 200) {
       this.setData({
-        NoticeTitle:"暂无公告"
+        xunjianImgCount: res.data.xunjianImgCount,
       })
+      if (res.data.noticeList.length > 0) {
+        this.setData({
+          NoticeTitle: res.data.noticeList[0].noticeTitle
+        })
+      } else {
+        this.setData({
+          NoticeTitle: "暂无公告"
+        })
+      }
     }
-    }
-  
+
   },
 
   // getSysUserInfo(info) {
@@ -240,8 +249,8 @@ Page({
   //     }
   //   })
   // },
-  onTabItemTap(item){
-    console.log("$$$$$$$",item)
+  onTabItemTap(item) {
+    console.log("$$$$$$$", item)
   }
 
 

+ 1 - 1
pages/index/index.wxml

@@ -101,7 +101,7 @@
       </view>
         <text>会议</text>
       </view>
-      <view class="icon_vi">
+      <view class="icon_vi" bindtap="bindViewWuZi">
         <view class="icon_bg icon_wz">
         <i class="iconfont icon-wuzichubei"></i>
       </view>

+ 144 - 47
pages/material/material.js

@@ -1,66 +1,163 @@
-// pages/material/material.js
-Page({
+import http from '../../base/httputil'
+const app = getApp()
 
-  /**
-   * 页面的初始数据
-   */
+Page({
   data: {
-    dataList:[],
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {
 
+    /**
+     * 控制上拉到底部时是否出现 "数据加载中..."
+     */
+    hidden: true,
+    /**
+     * 数据是否正在加载中,避免数据多次加载
+     */
+    loadingData: false,
+    enterpriseList: [],
+    isRefresh: true,
+    total: 0,
+    pageNum: 1 // 页码
   },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
+  onLoad: function () {
+    // wx.showLoading({
+    //   title: '加载中'
+    // })
+    this.loadData()
   },
+  //加载数据
+  loadData: function () {
+    let obj = new Object()
+    obj.pageNum = this.data.pageNum
+    obj.pageSize = 10
+    obj.reasonable= false
+    http.send_get("/system/AppMaterialController/geMaterialList", obj, this.getQiyeEnterpriseListSuccess)
 
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow() {
-    getDataList();
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
 
   },
 
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
+  getQiyeEnterpriseListSuccess(res) {
+
+console.log("@@@@",res)
+if(res.code==200){
+     // 显示加载图标
+     wx.showLoading({
+      title: '玩命加载中',
+    })
+    var that = this
+
+    if(res.data.rows.length==0){
+      wx.showToast({
+        title: '暂无更多数据',
+        icon:"none"
+      })
+    }
+    if (this.data.isRefresh) {
+      this.setData({
+        enterpriseList: res.data.rows,
+        total: res.data.total
+      })
+
+
+
+      // 隐藏导航栏加载框
+      setTimeout(function () {
+        that.setData({
+          loadingData: false
+        });
+        wx.hideNavigationBarLoading();
+        // 停止下拉动作
+        wx.stopPullDownRefresh();
+        wx.hideLoading()
+
+      }, 1000)
+
+    } else {
+      this.setData({
+        enterpriseList: this.data.enterpriseList.concat(res.data.rows)
+      })
+      // 隐藏加载框
+
+      setTimeout(function () {
+        that.setData({
+          hidden: true,
+          loadingData: false
+        });
+
+        wx.hideLoading();
+      }, 1000)
+
+    }
+  }else{
+    console.log("@@!","请求失败")
+  }
   },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
+  onPullDownRefresh: function () {
+    // 显示顶部刷新图标
+    wx.showNavigationBarLoading();
+    var that = this;
+    var loadingData = this.data.loadingData
+    if (loadingData) {
+      return;
+    }
+    that.setData({
+      pageNum: 1,
+      isRefresh: true
+    })
+    this.loadData()
   },
-
   /**
    * 页面上拉触底事件的处理函数
    */
-  onReachBottom() {
-
+  onReachBottom: function () {
+    let that = this
+    var loadingData = that.data.loadingData
+   
+    var hidden = that.data.hidden
+    // 页数+1
+    that.setData({
+      pageNum: that.data.pageNum + 1,
+      isRefresh: false
+    })
+    if (hidden) {
+      that.setData({
+        hidden: false
+      });
+      console.info(that.data.hidden);
+    }
+
+    if (loadingData) {
+      return;
+    }
+    that.setData({
+      loadingData: true
+    });
+
+    
+    //console.log("@@@@"+Math.ceil(this.data.total/10))
+   // if(Math.ceil(that.data.total/10)>=that.data.pageNum){
+      that.loadData();
+  
+    // }else{
+     
+    //   setTimeout(function () {
+    //     that.setData({
+    //       hidden: true,
+    //     });
+
+    //   }, 2000)
+    // }
+
+   
   },
 
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
 
+  bindViewDetails(e) {
+    let material_details = e.currentTarget.dataset.index
+   
+ 
+
+ 
+    wx.navigateTo({
+      url: '../material/material_details?details='+JSON.stringify(material_details)
+    })
   }
 })

+ 3 - 0
pages/material/material.json

@@ -6,6 +6,9 @@
 
   "navigationBarBackgroundColor": "#f94b0e",
   "navigationBarTextStyle": "white",
+  "enablePullDownRefresh": true,
+  "onPullDownRefresh": true,
+  "onReachBottom": true,
   "navigationBarTitleText": "物资"
 
 }

+ 18 - 8
pages/material/material.wxml

@@ -11,14 +11,24 @@
     </button>
   </view>
   <!-- 列表 -->
-  <view class="list_vi">
-    <view class="list_li" bindtap="bindViewDetails" wx:for="{{enterpriseList}}" wx:key="index" data-enterpriseid="{{item.busEnterpriseId}}">
-      <i class="list_icon iconfont icon-queding" wx:if="{{item.riskCount == 0}}"></i>
-      <i class="list_icon iconfont icon-yingjipingtai" wx:if="{{item.riskCount > 0}}"></i>
-      <text>{{item.businessName}}</text>
+<view class="list_vi">
+    <view class="list_li" catchtap="bindViewDetails" wx:for="{{enterpriseList}}" wx:key="index" data-index="{{item}}">
+      <!-- <i class="list_icon iconfont icon-queding" wx:if="{{item.riskCount == 0}}"></i>
+      <i class="list_icon iconfont icon-yingjipingtai" wx:if="{{item.riskCount > 0}}"></i> -->
+      <text>{{item.materialName}}</text>
+      <text>{{item.connector}}</text>
       <i class="iconfont icon-xiangyou list_right"></i>
     </view>
-
-  </view>
-    
 </view>
+    <view class='data-loading' hidden='{{hidden}}'>
+    数据加载中...
+  </view>
+    </view>
+
+    
+
+
+
+
+
+

+ 13 - 1
pages/material/material.wxss

@@ -1,4 +1,4 @@
-/* pages/material/material.wxss */.qy_con {
+.qy_con {
   display: flex;
   flex-direction: row;
   justify-content: space-around;
@@ -33,3 +33,15 @@
 .qy_con view p {
   font-size: 35rpx;
 }
+
+.icon-jiahao {
+  font-size: 60rpx;
+}
+
+.data-loading {
+  height: 100rpx;
+  line-height: 100rpx;
+  background-color: #fff;
+  text-align: center;
+  font-size: 14px;
+}

+ 32 - 0
pages/material/material_details copy.wxml

@@ -0,0 +1,32 @@
+<view class="container">
+  <view>
+        <span>标题:</span>
+        <i>{{noticeTitle}}</i>
+      </view>
+      <view>
+        <span>时间:</span>
+        <i>{{noticeTime}}</i>
+      </view>
+      <view>
+        <span>作者:</span>
+        <i>{{noticeBy}}</i>
+      </view>
+
+      <view>
+        <span>类型:</span>
+        <i>{{noticeType=='1'?'通知':'公告'}}</i>
+      </view>
+      <view>
+        <span>内容:</span>
+        <i>{{noticeContent}}</i>
+      </view>
+
+</view>
+
+
+
+
+
+
+
+

+ 109 - 0
pages/material/material_details.js

@@ -0,0 +1,109 @@
+// pages/material/material_details.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    connector: "",
+    connectorPhone: "",
+    createBy: "",
+    createTime: "",
+
+    materialName: "",
+    materialParms: "",
+    materialType: "",
+    num: "",
+
+    productionDate: "",
+    purpose: "",
+    remark: "",
+    searchValue: "",
+    technology: "",
+
+    warehouseName: ""
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    let details = JSON.parse(options.details)
+    this.setData({
+      connector: details.connector,
+      connectorPhone: details.connectorPhone,
+      createBy: details.createBy,
+      createTime: details.createTime,
+
+      materialName: details.materialName,
+      materialParms: details.materialParms,
+      materialType: details.materialType,
+      num: details.num,
+
+      productionDate: details.productionDate,
+      purpose: details.purpose,
+      remark: details.remark,
+      searchValue: details.searchValue,
+      technology: details.technology,
+
+      warehouseName: details.warehouseName
+
+    })
+
+  },
+//拨打电话
+Call() {
+  console.log("@@##"+this.data.connectorPhone)
+  wx.makePhoneCall({
+    phoneNumber: this.data.connectorPhone
+  })
+},
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 13 - 0
pages/material/material_details.json

@@ -0,0 +1,13 @@
+{
+  "component": true, 
+  "usingComponents": {
+    
+  },
+
+
+  "navigationBarBackgroundColor": "#f94b0e",
+  "navigationBarTextStyle": "white",
+  "navigationBarTitleText": "物资详情"
+
+}
+

+ 61 - 0
pages/material/material_details.wxml

@@ -0,0 +1,61 @@
+<!-- 物资详情页面 -->
+<view class="container">
+<view class="map_view">
+
+
+
+<view>
+  <span>物资名称:</span>
+  <i>{{materialName}}</i>
+</view>
+<view>
+  <span>所属仓库名称:</span>
+  <i>{{enterpriseDetails.warehouseName}}</i>
+</view>
+<view>
+  <span>负责人:</span>
+  <i>{{connector}}</i>
+</view>
+ <view class="phone" bindtap="Call"></view>>
+  <span>联系电话:</span>
+  <i>{{connectorPhone}}</i>
+</view>
+<view>
+  <span>创建人:</span>
+  <i>{{createBy}}</i>
+</view>
+<view>
+  <span>生产日期:</span>
+  <i>{{productionDate}}</i>
+</view>
+<view>
+  <span>技术状况:</span>
+  <i>{{technology}}</i>
+</view>
+<view>
+  <span>品牌、型号:</span>
+  <i>{{materialParms}}</i>
+</view>
+<view>
+  <span>主要功能和用途:</span>
+  <i>{{purpose}}</i>
+</view>
+<view>
+  <span>物资类型:</span>
+  <i>{{materialType}}</i>
+</view>
+<!-- <view class="phone" bindtap="Call">
+  <span>负责人电话:</span>
+  <i>{{enterpriseDetails.mainPersonPhone}}</i>
+</view> -->
+<view>
+  <span>数量:</span>
+  <i>{{num}}</i>
+</view>
+<view>
+  <span>备注:</span>
+  <i>{{remark}}</i>
+</view>
+
+</view>
+

+ 59 - 0
pages/material/material_details.wxss

@@ -0,0 +1,59 @@
+/* pages/material/material_details.wxss */
+
+
+map{
+  height: 40vh;
+  width: 100vw;
+}
+.map{
+  height: 40vh;
+  width: 100vw;
+  position: relative;
+}
+.map canvas{
+  width:100%;
+  height: 100%;
+}
+.map_view{
+  margin: 30rpx 30rpx;
+}
+.map_view view{
+  display: flex;
+  flex-direction: row;
+  font-size: 34rpx;
+  line-height: 50rpx;
+  padding-bottom: 10rpx;
+}
+.map_view view span{
+  width: 240rpx;
+  text-align: right;
+  color: #181818;
+}
+.map_view view i{
+ color: rgb(146, 146, 146);
+ white-space:normal;
+word-break:break-all;
+word-wrap:break-word
+}
+.map_btn{
+  background: rgba(0, 0, 0, 0.479);
+  display: flex;
+  flex-direction: row;
+  width: 220rpx;
+  height: 70rpx;
+  position: absolute;
+  right:20rpx;
+  bottom:20rpx;
+  z-index: 99999;
+  border-radius: 50rpx;
+  justify-content: space-evenly;
+  align-items: center;
+}
+.map_btn .iconfont{
+  color: #fff;
+  font-size: 50rpx;
+}
+.logo-text{
+  display: none;
+}
+

+ 2 - 8
pages/notice/notice.js

@@ -147,16 +147,10 @@ console.log("@@@@",res)
 
 
   bindViewDetails(e) {
-    let title = e.currentTarget.dataset.title
-    let time = e.currentTarget.dataset.time
-    let by = e.currentTarget.dataset.by
-    let type = e.currentTarget.dataset.type
-    let content = e.currentTarget.dataset.content
- 
-
  
+    let details = e.currentTarget.dataset.index
     wx.navigateTo({
-      url: '../notice/notice_details?title='+title+"&time="+time+"&by="+by+"&type="+type+"&content="+content
+      url: '../notice/notice_details?details='+JSON.stringify(details)
     })
   }
 })

+ 1 - 1
pages/notice/notice.wxml

@@ -4,7 +4,7 @@
 
 <!-- 列表 -->
 <view class="list_vi">
-    <view class="list_li" bindtap="bindViewDetails" wx:for="{{enterpriseList}}" wx:key="index" data-title="{{item.noticeTitle}}" data-time="{{item.createTime}}" data-by="{{item.createBy}}"  data-type="{{item.noticeType}}" data-content="{{item.noticeContent}}">
+    <view class="list_li" catchtap="bindViewDetails" wx:for="{{enterpriseList}}" wx:key="index" data-index="{{item}}">
       <!-- <i class="list_icon iconfont icon-queding" wx:if="{{item.riskCount == 0}}"></i>
       <i class="list_icon iconfont icon-yingjipingtai" wx:if="{{item.riskCount > 0}}"></i> -->
       <text>{{item.noticeTitle}}</text>

+ 6 - 6
pages/notice/notice_details.js

@@ -17,14 +17,14 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-
+let details=JSON.parse(options.details)
 
     this.setData({
-      noticeTitle: options.title,
-      noticeType: options.type,
-      noticeBy: options.by,
-      noticeTime: options.time,
-      noticeContent: options.content
+      noticeTitle: details.noticeTitle,
+      noticeType: details.noticeType,
+       noticeBy: details.createBy,
+       noticeTime: details.createTime,
+       noticeContent: details.noticeContent
     })
   
   },