zhanghongrui пре 2 година
родитељ
комит
749a36c987

+ 34 - 33
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'
     // })
   },
   // 企业跳转
@@ -95,7 +95,7 @@ Page({
     })
   },
   //物资跳转
-  bindViewWuZi(){
+  bindViewWuZi() {
     wx.navigateTo({
       url: '../material/material',
     })
@@ -109,7 +109,7 @@ Page({
   //巡检跳转
   bindViewXunJian() {
     // wx.navigateTo({
-      // url: '../xunjian/xunjian',
+    // url: '../xunjian/xunjian',
     // })
   },
   // 使用攻略跳转
@@ -178,7 +178,7 @@ Page({
 
     //   })
     // } else {
-      this.callByName(this.data.dofun)
+    this.callByName(this.data.dofun)
     // }
   },
 
@@ -195,37 +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"){
+    } 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) {
@@ -248,8 +249,8 @@ Page({
   //     }
   //   })
   // },
-  onTabItemTap(item){
-    console.log("$$$$$$$",item)
+  onTabItemTap(item) {
+    console.log("$$$$$$$", item)
   }
 
 

+ 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;
+}
+