ycm 2 年之前
父節點
當前提交
06c2ed3159
共有 8 個文件被更改,包括 279 次插入6 次删除
  1. 2 1
      app.json
  2. 2 2
      pages/cabinet/index.js
  3. 6 2
      pages/take/lattice.js
  4. 4 1
      pages/take/lattice.wxml
  5. 172 0
      pages/take/thaw.js
  6. 3 0
      pages/take/thaw.json
  7. 21 0
      pages/take/thaw.wxml
  8. 69 0
      pages/take/thaw.wxss

+ 2 - 1
app.json

@@ -21,7 +21,8 @@
         "pages/take/opentask/opentask",
         "pages/cabinet/orderNum/orderNum",
         "pages/take/blankorder/blankorder",
-        "pages/signFor/storagenext"
+        "pages/signFor/storagenext",
+        "pages/take/thaw"
     ],
     "window": {
         "backgroundTextStyle": "light",

+ 2 - 2
pages/cabinet/index.js

@@ -45,8 +45,8 @@ Page({
      * 页面上拉触底事件的处理函数
      */
     onReachBottom: function () {
-      this.setData({pageindex:this.data.pageindex+=1})
-      this.gettasklist()
+    //   this.setData({pageindex:this.data.pageindex+=1})
+    //   this.gettasklist()
     },
 
     onClose() {

+ 6 - 2
pages/take/lattice.js

@@ -40,8 +40,12 @@ Page({
   onReady: function () {
 
   },
-
-
+  gothaw(e){
+      let that = this
+      wx.navigateTo({
+        url: '/pages/take/thaw?device_id='+that.data.deviceId+'&spout_device_id='+spoutDeviceId,
+      })
+  },
   //点击变色 显示按钮
   seled: function (e) {
     this.setData({

+ 4 - 1
pages/take/lattice.wxml

@@ -168,9 +168,12 @@
     <view class="mod9" wx:if="{{state>=0}}">
       <view class="bd2">
         <block wx:if="{{status=='空闲'||status=='空闲'||status=='待收'||status=='冻结'}}">
-        <view class="outer8">
+        <view class="outer8" wx:if="{{status!='冻结'}}">
           <text lines="1" class="word12" bindtap="show">{{status=='空闲'?'开柜存入':(status=='待收'?'开柜取出':(status=='冻结'?'解冻':''))}}</text>
         </view>
+        <view class="outer8" wx:else>
+          <text lines="1" class="word12" bindtap="gothaw">解冻</text>
+        </view>
         <view class="outer9" wx:if="{{detashow}}" bindtap="deta">
           <text lines="1" class="word13">详情</text>
         </view>

+ 172 - 0
pages/take/thaw.js

@@ -0,0 +1,172 @@
+// pages/take/thaw.js
+const app = getApp();
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        device_id: 0,
+        spout_device_id: 0,
+        remark: '',
+        info: '',
+        userinfo: ''
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+        this.setData({
+            device_id: options.device_id,
+            spout_device_id: options.spout_device_id
+        })
+        this.getinfo()
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+        this.getuser()
+    },
+    getuser(){
+      var that=this;
+      app.api.useApi(app.globalData.baseAppUrl + "api/admin/UserInfo", {
+          appid: wx.getAccountInfoSync().miniProgram.appId
+        }, "get").then(function (res) {
+          console.log(res);
+          if (res.code != 200) {
+              wx.showLoading({
+                  title: '请重新登录',
+                })
+                setTimeout(function () {
+                  wx.hideLoading();
+                  wx.removeStorageSync('token')
+                  wx.reLaunch({
+                    url: '/pages/login/login',
+                  })
+                }, 1000);
+                
+          } else {
+            wx.hideLoading();
+         
+            that.setData({
+                  userinfo:res.message.data
+            })
+            
+          }
+        }).catch(function (err) {
+            
+          console.log(222);
+        })
+    },
+    getinfo() {
+        var that = this;
+        wx.showLoading()
+        app.api.useApi(app.globalData.baseAppUrl + "api/admin/thaw_details", {
+            device_id: that.data.device_id,
+            spout_device_id: that.data.spout_device_id
+        }, "get").then(function (res) {
+            if (res.code != 200) {
+                wx.showLoading({
+                    title: res.message.msg,
+                })
+                setTimeout(function () {
+                    wx.navigateBack({
+                        delta: 1
+                    })
+                    wx.hideLoading();
+                }, 1000);
+
+            } else {
+                that.setData({ info: res.message.data })
+                wx.hideLoading();
+            }
+        }).catch(function (err) {
+            console.log(222);
+        })
+    },
+    gosub() {
+        var that = this;
+        if (that.data.remark != '') {
+            wx.showLoading()
+            app.api.useApi(app.globalData.baseAppUrl + "api/admin/thaw_submit", {
+                device_id: that.data.device_id,
+                spout_device_id: that.data.spout_device_id,
+                remark: that.data.remark
+            }, "post").then(function (res) {
+                if (res.code != 200) {
+                    wx.showLoading({
+                        title: res.message.msg,
+                    })
+                    setTimeout(function () {
+                        wx.hideLoading();
+                    }, 1000);
+                } else {
+                    wx.showToast({
+                        title: res.message.msg,
+                        icon: 'none'
+                    })
+                    setTimeout(function () {
+                        wx.navigateBack()
+                    }, 1000);
+                }
+            }).catch(function (err) {
+                console.log(222);
+            })
+        } else {
+            wx.showToast({
+                title: '请填写操作原因',
+                icon: 'none'
+            })
+        }
+    },
+    goback() {
+        wx.navigateBack()
+    },
+    changetext(e) {
+        this.setData({ remark: e.detail.value })
+    },
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 3 - 0
pages/take/thaw.json

@@ -0,0 +1,3 @@
+{
+    "navigationBarTitleText": "解冻格口"
+}

+ 21 - 0
pages/take/thaw.wxml

@@ -0,0 +1,21 @@
+<!--pages/take/thaw.wxml-->
+<view class="header_view">
+    <view>将当前【{{spout_device_id}}号柜】的状态由「冻结」改为「空闲」</view>
+</view>
+<view class="content_view">
+    <view>操作说明</view>
+    <view>
+        <view>1、请确保此柜问题已解决</view>
+        <view>2、解冻后此格口允许用户下单,请确保柜内物品已清除</view>
+    </view>
+    <view>操作原因</view>
+    <view>
+        <textarea class="textarea_view" bindinput="changetext" placeholder="请填写操作原因"></textarea>
+    </view>
+    <view>操作人:{{userinfo.name}}</view>
+    <view>非正常业务操作,请谨慎确认</view>
+    <view class="display-between">
+        <view class="centerdispley" bindtap="goback">取消</view>
+        <view class="centerdispley" bindtap="gosub">确认</view>
+    </view>
+</view>

+ 69 - 0
pages/take/thaw.wxss

@@ -0,0 +1,69 @@
+/* pages/take/thaw.wxss */
+page{
+    background: #f8f8f8;
+}
+.header_view{
+    margin-bottom: 20rpx;
+    background: #fff;
+    padding: 40rpx 0;
+    text-align: center;
+    font-size: 28rpx;
+    font-weight: bold;
+    color: #333;
+}
+.content_view{
+    padding: 40rpx 60rpx 60rpx;
+    background: #fff;
+}
+.content_view>view:nth-child(1),.content_view>view:nth-child(3){
+    margin-bottom: 40rpx;
+    font-size: 30rpx;
+    font-weight: bold;
+    color: #333;
+}
+.content_view>view:nth-child(3){
+    margin-top: 90rpx;
+}
+.content_view>view:nth-child(2)>view{
+    font-size: 26rpx;
+    color: #666;
+    margin-bottom: 30rpx;
+}
+.content_view>view:nth-child(4){
+    margin-bottom: 30rpx;
+    width: 100%;
+    background: #f6f6f6;
+    font-size: 26rpx;
+    color: #333;
+}
+.textarea_view{
+    width: calc(100% - 60rpx);
+    padding: 30rpx;
+    height: 180rpx;
+}
+.content_view>view:nth-child(5){
+    margin-bottom: 128rpx;
+    font-size: 26rpx;
+    color: #666;
+}
+.content_view>view:nth-child(6){
+    margin-bottom: 42rpx;
+    font-size: 24rpx;
+    color: #FF7300;
+}
+.content_view>view:nth-child(7){
+    width: 100%;
+}
+.content_view>view:nth-child(7)>view{
+    width: 260rpx;
+    height: 90rpx;
+    border: 1rpx solid #ccc;
+    font-size: 30rpx;
+    color: #333;
+    border-radius: 4rpx;
+}
+.content_view>view:nth-child(7)>view:nth-child(2){
+    border: 1rpx solid #52A1FF;
+    background: #52A1FF;
+    color: #fff;
+}